:root {
  --ink: #2b2b2b;
  --ink-strong: #111111;
  --ink-soft: #646464;
  --ink-faint: #929292;
  --paper: #f6f5f2;
  --surface: #ffffff;
  --surface-soft: #fbfaf8;
  --line: #e8e2df;
  --line-strong: #dcd3cf;
  --wine: #8d3048;
  --wine-dark: #672035;
  --wine-soft: #f7e9ed;
  --rose: #e5bac5;
  --sand: #eee4d7;
  --green: #267057;
  --green-bg: #e7f4ed;
  --blue: #416b86;
  --blue-bg: #eaf2f7;
  --amber: #91631f;
  --amber-bg: #fbf1dc;
  --red: #a33c47;
  --red-bg: #fbeaec;
  --shadow-sm: 0 1px 2px rgba(44, 31, 35, .04), 0 4px 14px rgba(44, 31, 35, .035);
  --shadow-md: 0 16px 40px rgba(58, 38, 45, .075);
  --shadow-lg: 0 24px 70px rgba(64, 35, 45, .13);
  --sidebar: 264px;
  --content-gutter: clamp(24px, 3vw, 48px);
  --font-sans: "Helvetica Neue", Helvetica, Arial, ui-sans-serif, sans-serif;
  --font-display: "Helvetica Neue", Helvetica, Arial, ui-sans-serif, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 88% 0, rgba(141, 48, 72, .035), transparent 25rem),
    var(--paper);
}

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

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(141, 48, 72, .18);
  outline-offset: 2px;
}

::selection {
  color: var(--wine-dark);
  background: #f1d7de;
}

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

/* Navigation */
.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  padding: 24px 18px 20px;
  border-right: 1px solid var(--line);
  color: var(--ink-strong);
  background: rgba(255, 255, 255, .97);
  box-shadow: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 4px 8px 34px;
}

.brand-mark {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #292929;
  border-radius: 50%;
  color: #111;
  font: 500 15px/1 var(--font-display);
  letter-spacing: -.04em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .055em;
  line-height: 1.25;
}

.brand small {
  margin-top: 4px;
  color: #8b8b8b;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .13em;
  text-transform: uppercase;
}

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

.main-nav a {
  position: relative;
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #666;
  font-size: 14px;
  font-weight: 600;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}

.main-nav a:hover {
  color: #111;
  background: #f6f4f1;
  transform: translateX(2px);
}

.main-nav a.active {
  border-color: #e9e4e1;
  color: #111;
  background: #f2efec;
  box-shadow: none;
}

.nav-icon {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #777;
  font-size: 17px;
}

.nav-pulse {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--wine);
  box-shadow: 0 0 0 5px rgba(141, 48, 72, .08);
}

.sidebar-bottom {
  margin-top: auto;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 10px 18px;
  color: #858585;
  font-size: 11px;
  font-weight: 600;
}

.live-indicator i,
.live-pill i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #9a8780;
}

.live-indicator.connected {
  color: #9bd5bb;
}

.live-indicator.connected i,
.live-pill i {
  background: #55c58c;
  box-shadow: 0 0 0 4px rgba(85, 197, 140, .12);
  animation: breathe 2.2s infinite;
}

.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 17px 8px 0;
  border-top: 1px solid var(--line);
}

.avatar {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--wine-dark);
  background: linear-gradient(145deg, #f5ede2, #e9dcca);
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
  text-align: center;
  letter-spacing: .05em;
  box-shadow: inset 0 0 0 1px rgba(103, 32, 53, .06);
}

.avatar-small {
  width: 34px;
  height: 34px;
  font-size: 9px;
}

.profile-copy {
  min-width: 0;
  flex: 1;
}

.profile-copy strong,
.profile-copy small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.profile-copy strong {
  font-size: 12px;
}

.profile-copy small {
  margin-top: 3px;
  color: #888;
  font-size: 10px;
}

.icon-button {
  padding: 8px;
  border: 0;
  border-radius: 8px;
  color: #777;
  background: transparent;
  cursor: pointer;
  transition: .18s ease;
}

.icon-button:hover {
  color: #111;
  background: #f2efec;
}

/* Page shell */
.main {
  min-width: 0;
  grid-column: 2;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px var(--content-gutter);
  border-bottom: 1px solid rgba(220, 211, 207, .75);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(18px);
}

.topbar h1 {
  margin: 4px 0 0;
  color: var(--ink-strong);
  font: 400 clamp(24px, 2vw, 30px)/1.1 var(--font-display);
  letter-spacing: -.03em;
}

.eyebrow {
  margin: 0;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
}

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

.date-chip {
  padding-left: 18px;
  border-left: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.content {
  padding: 34px var(--content-gutter) 52px;
}

.workspace-dashboard {
  position: relative;
}

.workspace-dashboard.is-loading {
  cursor: progress;
}

.workspace-loading-layer {
  position: absolute;
  z-index: 15;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 420px;
  padding: 30px 2px;
  border-radius: 18px;
  background: rgba(246, 245, 242, .97);
  backdrop-filter: blur(2px);
}

.workspace-skeleton-heading {
  display: grid;
  width: min(420px, 70%);
  gap: 12px;
  margin-bottom: 22px;
}

.skeleton-line,
.workspace-skeleton-card {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(220, 211, 207, .65);
  background:
    linear-gradient(
      105deg,
      rgba(255, 255, 255, 0) 35%,
      rgba(255, 255, 255, .9) 48%,
      rgba(255, 255, 255, 0) 62%
    ),
    #e9e5e1;
  background-size: 240% 100%;
  animation: workspace-skeleton 1.15s ease-in-out infinite;
}

.skeleton-line {
  height: 11px;
  border-radius: 999px;
}

.skeleton-line-short {
  width: 34%;
}

.skeleton-line-title {
  width: 76%;
  height: 27px;
}

.workspace-skeleton-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.workspace-skeleton-card {
  height: 130px;
  border-radius: 14px;
}

.mobile-menu {
  display: none;
  padding: 7px;
  border: 0;
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
  font-size: 22px;
}

.back-link {
  color: var(--wine);
  transition: color .18s ease;
}

.back-link:hover {
  color: var(--wine-dark);
}

/* Actions and common components */
.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, #96364f, var(--wine));
  box-shadow: 0 8px 22px rgba(141, 48, 72, .2);
}

.button-primary:hover {
  background: var(--wine-dark);
  box-shadow: 0 12px 28px rgba(103, 32, 53, .24);
}

.button-secondary {
  border-color: var(--line-strong);
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.button-secondary:hover {
  border-color: #c9b9b8;
  background: var(--surface-soft);
}

.button-dark {
  color: #fff;
  background: var(--ink-strong);
  box-shadow: 0 8px 20px rgba(23, 19, 21, .18);
}

.button-large {
  min-height: 48px;
  padding: 13px 20px;
}

.button-full {
  width: 100%;
}

.muted-copy {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.status {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .065em;
  line-height: 1;
  text-transform: uppercase;
}

.status-positive {
  color: var(--green);
  background: var(--green-bg);
}

.status-warning {
  color: var(--amber);
  background: var(--amber-bg);
}

.status-danger {
  color: var(--red);
  background: var(--red-bg);
}

.status-accent {
  color: var(--wine);
  background: var(--wine-soft);
}

.status-muted {
  color: #756c6f;
  background: #f0ece9;
}

/* Dashboard */
.hero {
  position: relative;
  display: flex;
  min-height: 224px;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(32px, 4vw, 52px);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-strong);
  background:
    linear-gradient(120deg, rgba(239, 235, 229, .92), rgba(255, 255, 255, .98)),
    #fff;
  box-shadow: var(--shadow-sm);
}

.hero::after {
  position: absolute;
  top: -155px;
  right: -65px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  box-shadow:
    0 0 0 50px rgba(255, 255, 255, .025),
    0 0 0 100px rgba(255, 255, 255, .016);
  display: none;
  content: "";
}

.hero > div:first-child {
  position: relative;
  z-index: 1;
}

.hero h2 {
  max-width: 760px;
  margin: 14px 0 14px;
  font: 400 clamp(30px, 3.1vw, 46px)/1.1 var(--font-display);
  letter-spacing: -.045em;
  color: #111;
}

.hero p {
  max-width: 650px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  color: #f5e7ea;
  background: rgba(255, 255, 255, .05);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero-orbit {
  position: relative;
  z-index: 1;
  display: grid;
  width: 155px;
  height: 155px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
}

.hero-orbit::before {
  position: absolute;
  inset: 15px;
  border: 1px dashed rgba(255, 255, 255, .18);
  border-radius: 50%;
  content: "";
}

.orbit-main {
  margin-top: -24px;
  font-size: 36px;
}

.hero-orbit small {
  position: absolute;
  bottom: 27px;
  color: #ead3d9;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-align: center;
  text-transform: uppercase;
}

.orbit-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
}

.orbit-a {
  top: 22px;
  left: 29px;
}

.orbit-b {
  right: 15px;
  bottom: 49px;
  background: #e1aeb9;
}

.week-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #555;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.week-heading i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--wine);
}

