:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #0f9d8a;
  --accent-2: #0b7f70;
  --accent-ink: #ffffff;
  --accent-soft: rgba(15, 157, 138, .12);
  --danger: #dc2626;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .08);
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f14;
    --surface: #131a22;
    --surface-2: #1b242e;
    --ink: #e8eef5;
    --muted: #8a98a8;
    --line: #243040;
    --accent: #2dd4bf;
    --accent-2: #5eead4;
    --accent-ink: #052b26;
    --accent-soft: rgba(45, 212, 191, .14);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
svg.ic { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[data-icon] { display: inline-flex; line-height: 0; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }

/* ---------- Views ---------- */
.view { position: fixed; inset: 0; display: none; flex-direction: column; background: var(--bg); }
.view.active { display: flex; }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.container { max-width: 1080px; margin: 0 auto; padding: 8px 20px calc(40px + var(--safe-b)); }

/* ---------- Topbar & buttons ---------- */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  flex: none;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; letter-spacing: -.01em; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.pill { font-size: 12px; color: var(--muted); background: var(--surface-2); padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.pill.ok { color: var(--accent); background: var(--accent-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  height: 40px; padding: 0 16px; border-radius: 12px; cursor: pointer; font-weight: 600; white-space: nowrap;
  transition: transform .08s, background .15s, border-color .15s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.lg { height: 50px; padding: 0 22px; font-size: 16px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn svg.ic { font-size: 18px; }
.btn:disabled { opacity: .5; pointer-events: none; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; cursor: pointer;
  display: inline-grid; place-items: center; flex: none; font-size: 20px;
}
.icon-btn:hover { background: var(--surface-2); }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 4px 0; font-weight: 600; }

/* ---------- Home ---------- */
.hero { display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: 24px; padding: 36px 0 28px; }
.hero h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.1; letter-spacing: -.03em; font-weight: 800; }
.hero h1 span { color: var(--accent); }
.hero-copy > p { color: var(--muted); font-size: 17px; margin: 16px 0 24px; max-width: 520px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: 13px; margin-top: 14px; }
.hero-art { display: grid; place-items: center; }
.hero-art svg { width: min(100%, 300px); filter: drop-shadow(0 18px 30px rgba(15, 23, 42, .18)); }
.art-paper { fill: var(--surface); stroke: var(--line); }
.art-ink { fill: var(--ink); opacity: .85; }
.art-line { fill: var(--line); }
.art-box { fill: var(--accent-soft); stroke: var(--accent); stroke-dasharray: 4 4; }
.art-frame { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.art-dot circle { fill: var(--surface); stroke: var(--accent); stroke-width: 3.5; }

.section-head { display: flex; align-items: baseline; gap: 12px; margin: 20px 0 14px; }
.section-head h2 { font-size: 20px; letter-spacing: -.01em; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }
.doc-card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.doc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.doc-thumb { aspect-ratio: 3/4; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.doc-card .badge { position: absolute; top: 8px; left: 8px; background: rgba(15, 23, 42, .72); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; backdrop-filter: blur(6px); }
.doc-info { padding: 10px 12px 12px; }
.doc-info h3 { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-info p { font-size: 12px; color: var(--muted); }
.card-acts { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.card-acts .icon-btn { width: 32px; height: 32px; font-size: 16px; border-radius: 10px; background: rgba(15, 23, 42, .66); color: #fff; backdrop-filter: blur(6px); }
.card-acts .icon-btn:hover { background: rgba(15, 23, 42, .85); }
.doc-card:hover .card-acts, .card-acts:focus-within { opacity: 1; }
@media (hover: none) { .card-acts { opacity: 1; } }
.empty { text-align: center; color: var(--muted); padding: 36px 0; display: grid; justify-items: center; gap: 10px; border: 1.5px dashed var(--line); border-radius: var(--radius); }
.features { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.features li { display: flex; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.features li > svg, .features li > [data-icon] { color: var(--accent); font-size: 22px; margin-top: 2px; }
.features b { display: block; }
.features span { color: var(--muted); font-size: 13px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 28px; }
.drop-active::after {
  content: "Thả ảnh để quét"; position: fixed; inset: 12px; z-index: 50; display: grid; place-items: center;
  border: 3px dashed var(--accent); border-radius: 24px; background: color-mix(in srgb, var(--bg) 85%, transparent);
  font-size: 22px; font-weight: 700; color: var(--accent); pointer-events: none;
}

/* ---------- Camera ---------- */
.view.cam { background: #000; color: #fff; }
.cam-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #000; }
.cam-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cam-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cam-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: calc(12px + var(--safe-t)) 14px 12px; background: linear-gradient(#0008, transparent); }
.cam-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; display: inline-grid; place-items: center; cursor: pointer; font-size: 20px; backdrop-filter: blur(8px); }
.cam-btn.lg { width: 52px; height: 52px; }
.cam-btn.on { background: #facc15; color: #000; }
.cam-chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 99px; border: 0; background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer; font-size: 13px; font-weight: 600; backdrop-filter: blur(8px); }
.cam-chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.cam-hint { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); background: rgba(0, 0, 0, .55); padding: 6px 14px; border-radius: 99px; font-size: 13px; backdrop-filter: blur(6px); white-space: nowrap; transition: background .2s; }
.cam-hint.ok { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.cam-error { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 14px; padding: 32px; text-align: center; background: #0b0f14; }
.cam-error p { max-width: 420px; color: #cbd5e1; }
.cam-bottom { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 14px 28px calc(14px + var(--safe-b)); background: #000; }
.shutter { width: 76px; height: 76px; border-radius: 50%; border: 4px solid #fff; background: transparent; padding: 4px; cursor: pointer; }
.shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: transform .1s; }
.shutter:active span { transform: scale(.88); }
.cam-done { position: relative; width: 52px; height: 52px; border: 0; background: transparent; color: #fff; cursor: pointer; padding: 0; }
.done-thumb { position: absolute; inset: 0; border-radius: 12px; background: #1f2937 center/cover no-repeat; border: 2px solid #fff; }
.done-count { position: absolute; top: -8px; right: -8px; min-width: 22px; height: 22px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; display: grid; place-items: center; padding: 0 6px; }
.done-label { position: absolute; left: 50%; bottom: -22px; transform: translateX(-50%); font-size: 12px; font-weight: 600; }
.cam-done:disabled { opacity: .35; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.go { animation: flash .35s ease-out; }
@keyframes flash { 0% { opacity: .85; } 100% { opacity: 0; } }

/* ---------- Editor ---------- */
.name-input { border: 1px solid transparent; background: transparent; font-weight: 700; font-size: 17px; padding: 6px 10px; border-radius: 10px; min-width: 0; flex: 1 1 200px; max-width: 420px; outline: none; }
.name-input:hover { background: var(--surface-2); }
.name-input:focus { border-color: var(--accent); background: var(--surface); }
.ed-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 116px 1fr 320px; }
.ed-thumbs { overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; border-right: 1px solid var(--line); background: var(--surface); }
.thumb { position: relative; flex: none; border: 2px solid transparent; border-radius: 10px; padding: 0; background: var(--surface-2); cursor: pointer; overflow: hidden; aspect-ratio: 3/4; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.thumb span { position: absolute; bottom: 4px; left: 4px; background: rgba(15, 23, 42, .75); color: #fff; font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 99px; }
.thumb.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.ed-stage { position: relative; min-width: 0; min-height: 0; background: var(--surface-2); }
.stage-inner { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; }
#preview { max-width: 100%; max-height: 100%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .1), 0 18px 48px rgba(0, 0, 0, .22); border-radius: 2px; }
.nav-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; font-size: 20px; }
.nav-btn.prev { left: 14px; } .nav-btn.next { right: 14px; }
.nav-btn:disabled { opacity: 0; pointer-events: none; }
.page-ind { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); background: rgba(15, 23, 42, .75); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 99px; backdrop-filter: blur(6px); }
.stage-busy { position: absolute; top: 14px; right: 14px; background: var(--surface); border-radius: 99px; padding: 8px; box-shadow: var(--shadow); }

.ed-panel { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 18px; background: var(--surface); border-left: 1px solid var(--line); }
.ed-panel h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.filters { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; }
.chip { flex: none; width: 68px; background: none; border: 0; padding: 0; cursor: pointer; text-align: center; }
.chip canvas { display: block; width: 68px; height: 88px; object-fit: contain; border-radius: 10px; border: 2px solid var(--line); background: var(--surface-2); }
.chip span { display: block; font-size: 12px; margin-top: 5px; color: var(--muted); font-weight: 600; }
.chip.on canvas { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chip.on span { color: var(--accent); }
.adjust summary { cursor: pointer; list-style: none; } .adjust summary::-webkit-details-marker { display: none; }
.adjust summary h4 { margin-bottom: 8px; }
.slider { display: grid; grid-template-columns: 78px 1fr 34px; align-items: center; gap: 8px; font-size: 13px; margin: 6px 0; }
.slider output { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 4px; background: var(--line); border-radius: 4px; outline: none; width: 100%; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 1px 4px rgba(0, 0, 0, .3); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); cursor: pointer; }
.tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tool { display: grid; justify-items: center; gap: 4px; padding: 10px 2px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; cursor: pointer; font-size: 11.5px; font-weight: 600; }
.tool svg.ic { font-size: 20px; }
.tool:hover { background: var(--surface-2); }
.tool.danger { color: var(--danger); }

/* ---------- Crop ---------- */
.view.dark { background: #0b0f14; color: #e8eef5; }
.view.dark .topbar { background: #0f151c; border-color: #1e2833; }
.view.dark .btn { background: #1b242e; border-color: #2a3644; color: #e8eef5; }
.view.dark .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.view.dark .btn.ghost { background: transparent; border-color: transparent; }
.crop-title { font-size: 15px; margin-left: 4px; }
.crop-wrap { flex: 1; min-height: 0; position: relative; }
#crop-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.crop-bar { flex: none; display: flex; justify-content: center; gap: 12px; padding: 12px 16px calc(12px + var(--safe-b)); background: #0f151c; border-top: 1px solid #1e2833; }

/* ---------- Dialog ---------- */
dialog { border: 0; padding: 0; border-radius: 20px; background: var(--surface); color: var(--ink); width: min(520px, calc(100vw - 24px)); box-shadow: 0 24px 80px rgba(0, 0, 0, .45); max-height: calc(100dvh - 24px); }
dialog::backdrop { background: rgba(2, 6, 12, .55); backdrop-filter: blur(3px); }
.dlg { padding: 18px 20px 20px; display: grid; gap: 14px; }
.dlg.wide { width: min(720px, 100%); }
dialog:has(.dlg.wide) { width: min(720px, calc(100vw - 24px)); }
.dlg header { display: flex; align-items: center; justify-content: space-between; }
.dlg h3 { font-size: 18px; }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.field input, .field select { height: 42px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 0 12px; color: var(--ink); font-weight: 500; outline: none; width: 100%; }
.field input:focus, .field select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.exp-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.exp-actions .btn { flex: 1 1 auto; }
textarea { width: 100%; min-height: 220px; resize: vertical; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px; outline: none; line-height: 1.55; }
.ocr-progress { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.bar { height: 6px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* ---------- Misc ---------- */
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.busy { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(2, 6, 12, .5); backdrop-filter: blur(3px); }
.busy-card { background: var(--surface); padding: 22px 28px; border-radius: 18px; display: grid; justify-items: center; gap: 12px; box-shadow: var(--shadow); min-width: 200px; }
.busy-card .spinner { width: 30px; height: 30px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 20px); background: #0f172a; color: #fff; padding: 10px 18px; border-radius: 99px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 200; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 20px; }
  .hero-art { display: none; }
  .btn .lbl { display: none; }
  .ed-body { display: flex; flex-direction: column; }
  .ed-stage { flex: 1; }
  .stage-inner { padding: 12px; }
  .ed-thumbs { order: 2; flex-direction: row; border-right: 0; border-top: 1px solid var(--line); padding: 8px 12px; min-height: 84px; overflow-x: auto; overflow-y: hidden; }
  .thumb { height: 64px; aspect-ratio: auto; width: 48px; }
  .ed-panel { order: 3; max-height: 40vh; border-left: 0; border-top: 1px solid var(--line); padding: 12px 14px calc(12px + var(--safe-b)); gap: 12px; }
  .adjust:not([open]) .slider { display: none; }
  .tools { display: flex; overflow-x: auto; }
  .tool { flex: none; width: 74px; }
  .nav-btn { display: none; }
}
@media (max-width: 480px) {
  .container { padding-inline: 14px; }
  .field-row { grid-template-columns: 1fr; }
}

/* ---------- Tinh chỉnh UX ---------- */
.crop-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(0,0,0,.6); color: #fff; font-size: 13px; padding: 6px 14px; border-radius: 99px; pointer-events: none; white-space: nowrap; }
.btn.primary { box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 35%, transparent); }
.doc-card:focus-visible, .btn:focus-visible, .icon-btn:focus-visible, .thumb:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media (max-width: 860px) {
  .ed-panel { max-height: 34vh; padding-top: 10px; }
  .ed-panel h4 { margin-bottom: 6px; }
  .ed-thumbs { min-height: 76px; }
  .thumb { height: 56px; width: 42px; }
  .name-input { font-size: 15px; flex-basis: 80px; }
  #ed-more { display: none; }
  .topbar { gap: 6px; padding-inline: 10px; }
  .hero { padding: 16px 0; }
  .hero h1 { font-size: 30px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .features { display: none; }
}

/* ---------- Nâng cấp ---------- */
.search { height: 38px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 0 12px; width: min(260px, 50vw); outline: none; }
.search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.no-result { grid-column: 1 / -1; text-align: center; padding: 24px 0; }
.toast.has-act { pointer-events: auto; display: flex; align-items: center; gap: 14px; padding-right: 8px; }
.toast-act { border: 0; background: rgba(255,255,255,.14); color: #5eead4; font-weight: 700; padding: 6px 12px; border-radius: 99px; cursor: pointer; }
.toast-act:hover { background: rgba(255,255,255,.24); }
#preview { cursor: zoom-in; }
.ed-stage.zoom .stage-inner { overflow: auto; display: block; text-align: center; }
.ed-stage.zoom #preview { max-width: none; max-height: none; cursor: zoom-out; }
.ed-stage.zoom .nav-btn { display: none; }
.thumb.drop { border-color: var(--accent); border-style: dashed; }
.thumb[draggable="true"] { cursor: grab; }
.apply-all { font-size: 13px; margin-top: 4px; }
@media (max-width: 520px) { .doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
@media (hover: none) and (pointer: coarse) { .hero .hint { display: none; } }
.paper-select { height: 32px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 9px; padding: 0 8px; font-size: 13px; }
.tool.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ---------- Hướng dẫn & Hỏi đáp (SEO/AEO) ---------- */
.seo-block { margin-top: 36px; }
.seo-block h2 { font-size: 20px; letter-spacing: -.01em; margin-bottom: 12px; }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; color: var(--ink); }
.steps li::marker { color: var(--accent); font-weight: 700; }
.qa { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; margin-bottom: 8px; }
.qa summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; color: var(--accent); font-weight: 700; }
.qa[open] summary::after { content: "–"; }
.qa p { margin: 0 0 14px; color: var(--muted); }
.foot a { color: inherit; }

.btn.pulse { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: pulse 1.6s ease-in-out 3; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px var(--accent-soft); } }
.guides { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.guides a { display: block; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 600; }
.guides a::after { content: " →"; color: var(--accent); }

/* nút chụp khi đang xử lý ảnh: vòng xoay + không bấm lặp */
.shutter.busy { pointer-events: none; border-color: var(--accent); }
.shutter.busy span { transform: scale(.55); background: var(--accent); animation: shot 0.9s ease-in-out infinite; }
@keyframes shot { 50% { transform: scale(.75); opacity: .6; } }
