:root {
  color-scheme: light;
  --bg: #f0f2ed;
  --surface: #fffdf8;
  --surface-soft: #f4f1ea;
  --surface-cool: #edf6f2;
  --ink: #1e2425;
  --ink-soft: #485153;
  --muted: #697174;
  --hero: #111a1c;
  --hero-soft: #dbe8e2;
  --line: #d7d8d0;
  --line-strong: #b3b7ad;
  --accent: #d8647a;
  --accent-ink: #351219;
  --green: #2f7a61;
  --green-soft: #dcece4;
  --gold: #d8a63e;
  --gold-soft: #f1dfb7;
  --blue: #316d86;
  --plum: #8b4f63;
  --focus: #007899;
  --shadow: 0 18px 44px rgba(30, 36, 37, .12);
  --shadow-soft: 0 8px 20px rgba(30, 36, 37, .08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #f7f6f1 0%, var(--bg) 300px, #e9efeb 100%);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fffaf2;
  padding: 11px 16px;
  font-weight: 780;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(16, 24, 24, .13);
  transition: transform .16s ease, background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

button:hover,
.actions .source-action:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.card-stage:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(0, 120, 153, .16);
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 250, 242, .26);
  border-radius: var(--radius);
  background: rgba(255, 250, 242, .94);
  color: var(--ink);
  padding: 13px 14px;
  line-height: 1.4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65);
}

input::placeholder,
textarea::placeholder {
  color: #80888b;
}

select,
textarea {
  border-color: var(--line);
  background: #fffefa;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

a {
  color: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.shell {
  width: 100%;
  min-height: 100svh;
  padding-bottom: 64px;
}

.hero {
  position: relative;
  display: flex;
  width: 100%;
  min-height: clamp(286px, 34svh, 360px);
  align-items: end;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
  padding: 30px max(4vw, 24px) 18px;
  color: #fff8eb;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(11, 18, 18, .94) 0%, rgba(14, 23, 22, .78) 50%, rgba(14, 23, 22, .36) 78%),
    linear-gradient(0deg, rgba(12, 18, 18, .92) 0%, rgba(12, 18, 18, .22) 52%, rgba(12, 18, 18, .58) 100%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(840px, 100%);
  max-width: 840px;
  margin-right: auto;
  padding-bottom: 2px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #8dd4b8;
}

.hero-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 640px;
}

.hero-kicker .eyebrow {
  margin: 0;
}

.vision-bridge {
  border-bottom: 1px solid rgba(241, 223, 183, .7);
  color: #f1dfb7;
  padding-bottom: 1px;
  font-size: .74rem;
  font-weight: 780;
  line-height: 1.2;
  text-decoration: none;
}

.vision-bridge span {
  color: var(--accent);
}

.vision-bridge:hover {
  border-color: #fff8eb;
  color: #fff8eb;
}

h1 {
  max-width: 640px;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(2rem, 3.2vw, 3.1rem);
  font-weight: 850;
  line-height: 1.03;
  text-wrap: balance;
}

.lede {
  max-width: 580px;
  margin: 8px 0 0;
  color: #ece4d7;
  font-size: 1rem;
  line-height: 1.45;
}

.hero-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  margin: 0;
  overflow: hidden;
  background: #142021;
}

.hero-art img {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: 62% 50%;
  opacity: .74;
  filter: saturate(.95) contrast(1.06);
}

.hero-art figcaption {
  position: absolute;
  right: max(4vw, 24px);
  bottom: 18px;
  max-width: min(250px, 24vw);
  border: 1px solid rgba(255, 250, 242, .2);
  border-radius: var(--radius);
  background: rgba(12, 18, 18, .48);
  color: #fff9ef;
  padding: 10px 12px;
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.25;
  backdrop-filter: blur(16px);
}

.hero-art span {
  display: block;
  margin-bottom: 4px;
  color: #f1dfb7;
  font-size: .68rem;
  font-weight: 900;
  text-transform: uppercase;
}

#controls {
  display: grid;
  grid-template-columns: minmax(136px, .34fr) minmax(260px, 1fr) auto;
  gap: 11px;
  width: 100%;
  margin-top: 18px;
}

#controls button {
  background: linear-gradient(180deg, #ee8ea0, var(--accent));
  color: var(--accent-ink);
  box-shadow: 0 12px 28px rgba(10, 12, 12, .24);
}