.week-hero h2 {
  margin-bottom: 0;
}

.week-context {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(300px, 28%);
  min-height: 145px;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: center;
  padding: 24px 0 24px 34px;
  border-left: 1px solid #d9d4cf;
}

.week-context small,
.week-context strong,
.week-context span,
.week-context em {
  display: block;
}

.week-context small {
  color: #777;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.week-context strong {
  margin-top: 10px;
  color: #111;
  font-size: 25px;
  font-weight: 450;
  letter-spacing: -.03em;
}

.week-context span {
  margin-top: 5px;
  color: #555;
  font-size: 12px;
}

.week-context em {
  margin-top: 14px;
  color: var(--wine);
  font-size: 10px;
  font-style: normal;
  font-weight: 650;
}

.data-browser {
  margin-top: 28px;
  padding: 26px 28px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.data-browser-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 34px;
}

.data-browser-title {
  min-width: 0;
}

.data-browser-title h2 {
  margin: 7px 0 6px;
  color: #111;
  font-size: clamp(23px, 2vw, 29px);
  font-weight: 400;
  letter-spacing: -.035em;
}

.data-browser-title > p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.data-browser-summary {
  display: grid;
  min-width: 330px;
  padding-left: 28px;
  border-left: 1px solid var(--line);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.data-browser-summary span,
.data-browser-summary strong {
  display: block;
}

.data-browser-summary span,
.data-browser-selection span {
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.data-browser-summary strong {
  margin-top: 7px;
  color: #1b1b1b;
  font-size: 13px;
  font-weight: 600;
}

.data-browser-toolbar {
  display: flex;
  min-height: 74px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #f0ece9;
}

.data-browser-controls {
  display: flex;
  align-items: flex-end;
  gap: 9px;
}

.data-browser-controls label {
  display: grid;
  gap: 6px;
}

.data-browser-controls label > span {
  color: #777;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.data-browser-controls select,
.data-browser-controls button {
  height: 38px;
  border-radius: 5px;
  font-size: 11px;
}

.data-browser-controls select {
  min-width: 116px;
  padding: 0 32px 0 11px;
  border: 1px solid var(--line-strong);
  outline: 0;
  background: #fff;
}

.data-browser-controls button {
  padding: 0 17px;
  border: 1px solid #1d1d1d;
  color: #fff;
  background: #1d1d1d;
  cursor: pointer;
  font-weight: 650;
  transition: background .16s ease, border-color .16s ease;
}

.data-browser-controls button:hover {
  border-color: var(--wine);
  background: var(--wine);
}

.data-browser-controls button:disabled {
  cursor: wait;
  opacity: .62;
}

.data-browser-selection {
  min-width: 220px;
  text-align: right;
}

.data-browser-selection strong {
  display: block;
  margin-top: 6px;
  color: var(--wine);
  font-size: 12px;
  font-weight: 650;
}

.data-browser-days {
  display: flex;
  gap: 3px;
  margin-top: 16px;
  overflow-x: auto;
  padding: 3px 2px 8px;
  scrollbar-color: #d2c7c4 transparent;
  scrollbar-width: thin;
  user-select: none;
}

.data-browser-days.is-dragging {
  cursor: ew-resize;
}

.data-day {
  position: relative;
  display: flex;
  min-width: 29px;
  height: 54px;
  flex: 1 0 29px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #9a9694;
  background: #efedeb;
}

a.data-day {
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}

a.data-day:hover {
  z-index: 2;
  box-shadow: 0 7px 16px rgba(54, 37, 42, .15);
  transform: translateY(-2px);
}

.data-day > span {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.data-day > strong {
  font-size: 11px;
  font-weight: 650;
}

.data-day.is-available {
  color: #fff;
  background: #292727;
}

.data-day.is-warning {
  color: #4d3512;
  background: #e4bd78;
}

.data-day.is-danger {
  color: #fff;
  background: var(--red);
}

.data-day.is-weekend:not(.is-available, .is-warning, .is-danger) {
  background: #e4e0dd;
}

.data-day.is-selected,
.data-day.is-range-preview {
  border-color: #d9a9b6;
  color: var(--wine-dark);
  background: var(--wine-soft);
  box-shadow: inset 0 0 0 1px rgba(141, 48, 72, .08);
}

.data-day.is-selected.is-available,
.data-day.is-range-preview.is-available {
  background: var(--wine);
  color: #fff;
}

.data-day.is-selection-start,
.data-day.is-selection-end,
.data-day.is-range-preview-start,
.data-day.is-range-preview-end {
  z-index: 1;
  border-color: var(--wine-dark);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(141, 48, 72, .38);
}

.data-day.is-range-preview {
  transform: translateY(-2px);
}

.data-browser-days.is-dragging a.data-day:hover {
  box-shadow: none;
  transform: none;
}

.data-range-cursor {
  position: fixed;
  z-index: 100;
  min-width: 170px;
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 7px;
  color: #fff;
  background: rgba(28, 27, 27, .96);
  box-shadow: 0 12px 30px rgba(31, 22, 25, .24);
  pointer-events: none;
  transform: translateZ(0);
}

.data-range-cursor[hidden] {
  display: none;
}

.data-range-cursor strong,
.data-range-cursor span {
  display: block;
}

.data-range-cursor strong {
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.data-range-cursor span {
  margin-top: 4px;
  color: #d9cdd0;
  font-size: 8px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.data-browser-footer {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 7px;
  color: var(--ink-faint);
  font-size: 9px;
}

.data-browser-count {
  margin-right: auto;
}

.data-browser-count strong {
  color: #333;
  font-weight: 700;
}

.data-browser-legend {
  display: flex;
  align-items: center;
  gap: 14px;
}

.data-browser-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.data-browser-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #292727;
}

.data-browser-legend i.is-warning {
  background: #dca94f;
}

.data-browser-legend i.is-empty {
  background: #dcd8d5;
}

.data-browser-batch {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #6f6b69;
  font-weight: 600;
}

.data-browser-batch i {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #aaa3a0;
}

.territory-browser {
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.territory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 34px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--line);
}

.territory-header h2 {
  margin: 7px 0 6px;
  color: #111;
  font-size: clamp(23px, 2vw, 29px);
  font-weight: 400;
  letter-spacing: -.035em;
}

.territory-header > div > p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.territory-network {
  display: grid;
  min-width: 230px;
  gap: 3px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  transition: border-color .18s ease, background .18s ease;
}

.territory-network:hover,
.territory-network.is-selected {
  border-color: #cfaab4;
  background: var(--wine-soft);
}

.territory-network span {
  color: var(--wine);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.territory-network strong {
  color: #1b1b1b;
  font-size: 14px;
  font-weight: 600;
}

.territory-network small {
  color: var(--ink-soft);
  font-size: 9px;
}

.territory-layout {
  display: grid;
  height: 430px;
  min-height: 430px;
  grid-template-columns: minmax(470px, 1.25fr) minmax(300px, .75fr);
}

.territory-map {
  position: relative;
  display: grid;
  min-width: 0;
  place-items: center;
  padding: 16px 20px 28px;
  background: transparent;
}

.territory-map::after {
  position: absolute;
  top: 12%;
  right: 0;
  bottom: 12%;
  width: 1px;
  background: var(--line);
  content: "";
}

.territory-map svg {
  width: min(100%, 760px);
  height: 320px;
  overflow: visible;
}

.world-map-source {
  opacity: .42;
}

.world-focus circle {
  fill: none;
  stroke: var(--wine);
  stroke-width: 1;
  opacity: .15;
}

.world-focus circle:first-child {
  stroke-dasharray: 3 6;
  opacity: .3;
}

.world-focus path {
  fill: none;
  stroke: var(--wine);
  stroke-width: .8;
  opacity: .1;
}

.world-country-link {
  outline: none;
}

.world-country {
  cursor: pointer;
  transition: transform .18s ease;
  transform-box: fill-box;
  transform-origin: center;
}

.world-country-link:hover .world-country {
  transform: scale(1.12);
}

.world-marker-halo {
  fill: rgba(141, 48, 72, .08);
  stroke: rgba(141, 48, 72, .3);
  stroke-width: 1;
  transition: fill .18s ease, stroke .18s ease;
}

.world-marker {
  fill: #fff;
  stroke: var(--wine);
  stroke-width: 2;
  transition: fill .18s ease;
}

.world-country.is-selected .world-marker,
.world-country-link:hover .world-marker {
  fill: var(--wine);
}

.world-country.is-selected .world-marker-halo,
.world-country-link:hover .world-marker-halo {
  fill: rgba(141, 48, 72, .15);
  stroke: var(--wine);
}

.world-marker-value {
  fill: var(--wine);
  font-size: 9px;
  font-weight: 800;
  pointer-events: none;
  text-anchor: middle;
  transition: fill .18s ease;
}

.world-marker-value-small {
  font-size: 6px;
}

.world-country.is-selected .world-marker-value,
.world-country-link:hover .world-marker-value {
  fill: #fff;
}

.territory-map-note {
  position: absolute;
  bottom: 15px;
  left: 24px;
  color: #aaa29e;
  font-size: 8px;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.territory-directory {
  display: grid;
  height: 430px;
  min-width: 0;
  grid-template-rows: auto minmax(0, 1fr);
  background: #fff;
}

.territory-search {
  display: grid;
  gap: 7px;
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.territory-search > span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.territory-search input {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 12px;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.territory-search input:focus {
  border-color: #c99dab;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(141, 48, 72, .08);
  outline: 0;
}

.territory-list {
  display: grid;
  min-height: 0;
  align-content: start;
  gap: 8px;
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #c8bbb7 transparent;
  scrollbar-width: thin;
}

.territory-list::-webkit-scrollbar {
  width: 7px;
}

.territory-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #c8bbb7;
  background-clip: padding-box;
}

.territory-search-empty {
  margin: 18px 4px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.territory-option {
  display: grid;
  min-height: 66px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #faf9f7;
  grid-template-columns: 38px minmax(0, 1fr) auto 14px;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.territory-option[hidden],
.territory-search-empty[hidden] {
  display: none;
}

.territory-option:hover {
  border-color: #dfd5d1;
  background: #fff;
  transform: translateX(-2px);
}

.territory-option.is-selected {
  border-color: #d9adb9;
  background: var(--wine-soft);
}

.territory-code {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #d8d0cc;
  border-radius: 50%;
  color: #514b49;
  background: #fff;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .06em;
}

.territory-option.is-selected .territory-code {
  border-color: var(--wine);
  color: #fff;
  background: var(--wine);
}

.territory-option strong,
.territory-option small {
  display: block;
}

.territory-option strong {
  color: #1c1c1c;
  font-size: 12px;
  font-weight: 650;
}

.territory-option small {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 9px;
}

.territory-option b {
  color: #222;
  font-size: 18px;
  font-weight: 450;
}

.territory-option i {
  color: var(--wine);
  font-size: 12px;
  font-style: normal;
}

.region-picker {
  padding: 22px 28px 26px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.region-picker > header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.region-picker h3 {
  margin: 6px 0 0;
  color: #181818;
  font-size: 20px;
  font-weight: 450;
  letter-spacing: -.025em;
}

.region-picker > header > span {
  color: var(--wine);
  font-size: 10px;
  font-weight: 650;
}

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

.region-option {
  display: grid;
  min-width: 0;
  min-height: 68px;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #faf9f7;
  grid-template-columns: 32px minmax(0, 1fr) auto 10px;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.region-option:hover {
  border-color: #d5c4c1;
  background: #fff;
  transform: translateY(-2px);
}

.region-option.is-selected {
  border-color: #cfaab4;
  background: var(--wine-soft);
}

.region-symbol {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #ddd4d0;
  border-radius: 50%;
  color: #716966;
  background: #fff;
  font-size: 9px;
  font-weight: 750;
}

.region-option.is-selected .region-symbol {
  border-color: var(--wine);
  color: #fff;
  background: var(--wine);
}

.region-option strong,
.region-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-option strong {
  color: #272423;
  font-size: 11px;
  font-weight: 650;
}

.region-option small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 8px;
}

.region-option b {
  color: #2b2827;
  font-size: 15px;
  font-weight: 500;
}

.region-option i {
  color: var(--wine);
  font-size: 10px;
  font-style: normal;
}

.region-option-all {
  background: #f6f2f0;
  grid-column: span 2;
}

.store-picker {
  padding: 22px 28px 26px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.store-picker > header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.store-picker h3 {
  margin: 6px 0 0;
  color: #181818;
  font-size: 20px;
  font-weight: 450;
  letter-spacing: -.025em;
}

.store-picker > header > span {
  max-width: 48%;
  overflow: hidden;
  color: var(--wine);
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-picker-toolbar {
  display: grid;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
  grid-template-columns: minmax(260px, 1fr) auto;
}

.store-search {
  display: grid;
  gap: 7px;
}

.store-search > span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.store-search input {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.store-search input:focus {
  border-color: #c99dab;
  box-shadow: 0 0 0 3px rgba(141, 48, 72, .08);
  outline: 0;
}

.store-all {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
  transition: border-color .18s ease, background .18s ease;
}

.store-all:hover,
.store-all.is-selected {
  border-color: #cfaab4;
  background: var(--wine-soft);
}

.store-all strong {
  color: var(--wine);
  font-size: 14px;
}

.store-options {
  display: grid;
  max-height: 310px;
  gap: 8px;
  padding: 2px 5px 2px 2px;
  overflow-y: auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overscroll-behavior: contain;
  scrollbar-color: #c8bbb7 transparent;
  scrollbar-width: thin;
}

.store-option {
  display: grid;
  min-width: 0;
  min-height: 70px;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  grid-template-columns: 45px minmax(0, 1fr) 10px;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.store-option:hover {
  border-color: #d5c4c1;
  transform: translateY(-2px);
}

.store-option.is-selected {
  border-color: #cfaab4;
  background: var(--wine-soft);
}

.store-option[hidden],
.store-search-empty[hidden] {
  display: none;
}

.store-code {
  display: grid;
  min-height: 32px;
  place-items: center;
  border: 1px solid #ddd4d0;
  border-radius: 7px;
  color: #716966;
  background: var(--surface-soft);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .04em;
}

.store-option.is-selected .store-code {
  border-color: var(--wine);
  color: #fff;
  background: var(--wine);
}

.store-option strong,
.store-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-option strong {
  color: #272423;
  font-size: 11px;
  font-weight: 650;
}

.store-option small {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 8px;
}

.store-option i {
  color: var(--wine);
  font-size: 10px;
  font-style: normal;
}

.store-search-empty {
  margin: 24px 4px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  grid-column: 1 / -1;
}

.decision-section {
  padding: 38px 0 30px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  padding: 0 2px;
}

.section-heading h2 {
  margin: 7px 0 0;
  color: #111;
  font-size: clamp(26px, 2.3vw, 34px);
  font-weight: 400;
  letter-spacing: -.04em;
}

.section-heading > a {
  color: var(--wine);
  font-size: 11px;
  font-weight: 700;
}

.section-heading-compact {
  margin-bottom: 14px;
}

.section-heading-compact h2 {
  font-size: 23px;
}

.scope-summary {
  padding-left: 20px;
  border-left: 1px solid var(--line-strong);
  text-align: right;
}

.scope-summary span,
.scope-summary strong {
  display: block;
}

.scope-summary span {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.scope-summary strong {
  margin-top: 4px;
  color: #222;
  font-size: 13px;
  font-weight: 500;
}

.kpi-overview-grid {
  display: grid;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.decision-kpi {
  min-width: 0;
  padding: 23px 24px 20px;
  border-right: 1px solid var(--line);
}

.decision-kpi:last-child {
  border-right: 0;
}

.decision-kpi header {
  display: flex;
  min-height: 22px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #5d5d5d;
  font-size: 11px;
  font-weight: 600;
}

.kpi-mark {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #bbb;
}

.kpi-mark-net_revenue {
  background: var(--wine);
}

.kpi-mark-tickets {
  background: #b4915f;
}

.kpi-mark-average_basket {
  background: var(--green);
}

.kpi-mark-conversion_rate {
  background: var(--blue);
}

.decision-kpi > strong {
  display: block;
  overflow: hidden;
  margin-top: 13px;
  color: #111;
  font-size: clamp(24px, 2.1vw, 32px);
  font-weight: 450;
  letter-spacing: -.045em;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decision-kpi > strong small {
  color: #666;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}

.decision-kpi footer {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.comparison-chip {
  position: relative;
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 5px;
  color: #747474;
  background: #f5f4f2;
  font-size: 9px;
  cursor: help;
  outline: none;
}

.comparison-chip b {
  color: #333;
  font-size: 10px;
}

.comparison-chip::before,
.comparison-chip::after {
  position: absolute;
  z-index: 20;
  left: 50%;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    visibility 140ms ease;
}

.comparison-chip::before {
  bottom: calc(100% + 4px);
  width: 8px;
  height: 8px;
  border-right: 1px solid #ddd6d2;
  border-bottom: 1px solid #ddd6d2;
  background: #fff;
  content: "";
  transform: translate(-50%, 4px) rotate(45deg);
}

.comparison-chip::after {
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: min(250px, 80vw);
  padding: 9px 11px;
  border: 1px solid #ddd6d2;
  border-radius: 7px;
  color: #332f2d;
  background: #fff;
  box-shadow: 0 9px 24px rgba(48, 35, 31, .13);
  content: attr(data-tooltip);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.35;
  text-align: center;
  text-transform: none;
  transform: translate(-50%, 4px);
  white-space: normal;
}

.comparison-chip:hover,
.comparison-chip:focus-visible {
  z-index: 21;
}

.comparison-chip:hover::before,
.comparison-chip:hover::after,
.comparison-chip:focus-visible::before,
.comparison-chip:focus-visible::after {
  visibility: visible;
  opacity: 1;
}

.comparison-chip:hover::before,
.comparison-chip:focus-visible::before {
  transform: translate(-50%, 0) rotate(45deg);
}

.comparison-chip:hover::after,
.comparison-chip:focus-visible::after {
  transform: translate(-50%, 0);
}

.comparison-positive {
  color: #507565;
  background: #edf5f1;
}

.comparison-positive b {
  color: var(--green);
}

.comparison-negative {
  color: #8a6368;
  background: #f9eff1;
}

.comparison-negative b {
  color: var(--red);
}

.data-freshness {
  margin: 10px 2px 0;
  color: #8a6b42;
  font-size: 10px;
}

.calculation-checks {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.calculation-checks > summary {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  list-style: none;
  cursor: pointer;
}

.calculation-checks > summary::-webkit-details-marker {
  display: none;
}

.calculation-checks > summary::after {
  color: var(--wine);
  content: "+";
  font-size: 22px;
  line-height: 1;
}

.calculation-checks[open] > summary::after {
  content: "−";
}

.calculation-checks > summary span {
  display: grid;
  gap: 3px;
}

.calculation-checks > summary small {
  color: var(--wine);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.calculation-checks > summary strong {
  color: #222;
  font-size: 15px;
  font-weight: 600;
}

.calculation-checks > summary em {
  margin-left: auto;
  color: var(--ink-faint);
  font-size: 10px;
  font-style: normal;
}

.calculation-checks-body {
  border-top: 1px solid var(--line);
}

.calculation-checks-body > header,
.calculation-checks-body > footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 20px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.calculation-checks-body > header p,
.calculation-checks-body > footer p {
  margin: 0;
}

.calculation-checks-body > header span {
  display: block;
  margin-top: 2px;
}

.calculation-source {
  max-width: 260px;
  padding: 5px 8px;
  border-radius: 5px;
  color: #5f514a;
  background: #f5f2ef;
  cursor: help;
  overflow-wrap: anywhere;
}

.calculation-card-grid {
  display: grid;
  gap: 12px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8f7f5;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.calculation-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 260px;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(28, 22, 20, .035);
}

.calculation-card-verified {
  border-top-color: #acd1c2;
}

.calculation-card-not_computable {
  border-top-color: #d9bd91;
}

.calculation-card-inconsistent {
  border-top-color: #d3a2aa;
}

.calculation-card > header {
  display: flex;
  min-height: 42px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.calculation-card-tools {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.calculation-info-trigger {
  display: inline-grid;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #d8d2ce;
  border-radius: 50%;
  color: var(--wine);
  background: #fff;
  cursor: help;
  font: 700 10px/1 var(--font-body);
  place-items: center;
  transition: border-color 140ms ease, background 140ms ease;
}

.calculation-info-trigger:hover,
.calculation-info-trigger:focus-visible,
.calculation-card.is-detail-open .calculation-info-trigger {
  border-color: var(--wine);
  background: #f8eff1;
  outline: none;
}

.calculation-detail-popover {
  position: absolute;
  z-index: 45;
  top: 47px;
  left: 12px;
  visibility: hidden;
  width: min(390px, calc(100vw - 64px));
  max-height: min(610px, calc(100vh - 100px));
  overflow-y: auto;
  padding: 16px;
  border: 1px solid #d8d0cc;
  border-radius: 11px;
  opacity: 0;
  color: #2b2522;
  background: #fff;
  box-shadow: 0 18px 46px rgba(37, 25, 23, .18);
  pointer-events: none;
  transform: translateY(5px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}

.calculation-card:nth-child(4n) .calculation-detail-popover {
  right: 12px;
  left: auto;
}

.calculation-card.is-detail-open {
  z-index: 46;
}

.calculation-card.is-detail-open .calculation-detail-popover {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.calculation-detail-loading {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 10px;
}

.calculation-detail-loading i {
  width: 17px;
  height: 17px;
  border: 2px solid #eadde0;
  border-top-color: var(--wine);
  border-radius: 50%;
  animation: calculation-spinner 700ms linear infinite;
}

.calculation-detail-heading {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.calculation-detail-heading strong,
.calculation-detail-heading span {
  display: block;
}

.calculation-detail-heading strong {
  color: #261f1d;
  font-size: 14px;
}

.calculation-detail-heading span {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.calculation-detail-section {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.calculation-detail-section:last-of-type {
  border-bottom: 0;
}

.calculation-detail-section > small {
  margin-bottom: 9px;
  color: var(--wine);
}

.calculation-math {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #302927;
  font-family: var(--font-body);
  font-size: 13px;
}

.calculation-math-fraction {
  display: grid;
  min-width: 150px;
  flex: 1;
  text-align: center;
}

.calculation-math-fraction > span {
  padding: 5px 6px;
}

.calculation-math-fraction > span:first-child {
  border-bottom: 1px solid #504642;
}

.calculation-math-term {
  display: grid;
  gap: 2px;
}

.calculation-math-term small {
  color: var(--ink-faint);
  font-family: var(--font-body);
  font-size: 7px;
  letter-spacing: .04em;
}

.calculation-math-term b {
  color: #2a2421;
  font-size: 13px;
  font-weight: 600;
}

.calculation-math-operator {
  flex: 0 0 auto;
  color: var(--ink-faint);
  font-size: 13px;
}

.calculation-math-result {
  color: var(--wine);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.calculation-detail-meta {
  margin: 11px 0 0;
  color: var(--ink-faint);
  font-size: 8px;
  line-height: 1.45;
}

.calculation-detail-error {
  margin: 0;
  padding: 12px;
  border-radius: 7px;
  color: var(--red);
  background: #f9eff1;
  font-size: 10px;
  line-height: 1.45;
}

@keyframes calculation-spinner {
  to {
    transform: rotate(360deg);
  }
}

.calculation-card small {
  display: block;
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.calculation-card h3 {
  margin: 4px 0 0;
  color: #262220;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
}

.calculation-formula {
  min-height: 48px;
  margin: 14px 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.calculation-values {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf9f8;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calculation-values > div {
  min-width: 0;
  padding: 11px;
}

.calculation-values > div + div {
  border-left: 1px solid var(--line);
}

.calculation-card strong {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: #24201e;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calculation-card strong em {
  color: var(--ink-faint);
  font-size: 9px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0;
}

.calculation-card > footer {
  display: flex;
  min-height: 53px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
}

.calculation-card > footer strong {
  font-size: 17px;
}

.calculation-card > footer .calculation-performance-positive,
.calculation-card > footer .calculation-performance-positive em {
  color: var(--green);
}

.calculation-card > footer .calculation-performance-negative,
.calculation-card > footer .calculation-performance-negative em {
  color: var(--wine);
}

.calculation-card > footer .calculation-performance-neutral,
.calculation-card > footer .calculation-performance-neutral em {
  color: var(--ink-soft);
}

.calculation-card > footer .calculation-performance-unavailable,
.calculation-card > footer .calculation-performance-unavailable em {
  color: var(--ink-faint);
}

.calculation-index {
  padding-left: 12px;
  border-left: 1px solid var(--line);
  text-align: right;
}

.calculation-status {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 700;
}

.calculation-status-verified {
  color: var(--green);
  background: #edf5f1;
}

.calculation-status-warning {
  color: #8a6b42;
  background: #fbf2e5;
}

.calculation-status-danger {
  color: var(--red);
  background: #f9eff1;
}

.calculation-status-muted {
  color: var(--ink-faint);
  background: #f3f2f1;
}

.kpi-unavailable {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.kpi-unavailable > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #777;
  background: #f2f0ed;
}

.kpi-unavailable strong {
  font-size: 13px;
}

.kpi-unavailable p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.kpi-unavailable a {
  display: inline-flex;
  margin-top: 10px;
  color: var(--wine);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.kpi-unavailable a:hover,
.kpi-unavailable a:focus-visible {
  text-decoration: underline;
}

.workflow-section {
  padding-bottom: 28px;
}

.workflow-explainer {
  max-width: 790px;
  margin: -8px 0 18px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
}

.section-period {
  display: block;
  margin-top: 7px;
  color: var(--wine);
  font-size: 10px;
  font-weight: 650;
}

.stat-grid {
  display: grid;
  margin: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  display: flex;
  min-height: 94px;
  align-items: center;
  gap: 15px;
  padding: 19px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.stat-card:hover {
  border-color: #d6c8c6;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 800;
}

.stat-icon.warm {
  color: var(--wine);
  background: var(--wine-soft);
}

.stat-icon.green {
  color: var(--green);
  background: var(--green-bg);
}

.stat-icon.blue {
  color: var(--blue);
  background: var(--blue-bg);
}

.stat-icon.red {
  color: var(--red);
  background: var(--red-bg);
}

.stat-card div {
  flex: 1;
}

.stat-card small,
.stat-card strong {
  display: block;
}

.stat-card small {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.stat-card strong {
  margin-top: 3px;
  color: var(--ink-strong);
  font: 500 30px/1 var(--font-display);
}

.stat-card b {
  color: #b9abad;
  font-size: 17px;
}

.panel {
  min-width: 0;
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .95);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.panel-head h2 {
  margin: 5px 0 0;
  color: var(--ink-strong);
  font: 400 23px/1.15 var(--font-display);
  letter-spacing: -.025em;
}

.panel-head > a {
  padding-top: 4px;
  color: var(--wine);
  font-size: 11px;
  font-weight: 750;
}

.panel-head > a:hover {
  color: var(--wine-dark);
}

.live-pill {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-bg);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.message-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

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

.message-card {
  display: flex;
  min-height: 254px;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.message-card:hover {
  border-color: #d1c1c0;
  box-shadow: 0 14px 32px rgba(63, 42, 49, .08);
  transform: translateY(-2px);
}

.message-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.message-card-head > div {
  min-width: 0;
  flex: 1;
}

.message-card-head strong,
.message-card-head small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.message-card-head strong {
  font-size: 12px;
}

.message-card-head small {
  margin: 0 0 3px;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.audience-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  padding: 8px 10px;
  border-radius: 7px;
  color: #656565;
  background: #f6f4f1;
  font-size: 9px;
}

.audience-line span {
  overflow: hidden;
  flex: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audience-line b {
  flex: 0 0 auto;
  color: #333;
  font-weight: 600;
}

.control-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 9px;
}

.control-line span {
  flex: 0 0 auto;
  padding: 5px 7px;
  border-radius: 999px;
  font-weight: 750;
}

.control-line small {
  overflow: hidden;
  color: var(--ink-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-line-required span {
  color: var(--red);
  background: var(--red-bg);
}

.control-line-sample span {
  color: var(--blue);
  background: var(--blue-bg);
}

.control-line-automatic span {
  color: var(--green);
  background: var(--green-bg);
}

.message-card h3 {
  margin: 16px 0 9px;
  color: var(--ink-strong);
  font: 500 17px/1.3 var(--font-display);
  letter-spacing: -.015em;
}

.message-card > p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.62;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.message-card footer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid #f0ece9;
  color: var(--ink-faint);
  font-size: 9px;
}

.message-card footer b {
  margin-left: auto;
  color: var(--wine);
  font-size: 10px;
}

.timeline {
  display: grid;
  max-height: 492px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #d4c9c6 transparent;
  scrollbar-width: thin;
}

.timeline-item {
  position: relative;
  display: grid;
  min-height: 76px;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  padding-right: 4px;
  transition: background .4s;
}

.timeline-item::before {
  position: absolute;
  top: 15px;
  bottom: -2px;
  left: 4px;
  width: 1px;
  background: var(--line);
  content: "";
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  z-index: 1;
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #bcaeb1;
  box-shadow: 0 0 0 1px #bcaeb1;
}

.timeline-item strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.timeline-item p,
.timeline-item time {
  margin: 4px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.35;
}

.timeline-item-new {
  border-radius: 8px;
  background: #faf1f3;
}

.schedule-panel {
  margin-top: 20px;
}

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

.schedule-row article {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
  padding: 15px;
  border: 1px solid #eee9e5;
  border-radius: 11px;
  background: var(--surface-soft);
}

.schedule-time {
  color: var(--wine);
  font: 500 20px var(--font-display);
}

.schedule-row article div {
  min-width: 0;
  flex: 1;
}

.schedule-row strong,
.schedule-row small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.schedule-row strong {
  font-size: 11px;
}

.schedule-row small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 9px;
}

.empty-state {
  padding: 58px 24px;
  grid-column: 1 / -1;
  color: var(--ink-soft);
  text-align: center;
}

.empty-state > span {
  display: inline-grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 15px;
  color: var(--wine);
  background: var(--wine-soft);
  font-size: 20px;
}

.empty-state h3 {
  margin: 15px 0 5px;
  color: var(--ink);
  font: 500 20px var(--font-display);
}

.empty-state p {
  margin: 0;
  font-size: 13px;
}

.empty-compact {
  padding: 34px 12px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

/* Lists */
.list-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 26px;
}

.list-intro h2 {
  max-width: 850px;
  margin: 0;
  color: var(--ink-strong);
  font: 400 clamp(28px, 3vw, 40px)/1.12 var(--font-display);
  letter-spacing: -.045em;
}

.list-intro p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}

.filterbar {
  display: flex;
  gap: 11px;
  margin-bottom: 15px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.search-field {
  display: flex;
  min-height: 42px;
  flex: 1;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--surface-soft);
}

.search-field span {
  color: var(--ink-faint);
  font-size: 18px;
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}

.filterbar select {
  min-width: 190px;
  padding: 9px 34px 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  font-size: 12px;
}

.message-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.message-row {
  display: grid;
  min-height: 88px;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #eee9e6;
  grid-template-columns: 40px minmax(190px, 1.25fr) minmax(240px, 1.7fr) auto 80px 16px;
  transition: background .18s ease;
}

.message-row:last-child {
  border: 0;
}

.message-row:hover {
  background: #fdfbfa;
}

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

.message-row-title strong {
  color: var(--ink-strong);
  font: 500 15px/1.3 var(--font-display);
  letter-spacing: -.01em;
}

.message-row-title small {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.4;
}

.message-row > p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.message-row time {
  color: var(--ink-faint);
  font-size: 10px;
}

.message-row > b {
  color: var(--wine);
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin-top: 20px;
  color: var(--ink-soft);
  font-size: 12px;
}

.pagination a {
  color: var(--wine);
  font-weight: 700;
}

.launch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.launch-card {
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}

.launch-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.launch-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.launch-symbol {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  color: var(--wine);
  background: var(--wine-soft);
  font-size: 19px;
}

.launch-card h3 {
  min-height: 54px;
  margin: 9px 0 20px;
  color: var(--ink-strong);
  font: 500 21px/1.24 var(--font-display);
  letter-spacing: -.02em;
}

.launch-meta {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  grid-template-columns: 1fr 1fr;
}

.launch-meta span {
  padding: 14px;
}

.launch-meta span + span {
  border-left: 1px solid var(--line);
}

.launch-meta small,
.launch-meta strong {
  display: block;
}

.launch-meta small {
  color: var(--ink-soft);
  font-size: 10px;
}

.launch-meta strong {
  margin-top: 5px;
  font: 500 20px var(--font-display);
}

.launch-card footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 19px;
  color: var(--ink-soft);
  font-size: 10px;
}

/* Message workspace */
.document-page {
  max-width: 1640px;
  margin: 0 auto;
}

.document-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 2px 4px 22px;
}

.recipient-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.recipient-lockup > div > small,
.recipient-lockup > div > strong,
.recipient-lockup > div > span {
  display: block;
}

.recipient-lockup > div > small {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.recipient-lockup > div > strong {
  margin: 3px 0;
  font-size: 13px;
}

.recipient-lockup > div > span {
  color: var(--ink-soft);
  font-size: 11px;
}

.provenance-summary {
  display: grid;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  grid-template-columns: 1.2fr 1fr 1fr .65fr auto;
}

.provenance-summary-warning {
  border-color: #e5c999;
  background: #fffcf7;
}

.provenance-summary > div {
  min-width: 0;
}

.provenance-summary small,
.provenance-summary strong {
  display: block;
}

.provenance-summary small {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.provenance-summary strong {
  overflow: hidden;
  margin-top: 5px;
  color: var(--ink-strong);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provenance-summary .button {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 10px;
}

.control-context {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  font-size: 11px;
}

.control-context > span {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.control-context > strong {
  color: var(--ink);
  font-size: 12px;
}

.control-context > small {
  flex: 1;
}

.control-context > em {
  color: var(--red);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.control-context-required > span {
  color: var(--red);
  background: var(--red-bg);
}

.control-context-sample > span {
  color: var(--blue);
  background: var(--blue-bg);
}

.control-context-automatic > span {
  color: var(--green);
  background: var(--green-bg);
}

.document-meta {
  display: flex;
  gap: 28px;
}

.document-meta span {
  padding-left: 21px;
  border-left: 1px solid var(--line-strong);
}

.document-meta small,
.document-meta strong {
  display: block;
}

.document-meta small {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.document-meta strong {
  margin-top: 5px;
  font-size: 11px;
}

.workspace-columns {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--shadow-md);
  grid-template-columns: minmax(280px, .82fr) minmax(340px, 1fr) minmax(370px, 1.14fr);
}

.work-column {
  min-width: 0;
  border-right: 1px solid var(--line);
}

.work-column:last-child {
  border: 0;
}

.work-column > header {
  display: flex;
  min-height: 88px;
  align-items: center;
  gap: 13px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.work-column > header > div {
  flex: 1;
}

.work-column > header h2 {
  margin: 4px 0 0;
  color: var(--ink-strong);
  font: 500 20px var(--font-display);
}

.step-number {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: #807479;
  background: #eee8e4;
  font-size: 9px;
  font-weight: 800;
}

.column-icon {
  color: #aa9ea1;
  font-size: 18px;
}

.interpretation-column > header {
  background: #fcf7f8;
}

.interpretation-column .step-number {
  color: var(--wine);
  background: #f1dfe4;
}

.message-column > header {
  background: #fbf8f3;
}

.message-column .step-number {
  color: #715b3f;
  background: #eee4d5;
}

.column-body {
  padding: 21px;
}

.quality-banner {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid rgba(38, 112, 87, .08);
  border-radius: 11px;
  color: var(--green);
  background: var(--green-bg);
}

.quality-banner > span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
}

.quality-banner strong,
.quality-banner small {
  display: block;
}

.quality-banner strong {
  font-size: 11px;
}

.quality-banner small {
  margin-top: 3px;
  font-size: 9px;
  opacity: .8;
}

.quality-warning {
  border-color: rgba(145, 99, 31, .08);
  color: var(--amber);
  background: var(--amber-bg);
}

.kpi-stack {
  overflow: hidden;
  margin-top: 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
}

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

.kpi-line:last-child {
  border: 0;
}

.kpi-line small,
.kpi-line strong {
  display: block;
}

.kpi-line small {
  color: var(--ink-soft);
  font-size: 10px;
}

.kpi-line strong {
  margin-top: 4px;
  color: var(--ink-strong);
  font: 500 19px var(--font-display);
}

.delta {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.delta.up {
  color: var(--green);
  background: var(--green-bg);
}

.delta.down {
  color: var(--red);
  background: var(--red-bg);
}

.signal-box {
  margin-top: 15px;
  padding: 15px;
  border-radius: 11px;
  background: var(--surface-soft);
}

.signal-box > p:not(.eyebrow) {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0 0;
  font-size: 11px;
}

.signal-box b {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 6px;
  color: #776b6f;
  background: #ede7e3;
  font-size: 8px;
}

.signal-box span {
  flex: 1;
}

.signal-box small {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.source-detail-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--wine);
  background: #fff;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.source-detail-button:hover {
  border-color: #d5b4bc;
  background: var(--wine-soft);
}

.reading-note {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  padding: 13px 14px;
  border-left: 3px solid var(--wine);
  border-radius: 0 9px 9px 0;
  color: var(--wine);
  background: #faf0f2;
}

.reading-note p {
  margin: 0;
  font-size: 11px;
  line-height: 1.55;
}

.interpretation-limits {
  margin-bottom: 15px;
  padding: 12px 13px;
  border: 1px solid #ead4a9;
  border-radius: 9px;
  color: #6d4c1f;
  background: var(--amber-bg);
}

.interpretation-limits strong {
  font-size: 11px;
}

.interpretation-limits p {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.5;
}

.editor-label {
  display: block;
  margin-bottom: 14px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.editor-label textarea,
.editor-label input,
.review-form textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: 0;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  line-height: 1.65;
  resize: vertical;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.editor-label textarea:focus,
.editor-label input:focus,
.review-form textarea:focus {
  border-color: #b77d8c;
  box-shadow: 0 0 0 4px rgba(141, 48, 72, .1);
}

.prose {
  color: #40373a;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.message-preview {
  padding: 16px;
  border: 1px solid #e5dbcf;
  border-radius: 12px;
  background: #faf7f2;
}

.message-preview-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5dbcf;
}

.message-preview-head div {
  min-width: 0;
}

.message-preview-head strong,
.message-preview-head small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.message-preview-head strong {
  font: 500 13px var(--font-display);
}

.message-preview-head small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.message-preview textarea {
  width: 100%;
  padding: 17px 5px;
  border: 0;
  outline: 0;
  color: #3b3235;
  background: transparent;
  font-size: 13px;
  line-height: 1.75;
  resize: vertical;
}

.message-preview .prose {
  min-height: 300px;
  padding: 17px 5px;
}

.message-preview footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5dbcf;
  color: #94878b;
  font-size: 9px;
}

.audio-summary-card {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid #dfd3c6;
  border-radius: 12px;
  background: #fff;
}

.audio-summary-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.audio-summary-card h3 {
  margin: 3px 0 0;
  font: 500 16px var(--font-display);
}

.audio-status {
  padding: 5px 8px;
  border-radius: 999px;
  color: #675a5e;
  background: #f1ece7;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.audio-status-ready .audio-status {
  color: #286146;
  background: #e5f2eb;
}

.audio-status-failed .audio-status {
  color: #8b3048;
  background: #f8e8ed;
}

.audio-status-pending .audio-status {
  color: #775b1a;
  background: #f8f0d9;
}

.audio-summary-card audio {
  width: 100%;
  height: 38px;
}

.audio-disclosure,
.audio-feedback {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.audio-feedback:empty {
  display: none;
}

.audio-script-label {
  margin: 0;
}

.audio-script-copy {
  display: block;
  margin-top: 7px;
  padding: 10px 11px;
  border: 1px solid #e7ded5;
  border-radius: 9px;
  color: #40373a;
  background: #faf7f2;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.65;
  white-space: pre-wrap;
}

.message-column .button {
  margin-top: 13px;
}

.control-grid {
  display: grid;
  align-items: start;
  gap: 18px;
  margin-top: 20px;
  grid-template-columns: minmax(0, 1fr);
}

.review-panel {
  width: 100%;
}

.review-reason {
  display: block;
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}

.approved-seal {
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}

.decision-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.decision-row input {
  position: absolute;
  opacity: 0;
}

.decision-row span {
  display: block;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  background: #fff;
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
}

.decision-row input:checked + span {
  border-color: var(--wine);
  color: #fff;
  background: var(--wine);
  box-shadow: 0 5px 14px rgba(141, 48, 72, .18);
}

.score-grid {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.score-grid label {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
}

.score-grid select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
}

.review-form .button {
  margin-top: 11px;
}

.review-history {
  display: grid;
  gap: 11px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.review-history article {
  display: flex;
  gap: 10px;
}

.review-history strong {
  font-size: 11px;
}

.review-history p {
  margin: 4px 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.review-history small {
  color: var(--ink-faint);
  font-size: 9px;
}

.collaboration-panel {
  border-color: #2c2225;
  color: #f5edef;
  background:
    radial-gradient(circle at 100% 0, rgba(150, 54, 79, .23), transparent 15rem),
    linear-gradient(160deg, #302327, #191517);
  box-shadow: 0 18px 40px rgba(30, 20, 23, .14);
}

.collaboration-panel .eyebrow {
  color: #ad9fa3;
}

.collaboration-panel .panel-head h2 {
  color: #fff;
}

.collaboration-panel > p {
  color: #bdb0b4;
  font-size: 11px;
  line-height: 1.65;
}

.connection-code {
  margin: 17px 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 11px;
  background: rgba(255, 255, 255, .055);
  text-align: center;
}

.connection-code small,
.connection-code strong {
  display: block;
}

.connection-code small {
  color: #b3a7aa;
  font-size: 9px;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.connection-code strong {
  margin: 10px 0;
  color: #fff;
  font: 500 29px var(--font-display);
  letter-spacing: .12em;
}

.connection-code button {
  border: 0;
  color: #e0b2be;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.connection-active {
  border-color: #4b9f77;
  background: rgba(58, 140, 98, .14);
}

.connection-steps {
  display: grid;
  gap: 11px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.connection-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #b1a4a8;
  font-size: 10px;
  line-height: 1.5;
}

.connection-steps b {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #675a5e;
  border-radius: 6px;
  color: #e0d3d6;
  font-size: 8px;
}

.activity-panel .timeline {
  max-height: 340px;
}

.provenance-dialog {
  width: min(1080px, calc(100vw - 42px));
  max-height: min(820px, calc(100vh - 42px));
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 30px 90px rgba(29, 20, 23, .26);
}

.provenance-dialog::backdrop {
  background: rgba(26, 21, 23, .56);
  backdrop-filter: blur(4px);
}

.dialog-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
}

.dialog-head h2 {
  margin: 6px 0 4px;
  color: var(--ink-strong);
  font: 500 27px/1.15 var(--font-display);
}

.dialog-head > div > p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.dialog-close {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  background: #fff;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

.dialog-close:hover {
  color: var(--wine);
  background: var(--wine-soft);
}

.provenance-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
}

.provenance-grid > section {
  min-width: 0;
  padding: 25px 26px;
}

.provenance-grid > section + section {
  border-left: 1px solid var(--line);
}

.provenance-grid h3 {
  margin: 7px 0 16px;
  color: var(--ink-strong);
  font: 500 21px var(--font-display);
}

.coverage-warning {
  margin-bottom: 15px;
  padding: 12px 13px;
  border: 1px solid #ead4a9;
  border-radius: 9px;
  color: #6d4c1f;
  background: var(--amber-bg);
}

.coverage-warning strong {
  font-size: 10px;
}

.coverage-warning p {
  margin: 4px 0 0;
  font-size: 10px;
  line-height: 1.5;
}

.store-source-list {
  display: grid;
  max-height: 360px;
  gap: 7px;
  overflow: auto;
  padding-right: 4px;
}

.store-source-list article {
  display: grid;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  grid-template-columns: 48px 1fr;
}

.store-source-list article > span {
  display: grid;
  min-height: 31px;
  place-items: center;
  border-radius: 7px;
  color: var(--wine);
  background: var(--wine-soft);
  font-size: 9px;
  font-weight: 800;
}

.store-source-list strong,
.store-source-list small {
  display: block;
}

.store-source-list strong {
  font-size: 11px;
}

.store-source-list small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.provenance-facts {
  display: grid;
  gap: 0;
  margin: 13px 0 17px;
}

.provenance-facts > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.provenance-facts dt {
  color: var(--ink-soft);
  font-size: 10px;
}

.provenance-facts dd {
  margin: 0;
  color: var(--ink);
  font-size: 10px;
  font-weight: 650;
  text-align: right;
}

.quality-issue-list {
  display: grid;
  gap: 7px;
}

.quality-issue-list article {
  display: flex;
  gap: 9px;
  padding: 10px;
  border-radius: 9px;
  color: #74352f;
  background: var(--red-bg);
}

.quality-issue-list article > span {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
}

.quality-issue-list strong,
.quality-issue-list small {
  display: block;
}

.quality-issue-list strong {
  font-size: 10px;
  line-height: 1.4;
}

.quality-issue-list small {
  margin-top: 3px;
  font-size: 8px;
  opacity: .8;
}

.manual-override-note {
  margin: 12px 0 0;
  padding: 10px 11px;
  border-left: 3px solid var(--amber);
  color: #6d4c1f;
  background: var(--amber-bg);
  font-size: 9px;
  line-height: 1.5;
}

.source-catalog {
  padding: 22px 26px 26px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.source-catalog > div {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.source-catalog > div > span {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.source-catalog strong {
  font-size: 10px;
}

.source-catalog span small {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 8px;
}

.source-catalog > small {
  display: block;
  margin-top: 12px;
  color: var(--ink-faint);
  font-size: 8px;
}

/* Feedback */
.flash-stack {
  position: fixed;
  z-index: 60;
  top: 100px;
  right: 26px;
  display: grid;
  gap: 9px;
}

.flash {
  max-width: 390px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-md);
  font-size: 12px;
}

.flash-success {
  border-left: 4px solid var(--green);
}

.flash-error {
  border-left: 4px solid var(--red);
}

.toast-stack {
  position: fixed;
  z-index: 100;
  right: 26px;
  bottom: 26px;
  display: grid;
  gap: 9px;
}

.toast {
  display: flex;
  max-width: 360px;
  align-items: center;
  gap: 11px;
  padding: 14px 16px;
  border-radius: 11px;
  color: #fff;
  background: #282124;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .22);
  opacity: 0;
  transform: translateY(10px);
  transition: .3s ease;
}

.toast.show {
  opacity: 1;
  transform: none;
}

.toast > span {
  color: #dda6b4;
}

.toast p {
  margin: 0;
  font-size: 12px;
}

.toast-positive > span {
  color: #7fcea7;
}

/* Authentication */
.login-page {
  background: #211b1d;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 1.1fr minmax(400px, .7fr);
}

.login-story {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10vw;
  color: #fff;
  background:
    linear-gradient(
      90deg,
      rgba(24, 13, 17, .86),
      rgba(30, 17, 20, .62) 58%,
      rgba(28, 18, 18, .36)
    ),
    linear-gradient(0deg, rgba(20, 13, 15, .52), transparent 55%),
    url("login-background.ead3c30b04eb.jpg") 54% center / cover no-repeat;
}

.login-story .brand-mark {
  width: 60px;
  height: 60px;
  margin-bottom: 65px;
  border-color: rgba(255, 255, 255, .72);
  color: #fff;
  background: rgba(20, 12, 15, .28);
  box-shadow: 0 12px 40px rgba(15, 8, 11, .2);
  backdrop-filter: blur(8px);
}

.login-story .eyebrow {
  color: #f3dce1;
  text-shadow: 0 2px 16px rgba(15, 8, 11, .55);
}

.login-story h1 {
  max-width: 650px;
  margin: 17px 0;
  font: 400 clamp(40px, 5vw, 70px)/1.06 var(--font-display);
  letter-spacing: -.05em;
  text-shadow: 0 3px 32px rgba(15, 8, 11, .7);
}

.login-story p:last-child {
  max-width: 530px;
  color: rgba(255, 255, 255, .88);
  font-size: 14px;
  line-height: 1.7;
  text-shadow: 0 2px 18px rgba(15, 8, 11, .8);
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(38px, 6vw, 90px);
  background: #f8f5f1;
}

.login-panel h2 {
  margin: 9px 0;
  font: 400 33px var(--font-display);
}

.stack-form {
  display: grid;
  gap: 18px;
  margin-top: 34px;
}

.stack-form label {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.stack-form input {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: 0;
  background: #fff;
  font-size: 13px;
}

.stack-form input:focus {
  border-color: #b77d8c;
  box-shadow: 0 0 0 4px rgba(141, 48, 72, .1);
}

.stack-form .errorlist {
  margin: 8px 0 0;
  padding: 0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  list-style: none;
  text-transform: none;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0 -12px;
  color: var(--ink-muted);
  font-size: 11px;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  flex: 1;
  height: 1px;
  background: var(--line);
  content: "";
}

.auth-security-note {
  margin: 20px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.6;
}

.auth-steps {
  display: grid;
  gap: 9px;
  margin: 24px 0 0;
  padding-left: 22px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.otp-enrollment {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.otp-qrcode {
  display: block;
  width: min(220px, 100%);
  height: auto;
}

.otp-manual-secret {
  width: 100%;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.5;
}

.otp-manual-secret summary {
  cursor: pointer;
  font-weight: 700;
  text-align: center;
}

.otp-manual-secret p {
  margin: 13px 0 8px;
}

.otp-manual-secret code {
  display: block;
  overflow-wrap: anywhere;
  padding: 11px 12px;
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-muted);
  font-size: 12px;
  letter-spacing: .08em;
  text-align: center;
}

.stack-form .otp-code-input {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .35em;
  text-align: center;
}

.auth-secondary-action {
  margin-top: 12px;
  text-align: center;
}

.auth-secondary-action button {
  padding: 6px 10px;
  border: 0;
  color: var(--ink-muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  text-decoration: underline;
}

@keyframes breathe {
  50% {
    opacity: .55;
    transform: scale(.82);
  }
}

@keyframes workspace-skeleton {
  from {
    background-position: 120% 0;
  }

  to {
    background-position: -120% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-line,
  .workspace-skeleton-card {
    animation: none;
  }
}

@media (max-width: 1380px) {
  .control-grid {
    grid-template-columns: 1fr 1fr;
  }

  .review-panel {
    grid-column: 1 / -1;
  }

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

@media (max-width: 1180px) {
  .workspace-skeleton-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :root {
    --sidebar: 226px;
    --content-gutter: 26px;
  }

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

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

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

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

  .territory-layout {
    grid-template-columns: minmax(420px, 1.1fr) minmax(280px, .9fr);
  }

  .decision-kpi:nth-child(2) {
    border-right: 0;
  }

  .decision-kpi:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

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

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

  .message-column {
    border-top: 1px solid var(--line);
    grid-column: 1 / -1;
  }

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

@media (max-width: 860px) {
  :root {
    --sidebar: 270px;
    --content-gutter: 18px;
  }

  .shell {
    display: block;
  }

  .main {
    margin: 0;
  }

  .sidebar {
    box-shadow: 20px 0 60px rgba(0, 0, 0, .25);
    transform: translateX(-100%);
    transition: transform .25s ease;
  }

  .menu-open .sidebar {
    transform: none;
  }

  .mobile-menu {
    display: block;
  }

  .topbar {
    min-height: 72px;
  }

  .topbar .eyebrow,
  .date-chip {
    display: none;
  }

  .topbar > div:first-of-type {
    flex: 1;
  }

  .topbar-actions .button {
    display: none;
  }

  .content {
    padding-top: 22px;
  }

  .hero {
    min-height: 220px;
    padding: 30px;
  }

  .week-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 28px;
  }

  .week-context {
    width: 100%;
    min-height: 0;
    padding: 18px 0 0;
    border-top: 1px solid #d9d4cf;
    border-left: 0;
  }

  .data-browser-header,
  .data-browser-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .data-browser-summary {
    width: 100%;
    min-width: 0;
    padding: 17px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .data-browser-toolbar {
    gap: 16px;
  }

  .data-browser-selection {
    min-width: 0;
    text-align: left;
  }

  .data-day {
    min-width: 32px;
    flex-basis: 32px;
  }

  .data-browser-footer {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .territory-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .territory-network {
    width: 100%;
  }

  .territory-layout {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .territory-map::after {
    display: none;
  }

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

  .territory-directory {
    height: 430px;
    border-top: 1px solid var(--line);
  }

  .territory-list {
    border-top: 0;
  }

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

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

  .hero-orbit {
    display: none;
  }

  .hero h2 {
    font-size: 32px;
  }

  .section-heading h2 {
    font-size: 28px;
  }

  .workspace-columns,
  .control-grid {
    grid-template-columns: 1fr;
  }

  .work-column,
  .message-column {
    border: 0;
    border-bottom: 1px solid var(--line);
    grid-column: auto;
  }

  .message-grid,
  .launch-grid {
    grid-template-columns: 1fr;
  }

  .message-row {
    grid-template-columns: 40px 1fr auto 16px;
  }

  .message-row > p,
  .message-row > time {
    display: none;
  }

  .document-header {
    align-items: flex-start;
  }

  .provenance-summary {
    grid-template-columns: 1fr 1fr;
  }

  .provenance-summary .button {
    grid-column: 1 / -1;
  }

  .control-context {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .control-context > small {
    flex-basis: 60%;
  }

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

  .provenance-grid > section + section {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .source-catalog > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .document-meta {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
  }

  .document-meta span {
    padding-left: 10px;
  }

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

  .filterbar {
    flex-wrap: wrap;
  }

  .search-field {
    flex-basis: 100%;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-story {
    display: none;
  }
}

@media (max-width: 560px) {
  .workspace-skeleton-cards {
    grid-template-columns: 1fr;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .stat-grid {
    gap: 10px;
    grid-template-columns: 1fr 1fr;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .scope-summary {
    padding: 0;
    border: 0;
    text-align: left;
  }

  .data-browser {
    padding: 21px 18px 17px;
  }

  .territory-header {
    padding: 21px 18px 17px;
  }

  .territory-map {
    padding: 10px 8px 28px;
  }

  .territory-map svg {
    height: 250px;
  }

  .territory-list {
    padding: 14px;
  }

  .territory-search {
    padding: 16px 14px 11px;
  }

  .region-picker {
    padding: 20px 14px;
  }

  .store-picker {
    padding: 20px 14px;
  }

  .region-picker > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .store-picker > header,
  .store-picker-toolbar {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .store-picker > header {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .store-picker > header > span {
    max-width: 100%;
  }

  .region-options {
    grid-template-columns: 1fr;
  }

  .store-options {
    grid-template-columns: 1fr;
  }

  .region-option-all {
    grid-column: auto;
  }

  .data-browser-summary {
    gap: 14px;
  }

  .data-browser-controls {
    width: 100%;
    flex-wrap: wrap;
  }

  .data-browser-controls label {
    flex: 1;
  }

  .data-browser-controls select {
    width: 100%;
    min-width: 0;
  }

  .data-browser-controls button {
    flex: 1 0 100%;
  }

  .data-browser-legend {
    width: 100%;
    flex-wrap: wrap;
  }

  .kpi-overview-grid {
    grid-template-columns: 1fr;
  }

  .calculation-card-grid {
    padding: 12px;
    grid-template-columns: 1fr;
  }

  .decision-kpi,
  .decision-kpi:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .decision-kpi:last-child {
    border-bottom: 0;
  }

  .stat-card {
    min-height: 94px;
    padding: 15px;
    gap: 10px;
  }

  .stat-icon {
    display: none;
  }

  .stat-card strong {
    font-size: 27px;
  }

  .hero {
    border-radius: 15px;
  }

  .hero h2 {
    font-size: 28px;
  }

  .panel {
    padding: 20px;
    border-radius: 14px;
  }

  .schedule-row {
    grid-template-columns: 1fr;
  }

  .document-header {
    display: block;
  }

  .provenance-summary {
    grid-template-columns: 1fr;
  }

  .provenance-summary .button {
    grid-column: auto;
  }

  .control-context {
    display: grid;
  }

  .provenance-dialog {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 18px);
    border-radius: 12px;
  }

  .dialog-head,
  .provenance-grid > section,
  .source-catalog {
    padding-right: 18px;
    padding-left: 18px;
  }

  .source-catalog > div {
    grid-template-columns: 1fr;
  }

  .document-meta {
    justify-content: flex-start;
    margin-top: 17px;
  }

  .control-grid {
    display: block;
  }

  .control-grid > * {
    margin-bottom: 15px;
  }

  .decision-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .decision-row span {
    text-align: center;
  }

  .filterbar select {
    min-width: 0;
    flex: 1;
  }

  .launch-card footer,
  .message-preview footer {
    flex-direction: column;
  }
}

.workspace-filters { margin-top: 28px; flex-wrap: wrap; padding: 22px 28px; background: #fff; border: 1px solid var(--line-strong); border-radius: 12px; }
.workspace-filters label { flex: 1; min-width: 0; }
.workspace-filters select { width: 100%; max-width: 540px; }
.workspace-filters select:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }
.annual-period { display: flex; align-items: center; gap: 24px; padding-top: 24px; border-top: 1px solid var(--line-strong); }
.annual-period div { display: grid; gap: 8px; }
.annual-period div > span, .annual-period-scope { font-size: 12px; color: #777; }
.annual-period strong { font-size: 16px; color: var(--wine); }
.annual-period-line { flex: 1; min-width: 24px; height: 2px; background: var(--wine); }
.annual-period-scope { margin-top: 20px; }
@media (max-width: 600px) { .annual-period { flex-wrap: wrap; gap: 16px; } .annual-period-line { display: none; } .annual-period div { width: 100%; } }
