/* =====================================================================
 * Editora theme — glassmorphism, soft radii, brand navy / sky / orange
 * =================================================================== */
:root {
  --navy: #0a2342; --navy-2: #143a6b; --blue: #0b8fd6; --blue-2: #39a9e8; --orange: #ef7d00;
  --ink: #0f1b2d; --muted: #5b6b82; --line: rgba(15, 27, 45, .10);
  --glass: rgba(255, 255, 255, .58); --glass-strong: rgba(255, 255, 255, .72); --glass-brd: rgba(255, 255, 255, .75);
  --bg-1: #dfe4f3; --bg-2: #ece8f4; --bg-3: #f6f1ec;
  --r-xl: 40px; --r-lg: 28px; --r-md: 20px; --r-sm: 14px;
  --shadow: 0 10px 40px -12px rgba(10, 35, 66, .25);
  --shadow-sm: 0 4px 18px -8px rgba(10, 35, 66, .25);
  --ok: #16a34a; --warn: #ef7d00; --err: #dc2626;
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --ink: #e8eef8; --muted: #9fb0c8; --line: rgba(255, 255, 255, .10);
  --glass: rgba(20, 32, 54, .55); --glass-strong: rgba(18, 28, 48, .78); --glass-brd: rgba(255, 255, 255, .10);
  --bg-1: #0b1424; --bg-2: #111c33; --bg-3: #161f35;
  --shadow: 0 10px 40px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg-2); line-height: 1.55; min-height: 100vh; overflow-x: hidden; }
img, svg, canvas { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.02em; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { flex: none; }
.muted { color: var(--muted); }
.hide-sm { }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* background sky */
.sky { position: fixed; inset: 0; z-index: -1; background:
  radial-gradient(60vw 50vh at 10% 0%, rgba(11, 143, 214, .18), transparent 60%),
  radial-gradient(50vw 40vh at 95% 20%, rgba(124, 92, 255, .14), transparent 60%),
  radial-gradient(40vw 40vh at 70% 100%, rgba(239, 125, 0, .10), transparent 60%),
  linear-gradient(180deg, var(--bg-1), var(--bg-2) 45%, var(--bg-3)); }

/* glass */
.glass { background: var(--glass); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border: 1px solid var(--glass-brd); box-shadow: var(--shadow-sm); }
.glass-strong { background: var(--glass-strong); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4); border: 1px solid var(--glass-brd); box-shadow: var(--shadow); }

