:root {
  color-scheme: dark;
  --bg: #0d100f;
  --bg-deep: #050706;
  --stone: #131817;
  --stone-2: #1e2522;
  --stone-3: #2d2920;
  --parchment: #eadfca;
  --parchment-2: #d9c6a1;
  --parchment-3: #f5eddb;
  --ink: #1c1a14;
  --muted: #70634d;
  --line: rgba(218, 183, 105, 0.24);
  --gold: #c59a3e;
  --gold-2: #f0d184;
  --gold-dark: #73511d;
  --emerald: #2aa878;
  --amber: #d5943d;
  --red: #c45a52;
  --slate: #8fa3a1;
  --shadow: 0 24px 72px rgba(0, 0, 0, 0.38);
  --engraved: 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --parchment-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3), 0 14px 34px rgba(0, 0, 0, 0.18);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(197, 154, 62, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 22%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 18px),
    var(--bg-deep);
  color: #f7f4eb;
}

body.drawer-open {
  overflow: hidden;
}

.gatehouse {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(202, 168, 92, 0.16), transparent 34%),
    radial-gradient(circle at 80% 10%, rgba(42, 168, 120, 0.14), transparent 30%),
    rgba(9, 12, 12, 0.94);
}

.gatehouse[hidden] {
  display: none;
}

.gatehouse-panel {
  width: min(100%, 460px);
  padding: 24px;
  border: 1px solid rgba(240, 209, 132, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(197, 154, 62, 0.12), transparent 42%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 28px),
    var(--stone);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.55), inset 0 0 0 4px rgba(197, 154, 62, 0.06);
}

.gatehouse-copy,
.gatehouse-note {
  color: #cbd5cf;
  line-height: 1.5;
}

.gatehouse-copy {
  margin-bottom: 18px;
}

.gatehouse-note {
  margin: 14px 0 0;
  font-size: 0.84rem;
}

.gatehouse-field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: #f7f4eb;
  font-weight: 800;
}

.gatehouse-field input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(202, 168, 92, 0.28);
  border-radius: var(--radius);
  outline: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.gatehouse-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gatehouse-button,
.gatehouse-secondary {
  min-height: 44px;
  border: 1px solid rgba(240, 209, 132, 0.34);
  border-radius: var(--radius);
  font-weight: 900;
}

.gatehouse-button {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #15130c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.gatehouse-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  border-right: 1px solid rgba(240, 209, 132, 0.2);
  background:
    linear-gradient(180deg, rgba(240, 209, 132, 0.07), transparent 32%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.024) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 28px),
    var(--stone);
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.42);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(240, 209, 132, 0.58);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(240, 209, 132, 0.24), rgba(70, 44, 18, 0.38)),
    var(--stone-2);
  color: var(--gold-2);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: var(--engraved);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold-2);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.16rem;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  font-size: 1.05rem;
  letter-spacing: 0;
}

.realm-nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(240, 209, 132, 0.08);
  border-radius: var(--radius);
  color: #d7ded9;
  background: rgba(0, 0, 0, 0.08);
}

.nav-item span:first-child {
  display: grid;
  width: 24px;
  place-items: center;
  color: var(--gold-2);
  font-size: 0.68rem;
  font-weight: 800;
}

.nav-item.active,
.nav-item:hover {
  border-color: rgba(240, 209, 132, 0.38);
  background:
    linear-gradient(90deg, rgba(197, 154, 62, 0.2), rgba(255, 255, 255, 0.045)),
    rgba(255, 255, 255, 0.04);
  color: #ffffff;
  box-shadow: var(--engraved);
}

.sidebar-card {
  margin-top: 26px;
  padding: 16px;
  border: 1px solid rgba(202, 168, 92, 0.28);
  border-radius: var(--radius);
  background: rgba(9, 12, 12, 0.42);
}

.health-ring {
  display: grid;
  width: 92px;
  height: 92px;
  margin: 12px auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--emerald) 0 86%, rgba(255, 255, 255, 0.1) 86% 100%);
}