#controls button:hover {
  background: linear-gradient(180deg, #f2a1af, #df6a7f);
}

.quick {
  display: flex;
  width: 100%;
  gap: 8px;
  flex-wrap: wrap;
  overflow-x: visible;
  margin-top: 12px;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.quick button {
  min-height: 36px;
  border-color: var(--line);
  background: #fffefa;
  color: var(--ink);
  padding: 8px 11px;
  font-size: .88rem;
  font-weight: 760;
  white-space: nowrap;
  box-shadow: none;
  backdrop-filter: none;
}

.quick button:hover {
  border-color: rgba(141, 212, 184, .54);
  background: rgba(141, 212, 184, .14);
}

.taste-status,
.taste-memory,
.saved-plans,
.selected-mission,
.calendar-lane,
.venue-lane,
.agent-console,
.briefing {
  width: min(1120px, calc(100% - 48px));
  margin-right: auto;
  margin-left: auto;
}

.taste-status {
  margin-top: 20px;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: .95rem;
  line-height: 1.5;
}

.taste-status:empty,
.taste-memory:empty,
.saved-plans:empty,
.selected-mission:empty,
.calendar-lane:empty,
.venue-lane:empty {
  display: none;
}

.calendar-lane,
.venue-lane,
.agent-console {
  margin-top: 22px;
}

.section-heading,
.agent-console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, .55fr);
  gap: 18px;
  align-items: end;
}

.section-heading h2,
.agent-console h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 2.1vw, 2.1rem);
  font-weight: 520;
  line-height: 1.08;
}

.section-heading p,
.agent-console p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

.calendar-grid,
.venue-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.venue-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.calendar-day,
.venue-plan,
.agent-console {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, .92);
  box-shadow: var(--shadow-soft);
}

.calendar-day,
.venue-plan {
  min-width: 0;
  padding: 15px;
}