/* ---------------- top bar ---------------- */
.topbar { position: sticky; top: 12px; z-index: 40; margin: 12px auto 0; width: min(1320px, calc(100% - 24px)); display: flex; align-items: center; gap: 16px; padding: 8px 10px 8px 18px; border-radius: 999px; }
.brand img { height: 42px; width: auto; }
.topnav { flex: 1; display: flex; justify-content: center; }
.pill-group { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .45); }
[data-theme="dark"] .pill-group { background: rgba(255, 255, 255, .05); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px; text-decoration: none; font-weight: 500; font-size: .95rem; white-space: nowrap; transition: background .2s, transform .2s; border: 0; background: none; cursor: pointer; }
.pill:hover { background: rgba(255, 255, 255, .8); }
[data-theme="dark"] .pill:hover { background: rgba(255, 255, 255, .08); }
.pill-ghost { background: rgba(255, 255, 255, .55); }
.pill-dark { background: var(--navy); color: #fff; }
.pill-dark:hover { background: var(--navy-2); }
.top-actions { display: flex; gap: 6px; align-items: center; }
.menu-btn { display: none; border: 0; background: var(--navy); color: #fff; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1; }
.menu-btn .mb-close, .topbar.is-open .menu-btn .mb-open { display: none; }
.topbar.is-open .menu-btn .mb-close { display: inline; }
.mnav { display: none; }
.mnav-cat { margin: 14px 6px 6px; font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mnav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mnav-grid a { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 14px; text-decoration: none; font-weight: 500; font-size: .92rem; background: rgba(255, 255, 255, .55); }
[data-theme="dark"] .mnav-grid a { background: rgba(255, 255, 255, .05); }
.mnav-grid .tool-ic { width: 32px; height: 32px; border-radius: 10px; margin: 0; flex: none; }
.mnav-grid .badge { font-size: .6rem; padding: 1px 6px; }
.mnav-auth { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.mnav-auth .btn:only-child { grid-column: 1 / -1; }

/* ---------------- buttons ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: 999px; font-weight: 600; text-decoration: none; border: 0; cursor: pointer; transition: transform .15s, background .2s, box-shadow .2s; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
.btn-dark { background: var(--navy); color: #fff; box-shadow: 0 8px 24px -10px rgba(10, 35, 66, .7); }
.btn-dark:hover { background: var(--navy-2); }
.btn-glass { background: rgba(255, 255, 255, .7); color: var(--navy); border: 1px solid var(--glass-brd); }
[data-theme="dark"] .btn-glass { background: rgba(255, 255, 255, .08); color: var(--ink); }
.btn-danger { background: var(--err); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: .9rem; }
.circle-btn { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .85); color: var(--navy); text-decoration: none; border: 1px solid var(--glass-brd); transition: transform .2s; }
.circle-btn:hover { transform: rotate(45deg); }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: rgba(255, 255, 255, .7); padding: 7px 12px; border-radius: 999px; font-size: .88rem; cursor: pointer; font-weight: 500; }
[data-theme="dark"] .chip-btn { background: rgba(255, 255, 255, .06); }
.chip-btn:hover { border-color: var(--blue); }

/* ---------------- hero frame ---------------- */
main { width: min(1320px, calc(100% - 24px)); margin: 0 auto; }
.hero-frame { position: relative; margin-top: 20px; min-height: 860px; border-radius: var(--r-xl); overflow: hidden; padding: 24px;
  background:
    radial-gradient(120% 80% at 50% 110%, rgba(239, 125, 0, .22), transparent 55%),
    radial-gradient(60% 50% at 80% 30%, rgba(255, 255, 255, .5), transparent 60%),
    linear-gradient(180deg, #5d7cc4 0%, #8fa3d9 30%, #c9c3e6 62%, #efe5ec 100%); }
[data-theme="dark"] .hero-frame { background: radial-gradient(120% 80% at 50% 110%, rgba(239, 125, 0, .18), transparent 55%), linear-gradient(180deg, #0c1a35 0%, #1a2b55 45%, #2b2f55 75%, #3a2f45 100%); }

.rail { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 999px; z-index: 3; }
.rail-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--navy); text-decoration: none; background: transparent; border: 0; cursor: pointer; transition: background .2s; }
[data-theme="dark"] .rail-btn { color: var(--ink); }
.rail-btn:hover { background: rgba(255, 255, 255, .7); }
.rail-btn.is-active { background: #fff; box-shadow: var(--shadow-sm); }
[data-theme="dark"] .rail-btn:hover, [data-theme="dark"] .rail-btn.is-active { background: rgba(255, 255, 255, .12); }
.rail-sep { height: 1px; background: var(--line); margin: 4px 8px; }

.hero-search { position: relative; z-index: 5; margin: 0 auto; width: min(640px, 100%); display: flex; align-items: center; gap: 14px; padding: 8px 20px; border-radius: 999px; }
.hs-field { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.hs-label { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; color: var(--muted); }
.hs-field input { border: 0; background: transparent; outline: none; font-weight: 600; padding: 0; width: 100%; }
.hs-field input::placeholder { color: var(--ink); opacity: .55; font-weight: 500; }
.hs-static { flex: none; }
.hs-static strong { font-weight: 600; font-size: .95rem; }
.hs-divider { width: 1px; align-self: stretch; background: var(--line); }
.hs-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; border-radius: var(--r-md); padding: 6px; max-height: 340px; overflow: auto; }
.hs-results a { display: block; padding: 10px 14px; border-radius: 12px; text-decoration: none; }
.hs-results a:hover, .hs-results a.is-hl { background: rgba(255, 255, 255, .8); }
[data-theme="dark"] .hs-results a:hover, [data-theme="dark"] .hs-results a.is-hl { background: rgba(255, 255, 255, .08); }
.hs-results small { display: block; color: var(--muted); }

.hero-copy { position: relative; z-index: 2; text-align: center; margin-top: 44px; padding: 0 70px; }
.hero-title { font-size: clamp(2.6rem, 6.6vw, 5.6rem); font-weight: 600; line-height: .98; color: rgba(255, 255, 255, .92); text-shadow: 0 6px 40px rgba(10, 35, 66, .35); letter-spacing: -.035em; margin-bottom: 18px; }
.hero-lead { max-width: 560px; margin: 0 auto 26px; color: #fff; font-size: 1.12rem; text-shadow: 0 2px 16px rgba(10, 35, 66, .45); }
.hero-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.hero-art { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%) scale(.9); transform-origin: bottom center; width: 360px; height: 300px; z-index: 1; pointer-events: none; }
.sheet { position: absolute; width: 220px; height: 280px; border-radius: 18px; background: #fff; box-shadow: 0 30px 60px -20px rgba(10, 35, 66, .5); }
[data-theme="dark"] .sheet { background: #e8edf6; }
.sheet-1 { left: 70px; top: 0; padding: 26px 22px; animation: float 6s ease-in-out infinite; }
.sheet-2 { left: 10px; top: 26px; transform: rotate(-10deg); background: rgba(255, 255, 255, .7); }
.sheet-3 { left: 140px; top: 30px; transform: rotate(9deg); background: rgba(255, 255, 255, .55); }
.sheet-fold { position: absolute; right: 0; top: 0; width: 46px; height: 46px; background: linear-gradient(225deg, transparent 50%, var(--orange) 50%); border-radius: 0 18px 0 12px; }
.ln { height: 9px; border-radius: 9px; background: #c9d3e6; margin-bottom: 11px; }
.ln.w80 { width: 80%; background: var(--navy); opacity: .85; } .ln.w60 { width: 60%; } .ln.w90 { width: 90%; } .ln.w40 { width: 40%; } .ln.w70 { width: 70%; } .ln.w50 { width: 50%; }
.sheet-img { height: 60px; border-radius: 10px; margin: 6px 0 14px; background: linear-gradient(135deg, var(--blue), var(--blue-2)); opacity: .85; }
.sheet-sign { width: 120px; margin-top: 6px; }
@keyframes float { 50% { transform: translateY(-10px); } }

.float-card { position: absolute; z-index: 4; border-radius: var(--r-lg); padding: 22px 24px; }
.float-card h2 { font-size: 1.3rem; font-weight: 600; margin-bottom: 6px; }
.float-card p { margin: 0 0 12px; font-size: .92rem; color: var(--muted); }
.fc-left { left: 90px; bottom: 24px; width: 360px; }
.fc-stat { display: flex; align-items: center; gap: 12px; }
.fc-stat strong { font-size: 2.6rem; font-weight: 600; line-height: 1; color: var(--navy); }
[data-theme="dark"] .fc-stat strong { color: var(--ink); }
.fc-stat span { font-size: .8rem; color: var(--muted); line-height: 1.2; flex: 1; }
.fc-right { right: 24px; bottom: 150px; width: 330px; }
.fc-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.fc-head .muted { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; margin: 0 0 6px; }
.fc-meta { list-style: none; padding: 0; margin: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.fc-meta li { display: inline-flex; gap: 5px; align-items: center; font-size: .8rem; background: rgba(255, 255, 255, .7); padding: 6px 10px; border-radius: 999px; }
[data-theme="dark"] .fc-meta li { background: rgba(255, 255, 255, .06); }
.brand-orb { position: absolute; z-index: 4; left: calc(50% + 150px); bottom: 26px; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: #fff; box-shadow: 0 0 0 8px rgba(10, 35, 66, .9), var(--shadow); }

/* ---------------- sections / tools ---------------- */
.section { margin: 72px 0; }
.section-head { text-align: center; margin-bottom: 34px; }
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.7rem); font-weight: 600; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); margin: 0 0 10px; }
.h-sm { font-size: 1.5rem; font-weight: 600; margin-bottom: 18px; }
.cat-block { margin-bottom: 34px; scroll-margin-top: 100px; }
.cat-title { font-size: 1.05rem; font-weight: 600; color: var(--muted); margin: 0 0 14px 6px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tool-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--r-lg); text-decoration: none; transition: transform .2s, box-shadow .2s, background .2s; }
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); background: var(--glass-strong); }
.tool-card.is-soon { opacity: .75; }
.tool-name { font-weight: 600; font-size: 1.08rem; }
.tool-desc { font-size: .88rem; color: var(--muted); padding-right: 30px; }
.tool-go { position: absolute; right: 16px; top: 18px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .8); color: var(--navy); transition: transform .2s; }
.tool-card:hover .tool-go { transform: rotate(45deg); background: var(--navy); color: #fff; }
.tool-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 6px; }
.tool-ic.big { width: 60px; height: 60px; border-radius: 18px; margin: 0; }
.tool-ic-organize { background: rgba(11, 143, 214, .14); color: var(--blue); }
.tool-ic-edit { background: rgba(239, 125, 0, .14); color: var(--orange); }
.tool-ic-secure { background: rgba(10, 35, 66, .10); color: var(--navy); }
[data-theme="dark"] .tool-ic-secure { background: rgba(255, 255, 255, .1); color: #cfe0ff; }
.tool-ic-convert { background: rgba(124, 92, 255, .14); color: #7c5cff; }
.badge { font-style: normal; font-size: .68rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--orange); color: #fff; vertical-align: middle; }

.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.why-card { padding: 28px; border-radius: var(--r-lg); }
.why-card h3 { font-size: 1.2rem; font-weight: 600; margin-top: 8px; }
.why-card p { color: var(--muted); margin: 0; }

.faq-list { display: grid; gap: 10px; max-width: 860px; margin: 0 auto; }
.faq-item { border-radius: var(--r-md); padding: 0 22px; }
.faq-item summary { cursor: pointer; padding: 18px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq-item summary::after { content: '+'; font-size: 1.4rem; line-height: 1; color: var(--blue); transition: transform .2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin: 0 0 18px; color: var(--muted); }

/* ---------------- tool page ---------------- */
.tool-layout { display: grid; grid-template-columns: 72px 1fr; gap: 18px; margin-top: 20px; }
.rail-sticky { position: sticky; top: 96px; left: auto; transform: none; align-self: start; }
.tool-main { min-width: 0; }
.crumbs { font-size: .85rem; color: var(--muted); margin: 4px 0 12px 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { text-decoration: none; } .crumbs a:hover { color: var(--blue); }
.workspace { position: relative; border-radius: var(--r-xl); padding: 28px; min-height: 420px; }
.ws-head { display: flex; gap: 18px; align-items: center; margin-bottom: 22px; }
.ws-head h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 600; margin: 0 0 2px; }
.ws-head .lead { margin: 0; color: var(--muted); }

.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; min-height: 280px; border: 2px dashed rgba(11, 143, 214, .45); border-radius: var(--r-lg); cursor: pointer; padding: 30px; transition: background .2s, border-color .2s; background: rgba(255, 255, 255, .35); }
[data-theme="dark"] .dropzone { background: rgba(255, 255, 255, .03); }
.dropzone:hover, .dropzone.is-over { background: rgba(11, 143, 214, .08); border-color: var(--blue); }
.dropzone strong { font-size: 1.3rem; font-weight: 600; }
.dz-ic { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; margin-bottom: 6px; box-shadow: 0 0 0 10px rgba(10, 35, 66, .08); }

.ws-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.file-chips { display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .75); font-size: .86rem; max-width: 100%; }
[data-theme="dark"] .file-chip { background: rgba(255, 255, 255, .06); }
.file-chip i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.fc-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.file-chip small { color: var(--muted); }
.file-chip button { border: 0; background: rgba(10, 35, 66, .07); border-radius: 50%; width: 24px; height: 24px; font-size: .7rem; cursor: pointer; }
.ws-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.ws-body { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.stage { min-width: 0; border-radius: var(--r-lg); background: rgba(255, 255, 255, .35); padding: 16px; min-height: 360px; max-height: 78vh; overflow: auto; }
[data-theme="dark"] .stage { background: rgba(0, 0, 0, .15); }
.stage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; align-content: start; }
.pg { position: relative; border-radius: 14px; padding: 10px 10px 28px; background: rgba(255, 255, 255, .75); border: 2px solid transparent; transition: border-color .15s, transform .15s; user-select: none; }
[data-theme="dark"] .pg { background: rgba(255, 255, 255, .06); }
.pg[draggable="true"] { cursor: grab; }
.pg.is-clickable { cursor: pointer; }
.pg:hover { border-color: rgba(11, 143, 214, .4); }
.pg.is-sel { border-color: var(--orange); background: rgba(239, 125, 0, .1); }
.tool-delete .pg.is-sel .pg-frame { opacity: .35; }
.tool-delete .pg.is-sel::after { content: '✕'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.4rem; color: var(--orange); }
.pg.is-drag { opacity: .4; }
.pg.drop-before { box-shadow: -5px 0 0 var(--blue); } .pg.drop-after { box-shadow: 5px 0 0 var(--blue); }
.pg-frame { aspect-ratio: 3 / 4; display: grid; place-items: center; overflow: hidden; }
.pg-canvas { transition: transform .25s; display: grid; place-items: center; max-width: 100%; max-height: 100%; }
.pg-canvas canvas { max-height: 180px; width: auto; box-shadow: 0 2px 10px rgba(0, 0, 0, .15); background: #fff; }
.pg-ph { width: 100px; height: 130px; border-radius: 6px; background: linear-gradient(90deg, #eef1f7, #f8f9fc, #eef1f7); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.pg-num { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-size: .78rem; font-weight: 600; color: var(--muted); }
.pg-file { position: absolute; top: 6px; left: 6px; width: 10px; height: 10px; border-radius: 50%; }
.pg-tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.pg:hover .pg-tools, .pg:focus-within .pg-tools { opacity: 1; }
@media (hover: none) { .pg-tools { opacity: 1; } }
.pg-tools button { width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; cursor: pointer; font-size: .78rem; }

.ws-panel { position: sticky; top: 96px; border-radius: var(--r-lg); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.panel-body { display: flex; flex-direction: column; gap: 12px; }
.panel-title { font-size: 1.1rem; font-weight: 600; margin: 0; }
.panel-note { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: .8rem; margin: 0; }
.hint { font-size: .86rem; color: var(--muted); margin: 0; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: .86rem; font-weight: 500; }
.field > span { display: flex; justify-content: space-between; }
.field input:not([type=color]):not([type=range]), .field select, .field textarea, .input { width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .85); outline: none; transition: border-color .2s, box-shadow .2s; }
[data-theme="dark"] .field input:not([type=color]):not([type=range]), [data-theme="dark"] .field select, [data-theme="dark"] .field textarea, [data-theme="dark"] .input { background: rgba(255, 255, 255, .06); }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(11, 143, 214, .15); }
.field input[type=color] { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 12px; padding: 4px; background: #fff; cursor: pointer; }
.field input[type=range] { accent-color: var(--blue); }
.check { display: flex; gap: 8px; align-items: center; font-size: .88rem; cursor: pointer; }
.check input { accent-color: var(--blue); width: 18px; height: 18px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(10, 35, 66, .06); }
.seg label { flex: 1; text-align: center; cursor: pointer; font-size: .85rem; font-weight: 500; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: #fff; border-radius: 999px; box-shadow: var(--shadow-sm); }
[data-theme="dark"] .seg label:has(input:checked) { background: rgba(255, 255, 255, .12); }
.seg label { padding: 7px 6px; }
.stat-row { display: flex; justify-content: space-between; padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, .6); font-size: .9rem; }
[data-theme="dark"] .stat-row { background: rgba(255, 255, 255, .05); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.perm { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px 12px; display: grid; gap: 8px; }
.perm legend { font-size: .82rem; color: var(--muted); padding: 0 4px; }
.form-fields { display: grid; gap: 10px; max-height: 46vh; overflow: auto; padding-right: 4px; }

/* editor */
.stage-editor { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.ed-page { position: relative; flex: none; background: #fff; box-shadow: 0 6px 24px rgba(10, 35, 66, .18); }
.ed-canvas { position: absolute; inset: 0; }
.ed-layer { position: absolute; inset: 0; }
.stage-editor[data-etool=text] .ed-layer { cursor: text; }
.stage-editor[data-etool=whiteout] .ed-layer, .stage-editor[data-etool=image] .ed-layer, .stage-editor[data-etool=sign] .ed-layer { cursor: crosshair; }
.ed-num { position: absolute; bottom: -20px; right: 0; font-size: .75rem; color: var(--muted); }
.item { position: absolute; outline: 1px dashed transparent; }
.item:hover, .item.is-focus { outline-color: var(--blue); }
.item img { width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.item-whiteout { background: #fff; outline: 1px dashed rgba(11, 143, 214, .6); cursor: move; }
.item-image, .item-sign { cursor: move; }
.it-text { font-family: Helvetica, Arial, sans-serif; line-height: 1.2; white-space: pre; outline: none; min-width: 100%; min-height: 100%; padding: 0; display: inline-block; cursor: text; }
.it-move { position: absolute; top: -12px; left: -2px; width: 22px; height: 12px; border-radius: 4px 4px 0 0; background: var(--blue); cursor: move; display: none; }
.item-text:hover .it-move, .item-text.is-focus .it-move { display: block; }
.it-resize { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--blue); cursor: nwse-resize; display: none; }
.it-del { position: absolute; right: -10px; top: -12px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--err); color: #fff; font-size: .65rem; cursor: pointer; display: none; }
.item:hover .it-resize, .item.is-focus .it-resize, .item:hover .it-del, .item.is-focus .it-del { display: block; }
.edit-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.etool { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .7); cursor: pointer; font-size: .82rem; font-weight: 500; }
[data-theme="dark"] .etool { background: rgba(255, 255, 255, .05); }
.etool.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* signature dialog */
.sig-dialog { border-radius: var(--r-lg); padding: 24px; width: min(620px, 94vw); color: var(--ink); }
.sig-dialog::backdrop { background: rgba(10, 35, 66, .45); backdrop-filter: blur(4px); }
.sig-dialog form { display: grid; gap: 14px; }
.sig-dialog h2 { font-weight: 600; margin: 0; }
.sig-draw canvas { width: 100%; height: auto; border-radius: 14px; background: #fff; border: 1px dashed var(--line); touch-action: none; cursor: crosshair; }
.sig-type input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); }
.sig-preview { min-height: 90px; font-family: 'Segoe Script', 'Brush Script MT', 'Snell Roundhand', cursive; font-size: 3rem; padding: 6px 10px; background: #fff; border-radius: 12px; margin-top: 8px; }
.sig-color { max-width: 120px; }

/* result / busy / error */
.result { margin-top: 10px; border-radius: var(--r-lg); padding: 26px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.result-text { flex: 1; min-width: 200px; } .result-text h2 { font-weight: 600; margin: 0; } .result-text p { margin: 2px 0 0; word-break: break-all; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.busy { position: absolute; inset: 0; border-radius: var(--r-xl); background: rgba(255, 255, 255, .6); backdrop-filter: blur(4px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; z-index: 10; font-weight: 600; }
[data-theme="dark"] .busy { background: rgba(10, 20, 40, .7); }
.busy[hidden] { display: none; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(11, 143, 214, .2); border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ws-error { position: sticky; bottom: 16px; margin-top: 14px; padding: 14px 18px; border-radius: 14px; background: #fff1f0; color: #9f1d1d; border: 1px solid #fecaca; font-weight: 500; z-index: 11; }
.soon-box { border-radius: var(--r-lg); padding: 28px; }
.soon-box h2 { font-weight: 600; }

.seo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.seo-card { border-radius: var(--r-lg); padding: 26px; }
.seo-card h2 { font-size: 1.25rem; font-weight: 600; }
.seo-card p { color: var(--muted); margin: 0; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: center; }
.steps li::before { content: counter(s); flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 600; font-size: .85rem; }

/* toast */
.toast { position: fixed; top: 86px; right: 20px; z-index: 60; padding: 14px 18px; border-radius: 14px; background: var(--navy); color: #fff; box-shadow: var(--shadow); animation: toast 5s forwards; max-width: 360px; }
.toast-err { background: var(--err); }
@keyframes toast { 0% { transform: translateY(-10px); opacity: 0; } 8%, 85% { transform: none; opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

/* ---------------- footer ---------------- */
.site-footer { width: min(1320px, calc(100% - 24px)); margin: 60px auto 20px; }
.footer-card { border-radius: var(--r-xl); padding: 34px; display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 24px; }
.footer-brand img { height: 46px; width: auto; margin-bottom: 10px; }
.footer-brand p { color: var(--muted); font-size: .9rem; margin: 0; }
.footer-col h2 { font-size: .9rem; font-weight: 600; margin-bottom: 10px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-col a { text-decoration: none; color: var(--muted); font-size: .9rem; } .footer-col a:hover { color: var(--blue); }
.copyright { text-align: center; font-size: .85rem; color: var(--muted); }

/* ---------------- auth ---------------- */
.auth-wrap { display: grid; place-items: center; min-height: calc(100vh - 220px); padding: 40px 0; }
.auth-card { width: min(440px, 100%); border-radius: var(--r-xl); padding: 34px; display: grid; gap: 14px; }
.auth-card h1 { font-weight: 600; font-size: 1.9rem; margin: 0; }
.auth-card .alt { text-align: center; font-size: .9rem; color: var(--muted); margin: 0; }
.alert { padding: 12px 14px; border-radius: 12px; font-size: .9rem; }
.alert-err { background: #fff1f0; color: #9f1d1d; border: 1px solid #fecaca; }
.alert-ok { background: #effaf3; color: #166534; border: 1px solid #bbf7d0; }

/* prose (privacy etc.) */
.prose { border-radius: var(--r-xl); padding: 40px; max-width: 860px; margin: 30px auto; }
.prose h1 { font-weight: 600; } .prose h2 { font-weight: 600; font-size: 1.3rem; margin-top: 1.4em; } .prose p, .prose li { color: var(--muted); }

/* ---------------- responsive ---------------- */
@media (max-width: 1100px) {
  .topnav { display: none; }
  .fc-right { display: none; }
  .brand-orb { left: auto; right: 30px; }
  .footer-card { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .ws-body { grid-template-columns: 1fr; }
  .ws-panel { position: static; order: -1; }
  .stage { max-height: none; }
  .tool-layout { grid-template-columns: 1fr; }
  .rail-sticky { position: fixed; top: auto; bottom: 12px; left: 50%; transform: translateX(-50%); flex-direction: row; z-index: 30; overflow-x: auto; max-width: calc(100% - 24px); }
  .rail-sticky .rail-sep { width: 1px; height: auto; margin: 8px 4px; }
  .seo-grid, .why-grid { grid-template-columns: 1fr; }
  .menu-btn { display: grid; place-items: center; flex: none; }
  .top-actions { margin-left: auto; }
  .top-actions .pill { display: none; }
  .topbar { padding: 8px 8px 8px 14px; gap: 10px; }
  .brand img { height: 36px; }
  .topbar.is-open { border-radius: 26px; flex-wrap: wrap; }
  .topbar.is-open .topnav { display: block; order: 3; flex: 0 0 100%; width: 100%; max-height: calc(100vh - 110px); overflow-y: auto; padding: 4px 4px 8px; }
  .topbar.is-open .pill-group { display: none; }
  .topbar.is-open .mnav { display: block; }
}
@media (max-width: 760px) {
  .hide-sm { display: none !important; }
  .hero-frame { min-height: 0; padding: 14px; display: flex; flex-direction: column; gap: 16px; }
  .rail:not(.rail-sticky) { position: static; transform: none; flex-direction: row; align-self: center; order: 5; }
  .rail:not(.rail-sticky) .rail-sep { width: 1px; height: auto; margin: 8px 4px; }
  .hero-copy { margin-top: 20px; padding: 0; }
  .hero-art { position: relative; left: auto; bottom: auto; transform: none; margin: 10px auto 0; width: 300px; height: 280px; }
  .float-card { position: static; width: auto; }
  .brand-orb { display: none; }
  .workspace { padding: 18px; border-radius: 28px; }
  .ws-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .footer-card { grid-template-columns: 1fr; padding: 26px; }
  .stage-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
  main.tool-layout { padding-bottom: 80px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }

/* =====================================================================
 * Admin panel
 * =================================================================== */
.admin-body .topbar { display: none; }
.admin-shell { display: grid; grid-template-columns: 250px 1fr; gap: 18px; width: min(1440px, calc(100% - 24px)); margin: 12px auto; min-height: calc(100vh - 24px); }
.admin-side { position: sticky; top: 12px; align-self: start; border-radius: var(--r-xl); padding: 22px 16px; display: flex; flex-direction: column; gap: 6px; height: calc(100vh - 24px); }
.admin-side .brand img { height: 40px; margin: 0 6px 18px; }
.admin-nav a { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; text-decoration: none; font-weight: 500; }
.admin-nav a:hover { background: rgba(255, 255, 255, .6); }
.admin-nav a.is-active { background: var(--navy); color: #fff; }
[data-theme="dark"] .admin-nav a:hover { background: rgba(255, 255, 255, .06); }
.admin-me { margin-top: auto; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, .5); font-size: .86rem; }
[data-theme="dark"] .admin-me { background: rgba(255, 255, 255, .05); }
.admin-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; padding-bottom: 30px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 6px 4px 0; }
.admin-head h1 { font-size: 1.9rem; font-weight: 600; margin: 0; }
.range-pills { display: flex; gap: 4px; padding: 4px; border-radius: 999px; }
.range-pills a { padding: 7px 14px; border-radius: 999px; text-decoration: none; font-size: .88rem; font-weight: 500; }
.range-pills a.is-active { background: var(--navy); color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.kpi { border-radius: var(--r-lg); padding: 20px; }
.kpi span { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi strong { display: block; font-size: 2.1rem; font-weight: 600; line-height: 1.15; margin-top: 6px; }
.kpi small { color: var(--muted); }
.kpi.is-err strong { color: var(--err); }
.panel { border-radius: var(--r-lg); padding: 22px; min-width: 0; }
.panel h2 { font-size: 1.1rem; font-weight: 600; margin: 0 0 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panels-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .bar { fill: var(--blue); } .chart .bar-err { fill: var(--orange); }
.chart .axis { stroke: var(--line); } .chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .bar:hover, .chart .bar-err:hover { opacity: .8; }
.legend { display: flex; gap: 14px; font-size: .82rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.toolbars { display: grid; gap: 10px; }
.toolbar-row { display: grid; grid-template-columns: 130px 1fr 50px; gap: 10px; align-items: center; font-size: .9rem; }
.toolbar-track { height: 10px; border-radius: 10px; background: rgba(10, 35, 66, .07); overflow: hidden; }
.toolbar-fill { height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--blue), var(--blue-2)); }
.toolbar-row b { text-align: right; font-weight: 600; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: rgba(255, 255, 255, .35); }
[data-theme="dark"] .tbl tr:hover td { background: rgba(255, 255, 255, .03); }
.tbl a { text-decoration: none; font-weight: 600; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; }
.tag-admin { background: rgba(10, 35, 66, .1); color: var(--navy); }
[data-theme="dark"] .tag-admin { color: #cfe0ff; background: rgba(255, 255, 255, .1); }
.tag-editor { background: rgba(124, 92, 255, .14); color: #6d4dff; }
.tag-user { background: rgba(11, 143, 214, .12); color: #0773ad; }
.tag-active { background: #dcfce7; color: #166534; }
.tag-blocked { background: #fee2e2; color: #991b1b; }
.tag-complete { background: #dcfce7; color: #166534; } .tag-open { background: rgba(11, 143, 214, .12); color: #0773ad; } .tag-error { background: #fee2e2; color: #991b1b; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters .input { width: auto; flex: 1; min-width: 200px; }
.filters select.input { flex: 0 1 160px; min-width: 130px; }
.pager { display: flex; gap: 6px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.pager a, .pager span { padding: 7px 12px; border-radius: 10px; text-decoration: none; font-size: .86rem; border: 1px solid var(--line); }
.pager .is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; background: linear-gradient(135deg, var(--blue), var(--navy)); color: #fff; font-weight: 600; font-size: .85rem; flex: none; }
.user-cell { display: flex; gap: 10px; align-items: center; }
.user-cell small { display: block; color: var(--muted); font-weight: 400; }
.detail-grid { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
.profile { text-align: center; }
.profile .avatar { width: 84px; height: 84px; font-size: 1.8rem; margin-bottom: 10px; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; text-align: left; font-size: .9rem; margin: 16px 0 0; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; font-weight: 500; word-break: break-word; }
.actions { display: grid; gap: 10px; margin-top: 16px; }
.actions form { display: grid; gap: 8px; }
.copybox { display: flex; gap: 6px; } .copybox input { flex: 1; font-size: .8rem; }
.empty { text-align: center; color: var(--muted); padding: 30px; }
@media (max-width: 1000px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; }
  .admin-side .brand img { margin: 0 10px 0 0; }
  .admin-nav { display: flex; gap: 4px; flex-wrap: wrap; }
  .admin-me { margin: 0 0 0 auto; }
  .panels-2, .detail-grid { grid-template-columns: 1fr; }
}

/* dark-mode fixes: navy wordmark needs a light plate; ghost pills go translucent */
[data-theme="dark"] .brand img, [data-theme="dark"] .footer-brand img { background: rgba(255, 255, 255, .92); border-radius: 12px; padding: 4px 10px; }
[data-theme="dark"] .pill-ghost { background: rgba(255, 255, 255, .08); }
[data-theme="dark"] .tool-go, [data-theme="dark"] .circle-btn { background: rgba(255, 255, 255, .12); color: var(--ink); }
[data-theme="dark"] .file-chip button { background: rgba(255, 255, 255, .1); }

/* editable existing text */
.tl-run { position: absolute; border-radius: 3px; cursor: text; }
.stage-editor[data-etool=text] .tl-run:hover { background: rgba(11, 143, 214, .18); outline: 1px solid rgba(11, 143, 214, .7); }
.stage-editor:not([data-etool=text]) .tl-run { pointer-events: none; }
.item-whiteout.is-cover { outline-color: transparent; }

/* footer credit */
.made-with { text-align: center; font-size: .9rem; color: var(--muted); margin: 4px 0 0; }
.made-with a { font-weight: 700; color: var(--navy); text-decoration: none; letter-spacing: .02em; }
[data-theme="dark"] .made-with a { color: #cfe0ff; }
.made-with a:hover { color: var(--blue); }
.made-with .heart { color: #e11d48; display: inline-block; animation: beat 1.4s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.25); } 30% { transform: scale(1); } }