.health-ring span {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border-radius: 50%;
  background: var(--stone);
  color: #fff;
  font-weight: 800;
}

.small-copy {
  margin-bottom: 0;
  color: #b8c1bb;
  font-size: 0.86rem;
  line-height: 1.45;
}

.main-panel {
  min-width: 0;
  padding: 22px 24px 92px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 18;
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) minmax(260px, 520px) auto;
  align-items: center;
  gap: 16px;
  margin: -22px -24px 20px;
  padding: 22px 24px 14px;
  border-bottom: 1px solid rgba(240, 209, 132, 0.14);
  background:
    linear-gradient(180deg, rgba(13, 16, 15, 0.94), rgba(13, 16, 15, 0.78));
  backdrop-filter: blur(18px);
}

.icon-button,
.ghost-button,
.profile-chip {
  min-height: 38px;
  border: 1px solid rgba(240, 209, 132, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
  box-shadow: var(--engraved);
}

.menu-button {
  display: none;
  min-width: 58px;
  padding: 0 10px;
}

.ghost-button {
  padding: 0 12px;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(240, 209, 132, 0.32), rgba(197, 154, 62, 0.18));
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(240, 209, 132, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: #cfd8d2;
}

.drawer-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  margin-bottom: 16px;
  padding: 0 14px;
  border: 1px solid rgba(240, 209, 132, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: #cfd8d2;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
}

.drawer-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 8px;
}

.avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #15130c;
  font-size: 0.72rem;
  font-weight: 800;
}

.mobile-hero {
  display: none;
}

.command-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.strip-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(240, 209, 132, 0.24);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035)),
    rgba(0, 0, 0, 0.1);
  box-shadow: var(--engraved);
}

.strip-card strong,
.strip-card span {
  display: block;
}

.strip-card strong {
  margin-bottom: 2px;
  color: #fff;
}

.strip-card span {
  color: #b8c1bb;
  font-size: 0.82rem;
}

.control-deck {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid rgba(240, 209, 132, 0.24);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(240, 209, 132, 0.09), rgba(42, 168, 120, 0.06)),
    rgba(255, 255, 255, 0.04);
  box-shadow: var(--engraved);
}

.pulse-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.pulse-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(16, 20, 20, 0.58);
}

.pulse-card span,
.pulse-card strong {
  display: block;
}

.pulse-card span {
  margin-bottom: 4px;
  color: #b8c1bb;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.pulse-card strong {
  overflow: hidden;
  color: #fff;
  font-size: 0.98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pulse-card.gold {
  border-color: rgba(202, 168, 92, 0.34);
}

.pulse-card.emerald {
  border-color: rgba(42, 168, 120, 0.34);
}

.pulse-card.amber {
  border-color: rgba(213, 148, 61, 0.34);
}

.pulse-card.red {
  border-color: rgba(196, 90, 82, 0.34);
}

.pulse-checked .pulse-card {
  animation: pulseCheck 0.9s ease;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(4, minmax(68px, 1fr));
  min-height: 38px;
  padding: 3px;
  border: 1px solid rgba(240, 209, 132, 0.24);
  border-radius: var(--radius);
  background: rgba(9, 12, 12, 0.42);
}

.segmented-control button,
.control-button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  color: #dce4df;
  font-weight: 850;
}

.segmented-control button {
  padding: 0 10px;
  background: transparent;
}

.segmented-control button.active {
  background: linear-gradient(180deg, rgba(240, 209, 132, 0.28), rgba(197, 154, 62, 0.18));
  color: #fff;
}

.control-button {
  padding: 0 12px;
  border: 1px solid rgba(240, 209, 132, 0.26);
  background: rgba(255, 255, 255, 0.065);
}

.control-button[aria-pressed="true"] {
  border-color: rgba(42, 168, 120, 0.46);
  background: rgba(42, 168, 120, 0.18);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 16px;
}