.calendar-day > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.calendar-day strong,
.venue-plan h3 {
  min-width: 0;
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.calendar-day-select {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 850;
  text-align: left;
}

.calendar-day-select:hover,
.calendar-day-select:focus-visible {
  color: var(--green);
  background: transparent;
  transform: none;
}

.calendar-day-select span {
  color: var(--gold);
  font-size: 1rem;
}

.calendar-day span,
.calendar-day li span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-day ul {
  display: grid;
  gap: 10px;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
}

.calendar-day li {
  display: grid;
  gap: 3px;
}

.calendar-day a {
  color: var(--ink);
  font-weight: 850;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.calendar-day small {
  color: var(--muted);
  line-height: 1.35;
}

.calendar-day > p {
  margin: 13px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.venue-plan {
  display: flex;
  min-height: 330px;
  flex-direction: column;
  gap: 10px;
}

.venue-plan h3 {
  font-size: 1.25rem;
}

.venue-plan > p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.48;
}

.venue-plan .actions {
  margin-top: auto;
}

.agent-console {
  padding: 18px;
}

#agentChat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

#agentChat textarea {
  min-height: 78px;
}

.agent-reply {
  grid-column: 1 / -1;
  min-height: 24px;
  color: var(--ink-soft);
}

.agent-reply p {
  margin-top: 10px;
}

.agent-reply ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.agent-reply li {
  display: flex;
  gap: 8px;
  align-items: baseline;
  color: var(--muted);
}

.agent-reply strong {
  color: var(--green);
}

.taste-memory {
  display: grid;
  grid-template-columns: minmax(220px, .72fr) repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
  margin-top: 20px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, .92);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.taste-memory > div:first-child {
  display: flex;
  min-width: 0;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.taste-memory .eyebrow {
  margin: 0;
}

.taste-memory button,
.saved-plan button {
  min-height: 34px;
  border-color: var(--line);
  background: #fffefa;
  color: var(--ink);
  padding: 7px 10px;
  font-size: .8rem;
  font-weight: 760;
  box-shadow: none;
}

.taste-memory strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 900;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.taste-memory p {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
}

.taste-memory span {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-cool);
  color: var(--ink-soft);
  padding: 5px 5px 5px 10px;
  font-size: .82rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.taste-memory span button {
  display: inline-grid;
  width: 24px;
  height: 24px;
  min-height: 24px;
  place-items: center;
  border-radius: 999px;
  padding: 0;
  line-height: 1;
}

.saved-plans {
  margin-top: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, .92);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.calendar-handoff { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; border-radius: 999px; padding: 10px 16px; background: var(--green); color: #fff; font-weight: 800; text-decoration: none; }
.calendar-note { display: block; margin-top: 8px; color: var(--ink-soft); }

.saved-plans .eyebrow {
  margin-bottom: 10px;
}

.saved-plan-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.saved-plan {
  min-width: 0;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffefa;
  padding: 14px;
}

.saved-plan > *,
.saved-plan div,
.saved-plan form,
.saved-plan label,
.saved-plan details {
  min-width: 0;
}

.saved-plan strong {
  display: block;
  color: var(--ink);
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.saved-plan p,
.saved-plan details {
  margin: 0;
  color: var(--ink-soft);
  font-size: .88rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.saved-plan summary,
.saved-plan small {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.handoff-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin: 0;
}

.handoff-form label {
  display: block;
  min-width: 0;
  width: 100%;
}

.handoff-form input,
.handoff-form select,
.handoff-form textarea {
  width: 100%;
  min-width: 0;
  border-color: var(--line);
  box-shadow: none;
  font-size: .86rem;
}

.handoff-form select {
  color: var(--green);
  font-weight: 800;
}

.saved-plan summary {
  color: var(--gold);
  cursor: pointer;
  font-weight: 800;
}

.saved-plan small {
  display: block;
  margin-top: 7px;
  color: var(--green);
  line-height: 1.35;
}

.saved-plan .handoff-save {
  border-color: rgba(215, 95, 118, .36);
  background: #fbecf0;
  color: var(--accent-ink);
}

.selected-mission {
  margin-top: 16px;
}

.mission-card-shell {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  border: 1px solid #bfd5ca;
  border-radius: var(--radius);
  background: #eef7f2;
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.mission-card-shell h2 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.mission-card {
  min-width: 0;
  display: grid;
  gap: 9px;
  color: var(--ink);
}

.mission-card .role {
  margin: 0;
}

.mission-card .meta {
  margin: 0;
  padding: 0;
  border: 0;
  gap: 6px;
}

.mission-card .meta span {
  background: #fffefa;
}

.mission-card .next-action {
  display: block;
  margin: 0;
  padding-top: 0;
  border-top: 0;
  color: var(--ink-soft);
  overflow: visible;
  -webkit-line-clamp: unset;
}

.mission-card ol {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-soft);
  font-size: .9rem;
  line-height: 1.45;
}

.mission-card li + li {
  margin-top: 5px;
}

.mission-card .source-action {
  width: max-content;
  max-width: 100%;
  border: 1px solid #bfd5ca;
  border-radius: var(--radius);
  background: #fffefa;
  color: var(--green);
  padding: 7px 10px;
  font-size: .84rem;
  font-weight: 850;
  text-decoration: none;
}

.mission-card small {
  color: var(--green);
  font-size: .82rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.mission-card.is-compact {
  gap: 7px;
}

.mission-card.is-compact ol {
  font-size: .84rem;
}

.briefing {
  position: relative;
  display: grid;
  gap: 18px;
  margin-top: 20px;
  padding: 24px 0 26px;
}

.when-picker {
  display: grid;
  grid-template-columns: minmax(220px, .72fr) minmax(0, 1.35fr);
  gap: 18px;
  align-items: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.when-picker-copy {
  display: grid;
  gap: 3px;
}

.when-picker-copy p {
  margin: 0;
}

.when-picker-copy > p:last-child {
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.35;
}

.when-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, .9);
}

.when-tabs button {
  min-height: 48px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 9px 10px;
  background: transparent;
  box-shadow: none;
  color: var(--ink-soft);
  font-size: .84rem;
  font-weight: 850;
  line-height: 1.15;
}

.when-tabs button:last-child {
  border-right: 0;
}

.when-tabs button:hover,
.when-tabs button:focus-visible {
  background: var(--surface-soft);
  color: var(--green);
  transform: none;
}

.when-tabs button.is-active {
  background: var(--ink);
  box-shadow: inset 0 -3px 0 var(--gold);
  color: #fffaf2;
}

.planning-empty {
  display: grid;
  gap: 8px;
  min-height: 180px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  background: rgba(255, 253, 248, .78);
  text-align: center;
}

.planning-empty h3,
.planning-empty p {
  margin: 0;
}

.planning-empty h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 500;
}

.planning-empty p {
  color: var(--muted);
}

.briefing-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 500px);
  gap: 24px;
  align-items: start;
}

.headline {
  margin: 0;
  color: #6f5220;
  font-size: clamp(1.5rem, 2vw, 2.05rem);
  font-weight: 750;
  line-height: 1.2;
  overflow-wrap: break-word;
}

.briefing-note {
  max-width: 640px;
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.58;
}

.quality-note {
  width: fit-content;
  max-width: 680px;
  margin: 10px 0 0;
  border: 1px solid rgba(183, 131, 34, .28);
  border-radius: var(--radius);
  background: #fff7e2;
  color: #6b4a12;
  padding: 8px 10px;
  font-size: .86rem;
  line-height: 1.45;
}

.briefing-side {
  display: grid;
  gap: 9px;
  justify-items: end;
  min-width: 0;
}

.briefing-count {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
}

.briefing-count span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffefa;
  color: var(--ink);
  padding: 7px 11px;
  font-size: .8rem;
  font-weight: 850;
  white-space: nowrap;
}

.source-health {
  display: grid;
  grid-template-columns: minmax(160px, .72fr) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  width: min(520px, 100%);
  border: 1px solid #cbd8d5;
  border-radius: var(--radius);
  background: rgba(237, 246, 242, .92);
  padding: 11px;
}

.source-health p {
  margin: 0;
  color: var(--ink);
  font-size: .84rem;
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: break-word;
}

.source-health ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.source-health li {
  display: grid;
  gap: 2px;
  max-width: min(190px, 100%);
  border: 1px solid rgba(47, 122, 97, .28);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, .86);
  padding: 7px 8px;
  color: var(--ink-soft);
  line-height: 1.25;
}

