:root {
  --navy-950: #041225;
  --navy-900: #071a33;
  --navy-850: #092140;
  --navy-800: #0b2a50;
  --navy-700: #123d6c;
  --gold-500: #c99a39;
  --gold-400: #ddb65f;
  --gold-100: #f7ecd2;
  --ink: #162338;
  --slate-700: #526174;
  --slate-600: #657386;
  --slate-500: #7b8797;
  --slate-300: #cbd2da;
  --slate-200: #dde2e7;
  --slate-100: #edf0f2;
  --paper: #ffffff;
  --canvas: #f3f4f2;
  --cream: #faf7ee;
  --green: #3e8c70;
  --green-soft: #e5f1ec;
  --red: #a24a42;
  --red-soft: #f5e8e6;
  --blue: #4e7399;
  --blue-soft: #e7eef5;
  --shadow-sm: 0 4px 18px rgba(7, 26, 51, .07);
  --shadow-lg: 0 24px 70px rgba(7, 26, 51, .15);
  --sidebar-width: 254px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-width: 320px; background: var(--canvas); }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

button { color: inherit; font: inherit; }
button:not(:disabled) { cursor: pointer; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--gold-400); outline-offset: 3px; }
svg { display: block; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 1rem;
  left: 1rem;
  transform: translateY(-180%);
  padding: .75rem 1rem;
  color: var(--navy-900);
  background: #fff;
  border: 2px solid var(--gold-500);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus { transform: none; }

.access-gate {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(330px, .9fr) minmax(520px, 1.1fr);
  color: #fff;
  background: var(--navy-950);
}

.access-story {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: clamp(2rem, 5vw, 5.5rem);
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(4, 18, 37, .98), rgba(8, 32, 60, .92)),
    radial-gradient(circle at 80% 18%, rgba(221, 182, 95, .22), transparent 34%);
  border-right: 1px solid rgba(255, 255, 255, .1);
}

.access-story::before,
.access-story::after {
  content: "";
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(221, 182, 95, .13);
  border-radius: 50%;
}

.access-story::before { width: 620px; height: 620px; right: -390px; top: 12%; }
.access-story::after { width: 880px; height: 880px; right: -500px; top: 2%; }

.access-brand { display: flex; align-items: center; gap: .9rem; }
.access-brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: var(--navy-950);
  background: linear-gradient(135deg, #f0d694, var(--gold-500));
  clip-path: polygon(50% 0, 94% 24%, 94% 76%, 50% 100%, 6% 76%, 6% 24%);
}
.access-brand-mark i { font-family: "Libre Caslon Display", Georgia, serif; font-size: 1.8rem; font-style: normal; }
.access-brand > span:last-child { display: flex; flex-direction: column; line-height: 1.08; }
.access-brand strong { font-family: "Libre Caslon Display", Georgia, serif; font-size: 1.75rem; font-weight: 400; letter-spacing: .17em; text-transform: uppercase; }
.access-brand small { color: #98a9bd; font-size: .66rem; font-weight: 700; letter-spacing: .21em; text-transform: uppercase; }

.access-story-copy { max-width: 630px; margin: auto 0 3.5rem; }
.access-kicker { margin: 0 0 1.15rem; color: var(--gold-400); font-size: .68rem; font-weight: 700; letter-spacing: .2em; }
.access-story-copy h1 { max-width: 600px; margin: 0; font-family: "Libre Caslon Display", Georgia, serif; font-size: clamp(3.1rem, 6.3vw, 6.4rem); font-weight: 400; line-height: .93; letter-spacing: -.035em; }
.access-story-copy > p:last-child { max-width: 580px; margin: 1.8rem 0 0; color: #afbdcc; font-size: clamp(.95rem, 1.3vw, 1.15rem); line-height: 1.75; }

.access-safeguards { max-width: 680px; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); list-style: none; border-top: 1px solid rgba(255, 255, 255, .12); border-bottom: 1px solid rgba(255, 255, 255, .12); }
.access-safeguards li { min-height: 132px; padding: 1.25rem 1rem; display: grid; align-content: start; gap: .65rem; border-right: 1px solid rgba(255, 255, 255, .12); }
.access-safeguards li:first-child { padding-left: 0; }
.access-safeguards li:last-child { border-right: 0; }
.access-safeguards li > span { color: var(--gold-400); font-family: "Libre Caslon Display", Georgia, serif; font-size: 1.05rem; }
.access-safeguards div { display: flex; flex-direction: column; gap: .28rem; }
.access-safeguards strong { font-size: .72rem; letter-spacing: .02em; }
.access-safeguards small { color: #8497ab; font-size: .62rem; line-height: 1.5; }
.access-story-foot { margin: 1.3rem 0 0; color: #60758e; font-size: .56rem; font-weight: 700; letter-spacing: .16em; }

.access-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(1.25rem, 4vw, 4.5rem);
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, .88), rgba(247, 245, 239, .94)),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(7, 26, 51, .04) 80px),
    repeating-linear-gradient(0deg, transparent 0 79px, rgba(7, 26, 51, .04) 80px);
}