.panel {
  position: relative;
  overflow: hidden;
  scroll-margin-top: 92px;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(97, 65, 24, 0.42);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(217, 198, 161, 0.92)),
    repeating-linear-gradient(90deg, rgba(115, 81, 29, 0.035) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(0deg, rgba(115, 81, 29, 0.028) 0 1px, transparent 1px 18px),
    var(--parchment);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.panel::before {
  content: "";
  display: block;
  height: 4px;
  margin: -16px -16px 13px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-2), var(--gold-dark));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.34);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: 0;
  pointer-events: none;
  border: 1px solid rgba(115, 81, 29, 0.12);
  border-radius: 6px;
}

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

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-header.compact {
  margin-bottom: 12px;
}

.priority-panel,
.quests-panel,
.briefing-panel,
.memory-panel {
  grid-column: 1;
}

.briefing-panel {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.68), rgba(217, 198, 161, 0.95)),
    repeating-linear-gradient(90deg, rgba(115, 81, 29, 0.032) 0 1px, transparent 1px 18px),
    var(--parchment-3);
}

.briefing-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.briefing-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(115, 81, 29, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.48), rgba(217, 198, 161, 0.34)),
    rgba(255, 255, 255, 0.42);
  box-shadow: var(--parchment-shadow);
}

.briefing-card h4 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.22;
}

.briefing-card p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.36;
}

.briefing-card.gold {
  border-color: rgba(202, 168, 92, 0.34);
}

.briefing-card.emerald {
  border-color: rgba(42, 168, 120, 0.3);
}

.briefing-card.amber {
  border-color: rgba(213, 148, 61, 0.32);
}

.briefing-card.red {
  border-color: rgba(196, 90, 82, 0.32);
}

.briefing-active {
  animation: briefingLift 1.2s ease;
}

.council-panel,
.watch-panel,
.treasury-panel,
.inbox-panel,
.readiness-panel,
.health-panel,
.connectors-panel,
.approvals-panel {
  grid-column: 2;
}

.priority-list,
.quest-list,
.risk-list,
.inbox-list,
.readiness-list,
.health-list,
.connectors-list,
.quota-list,
.approval-list,
.memory-list {
  display: grid;
  gap: 10px;
}

.priority-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

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

.priority-card,
.quest-card,
.risk-card,
.inbox-card,
.readiness-card,
.health-card,
.connectors-card,
.quota-card,
.approval-card,
.memory-card {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid rgba(115, 81, 29, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.46), rgba(217, 198, 161, 0.36)),
    rgba(255, 255, 255, 0.42);
  box-shadow: var(--parchment-shadow);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.priority-card {
  position: relative;
  min-height: 188px;
  align-content: start;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(217, 198, 161, 0.48)),
    radial-gradient(circle at 92% 12%, rgba(197, 154, 62, 0.18), transparent 28%),
    rgba(255, 255, 255, 0.44);
}

.priority-card::after,
.quest-card::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 9px;
  width: 28px;
  height: 28px;
  pointer-events: none;
  border-right: 1px solid rgba(115, 81, 29, 0.18);
  border-bottom: 1px solid rgba(115, 81, 29, 0.18);
  opacity: 0.72;
}

.quest-card {
  position: relative;
  min-height: 138px;
}

.priority-card:hover,
.quest-card:hover,
.risk-card:hover,
.inbox-card:hover,
.readiness-card:hover,
.health-card:hover,
.connectors-card:hover,
.quota-card:hover,
.approval-card:hover,
.memory-card:hover,
.agent-card:hover {
  transform: translateY(-1px);
  border-color: rgba(115, 81, 29, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(217, 198, 161, 0.42)),
    rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34), 0 16px 36px rgba(24, 20, 12, 0.14);
}

.draft-card {
  border-color: rgba(197, 154, 62, 0.46);
  background:
    linear-gradient(135deg, rgba(197, 154, 62, 0.2), rgba(255, 255, 255, 0.54)),
    rgba(255, 255, 255, 0.72);
}

.filtered-view [hidden] {
  display: none;
}