.source-health li[data-source-health="dated"],
.source-health li[data-source-health="future"] {
  border-color: rgba(215, 95, 118, .4);
}

.source-health li[data-source-health="pending"] {
  border-color: rgba(215, 173, 88, .42);
}

.source-health .source-health-source,
.source-health strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-health .source-health-source {
  color: var(--ink);
  font-size: .72rem;
  font-weight: 900;
  text-decoration: none;
}

.source-health a.source-health-source:hover {
  color: var(--blue);
}

.source-health strong {
  color: var(--green);
  font-size: .7rem;
  font-weight: 850;
}

.source-health li[data-source-health="dated"] strong,
.source-health li[data-source-health="future"] strong {
  color: var(--accent);
}

.source-health li[data-source-health="pending"] strong {
  color: var(--gold);
}

.source-health-overflow {
  grid-column: 1 / -1;
  justify-self: stretch;
}

.source-health .source-health-more {
  color: var(--ink-soft);
  font-size: .72rem;
  font-weight: 800;
}

.source-health-overflow .source-health-more {
  width: fit-content;
  margin-left: auto;
  cursor: pointer;
  list-style-position: inside;
}

.source-health-overflow[open] .source-health-more {
  margin-bottom: 7px;
  color: var(--ink);
}

.source-health-hidden {
  justify-content: flex-end;
  padding-top: 7px;
  border-top: 1px solid rgba(32, 36, 39, .1);
}

.deck-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.deck-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.deck-position {
  min-width: 58px;
  margin: 0;
  color: var(--ink-soft);
  text-align: center;
  font-size: .86rem;
  font-weight: 850;
}

.deck-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.deck-dots button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background:
    radial-gradient(circle, #9ea4a2 0 4px, transparent 5px),
    #fffefa;
  padding: 0;
  box-shadow: none;
}

.deck-dots button.is-active {
  border-color: var(--gold);
  background:
    radial-gradient(circle, var(--gold) 0 5px, transparent 6px),
    #fff8e6;
}

.deck-dots button:hover {
  transform: none;
}

.deck-nav {
  display: grid;
  width: 38px;
  height: 38px;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffefa;
  color: var(--ink);
  padding: 0;
  box-shadow: var(--shadow-soft);
}

.deck-nav-icon {
  display: block;
  margin-top: -2px;
  font-size: 1.65rem;
  font-weight: 700;
}