.access-card { width: min(100%, 660px); padding: clamp(1.5rem, 3.2vw, 2.6rem); background: rgba(255, 255, 255, .97); border: 1px solid #d9d8d1; box-shadow: 0 28px 80px rgba(4, 18, 37, .17); }
.auth-loading { min-height: 260px; display: grid; place-items: center; align-content: center; gap: .8rem; text-align: center; }
.auth-loading strong { color: var(--navy-900); font-family: "Libre Caslon Display", Georgia, serif; font-size: 1.45rem; font-weight: 400; }
.auth-loading small { color: var(--slate-600); }
.auth-loader { width: 40px; height: 40px; border: 3px solid var(--slate-200); border-top-color: var(--gold-500); border-radius: 50%; animation: auth-spin .8s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-header { display: flex; align-items: center; gap: .9rem; padding-bottom: 1.35rem; }
.auth-lock { width: 48px; height: 48px; display: grid; place-items: center; color: var(--navy-800); background: var(--gold-100); border: 1px solid #ead7aa; border-radius: 50%; }
.auth-lock svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.auth-header > div { display: flex; flex-direction: column; }
.auth-header p { margin: 0 0 .16rem; color: #926918; font-size: .6rem; font-weight: 700; letter-spacing: .16em; }
.auth-header h2 { margin: 0; color: var(--navy-900); font-family: "Libre Caslon Display", Georgia, serif; font-size: clamp(1.6rem, 3vw, 2.15rem); font-weight: 400; line-height: 1.1; }

.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 1.35rem; border-bottom: 1px solid var(--slate-200); }
.auth-tabs.single-mode { grid-template-columns: 1fr; }
.auth-tabs button { position: relative; min-height: 46px; padding: .65rem; color: var(--slate-600); background: transparent; border: 0; font-size: .7rem; font-weight: 700; }
.auth-tabs button[aria-selected="true"] { color: var(--navy-900); }
.auth-tabs button[aria-selected="true"]::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; background: var(--gold-500); }

.auth-message { margin: 0 0 1rem; padding: .75rem .85rem; color: #7d302b; background: var(--red-soft); border-left: 3px solid var(--red); font-size: .68rem; }
.auth-intro { margin: 0 0 1.1rem; color: var(--slate-600); font-size: .75rem; }
.auth-form { display: grid; gap: 1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { min-width: 0; display: flex; flex-direction: column; gap: .34rem; }
.field label { color: var(--navy-900); font-size: .65rem; font-weight: 700; }
.field input { width: 100%; min-height: 46px; padding: .7rem .8rem; color: var(--ink); background: #fff; border: 1px solid #bfc7d0; border-radius: 0; font: inherit; font-size: .78rem; transition: border-color .15s ease, box-shadow .15s ease; }
.field input:hover { border-color: #8491a0; }
.field input:focus { outline: 0; border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(201, 154, 57, .2); }
.field input:user-invalid { border-color: var(--red); }
.field small { color: var(--slate-500); font-size: .58rem; line-height: 1.45; }
.password-field { position: relative; }
.password-field input { padding-right: 4rem; }
.password-toggle { position: absolute; top: 50%; right: .4rem; min-width: 48px; min-height: 34px; padding: .25rem .45rem; color: var(--navy-800); background: var(--cream); border: 0; transform: translateY(-50%); font-size: .58rem; font-weight: 700; }
.auth-submit { min-height: 50px; margin-top: .25rem; padding: .75rem 1rem; display: flex; align-items: center; justify-content: space-between; color: var(--navy-950); background: linear-gradient(135deg, var(--gold-400), var(--gold-500)); border: 1px solid #ad7e23; font-weight: 800; letter-spacing: .025em; }
.auth-submit:hover:not(:disabled) { background: linear-gradient(135deg, #ecd082, #d1a345); }
.auth-submit:disabled { cursor: wait; opacity: .67; }
.setup-callout { margin-bottom: 1rem; padding: .85rem; display: flex; flex-direction: column; gap: .22rem; color: var(--slate-700); background: var(--blue-soft); border-left: 3px solid var(--blue); }
.setup-callout strong { color: var(--navy-800); font-size: .68rem; }
.setup-callout span { font-size: .62rem; line-height: 1.5; }
.auth-footnote { margin-top: 1.45rem; padding-top: 1rem; display: flex; align-items: start; gap: .55rem; color: var(--slate-500); border-top: 1px solid var(--slate-200); font-size: .58rem; line-height: 1.5; }
.auth-footnote svg { width: 18px; flex: 0 0 auto; fill: none; stroke: var(--green); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.auth-footnote strong { color: var(--slate-700); }

.pilot-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  color: #fff;
  background:
    radial-gradient(circle at 12% 10%, rgba(201, 154, 57, .12), transparent 24%),
    linear-gradient(180deg, var(--navy-950), var(--navy-900));
  border-right: 1px solid rgba(255, 255, 255, .08);
}

.brand-lockup {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: .78rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--navy-900);
  background: linear-gradient(135deg, #edcf85, var(--gold-500));
  border: 1px solid rgba(255, 255, 255, .35);
  clip-path: polygon(50% 0, 94% 24%, 94% 76%, 50% 100%, 6% 76%, 6% 24%);
}

.brand-mark i {
  font-family: "Libre Caslon Display", Georgia, serif;
  font-size: 1.45rem;
  font-style: normal;
}

.brand-copy { display: flex; flex-direction: column; line-height: 1.12; }
.brand-copy strong { font-family: "Libre Caslon Display", Georgia, serif; font-size: 1.35rem; font-weight: 400; letter-spacing: .15em; text-transform: uppercase; }
.brand-copy small { color: #95a5b9; font-size: .61rem; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; }

.pilot-badge {
  margin: 1rem .9rem .35rem;
  padding: .8rem .85rem;
  display: flex;
  align-items: center;
  gap: .7rem;
  background: rgba(201, 154, 57, .11);
  border: 1px solid rgba(221, 182, 95, .25);
}

.pilot-badge > span:last-child { display: flex; flex-direction: column; }
.pilot-badge strong { color: var(--gold-400); font-size: .66rem; letter-spacing: .09em; text-transform: uppercase; }
.pilot-badge small { margin-top: .08rem; color: #8f9fb2; font-size: .58rem; }
.status-dot { width: 9px; height: 9px; flex: 0 0 auto; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 5px rgba(62, 140, 112, .14); }

.primary-nav { padding: .5rem .7rem 1rem; }
.nav-label { margin: 1.15rem .75rem .45rem; color: #62758d; font-size: .55rem; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; }
.settings-label { margin-top: 1.55rem; }

.nav-item {
  width: 100%;
  min-height: 45px;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: .68rem;
  padding: .65rem .8rem;
  color: #a8b5c5;
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  text-align: left;
}

.nav-item svg { width: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.65; }
.nav-item span { font-size: .77rem; font-weight: 600; }
.nav-item b { min-width: 24px; padding: .1rem .36rem; color: #76889e; background: rgba(255, 255, 255, .06); border-radius: 10px; font-size: .52rem; text-align: center; }
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .045); }
.nav-item.is-active { color: #fff; background: linear-gradient(90deg, rgba(201, 154, 57, .15), rgba(201, 154, 57, .03)); border-left-color: var(--gold-500); }
.nav-item.is-active svg { color: var(--gold-400); }
.nav-item.is-active b { color: var(--gold-400); background: rgba(201, 154, 57, .13); }

.workspace-card {
  min-height: 67px;
  margin: auto .9rem 1rem;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: .65rem;
  padding: .75rem;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .09);
}

.workspace-avatar, .user-avatar, .member-avatar { display: grid; place-items: center; border-radius: 50%; font-size: .61rem; font-weight: 700; letter-spacing: .03em; }
.workspace-avatar { width: 34px; height: 34px; color: var(--navy-900); background: var(--gold-400); }
.workspace-card > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.workspace-card strong { overflow: hidden; font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.workspace-card small { color: #75879d; font-size: .53rem; }
.workspace-chevron { color: #6f8197; }

.app-frame { min-height: 100vh; margin-left: var(--sidebar-width); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0 clamp(1rem, 3vw, 2.6rem);
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--slate-200);
  backdrop-filter: blur(14px);
}

.page-context { min-width: 0; display: flex; flex-direction: column; }
.page-context small { overflow: hidden; color: var(--slate-500); font-size: .55rem; font-weight: 700; letter-spacing: .12em; text-overflow: ellipsis; white-space: nowrap; }
.page-context small b { color: #9a7324; }
.page-context strong { font-family: "Libre Caslon Display", Georgia, serif; color: var(--navy-900); font-size: 1.32rem; font-weight: 400; }
.topbar-actions { display: flex; align-items: center; gap: .65rem; }
.safety-chip { display: flex; align-items: center; gap: .42rem; padding: .48rem .68rem; color: #2f725d; background: var(--green-soft); font-size: .6rem; font-weight: 700; }
.safety-chip i { width: 7px; height: 7px; background: var(--green); border-radius: 50%; }
.reset-control, .text-button { color: var(--navy-800); background: transparent; border: 0; font-size: .62rem; font-weight: 700; letter-spacing: .04em; }
.reset-control { min-height: 34px; padding: .45rem .65rem; border: 1px solid var(--slate-300); text-transform: uppercase; }
.reset-control:hover { background: var(--cream); border-color: var(--gold-500); }
.user-avatar { width: 36px; height: 36px; color: #fff; background: var(--navy-800); }
.session-identity { display: flex; align-items: center; gap: .55rem; }
.session-identity > span:first-child { display: flex; flex-direction: column; align-items: end; line-height: 1.2; }
.session-identity strong { max-width: 150px; overflow: hidden; color: var(--navy-900); font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.session-identity small { color: var(--slate-500); font-size: .45rem; font-weight: 700; letter-spacing: .08em; }
.sign-out-control { min-height: 34px; padding: .45rem .65rem; color: var(--slate-600); background: transparent; border: 1px solid transparent; font-size: .56rem; font-weight: 700; text-transform: uppercase; }
.sign-out-control:hover { color: var(--navy-900); background: var(--cream); border-color: var(--slate-300); }
.sign-out-control:disabled { cursor: wait; opacity: .6; }
.mobile-menu { display: none; width: 40px; height: 40px; padding: 9px; background: transparent; border: 1px solid var(--slate-300); }
.mobile-menu i { display: block; height: 1.5px; margin: 4px 0; background: var(--navy-900); }

.workspace { width: min(1480px, 100%); margin: 0 auto; padding: 1.35rem clamp(1rem, 3vw, 2.6rem) 2rem; }

.preview-notice {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: 1.6rem;
  padding: .72rem .9rem;
  color: #6c5523;
  background: #fff8e7;
  border: 1px solid #e8d4a4;
  box-shadow: 0 4px 20px rgba(122, 91, 29, .05);
}

.preview-notice svg { width: 22px; flex: 0 0 auto; fill: none; stroke: #a77c23; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.preview-notice > div { display: flex; align-items: baseline; gap: .7rem; }
.preview-notice strong { font-size: .69rem; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.preview-notice span { color: #887344; font-size: .67rem; }

.workspace-state {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: 0 0 1rem;
  padding: .85rem 1rem;
  color: var(--slate-700);
  background: #fff;
  border: 1px solid var(--slate-200);
  border-left: 3px solid var(--blue);
  box-shadow: var(--shadow-sm);
}
.workspace-state[data-state="error"] { border-left-color: var(--red); background: var(--red-soft); }
.workspace-state > div { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.workspace-state strong { color: var(--navy-900); font-size: .7rem; }
.workspace-state small { color: var(--slate-600); font-size: .58rem; }
.workspace-state button { min-height: 36px; padding: .45rem .7rem; color: #fff; background: var(--navy-800); border: 0; font-size: .58rem; font-weight: 700; }
.workspace-loader { width: 25px; height: 25px; flex: 0 0 auto; border: 2px solid var(--slate-200); border-top-color: var(--gold-500); border-radius: 50%; animation: auth-spin .8s linear infinite; }
.workspace-state[data-state="error"] .workspace-loader { display: none; }

.sample-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1rem;
  padding: 1rem 1.15rem;
  color: #fff;
  background: linear-gradient(125deg, var(--navy-900), var(--navy-800));
  border: 1px solid #173f68;
  box-shadow: var(--shadow-sm);
}
.sample-callout small { color: var(--gold-400); font-size: .48rem; font-weight: 800; letter-spacing: .12em; }
.sample-callout h2 { margin: .12rem 0; font-family: "Libre Caslon Display", Georgia, serif; font-size: 1.2rem; font-weight: 400; }
.sample-callout p { max-width: 680px; margin: 0; color: #b4c1cf; font-size: .62rem; }
.sample-callout button { min-height: 43px; flex: 0 0 auto; padding: .65rem .85rem; color: var(--navy-950); background: var(--gold-400); border: 1px solid #bd8d2f; font-size: .6rem; font-weight: 800; }
.sample-callout button:disabled { cursor: wait; opacity: .68; }

.entry-drawer { margin: 0 0 .85rem; background: #fff; border: 1px solid var(--slate-200); box-shadow: var(--shadow-sm); }
.entry-drawer summary { min-height: 48px; display: flex; align-items: center; justify-content: space-between; padding: .7rem .9rem; color: var(--navy-900); font-size: .65rem; font-weight: 800; list-style: none; }
.entry-drawer summary::-webkit-details-marker { display: none; }
.entry-drawer summary span { color: var(--gold-500); font-size: 1.2rem; font-weight: 400; }
.entry-drawer[open] summary { background: var(--cream); border-bottom: 1px solid var(--slate-200); }
.entry-form { padding: .9rem; }
.form-boundary { margin: 0 0 .8rem; padding: .58rem .7rem; color: #785716; background: var(--gold-100); border-left: 3px solid var(--gold-500); font-size: .56rem; }
.entry-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.entry-grid label, .inline-control, .card-stage { min-width: 0; display: flex; flex-direction: column; gap: .3rem; color: var(--navy-900); font-size: .54rem; font-weight: 700; }
.entry-grid input, .entry-grid select, .inline-control select, .card-stage select { width: 100%; min-height: 40px; padding: .55rem .62rem; color: var(--ink); background: #fff; border: 1px solid #bfc7d0; border-radius: 0; font: inherit; font-size: .65rem; }
.entry-grid input:focus, .entry-grid select:focus, .inline-control select:focus, .card-stage select:focus { outline: 0; border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(201, 154, 57, .2); }
.entry-wide { grid-column: 1 / -1; }
.entry-submit { min-height: 41px; margin-top: .8rem; padding: .58rem .85rem; color: #fff; background: var(--navy-800); border: 1px solid var(--navy-900); font-size: .59rem; font-weight: 800; }
.entry-submit:disabled { cursor: wait; opacity: .65; }
.form-result { display: inline; margin: 0 0 0 .65rem; color: var(--green); font-size: .56rem; }
.form-result.is-error { color: var(--red); }
.empty-state { min-height: 115px; display: grid; place-items: center; align-content: center; gap: .18rem; padding: 1.3rem; color: var(--slate-500); background: #fff; border: 1px dashed var(--slate-300); text-align: center; }
.empty-state strong { color: var(--navy-900); font-size: .7rem; }
.empty-state span { font-size: .58rem; }
.empty-state.compact { min-height: 74px; border: 0; }
.stage-pulse { padding: .55rem 1rem 1rem; }
.stage-pulse > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--slate-200); }
.stage-pulse > div:last-child { border-bottom: 0; }
.stage-pulse span { display: flex; flex-direction: column; }
.stage-pulse strong { color: var(--navy-900); font-size: .63rem; }
.stage-pulse small { color: var(--slate-500); font-size: .51rem; }
.stage-pulse b { color: var(--navy-800); font-family: "Libre Caslon Display", Georgia, serif; font-size: .9rem; font-weight: 400; }

.view[hidden] { display: none; }
.view { animation: reveal .28s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } }

.view-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin: .6rem 0 1.55rem;
}

.view-heading > div { max-width: 860px; }
.view-heading h1 { margin: .18rem 0 .5rem; color: var(--navy-900); font-family: "Libre Caslon Display", Georgia, serif; font-size: clamp(2.1rem, 3.6vw, 3.75rem); font-weight: 400; line-height: 1.03; letter-spacing: -.035em; }
.view-heading.compact h1 { font-size: clamp(1.95rem, 3.2vw, 3.1rem); }
.view-heading p:not(.eyebrow) { max-width: 730px; margin: 0; color: var(--slate-600); font-size: .82rem; }
.eyebrow { margin: 0; color: #916a1d; font-size: .57rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.period-chip { flex: 0 0 auto; padding: .5rem .7rem; color: var(--slate-600); background: #e8ebed; font-size: .54rem; font-weight: 700; letter-spacing: .11em; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .85rem; margin-bottom: .85rem; }
.metric-card { padding: 1.05rem 1.1rem; background: var(--paper); border: 1px solid var(--slate-200); box-shadow: var(--shadow-sm); }
.metric-card > div { display: flex; align-items: center; gap: .62rem; }
.metric-card small { color: var(--slate-500); font-size: .53rem; font-weight: 700; letter-spacing: .1em; }
.metric-card > strong { display: block; margin-top: .7rem; color: var(--navy-900); font-family: "Libre Caslon Display", Georgia, serif; font-size: 2.15rem; font-weight: 400; line-height: 1; }
.metric-card p { margin: .35rem 0 0; color: var(--slate-500); font-size: .61rem; }
.metric-card p b { color: var(--green); font-weight: 600; }
.metric-icon { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-size: .7rem; font-weight: 700; }
.metric-icon.gold { color: #785515; background: var(--gold-100); }
.metric-icon.blue { color: #315b82; background: var(--blue-soft); }
.metric-icon.green { color: #2b6c56; background: var(--green-soft); }
.metric-icon.cream { color: #6f603f; background: #f2eee5; }

.today-grid { display: grid; grid-template-columns: 1.35fr .85fr; gap: .85rem; }
.panel { min-width: 0; background: var(--paper); border: 1px solid var(--slate-200); box-shadow: var(--shadow-sm); }
.panel-header { min-height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1rem; border-bottom: 1px solid var(--slate-200); }
.panel-header > div { min-width: 0; }
.panel-header small { display: block; color: #987121; font-size: .52rem; font-weight: 700; letter-spacing: .12em; }
.panel-header h2 { margin: .12rem 0 0; color: var(--navy-900); font-family: "Libre Caslon Display", Georgia, serif; font-size: 1.12rem; font-weight: 400; }
.panel-header > span { flex: 0 0 auto; color: var(--slate-500); font-size: .55rem; font-weight: 700; letter-spacing: .05em; }
.text-button { padding: .4rem .15rem; }
.text-button:hover { color: #8a651c; text-decoration: underline; text-underline-offset: 3px; }

.priority-list { display: grid; }
.priority-row { min-height: 77px; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: .8rem; padding: .8rem 1rem; background: #fff; border: 0; border-bottom: 1px solid #e5e8eb; text-align: left; }
.priority-row:last-child { border-bottom: 0; }
.priority-row:hover, .priority-row.is-selected { background: var(--cream); }
.priority-number { width: 31px; height: 31px; display: grid; place-items: center; color: var(--slate-600); background: var(--slate-100); border: 1px solid var(--slate-200); font-size: .57rem; font-weight: 700; }
.priority-row.is-selected .priority-number { color: var(--navy-900); background: var(--gold-500); border-color: var(--gold-500); }
.priority-copy { min-width: 0; display: flex; flex-direction: column; }
.priority-copy small { color: #956e1f; font-size: .49rem; font-weight: 700; letter-spacing: .08em; }
.priority-copy strong { margin: .12rem 0; overflow: hidden; color: var(--ink); font-size: .71rem; text-overflow: ellipsis; white-space: nowrap; }
.priority-copy em { overflow: hidden; color: var(--slate-500); font-size: .58rem; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.row-action { color: var(--navy-700); font-size: .57rem; font-weight: 700; }
.row-action i { color: var(--gold-500); font-style: normal; }

.pulse-panel { display: flex; flex-direction: column; }
.pulse-chart { min-height: 203px; display: grid; grid-template-columns: 40px 1fr; gap: .55rem; padding: 1rem 1rem .35rem; background: repeating-linear-gradient(to bottom, transparent 0, transparent 31%, #edf0f2 31%, #edf0f2 calc(31% + 1px)); }
.chart-scale { display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 1.55rem; color: var(--slate-500); font-size: .47rem; }
.bar-set { min-width: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: .6rem; align-items: end; }
.bar-set > div { height: 100%; display: flex; flex-direction: column; justify-content: end; text-align: center; }
.bar-set span { height: var(--bar); display: block; background: linear-gradient(180deg, #87a1bb, var(--navy-700)); opacity: .66; }
.bar-set .bar-44 { --bar: 44%; }
.bar-set .bar-53 { --bar: 53%; }
.bar-set .bar-61 { --bar: 61%; }
.bar-set .bar-69 { --bar: 69%; }
.bar-set .bar-82 { --bar: 82%; }
.bar-set .current span { background: linear-gradient(180deg, var(--gold-400), var(--gold-500)); opacity: 1; }
.bar-set small { margin-top: .42rem; color: var(--slate-500); font-size: .47rem; font-weight: 700; }
.pulse-summary { display: grid; grid-template-columns: repeat(3, 1fr); padding: .7rem 1rem 1rem; }
.pulse-summary span { display: flex; flex-direction: column; padding: 0 .7rem; border-right: 1px solid var(--slate-200); }
.pulse-summary span:first-child { padding-left: 0; }
.pulse-summary span:last-child { border: 0; }
.pulse-summary small { color: var(--slate-500); font-size: .45rem; font-weight: 700; letter-spacing: .08em; }
.pulse-summary strong { color: var(--navy-900); font-family: "Libre Caslon Display", Georgia, serif; font-size: 1rem; font-weight: 400; }
.pulse-summary .positive { color: var(--green); }

.guardrail-panel, .activity-panel { min-height: 277px; }
.safe-state { color: var(--green) !important; }
.safe-state i { width: 7px; height: 7px; display: inline-block; margin-right: .25rem; background: var(--green); border-radius: 50%; }
.control-list { margin: 0; padding: .55rem 1rem 1rem; list-style: none; }
.control-list li { display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding: .68rem 0; border-bottom: 1px solid #e9ebed; }
.control-list li:last-child { border: 0; }
.control-list span { display: flex; align-items: center; gap: .55rem; }
.control-list .check { width: 22px; height: 22px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); border-radius: 50%; font-size: .56rem; font-style: normal; }
.control-list strong { font-size: .65rem; }
.control-list b { color: var(--slate-500); font-size: .54rem; font-weight: 600; text-align: right; }

.mini-timeline { padding: .75rem 1rem 1rem; }
.mini-timeline > div { position: relative; display: grid; grid-template-columns: 14px 1fr; gap: .55rem; padding: .5rem 0; }
.mini-timeline > div:not(:last-child):after { content: ""; position: absolute; top: 24px; bottom: -7px; left: 5px; width: 1px; background: var(--slate-200); }
.timeline-dot { z-index: 1; width: 11px; height: 11px; margin-top: .2rem; border-radius: 50%; box-shadow: 0 0 0 4px #fff; }
.timeline-dot.green { background: var(--green); }
.timeline-dot.gold { background: var(--gold-500); }
.timeline-dot.blue { background: var(--blue); }
.mini-timeline p { margin: 0; display: flex; flex-direction: column; }
.mini-timeline strong { font-size: .64rem; }
.mini-timeline small { margin-top: .08rem; color: var(--slate-500); font-size: .54rem; }

.toolbar { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; padding: .55rem .65rem; background: #fff; border: 1px solid var(--slate-200); }
.segmented-control { display: flex; flex-wrap: wrap; gap: .3rem; }
.segmented-control button { padding: .48rem .72rem; color: var(--slate-600); background: transparent; border: 1px solid transparent; font-size: .6rem; font-weight: 700; }
.segmented-control button b { margin-left: .3rem; color: var(--slate-500); font-size: .48rem; }
.segmented-control button:hover { background: var(--slate-100); }
.segmented-control button.is-active { color: var(--navy-900); background: var(--gold-100); border-color: #e5cb90; }
.toolbar-note { color: var(--slate-500); font-size: .56rem; }

.companies-layout { display: grid; grid-template-columns: minmax(250px, .55fr) minmax(440px, 1.45fr); gap: .85rem; align-items: start; }
.company-list { display: grid; gap: .45rem; }
.company-list-empty { padding: 2rem 1rem; color: var(--slate-600); background: #fff; border: 1px solid var(--slate-200); text-align: center; }
.company-list-empty strong { display: block; color: var(--navy-900); }
.company-card { width: 100%; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: .7rem; padding: .78rem; background: #fff; border: 1px solid var(--slate-200); border-left: 3px solid transparent; text-align: left; }
.company-card:hover { border-color: #b8c1ca; }
.company-card.is-active { background: var(--cream); border-left-color: var(--gold-500); box-shadow: var(--shadow-sm); }
.company-monogram { width: 38px; height: 38px; display: grid; place-items: center; color: var(--navy-800); background: var(--slate-100); font-family: "Libre Caslon Display", Georgia, serif; font-size: .86rem; }
.company-card.is-active .company-monogram { background: var(--gold-100); }
.company-card > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.company-card small { color: #987021; font-size: .48rem; font-weight: 700; letter-spacing: .08em; }
.company-card strong { overflow: hidden; margin: .08rem 0; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.company-card em { overflow: hidden; color: var(--slate-500); font-size: .54rem; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.record-count { min-width: 38px; color: var(--slate-500); font-size: .45rem; font-weight: 700; text-align: right; }
.fit-ring { width: 36px; height: 36px; display: grid; place-items: center; color: var(--navy-800); background: conic-gradient(var(--gold-500) calc(var(--score) * 1%), #e4e7e9 0); border-radius: 50%; font-size: .53rem; font-weight: 700; }
.fit-ring:before { content: attr(data-score); width: 27px; height: 27px; display: grid; place-items: center; background: #fff; border-radius: 50%; }
.fit-92 { --score: 92; }
.fit-89 { --score: 89; }
.fit-86 { --score: 86; }
.fit-75 { --score: 75; }
.fit-72 { --score: 72; }
.fit-68 { --score: 68; }

.company-detail { position: sticky; top: 96px; }
.company-hero { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding: 1.15rem; background: linear-gradient(135deg, var(--navy-900), var(--navy-800)); color: #fff; }
.company-hero small { color: var(--gold-400); font-size: .5rem; font-weight: 700; letter-spacing: .12em; }
.company-hero h2 { margin: .22rem 0 .28rem; font-family: "Libre Caslon Display", Georgia, serif; font-size: 1.55rem; font-weight: 400; }
.company-hero p { margin: 0; color: #a8b6c7; font-size: .62rem; }
.company-status { padding: .32rem .5rem; color: #ddedE7; background: rgba(62, 140, 112, .18); border: 1px solid rgba(121, 190, 166, .3); font-size: .5rem; font-weight: 700; letter-spacing: .08em; }
.company-status.hold { color: #f3d8d4; background: rgba(162, 74, 66, .2); border-color: rgba(220, 137, 129, .32); }
.company-detail-body { padding: 1rem 1.15rem 1.15rem; }
.detail-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .55rem; }
.detail-stat-grid div { padding: .65rem; background: var(--slate-100); }
.detail-stat-grid small { display: block; color: var(--slate-500); font-size: .45rem; font-weight: 700; letter-spacing: .08em; }
.detail-stat-grid strong { display: block; margin-top: .16rem; color: var(--navy-900); font-size: .62rem; }
.evidence-panel { margin-top: .75rem; padding: .85rem .9rem; background: #fffaf0; border-left: 3px solid var(--gold-500); }
.evidence-panel small { color: #936b1e; font-size: .47rem; font-weight: 700; letter-spacing: .09em; }
.evidence-panel p { margin: .3rem 0 0; color: var(--slate-700); font-size: .64rem; }
.safety-checks { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.safety-checks span { padding: .32rem .45rem; color: #2f705b; background: var(--green-soft); font-size: .5rem; font-weight: 600; }
.safety-checks span.hold { color: #8f423b; background: var(--red-soft); }
.company-note { display: grid; grid-template-columns: auto 1fr; gap: .6rem; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--slate-200); }
.company-note b { color: var(--gold-500); font-family: "Libre Caslon Display", Georgia, serif; font-size: 1.3rem; }
.company-note p { margin: 0; color: var(--slate-600); font-size: .6rem; }
.inline-control { max-width: 230px; margin-top: .8rem; }

.pipeline-summary { display: grid; grid-template-columns: repeat(7, auto); align-items: center; justify-content: start; gap: .75rem; margin-bottom: .85rem; padding: .75rem 1rem; background: var(--navy-900); color: #fff; }
.pipeline-summary span { min-width: 115px; display: grid; grid-template-columns: 1fr auto; align-items: baseline; }
.pipeline-summary small { grid-column: 1 / 3; color: #8396ad; font-size: .46rem; font-weight: 700; letter-spacing: .09em; }
.pipeline-summary strong { font-family: "Libre Caslon Display", Georgia, serif; font-size: 1.35rem; font-weight: 400; }
.pipeline-summary b { color: var(--gold-400); font-size: .53rem; }
.pipeline-summary > i { color: var(--gold-500); font-style: normal; }
.pipeline-board { display: grid; grid-template-columns: repeat(8, minmax(205px, 1fr)); gap: .65rem; overflow-x: auto; padding-bottom: .5rem; }
.pipeline-column { min-width: 205px; padding: .65rem; background: #e8ebed; border: 1px solid var(--slate-200); }
.pipeline-column > header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; padding: .25rem .15rem .55rem; border-bottom: 1px solid #cfd5da; }
.pipeline-column > header span { color: var(--slate-600); font-size: .51rem; font-weight: 700; letter-spacing: .08em; }
.pipeline-column > header b { color: var(--navy-800); background: #fff; border-radius: 10px; padding: .1rem .38rem; font-size: .48rem; }
.opportunity-card { width: 100%; margin-top: .45rem; padding: .75rem; background: #fff; border: 1px solid #d7dce0; border-top: 2px solid var(--slate-300); text-align: left; }
.opportunity-card.hot { border-top-color: var(--gold-500); }
.opportunity-card:hover { border-color: #aeb8c2; box-shadow: var(--shadow-sm); }
.opportunity-card > small { color: #966d1e; font-size: .45rem; font-weight: 700; letter-spacing: .07em; }
.opportunity-card strong { display: block; margin: .18rem 0; font-size: .64rem; }
.opportunity-card p { min-height: 30px; margin: .2rem 0 .6rem; color: var(--slate-500); font-size: .53rem; }
.opportunity-meta { display: flex; align-items: center; justify-content: space-between; padding-top: .5rem; border-top: 1px solid var(--slate-200); }
.opportunity-meta b { color: var(--navy-800); font-family: "Libre Caslon Display", Georgia, serif; font-size: .88rem; font-weight: 400; }
.opportunity-meta span { color: var(--slate-500); font-size: .47rem; }
.card-stage { margin-top: .6rem; padding-top: .55rem; border-top: 1px solid var(--slate-200); }
.card-stage select { min-height: 34px; padding: .4rem .45rem; font-size: .56rem; }
.column-empty { padding: .8rem .4rem; color: var(--slate-500); font-size: .53rem; text-align: center; }

.task-overview { min-height: 76px; display: grid; grid-template-columns: 140px minmax(160px, 1fr) auto; align-items: center; gap: 1rem; margin-bottom: .85rem; padding: .85rem 1rem; }
.task-overview > div:first-child { display: flex; flex-direction: column; }
.task-overview small { color: var(--slate-500); font-size: .47rem; font-weight: 700; letter-spacing: .08em; }
.task-overview strong { color: var(--navy-900); font-family: "Libre Caslon Display", Georgia, serif; font-size: 1.35rem; font-weight: 400; }
.task-overview p { margin: 0; color: var(--slate-500); font-size: .56rem; }
.progress-track { height: 8px; overflow: hidden; background: #e1e5e8; }
.progress-track span { width: 0; height: 100%; display: block; background: linear-gradient(90deg, var(--gold-500), var(--gold-400)); transition: width .3s ease; }
.progress-track span[data-progress="20"] { width: 20%; }
.progress-track span[data-progress="10"] { width: 10%; }
.progress-track span[data-progress="30"] { width: 30%; }
.progress-track span[data-progress="40"] { width: 40%; }
.progress-track span[data-progress="50"] { width: 50%; }
.progress-track span[data-progress="60"] { width: 60%; }
.progress-track span[data-progress="70"] { width: 70%; }
.progress-track span[data-progress="80"] { width: 80%; }
.progress-track span[data-progress="90"] { width: 90%; }
.progress-track span[data-progress="100"] { width: 100%; }
.task-list { display: grid; gap: .55rem; }
.task-card { min-height: 78px; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: .8rem; padding: .8rem 1rem; background: #fff; border: 1px solid var(--slate-200); box-shadow: var(--shadow-sm); }
.task-check { width: 28px; height: 28px; display: grid; place-items: center; color: transparent; background: #fff; border: 1px solid var(--slate-300); }
.task-card.is-done .task-check { color: #fff; background: var(--green); border-color: var(--green); }
.task-copy { min-width: 0; display: flex; flex-direction: column; }
.task-copy small { color: #987021; font-size: .46rem; font-weight: 700; letter-spacing: .08em; }
.task-copy strong { margin: .11rem 0; overflow: hidden; font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }
.task-copy span { overflow: hidden; color: var(--slate-500); font-size: .54rem; text-overflow: ellipsis; white-space: nowrap; }
.task-card.is-done .task-copy strong { color: var(--slate-500); text-decoration: line-through; }
.task-owner { display: flex; align-items: center; gap: .35rem; color: var(--slate-600); font-size: .51rem; }
.task-owner i { width: 25px; height: 25px; display: grid; place-items: center; background: var(--blue-soft); border-radius: 50%; font-size: .46rem; font-style: normal; font-weight: 700; }
.due-chip { min-width: 70px; padding: .35rem .4rem; color: var(--slate-600); background: var(--slate-100); font-size: .47rem; font-weight: 700; text-align: center; }
.due-chip.today { color: #805d19; background: var(--gold-100); }

.outcome-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: .85rem; margin-bottom: .85rem; }
.outcome-card { background: #fff; border: 1px solid var(--slate-200); box-shadow: var(--shadow-sm); }
.outcome-card header { display: flex; align-items: center; gap: .7rem; padding: .9rem 1rem; border-bottom: 1px solid var(--slate-200); }
.outcome-card header > div { display: flex; flex-direction: column; }
.outcome-card header small { color: #956d1f; font-size: .47rem; font-weight: 700; letter-spacing: .1em; }
.outcome-card header strong { color: var(--navy-900); font-family: "Libre Caslon Display", Georgia, serif; font-size: .95rem; font-weight: 400; }
.outcome-card > div { display: flex; flex-wrap: wrap; gap: .4rem; padding: .8rem 1rem 1rem; }
.outcome-card > div span { min-width: 78px; display: flex; flex: 1; flex-direction: column; padding: .55rem; color: var(--slate-500); background: var(--slate-100); font-size: .48rem; }
.outcome-card > div b { color: var(--navy-900); font-family: "Libre Caslon Display", Georgia, serif; font-size: 1.35rem; font-weight: 400; }
.outcome-layout { display: grid; grid-template-columns: 1.25fr .75fr; gap: .85rem; }
.funnel { display: grid; justify-items: center; gap: .42rem; padding: 1.2rem 1rem; }
.funnel div { width: var(--width); max-width: 100%; min-width: 145px; min-height: 37px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .55rem; padding: .4rem .65rem; color: var(--navy-900); background: linear-gradient(90deg, var(--gold-500), #ecd28e); clip-path: polygon(5% 0, 95% 0, 100% 100%, 0 100%); }
.funnel .funnel-100 { --width: 100%; }
.funnel .funnel-85 { --width: 85%; }
.funnel .funnel-74 { --width: 74%; }
.funnel .funnel-72 { --width: 72%; }
.funnel .funnel-58 { --width: 58%; }
.funnel .funnel-57 { --width: 57%; }
.funnel .funnel-45 { --width: 45%; }
.funnel .funnel-43 { --width: 43%; }
.funnel .funnel-32 { --width: 32%; }
.funnel .funnel-31 { --width: 31%; }
.funnel .funnel-20 { --width: 20%; }
.funnel div:nth-child(n+4) { background: linear-gradient(90deg, #7290ae, #b8c8d7); }
.funnel b { font-family: "Libre Caslon Display", Georgia, serif; font-size: 1rem; font-weight: 400; }
.funnel span { font-size: .54rem; font-weight: 700; text-align: right; }
.segment-list { padding: .7rem 1rem 1rem; }
.segment-list > div { display: grid; grid-template-columns: 1fr auto; gap: .15rem .7rem; padding: .75rem 0; border-bottom: 1px solid var(--slate-200); }
.segment-list > div:last-child { border: 0; }
.segment-list span { display: flex; align-items: center; gap: .45rem; color: var(--slate-700); font-size: .62rem; }
.segment-swatch { width: 8px; height: 8px; border-radius: 50%; }
.segment-swatch.gold { background: var(--gold-500); }
.segment-swatch.blue { background: var(--blue); }
.segment-swatch.green { background: var(--green); }
.segment-list b { font-size: .58rem; }
.segment-list em { grid-column: 2; color: var(--green); font-size: .49rem; font-style: normal; text-align: right; }
.outcome-log { padding: .55rem 1rem 1rem; }
.outcome-log > div { display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding: .65rem 0; border-bottom: 1px solid var(--slate-200); }
.outcome-log > div:last-child { border-bottom: 0; }
.outcome-log span { min-width: 0; display: flex; flex-direction: column; }
.outcome-log strong { overflow: hidden; font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.outcome-log small { overflow: hidden; color: var(--slate-500); font-size: .51rem; text-overflow: ellipsis; white-space: nowrap; }
.outcome-log b { flex: 0 0 auto; color: var(--navy-800); font-size: .55rem; }

.settings-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: .85rem; }
.member-list { padding: .55rem 1rem .9rem; }
.member-list > div { display: grid; grid-template-columns: 37px 1fr auto; align-items: center; gap: .65rem; padding: .72rem 0; border-bottom: 1px solid var(--slate-200); }
.member-list > div:last-child { border: 0; }
.member-avatar { width: 37px; height: 37px; color: #fff; }
.member-avatar.navy { background: var(--navy-800); }
.member-avatar.gold { color: var(--navy-900); background: var(--gold-500); }
.member-avatar.sage { background: var(--green); }
.member-list p { margin: 0; display: flex; flex-direction: column; }
.member-list strong { font-size: .65rem; }
.member-list small { color: var(--slate-500); font-size: .53rem; }
.member-list b { padding: .25rem .4rem; color: var(--slate-600); background: var(--slate-100); font-size: .45rem; letter-spacing: .08em; }
.role-matrix { overflow-x: auto; padding: .55rem 1rem 1rem; }
.role-matrix > div { min-width: 500px; display: grid; grid-template-columns: 1.45fr repeat(3, .65fr); align-items: center; min-height: 43px; border-bottom: 1px solid var(--slate-200); }
.role-matrix span { font-size: .57rem; }
.role-matrix b { color: var(--slate-600); font-size: .51rem; text-align: center; }
.role-matrix .matrix-head span, .role-matrix .matrix-head b { color: #956d1f; font-size: .45rem; font-weight: 700; letter-spacing: .07em; }

.audit-panel { overflow-x: auto; }
.audit-table-head, .audit-row { min-width: 680px; display: grid; grid-template-columns: minmax(260px, 1.5fr) .75fr .6fr .6fr; gap: .8rem; align-items: center; padding: .72rem 1rem; }
.audit-table-head { color: var(--slate-500); background: var(--slate-100); border-bottom: 1px solid var(--slate-200); font-size: .47rem; font-weight: 700; letter-spacing: .1em; }
.audit-row { min-height: 66px; border-bottom: 1px solid var(--slate-200); }
.audit-row:last-child { border: 0; }
.audit-event { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: .65rem; }
.audit-event i { width: 30px; height: 30px; display: grid; place-items: center; color: var(--navy-800); background: var(--blue-soft); border-radius: 50%; font-size: .62rem; font-style: normal; }
.audit-event i.safety { color: #2f715b; background: var(--green-soft); }
.audit-event i.pipeline { color: #805c19; background: var(--gold-100); }
.audit-event > span { display: flex; flex-direction: column; }
.audit-event strong { font-size: .61rem; }
.audit-event small { color: var(--slate-500); font-size: .51rem; }
.audit-row > span, .audit-row > time { color: var(--slate-600); font-size: .53rem; }
.audit-type { justify-self: start; padding: .25rem .4rem; background: var(--slate-100); font-weight: 700; text-transform: uppercase; }
.audit-empty { padding: 2rem; color: var(--slate-500); text-align: center; }

.session-note { margin: 1.2rem 0 0; padding: .72rem .85rem; color: var(--slate-500); background: transparent; border: 1px dashed #c9cfd5; font-size: .55rem; text-align: center; }
.session-note strong { color: var(--navy-800); }

.nav-scrim { display: none; }
.toast { position: fixed; z-index: 80; right: 1.2rem; bottom: 1.2rem; max-width: min(360px, calc(100% - 2rem)); padding: .75rem 1rem; color: #fff; background: var(--navy-900); border-left: 3px solid var(--gold-500); box-shadow: var(--shadow-lg); font-size: .65rem; opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity .2s ease, transform .2s ease; }
.toast.is-visible { opacity: 1; transform: none; }

@media (max-width: 1180px) {
  .access-gate { grid-template-columns: minmax(300px, .72fr) minmax(500px, 1.28fr); }
  .access-story { padding: 2.5rem; }
  .access-story-copy h1 { font-size: clamp(3rem, 5.6vw, 4.9rem); }
  .access-safeguards { grid-template-columns: 1fr; }
  .access-safeguards li { min-height: auto; grid-template-columns: 36px 1fr; padding: .75rem 0; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .1); }
  .access-safeguards li:last-child { border-bottom: 0; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .today-grid { grid-template-columns: 1fr; }
  .guardrail-panel, .activity-panel { min-height: auto; }
  .outcome-groups { grid-template-columns: 1fr; }
  .outcome-layout, .settings-grid { grid-template-columns: 1fr; }
  .pipeline-summary { overflow-x: auto; }
}

@media (max-width: 880px) {
  .access-gate { grid-template-columns: 1fr; background: var(--navy-950); }
  .access-story { min-height: auto; padding: 1.4rem; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .1); }
  .access-story-copy { margin: 2.5rem 0 1.5rem; }
  .access-story-copy h1 { max-width: 500px; font-size: clamp(2.7rem, 9vw, 4.5rem); }
  .access-story-copy > p:last-child { margin-top: 1rem; }
  .access-safeguards { display: none; }
  .access-story-foot { display: none; }
  .access-panel { min-height: auto; padding: 1.2rem; }
  .access-card { width: min(100%, 680px); }
  :root { --sidebar-width: 266px; }
  .sidebar { transform: translateX(-104%); transition: transform .22s ease; box-shadow: 24px 0 70px rgba(4, 18, 37, .28); }
  .pilot-shell.nav-open .sidebar { transform: none; }
  .app-frame { margin-left: 0; }
  .mobile-menu { display: block; flex: 0 0 auto; }
  .nav-scrim { position: fixed; inset: 0; z-index: 35; display: block; background: rgba(4, 18, 37, .45); border: 0; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .pilot-shell.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
  .companies-layout { grid-template-columns: 1fr; }
  .company-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .company-detail { position: static; }
  .pipeline-board { grid-template-columns: repeat(8, 240px); }
  .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .access-story { padding: 1.1rem; }
  .access-brand-mark { width: 44px; height: 44px; }
  .access-brand strong { font-size: 1.35rem; }
  .access-story-copy { margin: 2rem 0 .75rem; }
  .access-story-copy h1 { font-size: clamp(2.5rem, 14vw, 3.8rem); }
  .access-story-copy > p:last-child { font-size: .85rem; line-height: 1.6; }
  .access-panel { padding: .75rem; }
  .access-card { padding: 1.15rem; }
  .field-row { grid-template-columns: 1fr; gap: 1rem; }
  .auth-tabs button { font-size: .64rem; }
  .topbar { height: 70px; gap: .7rem; }
  .page-context small { max-width: 170px; }
  .page-context strong { font-size: 1.05rem; }
  .safety-chip, .session-identity { display: none; }
  .reset-control { padding: .4rem .5rem; font-size: .52rem; }
  .sign-out-control { padding: .4rem .45rem; font-size: .5rem; }
  .workspace { padding-inline: .75rem; }
  .preview-notice { align-items: start; }
  .preview-notice > div { display: block; }
  .preview-notice strong { display: block; margin-bottom: .2rem; }
  .view-heading { display: block; }
  .view-heading h1 { font-size: 2rem; }
  .period-chip { display: inline-block; margin-top: .8rem; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { display: grid; grid-template-columns: 1fr auto; align-items: end; }
  .metric-card > strong { grid-column: 2; grid-row: 1 / 3; }
  .metric-card p { grid-column: 1; }
  .priority-row { grid-template-columns: 32px 1fr; }
  .row-action { display: none; }
  .companies-layout { grid-template-columns: 1fr; }
  .company-list { grid-template-columns: 1fr; }
  .detail-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar { align-items: start; flex-direction: column; }
  .toolbar-note { padding-inline: .2rem; }
  .sample-callout { align-items: stretch; flex-direction: column; }
  .sample-callout button { width: 100%; }
  .entry-grid { grid-template-columns: 1fr; }
  .entry-wide { grid-column: auto; }
  .pipeline-summary { grid-template-columns: repeat(7, auto); }
  .task-overview { grid-template-columns: 90px 1fr; }
  .task-overview p { grid-column: 1 / 3; }
  .task-card { grid-template-columns: auto 1fr auto; }
  .task-owner { display: none; }
  .outcome-card > div { display: grid; grid-template-columns: repeat(3, 1fr); }
  .funnel div { min-width: 125px; }
}

@media (max-width: 430px) {
  .page-context small { max-width: 122px; }
  .page-context strong { font-size: .93rem; }
  .reset-control { border: 0; text-decoration: underline; text-underline-offset: 3px; }
  .preview-notice span { font-size: .61rem; }
  .pilot-badge { margin-top: .75rem; }
  .pulse-summary { grid-template-columns: 1fr; gap: .55rem; }
  .pulse-summary span { padding: 0; border: 0; }
  .detail-stat-grid { grid-template-columns: 1fr; }
  .task-card { align-items: start; grid-template-columns: auto 1fr; }
  .due-chip { grid-column: 2; justify-self: start; }
  .outcome-card > div { grid-template-columns: 1fr; }
}

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

@media (prefers-contrast: more) {
  .panel, .metric-card, .company-card, .task-card { border-color: #8794a3; }
  .nav-item.is-active { outline: 1px solid var(--gold-400); outline-offset: -1px; }
}
