/* Starien CMS admin design system.
   Tokens follow starien.com: Figtree, #2E91FC → #3F6BF2 → #7A4FE6 accent,
   a warm canvas, soft white cards with large radii and pill-shaped controls. */

@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('/admin/assets/fonts/figtree-latin-wght-normal.woff2') format('woff2');
}

:root {
  --canvas: #f3f1ec;
  --background: #fbfcfd;
  --foreground: #10171f;
  --card: #ffffff;
  --muted: #f2f4f6;
  --muted-foreground: #585e66;
  --subtle: #8a9098;
  --border: #e2e5e9;
  --field: #f6f9fc;
  --input: #c9ced5;
  --sidebar: #ffffff;
  --sidebar-hover: #f1f4f8;
  --brand-blue: #2e91fc;
  --brand-indigo: #3f6bf2;
  --brand-violet: #7a4fe6;
  --brand-gradient: linear-gradient(100deg, #2e91fc 0%, #3f6bf2 50%, #7a4fe6 100%);
  --brand-pill: linear-gradient(100deg, #1a73e0 0%, #3a62e6 55%, #6a45de 100%);
  --brand-glow: 0 8px 18px -9px rgb(42 98 230 / 0.75), inset 0 1px 0 rgb(255 255 255 / 0.18);
  --brand-tint: #eef4ff;
  --ring: rgb(47 145 252 / 0.35);
  --success: #009957;
  --success-tint: #e6f8f0;
  --warning: #b86e00;
  --warning-tint: #fff6d6;
  --danger: #df2225;
  --danger-tint: #fdecec;
  --sun: #ffd43b;
  --lilac: #f1ecff;
  --sky: #eaf3ff;
  --mint: #e6f8f0;
  --shadow-soft: 0 1px 2px rgb(16 23 31 / 0.04), 0 4px 16px -4px rgb(16 23 31 / 0.08);
  --shadow-card: 0 2px 4px rgb(20 20 40 / 0.04), 0 30px 60px -34px rgb(40 60 140 / 0.35);
  --shadow-pop: 0 0 0 1px rgb(16 23 31 / 0.04), 0 4px 8px -2px rgb(16 23 31 / 0.06), 0 24px 48px -12px rgb(16 34 57 / 0.22);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --logo-trail: #2e91fc;
  --logo-star: #2e91fc;
  --sidebar-w: 264px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Figtree, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--foreground);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-indigo); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.starien-logo { height: 28px; width: auto; overflow: visible; display: block; color: var(--foreground); }
.starien-logo-trail path { transform-box: fill-box; transition: transform .35s cubic-bezier(.2,.8,.2,1); }
a:hover .starien-logo-trail path { transform: translateX(calc(8% + var(--i) * 4%)); }

.text-gradient { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.display { font-weight: 900; letter-spacing: -0.04em; line-height: 1.05; }

/* ---------- Buttons ---------- */
.btn {
  --h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 20px; border-radius: 999px; border: 0;
  font: inherit; font-weight: 800; font-size: 14px; letter-spacing: 0.01em;
  cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: transform .12s, box-shadow .2s, background-color .2s, filter .2s;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--brand-pill); color: #fff; box-shadow: var(--brand-glow); }
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 12px 24px -10px rgb(42 98 230 / 0.8), inset 0 1px 0 rgb(255 255 255 / 0.18); }
.btn-primary[disabled] { filter: grayscale(.4) opacity(.6); cursor: not-allowed; }
.btn-soft { background: rgb(16 23 31 / 0.06); color: var(--foreground); }
.btn-soft:hover { background: rgb(16 23 31 / 0.1); }
.btn-ghost { background: transparent; color: var(--muted-foreground); }
.btn-ghost:hover { background: rgb(16 23 31 / 0.05); color: var(--foreground); }
.btn-outline { background: var(--card); color: var(--foreground); box-shadow: inset 0 0 0 1px var(--border); }
.btn-outline:hover { box-shadow: inset 0 0 0 1px var(--input); }
.btn-danger { background: var(--danger-tint); color: var(--danger); }
.btn-danger:hover { background: #fbd9d9; }
.btn-sm { --h: 36px; padding: 0 14px; font-size: 13px; }
.btn-lg { --h: 52px; padding: 0 28px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: var(--h); padding: 0; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: 18px; }
.label { font-size: 14px; font-weight: 700; color: var(--foreground); display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.label .count { font-weight: 500; font-size: 12px; color: var(--subtle); font-variant-numeric: tabular-nums; }
.label .count.over { color: var(--danger); font-weight: 700; }
.hint { font-size: 13px; color: var(--muted-foreground); }
.input, .textarea, .select {
  width: 100%; font: inherit; font-size: 15px; color: var(--foreground);
  background: var(--field); border: 1px solid var(--input); border-radius: var(--radius);
  padding: 11px 14px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.input { height: 46px; }
.input:hover, .textarea:hover, .select:hover { border-color: #aab1ba; }
.input:focus, .textarea:focus, .select:focus { outline: none; background: #fff; border-color: var(--brand-blue); box-shadow: 0 0 0 4px var(--ring); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.textarea.tall { min-height: 360px; font-size: 15px; }
.input-lg { height: 56px; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.input::placeholder, .textarea::placeholder { color: #8a9098; }
.select { height: 46px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23585e66' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }

/* ---------- Sign in ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; padding: 12px 16px 24px; }
.auth-bar {
  max-width: 1152px; width: 100%; margin: 0 auto; display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-radius: 999px; padding: 10px 12px 10px 22px; box-shadow: var(--shadow-soft);
}
.auth-bar .starien-logo { height: 30px; }
.auth-bar .btn .short { display: none; }
.auth-grid { flex: 1; max-width: 1120px; width: 100%; margin: 16px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.auth-hero {
  position: relative; overflow: hidden; border-radius: var(--radius-xl); background: var(--brand-gradient);
  color: #fff; padding: 40px; display: flex; flex-direction: column; justify-content: space-between; min-height: 580px;
}
.auth-hero .watermark { position: absolute; right: -90px; top: 40px; width: 420px; opacity: .14; }
.auth-hero .watermark path { fill: #fff; }
.auth-hero .stars span { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; opacity: .5; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; position: relative; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; font-weight: 800; font-size: 14px; color: var(--foreground); }
.chip.sun { background: var(--sun); } .chip.white { background: #fff; } .chip.lilac { background: #c9b8ff; } .chip.mint { background: #8fe3bd; }
.auth-hero h2 { font-size: clamp(36px, 4vw, 50px); font-weight: 900; letter-spacing: -0.045em; line-height: 1.02; position: relative; }
.auth-hero h2 em { font-style: normal; color: var(--sun); display: block; }
.auth-hero p { margin-top: 18px; font-size: 17px; line-height: 1.6; opacity: .9; max-width: 440px; position: relative; }
.auth-card {
  background: var(--card); border-radius: var(--radius-xl); box-shadow: inset 0 0 0 1px var(--border), var(--shadow-card);
  display: flex; align-items: center; justify-content: center; padding: 40px 48px;
}
.auth-form { width: 100%; max-width: 400px; }
.auth-form h1 { font-size: 35px; }
.auth-form .lede { margin: 8px 0 28px; color: var(--muted-foreground); font-size: 16px; }
.auth-form .btn-primary { margin-top: 26px; text-transform: uppercase; letter-spacing: 0.05em; }
.auth-foot { text-align: center; color: var(--muted-foreground); font-size: 13px; margin-top: 18px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); font-size: 14px; font-weight: 600; margin-bottom: 18px; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.alert-error { background: var(--danger-tint); color: #a3171a; }
.alert-info { background: var(--brand-tint); color: #1d4fbf; }
.alert-error ul { margin: 4px 0 0; padding-left: 18px; font-weight: 500; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  background: var(--sidebar); border-right: 1px solid var(--border); padding: 22px 14px 16px;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.sidebar .brand .starien-logo { height: 26px; }
.sidebar .brand .tag { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-indigo); background: var(--brand-tint); padding: 3px 8px; border-radius: 999px; }
.nav-label { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--subtle); padding: 14px 12px 6px; }
.nav { display: grid; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px; border-radius: 999px;
  color: #272e38; font-weight: 700; font-size: 15px; text-decoration: none; transition: background .15s, color .15s;
}
.nav a svg { width: 20px; height: 20px; flex: none; color: #6c727a; transition: color .15s; }
.nav a:hover { background: var(--sidebar-hover); }
.nav a:hover svg { color: var(--foreground); }
.nav a[aria-current='page'] { background: var(--brand-pill); color: #fff; box-shadow: var(--brand-glow); }
.nav a[aria-current='page'] svg { color: #fff; }
.nav a .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; min-width: 0; }
.sidebar-foot > * { min-width: 0; }
.site-switch {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-lg); background: var(--muted);
}
.site-switch img { width: 38px; height: 38px; border-radius: 12px; background: #fff; object-fit: contain; padding: 3px; box-shadow: var(--shadow-soft); }
.site-switch .name { font-weight: 800; font-size: 13px; line-height: 1.2; }
.site-switch .url { font-size: 12px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 8px; border-radius: 999px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--brand-gradient); font-size: 14px; flex: none; }
.user-chip .who { line-height: 1.2; min-width: 0; overflow: hidden; }
.user-chip .who a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who b { display: block; font-size: 14px; }
.user-chip .who a { font-size: 12px; color: var(--muted-foreground); }
.user-chip form { margin-left: auto; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 14px 32px; background: color-mix(in srgb, var(--canvas) 86%, transparent); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgb(16 23 31 / 0.06);
}
.topbar .editing { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar .editing img { width: 40px; height: 40px; border-radius: 12px; background: #fff; padding: 3px; object-fit: contain; box-shadow: var(--shadow-soft); flex: none; }
.topbar .editing .eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--subtle); line-height: 1; }
.topbar .editing .site-name { font-size: 18px; font-weight: 900; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--success); background: var(--success-tint); padding: 4px 10px; border-radius: 999px; }
.topbar .live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgb(0 153 87 / .18); }
.topbar .spacer { flex: 1; }
.menu-toggle { display: none; }

.content { padding: 28px 32px 64px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 34px; font-weight: 900; letter-spacing: -0.04em; }
.page-head p { color: var(--muted-foreground); margin-top: 6px; font-size: 16px; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 700; color: var(--muted-foreground); margin-bottom: 8px; }
.crumbs a { color: var(--muted-foreground); }
.crumbs svg { width: 14px; height: 14px; }

/* ---------- Cards ---------- */
.card { background: var(--card); border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--border), var(--shadow-soft); }
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 0; }
.card-head h2, .card-head h3 { font-size: 18px; font-weight: 800; }
.card-head .sub { font-size: 13px; color: var(--muted-foreground); font-weight: 500; }
.card-body { padding: 18px 24px 24px; }
.grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }

/* Welcome banner */
.welcome {
  position: relative; overflow: hidden; border-radius: var(--radius-xl); background: var(--brand-gradient); color: #fff;
  padding: 32px 36px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center;
}
.welcome h1 { font-size: 34px; font-weight: 900; letter-spacing: -0.04em; }
.welcome p { margin-top: 8px; font-size: 16px; opacity: .92; max-width: 560px; }
.welcome .actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.welcome .btn-white { background: #fff; color: var(--brand-indigo); box-shadow: 0 10px 22px -12px rgb(10 20 60 / .5); }
.welcome .btn-white:hover { filter: brightness(.97); }
.welcome .btn-glass { background: rgb(255 255 255 / .16); color: #fff; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .3); }
.welcome .btn-glass:hover { background: rgb(255 255 255 / .24); }
.welcome .watermark { position: absolute; right: -50px; bottom: -70px; width: 360px; opacity: .12; pointer-events: none; }
.welcome .watermark path { fill: #fff; }
.welcome .preview { width: 300px; border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 24px 40px -20px rgb(10 20 60 / .6); transform: rotate(2deg); position: relative; }
.welcome .preview .bar { height: 22px; background: #f2f4f6; display: flex; gap: 5px; align-items: center; padding: 0 9px; }
.welcome .preview .bar i { width: 7px; height: 7px; border-radius: 50%; background: #d4d8de; }
.welcome .preview img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.welcome .preview .cap { color: var(--foreground); padding: 10px 12px 12px; font-weight: 800; font-size: 13px; line-height: 1.3; }

.stat { padding: 20px 22px; display: flex; align-items: center; gap: 14px; }
.stat .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.stat .ico svg { width: 22px; height: 22px; }
.stat .num { font-size: 28px; font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.stat .lbl { font-size: 13px; font-weight: 700; color: var(--muted-foreground); margin-top: 4px; }
.tint-sky { background: var(--sky); color: #1a73e0; } .tint-lilac { background: var(--lilac); color: #6a45de; }
.tint-sun { background: var(--warning-tint); color: #b86e00; } .tint-mint { background: var(--mint); color: #00845a; }

.list { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 12px 24px; border-top: 1px solid var(--border);
  color: inherit; text-decoration: none !important; transition: background .12s;
}
.row:first-child { border-top: 0; }
a.row:hover { background: #f8fafc; }
.row .thumb { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: var(--muted); flex: none; }
.row .thumb svg { width: 22px; height: 22px; }
.row .t { font-weight: 800; font-size: 15px; }
.row .s { font-size: 13px; color: var(--muted-foreground); }
.row .grow { flex: 1; min-width: 0; }
.row .grow .t, .row .grow .s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .chev { color: var(--subtle); width: 18px; height: 18px; flex: none; }
.empty { padding: 32px 24px; text-align: center; color: var(--muted-foreground); }
.empty b { display: block; color: var(--foreground); font-size: 16px; margin-bottom: 4px; }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.badge-live { background: var(--success-tint); color: #00784a; }
.badge-draft { background: var(--warning-tint); color: #8a5300; }
.badge-muted { background: var(--muted); color: var(--muted-foreground); }
.badge-brand { background: var(--brand-tint); color: var(--brand-indigo); }
.badge-live::before, .badge-draft::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.activity li { display: flex; gap: 12px; padding: 10px 24px; font-size: 14px; }
.activity .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-blue); margin-top: 8px; flex: none; }
.activity .when { color: var(--subtle); font-size: 12px; }

/* ---------- Editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.section-card { margin-bottom: 20px; }
.section-card > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 18px 24px;
}
.section-card > summary::-webkit-details-marker { display: none; }
.section-card > summary .num { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand-indigo); font-weight: 900; font-size: 14px; flex: none; }
.section-card > summary h2 { font-size: 17px; font-weight: 800; }
.section-card > summary p { font-size: 13px; color: var(--muted-foreground); }
.section-card > summary .chev { margin-left: auto; width: 20px; height: 20px; color: var(--subtle); transition: transform .2s; }
.section-card[open] > summary .chev { transform: rotate(180deg); }
.section-card .section-body { padding: 4px 24px 24px; border-top: 1px solid var(--border); padding-top: 20px; }
.section-card.has-error { box-shadow: inset 0 0 0 2px var(--danger), var(--shadow-soft); }

.image-field { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 14px; align-items: center; }
.image-field .preview { width: 148px; aspect-ratio: 4 / 3; border-radius: var(--radius); background: var(--muted) center / cover no-repeat; box-shadow: inset 0 0 0 1px var(--border); display: grid; place-items: center; color: var(--subtle); }
.image-field .preview svg { width: 26px; height: 26px; }
.image-field .preview.has-img svg { display: none; }
.image-field .controls { display: grid; gap: 8px; }
.image-field .controls .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.image-field .url { font-size: 12px; color: var(--subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.list-field { display: grid; gap: 12px; }
.list-item { border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fcfdfe; }
.list-item > header { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--border); }
.list-item > header .title { font-weight: 800; font-size: 14px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item > header .tools { display: flex; gap: 2px; }
.list-item > .body { padding: 16px; display: grid; gap: 14px; }
.list-item > .body .field + .field { margin-top: 0; }
.list-item.removing { display: none; }
.add-item { justify-self: start; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.rail { position: sticky; top: 92px; display: grid; gap: 16px; }
.publish .card-body { display: grid; gap: 14px; }
.publish .status { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.publish .status .k { color: var(--muted-foreground); font-weight: 600; }
.publish .status .v { font-weight: 700; text-align: right; }
.publish .unsaved { display: none; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #8a5300; background: var(--warning-tint); padding: 8px 12px; border-radius: 12px; }
form.dirty .publish .unsaved { display: flex; }
.seo-preview { border-radius: var(--radius); background: var(--muted); padding: 14px; font-family: Arial, sans-serif; }
.seo-preview .u { font-size: 12px; color: #4d5156; }
.seo-preview .t { color: #1a0dab; font-size: 17px; line-height: 1.3; margin: 2px 0; }
.seo-preview .d { font-size: 13px; color: #4d5156; line-height: 1.45; }

.md-toolbar { display: flex; gap: 4px; padding: 6px; border: 1px solid var(--input); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: #fff; flex-wrap: wrap; }
.md-toolbar + .textarea { border-top-left-radius: 0; border-top-right-radius: 0; }
.md-toolbar button { height: 32px; min-width: 32px; padding: 0 8px; border: 0; background: transparent; border-radius: 8px; font: inherit; font-weight: 800; font-size: 13px; color: #3c434c; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.md-toolbar button:hover { background: var(--muted); }
.md-toolbar button svg { width: 16px; height: 16px; }

/* ---------- Tables / filters ---------- */
.tabs { display: inline-flex; gap: 4px; background: rgb(16 23 31 / .05); padding: 4px; border-radius: 999px; }
.tabs a { height: 34px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; font-weight: 800; font-size: 13px; color: var(--muted-foreground); text-decoration: none; }
.tabs a[aria-current='true'] { background: #fff; color: var(--foreground); box-shadow: var(--shadow-soft); }
.tabs a .n { font-size: 11px; color: var(--subtle); }

/* ---------- Media ---------- */
.media-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.dropzone {
  border: 2px dashed #c4cbd6; border-radius: var(--radius-lg); padding: 26px; text-align: center; background: #fff;
  transition: border-color .15s, background .15s; cursor: pointer; display: block;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand-blue); background: var(--brand-tint); }
.dropzone svg { width: 30px; height: 30px; color: var(--brand-indigo); margin: 0 auto 6px; }
.dropzone b { display: block; font-size: 15px; }
.dropzone span { font-size: 13px; color: var(--muted-foreground); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-top: 20px; }
.media-tile { position: relative; display: block; border-radius: var(--radius); overflow: hidden; background: var(--muted); aspect-ratio: 1; box-shadow: inset 0 0 0 1px var(--border); cursor: pointer; border: 0; padding: 0; width: 100%; }
.media-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.media-tile:hover img { transform: scale(1.04); }
.media-tile .name { position: absolute; inset: auto 0 0; padding: 18px 10px 8px; font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(transparent, rgb(0 0 0 / .6)); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-tile[aria-current='true'] { outline: 3px solid var(--brand-blue); outline-offset: 2px; }
.media-tile .no-alt { position: absolute; top: 8px; left: 8px; }
.media-detail img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.meta dt { color: var(--muted-foreground); font-weight: 600; }
.meta dd { margin: 0; font-weight: 600; word-break: break-all; }

/* Picker dialog */
dialog.picker { border: 0; border-radius: var(--radius-xl); padding: 0; width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 64px); box-shadow: var(--shadow-pop); }
dialog.picker::backdrop { background: rgb(16 23 31 / .45); backdrop-filter: blur(3px); }
.picker-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 1; }
.picker-head h2 { font-size: 20px; font-weight: 900; }
.picker-body { padding: 20px 24px 24px; overflow: auto; max-height: calc(100vh - 160px); }
.picker-body .media-grid { margin-top: 16px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 100;
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 999px;
  background: var(--foreground); color: #fff; font-weight: 700; font-size: 14px; box-shadow: var(--shadow-pop);
  animation: toast-in .35s cubic-bezier(.2,.8,.2,1) both;
}
.toast .ok { width: 26px; height: 26px; border-radius: 50%; background: var(--success); display: grid; place-items: center; }
.toast .ok svg { width: 16px; height: 16px; }
.toast.error .ok { background: var(--danger); }
.toast a { color: #fff; background: rgb(255 255 255 / .14); padding: 6px 12px; border-radius: 999px; font-size: 13px; text-decoration: none; }
.toast a:hover { background: rgb(255 255 255 / .24); }
.toast button { background: none; border: 0; color: #fff; opacity: .6; cursor: pointer; padding: 4px 6px; font-size: 18px; line-height: 1; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }

.danger-zone { border-top: 1px solid var(--border); padding-top: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .editor, .media-layout, .grid-main { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .welcome .preview { display: none; }
  .welcome { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .auth-grid { grid-template-columns: 1fr; }
  .auth-hero { min-height: 0; order: 2; }
  .auth-card { padding: 32px 22px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 50; transform: translateX(-102%); transition: transform .25s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow-pop); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ''; position: fixed; inset: 0; background: rgb(16 23 31 / .4); z-index: 40; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .topbar .live, .topbar .view-label { display: none; }
  .content { padding: 20px 16px 48px; }
  .grid-3, .grid-2, .two-col { grid-template-columns: 1fr; }
  .image-field { grid-template-columns: 1fr; }
  .image-field .preview { width: 100%; }
  .page-head h1, .welcome h1 { font-size: 28px; }
  .welcome { padding: 26px 22px; }
}
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: 1fr; }
  .auth-bar .btn .long { display: none; }
  .auth-bar .btn .short { display: inline; }
  .auth-bar .starien-logo { height: 24px; }
  .auth-bar { padding-left: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Image fields in the narrow side rail stack vertically */
.rail .image-field { grid-template-columns: minmax(0, 1fr); }
.rail .image-field .preview { width: 100%; aspect-ratio: 16 / 9; }

/* ---------- Single-card auth screens (consent, invite) ---------- */
.auth-single { flex: 1; max-width: 620px; width: 100%; margin: 16px auto 0; display: grid; }
.auth-single .auth-card { padding: 44px 48px; }
.auth-form.consent { max-width: 460px; }
.auth-form.consent h1 { font-size: 30px; }
.consent-logos { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.consent-logos .tile { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: #fff; box-shadow: inset 0 0 0 1px var(--border), var(--shadow-soft); }
.consent-logos .tile img { width: 44px; height: 44px; }
.consent-logos .tile.ai { background: var(--brand-gradient); color: #fff; box-shadow: var(--brand-glow); }
.consent-logos .tile svg { width: 26px; height: 26px; }
.consent-logos .dots { display: flex; gap: 5px; }
.consent-logos .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--input); }
.choice { border: 0; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.choice legend { margin-bottom: 8px; }
.option, .perm { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--border); cursor: pointer; transition: box-shadow .15s, background .15s; }
.option:hover, .perm:hover { box-shadow: inset 0 0 0 1px var(--input); }
.option:has(input:checked), .perm:has(input:checked) { box-shadow: inset 0 0 0 2px var(--brand-blue); background: var(--brand-tint); }
.option input, .perm input { margin-top: 3px; accent-color: var(--brand-indigo); width: 17px; height: 17px; flex: none; }
.option b, .perm b { display: block; font-size: 15px; }
.option small, .perm small { display: block; color: var(--muted-foreground); font-size: 13px; line-height: 1.45; margin-top: 2px; }
.consent-scope { background: var(--muted); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.consent-scope ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.consent-scope li { display: flex; gap: 8px; align-items: center; }
.consent-scope li svg { width: 16px; height: 16px; color: var(--success); flex: none; }
.consent-scope .never li svg { color: var(--danger); }
.consent-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 22px; }
.consent-actions .btn-primary { margin-top: 0; text-transform: none; letter-spacing: .01em; }

/* ---------- AI assistants ---------- */
.ai-hero { grid-template-columns: minmax(0, 1fr); padding: 28px 32px; }
.ai-hero p { margin-top: 12px; }
.eyebrow-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: rgb(255 255 255 / .18); padding: 6px 12px; border-radius: 999px; }
.eyebrow-pill svg { width: 15px; height: 15px; }
.copy-field { display: flex; align-items: center; gap: 10px; margin-top: 14px; background: #fff; border-radius: 16px; padding: 8px 8px 8px 16px; box-shadow: inset 0 0 0 1px var(--border); min-width: 0; }
.copy-field code { flex: 1; min-width: 0; font: 600 15px/1.4 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--foreground); overflow-x: auto; white-space: nowrap; padding: 6px 0; }
.copy-field.dark { background: var(--foreground); box-shadow: none; }
.copy-field.dark code { color: #e8edf5; font-size: 13px; }
.ai-hero .copy-field { box-shadow: 0 16px 30px -18px rgb(10 20 60 / .55); }
.btn-white { background: #fff; color: var(--brand-indigo); box-shadow: inset 0 0 0 1px var(--border); }
.btn-white:hover { background: #f5f8ff; }
.steps { margin: 14px 0 0; padding: 0 24px 0 24px; list-style: none; counter-reset: step; display: grid; gap: 12px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; font-size: 15px; }
.steps li::before { content: counter(step); width: 30px; height: 30px; border-radius: 10px; background: var(--brand-tint); color: var(--brand-indigo); font-weight: 900; display: grid; place-items: center; font-size: 14px; }
.steps-foot { padding: 14px 24px 22px; }
.brand-chip { font-size: 12px; font-weight: 800; padding: 5px 10px; border-radius: 999px; }
.brand-chip.claude { background: #fbeee6; color: #b4532a; }
.brand-chip.gpt { background: #e7f6f0; color: #0e7a55; }
.prompts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.prompts span { background: var(--muted); border-radius: 14px; padding: 10px 14px; font-size: 14px; font-weight: 600; color: #2b333d; }
.tile-ai { display: grid !important; place-items: center; background: var(--brand-tint) !important; color: var(--brand-indigo); }
.safe-list li { display: flex; gap: 10px; padding: 10px 24px; font-size: 14px; font-weight: 600; }
.safe-list li svg { width: 18px; height: 18px; color: var(--success); flex: none; margin-top: 1px; }
.safe-list { padding-bottom: 12px; margin-top: 8px; }
.token-reveal { background: var(--warning-tint); border-radius: var(--radius-lg); padding: 16px 18px; margin-bottom: 18px; }
.token-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.token-form .field + .field { margin-top: 0; }

/* ---------- Team ---------- */
.person { padding: 16px 24px; border-top: 1px solid var(--border); }
.person:first-child { border-top: 0; }
.person-row { display: flex; align-items: center; gap: 14px; }
.person-row .t { font-weight: 800; }
.person-row .s { font-size: 13px; color: var(--muted-foreground); }
.person-note { margin: 8px 0 0 50px; }
.perm-form { margin: 14px 0 0 50px; }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.perm-grid.single { grid-template-columns: 1fr; }
.perm { padding: 10px 12px; }
.perm b { font-size: 14px; }
.perm small { font-size: 12px; }
.perm-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.invite-ready h2 { font-size: 18px; font-weight: 800; display: flex; gap: 8px; align-items: center; }
.invite-ready h2 svg { width: 20px; height: 20px; color: var(--success); }
.invite-ready { box-shadow: inset 0 0 0 2px var(--success), var(--shadow-soft); }

@media (max-width: 900px) {
  .auth-single .auth-card { padding: 30px 22px; }
  .perm-form, .person-note { margin-left: 0; }
  .perm-grid { grid-template-columns: 1fr; }
  .ai-hero { padding: 24px 20px; }
}

.person-row .grow { min-width: 0; }
.person-row .s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.verified-app { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 700; color: #00784a; background: var(--success-tint); padding: 8px 12px; border-radius: 12px; margin: 14px 0 6px; }
.verified-app svg { width: 18px; height: 18px; }
.alert.unverified { margin: 16px 0 6px; font-weight: 500; }
.option.trust { margin-bottom: 14px; }
.option.trust.has-error { box-shadow: inset 0 0 0 2px var(--danger); }

/* ---------- Visual page editor ---------- */
.content.wide { max-width: none; padding: 0; }
.visual-editor { --ve-top: 69px; --ve-bar: 72px; display: flex; flex-direction: column; min-height: calc(100vh - var(--ve-top)); }
.ve-bar { position: sticky; top: var(--ve-top); z-index: 15; display: flex; align-items: center; gap: 16px; padding: 12px 24px; background: color-mix(in srgb, var(--canvas) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid rgb(16 23 31 / .06); min-height: var(--ve-bar); }
.ve-title { min-width: 0; flex: 1; }
.ve-title .crumbs { margin-bottom: 2px; }
.ve-title h1 { font-size: 22px; font-weight: 900; letter-spacing: -0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ve-devices { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: rgb(16 23 31 / .06); }
.ve-devices button { width: 38px; height: 34px; border: 0; border-radius: 999px; background: transparent; color: var(--muted-foreground); display: grid; place-items: center; cursor: pointer; }
.ve-devices button svg { width: 18px; height: 18px; }
.ve-devices button.on { background: #fff; color: var(--foreground); box-shadow: var(--shadow-soft); }
.ve-actions { display: flex; align-items: center; gap: 10px; }
.ve-status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--muted-foreground); white-space: nowrap; }
.ve-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgb(0 153 87 / .15); }
.ve-status[data-state='unsaved'] { color: #8a5300; }
.ve-status[data-state='unsaved'] .dot { background: #e49e22; box-shadow: 0 0 0 3px rgb(228 158 34 / .2); }
.ve-status[data-state='saving'] .dot { background: var(--brand-blue); animation: ve-pulse 1s infinite; }
@keyframes ve-pulse { 50% { opacity: .3; } }
.ve-tabs { display: none; }
.ve-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 460px; min-height: 0; }
.ve-preview { position: sticky; top: calc(var(--ve-top) + var(--ve-bar)); height: calc(100vh - var(--ve-top) - var(--ve-bar)); display: flex; flex-direction: column; padding: 18px 20px 12px 24px; min-width: 0; }
.ve-stage { position: relative; flex: 1; overflow: hidden; border-radius: 18px; }
.ve-frame { position: absolute; top: 0; left: 50%; transform-origin: top center; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 0 0 1px rgb(16 23 31 / .08), 0 24px 50px -28px rgb(16 34 57 / .45); display: flex; flex-direction: column; transition: width .25s cubic-bezier(.2,.8,.2,1); }
.ve-chrome { height: 34px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 12px; background: #f2f4f6; border-bottom: 1px solid var(--border); }
.ve-chrome i { width: 10px; height: 10px; border-radius: 50%; background: #d4d8de; }
.ve-chrome span { margin-left: 10px; flex: 1; max-width: 420px; height: 22px; border-radius: 999px; background: #fff; font-size: 12px; font-weight: 600; color: var(--muted-foreground); display: flex; align-items: center; padding: 0 12px; overflow: hidden; white-space: nowrap; }
.ve-frame iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.ve-help { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: 13px; color: var(--muted-foreground); margin-top: 10px; }
.ve-help svg { width: 16px; height: 16px; color: var(--brand-indigo); }
.ve-panel { padding: 18px 24px 40px 4px; min-width: 0; }
.ve-panel .section-card { margin-bottom: 14px; }
.ve-panel .section-card > summary { padding: 16px 20px; }
.ve-panel .section-card .section-body { padding: 18px 20px 20px; }
.ve-panel .section-card > summary .num svg { width: 16px; height: 16px; }
.ve-foot { text-align: center; margin-top: 6px; }
.ve-foot kbd { font: 700 11px/1 Figtree, sans-serif; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 2px 5px; }
.field.ve-flash { animation: ve-flash 1.4s ease-out; border-radius: 14px; }
@keyframes ve-flash { 0% { box-shadow: 0 0 0 4px rgb(122 79 230 / .35); background: rgb(122 79 230 / .06); } 100% { box-shadow: 0 0 0 4px transparent; background: transparent; } }
.ve-panel .image-field { grid-template-columns: 120px minmax(0, 1fr); }
.ve-panel .image-field .preview { width: 120px; }

@media (max-width: 1100px) {
  .ve-body { grid-template-columns: minmax(0, 1fr); }
  .ve-tabs { display: flex; gap: 4px; margin: 12px 16px 0; padding: 4px; border-radius: 999px; background: rgb(16 23 31 / .06); align-self: flex-start; }
  .ve-tabs button { border: 0; background: transparent; height: 34px; padding: 0 18px; border-radius: 999px; font: inherit; font-weight: 800; font-size: 13px; color: var(--muted-foreground); cursor: pointer; }
  .ve-tabs button[aria-selected='true'] { background: #fff; color: var(--foreground); box-shadow: var(--shadow-soft); }
  .visual-editor[data-tab='panel'] .ve-preview { display: none; }
  .visual-editor[data-tab='preview'] .ve-panel { display: none; }
  .ve-preview { position: relative; top: 0; height: calc(100vh - 220px); padding: 12px 16px; }
  .ve-panel { padding: 12px 16px 40px; }
  .ve-devices { display: none; }
}
@media (max-width: 900px) {
  .visual-editor { --ve-top: 65px; }
  .ve-bar { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .ve-title h1 { font-size: 18px; }
  .ve-status, .hide-sm { display: none; }
}

/* ---------- Central dashboard ---------- */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.hub-card { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.hub-card header { display: flex; align-items: center; gap: 14px; }
.hub-card header img, .hub-logo-blank { width: 52px; height: 52px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px var(--border); padding: 4px; object-fit: contain; flex: none; }
.hub-logo-blank { display: grid; place-items: center; color: var(--brand-indigo); background: var(--brand-tint); }
.hub-logo-blank svg { width: 22px; height: 22px; }
.hub-card h2 { font-size: 18px; font-weight: 900; letter-spacing: -0.02em; }
.hub-card h2 a { color: inherit; }
.hub-url { font-size: 13px; color: var(--muted-foreground); }
.hub-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0; }
.hub-stats div { background: var(--muted); border-radius: 12px; padding: 10px 12px; }
.hub-stats dt { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--subtle); }
.hub-stats dd { margin: 2px 0 0; font-weight: 900; font-size: 17px; }
.hub-stats small { font-size: 11px; font-weight: 700; color: var(--muted-foreground); }
.hub-storage-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.hub-storage-label span:last-child { color: var(--muted-foreground); }
.meter { height: 8px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--brand-gradient); }
.meter.warn span { background: #e49e22; }
.meter.full span { background: var(--danger); }
.hub-last { font-size: 13px; color: var(--muted-foreground); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hub-last svg { width: 15px; height: 15px; }
.hub-card footer { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.hub-add { border: 2px dashed #c4cbd6; box-shadow: none; background: transparent; justify-content: center; align-items: flex-start; }
.hub-add p { color: var(--muted-foreground); font-size: 14px; }
.hub-head { align-items: center; }
.hub-title { display: flex; align-items: center; gap: 16px; }
.hub-title img { width: 64px; height: 64px; border-radius: 18px; background: #fff; padding: 4px; box-shadow: inset 0 0 0 1px var(--border); }
.hub-title p { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hub-domain-form { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; border-top: 1px solid var(--border); }
.hub-domain-form .field + .field { margin-top: 0; }
@media (max-width: 520px) { .hub-stats { grid-template-columns: repeat(2, 1fr); } .hub-grid { grid-template-columns: 1fr; } }
