:root {
  color-scheme: light;
  --navy-950: #0d1625;
  --navy-900: #101b2d;
  --navy-800: #182940;
  --navy-700: #243a55;
  --ink: #172438;
  --ink-soft: #2b3a4f;
  --muted: #68788d;
  --muted-light: #8b98a8;
  --paper: #f7f7f3;
  --paper-deep: #eff0ec;
  --surface: #ffffff;
  --surface-soft: #fbfcfa;
  --line: #e2e6e9;
  --line-strong: #ccd3da;
  --coral: #e86b4e;
  --coral-dark: #c95036;
  --coral-soft: #fff0eb;
  --blue: #4273e6;
  --blue-soft: #e9efff;
  --mint: #168f7a;
  --mint-soft: #e5f6f2;
  --purple: #7a60c9;
  --purple-soft: #f0ecff;
  --gold: #b37a13;
  --gold-soft: #fff4d9;
  --danger: #bd3d42;
  --danger-soft: #fff0f0;
  --success: #287e65;
  --success-soft: #e8f6f0;
  --shadow-xs: 0 1px 2px rgb(15 27 45 / 4%);
  --shadow-sm: 0 4px 16px rgb(15 27 45 / 7%);
  --shadow-md: 0 16px 40px rgb(15 27 45 / 11%);
  --shadow-lg: 0 28px 70px rgb(15 27 45 / 16%);
  --radius-xs: 8px;
  --radius-sm: 11px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --ease: cubic-bezier(.22, .8, .28, 1);
  --sidebar-width: 252px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  margin: 0;
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: .55;
}

button,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2,
h3,
h4,
ul,
ol,
dl,
dd {
  margin-block: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

svg {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  flex: 0 0 auto;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

::selection {
  color: var(--surface);
  background: var(--coral);
}

:focus-visible {
  outline: 3px solid rgb(232 107 78 / 44%);
  outline-offset: 3px;
}

.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;
}

/* Shared brand and controls ------------------------------------------------ */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  color: var(--navy-900);
  font-size: 1.17rem;
  font-weight: 850;
  letter-spacing: -.07em;
  line-height: 1;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--surface);
  background: var(--coral);
  border-radius: 12px 12px 12px 4px;
  box-shadow: 0 7px 16px rgb(232 107 78 / 25%);
  transform: rotate(-4deg);
}

.brand-mark svg {
  width: 19px;
  height: 19px;
  stroke-width: 2.2;
  transform: rotate(4deg);
}

.brand-light {
  color: var(--surface);
}

.btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: .88rem;
  font-weight: 750;
  letter-spacing: -.025em;
  line-height: 1;
  white-space: nowrap;
  transition: color .18s var(--ease), background-color .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}

.btn svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn-lg {
  min-height: 50px;
  padding-inline: 19px;
  border-radius: 13px;
  font-size: .95rem;
}

.btn-primary {
  color: var(--surface);
  background: var(--coral);
  box-shadow: 0 7px 16px rgb(232 107 78 / 20%);
}

.btn-primary:hover:not(:disabled) {
  background: var(--coral-dark);
  box-shadow: 0 9px 20px rgb(201 80 54 / 24%);
}

.btn-secondary {
  color: var(--ink-soft);
  background: var(--surface);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover:not(:disabled) {
  color: var(--navy-900);
  background: var(--surface-soft);
  border-color: var(--navy-700);
}

.btn-ghost {
  color: var(--ink-soft);
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--navy-900);
  background: var(--paper-deep);
}

.btn-light {
  color: var(--navy-900);
  background: var(--surface);
}

.btn-danger {
  color: var(--surface);
  background: var(--danger);
  box-shadow: 0 7px 16px rgb(189 61 66 / 18%);
}

.btn-danger:hover:not(:disabled) {
  background: #a62d35;
}

.btn-full {
  width: 100%;
}

.btn-sm {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 9px;
  font-size: .78rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 10px;
}

.btn-icon svg {
  width: 17px;
  height: 17px;
}

/* Landing ------------------------------------------------------------------ */

.locked-screen {
  position: relative;
  display: flex;
  min-height: 100svh;
  overflow: hidden;
  flex-direction: column;
  isolation: isolate;
  background:
    radial-gradient(circle at 2% 100%, rgb(232 107 78 / 10%), transparent 31rem),
    var(--paper);
}

.locked-screen::after {
  position: absolute;
  z-index: -1;
  top: -25rem;
  right: -18rem;
  width: 53rem;
  height: 53rem;
  border: 1px solid rgb(232 107 78 / 9%);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.landing-header {
  display: flex;
  width: min(1320px, calc(100% - 56px));
  min-height: 87px;
  align-items: center;
  justify-content: space-between;
  margin-inline: auto;
}

.landing-security {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.landing-security svg {
  width: 15px;
  height: 15px;
  color: var(--mint);
  stroke-width: 2;
}

.landing-main {
  display: grid;
  width: min(1320px, calc(100% - 56px));
  flex: 1;
  grid-template-columns: minmax(0, .91fr) minmax(470px, 1.09fr);
  gap: clamp(40px, 6vw, 108px);
  align-items: center;
  margin: 0 auto;
  padding: 37px 0 71px;
}

.landing-copy {
  position: relative;
  z-index: 2;
  max-width: 590px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--coral-dark);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .015em;
}

.eyebrow > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 5px rgb(232 107 78 / 13%);
}

.landing-copy h1 {
  max-width: 650px;
  margin-top: 20px;
  color: var(--navy-900);
  font-size: clamp(2.8rem, 5.3vw, 5rem);
  font-weight: 820;
  letter-spacing: -.1em;
  line-height: 1.12;
}

.landing-copy h1 em {
  position: relative;
  z-index: 0;
  color: var(--coral);
  font-style: normal;
  white-space: nowrap;
}

.landing-copy h1 em::after {
  position: absolute;
  z-index: -1;
  right: 0;
  bottom: -3px;
  left: 2px;
  height: 10px;
  border-radius: 50%;
  background: rgb(232 107 78 / 12%);
  content: "";
  transform: rotate(-1.7deg);
}

.landing-lead {
  max-width: 490px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 1rem;
  letter-spacing: -.035em;
  line-height: 1.78;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 29px;
}

.server-vault-status {
  width: min(100%, 446px);
  margin-top: 18px;
  padding: 11px 14px;
  color: var(--muted);
  background: rgb(255 255 255 / 56%);
  border: 1px solid #d7dde1;
  border-radius: 11px;
  font-size: .76rem;
  line-height: 1.5;
}

.landing-footnote {
  display: flex;
  max-width: 475px;
  align-items: flex-start;
  gap: 7px;
  margin-top: 24px;
  color: var(--muted-light);
  font-size: .7rem;
  letter-spacing: -.02em;
  line-height: 1.55;
}

.landing-footnote svg {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  color: var(--muted-light);
  stroke-width: 1.8;
}

.landing-visual {
  position: relative;
  display: grid;
  min-height: 540px;
  align-items: center;
  justify-items: center;
  isolation: isolate;
}

.landing-visual::before {
  position: absolute;
  z-index: -2;
  top: 50%;
  left: 50%;
  width: min(40vw, 540px);
  height: min(40vw, 540px);
  border-radius: 48% 52% 62% 38% / 45% 42% 58% 55%;
  background: linear-gradient(140deg, #eef2fc 0%, #f8ece7 100%);
  content: "";
  transform: translate(-50%, -50%) rotate(-11deg);
}

.landing-visual::after {
  position: absolute;
  z-index: -3;
  top: 50%;
  left: 50%;
  width: min(50vw, 650px);
  height: min(50vw, 650px);
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 255 255 / 68%) 0 48%, transparent 49%);
  content: "";
  opacity: .62;
  transform: translate(-50%, -50%);
}

