:root {
  --ink: #161614;
  --ink-2: #22221f;
  --ink-3: #30302b;
  --gold: #c29f5c;
  --gold-dark: #9c7b3f;
  --ivory: #eee7da;
  --ivory-2: #f6f1e8;
  --paper: #fbf8f2;
  --white: #fff;
  --clay: #a16b4a;
  --sage: #9d9572;
  --muted: #716d64;
  --line: #dfd8cc;
  --line-dark: rgba(255, 255, 255, .11);
  --green: #4d765e;
  --red: #a24e42;
  --blue: #517486;
  --orange: #b9763f;
  --shadow: 0 20px 60px rgba(43, 35, 24, .08);
  --sidebar-width: 260px;
  --serif: Didot, "Bodoni MT", "Times New Roman", Georgia, serif;
  --sans: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
img, video { display: block; max-width: 100%; }
h1, h2, h3, p, dl, dd { margin-top: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; }
h1 { letter-spacing: -.035em; }
h2 { letter-spacing: -.02em; }
small { color: var(--muted); }
hr { width: 100%; height: 1px; border: 0; background: var(--line); margin: 8px 0; }
code { padding: 3px 6px; border-radius: 4px; background: var(--ivory-2); color: var(--clay); font-size: 11px; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.eyebrow {
  margin-bottom: 10px;
  color: var(--clay);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.eyebrow-light { color: var(--gold); }
.muted { color: var(--muted); }

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 0 20px;
  background: transparent;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { border-color: var(--ink); background: var(--ink); color: var(--white); }
.button-primary:hover { border-color: var(--clay); background: var(--clay); }
.button-secondary { border-color: var(--line); background: var(--white); }
.button-secondary:hover { border-color: var(--gold); }
.button-small { min-height: 36px; padding: 0 13px; font-size: 9px; }
.button-wide { width: 100%; }
.text-button {
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 7px 0;
  color: var(--clay);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
}
.menu-toggle { display: none; }

.form-stack { display: grid; gap: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 8px; color: #4d4a43; font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.field-span-2 { grid-column: span 2; }
.field input, .field select, .field textarea, .library-filters input, .library-filters select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--white);
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .library-filters input:focus, .library-filters select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(194, 159, 92, .12); }
.field small { font-size: 10px; font-weight: 500; letter-spacing: 0; line-height: 1.5; text-transform: none; }
.field legend { margin-bottom: 10px; }
.file-drop { padding: 25px; border: 1px dashed var(--gold); background: var(--ivory-2); }

.alert {
  border: 1px solid #d5c8ab;
  background: #fbf2dc;
  color: #725e31;
  padding: 13px 15px;
  font-size: 13px;
  line-height: 1.5;
}
.alert-danger { border-color: #d9b4ad; background: #f9e8e4; color: #7c3930; }

/* Authentication and installation */
.auth-body { min-height: 100vh; background: var(--ivory-2); }
.auth-shell, .install-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1fr) minmax(520px, .9fr); }
.auth-story, .install-brand {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(60px, 9vw, 140px);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 15%, rgba(194,159,92,.2), transparent 25%),
    linear-gradient(145deg, #10100f, #24221d);
  color: var(--ivory);
}
.auth-story::after, .install-brand::after {
  content: "✦";
  position: absolute;
  right: -70px;
  bottom: -150px;
  color: rgba(194, 159, 92, .08);
  font-family: var(--serif);
  font-size: 430px;
}
.auth-story img, .install-brand img { width: 195px; height: auto; margin-bottom: 80px; }
.auth-story h1, .install-brand h1 { max-width: 700px; margin-bottom: 28px; font-size: clamp(52px, 5.2vw, 86px); line-height: .98; }
.auth-story > p:not(.eyebrow), .install-brand > p:not(.eyebrow) { max-width: 630px; color: #c9c0b0; font-family: Georgia, serif; font-size: 17px; line-height: 1.75; }
.auth-quote { max-width: 630px; margin-top: 60px; padding-top: 25px; border-top: 1px solid rgba(194, 159, 92, .5); color: var(--gold); font-family: Georgia, serif; font-size: 13px; font-style: italic; }
.auth-panel, .install-panel { display: grid; place-items: center; padding: 55px; background: var(--paper); }
.auth-card { width: min(470px, 100%); }
.auth-card h2, .install-panel h2 { margin-bottom: 15px; font-size: 47px; }
.auth-card > .muted, .install-panel > .muted { margin-bottom: 30px; font-family: Georgia, serif; font-size: 14px; line-height: 1.65; }
.auth-help { margin: 20px 0 0; color: var(--muted); text-align: center; font-size: 11px; }
.install-panel { place-items: start center; overflow-y: auto; }
.install-panel > * { width: min(700px, 100%); }
.install-checklist { display: grid; gap: 15px; margin: 45px 0 0; padding: 0; list-style: none; color: #d8d0c2; font-family: Georgia, serif; }
.install-checklist li::before { content: "✦"; margin-right: 13px; color: var(--gold); }

/* App shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--ink);
  color: #d5cdbf;
}
.sidebar-brand { min-height: 118px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 9px; padding: 24px 29px; border-bottom: 1px solid var(--line-dark); }
.sidebar-brand img { width: 132px; height: auto; }
.sidebar-brand span { color: #8f8779; font-size: 8px; font-weight: 800; letter-spacing: .26em; text-transform: uppercase; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 20px 13px; }
.nav-label { margin: 17px 15px 8px; color: #706b61; font-size: 8px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.sidebar-nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  border-radius: 2px;
  padding: 8px 12px;
  color: #aaa396;
  font-size: 11px;
  font-weight: 600;
  transition: .18s ease;
}
.sidebar-nav a:hover { color: var(--ivory); background: rgba(255,255,255,.04); }
.sidebar-nav a.active { background: rgba(194, 159, 92, .14); color: var(--ivory); }
.sidebar-nav a.active::before { content: ""; width: 2px; position: absolute; inset: 8px auto 8px -1px; background: var(--gold); }
.nav-icon { width: 21px; color: var(--gold); text-align: center; font-family: Georgia, serif; font-size: 17px; }
.sidebar-nav a em { min-width: 21px; margin-left: auto; border-radius: 20px; background: var(--clay); color: var(--white); padding: 3px 6px; text-align: center; font-size: 8px; font-style: normal; }
.sidebar-footer { min-height: 76px; display: flex; align-items: center; gap: 11px; padding: 17px 25px; border-top: 1px solid var(--line-dark); }
.sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-footer strong { color: #c4bcad; font-size: 9px; }
.sidebar-footer small { margin-top: 4px; color: #777166; font-size: 8px; }
.live-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #6a9a76; box-shadow: 0 0 0 4px rgba(106,154,118,.12); }

.app-main { min-width: 0; grid-column: 2; }
.topbar { height: 74px; display: flex; align-items: center; gap: 22px; position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: rgba(251,248,242,.94); padding: 0 31px; backdrop-filter: blur(14px); }
.global-search { width: min(430px, 43vw); display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); }
.global-search span { color: var(--clay); font-size: 21px; }
.global-search input { width: 100%; height: 41px; border: 0; background: transparent; outline: none; color: var(--ink); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.sync-state { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.sync-state span { width: 7px; height: 7px; border-radius: 50%; background: #6a9a76; }
.sync-state.syncing span { animation: pulse .8s ease infinite alternate; }
@keyframes pulse { to { opacity: .25; transform: scale(.75); } }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip strong, .user-chip small { display: block; }
.user-chip strong { margin-bottom: 2px; font-size: 10px; }
.user-chip small { font-size: 8px; text-transform: uppercase; }
.avatar {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(194,159,92,.5);
  border-radius: 50%;
  background: var(--ivory);
  color: var(--clay);
  font-size: 9px;
  font-weight: 800;
}
.avatar-small { width: 29px; height: 29px; font-size: 8px; }
.avatar-large { width: 64px; height: 64px; font-family: var(--serif); font-size: 19px; }
.avatar-xlarge { width: 90px; height: 90px; font-family: var(--serif); font-size: 28px; }
.sync-banner { position: sticky; top: 74px; z-index: 19; background: #313b32; color: #fff; padding: 9px 30px; text-align: center; font-size: 11px; }
.sync-banner button { border: 0; border-bottom: 1px solid var(--gold); background: transparent; color: var(--gold); }

.content { width: 100%; max-width: 1720px; margin: 0 auto; padding: 38px clamp(24px, 3.2vw, 58px) 70px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 35px; margin-bottom: 35px; }
.page-heading h1 { margin-bottom: 8px; font-size: clamp(37px, 4vw, 58px); line-height: 1; }
.page-heading > div > p:last-child { max-width: 750px; margin-bottom: 0; color: var(--muted); font-family: Georgia, serif; font-size: 13px; line-height: 1.7; }
.date-chip { align-self: center; border: 1px solid var(--line); background: var(--white); padding: 10px 15px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }

.panel { min-width: 0; border: 1px solid var(--line); background: rgba(255,255,255,.72); padding: 25px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 25px; margin-bottom: 20px; }
.panel-heading h2 { margin: 0; font-size: 26px; }
.panel-heading a, .panel-heading > span { color: var(--clay); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }

/* Dashboard */
.campaign-hero {
  min-height: 255px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 50px;
  overflow: hidden;
  position: relative;
  margin-bottom: 20px;
  background:
    linear-gradient(95deg, rgba(22,22,20,.98), rgba(34,34,31,.94)),
    radial-gradient(circle, rgba(194,159,92,.3), transparent);
  color: var(--ivory);
  padding: clamp(30px, 4vw, 55px);
}
.campaign-hero::before { content: "✦"; position: absolute; right: 20%; top: -130px; color: rgba(194,159,92,.08); font-size: 350px; }
.campaign-hero > div:first-child { max-width: 900px; position: relative; z-index: 1; }
.campaign-hero h2 { margin-bottom: 15px; font-size: clamp(34px, 4vw, 60px); }
.campaign-hero p:not(.eyebrow) { max-width: 700px; color: #c9c0b0; font-family: Georgia, serif; font-size: 14px; line-height: 1.7; }
.campaign-mark { width: 160px; height: 160px; display: grid; place-content: center; align-self: center; position: relative; z-index: 1; border: 1px solid rgba(194,159,92,.45); border-radius: 50%; text-align: center; }
.campaign-mark span { color: var(--gold); font-family: var(--serif); font-size: 62px; line-height: .8; }
.campaign-mark small { margin-top: 11px; color: #aaa294; font-size: 8px; letter-spacing: .14em; text-transform: uppercase; }
.hero-meta { display: flex; justify-content: space-between; max-width: 700px; margin-top: 28px; color: #bcb3a5; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
progress { width: 100%; height: 6px; overflow: hidden; border: 0; border-radius: 0; background: var(--line); }
progress::-webkit-progress-bar { background: rgba(194,159,92,.2); }
progress::-webkit-progress-value { background: var(--gold); }
progress::-moz-progress-bar { background: var(--gold); }
.campaign-hero progress { max-width: 700px; margin-top: 8px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { min-height: 143px; position: relative; overflow: hidden; border: 1px solid var(--line); background: var(--white); padding: 22px 23px; }
.stat-accent { width: 3px; position: absolute; inset: 0 auto 0 0; background: var(--gold); }
.tone-clay .stat-accent { background: var(--clay); }
.tone-sage .stat-accent { background: var(--sage); }
.tone-ink .stat-accent { background: var(--ink); }
.stat-card p { margin-bottom: 8px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.stat-card strong { display: block; margin-bottom: 7px; font-family: var(--serif); font-size: 42px; font-weight: 400; line-height: 1; }
.stat-card small { font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; }
.panel-large { grid-row: span 2; }
.phase-list { display: grid; gap: 0; }
.phase-row { min-height: 112px; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 17px; border-top: 1px solid var(--line); padding: 19px 0; }
.phase-number { color: var(--clay); font-family: var(--serif); font-size: 18px; }
.phase-copy strong, .phase-copy small { display: block; }
.phase-copy strong { margin-bottom: 7px; font-family: var(--serif); font-size: 20px; font-weight: 400; }
.phase-copy small { margin-bottom: 12px; font-size: 10px; line-height: 1.5; }
.phase-row b { color: var(--clay); font-family: var(--serif); font-size: 20px; font-weight: 400; }
.agenda-list, .activity-list { display: grid; }
.agenda-item { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 13px; border-top: 1px solid var(--line); padding: 14px 0; }
.agenda-item time { display: grid; place-content: center; text-align: center; }
.agenda-item time strong { color: var(--clay); font-family: var(--serif); font-size: 22px; font-weight: 400; line-height: .9; }
.agenda-item time span { margin-top: 4px; color: var(--muted); font-size: 7px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.agenda-item > div strong, .agenda-item > div small { display: block; }
.agenda-item > div strong { margin-bottom: 4px; font-size: 10px; }
.agenda-item > div small { max-width: 290px; overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.activity-item { display: flex; align-items: center; gap: 13px; border-top: 1px solid var(--line); padding: 13px 0; }
.activity-item strong, .activity-item small { display: block; }
.activity-item strong { margin-bottom: 4px; font-size: 10px; }
.activity-item small { font-size: 8px; }

/* Badges and statuses */
.badge, .priority {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--ivory-2);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-ready, .badge-approved, .badge-passed, .badge-go, .badge-complete, .badge-published, .badge-connected, .badge-active, .priority-low { border-color: rgba(77,118,94,.25); background: rgba(77,118,94,.1); color: var(--green); }
.badge-needs_review, .badge-in_review, .badge-scheduled, .badge-processing, .badge-retry, .badge-partially_published, .priority-normal, .priority-medium { border-color: rgba(194,159,92,.35); background: rgba(194,159,92,.12); color: var(--gold-dark); }
.badge-hold, .badge-failed, .badge-blocked, .badge-cancelled, .badge-inactive, .priority-urgent, .priority-critical { border-color: rgba(162,78,66,.25); background: rgba(162,78,66,.1); color: var(--red); }
.badge-in_progress, .badge-qualified, .badge-outreach, .badge-conversation, .badge-proposal, .priority-high { border-color: rgba(81,116,134,.25); background: rgba(81,116,134,.1); color: var(--blue); }
.badge-not_started, .badge-not_tested, .badge-draft, .badge-research, .badge-not_connected, .badge-needs_connection, .badge-pending { background: #f1eee8; color: #777169; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); }
.status-backlog, .status-not_tested { background: var(--sage); }
.status-in_progress, .status-passed { background: var(--blue); }
.status-needs_review, .status-blocked { background: var(--gold); }
.status-complete { background: var(--green); }
.status-failed { background: var(--red); }

/* Filters */
.filter-bar, .library-filters, .library-summary, .calendar-toolbar {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  background: var(--white);
  padding: 10px 16px;
}
.filter-bar { justify-content: space-between; margin-bottom: 15px; }
.filter-bar > span, .library-summary strong { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.filter-pills button, .filter-pills a { border: 0; border-radius: 20px; background: transparent; color: var(--muted); padding: 7px 10px; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.filter-pills button.active, .filter-pills a.active { background: var(--ivory); color: var(--ink); }
.library-filters { margin-bottom: 12px; }
.library-filters label { min-width: 160px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.library-filters input, .library-filters select { height: 38px; min-height: 38px; margin-top: 5px; padding: 7px 9px; font-size: 11px; }
.library-filters .grow { flex: 1; }
.library-summary { min-height: 42px; justify-content: space-between; border-top: 0; margin-bottom: 16px; color: var(--muted); font-size: 10px; }

/* Kanban and tasks */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 13px; overflow-x: auto; padding-bottom: 8px; }
.kanban-column { min-height: 570px; border: 1px solid var(--line); background: #f3eee6; }
.kanban-column > header { min-height: 55px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 0 15px; background: rgba(255,255,255,.7); }
.kanban-column > header h2 { margin: 0; font-family: var(--sans); font-size: 9px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.kanban-column > header em { margin-left: auto; color: var(--muted); font-size: 9px; font-style: normal; }
.kanban-stack { display: grid; gap: 10px; padding: 10px; }
.task-card, .contact-card { border: 1px solid var(--line); background: var(--white); padding: 15px; box-shadow: 0 8px 25px rgba(31,26,19,.04); }
.card-topline { min-height: 17px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--clay); font-size: 7px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.task-card h3, .contact-card h3 { margin: 12px 0 8px; font-family: var(--sans); font-size: 12px; font-weight: 700; line-height: 1.45; }
.task-card p, .contact-card p { margin-bottom: 15px; color: var(--muted); font-family: Georgia, serif; font-size: 10px; line-height: 1.55; }
.task-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); }
.quick-status { width: 100%; height: 32px; margin-top: 10px; border: 1px solid var(--line); border-radius: 2px; background: var(--ivory-2); padding: 3px 8px; color: var(--muted); font-size: 9px; }
.empty-column, .empty-state { padding: 35px 15px; color: var(--muted); text-align: center; font-family: Georgia, serif; font-size: 12px; font-style: italic; }

/* Calendar */
.calendar-toolbar { justify-content: space-between; margin-bottom: 12px; }
.calendar-nav { display: flex; align-items: center; gap: 18px; }
.calendar-nav a { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); }
.calendar-nav h2 { min-width: 160px; margin: 0; text-align: center; font-size: 22px; }
.calendar-legend { display: flex; gap: 14px; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.calendar-legend span { display: flex; align-items: center; gap: 5px; }
.calendar-legend i { width: 7px; height: 7px; border-radius: 50%; }
.format-video { background: var(--clay); }
.format-carousel { background: var(--gold); }
.format-story { background: var(--sage); }
.format-engagement { background: var(--blue); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--white); overflow-x: auto; }
.calendar-weekday { min-width: 110px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px; color: var(--muted); text-align: center; font-size: 8px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.calendar-day { min-width: 110px; min-height: 138px; overflow: hidden; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px; background: var(--paper); }
.calendar-day.outside { background: #f0ece5; color: #aaa49b; }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--gold); }
.day-number { display: block; margin-bottom: 7px; color: var(--muted); font-family: var(--serif); font-size: 14px; }
.calendar-event { width: 100%; display: grid; gap: 3px; position: relative; overflow: hidden; border: 0; border-left: 2px solid var(--clay); border-radius: 0; background: #f7eee9; margin-bottom: 5px; padding: 6px 7px; color: var(--ink); text-align: left; }
.calendar-event.format-carousel { border-color: var(--gold); background: #faf5e9; }
.calendar-event.format-story { border-color: var(--sage); background: #f0f0e9; }
.calendar-event.format-engagement { border-color: var(--blue); background: #edf3f5; }
.calendar-event span { color: var(--muted); font-size: 6px; font-weight: 900; letter-spacing: .05em; }
.calendar-event strong { overflow: hidden; font-size: 7px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }

/* Campaigns */
.campaign-overview { display: grid; grid-template-columns: 1.2fr .8fr; gap: 50px; margin-bottom: 18px; padding: 34px; }
.campaign-overview h2 { margin-bottom: 13px; font-size: 39px; }
.campaign-overview > div > p:last-child { color: var(--muted); font-family: Georgia, serif; line-height: 1.7; }
.campaign-overview dl { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 0; }
.campaign-overview dt, .phase-card dt, .email-card dt, .settings-list dt { margin-bottom: 6px; color: var(--muted); font-size: 7px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.campaign-overview dd, .phase-card dd, .email-card dd, .settings-list dd { margin: 0; font-size: 10px; line-height: 1.45; }
.phase-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.phase-card { min-height: 420px; display: flex; flex-direction: column; position: relative; overflow: hidden; border: 1px solid var(--line); background: var(--white); padding: 30px; }
.large-index { position: absolute; right: 15px; top: -10px; color: rgba(194,159,92,.12); font-family: var(--serif); font-size: 92px; }
.phase-card h2 { max-width: 320px; margin-bottom: 17px; font-size: 33px; line-height: 1.03; }
.phase-card > p:not(.eyebrow) { color: var(--muted); font-family: Georgia, serif; font-size: 12px; line-height: 1.65; }
.phase-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; margin: auto 0 25px; padding-top: 20px; border-top: 1px solid var(--line); }
.phase-card progress { margin-bottom: 8px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--ink); color: var(--ivory); padding: 11px 12px; text-align: left; font-size: 7px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }
td { border-bottom: 1px solid var(--line); padding: 11px 12px; color: #4f4b44; font-size: 9px; vertical-align: top; }
td strong, td small { display: block; }
td strong { margin-bottom: 4px; color: var(--ink); font-size: 10px; }
td small { max-width: 460px; line-height: 1.4; }

/* Content and assets */
.content-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.content-card { min-width: 0; display: grid; grid-template-columns: 37% 63%; border: 1px solid var(--line); background: var(--white); }
.content-preview { min-height: 275px; display: grid; place-items: center; position: relative; overflow: hidden; background: var(--ink); color: var(--gold); }
.content-preview img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; }
.content-preview span { font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.content-preview em { position: absolute; right: 8px; top: 8px; z-index: 1; background: rgba(22,22,20,.8); color: var(--gold); padding: 5px 6px; font-size: 7px; font-style: normal; }
.content-preview.format-carousel { background: var(--ivory); color: var(--clay); }
.content-preview.format-story { background: var(--sage); color: var(--white); }
.content-card-body { min-width: 0; display: flex; flex-direction: column; padding: 19px; }
.content-card h2, .asset-card h2 { margin: 13px 0 10px; font-size: 21px; line-height: 1.05; overflow-wrap: anywhere; }
.content-card p, .asset-card p { color: var(--muted); font-family: Georgia, serif; font-size: 10px; line-height: 1.55; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin: auto 0 13px; padding-top: 15px; }
.tag-row span { border-radius: 20px; background: var(--ivory-2); padding: 4px 7px; color: var(--muted); font-size: 7px; }
.card-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.email-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.email-card { min-height: 420px; display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--white); padding: 26px; }
.email-icon { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 22px; border: 1px solid rgba(194,159,92,.45); border-radius: 50%; color: var(--clay); }
.email-card h2 { margin-bottom: 18px; font-size: 28px; }
.email-card dl { display: grid; gap: 12px; margin-bottom: 18px; padding: 16px; background: var(--ivory-2); }
.email-card > p:not(.eyebrow) { color: var(--muted); font-family: Georgia, serif; font-size: 11px; line-height: 1.65; }
.email-card .card-actions { margin-top: auto; }
.asset-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.asset-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); background: var(--white); }
.asset-thumb { aspect-ratio: 1.35; display: grid; place-items: center; position: relative; overflow: hidden; background: var(--ink); }
.asset-thumb img, .asset-thumb video { width: 100%; height: 100%; object-fit: cover; }
.asset-thumb em { position: absolute; left: 9px; top: 9px; background: rgba(22,22,20,.84); color: var(--gold); padding: 6px 7px; font-size: 7px; font-style: normal; font-weight: 900; letter-spacing: .07em; }
.play-mark, .file-mark { position: absolute; color: var(--gold); }
.play-mark { width: 45px; height: 45px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.55); border-radius: 50%; padding-left: 3px; }
.file-mark { font-size: 9px; font-weight: 900; letter-spacing: .1em; }
.asset-body { padding: 17px; }
.asset-body small { display: block; margin-bottom: 8px; font-size: 8px; }
.pagination { display: flex; justify-content: center; gap: 5px; margin-top: 25px; }
.pagination a { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--white); font-size: 9px; }
.pagination a.active { border-color: var(--ink); background: var(--ink); color: var(--white); }

/* Gates */
.gate-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.gate-card { min-height: 430px; display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--white); padding: 24px; }
.gate-card > header { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.gate-card header span:not(.badge) { color: var(--clay); font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.gate-card h2 { margin: 7px 0 0; font-size: 26px; }
.gate-card > p { color: var(--muted); font-family: Georgia, serif; font-size: 11px; line-height: 1.55; }
.gate-progress { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; margin: 10px 0 14px; }
.gate-progress span { color: var(--muted); font-size: 8px; font-weight: 800; }
.check-list { display: grid; margin-bottom: 16px; }
.check-item { display: grid; grid-template-columns: 18px 1fr; gap: 9px; border-top: 1px solid var(--line); padding: 12px 0; cursor: pointer; }
.check-item input { accent-color: var(--clay); }
.check-item strong, .check-item small { display: block; }
.check-item strong { margin-bottom: 3px; font-size: 9px; }
.check-item small { font-size: 8px; line-height: 1.4; }
.decision-row { display: flex; gap: 6px; margin-top: auto; }
.decision-row button { flex: 1; border: 1px solid var(--line); background: var(--ivory-2); padding: 8px; color: var(--muted); font-size: 7px; font-weight: 900; text-transform: uppercase; }

/* QA and business */
.mini-stat-row, .pipeline-summary { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); background: var(--white); margin-bottom: 15px; }
.mini-stat-row > div, .pipeline-summary > div { min-height: 84px; display: flex; align-items: center; justify-content: center; gap: 10px; border-right: 1px solid var(--line); padding: 14px; text-align: center; }
.mini-stat-row > div:last-child, .pipeline-summary > div:last-child { border-right: 0; }
.mini-stat-row strong, .pipeline-summary strong { font-family: var(--serif); font-size: 28px; font-weight: 400; }
.mini-stat-row small, .pipeline-summary span { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.qa-table td:first-child { min-width: 300px; }
.pipeline { grid-template-columns: repeat(6, minmax(210px, 1fr)); }
.pipeline .kanban-column { min-height: 500px; }
.next-action { display: grid; gap: 4px; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.next-action span { color: var(--clay); font-size: 7px; font-weight: 900; text-transform: uppercase; }
.next-action strong { font-size: 9px; line-height: 1.4; }
.next-action small { font-size: 8px; }

/* Publishing */
.connections-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 13px; }
.connection-card { min-width: 0; display: grid; grid-template-columns: 42px 1fr; gap: 11px; align-items: center; border: 1px solid var(--line); background: var(--white); padding: 15px; }
.platform-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--gold); font-family: var(--serif); font-size: 18px; }
.connection-card strong, .connection-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connection-card strong { margin-bottom: 3px; font-size: 9px; }
.connection-card small { font-size: 8px; }
.connection-card .badge, .connection-card .text-button { grid-column: span 2; }
.connection-card .text-button { justify-self: start; }
.publishing-note { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: center; margin-bottom: 15px; border: 1px solid #ddcfb3; background: #f8f0de; padding: 13px 16px; color: #6c5c3a; }
.publishing-note > span { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; font-family: Georgia, serif; }
.publishing-note p { margin: 0; font-family: Georgia, serif; font-size: 11px; line-height: 1.5; }
.platform-dots { display: flex; gap: 4px; }
.platform-dots span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--gold); font-family: var(--serif); font-size: 9px; }
.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.checkbox-grid label { display: grid; grid-template-columns: auto 1fr auto; gap: 7px; align-items: center; border: 1px solid var(--line); padding: 9px; background: var(--white); font-size: 10px; font-weight: 600; letter-spacing: 0; text-transform: none; }

/* People, settings, account */
.people-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.person-card { display: grid; grid-template-columns: auto 1fr; gap: 17px; border: 1px solid var(--line); background: var(--white); padding: 23px; }
.person-card h2 { margin: 8px 0 5px; font-size: 25px; }
.person-card p, .person-card a { margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.person-card dl { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); margin: 10px 0 0; padding-top: 14px; }
.person-card dt { color: var(--muted); font-size: 7px; font-weight: 900; text-transform: uppercase; }
.person-card dd { margin: 5px 0 0; font-size: 10px; }
.person-card .card-actions { grid-column: span 2; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.panel-span-2 { grid-column: span 2; }
.settings-list { display: grid; margin: 0; }
.settings-list > div { display: flex; align-items: center; justify-content: space-between; gap: 25px; border-top: 1px solid var(--line); padding: 13px 0; }
.settings-list dt { margin: 0; }
.settings-list dd { text-align: right; }
.swatch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.swatch { min-height: 100px; display: flex; flex-direction: column; justify-content: flex-end; border: 1px solid var(--line); padding: 12px; }
.swatch span { font-size: 8px; }
.swatch strong { font-family: var(--serif); font-size: 18px; font-weight: 400; }
.swatch-ink { background: var(--ink); color: var(--white); }
.swatch-gold { background: var(--gold); }
.swatch-ivory { background: var(--ivory); }
.swatch-clay { background: var(--clay); color: var(--white); }
.integration-list { display: grid; }
.integration-list > div { display: grid; grid-template-columns: 46px 1fr auto auto; align-items: center; gap: 14px; border-top: 1px solid var(--line); padding: 12px 0; }
.integration-list strong, .integration-list small { display: block; }
.integration-list strong { margin-bottom: 4px; font-size: 10px; }
.integration-list small { font-size: 8px; }
.profile-block { display: flex; align-items: center; gap: 21px; margin: 25px 0; }
.profile-block h2 { margin: 0 0 7px; font-size: 31px; }
.profile-block p, .profile-block a { margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.session-list { display: grid; }
.session-list > div { display: flex; align-items: center; gap: 14px; border-top: 1px solid var(--line); padding: 14px 0; }
.session-list strong, .session-list small { display: block; }
.session-list strong { margin-bottom: 4px; font-size: 10px; }

/* Modal and toast */
.modal {
  width: min(650px, calc(100vw - 30px));
  max-height: calc(100vh - 30px);
  overflow: auto;
  border: 0;
  background: var(--paper);
  padding: 0;
  box-shadow: 0 25px 90px rgba(0,0,0,.3);
}
.modal::backdrop { background: rgba(10,10,9,.72); backdrop-filter: blur(7px); }
.modal-compact { width: min(530px, calc(100vw - 30px)); }
.modal-close-form { position: sticky; top: 0; z-index: 2; height: 0; }
.modal-close-form button { width: 42px; height: 42px; position: absolute; right: 12px; top: 12px; border: 0; border-radius: 50%; background: var(--ivory); color: var(--ink); font-family: var(--serif); font-size: 26px; }
.modal-body { padding: clamp(35px, 6vw, 62px); }
.modal-body h2 { margin-bottom: 26px; font-size: 42px; }
.modal-copy { color: var(--muted); font-family: Georgia, serif; font-size: 14px; line-height: 1.75; white-space: pre-wrap; }
.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 390px; border-left: 3px solid var(--gold); background: var(--ink); color: var(--white); padding: 13px 16px; box-shadow: var(--shadow); font-size: 11px; line-height: 1.45; animation: toast-in .25s ease both; }
.toast.error { border-color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1400px) {
  .content-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .connections-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1120px) {
  :root { --sidebar-width: 226px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .panel-large { grid-row: auto; }
  .phase-card-grid, .gate-grid, .people-grid { grid-template-columns: 1fr 1fr; }
  .email-grid { grid-template-columns: 1fr 1fr; }
  .asset-grid { grid-template-columns: 1fr 1fr; }
  .campaign-overview { grid-template-columns: 1fr; gap: 25px; }
  .connections-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { transform: translateX(-105%); transition: transform .25s ease; box-shadow: 20px 0 60px rgba(0,0,0,.25); }
  .sidebar.open { transform: translateX(0); }
  .app-main { width: 100%; }
  .menu-toggle { display: block; }
  .topbar { padding-inline: 15px; }
  .global-search { width: auto; flex: 1; }
  .sync-state, .user-chip > span:last-child { display: none; }
  .content { padding: 27px 16px 55px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 25px; }
  .page-heading h1 { font-size: 42px; }
  .campaign-hero { grid-template-columns: 1fr; }
  .campaign-mark { display: none; }
  .content-grid, .phase-card-grid, .gate-grid, .people-grid, .email-grid { grid-template-columns: 1fr; }
  .asset-grid { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .panel-span-2 { grid-column: auto; }
  .connections-grid { grid-template-columns: 1fr 1fr; }
  .auth-shell, .install-shell { grid-template-columns: 1fr; }
  .auth-story, .install-brand { min-height: 520px; padding: 60px 35px; }
  .auth-story img, .install-brand img { margin-bottom: 50px; }
  .auth-panel, .install-panel { padding: 50px 25px; }
}

@media (max-width: 580px) {
  .topbar { gap: 10px; }
  .global-search { display: none; }
  .topbar-actions { margin-left: auto; }
  .page-heading .button { width: 100%; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { min-height: 125px; padding: 18px; }
  .stat-card strong { font-size: 34px; }
  .campaign-hero { min-height: 280px; padding: 28px 22px; }
  .campaign-hero h2 { font-size: 38px; }
  .phase-row { grid-template-columns: 30px 1fr; }
  .phase-row b { display: none; }
  .panel { padding: 19px 16px; }
  .filter-bar, .library-filters, .calendar-toolbar, .library-summary { align-items: stretch; flex-direction: column; }
  .library-filters label { width: 100%; }
  .kanban { grid-template-columns: repeat(4, 82vw); }
  .calendar-toolbar { gap: 16px; }
  .calendar-legend { flex-wrap: wrap; }
  .phase-card-grid { grid-template-columns: 1fr; }
  .campaign-overview dl { grid-template-columns: 1fr; }
  .content-card { grid-template-columns: 1fr; }
  .content-preview { min-height: 230px; }
  .asset-grid { grid-template-columns: 1fr; }
  .connections-grid { grid-template-columns: 1fr; }
  .mini-stat-row, .pipeline-summary { grid-template-columns: 1fr 1fr; }
  .mini-stat-row > div:nth-child(2), .pipeline-summary > div:nth-child(2) { border-right: 0; }
  .mini-stat-row > div:nth-child(-n+2), .pipeline-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .form-grid { grid-template-columns: 1fr; }
  .field-span-2 { grid-column: auto; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .integration-list > div { grid-template-columns: 42px 1fr auto; }
  .integration-list .button { grid-column: span 3; }
  .auth-story h1, .install-brand h1 { font-size: 47px; }
  .auth-panel, .install-panel { padding: 42px 20px; }
  .auth-card h2, .install-panel h2 { font-size: 39px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
