/* HTML to PDF Converter Scoped Styles */

:root {
  --htpc-primary: #2563eb;
  --htpc-primary-hover: #1d4ed8;
  --htpc-surface: #ffffff;
  --htpc-bg: #f8fafc;
  --htpc-border: #e2e8f0;
  --htpc-text: #0f172a;
  --htpc-text-muted: #64748b;
  --htpc-success: #16a34a;
  --htpc-success-bg: #dcfce7;
  --htpc-radius: 8px;
  --htpc-font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --htpc-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  line-height: 1.5;
}

.htpc-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

.htpc-site-header {
  background: var(--htpc-surface);
  border-bottom: 1px solid var(--htpc-border);
  padding: 14px 0;
}

.htpc-header-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.htpc-brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--htpc-primary);
  text-decoration: none;
}

.htpc-header-badge {
  font-size: 0.8rem;
  font-weight: 600;
  background: #eff6ff;
  color: var(--htpc-primary);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid #bfdbfe;
}

.htpc-intro-section {
  padding: 32px 0 20px;
}

.htpc-title {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 10px;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.htpc-lead {
  font-size: 1.05rem;
  color: var(--htpc-text-muted);
  max-width: 800px;
  margin: 0;
}

.htpc-main-content {
  padding-bottom: 40px;
}

/* Tabs */
.htpc-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--htpc-border);
  margin-bottom: 20px;
  overflow-x: auto;
}

.htpc-tab-btn {
  background: none;
  border: none;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--htpc-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.htpc-tab-btn:hover {
  color: var(--htpc-primary);
}

.htpc-tab-btn-active {
  color: var(--htpc-primary);
  border-bottom-color: var(--htpc-primary);
}

.htpc-tab-panel {
  display: block;
}

.htpc-tab-panel[hidden] {
  display: none;
}

.htpc-tab-panel-active {
  display: block;
}

/* Toolbar */
.htpc-toolbar {
  background: var(--htpc-surface);
  border: 1px solid var(--htpc-border);
  border-radius: var(--htpc-radius);
  padding: 12px 18px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.htpc-toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.htpc-toolbar-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}

.htpc-select-sm {
  padding: 6px 10px;
  font-size: 0.85rem;
  border: 1px solid var(--htpc-border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--htpc-text);
  outline: none;
}

.htpc-toolbar-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
}

@media (max-width: 768px) {
  .htpc-toolbar-actions {
    margin-left: 0;
    width: 100%;
  }
}

/* Split View */
.htpc-split-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .htpc-split-view {
    grid-template-columns: 1fr;
  }
}

.htpc-editor-pane,
.htpc-preview-pane {
  background: var(--htpc-surface);
  border: 1px solid var(--htpc-border);
  border-radius: var(--htpc-radius);
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.htpc-pane-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--htpc-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border-radius: var(--htpc-radius) var(--htpc-radius) 0 0;
}

.htpc-pane-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #334155;
}

.htpc-code-editor {
  width: 100%;
  min-height: 480px;
  padding: 14px;
  font-family: var(--htpc-mono);
  font-size: 0.85rem;
  border: none;
  resize: vertical;
  background: #ffffff;
  color: var(--htpc-text);
  outline: none;
  line-height: 1.5;
}

/* Paper Preview Area */
.htpc-paper-viewport {
  background: #cbd5e1;
  padding: 24px;
  min-height: 480px;
  overflow-x: auto;
  display: flex;
  justify-content: center;
}

.htpc-sheet {
  background: #ffffff;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  padding: 20mm;
  width: 100%;
  max-width: 480px;
  min-height: 600px;
  transition: all 0.2s ease;
  overflow: hidden;
}

.htpc-paper-a4 {
  aspect-ratio: 1 / 1.414;
}

.htpc-paper-letter {
  aspect-ratio: 8.5 / 11;
}

.htpc-paper-landscape {
  aspect-ratio: 1.414 / 1;
  max-width: 640px;
}

.htpc-margin-compact {
  padding: 10mm;
}

.htpc-margin-zero {
  padding: 4px;
}

/* Card */
.htpc-card {
  background: var(--htpc-surface);
  border: 1px solid var(--htpc-border);
  border-radius: var(--htpc-radius);
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.htpc-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--htpc-border);
  padding-bottom: 12px;
}