.focus-view .council-panel,
.focus-view .memory-panel,
.focus-view .readiness-panel,
.focus-view .health-panel,
.focus-view .connectors-panel {
  display: none;
}

.focus-view .briefing-panel,
.focus-view .priority-panel,
.focus-view .quests-panel {
  grid-column: 1;
}

.focus-view .watch-panel,
.focus-view .approvals-panel,
.focus-view .treasury-panel,
.focus-view .inbox-panel {
  grid-column: 2;
}

.priority-topline,
.quest-topline,
.risk-topline,
.inbox-topline,
.readiness-topline,
.health-topline,
.connectors-topline,
.quota-topline,
.approval-topline,
.memory-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.priority-topline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.priority-topline .status-pill {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 7px;
}

.priority-rank {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(115, 81, 29, 0.34);
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(240, 209, 132, 0.72), rgba(197, 154, 62, 0.62)),
    var(--gold);
  color: #19130a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.34), 0 4px 10px rgba(24, 20, 12, 0.18);
}

.priority-title,
.quest-title,
.risk-title,
.inbox-title,
.readiness-title,
.health-title,
.connectors-title,
.quota-title,
.approval-title,
.memory-title {
  margin: 0;
  font-weight: 800;
  line-height: 1.25;
}

.priority-title {
  padding-top: 2px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.03rem;
  line-height: 1.18;
}

.priority-meta,
.quest-meta,
.risk-meta,
.inbox-meta,
.readiness-meta,
.health-meta,
.connectors-meta,
.quota-meta,
.approval-meta,
.memory-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.priority-meta {
  margin-top: 8px;
  font-size: 0.88rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  white-space: nowrap;
  border-radius: 999px;
  padding: 4px 9px;
  color: #101414;
  font-size: 0.72rem;
  font-weight: 800;
}

.emerald {
  background: rgba(42, 168, 120, 0.2);
  color: #126448;
}

.gold {
  background: rgba(202, 168, 92, 0.24);
  color: #684d17;
}

.amber {
  background: rgba(213, 148, 61, 0.2);
  color: #7a4812;
}

.red {
  background: rgba(196, 90, 82, 0.18);
  color: #86352f;
}

.slate {
  background: rgba(143, 163, 161, 0.2);
  color: #465856;
}

.agent-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.agent-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  min-height: 64px;
  padding: 12px;
  border: 1px solid rgba(115, 81, 29, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.46), rgba(217, 198, 161, 0.34)),
    rgba(255, 255, 255, 0.42);
  box-shadow: var(--parchment-shadow);
}

.agent-sigil {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: var(--radius);
  border: 1px solid rgba(240, 209, 132, 0.24);
  background:
    linear-gradient(145deg, rgba(240, 209, 132, 0.14), rgba(0, 0, 0, 0.18)),
    var(--stone-2);
  color: var(--gold-2);
  box-shadow: var(--engraved);
  font-weight: 800;
}

.agent-name {
  margin: 0 0 4px;
  font-weight: 800;
}

.agent-lane {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.agent-copy {
  min-width: 0;
}

.quest-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.quest-progress span {
  color: var(--gold-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(75, 54, 25, 0.18);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #238866, var(--gold));
}

.progress-34 {
  width: 34%;
}

.progress-42 {
  width: 42%;
}

.progress-58 {
  width: 58%;
}

.budget-meter {
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.budget-orb {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border: 1px solid rgba(115, 81, 29, 0.3);
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--parchment-3) 0 54%, transparent 55%),
    conic-gradient(var(--gold) 0 64%, rgba(75, 54, 25, 0.12) 64% 100%);
  box-shadow: var(--parchment-shadow);
}

.budget-orb span {
  display: block;
  margin-top: 16px;
  font-size: 1.25rem;
  font-weight: 900;
}

.budget-orb small {
  margin-top: -24px;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.budget-copy p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(115, 81, 29, 0.18);
  border-radius: var(--radius);
  background: rgba(75, 54, 25, 0.08);
  color: var(--ink);
  font-weight: 800;
}

.approve-button {
  background: rgba(42, 168, 120, 0.16);
}

.hold-button {
  background: rgba(202, 168, 92, 0.14);
}

.approval-card[data-state="approved"] {
  border-color: rgba(42, 168, 120, 0.45);
}

.approval-card[data-state="held"] {
  border-color: rgba(213, 148, 61, 0.5);
}

.bottom-nav {
  position: fixed;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 12px;
  z-index: 20;
  display: none;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(240, 209, 132, 0.28);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(240, 209, 132, 0.07), rgba(0, 0, 0, 0.08)),
    rgba(16, 20, 20, 0.95);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.54);
}

