/* Quot admin — built on the website's design system (same tokens, type, buttons, cards and dark theme). */
@font-face { font-family: "Quot Display"; src: url(/assets/ddbad953dcc27f5420aa06e2206e60ca.woff2) format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Quot Sans"; src: url(/assets/a5557604720a71324d64e1f63da5c5f5.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  /* website tokens (light) */
  --bg: #FFFFFF; --bg-app: #F4F5FA; --surface: #FFFFFF; --surface-muted: #F4F5FA; --surface-alt: #F3F4FB; --surface-green: #EEF9F1;
  --border: #E4E6F1; --border-strong: #C9CCE2;
  --fg: #101562; --fg-muted: #3E4274; --fg-subtle: #5d618c;
  --navy: #101562; --navy-strong: #0a0e45; --navy-soft: #e8e9f6;
  --green: #00E64D; --green-strong: #00c843; --accent: #007D28; --ring: #007D28;
  --danger: #b42318; --danger-soft: #fdecea; --amber: #8a5300; --amber-soft: #fff3d6; --blue-soft: #e8e9f6;
  --shadow: 0 24px 50px rgba(16, 21, 98, .10); --shadow-sm: 0 1px 2px rgba(16, 21, 98, .06), 0 8px 24px rgba(16, 21, 98, .06);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --r-btn: 6px; --r-card: 8px;
  --font: "Quot Sans", Montserrat, ui-sans-serif, system-ui, sans-serif;
  --display: "Quot Display", "Red Hat Display", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --header-bg: rgba(255, 255, 255, .78);
  color-scheme: light;
}
[data-theme="dark"] {
  /* Same near-black palette as the website's dark theme (navy and green stay as accents). */
  --bg: #07080f; --bg-app: #07080f; --surface: #10131f; --surface-muted: #151927; --surface-alt: #0b0d16; --surface-green: #0b1a12;
  --border: rgba(255, 255, 255, .10); --border-strong: rgba(255, 255, 255, .18);
  --fg: #f4f5fa; --fg-muted: #b4b8cc; --fg-subtle: #9a9fb6;
  --navy-soft: #141833; --accent: #2BF265; --ring: #2BF265;
  --danger: #ff8a80; --danger-soft: rgba(255, 90, 80, .14); --amber: #ffcf70; --amber-soft: rgba(255, 190, 60, .14); --blue-soft: rgba(255, 255, 255, .07);
  --shadow: 0 24px 50px rgba(0, 0, 0, .5); --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  --header-bg: rgba(7, 8, 15, .88);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 500 15px/1.55 var(--font); color: var(--fg); background: var(--bg-app); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; color: var(--fg); }
