:root {
  --ink: #171916;
  --paper: #f1efe7;
  --white: #fffefa;
  --line: #c9c8bf;
  --muted: #74766f;
  --acid: #dfff00;
  --orange: #ff6b36;
  --blue: #83c5ff;
  --green: #2d7650;
  --red: #a3342a;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(23, 25, 22, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 25, 22, .025) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 18px 18px;
  color: var(--white);
  background:
    radial-gradient(circle at 100% 0, rgba(223,255,0,.11), transparent 28%),
    var(--ink);
  border-right: 1px solid #30332e;
}

.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  width: 100%;
  padding: 0 4px 30px;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--ink);
  background: var(--acid);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--ink), 0 0 0 4px var(--acid);
  font: 800 14px/1 ui-monospace, monospace;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 13px; letter-spacing: .08em; }
.brand small {
  margin-top: 3px;
  color: #a8aca4;
  font: 500 9px/1 ui-monospace, monospace;
  letter-spacing: .14em;
}

.sidebar nav { display: grid; gap: 6px; }
.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 11px 12px;
  color: #b9bcb5;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  transition: 160ms ease;
}
.nav-item:hover { color: var(--white); background: #242721; }
.nav-item.active { color: var(--ink); background: var(--acid); border-color: var(--acid); font-weight: 750; }
.nav-item > span { text-align: center; font: 700 18px/1 ui-monospace, monospace; }
.nav-item b {
  min-width: 20px;
  padding: 3px 6px;
  color: var(--white);
  text-align: center;
  background: var(--orange);
  border-radius: 20px;
  font: 700 10px/1 ui-monospace, monospace;
}

.sidebar-foot { display: grid; gap: 16px; margin-top: auto; }
.connection-mini, .owner { display: flex; gap: 10px; align-items: center; }
.connection-mini { padding: 13px 10px; border: 1px solid #3a3d37; border-radius: 7px; }
.connection-mini strong, .connection-mini small, .owner strong, .owner small { display: block; }
.connection-mini strong, .owner strong { font-size: 12px; }
.connection-mini small, .owner small { margin-top: 3px; color: #8f938a; font-size: 10px; }
.status-dot { width: 9px; height: 9px; flex: 0 0 auto; background: #757970; border-radius: 50%; }
.status-dot.live { background: var(--acid); box-shadow: 0 0 0 3px rgba(223,255,0,.14); }
.owner { padding: 0 8px; }
.owner > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--ink);
  background: var(--white);
  border-radius: 50%;
  font-weight: 800;
}
.owner a { margin-left: auto; color: #8f938a; font-size: 9px; }

main { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 92px;
  padding: 17px 34px;
  background: rgba(241,239,231,.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.topbar h1 {
  margin: 3px 0 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1;
  letter-spacing: -.05em;
}
.eyebrow { color: var(--muted); font: 700 10px/1 ui-monospace, monospace; letter-spacing: .12em; }
.eyebrow.dark { color: rgba(23,25,22,.65); }
.top-actions { display: flex; gap: 12px; align-items: center; }
.sync { color: var(--muted); font: 500 10px/1 ui-monospace, monospace; }

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  color: inherit;
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 4px;
  cursor: pointer;
  font-weight: 740;
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 3px 3px 0 var(--ink); }
.button:disabled { color: #92948e; background: #d8d7d0; border-color: #c1c1ba; cursor: not-allowed; }
.button.primary { color: var(--ink); background: var(--acid); }
.button.secondary { background: var(--white); }
.button.ink { color: var(--white); background: var(--ink); white-space: nowrap; }
.button.full { width: 100%; }

.notice {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 18px 34px -4px;
  padding: 12px 14px;
  color: var(--white);
  background: var(--green);
  border-radius: 4px;
  font-size: 13px;
}
.notice.error { background: var(--red); }
.notice button { color: inherit; background: none; border: 0; cursor: pointer; font-size: 20px; }

.content { padding: 28px 34px 48px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: enter 180ms ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } }

.connect-banner {
  display: grid;
  grid-template-columns: 68px 1fr auto;
  gap: 22px;
  align-items: center;
  margin-bottom: 22px;
  padding: 20px 22px;
  background: var(--acid);
  border: 1px solid var(--ink);
  border-radius: 6px;
  box-shadow: 5px 5px 0 var(--ink);
}
.connect-number { color: rgba(23,25,22,.3); font: 800 44px/1 ui-monospace, monospace; }
.connect-banner h2 { margin: 4px 0 5px; font-size: 23px; letter-spacing: -.035em; }
.connect-banner p { max-width: 650px; margin: 0; font-size: 13px; line-height: 1.45; }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.metric {
  position: relative;
  min-height: 134px;
  padding: 20px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.metric::after {
  position: absolute;
  right: -18px;
  bottom: -30px;
  width: 76px;
  height: 76px;
  border: 1px solid #e2e1db;
  border-radius: 50%;
  content: "";
}
.metric.accent { color: var(--white); background: var(--ink); border-color: var(--ink); }
.metric.accent::after { border-color: #41443e; }
.metric > strong, .metric > span, .metric > small { display: block; }
.metric > strong { font: 780 34px/1 ui-monospace, monospace; letter-spacing: -.07em; }
.metric > span { margin-top: 10px; font-size: 12px; font-weight: 680; }
.metric > small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.metric.accent small { color: var(--acid); }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
  gap: 12px;
}
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 6px; }
.weekly-panel, .goal-panel, .conversations-panel, .next-panel { padding: 22px; }
.panel-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.panel h2 { margin: 5px 0 0; font-size: 21px; letter-spacing: -.035em; }
.week-pill, .status-chip, .safe-badge, .state {
  padding: 5px 8px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 100px;
  font: 650 9px/1 ui-monospace, monospace;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-chip.live, .state.published { color: var(--green); background: #e5f4e9; border-color: #afcfb8; }

.week-list { margin: 18px 0 10px; border-top: 1px solid var(--line); }
.week-item {
  display: grid;
  grid-template-columns: 42px 86px minmax(0,1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 55px;
  border-bottom: 1px solid var(--line);
}
.week-item b { font: 750 11px/1 ui-monospace, monospace; }
.week-item > span { color: var(--muted); font: 700 9px/1 ui-monospace, monospace; }
.week-item > strong { font-size: 12px; }
.week-item i { padding: 4px 7px; color: var(--muted); background: var(--paper); border-radius: 3px; font: normal 600 9px/1 ui-monospace, monospace; }
.text-link, .plain-button { padding: 0; color: var(--ink); background: none; border: 0; cursor: pointer; font-size: 11px; font-weight: 730; text-decoration: underline; text-underline-offset: 3px; }

.goal-panel { background: var(--blue); border-color: #5295cd; }
.goal-visual { display: grid; grid-template-columns: 116px 1fr; gap: 18px; align-items: center; margin-top: 22px; }
.goal-ring {
  display: grid;
  width: 112px;
  height: 112px;
  place-content: center;
  text-align: center;
  background: radial-gradient(closest-side, var(--blue) 72%, transparent 73% 99%), conic-gradient(var(--ink) 40%, rgba(255,255,255,.46) 0);
  border-radius: 50%;
}
.goal-ring strong, .goal-ring span { display: block; }
.goal-ring strong { font: 800 25px/1 ui-monospace, monospace; }
.goal-ring span { margin-top: 4px; font-size: 8px; text-transform: uppercase; }
.goal-copy p { margin: 0; font-size: 12px; line-height: 1.45; }
.goal-copy ul { margin: 11px 0 0; padding-left: 16px; font-size: 11px; line-height: 1.7; }

.conversation-row {
  display: grid;
  grid-template-columns: 35px 1fr auto;
  gap: 11px;
  align-items: center;
  min-height: 60px;
  border-bottom: 1px solid var(--line);
}
.conversation-row:last-child { border-bottom: 0; }
.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--white);
  background: var(--ink);
  border-radius: 50%;
  font: 700 12px/1 ui-monospace, monospace;
  text-transform: uppercase;
}
.avatar.large { width: 42px; height: 42px; }
.conversation-row strong { font-size: 11px; }
.conversation-row p { overflow: hidden; margin: 3px 0 0; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-row i {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  color: var(--white);
  background: var(--orange);
  border-radius: 50%;
  font: normal 700 9px/1 ui-monospace, monospace;
}

.next-panel { position: relative; min-height: 225px; overflow: hidden; color: var(--white); background: var(--ink); border-color: var(--ink); }
.next-panel::after { position: absolute; right: -70px; bottom: -80px; width: 210px; height: 210px; border: 34px solid #2b2e29; border-radius: 50%; content: ""; }
.next-panel .eyebrow { color: #93978f; }
.next-panel h2, .next-panel p, .next-panel .state, .next-panel .content-stamp { position: relative; z-index: 1; }
.next-panel h2 { max-width: 310px; margin-top: 19px; font-size: 18px; line-height: 1.28; }
.next-panel p { color: #aeb1aa; font-size: 11px; }
.content-stamp { display: inline-block; margin-top: 14px; padding: 4px 7px; color: var(--ink); background: var(--acid); border-radius: 2px; font: 800 9px/1 ui-monospace, monospace; text-transform: uppercase; }
.content-stamp.story { background: var(--orange); }
.content-stamp.post { background: var(--blue); }
.state { display: inline-block; }
.state.draft { color: #725f1e; background: #fff3c6; border-color: #d6c784; }
.state.scheduled { color: #22557b; background: #dceeff; border-color: #99c6e9; }
.state.failed { color: #8d2c23; background: #ffe0dc; border-color: #e2a39b; }

.empty-state { padding: 28px 14px; color: var(--muted); text-align: center; font-size: 11px; }
.inbox-layout { display: grid; grid-template-columns: minmax(260px,.68fr) minmax(420px,1.55fr); min-height: calc(100vh - 170px); }
.thread-list { padding: 12px; border-radius: 6px 0 0 6px; }
.search { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; padding: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; }
.search input { width: 100%; background: transparent; border: 0; outline: 0; font-size: 11px; }
.thread-row {
  display: grid;
  grid-template-columns: 35px minmax(0,1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 13px 10px;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.thread-row.selected { background: var(--acid); border-radius: 4px; }
.thread-row > span:nth-child(2) { min-width: 0; }
.thread-row strong, .thread-row small { display: block; }
.thread-row strong { font-size: 11px; }
.thread-row small { overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.thread-row b { display: grid; width: 18px; height: 18px; place-items: center; color: var(--white); background: var(--orange); border-radius: 50%; font: 700 8px/1 ui-monospace, monospace; }
.chat { display: grid; grid-template-rows: auto 1fr auto; border-left: 0; border-radius: 0 6px 6px 0; }
.chat-head { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.chat-head h2 { margin: 0; font-size: 14px; }
.chat-head div > span { color: var(--muted); font-size: 9px; }
.safe-badge { color: var(--green); background: #e6f4e9; border-color: #abd0b4; }
.chat-body { display: flex; min-height: 320px; max-height: 520px; padding: 28px; overflow-y: auto; flex-direction: column; gap: 12px; background: linear-gradient(rgba(23,25,22,.02) 1px, transparent 1px), var(--paper); background-size: 100% 24px; }
.bubble { width: fit-content; max-width: 68%; padding: 12px 14px; font-size: 12px; line-height: 1.5; }
.bubble.inbound { background: var(--white); border: 1px solid var(--line); border-radius: 3px 12px 12px; }
.bubble.outbound { align-self: flex-end; color: var(--white); background: var(--ink); border-radius: 12px 3px 12px 12px; }
.bubble p { margin: 0; white-space: pre-wrap; }
.bubble time { display: block; margin-top: 6px; color: var(--muted); font: 600 8px/1.2 ui-monospace, monospace; }
.bubble.outbound time { color: #aeb2aa; text-align: right; }
.reply-box { padding: 14px 18px; border-top: 1px solid var(--line); }
.reply-box textarea { width: 100%; min-height: 74px; padding: 10px; resize: vertical; border: 1px solid var(--line); border-radius: 4px; outline: 0; }
.reply-box > div { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-top: 8px; }
.reply-box small { color: var(--muted); font-size: 9px; }

.calendar-layout { display: grid; grid-template-columns: minmax(300px,.62fr) minmax(620px,1.38fr); gap: 14px; align-items: start; }
.rules-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(320px,.72fr); gap: 14px; align-items: start; }
.schedule, .composer, .rule-form { padding: 22px; }
.timeline { margin-top: 18px; }
.timeline-row { display: grid; grid-template-columns: 48px 55px minmax(0,1fr) auto; gap: 13px; align-items: center; min-height: 78px; border-top: 1px solid var(--line); }
.timeline-row.flash { animation: timeline-flash 1.8s ease; }
@keyframes timeline-flash {
  0%, 55% { background: #f0ffc6; box-shadow: 0 0 0 4px var(--acid); }
  100% { background: transparent; box-shadow: none; }
}
.date-block { text-align: center; }
.date-block strong, .date-block span { display: block; }
.date-block strong { font: 800 21px/1 ui-monospace, monospace; }
.date-block span { margin-top: 3px; color: var(--muted); font: 650 9px/1 ui-monospace, monospace; text-transform: uppercase; }
.timeline-row .content-stamp { margin: 0; text-align: center; }
.timeline-copy strong, .timeline-copy small, .timeline-copy em { display: block; }
.timeline-copy strong { font-size: 12px; }
.timeline-copy small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.timeline-copy em { margin-top: 4px; color: var(--red); font-size: 9px; }
.timeline-actions { display: grid; gap: 7px; justify-items: end; }
.mini-action { padding: 6px 8px; background: var(--white); border: 1px solid var(--line); border-radius: 3px; cursor: pointer; font: 700 8px/1 ui-monospace, monospace; }
.mini-action.danger { color: var(--red); border-color: #d9aaa5; }
.mini-action:hover { border-color: var(--ink); }
.mini-action:disabled { cursor: wait; opacity: .55; }
.composer, .rule-form { position: sticky; top: 118px; }
.composer h2, .rule-form h2 { margin-bottom: 21px; }
.composer-intro { margin: -10px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.phase-badge { padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font: 700 9px/1 ui-monospace, monospace; }
.composer-steps { display: grid; grid-template-columns: auto 1fr auto 1fr auto; gap: 8px; align-items: center; margin: -4px 0 20px; }
.composer-steps > span { height: 1px; background: var(--line); }
.composer-steps button, .composer-steps > div {
  display: flex;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  gap: 6px;
  align-items: center;
  font: 700 8px/1 ui-monospace, monospace;
  text-transform: uppercase;
}
.composer-steps button { cursor: pointer; }
.composer-steps b { display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid var(--line); border-radius: 50%; }
.composer-steps .active { color: var(--ink); }
.composer-steps .active b { background: var(--acid); border-color: var(--ink); }
.composer-step[hidden] { display: none; }
.composer label, .rule-form label { display: block; margin-top: 15px; font-size: 10px; font-weight: 700; }
.composer input, .composer textarea, .rule-form input, .rule-form textarea, .rule-form select {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 11px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  outline: none;
  font-size: 11px;
}
.composer input[type="file"] { padding: 8px; }
.file-drop { padding: 11px; background: var(--paper); border: 1px dashed #9b9c94; border-radius: 4px; transition: 140ms ease; }
.file-drop.dragging { background: #f7ffd0; border-color: var(--ink); }
.file-drop .drop-copy { display: block; margin: 5px 0 2px; color: var(--muted); font-size: 9px; font-weight: 500; }
.file-drop input[type="file"] { margin-top: 7px; background: var(--white); border-style: solid; }
.composer textarea, .rule-form textarea { min-height: 92px; resize: vertical; }
.composer label small { display: block; margin-top: 5px; color: var(--muted); font-weight: 400; }
.timezone-note { display: block; margin-top: 6px; color: var(--muted); font-size: 8px; }
.format-picker { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-top: 7px; }
.format-picker button { padding: 9px 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 3px; cursor: pointer; font: 700 9px/1 ui-monospace, monospace; text-transform: uppercase; }
.format-picker button.selected { background: var(--acid); border-color: var(--ink); }
.format-picker.single { grid-template-columns: 1fr; }
.post-actions .button { min-height: 44px; padding-inline: 10px; }
.reel-workbench { margin-top: 13px; }
.reel-workbench:has(.video-editor:not([hidden])) {
  display: grid;
  grid-template-columns: 205px minmax(0,1fr);
  gap: 12px;
  align-items: start;
}
.media-preview { padding: 12px; background: var(--ink); border: 1px solid var(--ink); border-radius: 5px; }
.preview-stage {
  position: relative;
  display: grid;
  width: min(100%, 180px);
  aspect-ratio: 9 / 16;
  margin-inline: auto;
  overflow: hidden;
  place-items: center;
  background:
    linear-gradient(45deg, #252822 25%, transparent 25%),
    linear-gradient(-45deg, #252822 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #252822 75%),
    linear-gradient(-45deg, transparent 75%, #252822 75%),
    #1d1f1b;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  border: 1px solid #3d4039;
  border-radius: 4px;
}
.media-preview[data-format="post"] .preview-stage { aspect-ratio: 4 / 5; }
.preview-stage img, .preview-stage video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.preview-stage video { transform-origin: center; transition: transform 120ms ease; }
.preview-empty { max-width: 145px; padding: 12px; color: #aeb1aa; text-align: center; font-size: 10px; line-height: 1.45; }
.preview-ratio { position: absolute; top: 7px; left: 7px; padding: 4px 6px; color: var(--ink); background: var(--acid); border-radius: 2px; font: 800 7px/1 ui-monospace, monospace; letter-spacing: .06em; }
.preview-overlay-text {
  position: absolute;
  z-index: 2;
  left: 50%;
  width: 84%;
  padding: 6px 7px;
  color: var(--white);
  text-align: center;
  white-space: pre-wrap;
  background: rgba(0,0,0,.68);
  border-radius: 3px;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.18;
}
.preview-overlay-text[data-position="top"] { top: 14%; }
.preview-overlay-text[data-position="center"] { top: 50%; transform: translate(-50%, -50%); }
.preview-overlay-text[data-position="bottom"] { bottom: 12%; }
.preview-info { display: flex; justify-content: space-between; gap: 10px; align-items: start; margin-top: 10px; }
.preview-info strong, .preview-info small { display: block; }
.preview-info strong { overflow: hidden; max-width: 205px; color: var(--white); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.preview-info small { margin-top: 4px; color: #aeb1aa; font-size: 8px; line-height: 1.35; }
.media-preview.invalid { border-color: var(--orange); }
.media-preview.invalid .preview-ratio { color: var(--white); background: var(--orange); }
.media-preview.warning { border-color: #d2ac32; }
.media-preview.warning .preview-ratio { color: var(--ink); background: #ffd95b; }
.media-preview .mini-action { color: var(--white); background: transparent; border-color: #666b62; }
.media-preview .mini-action:hover { border-color: var(--white); }
.upload-progress { margin-top: 12px; padding: 10px; background: #edf5fa; border: 1px solid #99c6e9; border-radius: 4px; }
.upload-progress .progress-track { height: 8px; overflow: hidden; background: #cddce6; border-radius: 20px; }
.upload-progress .progress-track span { display: block; width: 0; height: 100%; background: #276a93; transition: width 160ms linear; }
.upload-progress > div:last-child { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 8px; }
.upload-progress small { color: #22557b; font-size: 8px; }
.video-editor { min-width: 0; padding: 14px; background: #f7f6f0; border: 1px solid var(--ink); border-radius: 5px; }
.editor-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.editor-head h3 { margin: 4px 0 0; font-size: 15px; }
.editor-state { padding: 5px 7px; color: #725f1e; background: #fff3c6; border: 1px solid #d6c784; border-radius: 100px; font: 700 8px/1 ui-monospace, monospace; text-transform: uppercase; }
.editor-state.ready { color: var(--green); background: #e5f4e9; border-color: #afcfb8; }
.editor-state.working { color: #22557b; background: #dceeff; border-color: #99c6e9; }
.editor-state.failed { color: var(--red); background: #ffe0dc; border-color: #e2a39b; }
.trim-presets { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.trim-presets button {
  padding: 6px 8px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  font: 700 8px/1 ui-monospace, monospace;
}
.trim-presets button:hover { background: var(--acid); border-color: var(--ink); }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.video-editor label { position: relative; margin-top: 12px; }
.video-editor input[type="range"] { height: 24px; margin-top: 4px; padding: 0; accent-color: var(--ink); background: transparent; border: 0; }
.range-with-number { display: grid; grid-template-columns: minmax(0,1fr) 62px; gap: 7px; align-items: center; }
.video-editor .range-with-number input[type="number"] {
  width: 62px;
  margin: 4px 0 0;
  padding: 6px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 3px;
  font: 700 9px/1 ui-monospace, monospace;
}
.video-editor input[type="text"], .video-editor select {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 10px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 10px;
}
.video-editor output { display: block; color: var(--muted); text-align: right; font: 650 8px/1 ui-monospace, monospace; }
.editor-summary { display: flex; justify-content: space-between; gap: 12px; margin: 14px 0 10px; padding-top: 10px; color: var(--muted); border-top: 1px solid var(--line); font: 600 8px/1.4 ui-monospace, monospace; }
.render-progress { margin: 12px 0; }
.render-progress > div { height: 8px; overflow: hidden; background: #d8d8d1; border-radius: 30px; }
.render-progress span { display: block; width: 0; height: 100%; background: var(--acid); border-right: 1px solid var(--ink); transition: width 240ms ease; }
.render-progress.working span {
  background: repeating-linear-gradient(120deg, var(--acid) 0 12px, #d8f000 12px 24px);
  background-size: 48px 100%;
  animation: render-working .7s linear infinite;
}
@keyframes render-working { to { background-position: 48px 0; } }
.render-progress small { display: block; margin-top: 6px; color: var(--muted); font-size: 8px; }
.autosave-state { margin-top: 14px; color: var(--muted); text-align: right; font: 600 8px/1.4 ui-monospace, monospace; }
.review-panel { padding-top: 2px; }
.review-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.review-head h3 { margin: 5px 0 0; font-size: 18px; }
.review-media { display: grid; grid-template-columns: minmax(0,1fr) 118px; gap: 12px; align-items: start; }
.review-media.no-cover { grid-template-columns: 1fr; }
.review-video-frame {
  position: relative;
  display: grid;
  width: min(100%, 250px);
  aspect-ratio: 9 / 16;
  margin-inline: auto;
  overflow: hidden;
  place-items: center;
  background: var(--ink);
  border: 1px solid #3d4039;
  border-radius: 5px;
}
.review-video-frame video, .review-video-frame img { width: 100%; height: 100%; object-fit: cover; background: #000; }
.review-wait { position: absolute; inset: 0; display: grid; padding: 20px; color: #c8cbc4; text-align: center; place-items: center; background: rgba(23,25,22,.88); font-size: 10px; line-height: 1.5; }
.review-cover { padding: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; }
.review-cover > span, .review-copy > span, .review-schedule span { display: block; margin-bottom: 7px; color: var(--muted); font: 700 8px/1 ui-monospace, monospace; text-transform: uppercase; }
.review-cover img, .review-cover > div { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: #deded8; border-radius: 3px; }
.review-cover > div { display: grid; padding: 8px; color: var(--muted); text-align: center; place-items: center; font-size: 8px; line-height: 1.4; }
.review-copy { margin-top: 15px; padding: 13px; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; }
.review-copy p { margin: 0; white-space: pre-wrap; font-size: 11px; line-height: 1.5; }
.review-schedule { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }
.review-schedule > div { padding: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; }
.review-schedule strong { display: block; font-size: 10px; }
.manual-note { margin-top: 14px; padding: 10px; color: #705917; background: #fff3c7; border-left: 3px solid #d2ac32; font-size: 10px; line-height: 1.4; }
.form-error { margin-top: 12px; padding: 10px; color: #8d2c23; background: #ffe0dc; border-radius: 3px; font-size: 10px; }
.form-success { margin-top: 12px; padding: 10px; color: var(--green); background: #e5f4e9; border-radius: 3px; font-size: 10px; }
.form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.form-actions.post-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.composer-steps[hidden] { display: none; }

.safety-callout { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; padding: 16px; color: var(--white); background: var(--green); border-radius: 5px; }
.safety-callout > span { display: grid; width: 27px; height: 27px; flex: 0 0 auto; place-items: center; color: var(--green); background: var(--acid); border-radius: 50%; font-weight: 900; }
.safety-callout strong { font-size: 12px; }
.safety-callout p { margin: 4px 0 0; color: #c9ded1; font-size: 10px; line-height: 1.45; }
.rules-list { display: grid; gap: 10px; }
.rule-card { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 14px; padding: 17px; }
.rule-icon, .settings-icon { display: grid; width: 42px; height: 42px; place-items: center; color: var(--ink); background: var(--acid); border: 1px solid var(--ink); border-radius: 50%; font: 800 14px/1 ui-monospace, monospace; }
.rule-copy > span { color: var(--muted); font: 700 8px/1 ui-monospace, monospace; }
.rule-copy h3 { margin: 4px 0 0; font-size: 14px; }
.rule-copy > p { margin: 10px 0 6px; color: var(--muted); font-size: 10px; }
.rule-copy blockquote { margin: 0; padding: 8px 10px; background: var(--paper); border-left: 2px solid var(--line); font-size: 10px; line-height: 1.4; }
.rule-state { display: grid; justify-items: end; align-content: space-between; }
.toggle { position: relative; width: 32px; height: 18px; padding: 0; background: #d0d1ca; border: 0; border-radius: 30px; cursor: pointer; }
.toggle::after { position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; background: var(--white); border-radius: 50%; content: ""; }
.toggle.on { background: var(--green); }
.toggle.on::after { left: 17px; }
.rule-state small { color: var(--muted); font-size: 8px; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.account-card { grid-column: 1 / -1; display: grid; grid-template-columns: 58px 1fr auto; gap: 17px; align-items: center; padding: 23px; }
.settings-icon { width: 56px; height: 56px; background: var(--orange); }
.account-card h2 { margin-top: 4px; }
.account-card p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.setup-card, .guardrail-card { padding: 23px; }
.setup-card h2, .guardrail-card h2 { margin-bottom: 18px; }
.check-row { display: grid; grid-template-columns: 30px 1fr; gap: 11px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line); }
.check-row > span { display: grid; width: 26px; height: 26px; place-items: center; color: var(--muted); background: var(--paper); border: 1px solid var(--line); border-radius: 50%; font: 700 9px/1 ui-monospace, monospace; }
.check-row.done > span { color: var(--green); background: #e5f4e9; border-color: #abd0b4; }
.check-row strong, .check-row small { display: block; }
.check-row strong { font-size: 11px; }
.check-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.guardrail-card { color: var(--white); background: var(--ink); border-color: var(--ink); }
.guardrail-card .eyebrow { color: #969a92; }
.guardrail-card ul { padding-left: 18px; color: #c3c6bf; font-size: 11px; line-height: 1.7; }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--ink); }
.login-card {
  position: relative;
  width: min(100%, 430px);
  padding: 34px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--acid);
  border-radius: 7px;
  box-shadow: 10px 10px 0 var(--acid);
}
.login-card::after { position: absolute; right: -70px; bottom: -80px; width: 190px; height: 190px; border: 30px solid #ecebe4; border-radius: 50%; content: ""; }
.brand-lockup { position: relative; z-index: 1; display: flex; gap: 12px; align-items: center; margin-bottom: 38px; }
.brand-lockup strong, .brand-lockup small { display: block; }
.brand-lockup strong { font-size: 13px; letter-spacing: .08em; }
.brand-lockup small { margin-top: 3px; color: var(--muted); font: 600 9px/1 ui-monospace, monospace; letter-spacing: .12em; }
.login-card h1 { position: relative; z-index: 1; margin: 6px 0 8px; font-size: 34px; letter-spacing: -.055em; }
.login-copy { position: relative; z-index: 1; margin: 0 0 24px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.login-form { position: relative; z-index: 1; }
.login-form label { display: block; margin-top: 14px; font-size: 10px; font-weight: 750; }
.login-form input, .login-form textarea { display: block; width: 100%; margin: 7px 0 0; padding: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 3px; outline: none; resize: vertical; }
.login-form input.code-input { padding-left: calc(12px + .4em); text-align: center; font: 800 28px/1.2 ui-monospace, monospace; letter-spacing: .4em; }
.login-form .button { margin-top: 20px; }
.login-secondary { position: relative; z-index: 1; margin-top: 15px; text-align: center; }
.login-secondary a { color: var(--muted); font-size: 10px; text-underline-offset: 3px; }
.secure-line { position: relative; z-index: 1; display: block; margin-top: 18px; color: var(--muted); text-align: center; font-size: 9px; }
.meta-setup-body { padding-block: 50px; }
.meta-setup-card { width: min(100%, 650px); }
.setup-values { position: relative; z-index: 1; }
.setup-values label { display: block; margin-top: 14px; font-size: 10px; font-weight: 750; }
.setup-values input { display: block; width: 100%; margin-top: 7px; padding: 12px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 3px; font: 600 11px/1.3 ui-monospace, monospace; }
.setup-back { position: relative; z-index: 1; display: block; margin-top: 22px; text-align: center; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 86px minmax(0,1fr); }
  .sidebar { padding-inline: 12px; }
  .brand { justify-content: center; }
  .brand > span:last-child { display: none; }
  .nav-item { grid-template-columns: 1fr; justify-items: center; padding: 12px; font-size: 0; }
  .nav-item > span { font-size: 19px; }
  .nav-item b { position: absolute; top: 4px; right: 5px; font-size: 8px; }
  .connection-mini div, .owner div, .owner a { display: none; }
  .connection-mini, .owner { justify-content: center; }
}

@media (max-width: 850px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; top: auto; right: 0; bottom: 0; left: 0; z-index: 30; width: auto; height: 65px; padding: 8px 10px; border-top: 1px solid #3b3e38; }
  .brand, .sidebar-foot { display: none; }
  .sidebar nav { display: grid; grid-template-columns: repeat(5,1fr); }
  .nav-item, .nav-item.active { display: grid; grid-template-columns: 1fr; justify-items: center; gap: 2px; padding: 6px 2px; color: #c4c7c0; background: transparent; border: 0; font-size: 8px; }
  .nav-item.active { color: var(--acid); }
  .nav-item > span { font-size: 17px; }
  .topbar { padding: 15px 18px; }
  .topbar .button { display: none; }
  .content { padding: 18px 16px 92px; }
  .notice { margin: 14px 16px 0; }
  .connect-banner { grid-template-columns: 1fr; gap: 10px; }
  .connect-number { display: none; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .dashboard-grid, .calendar-layout, .rules-layout, .settings-grid, .inbox-layout { grid-template-columns: 1fr; }
  .inbox-layout { min-height: 0; gap: 12px; }
  .thread-list { max-height: 300px; overflow: auto; border-radius: 6px; }
  .chat { min-height: 560px; border: 1px solid var(--line); border-radius: 6px; }
  .composer, .rule-form { position: static; }
  .reel-workbench:has(.video-editor:not([hidden])) { grid-template-columns: 205px minmax(0,1fr); }
  .account-card { grid-column: auto; grid-template-columns: 58px 1fr; }
  .account-card > :last-child { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .topbar h1 { font-size: 25px; }
  .metrics { gap: 8px; }
  .metric { min-height: 119px; padding: 15px; }
  .metric > strong { font-size: 28px; }
  .goal-visual { grid-template-columns: 1fr; }
  .week-item { grid-template-columns: 35px 1fr auto; }
  .week-item > span { display: none; }
  .timeline-row { grid-template-columns: 42px 48px minmax(0,1fr); }
  .timeline-row > .timeline-actions { grid-column: 3; justify-items: start; }
  .chat-head { grid-template-columns: 42px 1fr; }
  .safe-badge { grid-column: 1 / -1; width: fit-content; }
  .bubble { max-width: 95%; }
  .editor-grid { grid-template-columns: 1fr; }
  .reel-workbench:has(.video-editor:not([hidden])) { display: block; }
  .video-editor { margin-top: 10px; }
  .editor-summary { display: grid; }
  .composer-steps > span { display: none; }
  .composer-steps { grid-template-columns: repeat(3,1fr); }
  .composer-steps button, .composer-steps > div { justify-content: center; }
  .review-media { grid-template-columns: 1fr; }
  .review-cover { display: grid; grid-template-columns: 70px 1fr; gap: 10px; align-items: center; }
  .review-cover > span { grid-column: 1 / -1; }
  .review-cover img, .review-cover > div { width: 70px; }
  .review-schedule { grid-template-columns: 1fr; }
  .form-actions.post-actions { grid-template-columns: 1fr; }
  .login-card { padding: 27px 22px; box-shadow: 6px 6px 0 var(--acid); }
}

/* --------------------------------------------------------------------------
   Professional interface refresh
   A restrained visual system for daily publishing work.
   -------------------------------------------------------------------------- */

:root {
  --ink: #172033;
  --paper: #f4f6f9;
  --white: #ffffff;
  --line: #e1e6ed;
  --muted: #667085;
  --acid: #285b9e;
  --orange: #b54708;
  --blue: #eaf1fb;
  --green: #177245;
  --red: #b42318;
}

html,
body {
  background: var(--paper);
}

body {
  color: var(--ink);
  background-image: none;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

.app-shell {
  grid-template-columns: 214px minmax(0, 1fr);
}

.sidebar {
  padding: 20px 14px 16px;
  color: #f8fafc;
  background: #172033;
  border-right: 1px solid #273247;
}

.brand {
  gap: 12px;
  padding: 0 6px 24px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  color: #ffffff;
  background: #315f9d;
  border-radius: 10px;
  box-shadow: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -.02em;
}

.brand strong {
  font-size: 12px;
  font-weight: 720;
  letter-spacing: .05em;
}

.brand small {
  margin-top: 5px;
  color: #98a2b3;
  font-family: inherit;
  font-size: 9px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .08em;
}

.sidebar nav {
  gap: 8px;
}

.nav-item {
  grid-template-columns: 20px 1fr auto;
  gap: 10px;
  min-height: 40px;
  padding: 9px 11px;
  color: #aeb8c8;
  border-radius: 8px;
  font-size: 13px;
}

.nav-item:hover {
  color: #ffffff;
  background: #202c42;
}

.nav-item.active {
  color: #ffffff;
  background: #2a3953;
  border-color: #354762;
  font-weight: 650;
}

.nav-item > span {
  color: #aeb8c8;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.nav-item.active > span {
  color: #dce7f8;
}

.nav-item b {
  color: #ffffff;
  background: #b42318;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.sidebar-foot {
  gap: 14px;
}

.connection-mini {
  padding: 12px;
  background: #141c2b;
  border-color: #303d53;
  border-radius: 9px;
}

.connection-mini strong,
.owner strong {
  font-size: 12px;
  font-weight: 650;
}

.connection-mini small,
.owner small,
.owner a {
  color: #98a2b3;
}

.status-dot.live {
  background: #39a96b;
  box-shadow: 0 0 0 3px rgba(57, 169, 107, .13);
}

.owner > span {
  color: #344054;
  background: #f2f4f7;
}

.topbar {
  min-height: 72px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, .94);
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(16, 24, 40, .02);
}

.topbar h1 {
  margin-top: 4px;
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 720;
  line-height: 1.05;
  letter-spacing: -.035em;
}

.eyebrow,
.sync,
.phase-badge {
  font-family: inherit;
}

.eyebrow {
  color: #7c8799;
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: .045em;
  text-transform: none;
}

.sync {
  color: #7c8799;
  font-size: 11px;
  font-weight: 500;
}

.phase-badge {
  display: none;
}

.content {
  width: 100%;
  max-width: 1540px;
  margin-inline: auto;
  padding: 18px 24px 32px;
}

.notice {
  margin: 16px 30px -2px;
  padding: 12px 15px;
  background: #177245;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(23, 114, 69, .12);
  font-size: 13px;
}

.panel {
  background: #ffffff;
  border-color: var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .035);
}

.panel h2 {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.025em;
}

.panel-head {
  gap: 14px;
}

.calendar-layout {
  grid-template-columns: minmax(330px, 370px) minmax(0, 1fr);
  gap: 16px;
}

.schedule,
.composer,
.rule-form {
  padding: 20px;
}

.composer,
.rule-form {
  top: 104px;
}

.composer h2,
.rule-form h2 {
  margin-bottom: 14px;
}

.composer-intro {
  margin: -7px 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.format-summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px 12px;
  color: #475467;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12px;
}

.format-summary span {
  color: #7c8799;
}

.format-summary strong {
  color: #344054;
  font-weight: 650;
}

.composer label,
.rule-form label {
  margin-top: 12px;
  color: #344054;
  font-size: 12px;
  font-weight: 650;
}

.composer input,
.composer textarea,
.rule-form input,
.rule-form textarea,
.rule-form select {
  margin-top: 6px;
  padding: 10px 12px;
  color: #172033;
  background: #ffffff;
  border-color: #d6dde7;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.composer input:focus,
.composer textarea:focus,
.rule-form input:focus,
.rule-form textarea:focus,
.rule-form select:focus {
  border-color: #7393bf;
  box-shadow: 0 0 0 3px rgba(40, 91, 158, .1);
}

.composer textarea,
.rule-form textarea {
  min-height: 82px;
}

.file-drop {
  padding: 12px;
  background: #f8fafc;
  border-color: #b9c3d0;
  border-radius: 10px;
}

.file-drop.dragging {
  background: #f1f6fc;
  border-color: #5d82b4;
}

.file-drop .drop-copy {
  margin: 4px 0 2px;
  color: #7c8799;
  font-size: 11px;
}

.file-drop input[type="file"] {
  padding: 6px;
  background: #ffffff;
  border-color: #d6dde7;
}

input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 7px 10px;
  color: #344054;
  background: #f2f4f7;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.composer label small,
.timezone-note {
  color: #7c8799;
  font-size: 10px;
}

.reel-workbench {
  margin-top: 10px;
}

.media-preview {
  display: grid;
  grid-template-columns: minmax(125px, 145px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  background: #f8fafc;
  border-color: var(--line);
  border-radius: 11px;
}

.preview-stage {
  width: min(100%, 140px);
  background: #e9edf3;
  background-image: none;
  border-color: #d2d9e3;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(16, 24, 40, .07);
}

.preview-empty {
  color: #7c8799;
  font-size: 11px;
}

.preview-ratio {
  top: 9px;
  left: 9px;
  padding: 5px 7px;
  color: #2f5d95;
  background: #e8f0fb;
  border-radius: 5px;
  font-family: inherit;
  font-size: 8px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: .03em;
}

.preview-info {
  margin-top: 0;
}

.preview-info strong {
  max-width: none;
  color: #344054;
  font-size: 13px;
  font-weight: 650;
}

.preview-info small {
  margin-top: 6px;
  color: #7c8799;
  font-size: 11px;
}

.media-preview .mini-action {
  color: var(--red);
  background: #ffffff;
  border-color: #e3b2ad;
}

.media-preview .mini-action:hover {
  border-color: var(--red);
}

.media-preview.invalid {
  border-color: #f0b4ae;
  background: #fff8f7;
}

.media-preview.invalid .preview-ratio {
  color: #912018;
  background: #fee4e2;
}

.media-preview.warning {
  border-color: #edcc8f;
  background: #fffcf5;
}

.media-preview.warning .preview-ratio {
  color: #7a4b00;
  background: #fef0c7;
}

.button {
  min-height: 44px;
  padding: 0 17px;
  border-color: #cfd6e1;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
}

.button.primary {
  color: #ffffff;
  background: #285b9e;
  border-color: #285b9e;
}

.button.primary:hover:not(:disabled) {
  background: #214e89;
  border-color: #214e89;
}

.button.secondary {
  color: #344054;
  background: #ffffff;
}

.button.secondary:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #aeb8c8;
}

.button.ink {
  color: #ffffff;
  background: #172033;
  border-color: #172033;
}

.button:disabled {
  color: #98a2b3;
  background: #eaecf0;
  border-color: #e1e5eb;
}

.form-actions {
  gap: 10px;
  margin-top: 16px;
}

.post-actions .button {
  min-height: 46px;
}

.autosave-state {
  margin-top: 12px;
  color: #7c8799;
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.45;
}

.timeline {
  margin-top: 14px;
}

.timeline-row {
  grid-template-columns: 44px 58px minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 72px;
  border-color: #e7ebf0;
}

.timeline-row.flash {
  animation: professional-timeline-flash 1.6s ease;
}

@keyframes professional-timeline-flash {
  0%, 48% { background: #eef5ff; box-shadow: inset 3px 0 0 #285b9e; }
  100% { background: transparent; box-shadow: none; }
}

.date-block strong {
  color: #344054;
  font-family: inherit;
  font-size: 20px;
  font-weight: 720;
  line-height: 1;
  letter-spacing: -.03em;
}

.date-block span {
  color: #8b95a5;
  font-family: inherit;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
}

.content-stamp {
  margin-top: 12px;
  padding: 5px 8px;
  color: #475467;
  background: #eef1f5;
  border: 1px solid #e0e5eb;
  border-radius: 6px;
  font-family: inherit;
  font-size: 9px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: .01em;
  text-transform: none;
}

.content-stamp.story,
.content-stamp.post,
.content-stamp.reel {
  color: #475467;
  background: #eef1f5;
}

.timeline-copy strong {
  color: #344054;
  font-size: 12px;
  font-weight: 650;
}

.timeline-copy small {
  margin-top: 5px;
  color: #7c8799;
  font-size: 10px;
}

.timeline-actions {
  gap: 7px;
}

.week-pill,
.status-chip,
.safe-badge,
.state {
  padding: 5px 8px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.status-chip {
  color: #177245;
  background: #ecf8f1;
  border-color: #b7dfc7;
}

.state.draft {
  color: #475467;
  background: #f2f4f7;
  border-color: #dfe3e8;
}

.state.scheduled,
.state.publishing {
  color: #24558f;
  background: #edf4fc;
  border-color: #bdd0e8;
}

.state.published,
.status-chip.live {
  color: #177245;
  background: #ecf8f1;
  border-color: #b7dfc7;
}

.state.failed {
  color: #9a241b;
  background: #fff1f0;
  border-color: #efb8b2;
}

.mini-action {
  padding: 7px 9px;
  color: #475467;
  background: #ffffff;
  border-color: #d6dde7;
  border-radius: 7px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}

.mini-action:hover {
  background: #f8fafc;
  border-color: #9eabbc;
}

.mini-action.danger {
  color: #b42318;
  border-color: #ebc5c1;
}

.upload-progress {
  padding: 12px;
  background: #f1f6fc;
  border-color: #bdd0e8;
  border-radius: 8px;
}

.upload-progress .progress-track {
  background: #d9e4f1;
}

.upload-progress .progress-track span {
  background: #285b9e;
}

.upload-progress small {
  color: #365f90;
  font-size: 10px;
}

.video-editor {
  padding: 16px;
  background: #f8fafc;
  border-color: #d6dde7;
  border-radius: 10px;
}

.editor-state,
.trim-presets button,
.editor-summary,
.review-cover > span,
.review-copy > span,
.review-schedule span {
  font-family: inherit;
}

.trim-presets button {
  border-radius: 7px;
  font-size: 10px;
}

.trim-presets button:hover {
  color: #24558f;
  background: #edf4fc;
  border-color: #9db7d7;
}

.manual-note {
  color: #805400;
  background: #fffaeb;
  border-left-color: #dcad45;
  border-radius: 5px;
}

.form-error,
.form-success {
  border-radius: 8px;
}

.login-body {
  background: #eef1f5;
}

.login-card {
  padding: 34px;
  background: #ffffff;
  border-color: #dfe4eb;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(16, 24, 40, .12);
}

.login-card::after {
  display: none;
}

.brand-lockup {
  margin-bottom: 34px;
}

.brand-lockup strong {
  color: #172033;
  font-weight: 720;
  letter-spacing: .04em;
}

.brand-lockup small {
  color: #7c8799;
  font-family: inherit;
  font-size: 9px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .08em;
}

.login-card h1 {
  color: #172033;
  font-size: 32px;
  letter-spacing: -.04em;
}

.login-copy {
  color: #667085;
  font-size: 13px;
}

.login-form label {
  color: #344054;
  font-size: 12px;
  font-weight: 650;
}

.login-form input,
.login-form textarea {
  padding: 12px 13px;
  background: #ffffff;
  border-color: #d6dde7;
  border-radius: 8px;
}

.login-form input:focus,
.login-form textarea:focus {
  outline: none;
  border-color: #7393bf;
  box-shadow: 0 0 0 3px rgba(40, 91, 158, .1);
}

.login-form input.code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 12px;
  }
}

@media (max-width: 850px) {
  .sidebar {
    height: 64px;
    background: #172033;
    border-top-color: #303d53;
  }

  .sidebar nav {
    grid-template-columns: 1fr;
  }

  .nav-item,
  .nav-item.active {
    color: #d4dbe6;
  }

  .nav-item.active {
    background: #2a3953;
  }

  .topbar {
    padding: 15px 18px;
  }

  .content {
    padding: 18px 16px 90px;
  }

  .notice {
    margin-inline: 16px;
  }

  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .composer {
    position: static;
  }

  .media-preview {
    grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .topbar h1 {
    font-size: 25px;
  }

  .calendar-layout {
    gap: 14px;
  }

  .schedule,
  .composer {
    padding: 18px;
  }

  .media-preview {
    grid-template-columns: 1fr;
  }

  .preview-info {
    margin-top: 0;
  }

  .form-actions.post-actions {
    grid-template-columns: 1fr;
  }

  .timeline-row {
    grid-template-columns: 38px 54px minmax(0, 1fr);
  }

  .timeline-row > .timeline-actions {
    grid-column: 3;
    justify-items: start;
  }

  .login-card {
    padding: 28px 22px;
    box-shadow: 0 12px 32px rgba(16, 24, 40, .12);
  }
}

/* Layout correction: use the available space instead of shrinking the UI. */

.content {
  max-width: none;
  margin-inline: 0;
}

.calendar-layout {
  grid-template-columns: minmax(330px, 350px) minmax(0, 1100px);
  justify-content: start;
  gap: 18px;
}

.schedule,
.composer {
  padding: 22px;
}

.nav-item {
  font-size: 14px;
}

.composer-intro {
  font-size: 14px;
}

.composer label,
.rule-form label {
  font-size: 13px;
}

.composer input,
.composer textarea,
.rule-form input,
.rule-form textarea,
.rule-form select {
  font-size: 14px;
}

.button {
  font-size: 14px;
}

#composer-edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  column-gap: 18px;
  align-items: start;
}

#composer-edit > .format-summary {
  grid-column: 1 / -1;
  grid-row: 1;
}

#composer-edit > .caption-field {
  grid-column: 1;
  grid-row: 2;
}

#composer-edit > .caption-field textarea {
  min-height: 126px;
}

#composer-edit > .file-drop {
  grid-column: 1;
  grid-row: 3;
}

#composer-edit > .upload-progress {
  grid-column: 1;
  grid-row: 4;
}

#composer-edit > .reel-workbench {
  grid-column: 2;
  grid-row: 2 / span 3;
  margin-top: 12px;
}

#composer-edit > .schedule-field {
  grid-column: 1 / -1;
  grid-row: 5;
}

#composer-edit > .timezone-note {
  grid-column: 1 / -1;
  grid-row: 6;
}

#composer-edit > .manual-note {
  grid-column: 1 / -1;
  grid-row: 7;
}

#composer-edit > .form-error {
  grid-column: 1 / -1;
  grid-row: 8;
}

#composer-edit > .autosave-state {
  grid-column: 1 / -1;
  grid-row: 9;
}

#composer-edit > .form-actions {
  grid-column: 1 / -1;
  grid-row: 10;
}

#composer-edit .media-preview {
  display: block;
  padding: 14px;
}

#composer-edit .preview-stage {
  width: min(100%, 190px);
}

#composer-edit .preview-info {
  margin-top: 12px;
}

#composer-edit .preview-info strong {
  font-size: 12px;
}

#composer-edit .preview-info small {
  font-size: 10px;
}

#composer-edit > .reel-workbench:has(.video-editor:not([hidden])) {
  grid-column: 1 / -1;
  grid-row: 4;
}

@media (max-width: 1150px) {
  .calendar-layout {
    grid-template-columns: minmax(0, 940px);
  }
}

@media (max-width: 760px) {
  #composer-edit {
    display: block;
  }

  #composer-edit > .reel-workbench {
    margin-top: 10px;
  }

  #composer-edit .media-preview {
    display: grid;
    grid-template-columns: minmax(125px, 160px) minmax(0, 1fr);
  }
}
