:root {
  --bg: #f3f4f6; --panel: #ffffff; --panel-2: #f8f9fb; --text: #111827; --muted: #6b7280; --line: #e5e7eb;
  --accent: #2563eb; --accent-soft: #e8efff; --accent-text: #ffffff;
  --warn: #b45309; --warn-bg: #fef3c7; --ok: #047857; --ok-bg: #d1fae5; --info: #1d4ed8; --info-bg: #dbeafe;
  --danger: #dc2626; --danger-bg: #fee2e2;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 1px 3px rgba(0,0,0,.06); --shadow-lg: 0 20px 50px rgba(0,0,0,.25);
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115; --panel: #181b21; --panel-2: #1f232b; --text: #e8eaee; --muted: #9aa1ad; --line: #2b3039;
    --accent: #4f8cff; --accent-soft: #1b2a47; --warn: #fbbf24; --warn-bg: #3a2c0b; --ok: #34d399; --ok-bg: #0d3326;
    --info: #93c5fd; --info-bg: #172a4a; --danger: #f87171; --danger-bg: #3b1515;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 20px 50px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  --bg: #0f1115; --panel: #181b21; --panel-2: #1f232b; --text: #e8eaee; --muted: #9aa1ad; --line: #2b3039;
  --accent: #4f8cff; --accent-soft: #1b2a47; --warn: #fbbf24; --warn-bg: #3a2c0b; --ok: #34d399; --ok-bg: #0d3326;
  --info: #93c5fd; --info-bg: #172a4a; --danger: #f87171; --danger-bg: #3b1515;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 20px 50px rgba(0,0,0,.6);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3 { margin: 0; }
button { font: inherit; color: inherit; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); padding: 7px 12px; cursor: pointer; transition: border-color .15s, background .15s; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.primary:hover:not(:disabled) { filter: brightness(1.08); }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover:not(:disabled) { background: var(--panel-2); border-color: var(--line); }
button.danger { color: var(--danger); }
button.icon { padding: 4px 8px; line-height: 1; }
input[type=number], input[type=text], textarea, select { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--text); font: inherit; }
textarea { resize: vertical; min-height: 64px; line-height: 1.5; display: block; }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12px; }
.spacer { flex: 1; }