h1, h2 { font-family: var(--display); font-weight: 900; letter-spacing: -0.02em; }
h3, h4 { font-weight: 700; }
em.acc, .acc { font-family: var(--display); font-style: italic; font-weight: 900; color: var(--accent); }
.ic { width: 18px; height: 18px; flex: none; }
.muted { color: var(--fg-muted); } .small { font-size: 13px; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 13px; }
.strong { font-weight: 700; color: var(--fg); text-decoration: none; }
.strong:hover { color: var(--accent); }
.grow { flex: 1; }
.eyebrow { display: block; color: var(--accent); font-weight: 600; font-size: 13.5px; margin-bottom: 2px; }
::selection { background: color-mix(in oklab, var(--green) 40%, transparent); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
body.app { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }
.side { background: #101562; color: #C9CDF0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid rgba(255, 255, 255, .08); }
.side::after { content: ""; position: fixed; left: 0; bottom: 0; width: 256px; height: 260px; pointer-events: none;
  background: radial-gradient(220px 180px at 10% 100%, rgba(0, 230, 77, .18), transparent 70%); }
.brand { display: flex; align-items: center; gap: 10px; padding: 22px 22px 14px; color: #fff; text-decoration: none; }
.brand img { height: 30px; width: auto; display: block; }
.brand span { font-family: var(--display); font-style: italic; font-weight: 900; font-size: 15px; color: #2BF265; margin-top: 4px; }
.side nav { padding: 4px 12px 16px; flex: 1; position: relative; z-index: 1; }
.nav-h { margin: 20px 10px 6px; font-size: 12px; font-weight: 600; color: #8f95d6; }
.side a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--r-btn); color: #E6E8FA; text-decoration: none; font-size: 14.5px; font-weight: 500; transition: background .2s var(--ease); }
.side a:hover { background: rgba(255, 255, 255, .08); }
.side a.on { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 #00E64D; }
.side a.on .ic { color: #2BF265; }
.side .count { margin-left: auto; background: #00E64D; color: #101562; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 20px; }
.side-foot { padding: 12px 12px 18px; border-top: 1px solid rgba(255, 255, 255, .08); position: relative; z-index: 1; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 14px; padding: 12px 32px; min-height: 68px; background: var(--header-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.top h1 { font-size: 24px; }
.top-actions { display: flex; gap: 8px; margin-left: auto; }
.user { display: flex; align-items: center; gap: 4px; margin-left: 6px; }
.user a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); padding: 4px 6px; border-radius: var(--r-btn); }
.user a:hover { background: var(--surface-muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #00E64D; color: #101562; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 15px; }
.uname { display: flex; flex-direction: column; font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.uname small { font-weight: 500; color: var(--fg-muted); }
.menu-btn { display: none; }
.content { padding: 28px 32px 64px; max-width: 1280px; width: 100%; }
.content.wide { max-width: none; }

/* ---------- sign in / setup ---------- */
body.bare { min-height: 100vh; display: grid; place-items: center; color: #fff;
  background: radial-gradient(900px 520px at 100% 110%, rgba(0, 230, 77, .35), transparent 60%), radial-gradient(700px 500px at -10% -20%, #2a32a8, transparent 60%), #101562; }
.bare-main { width: 100%; max-width: 440px; padding: 24px; }
.auth-card { background: var(--surface); color: var(--fg); border-radius: var(--r-card); padding: 36px; box-shadow: 0 30px 80px rgba(4, 6, 40, .45); }
.auth-card h1 { font-size: 28px; margin: 22px 0 8px; }
.auth-logo { height: 32px; display: block; }
.auth-logo-d { display: none; }
[data-theme="dark"] .auth-logo-l { display: none; }
[data-theme="dark"] .auth-logo-d { display: block; }
.auth-tag { text-align: center; color: #C9CDF0; font-size: 13.5px; margin-top: 18px; }

/* ---------- controls (website button system) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: var(--r-btn);
  border: 1px solid var(--fg); background: transparent; color: var(--fg); font: 600 14px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease), border-color .2s; }
.btn:hover { background: var(--fg); color: var(--bg); }
.btn:active { transform: scale(.98); }
.btn.primary { background: #00E64D; border-color: #00E64D; color: #101562; }
.btn.primary:hover { background: #00c843; border-color: #00c843; color: #101562; }
.btn.danger { color: var(--danger); border-color: color-mix(in oklab, var(--danger) 45%, transparent); }
.btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn.block { width: 100%; height: 46px; margin-top: 10px; font-size: 15px; }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn:disabled:hover { background: transparent; color: var(--fg); }
.btn-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-btn); border: 0; background: transparent; color: var(--fg-muted); cursor: pointer; font-size: 20px; }
.btn-icon:hover { background: var(--surface-muted); color: var(--fg); }
.theme-btn .moon { display: none; }
[data-theme="dark"] .theme-btn .sun { display: none; }
[data-theme="dark"] .theme-btn .moon { display: block; }

.field { margin-bottom: 18px; }
.field label, .lbl { display: block; font-weight: 600; font-size: 13.5px; margin: 0 0 7px; color: var(--fg); }
.lbl { margin-top: 14px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea, .in {
  width: 100%; min-height: 44px; padding: 10px 13px; border: 1px solid var(--border-strong); border-radius: var(--r-card); background: var(--surface);
  color: var(--fg); font: 500 14.5px/1.4 var(--font); transition: border-color .2s, box-shadow .2s; }
[data-theme="dark"] input:not([type=checkbox]):not([type=radio]):not([type=file]), [data-theme="dark"] select, [data-theme="dark"] textarea { background: rgba(255, 255, 255, .08); }
textarea { min-height: 90px; resize: vertical; line-height: 1.55; }
textarea.code { font: 12.5px/1.5 var(--mono); white-space: pre; }
input::placeholder, textarea::placeholder { color: var(--fg-subtle); opacity: .75; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 20%, transparent); }
input[readonly] { background: var(--surface-muted) !important; }
.help { font-size: 13px; color: var(--fg-muted); margin: 7px 0 0; font-weight: 500; }
.check { display: flex; align-items: center; gap: 9px; margin: 12px 0; font-size: 14px; cursor: pointer; }
.check.sm { margin: 0; font-size: 13px; }
.check input { width: 17px; height: 17px; accent-color: #00c843; }
.counter { display: block; text-align: right; font-size: 12px; color: var(--fg-muted); margin-top: 4px; }
.counter.over { color: var(--danger); font-weight: 700; }
.pick { display: flex; gap: 8px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.span2 { grid-column: 1 / -1; }
.inline { display: inline; }

/* ---------- surfaces (website cards) ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 24px 26px; box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 660px; }
.card.danger { border-color: color-mix(in oklab, var(--danger) 30%, transparent); }
.card h2 { font-size: 21px; margin-bottom: 14px; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.card-h h2 { margin: 0; }
.card-h a { font-weight: 600; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.grid2 > .card { margin: 0; }
.cards3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 20px; }
.bar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.bar select, .bar input[type=date] { width: auto; }
.search input { width: 280px; }

.hero { position: relative; overflow: hidden; border-radius: var(--r-card); padding: 28px 30px; margin-bottom: 20px; color: #fff;
  background: radial-gradient(520px 260px at 100% 120%, rgba(0, 230, 77, .45), transparent 65%), radial-gradient(500px 300px at 0% -40%, #2a32a8, transparent 60%), #101562; box-shadow: var(--shadow); }
.hero h2 { color: #fff; font-size: 30px; }
.hero h2 em { font-style: italic; color: #2BF265; }
.hero p { color: #C9CDF0; margin: 8px 0 0; max-width: 640px; }
.hero .actions { justify-content: flex-start; margin-top: 18px; }
.hero .btn:not(.primary) { color: #fff; border-color: #fff; }
.hero .btn:not(.primary):hover { background: #fff; color: #101562; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 18px 20px;
  text-decoration: none; color: var(--fg); box-shadow: var(--shadow-sm); transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat span { font-size: 13.5px; color: var(--fg-muted); font-weight: 600; }
.stat b { font-family: var(--display); font-weight: 900; font-size: 36px; line-height: 1.1; margin-top: 6px; letter-spacing: -0.02em; }
.stat small { color: var(--accent); font-weight: 600; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.feed li:last-child { border-bottom: 0; }
.feed li small { float: right; color: var(--fg-muted); }
.empty { text-align: center; padding: 64px 20px; }
.empty h2 { margin-bottom: 8px; font-size: 28px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12.5px; color: var(--fg-muted); font-weight: 600; padding: 12px 16px; background: var(--surface-alt); border-bottom: 1px solid var(--border); }
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.card:not(.flush) .tbl td { padding-left: 0; }
.tbl.hover tbody tr { transition: background .15s; }
.tbl.hover tbody tr:hover { background: var(--surface-alt); }
.tbl .w1 { width: 1%; }
.tbl tr.unread td { font-weight: 700; }
.tbl tr.unread td:first-child { box-shadow: inset 3px 0 0 #00E64D; }

.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; background: var(--surface-muted); color: var(--fg-muted); white-space: nowrap; }
.badge.green { background: color-mix(in oklab, #00E64D 18%, transparent); color: var(--accent); }
.badge.blue { background: var(--blue-soft); color: var(--fg); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.grey { background: var(--surface-muted); color: var(--fg-muted); }

.flash { padding: 13px 16px; border-radius: var(--r-card); margin-bottom: 18px; font-weight: 600; font-size: 14px;
  background: color-mix(in oklab, #00E64D 14%, var(--surface)); color: var(--fg); border: 1px solid color-mix(in oklab, #00E64D 45%, transparent); }
.flash-err { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in oklab, var(--danger) 35%, transparent); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 20px 0; color: var(--fg-muted); }
.serp { margin-top: 16px; padding: 16px; border: 1px solid var(--border); border-radius: var(--r-card); background: #fff; }
.serp span { display: block; font-family: Arial, sans-serif; }
.serp-url { font-size: 12.5px; color: #1e6b3a; }
.serp-t { font-size: 19px; color: #1a0dab; margin: 3px 0; }
.serp-d { font-size: 13.5px; color: #4d5156; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 10px 18px; margin: 0; }
.kv dt { color: var(--fg-muted); font-size: 13.5px; font-weight: 600; }
.kv dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.thumb { width: 68px; height: 46px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-muted); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 15px; text-decoration: none; color: var(--fg-muted); font-weight: 600; font-size: 14px; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--fg); }
.tabs a.on { color: var(--fg); border-color: #00E64D; }
.rows .row-i { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; padding: 18px; border: 1px solid var(--border); border-radius: var(--r-card); margin-bottom: 14px; background: var(--surface-alt); }
.rows .row-i .full { grid-column: 1 / -1; }
.rows .row-tools { grid-column: 1 / -1; display: flex; gap: 6px; justify-content: flex-end; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }

/* ---------- media ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.media-i { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.media-i img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-muted); display: block; }
.media-i .mi-b { padding: 10px 12px; font-size: 12.5px; display: flex; flex-direction: column; gap: 5px; }
.media-i .mi-b b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-i .mi-b input { min-height: 34px; padding: 6px 9px; font-size: 12.5px; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--r-card); padding: 26px; text-align: center; background: var(--surface); margin-bottom: 20px; transition: border-color .2s, background .2s; }
.dropzone.over { border-color: #00E64D; background: var(--surface-green); }
.mp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; max-height: 60vh; overflow-y: auto; padding: 2px; }
.mp-i { border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); padding: 0; cursor: pointer; overflow: hidden; text-align: left; font: inherit; color: var(--fg); }
.mp-i:hover { border-color: #00E64D; box-shadow: 0 0 0 3px color-mix(in oklab, #00E64D 30%, transparent); }
.mp-i img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--surface-muted); }
.mp-i span { display: block; padding: 6px 8px; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-muted); }

/* ---------- modal and toasts ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(10, 14, 69, .55); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 1000; padding: 20px; animation: fade .2s var(--ease); }
.modal { background: var(--surface); color: var(--fg); border-radius: var(--r-card); width: 100%; max-width: 580px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(4, 6, 40, .4); animation: rise .25s var(--ease); }
.modal.wide { max-width: 1000px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.modal-h h2 { font-size: 22px; }
.modal-b { padding: 20px 22px; overflow-y: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.toasts { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 2000; }
.toast { background: #101562; color: #fff; padding: 12px 18px; border-radius: var(--r-card); box-shadow: var(--shadow); font-size: 14px; font-weight: 600; max-width: 400px; border-left: 4px solid #00E64D; transition: opacity .3s, transform .3s; }
.toast.err { border-left-color: #ff6b5e; }
.toast.out { opacity: 0; transform: translateY(8px); }
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; margin-top: 16px; max-height: 62vh; overflow-y: auto; }
.lib-g h4 { font-size: 13px; color: var(--accent); margin: 0 0 8px; font-weight: 700; }
.lib-i { display: flex; flex-direction: column; width: 100%; text-align: left; border: 1px solid var(--border); border-radius: var(--r-card); padding: 10px 12px; margin-bottom: 7px; background: var(--surface); cursor: pointer; font: inherit; color: var(--fg); transition: border-color .2s, box-shadow .2s; }
.lib-i:hover { border-color: #00E64D; box-shadow: var(--shadow-sm); }
.lib-i b { font-size: 13.5px; font-weight: 700; }
.lib-i small { color: var(--fg-muted); font-size: 12px; }

/* ---------- visual editor ---------- */
body.editing { display: block; }
body.editing .side, body.editing .top { display: none; }
body.editing .content { padding: 0; max-width: none; }
.ed { display: flex; flex-direction: column; height: 100vh; }
.ed-top { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: #101562; color: #fff; flex-wrap: wrap; }
.ed-top .btn { color: #fff; border-color: rgba(255, 255, 255, .55); }
.ed-top .btn:hover { background: #fff; color: #101562; border-color: #fff; }
.ed-top .btn.primary { color: #101562; border-color: #00E64D; }
.ed-top .btn.primary:hover { background: #00c843; color: #101562; }
.ed-top .btn:disabled:hover { background: transparent; color: #fff; }
.ed-top .check { color: #C9CDF0; }
.ed-title { display: flex; align-items: center; gap: 10px; margin: 0 8px; min-width: 0; }
.ed-title b { white-space: nowrap; font-family: var(--display); font-weight: 900; font-size: 18px; letter-spacing: -0.01em; }
.ed-title .muted { color: #b9bde6; }
.ed-state { font-size: 12px; }
.ed-top .badge.green { background: rgba(0, 230, 77, .2); color: #2BF265; }
.ed-top .badge.amber { background: rgba(255, 190, 60, .2); color: #ffd37a; }
.ed-top .badge.blue { background: rgba(255, 255, 255, .14); color: #fff; }
.seg { display: inline-flex; border: 1px solid rgba(255, 255, 255, .4); border-radius: var(--r-btn); overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 0 11px; height: 32px; font: 600 12.5px var(--font); cursor: pointer; color: #C9CDF0; }
.seg button + button { border-left: 1px solid rgba(255, 255, 255, .25); }
.seg button.on { background: #00E64D; color: #101562; }
.ed-body { flex: 1; display: grid; grid-template-columns: 256px 1fr 310px; min-height: 0; }
.ed-left, .ed-right { background: var(--surface); overflow-y: auto; min-height: 0; }
.ed-left { border-right: 1px solid var(--border); }
.ed-right { border-left: 1px solid var(--border); }
.ed-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.ed-h b { font-family: var(--display); font-weight: 900; font-size: 17px; }
.pad { padding: 16px; }
.ed-sections { list-style: none; margin: 0; padding: 8px; }
.ed-sections li { display: flex; align-items: center; border-radius: var(--r-btn); }
.ed-sections li:hover, .ed-sections li.on { background: var(--surface-alt); }
.ed-sections li.on { box-shadow: inset 3px 0 0 #00E64D; }
.ed-sections li.is-hidden .ed-sec-name { color: var(--fg-subtle); }
.ed-sec-name { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; padding: 9px 10px; font: 600 13px var(--font); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); }
.ed-sec-tools { display: none; gap: 1px; padding-right: 4px; }
.ed-sections li:hover .ed-sec-tools, .ed-sections li.on .ed-sec-tools { display: flex; }
.ed-sec-tools button { width: 24px; height: 26px; border: 0; background: transparent; cursor: pointer; border-radius: 4px; color: var(--fg-muted); font-size: 12px; padding: 0; }
.ed-sec-tools button:hover { background: var(--surface); color: var(--fg); }
.ed-stage { background: var(--surface-alt); overflow: hidden; min-width: 0; position: relative; }
.ed-canvas { position: relative; margin: 0 auto; }
.ed-canvas iframe { position: absolute; top: 0; left: 0; transform-origin: 0 0; border: 0; background: #fff; display: block; }
.ed-canvas[data-device="tablet"] iframe, .ed-canvas[data-device="mobile"] iframe { box-shadow: var(--shadow); border-radius: 0; }
.ip { padding: 16px; border-bottom: 1px solid var(--border); }
.ip h3 { font-size: 13px; color: var(--accent); margin-bottom: 10px; font-weight: 700; }
.tool-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.i-thumb { width: 100%; max-height: 170px; object-fit: cover; border-radius: var(--r-card); border: 1px solid var(--border); background: var(--surface-muted); }

/* ---------- post editor ---------- */
.post-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.title-in { font-family: var(--display) !important; font-weight: 900 !important; font-size: 28px !important; letter-spacing: -0.02em; padding: 14px 16px !important; min-height: 60px !important; }
#quill { min-height: 460px; font-size: 16px; background: var(--surface); color: var(--fg); }
.ql-toolbar.ql-snow { border-radius: var(--r-card) var(--r-card) 0 0; border-color: var(--border-strong) !important; background: var(--surface-alt); position: sticky; top: 68px; z-index: 5; font-family: var(--font) !important; }
.ql-container.ql-snow { border-radius: 0 0 var(--r-card) var(--r-card); border-color: var(--border-strong) !important; font: 500 16px/1.75 var(--font) !important; }
.ql-editor { min-height: 460px; }
.ql-editor h2, .ql-editor h3, .ql-editor h4 { font-family: var(--display); font-weight: 900; letter-spacing: -0.015em; margin-top: 1.1em; }
.ql-editor > *:first-child { margin-top: 0; }
.ql-editor p + p, .ql-editor ul, .ql-editor ol, .ql-editor blockquote { margin-top: .8em; }
.ql-editor a { color: var(--accent); }
[data-theme="dark"] .ql-snow .ql-stroke { stroke: #C9CDF0; }
[data-theme="dark"] .ql-snow .ql-fill { fill: #C9CDF0; }
[data-theme="dark"] .ql-snow .ql-picker { color: #C9CDF0; }
[data-theme="dark"] .ql-snow .ql-picker-options { background: var(--surface); }
[data-theme="dark"] .ql-editor.ql-blank::before { color: var(--fg-subtle); }
.feat-prev { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-card); border: 1px solid var(--border); background: var(--surface-muted); display: block; margin-bottom: 10px; }

@media (max-width: 1100px) {
  .ed-body { grid-template-columns: 210px 1fr 270px; }
  .grid2, .post-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  body.app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; width: 260px; transform: translateX(-100%); transition: transform .25s var(--ease); }
  .side::after { display: none; }
  body.side-open .side { transform: none; box-shadow: var(--shadow); }
  .menu-btn { display: inline-grid; }
  .content { padding: 20px 16px 44px; }
  .top { padding: 10px 14px; }
  .top h1 { font-size: 20px; }
  .uname { display: none; }
  .ed-body { grid-template-columns: 1fr; }
  .ed-left, .ed-right { max-height: 30vh; }
  .kv { grid-template-columns: 1fr; }
  .search input { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }


/* ---------- Dark theme: near-black surfaces in place of the navy panels ---------- */
[data-theme="dark"] .side { background: #0b0d16; border-right-color: rgba(255, 255, 255, .07); }
[data-theme="dark"] .side::after { background: radial-gradient(220px 180px at 10% 100%, rgba(0, 230, 77, .10), transparent 70%); }
[data-theme="dark"] .side a.on { background: rgba(255, 255, 255, .07); }
[data-theme="dark"] .hero { background: radial-gradient(520px 260px at 100% 120%, rgba(0, 230, 77, .22), transparent 65%), radial-gradient(500px 300px at 0% -40%, rgba(62, 78, 200, .30), transparent 60%), #10131f; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
[data-theme="dark"] .hero p { color: #b4b8cc; }
[data-theme="dark"] .hero .btn:not(.primary):hover { color: #07080f; }
[data-theme="dark"] .toast { background: #151927; box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, .08); }
[data-theme="dark"] .ed-top { background: #0b0d16; border-bottom: 1px solid rgba(255, 255, 255, .08); }
[data-theme="dark"] .ed-top .btn:hover { color: #07080f; }
[data-theme="dark"] .ql-snow .ql-stroke { stroke: #b4b8cc; }
[data-theme="dark"] .ql-snow .ql-fill { fill: #b4b8cc; }
[data-theme="dark"] .ql-snow .ql-picker { color: #b4b8cc; }
[data-theme="dark"] body.bare, body.bare[data-theme="dark"] { background: radial-gradient(900px 520px at 100% 110%, rgba(0, 230, 77, .16), transparent 60%), radial-gradient(700px 500px at -10% -20%, rgba(62, 78, 200, .28), transparent 60%), #07080f; }
[data-theme="dark"] .auth-card { box-shadow: 0 30px 80px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .08); }
.hero .actions { flex-wrap: wrap; }
