/* Marketing Studio design system - product register (dark, restrained, one accent).
   Earned familiarity: the tool disappears into the task. One sans, fixed rem scale,
   a single accent for actions/selection/state, full state vocabulary per control. */

:root {
    color-scheme: dark;

    /* Neutrals: content surface + a cooler panel layer for chrome */
    --bg: #0c0e13;
    --surface: #12151c;
    --surface-2: #171b24;
    --line: #262c38;
    --line-strong: #333b4a;

    /* Ink ramp (contrast-checked against --surface) */
    --ink: #eef1f6;
    --ink-dim: #aab2c2;
    --muted: #7c8698;

    /* One accent. Nocap Technologies "Signal in the Abyss" blue. */
    --accent: #6ea8ff;
    --accent-ink: #05101f;
    --accent-weak: #6ea8ff26;

    /* Semantic states */
    --ok: #4bd08a;
    --warn: #e6c15a;
    --danger: #ff6b6b;
    --danger-weak: #ff6b6b1f;

    --radius: 10px;
    --radius-sm: 8px;
    --gap: 16px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- App chrome --- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap);
    padding: 0 24px;
    height: 56px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.01em; color: var(--ink); }
.brand .mark { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(140deg, var(--accent), #3f6fd0); }
.topnav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.topnav a { color: var(--ink-dim); }
.topnav a:hover { color: var(--ink); text-decoration: none; }
.who { color: var(--muted); font-size: 13px; }

.container { max-width: 880px; margin: 0 auto; padding: 32px 24px 96px; }
.container-wide { max-width: 1100px; }

/* --- Typography scale (fixed, tight ratio) --- */
.page-title { font-size: 1.5rem; line-height: 1.2; margin: 0 0 4px; letter-spacing: -0.02em; text-wrap: balance; }
.page-sub { color: var(--ink-dim); margin: 0 0 28px; }
.section-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 34px 0 12px; font-weight: 600; }

/* --- Panels (grouping, not decorative cards; never nested) --- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel + .panel { margin-top: 12px; }
.panel-pad { padding: 18px 20px; }
.panel-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line); }
.panel-row:first-child { border-top: 0; }
.panel-row .rt { color: var(--muted); font-size: 13px; }

/* --- Forms --- */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field > label { display: block; font-size: 13px; color: var(--ink-dim); margin-bottom: 6px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
    width: 100%;
    background: var(--bg);
    color: var(--ink);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font: inherit;
    font-size: 14px;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:hover, select:hover, textarea:hover { border-color: #3d4658; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-weak);
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: right 14px center, right 9px center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }

.check { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-dim); font-size: 14px; cursor: pointer; }
.check input { width: auto; accent-color: var(--accent); }

/* --- Buttons: full state vocabulary --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
    font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.06s var(--ease), opacity 0.15s var(--ease);
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-weak); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: #83b6ff; }
.btn-secondary { background: var(--surface-2); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover:not(:disabled) { border-color: #445067; background: #1c212c; }
.btn-ghost { background: transparent; color: var(--ink-dim); }
.btn-ghost:hover:not(:disabled) { color: var(--ink); background: var(--surface); }
.btn-danger { background: transparent; color: var(--danger); border-color: #4a2a2a; }
.btn-danger:hover:not(:disabled) { background: var(--danger-weak); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
form.inline { display: inline; }

/* --- Badges / status --- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.badge-accent { background: var(--accent-weak); color: var(--accent); }
.badge-ok { background: #4bd08a1f; color: var(--ok); }
.badge-muted { background: #ffffff0f; color: var(--ink-dim); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* --- Notices --- */
.notice { border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 18px; font-size: 14px; border: 1px solid; }
.notice-ok { background: #4bd08a14; border-color: #2e6b4d; color: #a9e6c6; }
.notice-err { background: var(--danger-weak); border-color: #6b3030; color: #f0b3b3; }

/* --- Empty states that teach --- */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h3 { color: var(--ink-dim); font-size: 15px; margin: 0 0 6px; font-weight: 600; }
.empty p { margin: 0; font-size: 13.5px; }

.who:hover { color: var(--ink); text-decoration: none; }

/* --- Pipeline summary (Nocap's own brand companies) --- */
.stat-n { font-size: 1.7rem; font-weight: 650; letter-spacing: -0.02em; line-height: 1; }
.post-row { display: flex; gap: 16px; align-items: flex-start; }
.post-thumb { width: 76px; height: 76px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); flex-shrink: 0; background: var(--bg); }
.rt { color: var(--muted); font-size: 13px; }

/* Lead-media thumbnail (image or video first frame + play badge) */
.thumb-wrap { position: relative; display: block; width: 76px; height: 76px; flex-shrink: 0; }
.thumb-wrap:hover { text-decoration: none; }
.thumb-wrap .post-thumb { width: 100%; height: 100%; display: block; }
.thumb-badge { position: absolute; left: 4px; bottom: 4px; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, 0.62); color: #fff; font-size: 9px; padding-left: 1px; pointer-events: none; }

/* --- Compatibility layer: the original pipeline dashboards (/c/{brand}, draft
   detail, new-draft, ask) predate this design system and use their own class
   names. Map them onto the same tokens so they read as one product. --- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 12px; }
.card h2 { font-size: 1.1rem; margin: 0 0 12px; letter-spacing: -0.01em; }
.card.row, .row { display: flex; gap: 16px; align-items: flex-start; }
.card img, .row img { width: 76px; height: 76px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); flex-shrink: 0; }
.meta { color: var(--muted); font-size: 13px; }
.caption { line-height: 1.5; margin: 4px 0; white-space: pre-wrap; }
.clip { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

.b-pending { background: var(--accent-weak); color: var(--accent); }
.b-approved { background: #e6c15a1f; color: var(--warn); }
.b-expired { background: #ffffff0f; color: var(--ink-dim); }
.b-published { background: #4bd08a1f; color: var(--ok); }
.b-failed { background: var(--danger-weak); color: var(--danger); }
.b-rejected { background: #ffffff0f; color: var(--muted); }

.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover:not(:disabled) { background: #83b6ff; text-decoration: none; }
.btn-dim { background: var(--surface-2); color: var(--ink); border-color: var(--line-strong); }
.btn-dim:hover:not(:disabled) { border-color: #445067; background: #1c212c; text-decoration: none; }
.btn-ok { background: transparent; color: var(--ok); border-color: #2e6b4d; }
.btn-ok:hover:not(:disabled) { background: #4bd08a1f; }
.btn-bad { background: transparent; color: var(--danger); border-color: #4a2a2a; }
.btn-bad:hover:not(:disabled) { background: var(--danger-weak); }
.card .btn, .row .btn { margin-right: 8px; margin-top: 4px; }
.audit { font-size: 13px; color: var(--ink-dim); }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