.mobile-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  width: min(88vw, 360px);
  padding: 18px;
  overflow-y: auto;
  border-right: 1px solid rgba(240, 209, 132, 0.28);
  background:
    linear-gradient(180deg, rgba(240, 209, 132, 0.07), transparent 32%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.024) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 28px),
    var(--stone);
  box-shadow: 24px 0 80px rgba(0, 0, 0, 0.5);
}

.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  width: min(92vw, 390px);
  padding: 18px;
  overflow-y: auto;
  border-left: 1px solid rgba(240, 209, 132, 0.28);
  background:
    linear-gradient(180deg, rgba(240, 209, 132, 0.07), transparent 32%),
    var(--stone);
  box-shadow: -24px 0 80px rgba(0, 0, 0, 0.48);
}

.settings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.settings-list {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px;
  border: 1px solid rgba(240, 209, 132, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.setting-row strong,
.setting-row small {
  display: block;
}

.setting-row small {
  margin-top: 3px;
  color: #b8c1bb;
  line-height: 1.35;
}

.setting-row input {
  width: 22px;
  height: 22px;
  accent-color: var(--gold);
}

.full-width {
  width: 100%;
}

.dense-mode .priority-card,
.dense-mode .briefing-card,
.dense-mode .quest-card,
.dense-mode .risk-card,
.dense-mode .inbox-card,
.dense-mode .readiness-card,
.dense-mode .connectors-card,
.dense-mode .quota-card,
.dense-mode .approval-card,
.dense-mode .memory-card,
.dense-mode .agent-card {
  padding: 10px;
}

.dense-mode .panel {
  padding: 12px;
}

.presentation-mode .briefing-panel,
.presentation-mode .priority-panel {
  grid-column: 1 / -1;
}

.presentation-mode .briefing-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.presentation-mode .priority-card:first-child {
  border-color: rgba(197, 154, 62, 0.5);
  background:
    linear-gradient(135deg, rgba(197, 154, 62, 0.24), rgba(255, 255, 255, 0.56)),
    rgba(255, 255, 255, 0.58);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 88px;
  z-index: 70;
  max-width: min(320px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid rgba(202, 168, 92, 0.28);
  border-radius: var(--radius);
  background: rgba(16, 20, 20, 0.96);
  color: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.drawer-header .brand-lockup {
  margin-bottom: 0;
}

.drawer-header h2 {
  font-size: 1.12rem;
}

.drawer-close {
  padding: 0 10px;
}

.bottom-nav a {
  display: grid;
  min-height: 48px;
  place-items: center;
  border-radius: 10px;
  color: #cbd5cf;
  font-size: 1rem;
}

.bottom-nav small {
  font-size: 0.68rem;
}

.bottom-nav a.active {
  background: linear-gradient(180deg, rgba(240, 209, 132, 0.22), rgba(197, 154, 62, 0.12));
  color: #fff;
}

@keyframes pulseCheck {
  0% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-2px);
    border-color: rgba(225, 200, 132, 0.58);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes briefingLift {
  0% {
    transform: translateY(0);
  }

  32% {
    transform: translateY(-3px);
    border-color: rgba(225, 200, 132, 0.7);
  }

  100% {
    transform: translateY(0);
  }
}

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .main-panel {
    padding: 16px 14px 96px;
  }

  .menu-button {
    display: inline-grid;
    place-items: center;
  }

  .topbar {
    grid-template-columns: auto 1fr auto;
    margin: -16px -14px 14px;
    padding: 14px 14px 12px;
  }

  .search-box {
    display: none;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .priority-panel,
  .quests-panel,
  .briefing-panel,
  .memory-panel,
  .council-panel,
  .watch-panel,
  .treasury-panel,
  .inbox-panel,
  .readiness-panel,
  .health-panel,
  .connectors-panel,
  .approvals-panel {
    grid-column: 1;
  }

  .priority-list,
  .quest-list {
    grid-template-columns: 1fr;
  }

  .mobile-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid rgba(240, 209, 132, 0.28);
    border-radius: var(--radius);
    background:
      linear-gradient(135deg, rgba(240, 209, 132, 0.14), rgba(42, 168, 120, 0.1)),
      rgba(255, 255, 255, 0.04);
    box-shadow: var(--engraved);
  }

  .command-strip {
    grid-template-columns: 1fr;
  }

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

  .briefing-grid,
  .presentation-mode .briefing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pulse-card:first-child {
    grid-column: 1 / -1;
  }

  .control-row,
  .segmented-control {
    width: 100%;
  }

  .control-button {
    flex: 1 1 140px;
  }

  .focus-view .priority-panel,
  .focus-view .quests-panel,
  .focus-view .watch-panel,
  .focus-view .approvals-panel,
  .focus-view .treasury-panel,
  .focus-view .inbox-panel {
    grid-column: 1;
  }

  .mobile-hero h2 {
    font-size: 1.05rem;
  }

  .mobile-hero .status-pill {
    flex: 0 0 auto;
    background: linear-gradient(180deg, var(--gold-2), var(--gold));
    color: #15130c;
  }

  .bottom-nav {
    display: grid;
  }
}

@media (max-width: 620px) {
  .topbar {
    gap: 10px;
  }

  .topbar h2 {
    max-width: 48vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .profile-chip span:not(.avatar) {
    display: none;
  }

  .dashboard-grid {
    gap: 12px;
  }

  .command-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .strip-card {
    min-height: 78px;
    padding: 10px;
  }

  .strip-card strong {
    font-size: 0.9rem;
    line-height: 1.1;
  }

  .strip-card span {
    font-size: 0.74rem;
    line-height: 1.25;
  }

  .control-deck {
    padding: 10px;
  }

  .segmented-control {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pulse-card:first-child {
    grid-column: auto;
  }

  .pulse-card {
    padding: 8px;
  }

  .briefing-grid,
  .presentation-mode .briefing-grid {
    grid-template-columns: 1fr;
  }

  .pulse-card span {
    margin-bottom: 2px;
  }

  .pulse-card strong {
    font-size: 0.9rem;
  }

  .panel {
    padding: 13px;
  }

  .priority-card,
  .quest-card {
    min-height: auto;
  }

  .priority-card {
    padding: 13px;
  }

  .priority-title {
    font-size: 1rem;
  }

  .panel::before {
    margin: -13px -13px 11px;
  }

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

  .gatehouse-panel {
    padding: 18px;
  }

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

  .agent-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .agent-card .status-pill {
    grid-column: 2;
    justify-self: start;
  }

  .budget-meter {
    grid-template-columns: 1fr;
  }

  .priority-topline,
  .quest-topline,
  .risk-topline,
  .inbox-topline,
  .readiness-topline,
  .health-topline,
  .connectors-topline,
  .quota-topline,
  .approval-topline,
  .memory-topline {
    align-items: flex-start;
  }
}

@media (hover: none) {
  .priority-card:hover,
  .quest-card:hover,
  .risk-card:hover,
  .inbox-card:hover,
  .readiness-card:hover,
  .health-card:hover,
  .connectors-card:hover,
  .quota-card:hover,
  .approval-card:hover,
  .memory-card:hover,
  .agent-card:hover {
    transform: none;
  }
}