.orbit {
  position: absolute;
  border: 1px solid rgb(66 115 230 / 17%);
  border-radius: 50%;
  pointer-events: none;
}

.orbit-a {
  width: min(42vw, 610px);
  height: min(42vw, 610px);
  transform: rotate(25deg) scaleY(.54);
}

.orbit-b {
  width: min(33vw, 470px);
  height: min(33vw, 470px);
  border-color: rgb(232 107 78 / 20%);
  transform: rotate(-28deg) scaleY(.58);
}

.preview-card {
  position: absolute;
  z-index: 1;
  color: var(--ink);
  background: rgb(255 255 255 / 92%);
  border: 1px solid rgb(255 255 255 / 88%);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}

.preview-main {
  top: 50%;
  left: 50%;
  width: min(100%, 385px);
  padding: 26px 27px 23px;
  transform: translate(-50%, -50%);
}

.preview-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.preview-label {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
}

.preview-top strong {
  display: block;
  margin-top: 5px;
  color: var(--navy-900);
  font-size: 2.14rem;
  font-weight: 850;
  letter-spacing: -.09em;
  line-height: 1;
}

.preview-top strong small {
  margin-left: 3px;
  color: var(--coral);
  font-size: .98rem;
  letter-spacing: -.04em;
}

.preview-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 5px 9px;
  color: var(--coral-dark);
  background: var(--coral-soft);
  border-radius: 8px;
  font-size: .73rem;
  font-weight: 850;
}

.preview-progress {
  height: 8px;
  margin-top: 25px;
  overflow: hidden;
  background: #edf0f1;
  border-radius: 999px;
}

.preview-progress span {
  display: block;
  width: 63%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), #f28f64);
}

.preview-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  color: var(--muted-light);
  font-size: .62rem;
}

.preview-person {
  display: flex;
  min-width: 197px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

.preview-person-a {
  top: 17%;
  left: 1%;
  transform: rotate(-4deg);
}

.preview-person-b {
  right: -1%;
  bottom: 17%;
  transform: rotate(4deg);
}

.preview-person > div {
  min-width: 0;
}

.preview-person strong,
.preview-person div > span {
  display: block;
}

.preview-person strong {
  overflow: hidden;
  color: var(--navy-900);
  font-size: .77rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-person div > span {
  margin-top: 1px;
  color: var(--muted);
  font-size: .62rem;
  white-space: nowrap;
}

.preview-person b {
  margin-left: auto;
  color: var(--blue);
  font-size: .77rem;
  font-weight: 850;
  white-space: nowrap;
}

.preview-date {
  right: 6%;
  top: 18%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  transform: rotate(5deg);
}

.preview-date > svg {
  width: 26px;
  height: 26px;
  padding: 6px;
  color: var(--surface);
  background: var(--mint);
  border-radius: 50%;
  stroke-width: 1.8;
}

.preview-date span,
.preview-date strong {
  display: block;
}

.preview-date span {
  color: var(--muted);
  font-size: .62rem;
}

.preview-date strong {
  margin-top: 1px;
  color: var(--navy-900);
  font-size: .72rem;
}

.avatar {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--surface);
  border-radius: 12px;
  font-size: .86rem;
  font-weight: 850;
}

.avatar-blue { background: var(--blue); }
.avatar-orange { background: var(--coral); }
.avatar-mint { background: var(--mint); }
.avatar-purple { background: var(--purple); }
.avatar-gold { color: #4e3409; background: #eabf59; }
.avatar-slate { background: var(--muted); }

/* Application shell -------------------------------------------------------- */

.app-shell {
  display: flex;
  min-height: 100svh;
  background: var(--paper);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  width: var(--sidebar-width);
  height: 100svh;
  flex: 0 0 var(--sidebar-width);
  flex-direction: column;
  padding: 28px 17px 18px;
  color: rgb(255 255 255 / 76%);
  background: var(--navy-900);
  box-shadow: 8px 0 28px rgb(15 27 45 / 7%);
}

.sidebar .brand {
  padding-inline: 9px;
}

.side-nav {
  display: grid;
  gap: 4px;
  margin-top: 56px;
}

.nav-item {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: rgb(255 255 255 / 58%);
  background: transparent;
  border-radius: 11px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: -.02em;
  text-align: left;
  transition: color .18s var(--ease), background-color .18s var(--ease), transform .18s var(--ease);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  color: currentColor;
  stroke-width: 1.7;
}

.nav-item:hover {
  color: rgb(255 255 255 / 90%);
  background: rgb(255 255 255 / 7%);
}

.nav-item.is-active {
  color: var(--surface);
  background: rgb(232 107 78 / 17%);
  box-shadow: inset 3px 0 0 var(--coral);
}

.nav-item.is-active svg {
  color: #ff997e;
}

.sidebar-bottom {
  display: grid;
  gap: 13px;
  margin-top: auto;
  padding: 18px 5px 1px;
  border-top: 1px solid rgb(255 255 255 / 10%);
}

.vault-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 1px 5px;
}

.vault-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  color: #8ce2c9;
  background: rgb(22 143 122 / 17%);
  border-radius: 9px;
}

.vault-icon svg {
  width: 15px;
  height: 15px;
}

.vault-status strong,
.vault-status div > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vault-status strong {
  color: rgb(255 255 255 / 88%);
  font-size: .73rem;
  font-weight: 800;
}

.vault-status div > span {
  margin-top: 1px;
  color: rgb(255 255 255 / 43%);
  font-size: .62rem;
}

.sidebar-lock {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: rgb(255 255 255 / 66%);
  background: rgb(255 255 255 / 6%);
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 10px;
  font-size: .74rem;
  font-weight: 700;
  transition: color .18s var(--ease), background-color .18s var(--ease), border-color .18s var(--ease);
}

.sidebar-lock:hover {
  color: var(--surface);
  background: rgb(255 255 255 / 11%);
  border-color: rgb(255 255 255 / 19%);
}

.sidebar-lock svg {
  width: 15px;
  height: 15px;
}

.workspace {
  min-width: 0;
  flex: 1;
}

.topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 21px clamp(26px, 4.3vw, 68px);
  background: rgb(247 247 243 / 90%);
  border-bottom: 1px solid rgb(226 230 233 / 80%);
  backdrop-filter: blur(16px);
}

.topbar-kicker {
  color: var(--muted);
  font-size: .69rem;
  font-weight: 750;
  letter-spacing: .01em;
}

.topbar h2 {
  margin-top: 2px;
  color: var(--navy-900);
  font-size: 1.35rem;
  font-weight: 820;
  letter-spacing: -.065em;
  line-height: 1.25;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.view-root {
  width: min(100%, 1420px);
  margin-inline: auto;
  padding: 36px clamp(26px, 4.3vw, 68px) 75px;
}

.mobile-nav {
  display: none;
}

/* View primitives ---------------------------------------------------------- */

.view-shell,
.dashboard-view,
.compare-view,
.simulation-view,
.people-view,
.settings-view {
  animation: view-enter .34s var(--ease) both;
}

@keyframes view-enter {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-heading,
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.view-heading h1,
.section-heading h3 {
  color: var(--navy-900);
  font-weight: 820;
  letter-spacing: -.075em;
  line-height: 1.25;
}

.view-heading h1 {
  font-size: clamp(1.7rem, 3vw, 2.25rem);
}

.view-heading p,
.section-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-size: .79rem;
  letter-spacing: -.025em;
}

.section-heading h3 {
  font-size: 1rem;
}

.section-heading .section-count,
.section-heading small {
  color: var(--muted-light);
  font-size: .7rem;
  font-weight: 700;
}

.surface,
.card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.card-head,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 0;
}

