:root {
    /* Orvoro Design System — same tokens orvoro.com's portal uses.
       Near-monochrome surfaces; indigo #5B45F0 is the ONLY accent. */
    --indigo-900: #3A2CA8;
    --indigo-800: #3A2CA8;
    --indigo-700: #3A2CA8;   /* accent-ink */
    --indigo-600: #5B45F0;   /* accent */
    --indigo-500: #5B45F0;
    --violet-500: #5B45F0;
    --violet-400: #B7ACFB;   /* accent on dark */
    --accent-tint: #EFEDFE;
    /* The logo gradient. DS rule: at most ONE gradient surface per view. */
    --grad: linear-gradient(100deg, #12CFC0 0%, #3A8AF0 38%, #5B45F0 68%, #A72CEF 100%);
    --grad-hero: var(--grad);

    --bg: #FAFAFB;
    --surface: #FFFFFF;
    --surface-2: #F4F5F7;
    --border: #E5E6EA;
    --text: #0E0F12;
    --muted: #6C707A;
    --faint: #9BA1AC;

    --ok: #0F9D63;
    --ok-bg: #E6F6EF;
    --warn: #B4620A;
    --warn-bg: #FBF0E3;
    --err: #D33A3A;
    --err-bg: #FBE9E9;
    --blue: #5B45F0;         /* DS: info == accent, never a second accent */
    --blue-bg: #EFEDFE;

    /* Elevation is border-first: shadows only on surfaces that float. */
    --shadow-sm: none;
    --shadow: none;
    --shadow-lg: 0 8px 24px -8px rgba(14,15,18,.18);
    --radius: 12px;          /* cards */
    --radius-sm: 6px;        /* inputs, chips */
    --font: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
.mt { margin-top: 18px; }

/* Buttons */
.btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; transition: .16s ease; box-shadow: var(--shadow-sm); }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.primary { background: var(--grad); border: none; color: #fff; box-shadow: 0 8px 24px rgba(124,58,237,.35); }
.btn.primary:hover { box-shadow: 0 12px 30px rgba(124,58,237,.45); }
.btn.ghost { background: var(--surface-2); box-shadow: none; }
.btn.ghost:hover { background: #eef0f8; box-shadow: none; transform: none; }
.btn.small { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.btn.danger { border-color: #f3c4c4; color: var(--err); background: #fff; }
.btn.block { width: 100%; }
.linkbtn { background: none; border: none; color: rgba(255,255,255,.75); font-size: 12px; padding: 0; text-align: left; }
.linkbtn:hover { color: #fff; text-decoration: underline; }

/* Brand marks */
.logo-mark { font-size: 26px; line-height: 1; color: var(--violet-400); }
.logo-word { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.logo-word em { font-style: normal; font-weight: 400; opacity: .85; }

/* ---------- Auth ---------- */
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.auth-split { width: 100%; max-width: 980px; min-height: 600px; display: grid; grid-template-columns: 1.05fr .95fr; background: var(--surface); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.auth-hero { background: var(--grad-hero); color: #fff; padding: 48px 44px; display: flex; flex-direction: column; position: relative; }
.auth-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 300px at 90% 0%, rgba(255,255,255,.16), transparent 60%); pointer-events: none; }
.hero-brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.hero-title { font-size: 40px; line-height: 1.08; letter-spacing: -1px; margin: 40px 0 16px; font-weight: 800; }
.hero-sub { color: rgba(255,255,255,.82); font-size: 15px; line-height: 1.6; max-width: 34ch; margin: 0 0 26px; }
.hero-points { list-style: none; padding: 0; margin: 0 0 26px; display: flex; flex-direction: column; gap: 12px; }
.hero-points li { display: flex; align-items: center; gap: 11px; color: rgba(255,255,255,.92); font-size: 14px; }
.hero-points li span { color: var(--violet-400); }
.hero-badges { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.hero-badge { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: rgba(255,255,255,.14); backdrop-filter: blur(4px); }

.auth-panel { display: grid; place-items: center; padding: 40px; }
.auth-card { width: 100%; max-width: 340px; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; margin-bottom: 24px; border: 1px solid var(--border); }
.tab { flex: 1; background: transparent; border: none; color: var(--muted); padding: 10px; border-radius: 9px; font-weight: 600; font-size: 14px; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
form label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 16px; }
.input, form input { width: 100%; margin-top: 7px; padding: 12px 13px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; color: var(--text); font-size: 14px; font-family: inherit; }
.input:focus, form input:focus { outline: none; border-color: var(--indigo-500); box-shadow: 0 0 0 3px rgba(91,69,240,.15); }
.form-error { color: var(--err); font-size: 13px; min-height: 18px; margin: 10px 0 0; }
.form-ok { color: var(--ok); font-size: 13px; margin: 8px 0 0; }
.fineprint { color: var(--faint); font-size: 12px; text-align: center; margin: 20px 0 0; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { display: flex; flex-direction: column; padding: 12px; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 28px; }
.sidebar nav { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 12px; text-align: left; background: transparent; border: none; color: rgba(255,255,255,.72); padding: 12px 14px; border-radius: 12px; font-weight: 600; font-size: 14.5px; transition: .15s; }
.nav-item .ni { width: 20px; text-align: center; opacity: .9; }
.nav-item:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.18); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.side-foot { display: flex; align-items: center; gap: 11px; border-top: 1px solid rgba(255,255,255,.14); padding-top: 16px; }
.avatar { width: 38px; height: 38px; border-radius: 11px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-weight: 700; text-transform: uppercase; }
.side-user { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.user-email { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }

.content { padding: 34px 40px 60px; overflow-y: auto; max-height: 100vh; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; }
.view-head h2 { margin: 0; font-size: 27px; letter-spacing: -.6px; font-weight: 800; }
.view-head p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card-title { margin: 0 0 14px; font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.card-title.mt { margin-top: 22px; }

/* Compose */
.grid-compose { display: grid; grid-template-columns: 1fr 340px; gap: 22px; align-items: start; }
.composer textarea { width: 100%; min-height: 220px; resize: vertical; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; color: var(--text); padding: 16px; font-size: 15.5px; line-height: 1.55; font-family: inherit; }
.composer textarea:focus { outline: none; border-color: var(--indigo-500); box-shadow: 0 0 0 3px rgba(91,69,240,.12); background: #fff; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.counter { color: var(--faint); font-size: 13px; }
.media-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.media-thumb { position: relative; width: 92px; height: 92px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-thumb button { position: absolute; top: 4px; right: 4px; background: rgba(15,15,25,.65); border: none; color: #fff; border-radius: 7px; width: 22px; height: 22px; line-height: 1; }

.platform-picker { display: flex; flex-direction: column; gap: 9px; }
.platform-toggle { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--text); background: var(--surface); cursor: pointer; transition: .15s; user-select: none; }
.platform-toggle .pcheck { margin-left: auto; width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--border); display: grid; place-items: center; font-size: 12px; color: transparent; }
.platform-toggle.on { border-color: var(--indigo-500); background: #EFEDFE; }
.platform-toggle.on .pcheck { background: var(--grad); border-color: transparent; color: #fff; }
.platform-toggle.disabled { opacity: .55; cursor: not-allowed; }
.pico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; flex-shrink: 0; }

.segmented { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 4px; gap: 4px; }
.seg { flex: 1; border: none; background: transparent; color: var(--muted); font-weight: 600; padding: 9px; border-radius: 9px; font-size: 13.5px; }
.seg.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* Posts */
.filters { display: flex; gap: 9px; margin-bottom: 20px; flex-wrap: wrap; }
.chip { background: var(--surface); border: 1px solid var(--border); color: var(--muted); padding: 8px 15px; border-radius: 20px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-sm); }
.chip.active { background: var(--indigo-600); border-color: var(--indigo-600); color: #fff; }
.post-list { display: flex; flex-direction: column; gap: 13px; }
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; gap: 16px; align-items: flex-start; }
.post-card .thumb { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); }
.post-main { flex: 1; min-width: 0; }
.post-caption { margin: 0 0 10px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.post-meta { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.badge.draft { background: #eef0f5; color: var(--muted); }
.badge.scheduled { background: var(--blue-bg); color: var(--blue); }
.badge.published { background: var(--ok-bg); color: var(--ok); }
.badge.publishing, .badge.partial { background: var(--warn-bg); color: var(--warn); }
.badge.failed { background: var(--err-bg); color: var(--err); }
.platform-dot { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 11px; font-weight: 600; }
.post-actions { display: flex; flex-direction: column; gap: 7px; }

/* Accounts */
.accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.account-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.account-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.account-card h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.account-status { font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.account-status.connected { color: var(--ok); }
.sim-tag { font-size: 10px; background: var(--warn-bg); color: var(--warn); padding: 2px 7px; border-radius: 6px; font-weight: 700; }
.scopes { font-size: 11.5px; color: var(--faint); margin: 4px 0 16px; word-break: break-word; line-height: 1.5; }

/* Calendar */
.calendar-head { align-items: center; }
.cal-nav { display: flex; gap: 7px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.cal-dow { text-align: center; font-size: 12px; color: var(--faint); font-weight: 700; padding: 4px 0 8px; text-transform: uppercase; letter-spacing: .5px; }
.cal-cell { background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; min-height: 96px; padding: 8px; }
.cal-cell.other { opacity: .45; }
.cal-cell.today { border-color: var(--indigo-500); box-shadow: 0 0 0 2px rgba(91,69,240,.18); }
.cal-daynum { font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 5px; }
.cal-event { font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 7px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event.scheduled { background: var(--blue-bg); color: var(--blue); }
.cal-event.published { background: var(--ok-bg); color: var(--ok); }
.cal-event.draft { background: #eef0f5; color: var(--muted); }
.cal-event.failed, .cal-event.partial { background: var(--err-bg); color: var(--err); }

/* Analytics */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; position: relative; overflow: hidden; }
.stat-tile::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--grad); }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.stat-value { font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.stat-sub { font-size: 12px; color: var(--faint); margin-top: 4px; }
.grid-analytics { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; align-items: start; }
.platform-bars { display: flex; flex-direction: column; gap: 16px; }
.pbar-row { display: flex; flex-direction: column; gap: 6px; }
.pbar-head { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; }
.pbar-head .val { margin-left: auto; color: var(--muted); font-weight: 700; }
.pbar-track { height: 9px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.pbar-fill { height: 100%; border-radius: 6px; background: var(--grad); }
.top-posts { display: flex; flex-direction: column; gap: 12px; }
.top-post { display: flex; align-items: center; gap: 12px; padding: 11px; border-radius: 12px; background: var(--surface-2); }
.top-rank { width: 26px; height: 26px; border-radius: 8px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.top-cap { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-val { font-weight: 700; font-size: 13px; }
.top-val small { color: var(--faint); font-weight: 500; }

.empty { color: var(--faint); text-align: center; padding: 52px; font-size: 14px; }
.toast { position: fixed; bottom: 26px; right: 26px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--indigo-500); padding: 14px 20px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500; z-index: 100; animation: slideUp .25s ease; }
.toast.err { border-left-color: var(--err); }
.toast.ok { border-left-color: var(--ok); }
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }




/* ============================================================= */
/* Icon system + multi-account UI + luxury refinements           */
/* ============================================================= */

/* Gold is used only by the SEO marker. */
:root { --gold: #B4620A; }

/* Inline UI icons */
.ic { width: 1.05em; height: 1.05em; flex: none; vertical-align: -0.16em; }
.ic.ok { color: var(--ok); }
.ic.err { color: var(--err); }
.ic.muted { color: var(--faint); }

/* Buttons align icon + label */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.iconbtn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; color: var(--muted); box-shadow: var(--shadow-sm); transition: .15s; }
.iconbtn:hover { color: var(--indigo-600); border-color: var(--indigo-500); transform: translateY(-1px); }
.iconbtn .ic { width: 18px; height: 18px; }

/* Brand logo mark */
.logo-mark { display: inline-flex; align-items: center; }
.logo-mark svg { width: 1.05em; height: 1.05em; display: block; }

/* Sidebar nav icons */
.nav-item .ni { display: inline-grid; place-items: center; }
.nav-item .ni svg { width: 20px; height: 20px; }

/* Hero bullet ticks */
.hero-points li .tick { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: rgba(255,255,255,.14); color: var(--violet-400); flex: none; }
.hero-points li .tick svg { width: 13px; height: 13px; }
.hero-badge span { display: inline-grid; place-items: center; width: 100%; height: 100%; border-radius: 9px; }
.hero-badge .bm { width: 60%; height: 60%; color: #fff; }
.fineprint { display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.fineprint .ic { color: var(--faint); }

/* Brand tile with SVG mark */
.pico { display: inline-grid; place-items: center; overflow: hidden; }
.pico .bm { width: 58%; height: 58%; color: #fff; }

/* Compose picker: one chip per connected account */
.picker-hint { color: var(--faint); font-size: 13px; display: flex; align-items: center; gap: 6px; margin: 2px 0 0; }
.platform-toggle .pt-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.platform-toggle .pcheck { margin-left: auto; width: 20px; height: 20px; border: 1.5px solid var(--border); border-radius: 6px; display: grid; place-items: center; color: transparent; flex: none; }
.platform-toggle .pcheck .ic { width: 13px; height: 13px; }
.platform-toggle.on .pcheck { background: var(--grad); border-color: transparent; color: #fff; }

/* Media remove button */
.media-thumb .media-rm { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 7px; border: none; background: rgba(15,15,25,.62); color: #fff; display: grid; place-items: center; }
.media-thumb .media-rm .ic { width: 12px; height: 12px; }

/* Accounts view — grouped by platform, one row per account */
.account-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.account-head .pico { width: 40px; height: 40px; border-radius: 11px; }
.account-h h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.account-count { font-size: 12.5px; color: var(--muted); }
.account-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.account-row { display: flex; align-items: center; justify-content: space-between; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 9px 12px; font-size: 13.5px; }
.account-row { gap: 4px; }
.account-row .ar-name { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; flex: 1; }
/* Two action buttons leave the label little room, so allow a second line but
   clamp there — the distinguishing suffix sits at the END of the name, which a
   single-line ellipsis would hide. */
.account-row .ar-label { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.account-row .ar-name .ic { width: 16px; height: 16px; }
.account-row .iconbtn { width: 26px; height: 26px; border: none; background: transparent; box-shadow: none; color: var(--faint); }
.account-row .iconbtn:hover { color: var(--err); transform: none; }
.account-row .iconbtn.test:hover { color: var(--indigo-600); }
.account-row .iconbtn[disabled] { opacity: .45; }

/* Connection self-test report, rendered under the account row it belongs to. */
.verify-report { display: flex; flex-direction: column; gap: 6px; padding: 11px 13px; margin: -2px 0 2px; border: 1px solid var(--border); border-left: 3px solid var(--faint); border-radius: 11px; background: var(--surface-2); font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.verify-report.ok { border-left-color: var(--ok); background: var(--ok-bg); color: #14532d; }
.verify-report.bad { border-left-color: var(--err); background: var(--err-bg); color: #7f1d1d; }
.verify-report .vr-line { display: flex; align-items: flex-start; gap: 7px; }
.verify-report .vr-line .ic { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.verify-report .vr-line b { font-weight: 700; text-transform: capitalize; }
.verify-report .vr-line.ok .ic { color: var(--ok); }
.verify-report .vr-line.bad .ic { color: var(--err); }

/* Post card meta with icons */
.post-meta .when { display: inline-flex; align-items: center; gap: 5px; }
.post-meta .when .ic { width: 14px; height: 14px; color: var(--faint); }
.platform-dot { display: inline-flex; align-items: center; gap: 6px; }
.platform-dot .pico { width: 18px; height: 18px; border-radius: 5px; }
.platform-dot .ic { width: 14px; height: 14px; }
.faint { color: var(--faint); }

/* Analytics platform bars */
.pbar-name { text-transform: capitalize; }
.pbar-head .pico { width: 22px; height: 22px; border-radius: 6px; }

/* Refined stat tile accent */
.stat-tile::before { background: linear-gradient(90deg, var(--indigo-500), var(--violet-500)); }

/* ============================================================= */
/* Compose designing tools, tags, SEO, live preview              */
/* ============================================================= */
.compose-main { display: flex; flex-direction: column; gap: 22px; }

/* Editor toolbar */
.editor-toolbar { position: relative; display: flex; align-items: center; gap: 4px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.tool { display: inline-grid; place-items: center; width: 34px; height: 34px; border: none; background: transparent; border-radius: 9px; color: var(--muted); cursor: pointer; transition: .15s; }
.tool:hover { background: var(--surface-2); color: var(--indigo-600); }
.tool .ic { width: 19px; height: 19px; }
.tool-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.editor-toolbar .counter { margin-left: auto; font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.emoji-pop { position: absolute; top: 40px; left: 0; z-index: 30; width: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-pop .emoji { border: none; background: transparent; font-size: 18px; padding: 4px; border-radius: 7px; cursor: pointer; }
.emoji-pop .emoji:hover { background: var(--surface-2); }
.composer textarea { min-height: 170px; }

/* Tag editor */
.tag-editor { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 9px 11px; }
.tag-editor:focus-within { border-color: var(--indigo-500); box-shadow: 0 0 0 3px rgba(91,69,240,.12); background: #fff; }
.tag-chips { display: contents; }
.tag-chip { display: inline-flex; align-items: center; gap: 5px; background: rgba(91,69,240,.12); color: var(--indigo-700); border: 1px solid rgba(91,69,240,.25); border-radius: 20px; padding: 4px 6px 4px 11px; font-size: 13px; font-weight: 600; }
.tag-chip button { border: none; background: transparent; color: inherit; display: grid; place-items: center; cursor: pointer; padding: 0; opacity: .7; }
.tag-chip button:hover { opacity: 1; }
.tag-chip button .ic { width: 12px; height: 12px; }
.tag-input { flex: 1; min-width: 140px; border: none; background: transparent; font-size: 14px; font-family: inherit; padding: 4px; color: var(--text); }
.tag-input:focus { outline: none; }
.tag-meta { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12.5px; color: var(--faint); }
.tag-hint.warn { color: var(--warn); font-weight: 600; }

/* SEO */
.seo-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.seo-head .card-title { margin: 0; }
.seo-sub { font-size: 12px; color: var(--faint); }
.field { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 14px; position: relative; }
.field .input { margin-top: 7px; font-weight: 400; }
.field .ct { position: absolute; right: 0; top: 0; font-size: 11px; color: var(--faint); font-weight: 500; font-variant-numeric: tabular-nums; }
.field .ct.over { color: var(--err); }
.serp { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.serp-url { font-size: 12.5px; color: #1a7f37; }
.serp-title { font-size: 18px; color: #1a3fb8; margin: 3px 0; line-height: 1.3; }
.serp-desc { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* Live preview */
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.pv-card { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); }
.pv-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.pv-head .pico { width: 30px; height: 30px; border-radius: 8px; }
.pv-name { font-weight: 700; font-size: 13.5px; }
.pv-plat { font-size: 11.5px; color: var(--faint); text-transform: capitalize; }
.pv-count { margin-left: auto; font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.pv-count.over { color: var(--err); font-weight: 700; }
.pv-body { padding: 13px 14px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 180px; overflow: auto; }
.pv-img { width: 100%; max-height: 200px; object-fit: cover; display: block; }

/* Posts page: tags + SEO */
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.tag-pill { font-size: 11.5px; font-weight: 600; color: var(--indigo-700); background: rgba(91,69,240,.10); border: 1px solid rgba(91,69,240,.2); border-radius: 14px; padding: 2px 9px; }
.post-seo { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.post-seo .ic { width: 14px; height: 14px; color: var(--gold); }

/* ============================================================= */
/* Alt text + keyword helper                                     */
/* ============================================================= */
.media-row { align-items: flex-start; }
.media-cell { display: flex; flex-direction: column; gap: 6px; width: 110px; }
.alt-input { width: 110px; font-size: 11.5px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); font-family: inherit; }
.alt-input:focus { outline: none; border-color: var(--indigo-500); background: #fff; }

.kw-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.kw-row { display: flex; align-items: center; gap: 9px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 8px 10px; }
.kw-state { display: inline-grid; place-items: center; }
.kw-state .ic { width: 16px; height: 16px; }
.kw-name { font-weight: 600; font-size: 13.5px; }
.kw-status { font-size: 11.5px; color: var(--warn); font-weight: 600; }
.kw-row.ok .kw-status { color: var(--ok); }
.kw-row .btn { margin-left: auto; }
.kw-del { width: 30px; height: 30px; border: none; background: transparent; box-shadow: none; color: var(--faint); }
.kw-del:hover { color: var(--err); transform: none; }
.kw-suggest-wrap { margin-top: 16px; }
.kw-suggest-label { font-size: 12px; color: var(--faint); font-weight: 600; margin-bottom: 8px; }
.kw-suggest { display: flex; flex-wrap: wrap; gap: 7px; }
.kw-chip { border: 1px dashed var(--border); background: var(--surface); color: var(--indigo-700); border-radius: 20px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: .15s; }
.kw-chip:hover { border-style: solid; border-color: var(--indigo-500); background: #EFEDFE; }

/* --- Per-platform publishing choices (TikTok audience + disclosure) --- */
.opt-card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); padding: 13px 14px; margin-top: 12px; }
.opt-card.bad { border-color: #f3c4c4; background: var(--err-bg); }
.opt-head { display: flex; align-items: center; gap: 9px; font-size: 13.5px; margin-bottom: 10px; }
.opt-head .pico { width: 26px; height: 26px; border-radius: 8px; }
.opt-label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); margin: 12px 0 6px; }
.opt-label:first-of-type { margin-top: 0; }
.opt-radios, .opt-checks { display: flex; flex-direction: column; gap: 2px; }
.opt-radio, .opt-check { display: flex; align-items: flex-start; gap: 9px; padding: 6px 8px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.opt-radio:hover, .opt-check:hover { background: var(--surface); }
.opt-radio input, .opt-check input { margin-top: 2px; accent-color: var(--indigo-600); flex: none; }
.opt-check i, .opt-radio i { font-style: normal; color: var(--faint); font-size: 12px; }
/* A capability the creator has switched off on the platform stays off here. */
.opt-radio.off, .opt-check.off { opacity: .5; cursor: not-allowed; }
.opt-note { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.opt-note.bad { color: var(--err); font-weight: 600; }
/* Consent text TikTok requires to be visible before posting — not decoration. */
.opt-consent { font-size: 11.5px; line-height: 1.5; color: var(--muted); margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border); }
.opt-consent a { color: var(--indigo-600); text-decoration: underline; }

/* --- Legal pages (privacy, terms, data deletion) --- */
.legal-body { background: var(--bg); }
.legal { max-width: 760px; margin: 0 auto; padding: 48px 24px 80px; color: var(--text); font-size: 15px; line-height: 1.7; }
.legal-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--indigo-700); margin-bottom: 32px; }
.legal-brand .logo-mark { width: 30px; height: 30px; }
.legal h1 { font-size: 34px; letter-spacing: -.02em; margin: 0 0 6px; }
.legal h2 { font-size: 19px; margin: 34px 0 10px; letter-spacing: -.01em; }
.legal p, .legal li { color: var(--muted); }
.legal ul { padding-left: 20px; display: flex; flex-direction: column; gap: 7px; }
.legal b { color: var(--text); }
.legal a { color: var(--indigo-600); }
.legal-meta { font-size: 13px; color: var(--faint); margin: 0 0 24px; }
/* The draft notice is load-bearing: these pages are accurate about the software
   but have not been through legal review, and must not be mistaken for advice. */
.legal-draft { border: 1px solid #f6dfa8; background: var(--warn-bg); color: #7c4a03; border-radius: 12px; padding: 14px 16px; font-size: 13.5px; line-height: 1.6; }
.legal-draft code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.legal-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13.5px; display: block; overflow-x: auto; }
.legal-table th, .legal-table td { border: 1px solid var(--border); padding: 9px 11px; text-align: left; vertical-align: top; }
.legal-table th { background: var(--surface-2); color: var(--text); font-weight: 700; white-space: nowrap; }
.legal-table td { color: var(--muted); }
.legal-foot { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 13.5px; }

/* App-wide footer carrying the policy links platforms require to be reachable. */
.app-foot { display: flex; justify-content: center; gap: 20px; padding: 22px 16px 26px; font-size: 12.5px; }
.app-foot a { color: var(--faint); text-decoration: none; }
.app-foot a:hover { color: var(--indigo-600); text-decoration: underline; }

/* ============================================================= */
/* Orvoro Design System alignment — matches orvoro.com's portal.  */
/* Structure over decoration: border-first elevation, one type    */
/* family, one accent, the brand gradient at most once per view.  */
/* Self-hosted: the app's CSP is default-src 'self', so no CDN.   */
/* ============================================================= */
@font-face {
    font-family: "Hanken Grotesk";
    src: url("/fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* Type: semibold headings, DS tracking. No display face, no gradient text. */
h1, h2, h3, .card-title, .hero-title, .view-head h2, .stat-value, .legal h1, .legal h2 { letter-spacing: -.02em; }
.hero-title, .view-head h2, .stat-value { font-weight: 600; }
.logo-word { font-weight: 600; letter-spacing: -.02em; }

/* Controls: radius 8 buttons / 6 inputs+chips / full pills, no hover lift. */
.btn { border-radius: 8px; }
.btn:hover { transform: none; background: var(--surface-2); }
.btn.primary { background: var(--indigo-600); box-shadow: none; }
.btn.primary:hover { background: #4A35D8; box-shadow: none; }
.input, form input, .tag-editor, .alt-input, .composer textarea, .serp, .opt-card, .kw-row, .account-row, .cal-cell, .top-post, .verify-report { border-radius: var(--radius-sm); }
.iconbtn, .tool, .seg, .emoji-pop .emoji { border-radius: var(--radius-sm); }
.iconbtn:hover { transform: none; }
.chip, .tag-chip, .tag-pill, .platform-dot, .badge, .kw-chip { border-radius: 999px; }
.seg.active { border: 1px solid var(--border); }
.card, .post-card, .account-card, .stat-tile, .pv-card, .platform-toggle, .segmented, .media-thumb, .emoji-pop, .legal-draft, .toast { border-radius: var(--radius); }
.auth-split { border-radius: var(--radius); box-shadow: none; }

/* App chrome: flat white sidebar with accent-tint active nav, as in the portal. */
.sidebar { background: var(--surface); color: var(--text); border-right: 1px solid var(--border); }
.side-brand, .side-user { color: var(--text); }
.nav-item { color: var(--muted); }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-tint); color: var(--indigo-700); box-shadow: none; }
.side-foot { border-top-color: var(--border); }
.avatar { background: var(--accent-tint); color: var(--indigo-700); border-radius: 8px; }

/* Auth hero is the one gradient surface of that view — so no ambient glow on top. */
.auth-hero::after { display: none; }
.hero-badge { background: rgba(255,255,255,.18); backdrop-filter: none; border-radius: 8px; }
.hero-points li .tick { background: rgba(255,255,255,.18); color: #fff; border-radius: 6px; }

/* Everything else reads the flat accent — the gradient stays a single moment. */
.stat-tile::before { background: var(--indigo-600); height: 2px; }
.top-rank, .pbar-fill, .platform-toggle.on .pcheck { background: var(--indigo-600); }

/* ================================================================= */
/* DS control specs — copied from @orvoro/ui so a button, field and   */
/* card here measure the same as one in the customer portal.          */
/* Button h-10 / px-18 / 14px semibold / r-8 · Input h-11→h-10, r-6.  */
/* ================================================================= */
html { -webkit-text-size-adjust: 100%; }

.btn {
    height: 40px; padding: 0 18px; font-size: 14px; font-weight: 600;
    border-radius: 8px; transition: color .15s, background-color .15s, filter .15s, box-shadow .15s;
}
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(91,69,240,.2); }
/* The portal's Button variant="brand": the logo gradient, reserved for the ONE
   primary call to action per view (Sign in · Publish now). */
.btn.primary { background: var(--grad); border: none; color: #fff; }
.btn.primary:hover { background: var(--grad); filter: brightness(1.08); }
.btn.small { height: 32px; padding: 0 14px; font-size: 13px; }
.btn.block { width: 100%; }

.input, form input, .tag-input, .alt-input, #kw-input {
    height: 44px; font-size: 16px; border-radius: var(--radius-sm);
}
.composer textarea, .input textarea, textarea { font-size: 16px; border-radius: var(--radius-sm); }
.input:focus, form input:focus, .composer textarea:focus, .tag-editor:focus-within {
    outline: none; border-color: var(--indigo-600); box-shadow: 0 0 0 3px rgba(91,69,240,.2);
}
@media (min-width: 640px) {
    .input, form input, .tag-input, .alt-input, #kw-input { height: 40px; font-size: 14px; }
    .composer textarea, textarea { font-size: 14.5px; }
}
.alt-input { height: 32px; font-size: 11.5px; }
.tag-editor { height: auto; min-height: 44px; }

/* ================================================================= */
/* App shell — the portal's three-state chrome:                       */
/*   < 768  slide-out drawer (288px) behind a 56px app bar            */
/*   768+   icon rail (64px), labels hidden                           */
/*   1024+  full sidebar (240px)                                      */
/* ================================================================= */
/* Column on phones so the app bar spans the top; row once the rail appears. */
.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
@media (min-width: 768px) { .app { flex-direction: row; } }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.content {
    flex: 1; overflow-y: auto; max-height: none;
    width: 100%; max-width: 1280px; margin-inline: auto; padding: 16px;
}
@media (min-width: 640px) { .content { padding: 24px; } }
@media (min-width: 1024px) { .content { padding: 32px; } }

.sidebar {
    position: fixed; inset-block: 0; left: 0; z-index: 50;
    width: 288px; max-width: 85vw; flex: none;
    transform: translateX(-100%); transition: transform .3s ease;
}
.app.nav-open .sidebar { transform: none; }
.nav-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.4); }
.nav-scrim[hidden] { display: none; }

.appbar {
    display: flex; align-items: center; gap: 10px; flex: none;
    height: 56px; padding: 0 12px;
    background: var(--surface); border-bottom: 1px solid var(--border);
}
.appbar-burger {
    display: inline-grid; place-items: center; width: 44px; height: 44px;
    border: none; background: transparent; color: var(--muted); border-radius: var(--radius-sm);
}
.appbar-burger:hover { color: var(--text); background: var(--surface-2); }
.appbar-burger svg { width: 22px; height: 22px; }

@media (min-width: 768px) {
    .appbar, .nav-scrim { display: none; }
    .sidebar { position: static; transform: none; width: 64px; max-width: none; padding: 12px 8px; }
    /* Icon rail: labels and the account row collapse to their icons. */
    .sidebar .logo-word, .sidebar .side-user { display: none; }
    .side-brand { justify-content: center; padding: 4px 0 20px; }
    .nav-item { justify-content: center; padding: 12px 8px; }
    .nav-item .nav-label { display: none; }
    .side-foot { justify-content: center; }
}
@media (min-width: 1024px) {
    .sidebar { width: 240px; padding: 12px; }
    .sidebar .logo-word { display: inline; }
    .sidebar .side-user { display: flex; }
    .side-brand { justify-content: flex-start; padding: 4px 8px 20px; }
    .nav-item { justify-content: flex-start; padding: 10px 12px; }
    .nav-item .nav-label { display: inline; }
    .side-foot { justify-content: flex-start; }
}
.nav-item { font-size: 14px; border-radius: var(--radius-sm); }
.side-foot { display: flex; align-items: center; gap: 11px; }

/* ================================================================= */
/* Responsive content — every view has to survive 320px.              */
/* ================================================================= */
.grid-compose, .grid-analytics { grid-template-columns: 1fr; }
@media (min-width: 1024px) {
    .grid-compose { grid-template-columns: minmax(0,1fr) 340px; }
    .grid-analytics { grid-template-columns: 1.3fr minmax(0,1fr); }
}
.view-head { flex-wrap: wrap; gap: 12px; }
.view-head h2 { font-size: 22px; }
@media (min-width: 640px) { .view-head h2 { font-size: 26px; } }

/* A month grid cannot usefully compress below ~600px — let it scroll instead
   of crushing seven columns into a phone. */
.card:has(> .calendar-grid), .card:has(> .cal-scroll) { overflow-x: auto; }
.calendar-grid { min-width: 600px; }
@media (min-width: 768px) { .calendar-grid { min-width: 0; } }
.calendar-head { flex-wrap: wrap; gap: 10px; }

.post-card { flex-wrap: wrap; }
.post-actions { flex-direction: row; flex-wrap: wrap; width: 100%; }
@media (min-width: 640px) { .post-actions { flex-direction: column; width: auto; } }
.stat-value { font-size: 26px; }
@media (min-width: 640px) { .stat-value { font-size: 30px; } }

/* Auth: the split collapses to the form alone on phones. */
.auth-screen { padding: 16px; }
.auth-split { grid-template-columns: 1fr; min-height: 0; }
.auth-hero { display: none; padding: 32px 24px; }
@media (min-width: 900px) {
    .auth-split { grid-template-columns: 1.05fr .95fr; min-height: 600px; }
    .auth-hero { display: flex; padding: 48px 44px; }
}
.hero-title { font-size: clamp(28px, 4vw, 40px); }
.auth-panel { padding: 28px 20px; }
@media (min-width: 640px) { .auth-panel { padding: 40px; } }