/* App bar */
.appbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .logo { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.brand h1 { font-size: 17px; }
.brand p { margin: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.status { font-size: 12px; padding: 3px 10px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.status.ok { color: var(--ok); }
.status.warn { color: var(--warn); }
@media (max-width: 640px) { .brand p, .status.hide-sm { display: none; } .appbar { padding: 10px 16px; flex-wrap: wrap; } }
.seg.modes button { padding: 6px 12px; white-space: nowrap; }
@media (max-width: 640px) {
  .appbar { row-gap: 8px; } .appbar .brand { flex-basis: 100%; }
  /* iOS zooms the page when focusing a field with text under 16px. */
  input[type=number], input[type=text], textarea, select { font-size: 16px; }
  .stepper button { padding: 8px 14px; }
}

/* Layout */
.layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; padding: 20px; align-items: start; max-width: 1600px; margin: 0 auto; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; padding: 16px; } }
.sidebar { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; }
@media (max-width: 900px) { .sidebar { position: static; max-height: none; overflow: visible; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.card h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.card h2 .num { width: 18px; height: 18px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 11px; }
.field + .field { margin-top: 12px; }
.field > label, .field > .lbl { display: flex; justify-content: space-between; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field > label .val, .field > .lbl .val { font-weight: 500; color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field > label.check, .check { display: flex; justify-content: flex-start; gap: 8px; align-items: flex-start; font-size: 13px; font-weight: 400; padding: 3px 0; margin: 0; cursor: pointer; }
.row2 + .field { margin-top: 12px; }
.check input { margin-top: 3px; }
.check.disabled { opacity: .45; cursor: default; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row > button { flex: 1; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 600; font-size: 13px; cursor: pointer; }
.switch input { appearance: none; width: 36px; height: 20px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }
.swatches { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.swatches.disabled { opacity: .35; pointer-events: none; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); padding: 0; }
.swatch.active { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); }
.swatches input[type=color] { width: 32px; height: 30px; padding: 0; border: none; background: none; cursor: pointer; }

.sumbar { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; line-height: 1.3; }
.sumbar #sumText, .sumbar #labSum { font-weight: 600; }
.sumbar .note { font-size: 12px; color: var(--muted); }
.sumbar .note.warn { color: var(--warn); }
.sumbar .note.err { color: var(--danger); }
@media (max-width: 640px) { .sumbar { align-items: flex-start; order: 5; width: 100%; } #addBtn { display: none; } }

/* Main */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: none; background: none; border-radius: 7px; padding: 6px 14px; color: var(--muted); }
.seg button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 99px; background: var(--panel-2); font-size: 11px; line-height: 18px; text-align: center; color: var(--muted); }
.chips { display: inline-flex; gap: 6px; }
.chip { border-radius: 99px; padding: 5px 12px; font-size: 13px; }
.chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chip.warn.has b { color: var(--warn); }

.progress-top { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; box-shadow: var(--shadow); }
.progress-top .bar { height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progress-top .bar div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; font-size: 13px; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.info { background: var(--info-bg); color: var(--info); }
.banner span { flex: 1; }
.banner button { padding: 0 6px; border: none; background: none; color: inherit; font-size: 16px; }

.empty-drop { border: 2px dashed var(--line); border-radius: 16px; padding: 48px 24px; text-align: center; background: var(--panel); transition: .15s; }
.empty-drop .big { width: 56px; height: 56px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin: 0 auto 14px; }
.empty-drop h2 { font-size: 20px; margin-bottom: 6px; }
.empty-drop p { color: var(--muted); margin: 0 0 18px; }
.empty-drop .btn-row { justify-content: center; }
.empty-drop .btn-row > button { flex: none; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 32px; text-align: left; max-width: 760px; margin-left: auto; margin-right: auto; }
.steps div { background: var(--panel-2); border-radius: 10px; padding: 12px; font-size: 13px; color: var(--muted); }
.steps b { display: block; color: var(--text); margin-bottom: 2px; }
@media (max-width: 640px) { .steps { grid-template-columns: 1fr; } }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stepper button { border: none; border-radius: 0; padding: 3px 9px; background: var(--panel-2); }
.stepper span { min-width: 34px; text-align: center; font-size: 12px; }
.empty { color: var(--muted); padding: 40px; text-align: center; }

.pages { display: flex; flex-wrap: wrap; gap: 24px; }
.page { display: flex; flex-direction: column; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; }
.page canvas { width: min(440px, calc(100vw - 64px)); height: auto; background: #fff; box-shadow: 0 4px 18px rgba(0,0,0,.15); border-radius: 2px; }

.drop-overlay { position: fixed; inset: 0; z-index: 30; background: rgba(37,99,235,.12); backdrop-filter: blur(2px); display: grid; place-items: center; pointer-events: none; }
.drop-overlay div { background: var(--panel); border: 2px dashed var(--accent); color: var(--accent); font-weight: 600; font-size: 18px; padding: 28px 40px; border-radius: 16px; box-shadow: var(--shadow-lg); }

/* Editor */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
.modal.open { display: flex; }
/* Toasts */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 40; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: #1f2937; color: #f9fafb; border-radius: 10px; padding: 10px 14px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow-lg); font-size: 13px; animation: tin .2s ease-out; }
.toast button { background: none; border: none; color: #93c5fd; font-weight: 600; padding: 0; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* ---------- App shell ---------- */
.appbar .home-btn { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; flex: none; }
.brand { color: inherit; text-decoration: none; }
.brand .logo { background: var(--mod, var(--accent)); transition: background .25s, transform .25s; }
.brand:hover .logo { transform: rotate(-6deg) scale(1.05); }
.mod-actions { display: flex; gap: 8px; align-items: center; }
#modActions { display: contents; }
#helpBtn, #exportBtn { white-space: nowrap; }
.notices { max-width: 1600px; margin: 0 auto; padding: 0 20px; }
.notices .progress-top { margin: 16px 0 0; position: sticky; top: 70px; z-index: 4; }
.notices .banner { margin: 12px 0 0; animation: rise .3s both; }
@media (max-width: 900px) { .notices { padding: 0 16px; } }
@media (max-width: 640px) {
  .seg.modes { display: none; }
  .appbar .right { margin-left: 0; flex: 1; justify-content: flex-end; }
  .appbar .brand { flex-basis: auto; flex: 1; }
  #helpBtn .t { display: none; }
}

/* Tool pages slide in; the home page cards rise one after another. */
.view:not([hidden]) { animation: viewIn .32s cubic-bezier(.2, .7, .3, 1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Home ---------- */
.home { max-width: 1120px; margin: 0 auto; padding: 36px 20px 48px; }
.hero { display: flex; gap: 20px; align-items: center; margin-bottom: 28px; }
.hero h2 { font-size: 28px; line-height: 1.2; margin-bottom: 6px; letter-spacing: -.01em; }
.hero p { margin: 0; color: var(--muted); font-size: 15px; max-width: 620px; }
.hero .wave { display: inline-block; transform-origin: 70% 70%; animation: wave 1.8s ease-in-out .4s 2; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }
.home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1100px) { .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .home-grid { grid-template-columns: 1fr; } }
/* Five tools no longer fit beside the title on mid-size screens; the home button covers switching. */
@media (max-width: 1280px) { .seg.modes { display: none; } }
.mod-card {
  --mc: var(--accent);
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  color: inherit; text-decoration: none; overflow: hidden;
  transition: transform .2s cubic-bezier(.2, .7, .3, 1), box-shadow .2s, border-color .2s;
  animation: rise .5s cubic-bezier(.2, .7, .3, 1) both;
}
.mod-card:nth-child(2) { animation-delay: .07s; }
.mod-card:nth-child(3) { animation-delay: .14s; }
.mod-card:nth-child(4) { animation-delay: .21s; }
.mod-card:nth-child(5) { animation-delay: .28s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.mod-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--mc); }
.mod-card:hover, .mod-card:focus-visible { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(0,0,0,.12); border-color: var(--mc); outline: none; }
.mod-card .mc-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  color: var(--mc); background: color-mix(in srgb, var(--mc) 13%, var(--panel)); transition: transform .25s;
}
.mod-card .mc-icon svg { width: 28px; height: 28px; }
.mod-card:hover .mc-icon { transform: scale(1.08) rotate(-4deg); }
.mod-card h3 { font-size: 19px; }
.mod-card p { margin: 0; color: var(--muted); font-size: 14px; }
.mc-steps { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; counter-reset: s; }
.mc-steps li { counter-increment: s; display: flex; gap: 10px; align-items: center; font-size: 13px; }
.mc-steps li::before {
  content: counter(s); width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--mc); background: color-mix(in srgb, var(--mc) 12%, var(--panel));
}
.mc-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mc-status { font-size: 12px; color: var(--muted); min-height: 18px; }
.mc-status:not(:empty)::before { content: "● "; color: var(--ok); }
.mc-go { margin-left: auto; font-weight: 700; color: var(--mc); white-space: nowrap; }
.mc-go i { display: inline-block; font-style: normal; transition: transform .2s; }
.mod-card:hover .mc-go i { transform: translateX(4px); }
.mc-last { position: absolute; top: 16px; right: 16px; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 99px; color: var(--mc); background: color-mix(in srgb, var(--mc) 12%, var(--panel)); }
.home-tips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
@media (max-width: 760px) { .home-tips { grid-template-columns: 1fr; } }
.home-tips div { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; color: var(--muted); animation: rise .5s .25s both; }
.home-tips b { color: var(--text); }
.home-tips span > b:first-child { display: block; margin-bottom: 2px; }
.home-tips .ti { font-size: 22px; line-height: 1; }
@media (max-width: 640px) {
  .home { padding: 22px 16px 36px; }
  .hero h2 { font-size: 23px; }
  .mod-card { padding: 18px; }
}

/* ---------- Introduction + FAQ under each page ---------- */
.about { max-width: 900px; margin: 12px auto 0; padding: 28px 20px 44px; border-top: 1px solid var(--line); color: var(--muted); }
.about h2 { font-size: 19px; color: var(--text); margin-bottom: 10px; }
.about h3 { font-size: 15px; color: var(--text); margin: 24px 0 10px; }
.about p { margin: 0 0 10px; max-width: 75ch; }
.about details { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); margin-bottom: 8px; }
.about summary { cursor: pointer; padding: 10px 14px; font-weight: 600; color: var(--text); }
.about details p { padding: 0 14px 4px; }
.about-links { display: flex; flex-wrap: wrap; gap: 8px; }
.about-links a { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); text-decoration: none; font-size: 13px; transition: border-color .15s; }
.about-links a:hover { border-color: var(--accent); }
@media (max-width: 640px) { .about { padding: 22px 16px 36px; } }

/* ---------- Help: tooltips and the guided tour ---------- */
button.help {
  width: 18px; height: 18px; padding: 0; border-radius: 50%; font-size: 11px; font-weight: 700; line-height: 1;
  display: inline-grid; place-items: center; vertical-align: 1px; margin-left: 2px; flex: none;
  color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); text-transform: none; letter-spacing: 0;
}
button.help:hover, button.help:focus-visible { color: #fff; background: var(--accent); border-color: var(--accent); }
@media (pointer: coarse) { button.help { width: 22px; height: 22px; font-size: 12px; } }
#tip {
  position: fixed; z-index: 70; max-width: min(280px, calc(100vw - 16px)); padding: 8px 11px; border-radius: 9px;
  background: #1f2937; color: #f9fafb; font-size: 12.5px; line-height: 1.45; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; top: -999px; left: -999px;
}
#tip[data-side="above"] { transform: translateY(-4px); }
#tip.show { opacity: 1; transform: none; }

.tour { position: fixed; inset: 0; z-index: 60; }
.tour-shade, .tour-spot { position: fixed; transition: all .35s cubic-bezier(.2, .7, .3, 1); }
.tour-shade { background: rgba(15, 23, 42, .58); }
.tour-spot { border-radius: 12px; pointer-events: none; box-shadow: 0 0 0 3px var(--accent); }
.tour-spot::after { content: ""; position: absolute; inset: -3px; border-radius: inherit; border: 3px solid var(--accent); animation: ring 1.6s ease-out infinite; }
@keyframes ring { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.06); } }
.tour-pop {
  position: fixed; width: min(340px, calc(100vw - 24px)); padding: 16px 18px 14px; border-radius: 16px;
  background: var(--panel); color: var(--text); box-shadow: var(--shadow-lg); border: 1px solid var(--line);
}
.tour-pop.in { animation: popIn .3s cubic-bezier(.2, .8, .3, 1.2); }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.96); } }
.tour-count { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.tour-title { font-size: 16px; margin: 4px 0 6px; }
.tour-text { margin: 0; font-size: 14px; color: var(--muted); }
.tour-text b { color: var(--text); }
.tour-dots { display: flex; gap: 5px; margin: 14px 0 12px; }
.tour-dots i { width: 7px; height: 7px; border-radius: 99px; background: var(--line); transition: width .25s, background .25s; }
.tour-dots i.on { width: 20px; background: var(--accent); }
.tour-btns { display: flex; gap: 8px; align-items: center; }
@media (max-width: 640px) {
  .tour-pop { left: 12px !important; right: 12px; bottom: 12px; top: auto !important; width: auto; }
}

/* First-visit offer of the tour */
.tour-offer { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; background: var(--accent-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); animation: rise .4s both; }
.tour-offer .ic { font-size: 22px; }
.tour-offer span { flex: 1; min-width: 200px; font-size: 14px; text-align: left; }

/* ---------- Motion ---------- */
button { transition: border-color .15s, background .15s, transform .1s, box-shadow .15s; }
button:active:not(:disabled) { transform: scale(.97); }
button.primary:not(:disabled) { box-shadow: 0 1px 2px rgba(37, 99, 235, .25); }
.toast.out { animation: tout .2s ease-in forwards; }
@keyframes tout { to { opacity: 0; transform: translateY(8px); } }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.14); } 100% { transform: scale(1); } }
.card, .pcard { animation: none; }
#exportBtn:not(:disabled):not([hidden]) { animation: ready .45s ease-out; }
@keyframes ready { from { transform: scale(.92); opacity: .6; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Word preview dialog (js/docx.js) ---------- */
#docxPreview .dp { background: var(--panel); border-radius: 16px; width: min(1000px, 100%); height: 100%; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg); }
#docxPreview .dp-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
#docxPreview .dp-title { font-size: 15px; }
#docxPreview .dp-body { flex: 1; overflow: auto; background: #525659; padding: 16px 8px; }
#docxPreview .dp-msg { color: #f3f4f6; text-align: center; padding: 60px 16px; }
#docxPreview .docx-wrapper { background: transparent; padding: 0; }
#docxPreview .docx-wrapper > section.docx { margin: 0 auto 16px; box-shadow: 0 4px 18px rgba(0,0,0,.35); }
/* docx-preview lets row alignment leak into cells; paragraphs that set their own alignment keep it. */
#docxPreview section.docx td { text-align: left; }
/* …and it gives runs the theme font (resolved wrongly to Cambria); use the template's Normal font instead. */
#docxPreview section.docx span { font-family: inherit; }
@media (max-width: 640px) {
  #docxPreview { padding: 0; }
  #docxPreview .dp { border-radius: 0; }
  #docxPreview .dp-note { display: none; }
}