.card-head h3,
.panel-head h3 {
  color: var(--navy-900);
  font-size: .94rem;
  font-weight: 820;
  letter-spacing: -.055em;
}

.card-head p,
.panel-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: .7rem;
}

.muted {
  color: var(--muted);
}

.empty-state {
  display: grid;
  min-height: 210px;
  place-items: center;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.empty-state > svg,
.empty-icon {
  width: 42px;
  height: 42px;
  padding: 10px;
  color: var(--coral);
  background: var(--coral-soft);
  border-radius: 13px;
}

.empty-state strong {
  display: block;
  margin-top: 13px;
  color: var(--navy-900);
  font-size: .86rem;
}

.empty-state p {
  max-width: 330px;
  margin-top: 4px;
  font-size: .73rem;
}

/* Dashboard ---------------------------------------------------------------- */

.dashboard-hero,
.dashboard-banner {
  position: relative;
  display: grid;
  min-height: 196px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 26px;
  align-items: center;
  overflow: hidden;
  padding: 30px 34px;
  color: var(--surface);
  background:
    radial-gradient(circle at 83% 25%, rgb(232 107 78 / 26%), transparent 15rem),
    linear-gradient(120deg, var(--navy-900), #1c304a);
  border: 1px solid var(--navy-700);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.dashboard-hero::before,
.dashboard-banner::before {
  position: absolute;
  right: -60px;
  bottom: -155px;
  width: 370px;
  height: 370px;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 50%;
  content: "";
}

.dashboard-hero::after,
.dashboard-banner::after {
  position: absolute;
  right: 59px;
  bottom: -137px;
  width: 270px;
  height: 270px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 50%;
  content: "";
}

.dashboard-hero > *,
.dashboard-banner > * {
  position: relative;
  z-index: 1;
}

.dashboard-hero h1,
.dashboard-banner h1 {
  max-width: 610px;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -.08em;
  line-height: 1.3;
}

.dashboard-hero p,
.dashboard-banner p {
  max-width: 590px;
  margin-top: 8px;
  color: rgb(255 255 255 / 63%);
  font-size: .78rem;
  letter-spacing: -.025em;
}

.hero-number,
.dashboard-banner .hero-number {
  min-width: 185px;
  padding: 17px 19px;
  text-align: right;
  background: rgb(255 255 255 / 8%);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 15px;
}

.hero-number span,
.hero-number strong {
  display: block;
}

.hero-number span {
  color: rgb(255 255 255 / 58%);
  font-size: .64rem;
  font-weight: 700;
}

.hero-number strong {
  margin-top: 3px;
  color: var(--surface);
  font-size: 1.76rem;
  font-weight: 850;
  letter-spacing: -.1em;
  line-height: 1;
}

.hero-number small {
  margin-left: 2px;
  color: #ffac91;
  font-size: .74rem;
  letter-spacing: -.03em;
}

.dashboard-summary,
.stats-grid,
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-top: 18px;
}

.summary-card,
.stat-card,
.metric-card {
  position: relative;
  min-height: 124px;
  padding: 19px 20px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.summary-card::after,
.stat-card::after,
.metric-card::after {
  position: absolute;
  right: -25px;
  bottom: -38px;
  width: 105px;
  height: 105px;
  border: 1px solid rgb(66 115 230 / 8%);
  border-radius: 50%;
  content: "";
}

.summary-label,
.stat-label,
.metric-label {
  display: block;
  color: var(--muted);
  font-size: .69rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.summary-value,
.stat-value,
.metric-value {
  display: block;
  margin-top: 7px;
  color: var(--navy-900);
  font-size: 1.55rem;
  font-weight: 850;
  letter-spacing: -.09em;
  line-height: 1;
}

.summary-value small,
.stat-value small,
.metric-value small {
  margin-left: 3px;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: -.04em;
}

.summary-note,
.stat-note,
.metric-note {
  display: block;
  margin-top: 9px;
  color: var(--muted-light);
  font-size: .64rem;
  letter-spacing: -.02em;
}

.summary-accent,
.stat-card.is-accent,
.metric-card.is-accent {
  border-top: 3px solid var(--coral);
}

.summary-accent .summary-value,
.stat-card.is-accent .stat-value,
.metric-card.is-accent .metric-value {
  color: var(--coral-dark);
}

.dashboard-columns,
.dashboard-content-grid,
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.34fr) minmax(280px, .66fr);
  gap: 18px;
  margin-top: 28px;
}

.dashboard-section,
.people-section,
.upcoming-section {
  min-width: 0;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin-top: 13px;
}

.person-card {
  --person-accent: var(--blue);
  position: relative;
  min-width: 0;
  padding: 19px 20px 17px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--person-accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}

.person-card:hover {
  border-color: color-mix(in srgb, var(--person-accent) 32%, var(--line));
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.person-card[data-accent="orange"],
.person-card.accent-orange { --person-accent: var(--coral); }
.person-card[data-accent="mint"],
.person-card.accent-mint { --person-accent: var(--mint); }
.person-card[data-accent="purple"],
.person-card.accent-purple { --person-accent: var(--purple); }
.person-card[data-accent="gold"],
.person-card.accent-gold { --person-accent: var(--gold); }
.person-card[data-accent="slate"],
.person-card.accent-slate { --person-accent: #4d6478; }

.person-card-header,
.person-header,
.person-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.person-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.person-identity .avatar {
  width: 39px;
  height: 39px;
}

.person-name,
.person-identity strong {
  display: block;
  overflow: hidden;
  color: var(--navy-900);
  font-size: .93rem;
  font-weight: 820;
  letter-spacing: -.05em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-subtitle,
.person-identity span,
.person-meta {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: .67rem;
  letter-spacing: -.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge,
.badge,
.tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 8px;
  color: var(--muted);
  background: var(--paper-deep);
  border-radius: 999px;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: -.025em;
  white-space: nowrap;
}

.status-badge::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-active,
.status-badge.active,
.badge-active {
  color: var(--success);
  background: var(--success-soft);
}

.status-upcoming,
.status-badge.upcoming,
.badge-upcoming {
  color: var(--blue);
  background: var(--blue-soft);
}

.status-completed,
.status-badge.completed,
.badge-completed {
  color: var(--muted);
  background: #edf0f2;
}

.status-undecided,
.status-badge.undecided,
.badge-undecided {
  color: var(--gold);
  background: var(--gold-soft);
}

.person-dday,
.dday {
  margin-top: 19px;
  color: var(--navy-900);
  font-size: 1.55rem;
  font-weight: 850;
  letter-spacing: -.1em;
  line-height: 1;
}

.person-dday small,
.dday small {
  margin-left: 5px;
  color: var(--muted);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: -.03em;
}

.person-card .progress-wrap,
.person-progress-wrap {
  margin-top: 17px;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: .64rem;
}

.progress-meta strong {
  color: var(--ink-soft);
  font-size: .68rem;
  font-weight: 800;
}

.progress-track,
.progress-bar,
.progress {
  position: relative;
  height: 7px;
  margin-top: 7px;
  overflow: hidden;
  background: #edf0f1;
  border-radius: 999px;
}

.progress-track > span,
.progress-bar > span,
.progress > span,
.progress-fill {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: var(--person-accent, var(--coral));
  transition: width .45s var(--ease);
}

.person-facts,
.person-fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.person-fact dt,
.person-fact-grid dt {
  color: var(--muted-light);
  font-size: .61rem;
  font-weight: 700;
}

.person-fact dd,
.person-fact-grid dd {
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: .69rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 13px;
}

.person-card-actions .btn {
  min-height: 31px;
}

.person-note {
  margin-top: 11px;
  padding: 8px 10px;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 8px;
  font-size: .66rem;
  line-height: 1.45;
}

.upcoming-list,
.event-list {
  margin-top: 13px;
  padding: 7px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.upcoming-item,
.event-item {
  display: flex;
  min-height: 63px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.upcoming-item:last-child,
.event-item:last-child {
  border-bottom: 0;
}

.event-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 4px var(--coral-soft);
}

.upcoming-item > div,
.event-item > div {
  min-width: 0;
  flex: 1;
}

.upcoming-item strong,
.event-item strong {
  display: block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: .73rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upcoming-item span,
.event-item span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .63rem;
}

.upcoming-item time,
.event-item time {
  color: var(--coral-dark);
  font-size: .66rem;
  font-weight: 800;
  white-space: nowrap;
}

/* Comparison table --------------------------------------------------------- */

.compare-toolbar,
.view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 24px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.filter-control,
.sort-control {
  min-height: 38px;
  padding: 8px 32px 8px 11px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  font-size: .72rem;
  font-weight: 700;
}

.compare-panel,
.compare-table-panel {
  margin-top: 14px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.table-scroll,
.compare-table-wrap {
  overflow-x: auto;
  scrollbar-color: var(--line-strong) transparent;
}

.compare-table,
.data-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  text-align: left;
}

.compare-table th,
.compare-table td,
.data-table th,
.data-table td {
  height: 58px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}

.compare-table th,
.data-table th {
  height: 46px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: -.015em;
}

.compare-table th:first-child,
.compare-table td:first-child,
.data-table th:first-child,
.data-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
}

.compare-table th:first-child,
.data-table th:first-child {
  background: var(--surface-soft);
}

.compare-table tbody tr:last-child td,
.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.compare-table tbody tr:hover td,
.data-table tbody tr:hover td {
  background: #fcfdfb;
}

.compare-table tbody tr:hover td:first-child,
.data-table tbody tr:hover td:first-child {
  background: #fcfdfb;
}

.table-person {
  display: inline-flex;
  min-width: 148px;
  align-items: center;
  gap: 9px;
}

.table-person .avatar {
  width: 29px;
  height: 29px;
  border-radius: 9px;
  font-size: .68rem;
}

.table-person strong {
  display: block;
  color: var(--ink-soft);
  font-size: .74rem;
  font-weight: 800;
}

.table-person span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: .61rem;
}

.table-value {
  color: var(--ink-soft);
  font-size: .72rem;
  font-weight: 750;
}

.table-value.is-highlight,
.difference {
  color: var(--coral-dark);
  font-weight: 850;
}

.compare-insight,
.insight-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding: 16px 18px;
  color: var(--ink-soft);
  background: var(--coral-soft);
  border: 1px solid #f7d8cf;
  border-radius: var(--radius-md);
}

.compare-insight > svg,
.insight-card > svg {
  width: 20px;
  height: 20px;
  color: var(--coral);
}

.compare-insight strong,
.insight-card strong {
  display: block;
  font-size: .76rem;
  font-weight: 820;
}

.compare-insight p,
.insight-card p {
  margin-top: 3px;
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.55;
}

/* Simulation ---------------------------------------------------------------- */

.simulation-layout,
.simulation-grid {
  display: grid;
  grid-template-columns: minmax(265px, .72fr) minmax(0, 1.28fr);
  gap: 18px;
  margin-top: 24px;
}

.simulation-controls,
.simulation-panel,
.simulation-stage {
  min-width: 0;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.simulation-controls h3,
.simulation-panel h3 {
  color: var(--navy-900);
  font-size: .94rem;
  font-weight: 820;
  letter-spacing: -.055em;
}

.simulation-controls > p,
.simulation-panel > p {
  margin-top: 4px;
  color: var(--muted);
  font-size: .69rem;
  line-height: 1.55;
}

.simulation-clock {
  display: grid;
  margin-top: 23px;
  padding: 20px 16px;
  text-align: center;
  background: var(--navy-900);
  border-radius: 14px;
}

.simulation-clock span {
  color: rgb(255 255 255 / 58%);
  font-size: .65rem;
}

.simulation-clock strong {
  margin-top: 3px;
  color: var(--surface);
  font-size: 1.65rem;
  font-weight: 850;
  letter-spacing: -.09em;
  line-height: 1.12;
}

.simulation-clock strong em {
  color: #ff9c7c;
  font-style: normal;
}

.simulation-field {
  margin-top: 19px;
}

.simulation-field label,
.range-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 750;
}

.simulation-field label strong,
.range-label strong {
  color: var(--ink-soft);
  font-size: .72rem;
  font-weight: 850;
}

.simulation-range,
input[type="range"] {
  width: 100%;
  height: 20px;
  margin-top: 10px;
  accent-color: var(--coral);
  cursor: pointer;
}

input[type="range"] {
  appearance: none;
  height: 5px;
  padding: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--coral) 0 var(--range-value, 48%), #e6eaec var(--range-value, 48%) 100%);
}

input[type="range"]::-webkit-slider-thumb {
  width: 17px;
  height: 17px;
  appearance: none;
  background: var(--surface);
  border: 4px solid var(--coral);
  border-radius: 50%;
  box-shadow: 0 1px 5px rgb(15 27 45 / 18%);
}

input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  background: var(--surface);
  border: 4px solid var(--coral);
  border-radius: 50%;
  box-shadow: 0 1px 5px rgb(15 27 45 / 18%);
}

.simulation-presets,
.preset-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 15px;
}