.deck-nav:hover:not(:disabled) {
  border-color: var(--gold);
  background: #fff8e6;
}

.deck-nav:disabled {
  cursor: default;
  opacity: .44;
}

.cards {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) repeat(2, minmax(0, .94fr));
  gap: 18px;
  align-items: stretch;
}

.card {
  position: relative;
  min-width: 0;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(183, 187, 178, .82);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card.is-active {
  outline: 2px solid rgba(183, 131, 34, .46);
  outline-offset: 4px;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 5px solid var(--green);
  background: linear-gradient(180deg, rgba(47, 122, 97, .06), transparent 36%);
  pointer-events: none;
}

.card.top-pick {
  border-color: rgba(183, 131, 34, .46);
  background:
    linear-gradient(135deg, rgba(241, 223, 183, .36), transparent 42%),
    var(--surface);
}

.card.top-pick::before {
  border-top-color: var(--gold);
}

.card > * {
  position: relative;
  z-index: 1;
}

.role {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  margin: 0;
  border: 1px solid rgba(139, 79, 99, .22);
  border-radius: 999px;
  background: #f8edf1;
  color: var(--plum);
  padding: 5px 10px;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.role::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.card h2 {
  flex-shrink: 0;
  margin: 14px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.5rem, 2.08vw, 1.95rem);
  font-weight: 650;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.card.top-pick h2 {
  font-size: clamp(1.82rem, 2.45vw, 2.32rem);
}

.meta {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 7px;
  margin: 11px 0 13px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  line-height: 1.34;
}

.meta span {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 5px 8px;
  overflow-wrap: break-word;
  font-size: .84rem;
  font-weight: 740;
}

.source-note {
  flex-shrink: 0;
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 760;
  line-height: 1.38;
  overflow-wrap: break-word;
}

.summary {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.62;
}

.summary,
.plan-shape,
.fit,
.next-action {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.summary {
  -webkit-line-clamp: 3;
}

.plan-shape {
  margin: 16px 0 0;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: .93rem;
  font-weight: 720;
  line-height: 1.5;
  -webkit-line-clamp: 2;
}

.social-radar {
  display: block;
  margin: 14px 0 0;
  padding: 12px 13px;
  border: 1px solid #d6c4a2;
  border-radius: 8px;
  background: #fff9eb;
  color: var(--ink-soft);
  font-size: .9rem;
  line-height: 1.42;
  overflow: visible;
}

.social-radar strong,
.social-radar small {
  display: block;
}

.social-radar strong {
  color: var(--ink);
  font-size: .96rem;
}

.social-radar small {
  margin-top: 4px;
  font-size: .86rem;
}

.social-radar span,
.plan-shape span,
.fit span,
.next-action span {
  display: block;
  margin-bottom: 5px;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.social-radar span {
  color: #8a5a1d;
}

.plan-shape span {
  color: #7a6330;
}

.fit {
  color: var(--ink);
  font-size: .98rem;
  line-height: 1.6;
  -webkit-line-clamp: 4;
}

.fit span {
  color: var(--plum);
}

.next-action {
  margin: 19px 0 0;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  line-height: 1.52;
  -webkit-line-clamp: 3;
}

.next-action span {
  color: var(--gold);
}

.actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 22px;
}

.actions button,
.actions .source-action {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #173638;
  border-radius: var(--radius);
  background: #142f31;
  color: #fff8eb;
  padding: 9px 12px;
  font: inherit;
  font-size: .84rem;
  font-weight: 850;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  box-shadow: none;
  cursor: pointer;
}

.actions button:hover,
.actions .source-action:hover {
  border-color: #26575b;
  background: #1f4548;
}

.card.top-pick .actions .plan-action {
  flex-basis: 100%;
  min-height: 46px;
  border-color: #8d6d32;
  background: var(--gold);
  color: #142f31;
  font-size: .92rem;
}

.card.top-pick .actions .plan-action:hover {
  border-color: #6f5220;
  background: #e5c27f;
}

.card.top-pick .actions .plan-action[aria-busy="true"] {
  cursor: wait;
  opacity: .78;
}

.consent-note {
  flex: 1 0 100%;
  color: var(--ink-soft);
  font-size: .72rem;
  line-height: 1.25;
}

@media (max-width: 1100px) {
  .hero-art figcaption {
    display: none;
  }

  .briefing-header {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .briefing-side {
    justify-items: stretch;
  }

  .briefing-count {
    justify-content: flex-start;
  }

  .source-health {
    width: 100%;
  }
}

@media (min-width: 901px) and (max-height: 760px) {
  .hero {
    padding-top: 24px;
    padding-bottom: 8px;
  }

  .lede {
    max-width: 540px;
    font-size: 1rem;
    line-height: 1.45;
  }

  .briefing {
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
  }

  .briefing-header {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 390px);
    gap: 16px;
    align-items: end;
  }

  .briefing-side {
    justify-items: end;
  }

  .source-health {
    grid-template-columns: minmax(128px, .58fr) minmax(0, 1fr);
    gap: 7px;
    padding: 8px;
  }

  .source-health li {
    padding: 5px 7px;
  }

  .deck-toolbar {
    display: none;
  }

  .briefing-note {
    display: none;
  }
}

@media (max-width: 900px) {
  .shell {
    padding-bottom: 32px;
  }

  .hero {
    width: 100%;
    padding: 22px 14px 14px;
  }

  .hero-copy {
    width: 100%;
  }

  .hero-kicker {
    align-items: flex-start;
    gap: 10px;
  }

  .vision-bridge {
    max-width: none;
    font-size: .69rem;
    text-align: right;
    white-space: nowrap;
  }

  h1 {
    font-size: clamp(2rem, 9vw, 2.75rem);
    line-height: 1.02;
  }

  .lede {
    display: block;
    max-width: 36rem;
    margin-top: 10px;
    font-size: .96rem;
    line-height: 1.48;
  }

  #controls {
    grid-template-columns: minmax(86px, .36fr) minmax(0, 1fr);
    gap: 8px;
    margin-top: 14px;
  }

  #controls input {
    padding: 11px 12px;
  }

  #controls button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .quick {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 3px;
    -webkit-overflow-scrolling: touch;
  }

  .quick button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 10px;
  }

  .taste-status,
  .taste-memory,
  .saved-plans,
  .selected-mission,
  .calendar-lane,
  .venue-lane,
  .agent-console,
  .briefing {
    width: calc(100% - 28px);
  }

  .section-heading,
  .agent-console,
  #agentChat {
    grid-template-columns: minmax(0, 1fr);
  }

  .section-heading {
    gap: 8px;
  }

  .when-picker {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 8px 0;
  }

  .when-picker-copy {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
  }

  .when-picker-copy > p:last-child {
    display: none;
  }

  .when-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .when-tabs button {
    flex: 1 0 auto;
    min-height: 40px;
    padding: 7px 12px;
  }

  .when-tabs button:nth-child(-n + 2) {
    border-bottom: 0;
  }

  .calendar-grid,
  .venue-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .calendar-day,
  .venue-plan {
    flex: 0 0 min(86vw, 340px);
    scroll-snap-align: start;
  }

  .calendar-day {
    min-height: 150px;
  }

  .venue-plan {
    min-height: 360px;
  }

  .agent-console {
    gap: 12px;
    padding: 14px;
  }

  .taste-memory {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
    padding: 12px;
  }

  .taste-memory > div:first-child {
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .saved-plan-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .mission-card-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
  }

  .briefing {
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 0;
    padding: 18px 0 20px;
  }

  .briefing-header {
    display: grid;
    gap: 10px;
    align-items: start;
  }

  .briefing-side {
    min-width: 0;
    justify-items: stretch;
  }

  .briefing-count,
  .briefing-note {
    display: none;
  }

  .headline {
    font-size: 1.35rem;
    line-height: 1.24;
  }

  .quality-note {
    width: 100%;
    max-width: none;
    margin-top: 6px;
    padding: 6px 8px;
    font-size: .74rem;
    line-height: 1.25;
  }

  .source-health {
    grid-template-columns: minmax(72px, 96px) minmax(0, 1fr);
    align-items: center;
    width: 100%;
    gap: 7px;
    padding: 8px;
    overflow: hidden;
  }

  .source-health .eyebrow {
    display: none;
  }

  .source-health p {
    font-size: .76rem;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .source-health ul {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .source-health li {
    flex: 0 0 min(168px, 72vw);
    max-width: min(168px, 72vw);
    scroll-snap-align: start;
  }

  .source-health .source-health-more {
    grid-column: 2;
    justify-self: start;
    font-size: .68rem;
  }

  .deck-toolbar {
    justify-content: space-between;
  }

  .deck-nav {
    width: 38px;
    height: 38px;
  }

  .card-stage {
    display: flex;
    min-height: min(590px, calc(100svh - 116px));
    align-items: stretch;
    margin-right: -14px;
    margin-left: -14px;
    overflow-x: auto;
    scroll-padding-inline: 14px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .cards {
    display: flex;
    gap: 12px;
    align-items: stretch;
    padding: 0 14px 12px;
  }

  .card,
  .card.top-pick {
    flex: 0 0 min(88vw, 430px);
    height: min(560px, calc(100svh - 42px));
    min-height: min(560px, calc(100svh - 42px));
    scroll-snap-align: center;
    padding: 17px;
  }

  .card.top-pick {
    flex-basis: min(92vw, 450px);
  }

  .card h2,
  .card.top-pick h2 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    margin: 8px 0 9px;
    font-size: 1.55rem;
    line-height: 1.08;
  }

  .role {
    margin-bottom: 3px;
  }

  .meta {
    gap: 5px;
    max-height: 68px;
    margin: 8px 0;
    padding: 8px 0;
  }

  .meta span {
    padding: 4px 7px;
    font-size: .75rem;
  }

  .source-note {
    margin: 0 0 2px;
    font-size: .68rem;
    line-height: 1.1;
    -webkit-line-clamp: 1;
  }

  .summary {
    margin: 4px 0;
    font-size: .9rem;
    line-height: 1.46;
    -webkit-line-clamp: 1;
  }

  .plan-shape {
    margin-top: 4px;
    padding-top: 0;
    border-top: 0;
    font-size: .8rem;
    line-height: 1.28;
    -webkit-line-clamp: 1;
  }

  .social-radar {
    margin-top: 6px;
    padding: 8px 9px;
    font-size: .8rem;
    line-height: 1.3;
  }

  .social-radar strong {
    font-size: .84rem;
  }

  .social-radar small {
    margin-top: 0;
    font-size: .78rem;
  }

  .social-radar strong,
  .social-radar small {
    display: inline;
  }

  .social-radar small::before {
    content: " · ";
  }

  .plan-shape span {
    display: inline;
    margin: 0 6px 0 0;
  }

  .fit {
    font-size: .86rem;
    line-height: 1.42;
    -webkit-line-clamp: 1;
  }

  .next-action {
    margin-top: 7px;
    padding-top: 7px;
    font-size: .85rem;
    line-height: 1.38;
    -webkit-line-clamp: 2;
  }

  .plan-shape span,
  .social-radar span,
  .fit span,
  .next-action span {
    font-size: .68rem;
  }

  .actions {
    gap: 8px;
    padding-top: 0;
  }

  .actions button,
  .actions .source-action {
    flex: 1 1 calc(33.333% - 6px);
    min-width: 0;
    min-height: 34px;
    padding: 6px 7px;
    font-size: .78rem;
  }

  .card.top-pick .actions .plan-action {
    min-height: 40px;
  }

  .meta,
  .source-note,
  .summary,
  .plan-shape,
  .fit,
  .next-action {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
  }

  .meta {
    display: flex;
  }

  .social-radar {
    display: block;
    overflow: visible;
  }

}

@media (max-width: 420px) {
  .hero {
    padding-bottom: 14px;
  }

  .briefing {
    padding-top: 14px;
  }

  h1 {
    max-width: 300px;
    font-size: 2.3rem;
    text-wrap: normal;
  }

  .lede {
    display: none;
  }

  #controls {
    margin-top: 10px;
  }

  .quick {
    margin-top: 8px;
  }
}

@media (max-width: 900px) and (max-height: 640px) {
  .hero {
    padding-top: 18px;
    padding-bottom: 12px;
  }

  .lede {
    display: none;
  }

  #controls {
    margin-top: 10px;
  }
}

.outcome-check-in {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.outcome-check-in fieldset { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; border: 0; }
.outcome-check-in legend { width: 100%; color: var(--ink-soft); font-size: .82rem; font-weight: 700; }
.outcome-check-in fieldset label { display: inline-flex; width: auto; align-items: center; gap: 5px; }
.outcome-check-in input[type="radio"] { width: auto; }
