:root {
  --bg: #f2f4f7;
  --panel: #ffffff;
  --border: #e2e6ec;
  --text: #1c2430;
  --text-dim: #6b7686;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, .12);
  --danger: #e5484d;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 4px 16px rgba(16, 24, 40, .06);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* app is hidden until a PDF is opened; the landing page shows instead */
#app { display: none; flex-direction: column; height: 100vh; }
body.has-doc #app { display: flex; }
body.has-doc #landing { display: none; }

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; min-width: 0; }
.doc-name {
  font-size: 14.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 280px;
}
.top-center { display: flex; align-items: center; gap: 6px; }
.zoom-label { font-size: 12.5px; color: var(--text-dim); min-width: 44px; text-align: center; }
.file-controls { display: flex; gap: 8px; }

.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  width: 32px; height: 32px;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
}
.icon-btn:hover:not(:disabled) { background: #eef1f5; }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }

.btn {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: #f4f6f9; border-color: #cfd6e0; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: #2f6fe0; }
.btn-danger { color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: rgba(229,72,77,.08); border-color: var(--danger); }
.btn-block { width: 100%; }

/* ---------- layout ---------- */
#body { flex: 1; display: flex; overflow: hidden; }

#sidebar {
  width: 168px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}
.thumb-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.side-thumb {
  position: relative;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  cursor: pointer;
  background: #fff;
}
.side-thumb.active { border-color: var(--accent); }
.side-thumb.drag-over { border-color: #2fd6c0; }
.side-thumb canvas { width: 100%; display: block; border-radius: 3px; }
.side-thumb .pg-num {
  position: absolute; left: -2px; bottom: -2px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 6px; font-size: 10.5px; color: var(--text-dim);
  padding: 1px 6px;
}
.side-thumb .thumb-mini-actions {
  position: absolute; top: 4px; right: 4px; display: none; gap: 3px;
}
.side-thumb:hover .thumb-mini-actions { display: flex; }
.thumb-mini-actions button {
  width: 22px; height: 22px; border-radius: 5px;
  border: 1px solid var(--border); background: #fff;
  font-size: 11px; cursor: pointer; padding: 0;
}
.thumb-mini-actions button:hover { background: #f0f3f7; }

#workspace { flex: 1; position: relative; overflow: hidden; display: flex; flex-direction: column; }

/* ---------- floating toolbar ---------- */
.float-toolbar-wrap {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 32px);
}
.float-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px 8px;
  overflow-x: auto;
}
.tb-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 11px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.tb-btn:hover:not(:disabled) { background: #f0f3f7; }
.tb-btn.active { background: var(--accent-soft); color: var(--accent); }
.tb-btn:disabled { opacity: .4; cursor: not-allowed; }
.tb-ico { font-size: 16px; line-height: 1; }
.tb-sep { width: 1px; align-self: stretch; margin: 4px 5px; background: var(--border); }

.context-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px 12px;
}
.sep { width: 1px; height: 20px; background: var(--border); }
.spacer { flex: 1; }
.hint { color: var(--text-dim); font-size: 12px; }

.tool-btn {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  cursor: pointer;
}
.tool-btn:hover { border-color: #cfd6e0; }
.tool-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.tool-inline { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-dim); }
.tool-inline input[type=color] { width: 28px; height: 24px; padding: 0; border: none; background: none; cursor: pointer; }
.tool-inline select, .tool-inline input[type=number] {
  border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; font-size: 12.5px; background: #fff; color: var(--text);
}

/* ---------- views ---------- */
.view { display: none; flex: 1; overflow: hidden; }
.view.active { display: flex; }

.page-stage {
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 96px 24px 40px;
}
.page-wrap {
  position: relative;
  background: #fff;
  box-shadow: var(--shadow);
  line-height: 0;
}
.page-wrap canvas { display: block; }
.overlay-canvas { position: absolute; top: 0; left: 0; touch-action: none; z-index: 5; }
.overlay-canvas.tool-draw { cursor: crosshair; }
.overlay-canvas.tool-text { cursor: text; }
.overlay-canvas.tool-field { cursor: copy; }
/* in Select mode the overlay passes clicks through to the text layer below */
.overlay-canvas.tool-select { pointer-events: none; }

/* ---------- selectable text layer (pdf.js) ---------- */
.text-layer {
  position: absolute; top: 0; left: 0;
  overflow: hidden;
  line-height: 1;
  z-index: 4;
  text-size-adjust: none;
  forced-color-adjust: none;
}
.text-layer span, .text-layer br {
  color: transparent;
  position: absolute;
  white-space: pre;
  cursor: text;
  transform-origin: 0% 0%;
}
.text-layer span:hover {
  background: rgba(59, 130, 246, .12);
  outline: 1px dashed rgba(59, 130, 246, .55);
  border-radius: 2px;
}
.text-layer ::selection { background: rgba(59, 130, 246, .35); }

.whiteout-box {
  position: absolute;
  background: #fff;
  z-index: 6;
  cursor: move;
}
.whiteout-box:hover { outline: 1px dashed rgba(229, 72, 77, .6); }

.text-box {
  position: absolute;
  z-index: 7;
  min-width: 24px;
  min-height: 1.1em;
  outline: none;
  border: 1px dashed rgba(59,130,246,.55);
  padding: 2px 4px;
  white-space: pre-wrap;
  cursor: move;
  line-height: 1.2;
}
.text-box:focus { border-style: solid; cursor: text; }

.stamp-box { position: absolute; z-index: 7; cursor: move; border: 1px dashed rgba(47,214,192,.8); }
.stamp-box img { width: 100%; height: 100%; display: block; pointer-events: none; }
.stamp-resize {
  position: absolute; right: -6px; bottom: -6px;
  width: 12px; height: 12px; background: #2fd6c0;
  border-radius: 3px; cursor: nwse-resize;
}

.field-box {
  position: absolute;
  z-index: 7;
  border: 1.5px dashed var(--accent);
  background: var(--accent-soft);
  cursor: move;
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; color: var(--accent);
  overflow: hidden;
}
.field-resize {
  position: absolute; right: -6px; bottom: -6px;
  width: 12px; height: 12px; background: var(--accent);
  border-radius: 3px; cursor: nwse-resize;
}

.item-delete {
  position: absolute; top: -10px; right: -10px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--danger); color: #fff; border: none;
  font-size: 11px; line-height: 17px; text-align: center; padding: 0;
  cursor: pointer; display: none;
}
.text-box:hover .item-delete, .stamp-box:hover .item-delete, .field-box:hover .item-delete { display: block; }