.preset-btn,
.simulation-presets button {
  min-height: 32px;
  padding: 6px 5px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .63rem;
  font-weight: 750;
  transition: color .18s var(--ease), background-color .18s var(--ease), border-color .18s var(--ease);
}

.preset-btn:hover,
.preset-btn.is-active,
.simulation-presets button:hover,
.simulation-presets button.is-active {
  color: var(--coral-dark);
  background: var(--coral-soft);
  border-color: #f0bcae;
}

.simulation-stage {
  display: flex;
  min-height: 440px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent 49.9%, rgb(226 230 233 / 56%) 50%, transparent 50.1%),
    linear-gradient(0deg, transparent 49.9%, rgb(226 230 233 / 56%) 50%, transparent 50.1%),
    var(--surface-soft);
  background-size: 100% 100%, 100% 100%, auto;
}

.simulation-stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.simulation-stage-head h3 {
  font-size: .83rem;
}

.simulation-stage-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: .65rem;
}

.simulation-stage-badge {
  padding: 5px 8px;
  color: var(--mint);
  background: var(--mint-soft);
  border-radius: 7px;
  font-size: .62rem;
  font-weight: 800;
  white-space: nowrap;
}

.simulation-cards,
.simulation-people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  align-items: end;
  margin-top: 25px;
}

.simulation-person,
.sim-person {
  --person-accent: var(--blue);
  padding: 14px;
  background: rgb(255 255 255 / 89%);
  border: 1px solid var(--line);
  border-bottom: 3px solid var(--person-accent);
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
}

.simulation-person .person-name,
.sim-person strong {
  margin-top: 10px;
  font-size: .75rem;
}