.htpc-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.htpc-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.htpc-badge-info {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.htpc-badge-neutral {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.htpc-badge-success {
  background: var(--htpc-success-bg);
  color: var(--htpc-success);
}

/* Buttons */
.htpc-btn {
  padding: 9px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--htpc-radius);
  border: none;
  cursor: pointer;
  transition: background-color 0.15s;
  white-space: nowrap;
}

.htpc-btn-primary {
  background: var(--htpc-primary);
  color: #ffffff;
}

.htpc-btn-primary:hover {
  background: var(--htpc-primary-hover);
}

.htpc-btn-secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.htpc-btn-secondary:hover {
  background: #e2e8f0;
}

.htpc-btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  cursor: pointer;
}

.htpc-btn-sm:hover {
  background: #e2e8f0;
}

.htpc-btn-xs {
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  cursor: pointer;
}

.htpc-btn-xs:hover {
  background: #e2e8f0;
}

.htpc-btn-block {
  width: 100%;
}

.htpc-hint {
  font-size: 0.85rem;
  color: var(--htpc-text-muted);
  margin: 0;
}

/* Template Grid */
.htpc-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.htpc-template-card {
  border: 1px solid var(--htpc-border);
  border-radius: var(--htpc-radius);
  padding: 20px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.htpc-template-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: #0f172a;
}

.htpc-template-desc {
  font-size: 0.85rem;
  color: var(--htpc-text-muted);
  margin: 0 0 16px;
  flex-grow: 1;
}

/* Guide */
.htpc-guide-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: #0f172a;
}

.htpc-guide-content p {
  font-size: 0.9rem;
  color: #475569;
  margin: 0 0 14px;
}

.htpc-code-snippet {
  background: #0f172a;
  color: #38bdf8;
  padding: 16px;
  border-radius: 6px;
  font-family: var(--htpc-mono);
  font-size: 0.85rem;
  overflow-x: auto;
  line-height: 1.4;
  margin: 0;
}

/* AdSense Container */
.htpc-ad-container {
  min-height: 280px;
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--htpc-text-muted);
  font-size: 0.85rem;
  margin: 24px 0;
  border-radius: var(--htpc-radius);
}

/* Disclaimer & Guide */
.htpc-disclaimer {
  background: #fffbeb;
  border-top: 1px solid #fef3c7;
  border-bottom: 1px solid #fef3c7;
  padding: 18px 0;
  margin-top: 24px;
}

.htpc-disclaimer-text {
  font-size: 0.85rem;
  color: #92400e;
  margin: 0;
}

.htpc-guide-section {
  padding: 36px 0;
  background: var(--htpc-surface);
  border-bottom: 1px solid var(--htpc-border);
}

.htpc-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.htpc-guide-card {
  border: 1px solid var(--htpc-border);
  border-radius: var(--htpc-radius);
  padding: 18px;
  background: #f8fafc;
}

.htpc-guide-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--htpc-primary);
}

.htpc-guide-card p {
  margin: 0;
  font-size: 0.85rem;
  color: #475569;
}

.htpc-faq-section {
  padding: 36px 0;
}

.htpc-faq-item {
  margin-bottom: 18px;
}

.htpc-faq-q {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: #0f172a;
}

.htpc-faq-a {
  font-size: 0.9rem;
  color: #475569;
  margin: 0;
}

.htpc-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 24px 0;
  text-align: center;
  font-size: 0.85rem;
}

.htpc-footer p {
  margin: 0;
}

.htpc-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #0f172a;
  color: #f8fafc;
  padding: 12px 0;
  font-size: 0.85rem;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
}

.htpc-consent-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
/* tf:dark-palette — generated by migrate_chrome.py */
/* Neutrals inherit the shared chrome tokens so all tools share one
   ground; brand hues are kept and lightened, never inverted. */
[data-theme="dark"] {
  --htpc-primary: #819dda;
  --htpc-primary-hover: #8198da;
  --htpc-surface: var(--tf-surface);
  --htpc-bg: var(--tf-surface);
  --htpc-border: var(--tf-surface);
  --htpc-text: var(--tf-ink);
  --htpc-text-muted: var(--tf-ink-faint);
  --htpc-success: #7ad89d;
  --htpc-success-bg: var(--tf-surface);
}
