/* Go Create Studio: dashboard styles */
@font-face { font-family: 'Inter'; src: url('/assets/fonts/inter-var.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; src: url('/assets/fonts/inter-var-ext.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #f5f5f2; --surface: #fff; --surface-2: #fafaf8; --surface-3: #f2f1ed;
  --border: #e5e3dd; --border-strong: #d3d0c8;
  --text: #1b1a19; --text-2: #5b5751; --text-3: #8c877e;
  --accent: #4a44d4; --accent-hover: #3d37bf; --accent-ink: #fff; --accent-soft: #eeedfb; --accent-line: #c9c6f3;
  --success: #1d7348; --success-soft: #e6f4ec; --warning: #8f5b00; --warning-soft: #fcf2df; --danger: #bd3a31; --danger-soft: #fcebe9; --info: #23608f; --info-soft: #e7f1f9;
  --sidebar: #16151a; --sidebar-2: #211f27; --sidebar-3: #2b2932; --sidebar-text: #d4d1da; --sidebar-muted: #8e8996;
  --radius-sm: 7px; --radius: 10px; --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(22,20,16,.05);
  --shadow: 0 1px 2px rgba(22,20,16,.05), 0 4px 14px -6px rgba(22,20,16,.10);
  --shadow-lg: 0 24px 60px -24px rgba(22,20,16,.38), 0 2px 8px rgba(22,20,16,.06);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --focus: 0 0 0 3px rgba(74,68,212,.28);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.011em; }
h1 { font-size: 24px; font-weight: 650; }
h2 { font-size: 17px; font-weight: 620; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 10px; }
code, pre { font-family: var(--mono); font-size: 12.5px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 980px) { .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid3 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .grid2, .grid4 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; text-decoration: none !important; }
.btn:hover { background: var(--surface-3); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { flex: 0 0 auto; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(40,34,160,.25); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #17603c; }
.btn-danger { color: var(--danger); border-color: #ecc5c1; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #a3302a; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn .spin { width: 15px; height: 15px; }

/* ------------------------------------------------------------ cards, stats, tables */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2 { flex: 1; }
.card-body { padding: 20px; }
.card-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.stat { padding: 18px 20px; }
.stat .k { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.stat .v { margin-top: 4px; font-size: 28px; font-weight: 650; letter-spacing: -.02em; }
.stat .s { margin-top: 2px; font-size: 12.5px; color: var(--text-3); }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 550; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.table td .t1 { font-weight: 560; }
.table td .t2 { font-size: 12.5px; color: var(--text-3); }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 560; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-info { background: var(--info-soft); color: var(--info); }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 9px 16px; font-size: 13.5px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; word-break: break-word; }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 8px; } }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--radius); background: var(--info-soft); color: #18476b; font-size: 13.5px; border: 1px solid #cfe2f1; }
.alert svg { flex: 0 0 auto; margin-top: 1px; }
.alert-warning { background: var(--warning-soft); color: #6d4500; border-color: #f0dcb6; }
.alert-danger { background: var(--danger-soft); color: #8b2a23; border-color: #f2cdc9; }
.alert-success { background: var(--success-soft); color: #165a38; border-color: #c7e7d4; }
.alert p:last-child { margin: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .t1 { font-weight: 560; }
.list .t2 { font-size: 12.5px; color: var(--text-3); }
pre.code { margin: 0; padding: 14px 16px; background: #15141a; color: #e8e6ee; border-radius: var(--radius); overflow: auto; max-height: 420px; line-height: 1.55; }
.empty { padding: 40px 24px; text-align: center; color: var(--text-2); }
.empty .ico { width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty p { max-width: 420px; margin: 0 auto 14px; font-size: 13.5px; }
.skel { background: linear-gradient(90deg, #eceae5 25%, #f4f3ef 50%, #eceae5 75%); background-size: 200% 100%; animation: skel 1.2s infinite; border-radius: 8px; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.spin { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-page { display: grid; place-items: center; min-height: 40vh; color: var(--text-3); }

/* ------------------------------------------------------------ forms */
.field { display: block; }
.field + .field { margin-top: 16px; }
.field > label, .field > .label { display: block; font-weight: 560; font-size: 13.5px; margin-bottom: 6px; }
.field .req { color: var(--danger); margin-left: 2px; }
.field .help { font-size: 12.5px; color: var(--text-3); margin-top: 5px; }
.field .err { font-size: 12.5px; color: var(--danger); margin-top: 5px; font-weight: 500; }
.field .label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.field .label-row > label { margin: 0; font-weight: 560; font-size: 13.5px; }
.field .count { font-size: 12px; color: var(--text-3); font-weight: 450; white-space: nowrap; }
.field .count.over { color: var(--danger); font-weight: 600; }
.input, select.input, textarea.input { display: block; width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 14.5px; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%235b5751' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.input:hover { border-color: #bdb9b0; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.input.invalid, .field.has-error .input { border-color: var(--danger); }
.input[readonly] { background: var(--surface-2); color: var(--text-2); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-row > .field + .field { margin-top: 0; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }
fieldset.group { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 16px; margin: 16px 0 0; }
fieldset.group legend { padding: 0 6px; font-weight: 600; font-size: 13px; color: var(--text-2); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--accent); flex: 0 0 auto; }
.toggle { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .track { width: 38px; height: 22px; border-radius: 11px; background: #cfccc4; transition: background .15s; position: relative; flex: 0 0 auto; }
.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.toggle input:checked + .track { background: var(--success); }
.toggle input:checked + .track::after { transform: translateX(16px); }
.toggle input:focus-visible + .track { box-shadow: var(--focus); }
.img-field { display: flex; align-items: center; gap: 14px; }
.img-field .thumb { width: 96px; height: 72px; border-radius: 8px; background: var(--surface-3) center/cover no-repeat; border: 1px solid var(--border); flex: 0 0 auto; overflow: hidden; display: grid; place-items: center; color: var(--text-3); }
.img-field .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pw-meter { height: 4px; border-radius: 2px; background: var(--surface-3); margin-top: 8px; overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; background: var(--danger); transition: width .2s, background .2s; }

/* ------------------------------------------------------------ app shell */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 20px 18px; color: #fff; text-decoration: none !important; }
.brand .mark { width: 32px; height: 32px; border-radius: 9px; flex: 0 0 auto; }
.brand b { display: block; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.brand span { display: block; font-size: 11.5px; color: var(--sidebar-muted); }
.org-card { margin: 0 12px 10px; padding: 12px; border-radius: 10px; background: var(--sidebar-2); display: flex; align-items: center; gap: 10px; }
.org-card .logo { width: 36px; height: 36px; border-radius: 8px; background: #fff; flex: 0 0 auto; overflow: hidden; display: grid; place-items: center; color: #222; font-weight: 700; }
.org-card .logo img { width: 100%; height: 100%; object-fit: contain; }
.org-card b { display: block; font-size: 13.5px; color: #fff; font-weight: 600; line-height: 1.3; }
.org-card span { display: block; font-size: 12px; color: var(--sidebar-muted); }
.nav-group { padding: 6px 12px; }
.nav-label { padding: 12px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--sidebar-muted); font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--sidebar-text); font-size: 14px; font-weight: 480; text-decoration: none !important; transition: background .12s, color .12s; }
.nav a svg { opacity: .8; flex: 0 0 auto; }
.nav a:hover { background: var(--sidebar-2); color: #fff; }
.nav a.active { background: var(--sidebar-3); color: #fff; font-weight: 560; }
.nav a.active svg { opacity: 1; color: #a9a4ff; }
.nav a .dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: #f0b44c; }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid #2a2830; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 9px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #3a3746; color: #fff; display: grid; place-items: center; font-weight: 650; font-size: 13px; flex: 0 0 auto; }
.user-chip b { display: block; font-size: 13.5px; color: #fff; font-weight: 560; }
.user-chip span { display: block; font-size: 12px; color: var(--sidebar-muted); }
.sidebar-foot .nav a { font-size: 13.5px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px 36px 64px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .titles { flex: 1; min-width: 240px; }
.page-head .eyebrow { font-size: 12.5px; color: var(--text-3); font-weight: 520; margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.page-head .eyebrow a { color: var(--text-3); }
.page-head p { margin: 6px 0 0; color: var(--text-2); max-width: 680px; }
.support-bar { display: flex; align-items: center; gap: 10px; padding: 9px 36px; background: #fff7e6; border-bottom: 1px solid #f0dcb0; color: #6b4500; font-size: 13px; }
.publish-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 36px; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.publish-bar .state { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 520; flex: 1; min-width: 0; }
.publish-bar .state .sub { font-weight: 400; color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scrim { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(15,14,18,.4); }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--sidebar); color: #fff; position: sticky; top: 0; z-index: 30; }
  .topbar .btn { background: transparent; border-color: #3a3842; color: #fff; }
  .topbar b { font-size: 14.5px; font-weight: 600; }
  .content { padding: 22px 16px 56px; }
  .publish-bar { top: 52px; padding: 10px 16px; flex-wrap: wrap; }
  .support-bar { padding: 9px 16px; }
  h1 { font-size: 21px; }
}

/* ------------------------------------------------------------ site editor */
.site-hero { display: flex; gap: 20px; align-items: center; padding: 22px; }
.site-hero .logo { width: 64px; height: 64px; border-radius: 14px; border: 1px solid var(--border); background: #fff; overflow: hidden; display: grid; place-items: center; flex: 0 0 auto; font-weight: 700; font-size: 22px; color: var(--accent); }
.site-hero .logo img { width: 100%; height: 100%; object-fit: contain; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tile { display: flex; gap: 14px; padding: 16px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s; }
.tile:hover { border-color: var(--accent-line); box-shadow: var(--shadow); }
.tile .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: 0 0 auto; }
.tile b { display: block; font-weight: 600; margin-bottom: 2px; }
.tile span { display: block; font-size: 12.5px; color: var(--text-2); line-height: 1.4; }
.items { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.item:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.item.dim { opacity: .62; }
.item .date { width: 52px; text-align: center; border-radius: 9px; background: var(--surface-3); padding: 6px 0 5px; flex: 0 0 auto; }
.item .date b { display: block; font-size: 18px; line-height: 1.05; font-weight: 650; }
.item .date span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); font-weight: 600; }
.item .thumb { width: 58px; height: 44px; border-radius: 7px; background: var(--surface-3) center/cover; flex: 0 0 auto; overflow: hidden; }
.item .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item .body { flex: 1; min-width: 0; cursor: pointer; }
.item .t1 { font-weight: 580; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .t2 { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .actions { display: flex; gap: 4px; flex: 0 0 auto; }
.section-sub { display: flex; align-items: center; gap: 10px; margin: 26px 0 10px; color: var(--text-2); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.section-sub::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.comp-host { margin-bottom: 18px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); cursor: pointer; text-align: left; padding: 0; font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s; }
.media-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow); }
.media-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.media-card .img { aspect-ratio: 4/3; background: var(--surface-3) center/cover no-repeat; display: block; overflow: hidden; }
.media-card .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-card .meta { padding: 8px 10px; }
.media-card .meta b { display: block; font-size: 12.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card .meta span { font-size: 11.5px; color: var(--text-3); }
.dropzone { border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--text-2); background: var(--surface-2); transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }

/* ------------------------------------------------------------ dialogs, drawers, toasts */
dialog.modal { border: 0; padding: 0; border-radius: 16px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: var(--shadow-lg); color: var(--text); background: var(--surface); }
dialog.modal.wide { width: min(860px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(18,16,22,.45); }
dialog.modal[open] { display: flex; flex-direction: column; animation: pop .16s ease-out; }
@keyframes pop { from { transform: translateY(8px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { dialog.modal[open] { animation: none; } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; }
.modal-head h2 { flex: 1; font-size: 17px; }
.modal-body { padding: 4px 20px 18px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 16px 16px; }
dialog.drawer { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(620px, 100vw); border: 0; padding: 0; background: var(--surface); box-shadow: var(--shadow-lg); color: var(--text); }
dialog.drawer[open] { display: flex; flex-direction: column; animation: slide .2s ease-out; }
dialog.drawer::backdrop { background: rgba(18,16,22,.4); }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { dialog.drawer[open] { animation: none; } }
.drawer .modal-body { flex: 1; padding-top: 8px; }
.drawer .modal-foot { border-radius: 0; }
.toasts { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: #1d1c22; color: #fff; box-shadow: var(--shadow-lg); font-size: 13.5px; animation: pop .18s ease-out; }
.toast.success svg { color: #6fd39e; }
.toast.error svg { color: #ff8f86; }
.toast .x { margin-left: auto; color: #aaa; background: none; border: 0; cursor: pointer; padding: 0 0 0 6px; font-size: 16px; line-height: 1; }
.copy-box { display: flex; gap: 8px; }
.copy-box .input { font-family: var(--mono); font-size: 12.5px; }

/* ------------------------------------------------------------ sign-in pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: radial-gradient(1200px 600px at 10% -10%, #e9e7fb 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #f6ead6 0%, transparent 55%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card { padding: 30px 28px 26px; box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand .mark { width: 40px; height: 40px; border-radius: 11px; }
.auth-brand b { display: block; font-size: 17px; font-weight: 650; letter-spacing: -.015em; }
.auth-brand span { display: block; font-size: 12.5px; color: var(--text-3); }
.auth h1 { font-size: 21px; margin-bottom: 6px; }
.auth .lead { color: var(--text-2); margin-bottom: 20px; font-size: 14px; }
.auth form .btn-block { margin-top: 20px; }
.auth .below { margin-top: 18px; text-align: center; font-size: 13.5px; color: var(--text-2); }
.auth .legal { margin-top: 20px; text-align: center; font-size: 12px; color: var(--text-3); }
.steps { display: flex; gap: 8px; margin-bottom: 18px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); }
.steps i.on { background: var(--accent); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 70px; }
.pw-wrap button { position: absolute; right: 6px; top: 6px; height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer; }

/* ------------------------------------------------------------ refinements */
h1[tabindex="-1"]:focus, h1[tabindex="-1"]:focus-visible { outline: none; box-shadow: none; }
.topbar .mark { width: 28px; height: 28px; flex: 0 0 auto; }
.item .t1 { white-space: normal; overflow-wrap: anywhere; }
.item .t2 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.quick { display: flex; gap: 10px; flex-wrap: wrap; }
.quick .btn { height: 44px; padding: 0 18px; font-size: 14.5px; border-radius: 10px; }
.full-note { font-size: 12.5px; color: var(--text-3); align-self: center; }
@media (max-width: 900px) {
  .publish-bar .state { flex: 1 1 100%; flex-wrap: wrap; }
  .publish-bar .state .sub { white-space: normal; }
  .item { padding: 12px; gap: 12px; }
  .item .actions .btn-icon { width: 36px; height: 36px; }
  .page-head .btn-primary { width: 100%; height: 44px; }
  .quick .btn { flex: 1 1 100%; }
}

/* ---------------------------------------------------------------- website code + code map */
.cm-host { display: flex; gap: 12px; align-items: flex-start; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.cm-host .k { font-size: 12.5px; color: var(--text-3); font-weight: 520; margin-bottom: 2px; }
.cm-link { font-weight: 600; word-break: break-all; }
.cm-live { padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); margin-bottom: 14px; }
.cm-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--surface-3); }
.cm-bar > span { display: block; height: 100%; min-width: 3px; }
.cm-b-edit { background: var(--success); }
.cm-b-fixed { background: var(--info); opacity: .55; }
.cm-b-off { background: var(--warning); opacity: .75; }
.cm-upload { display: grid; gap: 10px; padding-top: 4px; }
.cm-upload .field-label { font-weight: 600; font-size: 13.5px; }
.cm-upload .help { font-size: 12.5px; color: var(--text-3); }
.cm-all { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 10px; }
.cm-all > summary { cursor: pointer; font-weight: 600; font-size: 13.5px; padding: 6px 0; }
.cm-versions > li { padding: 10px 0; flex-wrap: wrap; }
.cm-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.cm-tile .v { font-size: 24px; }
.cm-t-edit .v { color: var(--success); }
.cm-t-fixed .v { color: var(--info); }
.cm-t-warn .v { color: var(--warning); }
@media (max-width: 1100px) { .cm-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cm-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .cm-tile { padding: 12px 14px; } .cm-tile .v { font-size: 21px; } }
.cm-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; position: sticky; top: 0; z-index: 5; padding: 10px 0; background: var(--bg); }
.cm-filters .input { flex: 1 1 240px; max-width: 380px; }
.cm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cm-chip { height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 540; cursor: pointer; }
.cm-chip:hover { border-color: var(--border-strong); color: var(--text); }
.cm-chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cm-chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cm-group { padding: 0; overflow: hidden; }
.cm-group > summary { display: flex; align-items: center; gap: 10px; padding: 14px 18px; cursor: pointer; list-style: none; font-weight: 620; }
.cm-group > summary::-webkit-details-marker { display: none; }
.cm-group > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(-45deg); transition: transform .15s; flex: 0 0 auto; }
.cm-group[open] > summary::before { transform: rotate(45deg); }
.cm-gname { flex: 1; min-width: 0; }
.cm-gcount { font-size: 12.5px; color: var(--text-3); font-weight: 520; display: flex; align-items: center; }
.cm-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.cm-row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.cm-row:last-child { border-bottom: 0; }
.cm-status { flex: 0 0 auto; width: 104px; font-size: 11.5px; font-weight: 640; text-transform: uppercase; letter-spacing: .03em; padding: 3px 0 0; }
.cm-s-edit { color: var(--success); }
.cm-s-fixed { color: var(--info); }
.cm-s-off { color: var(--warning); }
.cm-s-code { color: var(--text-3); }
.cm-main { min-width: 0; }
.cm-what { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.cm-kind { font-size: 12px; color: var(--text-3); font-weight: 560; }
.cm-path { font-size: 11.5px; }
.cm-text { flex: 1 1 100%; overflow-wrap: anywhere; }
.cm-sub { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; font-size: 12.5px; }
.cm-field { color: var(--success); font-weight: 560; display: inline-flex; align-items: center; gap: 2px; }
.cm-warn { color: var(--warning); font-weight: 560; display: inline-flex; align-items: center; gap: 2px; }
.cm-href { overflow-wrap: anywhere; font-size: 11.5px; }
.cm-where { margin-top: 3px; font-size: 11px; color: var(--text-3); overflow-wrap: anywhere; }
.cm-view { flex: 0 0 auto; }
.cm-view .mono { font-size: 11.5px; }
.cm-files > summary { padding: 14px 18px; cursor: pointer; font-weight: 620; }
.cm-files .list > li { padding: 8px 18px; }
.cm-code { font-family: var(--mono); font-size: 12px; line-height: 1.55; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 60vh; overflow: auto; padding: 8px 0; }
.cm-line { display: flex; gap: 12px; padding: 0 12px; }
.cm-line .n { flex: 0 0 auto; width: 44px; text-align: right; color: var(--text-3); user-select: none; }
.cm-line .c { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.cm-line.focus { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
@media (max-width: 640px) {
  .cm-row { flex-wrap: wrap; padding: 11px 14px; gap: 6px 10px; }
  .cm-status { width: auto; }
  .cm-main { flex: 1 1 100%; order: 2; }
  .cm-view { order: 1; margin-left: auto; }
  .cm-group > summary { padding: 13px 14px; }
  .cm-filters .input { max-width: none; }
}

/* long forms: jump row and a save bar that stays in reach */
.jump-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }
.jump-chips .cm-chip { height: 30px; font-size: 12.5px; }
fieldset.group { scroll-margin-top: 84px; }
fieldset.group > .help { margin: 0 0 12px; }
.card-foot.sticky-foot { position: sticky; bottom: 0; z-index: 4; background: var(--surface); box-shadow: 0 -8px 20px rgba(20, 20, 30, .07); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
@media (max-width: 640px) { .card-foot.sticky-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); } }