.simulation-person .simulation-dday,
.sim-person .sim-dday {
  margin-top: 14px;
  color: var(--navy-900);
  font-size: 1.02rem;
  font-weight: 850;
  letter-spacing: -.07em;
}

.sim-bar,
.simulation-person .progress-track {
  height: 5px;
  margin-top: 11px;
}

.simulation-axis,
.timeline-axis {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding-top: 13px;
  color: var(--muted-light);
  border-top: 1px solid var(--line);
  font-size: .61rem;
}

.timeline {
  position: relative;
  padding: 18px 5px 4px;
}

.timeline::before {
  position: absolute;
  top: 30px;
  right: 5px;
  left: 5px;
  height: 3px;
  border-radius: 99px;
  background: var(--line);
  content: "";
}

.timeline-progress {
  position: absolute;
  top: 30px;
  left: 5px;
  width: var(--progress, 46%);
  height: 3px;
  border-radius: 99px;
  background: var(--coral);
}

.timeline-events {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 7px;
}

.timeline-event {
  display: grid;
  max-width: 92px;
  gap: 8px;
  color: var(--muted);
  font-size: .61rem;
  text-align: center;
}

.timeline-event i {
  display: block;
  width: 13px;
  height: 13px;
  margin-inline: auto;
  background: var(--surface);
  border: 3px solid var(--line-strong);
  border-radius: 50%;
}

.timeline-event.is-done,
.timeline-event.is-current {
  color: var(--ink-soft);
  font-weight: 750;
}

.timeline-event.is-done i {
  background: var(--coral);
  border-color: var(--coral);
}

.timeline-event.is-current i {
  border-color: var(--coral);
  box-shadow: 0 0 0 5px var(--coral-soft);
}

/* People management -------------------------------------------------------- */

.people-table-panel,
.management-panel {
  margin-top: 24px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.management-card {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.management-card:last-child {
  border-bottom: 0;
}

.management-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(100px, .75fr) minmax(130px, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.management-row + .management-row {
  margin-top: 14px;
}

.management-row > * {
  min-width: 0;
}

.management-row .row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.management-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted-light);
  font-size: .61rem;
  font-weight: 750;
}

.management-value {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: .73rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Settings and security ---------------------------------------------------- */

.settings-grid,
.security-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.13fr) minmax(280px, .87fr);
  gap: 18px;
  margin-top: 24px;
}

.settings-card,
.security-card,
.source-card {
  min-width: 0;
  padding: 23px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.settings-card + .settings-card,
.security-card + .security-card {
  margin-top: 14px;
}

.settings-card h3,
.security-card h3,
.source-card h3 {
  color: var(--navy-900);
  font-size: .94rem;
  font-weight: 820;
  letter-spacing: -.055em;
}

.settings-card > p,
.security-card > p,
.source-card > p {
  margin-top: 5px;
  color: var(--muted);
  font-size: .69rem;
  line-height: 1.6;
}

.security-state {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 13px;
  background: var(--mint-soft);
  border-radius: 11px;
}

.security-state > svg {
  width: 23px;
  height: 23px;
  color: var(--mint);
}

.security-state strong,
.security-state span {
  display: block;
}

.security-state strong {
  color: #196c5c;
  font-size: .74rem;
  font-weight: 820;
}

.security-state span {
  margin-top: 2px;
  color: #558e82;
  font-size: .64rem;
}

.security-actions,
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 17px;
}

.source-list {
  margin-top: 17px;
  border-top: 1px solid var(--line);
}

.source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.source-item:last-child {
  border-bottom: 0;
}

.source-item strong,
.source-item span {
  display: block;
}

.source-item strong {
  color: var(--ink-soft);
  font-size: .7rem;
  font-weight: 800;
}

.source-item span {
  margin-top: 2px;
  color: var(--muted);
  font-size: .62rem;
}

.source-item a,
.source-link {
  display: inline-flex;
  align-items: center;
  color: var(--blue);
  font-size: .64rem;
  font-weight: 800;
  white-space: nowrap;
}