/* ---------- organize grid ---------- */
.thumb-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  padding: 110px 24px 24px;
  align-content: start;
}
.thumb-card {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  cursor: grab;
  position: relative;
  user-select: none;
  box-shadow: var(--shadow);
}
.thumb-card.selected { border-color: var(--accent); }
.thumb-card.drag-over { border-color: #2fd6c0; }
.thumb-card canvas { width: 100%; display: block; border-radius: 4px; }
.thumb-card .thumb-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 11.5px; color: var(--text-dim); }
.thumb-card input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; }

/* ---------- compare ---------- */
.compare-stage {
  flex: 1; overflow: auto; padding: 110px 24px 24px;
  display: flex; gap: 16px; justify-content: center; align-items: flex-start;
}
.compare-pane { text-align: center; }
.compare-pane .cmp-title { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.compare-pane canvas { background: #fff; box-shadow: var(--shadow); max-width: 100%; }
.cmp-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* ---------- landing / home page ---------- */
#landing { min-height: 100vh; }
#landing section { scroll-margin-top: 76px; }

.btn-lg { padding: 12px 26px; font-size: 15px; border-radius: 10px; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 24px;
  padding: 0 clamp(16px, 5vw, 48px);
  height: 62px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none;
}
.site-brand b { color: var(--accent); }
.site-nav { display: flex; gap: 22px; margin-left: auto; }
.site-nav a { color: var(--text-dim); text-decoration: none; font-size: 14px; font-weight: 500; }
.site-nav a:hover { color: var(--accent); }

.hero {
  text-align: center;
  padding: clamp(48px, 8vw, 88px) 20px 56px;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(59, 130, 246, .10), transparent 70%),
    linear-gradient(180deg, #f8fafd 0%, var(--bg) 100%);
}
.hero-eyebrow {
  display: inline-block;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 999px; padding: 6px 16px;
  font-size: 13px; font-weight: 600; margin: 0 0 18px;
}
.hero h1 {
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1.08; letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.hero-sub {
  max-width: 640px; margin: 0 auto 34px;
  color: var(--text-dim); font-size: clamp(15px, 2vw, 17.5px); line-height: 1.6;
}

.hero-drop {
  max-width: 560px; margin: 0 auto;
  border: 2px dashed #b9c5d6; border-radius: 18px;
  background: var(--panel);
  padding: 36px 32px 26px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.hero-drop:hover, .hero-drop.drag-active { border-color: var(--accent); background: #f5f9ff; }
.hero-drop svg { display: block; margin: 0 auto 14px; }
.drop-hint { color: var(--text-dim); font-size: 14px; margin: 14px 0 4px; }
.drop-privacy { color: #16a34a; font-size: 13px; margin: 10px 0 0; font-weight: 500; }

.trust-strip {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px;
  list-style: none; padding: 0; margin: 30px auto 0;
  color: var(--text-dim); font-size: 13.5px; font-weight: 500;
}

.section { max-width: 1080px; margin: 0 auto; padding: clamp(48px, 7vw, 80px) 20px; }
.section h2 {
  text-align: center;
  font-size: clamp(24px, 4vw, 34px); letter-spacing: -0.015em;
  margin: 0 0 12px;
}
.section-sub { text-align: center; color: var(--text-dim); margin: 0 auto 40px; max-width: 560px; }
.section-alt {
  max-width: none;
  background: #eef2f8;
}
.section-alt > * { max-width: 1080px; margin-left: auto; margin-right: auto; }
.section-alt h2 { margin-bottom: 36px; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 36px;
}
.feature-card {
  background: var(--panel);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 20px;
  box-shadow: var(--shadow);
}
.feature-card .f-ico { font-size: 26px; display: block; margin-bottom: 10px; }
.feature-card h3 { margin: 0 0 8px; font-size: 16.5px; }
.feature-card p { margin: 0; color: var(--text-dim); font-size: 13.8px; line-height: 1.55; }
.feature-card h3 a { color: inherit; text-decoration: none; }
.feature-card h3 a:hover { color: var(--accent); text-decoration: underline; }
.feature-card p a { color: var(--text-dim); text-decoration: underline; text-decoration-color: #c3cddc; }
.feature-card p a:hover { color: var(--accent); }

.steps {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px; list-style: none; padding: 0 20px; margin: 0 auto;
}
.steps li { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 26px 22px; box-shadow: var(--shadow); }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 16px;
  margin-bottom: 12px;
}
.steps h3 { margin: 0 0 8px; font-size: 17px; }
.steps p { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.55; }

.privacy-cols {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px; margin-top: 28px;
}
.privacy-cols p { margin: 0; color: var(--text-dim); font-size: 15px; line-height: 1.7; }
.privacy-cols strong { color: var(--text); }

.table-wrap { overflow-x: auto; padding: 0 20px; }
.compare-table {
  width: 100%; max-width: 860px; margin: 0 auto;
  border-collapse: collapse; background: var(--panel);
  border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow); font-size: 14.5px;
}
.compare-table th, .compare-table td { padding: 13px 18px; text-align: left; border-bottom: 1px solid var(--border); }
.compare-table thead th { background: #f6f8fb; font-size: 13.5px; }
.compare-table thead th:nth-child(2) { color: var(--accent); }
.compare-table tbody th { color: var(--text-dim); font-weight: 600; width: 30%; }
.compare-table td:nth-child(2) { color: #15803d; font-weight: 600; }
.compare-table td:nth-child(3) { color: var(--text-dim); }
.compare-table tr:last-child th, .compare-table tr:last-child td { border-bottom: none; }

.faq-list { max-width: 760px; margin: 32px auto 0; }
.faq-list details {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 20px; margin-bottom: 12px;
}
.faq-list summary {
  cursor: pointer; font-weight: 600; font-size: 15.5px;
  list-style: none; position: relative; padding-right: 28px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+"; position: absolute; right: 2px; top: 50%;
  transform: translateY(-50%); color: var(--accent); font-size: 20px; font-weight: 500;
}
.faq-list details[open] summary::after { content: "–"; }
.faq-list details p { color: var(--text-dim); font-size: 14.5px; line-height: 1.65; margin: 12px 0 2px; }

.site-footer { background: #1c2430; color: #c6cfdc; padding: 44px 20px; }
.footer-inner { max-width: 1080px; margin: 0 auto; text-align: center; }
.footer-inner p { margin: 0 0 12px; font-size: 14.5px; }
.footer-inner strong { color: #fff; }
.footer-inner nav { margin-bottom: 14px; font-size: 14px; }
.footer-inner nav a { color: #9fb2cc; text-decoration: none; margin: 0 4px; }
.footer-inner nav a:hover { color: #fff; }
.footer-copy { color: #7c8aa0; font-size: 12.5px; }

@media (max-width: 720px) {
  .site-nav { display: none; }
  .hero-drop { padding: 28px 18px 20px; }
}

/* ---------- SEO / content pages ---------- */
.hero-article { padding-bottom: 40px; }
.answer-block {
  max-width: 720px; margin: 0 auto 26px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 18px 22px;
  text-align: left;
  box-shadow: var(--shadow);
}
.answer-block p { margin: 0; font-size: 15.5px; line-height: 1.65; color: var(--text); }
.hint-link { color: var(--text-dim); font-size: 13.5px; margin-top: 14px; }
.hint-link a { color: var(--accent); }

.tools-links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  max-width: 860px; margin: 28px auto 0;
}
.tools-links a {
  display: inline-block;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 16px;
  color: var(--text); text-decoration: none; font-size: 13.5px; font-weight: 500;
  transition: border-color .15s, color .15s;
}
.tools-links a:hover { border-color: var(--accent); color: var(--accent); }

.check-list, .cross-list {
  max-width: 720px; margin: 20px auto 0; padding: 0 0 0 4px;
  list-style: none; font-size: 15px; line-height: 1.7; color: var(--text);
}
.check-list li, .cross-list li { padding-left: 28px; position: relative; margin-bottom: 10px; }
.check-list li::before { content: "✔"; position: absolute; left: 0; color: #16a34a; font-weight: 700; }
.cross-list li::before { content: "—"; position: absolute; left: 0; color: #d97706; font-weight: 700; }

.article-body { max-width: 760px; margin: 0 auto; }
.article-body p { color: var(--text-dim); font-size: 15.5px; line-height: 1.75; }
.article-body p strong { color: var(--text); }
.article-body h2 { text-align: left; font-size: 22px; margin: 34px 0 10px; }
.article-body h2:first-child { margin-top: 0; }
.article-body ul { margin: 12px 0; }
.article-body a { color: var(--accent); }

.steps-vertical { grid-template-columns: 1fr; max-width: 720px; }

.card-link { text-decoration: none; color: inherit; display: block; transition: border-color .15s, transform .15s; }
.card-link:hover { border-color: var(--accent); transform: translateY(-2px); }

.footer-tools { margin-bottom: 16px; font-size: 13px; line-height: 2; }
.footer-tools a { color: #9fb2cc; text-decoration: none; margin: 0 4px; white-space: nowrap; }
.footer-tools a:hover { color: #fff; }

.home-tools { padding-top: 0; }

.shot-section { text-align: center; }
.shot-frame {
  display: block;
  width: min(920px, 100%);
  height: auto;
  margin: 28px auto 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 44px rgba(16, 24, 40, .14);
}

/* ---------- OCR modal ---------- */
.modal-check { display: flex; margin: 10px 0; font-size: 13.5px; color: var(--text); }
.ocr-progress { min-height: 18px; font-weight: 500; }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 60; }
.modal.hidden { display: none; }
.modal-content {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px; width: min(560px, 92vw); max-height: 86vh; overflow-y: auto;
  box-shadow: 0 10px 40px rgba(16,24,40,.2);
}
.modal-wide { width: min(680px, 94vw); }
.modal-content h3 { margin: 0 0 12px; }
.modal-hint { color: var(--text-dim); font-size: 12.5px; }
.modal-hint code { background: #eef1f5; padding: 1px 5px; border-radius: 4px; }
.modal-input {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 11px; font-size: 13.5px; margin: 6px 0 10px; background: #fff; color: var(--text);
}
.modal-label { display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 4px; }
.modal-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.modal-grid label { font-size: 12.5px; color: var(--text-dim); display: flex; flex-direction: column; gap: 4px; }
.modal-grid input, .modal-grid select {
  border: 1px solid var(--border); border-radius: 7px; padding: 7px 9px; font-size: 13px; background: #fff; color: var(--text);
}
.pill-toggle { display: flex; gap: 6px; margin-bottom: 14px; }

#sigCanvas { background: #fff; border: 1px solid var(--border); border-radius: 8px; touch-action: none; cursor: crosshair; max-width: 100%; }

.convert-row {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.convert-row:last-of-type { border-bottom: none; }

.autofill-fields { max-height: 320px; overflow-y: auto; margin: 12px 0; }
.af-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; padding: 6px 0; }
.af-row .af-name { font-size: 12.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.af-row input[type=text] { border: 1px solid var(--border); border-radius: 7px; padding: 6px 8px; font-size: 13px; }
.af-matched { font-size: 10.5px; color: #16a34a; }

#profileDetails { margin-bottom: 8px; }
#profileDetails summary { cursor: pointer; font-size: 13px; color: var(--text-dim); }

/* ---------- AI panel ---------- */
.ai-panel {
  position: fixed; top: 64px; right: 16px; bottom: 16px; width: 340px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 10px 40px rgba(16,24,40,.18);
  padding: 16px; z-index: 55;
  display: flex; flex-direction: column; gap: 10px;
}
.ai-panel.hidden { display: none; }
.ai-header { display: flex; align-items: center; justify-content: space-between; }
.ai-question {
  width: 100%; min-height: 72px; resize: vertical;
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px;
  font-size: 13.5px; font-family: inherit;
}
.ai-answer {
  flex: 1; overflow-y: auto; font-size: 13.5px; line-height: 1.5;
  white-space: pre-wrap; background: #f7f9fc; border-radius: 8px; padding: 10px;
}

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #1c2430; color: #fff;
  padding: 10px 18px; border-radius: 8px; font-size: 13px; z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
}
.toast.hidden { display: none; }
.toast.error { background: var(--danger); }