.source-item a:hover,
.source-link:hover {
  color: var(--coral-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.source-item a svg,
.source-link svg {
  width: 13px;
  height: 13px;
  margin-left: 3px;
}

/* Form controls ------------------------------------------------------------ */

.field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.field > span,
.field > label,
.field legend {
  color: var(--ink-soft);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

.field > span em,
.field legend em {
  margin-left: 4px;
  color: var(--muted-light);
  font-size: .62rem;
  font-style: normal;
  font-weight: 650;
}

.field input,
.field select,
.field textarea,
.form-control,
.settings-input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: 0;
  font-size: .77rem;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background-color .18s var(--ease);
}

.field textarea {
  min-height: 100px;
  resize: vertical;
}

.field select {
  appearance: none;
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 18px, calc(100% - 10px) 18px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #a3aeb9;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #aeb9c3;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.form-control:focus,
.settings-input:focus {
  background: var(--surface);
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgb(232 107 78 / 13%);
}

.field small,
.form-hint {
  color: var(--muted-light);
  font-size: .62rem;
  line-height: 1.45;
}

.password-wrap {
  position: relative;
  display: block;
}

.password-wrap input {
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border-radius: 8px;
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: var(--ink-soft);
  background: var(--paper-deep);
}

.password-toggle svg {
  width: 16px;
  height: 16px;
}

.form-error {
  min-height: 1.3em;
  margin-top: 9px;
  color: var(--danger);
  font-size: .68rem;
  font-weight: 700;
}

.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea,
input[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgb(189 61 66 / 10%);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 13px;
  margin-top: 22px;
}

.field-wide {
  grid-column: 1 / -1;
}

.accent-field {
  min-width: 0;
  padding: 0;
  border: 0;
}

.accent-field legend {
  padding: 0;
  margin-bottom: 8px;
}

.accent-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.accent-option {
  position: relative;
  display: inline-grid;
  width: 31px;
  height: 31px;
  place-items: center;
  color: transparent;
  background: var(--option-color, var(--blue));
  border: 3px solid var(--surface);
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--line-strong);
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}

.accent-option:hover {
  transform: translateY(-2px);
}

.accent-option.is-selected,
.accent-option[aria-checked="true"] {
  box-shadow: 0 0 0 2px var(--navy-900), 0 0 0 4px var(--surface);
}

.accent-option svg {
  width: 14px;
  height: 14px;
  color: var(--surface);
  stroke-width: 3;
}

.advanced-fields {
  margin-top: 22px;
  padding: 0 14px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.advanced-fields summary {
  display: flex;
  min-height: 47px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: .71rem;
  font-weight: 800;
  list-style: none;
}

.advanced-fields summary::-webkit-details-marker {
  display: none;
}

.advanced-fields summary > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.advanced-fields summary svg {
  width: 15px;
  height: 15px;
  color: var(--coral);
}

.advanced-fields summary small {
  color: var(--muted-light);
  font-size: .62rem;
  font-weight: 700;
}

.advanced-fields summary::after {
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  content: "";
  transform: rotate(45deg) translateY(-2px);
  transition: transform .18s var(--ease);
}

.advanced-fields[open] summary::after {
  transform: rotate(225deg) translate(-2px, -1px);
}

.advanced-fields > p {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: .65rem;
}

.promotion-grid {
  margin-top: 0;
}

/* Dialogs ------------------------------------------------------------------ */

dialog.modal {
  width: min(calc(100% - 30px), 450px);
  max-height: min(90svh, 780px);
  padding: 29px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid rgb(226 230 233 / 90%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: auto;
}

dialog.modal::backdrop {
  background: rgb(13 22 37 / 52%);
  backdrop-filter: blur(5px);
}

dialog.modal-sm {
  width: min(calc(100% - 30px), 420px);
}

dialog.modal-lg {
  width: min(calc(100% - 30px), 680px);
}

dialog.modal-detail {
  width: min(calc(100% - 30px), 720px);
}

dialog.modal[open] {
  animation: dialog-enter .2s var(--ease) both;
}

@keyframes dialog-enter {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal > form {
  position: relative;
}

.modal-close {
  position: absolute;
  z-index: 1;
  top: -10px;
  right: -10px;
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  color: var(--muted);
  background: var(--paper-deep);
  border-radius: 9px;
  transition: color .18s var(--ease), background-color .18s var(--ease);
}

.modal-close:hover {
  color: var(--navy-900);
  background: var(--line);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--coral);
  background: var(--coral-soft);
  border-radius: 14px;
}

.modal-icon svg {
  width: 22px;
  height: 22px;
}

.modal-icon-warn {
  color: var(--gold);
  background: var(--gold-soft);
}

.modal-eyebrow {
  margin-top: 19px;
  color: var(--coral-dark);
  font-size: .69rem;
  font-weight: 850;
  letter-spacing: .01em;
}

.modal h2 {
  margin-top: 5px;
  color: var(--navy-900);
  font-size: 1.35rem;
  font-weight: 830;
  letter-spacing: -.075em;
  line-height: 1.3;
}

.modal-description {
  margin-top: 7px;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.6;
}

.modal .field:first-of-type {
  margin-top: 22px;
}

.modal .field + .field {
  margin-top: 15px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 18px;
}

.modal-actions .btn {
  min-width: 78px;
}

/* Toasts ------------------------------------------------------------------- */

.toast-region {
  position: fixed;
  z-index: 20;
  right: 22px;
  bottom: 22px;
  display: grid;
  width: min(360px, calc(100% - 30px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  min-height: 49px;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  color: var(--surface);
  background: var(--navy-900);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 11px;
  box-shadow: var(--shadow-md);
  font-size: .72rem;
  font-weight: 700;
  pointer-events: auto;
  animation: toast-enter .25s var(--ease) both;
}

.toast svg {
  width: 17px;
  height: 17px;
  color: #8ce2c9;
}

.toast.is-error,
.toast.error {
  background: #592a32;
}

.toast.is-error svg,
.toast.error svg {
  color: #ff9b98;
}

@keyframes toast-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* patch probe */
/* Responsive --------------------------------------------------------------- */

@media (max-width: 1120px) {
  .landing-main {
    grid-template-columns: minmax(0, .93fr) minmax(390px, 1.07fr);
    gap: 36px;
  }

  .landing-copy h1 {
    font-size: clamp(2.6rem, 5.3vw, 4.2rem);
  }

  .preview-person-a {
    left: -4%;
  }

  .preview-person-b {
    right: -5%;
  }

  .dashboard-columns,
  .dashboard-content-grid,
  .overview-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .upcoming-list,
  .event-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
  }

  .upcoming-item:nth-last-child(-n + 2),
  .event-item:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .upcoming-item:nth-child(odd),
  .event-item:nth-child(odd) {
    padding-right: 14px;
    border-right: 1px solid var(--line);
  }

  .settings-grid,
  .security-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 218px;
  }

  .landing-main {
    grid-template-columns: minmax(0, 1fr) minmax(330px, .95fr);
  }

  .landing-visual {
    min-height: 450px;
  }

  .landing-visual::before {
    width: min(44vw, 460px);
    height: min(44vw, 460px);
  }

  .landing-visual::after {
    width: min(54vw, 560px);
    height: min(54vw, 560px);
  }

  .preview-main {
    width: min(100%, 340px);
    padding: 21px 22px 19px;
  }

  .preview-top strong {
    font-size: 1.8rem;
  }

  .preview-person {
    min-width: 170px;
  }

  .preview-date {
    right: -3%;
  }

  .simulation-layout,
  .simulation-grid {
    grid-template-columns: minmax(235px, .68fr) minmax(0, 1.32fr);
  }
}

@media (max-width: 720px) {
  .landing-header,
  .landing-main {
    width: min(100% - 36px, 570px);
  }

  .landing-header {
    min-height: 73px;
  }

  .landing-security {
    font-size: .64rem;
  }

  .landing-main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 22px;
    padding: 44px 0 50px;
  }

  .landing-copy {
    max-width: none;
  }

  .landing-copy h1 {
    max-width: 500px;
    font-size: clamp(2.5rem, 11vw, 4rem);
  }

  .landing-lead {
    max-width: 520px;
    margin-top: 19px;
    font-size: .9rem;
  }

  .landing-actions {
    width: 100%;
  }

  .landing-actions .btn {
    flex: 1 1 200px;
  }

  .landing-visual {
    min-height: 410px;
    margin-top: 6px;
  }

  .landing-visual::before {
    width: min(92vw, 440px);
    height: min(92vw, 440px);
  }

  .landing-visual::after {
    width: min(106vw, 530px);
    height: min(106vw, 530px);
  }

  .orbit-a {
    width: min(98vw, 510px);
    height: min(98vw, 510px);
  }

  .orbit-b {
    width: min(76vw, 390px);
    height: min(76vw, 390px);
  }

  .preview-main {
    width: min(calc(100% - 74px), 360px);
  }

  .preview-person-a {
    top: 11%;
    left: 0;
  }

  .preview-person-b {
    right: 0;
    bottom: 10%;
  }

  .preview-date {
    top: 7%;
    right: 1%;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .workspace {
    min-height: 100svh;
    padding-bottom: 74px;
  }

  .topbar {
    min-height: 70px;
    padding: 14px 18px;
  }

  .topbar-kicker {
    font-size: .62rem;
  }

  .topbar h2 {
    font-size: 1.1rem;
  }

  .topbar-actions {
    gap: 0;
  }

  .topbar-actions .btn {
    min-height: 37px;
    padding-inline: 9px;
    font-size: .72rem;
  }

  .topbar-actions .btn svg {
    width: 15px;
    height: 15px;
  }

  .view-root {
    padding: 27px 18px 55px;
  }

  .mobile-nav {
    position: fixed;
    z-index: 10;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 63px;
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
    background: rgb(255 255 255 / 95%);
    border-top: 1px solid var(--line);
    box-shadow: 0 -7px 24px rgb(15 27 45 / 7%);
    backdrop-filter: blur(14px);
  }

  .mobile-nav button {
    display: grid;
    min-width: 0;
    min-height: 50px;
    place-items: center;
    align-content: center;
    gap: 2px;
    color: var(--muted-light);
    background: transparent;
    border-radius: 10px;
    font-size: .58rem;
    font-weight: 800;
  }

  .mobile-nav button svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.8;
  }

  .mobile-nav button.is-active {
    color: var(--coral-dark);
    background: var(--coral-soft);
  }

  .mobile-nav button:active {
    background: var(--paper-deep);
  }

  .dashboard-hero,
  .dashboard-banner {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 24px 22px;
  }

  .dashboard-hero h1,
  .dashboard-banner h1 {
    font-size: 1.48rem;
  }

  .hero-number,
  .dashboard-banner .hero-number {
    width: max-content;
    min-width: 160px;
    padding: 13px 15px;
    text-align: left;
  }

  .dashboard-summary,
  .stats-grid,
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 12px;
  }

  .summary-card,
  .stat-card,
  .metric-card {
    min-height: 106px;
    padding: 15px 14px;
  }

  .summary-value,
  .stat-value,
  .metric-value {
    font-size: 1.3rem;
  }

  .dashboard-columns,
  .dashboard-content-grid,
  .overview-grid,
  .simulation-layout,
  .simulation-grid,
  .settings-grid,
  .security-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

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

  .upcoming-list,
  .event-list {
    display: block;
  }

  .upcoming-item:nth-child(odd),
  .event-item:nth-child(odd) {
    padding-right: 0;
    border-right: 0;
  }

  .upcoming-item:nth-last-child(-n + 2),
  .event-item:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .upcoming-item:last-child,
  .event-item:last-child {
    border-bottom: 0;
  }

  .view-heading,
  .section-heading,
  .compare-toolbar,
  .view-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .compare-toolbar,
  .view-toolbar {
    gap: 10px;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions .btn,
  .toolbar-actions select {
    flex: 1;
  }

  .simulation-stage {
    min-height: 385px;
    padding: 18px;
  }

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

  .management-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
  }

  .management-row .management-service,
  .management-row .management-dates {
    grid-column: 1;
  }

  .management-row .row-actions {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

@media (max-width: 480px) {
  .landing-header,
  .landing-main {
    width: min(100% - 28px, 570px);
  }

  .landing-security {
    max-width: 28px;
    overflow: hidden;
    white-space: nowrap;
  }

  .landing-copy h1 {
    font-size: 2.48rem;
  }

  .landing-copy h1 em {
    white-space: normal;
  }

  .landing-actions .btn {
    width: 100%;
    flex-basis: 100%;
  }

  .landing-visual {
    min-height: 345px;
  }

  .preview-main {
    width: calc(100% - 38px);
    padding: 18px 17px 16px;
  }

  .preview-top strong {
    font-size: 1.5rem;
  }

  .preview-person {
    min-width: 137px;
    padding: 9px;
    gap: 7px;
  }

  .preview-person .avatar {
    width: 29px;
    height: 29px;
    border-radius: 9px;
    font-size: .69rem;
  }

  .preview-person strong {
    font-size: .67rem;
  }

  .preview-person div > span {
    font-size: .54rem;
  }

  .preview-person b {
    font-size: .64rem;
  }

  .preview-date {
    right: -6px;
    padding: 8px 9px;
  }

  .preview-date > svg {
    width: 22px;
    height: 22px;
    padding: 5px;
  }

  .preview-date span {
    font-size: .52rem;
  }

  .preview-date strong {
    font-size: .58rem;
  }

  .view-root {
    padding-inline: 14px;
  }

  .view-heading h1 {
    font-size: 1.55rem;
  }

  .dashboard-hero,
  .dashboard-banner {
    padding: 21px 18px;
  }

  .person-card,
  .simulation-controls,
  .simulation-panel,
  .simulation-stage,
  .settings-card,
  .security-card,
  .source-card {
    padding-right: 16px;
    padding-left: 16px;
  }

  .simulation-cards,
  .simulation-people {
    grid-template-columns: 1fr;
  }

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

  .field-wide {
    grid-column: auto;
  }

  dialog.modal,
  dialog.modal-sm,
  dialog.modal-lg,
  dialog.modal-detail {
    width: calc(100% - 20px);
    padding: 22px 18px;
    border-radius: 18px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions .btn {
    width: 100%;
  }

  .toast-region {
    right: 14px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    left: 14px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Actual controller markup ------------------------------------------------ */

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 30px;
}

.summary-grid .summary-card { min-height: 128px; }
.summary-grid .summary-card > span,
.summary-grid .summary-card > strong,
.summary-grid .summary-card > small { display: block; position: relative; z-index: 1; }
.summary-grid .summary-card > span { color: var(--muted); font-size: .69rem; font-weight: 750; }
.summary-grid .summary-card > strong { margin-top: 11px; color: var(--navy-900); font-size: 1.65rem; font-weight: 850; letter-spacing: -.08em; line-height: 1; }
.summary-grid .summary-card > strong small { margin-left: 3px; color: var(--muted); font-size: .72rem; letter-spacing: 0; }
.summary-grid .summary-card > small { margin-top: 10px; overflow: hidden; color: var(--muted-light); font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }

.person-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin-top: 13px;
}

.person-grid > .empty-state,
.simulation-grid > .empty-state { grid-column: 1 / -1; }
.person-grid .person-card { border-top-color: var(--accent, var(--blue)); }
.person-card-main { display: grid; width: 100%; grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 0; color: inherit; background: transparent; text-align: left; }
.person-card-copy { display: block; min-width: 0; }
.person-card-copy strong,
.person-card-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-card-copy strong { color: var(--navy-900); font-size: .9rem; font-weight: 820; letter-spacing: -.045em; }
.person-card-copy small { margin-top: 2px; color: var(--muted); font-size: .66rem; }
.person-card-dday { color: var(--navy-900); font-size: 1.03rem; font-weight: 850; letter-spacing: -.065em; white-space: nowrap; }
.person-grid .person-card .progress-track { margin-top: 19px; }
.person-grid .person-card .progress-track > span { background: var(--accent, var(--blue)); }
.person-card-stats { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; color: var(--muted); font-size: .64rem; }
.person-card-stats > span:first-child { color: var(--accent, var(--blue)); font-variant-numeric: tabular-nums; font-weight: 820; }

.text-button { padding: 2px; color: var(--blue); background: transparent; font-size: .72rem; font-weight: 800; }
.text-button:hover { color: var(--coral-dark); text-decoration: underline; text-underline-offset: 3px; }
.control-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, 280px); gap: 28px; align-items: end; padding: 26px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.control-card h3 { color: var(--navy-900); font-size: 1.35rem; font-weight: 830; letter-spacing: -.065em; }
.control-card p:not(.eyebrow) { margin-top: 6px; color: var(--muted); font-size: .74rem; }
.field.compact { margin: 0; }

.table-wrap { margin-top: 20px; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }
.table-wrap table { width: 100%; min-width: 850px; border-collapse: collapse; font-size: .7rem; white-space: nowrap; }
.table-wrap th,
.table-wrap td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; }
.table-wrap th { color: var(--muted); background: var(--surface-soft); font-size: .62rem; font-weight: 800; }
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap tbody tr:hover td { background: #fcfcfa; }
.status-chip { display: inline-flex; min-height: 25px; align-items: center; padding: 4px 9px; color: var(--muted); background: var(--paper-deep); border-radius: 999px; font-size: .61rem; font-weight: 800; }
.status-chip.status-active { color: var(--success); background: var(--success-soft); }
.status-chip.status-upcoming { color: var(--blue); background: var(--blue-soft); }
.status-chip.status-completed { color: var(--muted); background: #edf0f2; }
.status-chip.status-undecided { color: var(--gold); background: var(--gold-soft); }

.simulation-view .simulation-stage { min-height: 340px; align-items: center; justify-content: center; padding: 40px 24px; color: var(--surface); background: radial-gradient(circle at 30% 22%, rgb(66 115 230 / 28%), transparent 18rem), radial-gradient(circle at 78% 72%, rgb(232 107 78 / 25%), transparent 17rem), var(--navy-900); border: 1px solid var(--navy-700); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); text-align: center; }
.simulation-view .simulation-stage .eyebrow { color: #ffb29b; }
.simulation-date,
.simulation-time { display: block; font-variant-numeric: tabular-nums; }
.simulation-date { margin-top: 12px; color: var(--surface); font-size: clamp(2.15rem, 6vw, 4rem); font-weight: 850; letter-spacing: -.095em; line-height: 1; }
.simulation-time { margin-top: 9px; color: rgb(255 255 255 / 64%); font-size: 1rem; font-weight: 750; }
.simulation-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 27px; }
.simulation-view .simulation-actions .btn-secondary { color: var(--surface); background: rgb(255 255 255 / 8%); border-color: rgb(255 255 255 / 18%); }
.speed-control { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 17px 0; padding: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.speed-control > span { margin-right: 5px; color: var(--muted); font-size: .67rem; font-weight: 750; }
.speed-control button { min-height: 31px; padding: 5px 10px; color: var(--muted); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; font-size: .65rem; font-weight: 800; }
.speed-control button:hover,
.speed-control button.is-active { color: var(--coral-dark); background: var(--coral-soft); border-color: #efb6a6; }
.simulation-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.simulation-grid .simulation-person { border-bottom-color: var(--accent, var(--blue)); }
.simulation-person > div:first-child { display: grid; gap: 2px; }
.simulation-person > div:first-child strong,
.simulation-person > div:first-child span,
.simulation-person > small { display: block; }
.simulation-person > div:first-child strong { color: var(--navy-900); font-size: .78rem; }
.simulation-person > div:first-child span,
.simulation-person > small { color: var(--muted); font-size: .62rem; }
.simulation-person > b { display: block; margin-top: 16px; color: var(--accent, var(--blue)); font-size: 1.16rem; font-variant-numeric: tabular-nums; }
.simulation-person > small { margin-top: 7px; }

.people-list { display: grid; gap: 10px; margin-top: 17px; }
.person-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 13px; align-items: center; padding: 17px 19px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-xs); }
.person-row > div:nth-child(2) { min-width: 0; }
.person-row > div:nth-child(2) strong,
.person-row > div:nth-child(2) span,
.person-row > div:nth-child(2) small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-row > div:nth-child(2) strong { color: var(--navy-900); font-size: .79rem; font-weight: 820; }
.person-row > div:nth-child(2) span { margin-top: 2px; color: var(--muted); font-size: .65rem; }
.person-row > div:nth-child(2) small { margin-top: 3px; color: var(--muted-light); font-size: .61rem; }
.row-actions { display: flex; gap: 5px; }
.icon-button { display: grid; width: 34px; height: 34px; place-items: center; color: var(--muted); background: var(--paper); border: 1px solid var(--line); border-radius: 9px; }
.icon-button:hover { color: var(--blue); background: var(--blue-soft); border-color: #b9c9f4; }
.icon-button.danger:hover { color: var(--danger); background: var(--danger-soft); border-color: #efc4c6; }
.icon-button svg { width: 15px; height: 15px; }

.settings-view .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-view .settings-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-content: start; margin-top: 0; }
.settings-icon { display: grid; width: 39px; height: 39px; place-items: center; color: var(--coral-dark); background: var(--coral-soft); border-radius: 11px; }
.settings-card > .settings-actions,
.settings-card > .btn { grid-column: 1 / -1; }
.settings-card > div:nth-child(2) p { margin-top: 5px; color: var(--muted); font-size: .68rem; }
.sources { margin-top: 18px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }
.sources > h3 { color: var(--navy-900); font-size: 1rem; font-weight: 820; }
.sources > p:not(.eyebrow) { margin-top: 5px; color: var(--muted); font-size: .69rem; }
.sources .source-list a { display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.sources .source-list a:last-child { border-bottom: 0; }
.sources .source-list a strong,
.sources .source-list a small { display: block; }
.sources .source-list a strong { color: var(--ink-soft); font-size: .7rem; font-weight: 800; }
.sources .source-list a small { margin-top: 2px; color: var(--muted); font-size: .62rem; }
.sources .source-list a:hover strong { color: var(--blue); }
.sources .source-list a > svg { width: 14px; height: 14px; color: var(--blue); }

.detail-hero { padding: 22px; background: var(--accent-soft, var(--blue-soft)); border-radius: 15px; text-align: center; }
.detail-hero .avatar { width: 52px; height: 52px; margin-inline: auto; color: var(--surface); background: var(--accent, var(--blue)); }
.detail-hero .eyebrow { margin-top: 11px; color: var(--accent, var(--blue)); }
.detail-hero h2 { margin: 3px 0 9px; color: var(--navy-900); font-size: 1.45rem; letter-spacing: -.07em; }
.detail-progress { margin-top: 19px; padding: 17px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; }
.detail-progress > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.detail-progress > div:first-child span { color: var(--muted); font-size: .67rem; font-weight: 750; }
.detail-progress > div:first-child strong { color: var(--accent, var(--blue)); font-size: 1.14rem; font-variant-numeric: tabular-nums; }
.detail-progress .progress-track > span { background: var(--accent, var(--blue)); }
.detail-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.detail-stats > div { padding: 13px; background: var(--paper); border-radius: 10px; }
.detail-stats dt { color: var(--muted); font-size: .61rem; font-weight: 750; }
.detail-stats dd { margin-top: 4px; color: var(--navy-900); font-size: .76rem; font-weight: 820; }
.detail-stats dd small { display: block; margin-top: 2px; color: var(--muted); font-size: .58rem; font-weight: 650; }
#detail-content .timeline { margin-top: 18px; padding: 0; }
#detail-content .timeline::before { content: none; }
#detail-content .timeline h3 { color: var(--navy-900); font-size: .82rem; font-weight: 820; }
#detail-content .timeline ol { position: relative; margin-top: 12px; padding-left: 20px; }
#detail-content .timeline ol::before { position: absolute; top: 8px; bottom: 8px; left: 5px; width: 2px; background: var(--line); content: ""; }
#detail-content .timeline li { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 46px; padding: 7px 0 7px 9px; }
#detail-content .timeline li > i { position: absolute; left: -19px; width: 10px; height: 10px; background: var(--surface); border: 3px solid var(--line-strong); border-radius: 50%; }
#detail-content .timeline li.is-reached > i { background: var(--accent, var(--blue)); border-color: var(--accent, var(--blue)); }
#detail-content .timeline li strong,
#detail-content .timeline li span { display: block; }
#detail-content .timeline li strong { color: var(--ink-soft); font-size: .68rem; font-weight: 800; }
#detail-content .timeline li span { margin-top: 2px; color: var(--muted); font-size: .6rem; }
.detail-note { display: flex; gap: 8px; margin-top: 15px; padding: 11px 12px; color: var(--muted); background: var(--gold-soft); border-radius: 9px; font-size: .66rem; }
.detail-note svg { width: 15px; height: 15px; color: var(--gold); }
.toast-error { background: #592a32; }

@media (max-width: 720px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .summary-grid .summary-card:last-child { grid-column: 1 / -1; }
  .person-grid { grid-template-columns: 1fr; }
  .control-card { grid-template-columns: 1fr; gap: 17px; padding: 21px 19px; }
  .settings-view .settings-grid { grid-template-columns: 1fr; }
  .simulation-view .simulation-stage { min-height: 310px; padding: 32px 17px; }
}

@media (max-width: 480px) {
  .summary-grid { grid-template-columns: 1fr; }
  .summary-grid .summary-card:last-child { grid-column: auto; }
  .person-card-main { grid-template-columns: auto minmax(0, 1fr); }
  .person-card-dday { grid-column: 2; font-size: .88rem; }
  .speed-control > span { width: 100%; margin: 0 0 3px; text-align: center; }
  .person-row { padding: 14px; }
  .person-row > .avatar { display: none; }
  .detail-stats { grid-template-columns: 1fr; }
}
