:root {
  --ink: #112d36;
  --ink-soft: #324c53;
  --ink-muted: #65767a;
  --paper: #f2eee5;
  --paper-deep: #e5ded1;
  --panel: #fffdf8;
  --line: #d9d1c4;
  --line-soft: #ece6dc;
  --teal: #08786e;
  --teal-dark: #075b55;
  --teal-pale: #dceee9;
  --orange: #db5d37;
  --orange-pale: #f8e0d5;
  --yellow: #a8790b;
  --yellow-pale: #f5ebc8;
  --blue: #396e91;
  --blue-pale: #e0ebf1;
  --navy: #123846;
  --shadow: 0 20px 60px rgb(23 45 48 / 10%);
  --shadow-small: 0 10px 28px rgb(23 45 48 / 8%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 4%, rgb(8 120 110 / 14%), transparent 28rem),
    radial-gradient(circle at 95% 13%, rgb(219 93 55 / 11%), transparent 26rem),
    var(--paper);
  font-family: "Trebuchet MS", "PT Sans Caption", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.ambient-grid {
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    linear-gradient(rgb(18 56 70 / 4%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(18 56 70 / 4%) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px clamp(18px, 3vw, 48px) 34px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand img {
  border-radius: 12px;
  box-shadow: 0 8px 18px rgb(18 56 70 / 16%);
}

.brand span {
  display: grid;
  gap: 1px;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.brand small {
  color: var(--ink-muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

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

.mode-pill {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--ink-muted);
  background: rgb(255 253 248 / 60%);
  font-size: 12px;
  font-weight: 700;
}

.mode-pill.is-live {
  border-color: rgb(8 120 110 / 30%);
  color: var(--teal-dark);
  background: rgb(8 120 110 / 8%);
}

.sync-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--navy);
  box-shadow: 0 8px 18px rgb(18 56 70 / 16%);
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.sync-button:hover {
  background: #092e3a;
  transform: translateY(-1px);
}

.sync-button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.sync-button.is-loading .sync-icon {
  animation: spin 0.8s linear infinite;
}

.demo-banner {
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 11px 15px;
  border: 1px solid #e2c273;
  border-radius: 12px;
  color: #705716;
  background: var(--yellow-pale);
  font-size: 12px;
}

.demo-banner:not([hidden]) {
  display: flex;
}

.demo-banner strong {
  flex: none;
  padding: 4px 8px;
  border-radius: 6px;
  color: #fff;
  background: #957016;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: end;
  gap: clamp(28px, 5vw, 72px);
  padding: clamp(52px, 7vw, 98px) 0 36px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 900px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 5.4vw, 76px);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 0.96;
}

.hero-description {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--ink-muted);
  font-size: clamp(15px, 1.5vw, 19px);
  line-height: 1.58;
}

.opportunity-card {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  padding: 25px;
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 12%, rgb(255 255 255 / 17%), transparent 8rem),
    var(--navy);
  box-shadow: 0 24px 60px rgb(18 56 70 / 24%);
}

.opportunity-card::after {
  position: absolute;
  right: -25px;
  bottom: -54px;
  width: 150px;
  height: 150px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 50%;
  content: "";
}

.opportunity-card > small,
.opportunity-card > span {
  display: block;
  position: relative;
  z-index: 1;
}

.opportunity-card > small {
  color: rgb(255 255 255 / 63%);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.opportunity-card > strong {
  display: block;
  position: relative;
  z-index: 1;
  margin: 13px 0 5px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 3.6vw, 50px);
  font-weight: 500;
  letter-spacing: -0.045em;
}

.opportunity-card > span {
  max-width: 235px;
  min-height: 34px;
  color: rgb(255 255 255 / 64%);
  font-size: 11px;
  line-height: 1.45;
}

.sync-status {
  display: flex;
  position: absolute;
  z-index: 1;
  right: 25px;
  bottom: 22px;
  left: 25px;
  align-items: center;
  gap: 11px;
  padding-top: 14px;
  border-top: 1px solid rgb(255 255 255 / 14%);
}

.sync-status span:last-child {
  display: grid;
  gap: 2px;
}

.sync-status small {
  color: rgb(255 255 255 / 52%);
  font-size: 9px;
}

.sync-status strong {
  font-size: 11px;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #67d2ae;
  box-shadow: 0 0 0 6px rgb(103 210 174 / 12%);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgb(255 253 248 / 76%);
  box-shadow: var(--shadow);
}

.metric {
  position: relative;
  min-height: 160px;
  overflow: hidden;
  padding: 24px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric::after {
  position: absolute;
  right: -24px;
  bottom: -30px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgb(8 120 110 / 5%);
  content: "";
}

.metric-risk::after,
.metric-critical::after {
  background: rgb(219 93 55 / 8%);
}

.metric-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-mark {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  color: var(--teal-dark);
  background: rgb(8 120 110 / 10%);
  font-family: Georgia, serif;
  font-weight: 800;
}

.metric-risk .metric-mark,
.metric-critical .metric-mark {
  color: var(--orange);
  background: var(--orange-pale);
}

.metric > strong {
  display: block;
  position: relative;
  z-index: 1;
  margin: 17px 0 5px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3.8vw, 46px);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.metric > span {
  position: relative;
  z-index: 1;
  color: var(--ink-muted);
  font-size: 11px;
}

.metric-period {
  display: flex;
  position: relative;
  z-index: 2;
  align-items: center;
  gap: 7px;
  width: max-content;
  margin-top: 13px;
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.metric-period select {
  min-height: 29px;
  padding: 0 24px 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.module-section {
  padding: clamp(64px, 8vw, 108px) 0 30px;
}

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

.section-heading h2,
.workspace h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(27px, 3vw, 40px);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.section-heading > p {
  max-width: 390px;
  margin: 0 0 3px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.55;
}

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

.module-card {
  --module-color: var(--teal);
  --module-pale: var(--teal-pale);
  display: flex;
  min-height: 268px;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: left;
  background: rgb(255 253 248 / 78%);
  box-shadow: var(--shadow-small);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  animation: module-reveal 420ms ease forwards;
  animation-delay: calc(var(--module-index) * 45ms);
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.module-card:hover,
.module-card.is-active {
  border-color: color-mix(in srgb, var(--module-color) 42%, var(--line));
  box-shadow: 0 18px 42px rgb(23 45 48 / 13%);
  transform: translateY(-3px);
}

.module-card.is-active {
  outline: 2px solid color-mix(in srgb, var(--module-color) 20%, transparent);
}

.module-risk,
.module-anomaly {
  --module-color: var(--orange);
  --module-pale: var(--orange-pale);
}

.module-buy,
.module-portfolio {
  --module-color: var(--blue);
  --module-pale: var(--blue-pale);
}

.module-capital {
  --module-color: var(--yellow);
  --module-pale: var(--yellow-pale);
}

.module-operations {
  --module-color: #8e6455;
  --module-pale: #efe3dc;
}

.module-supplier {
  --module-color: #547c48;
  --module-pale: #e3eddf;
}

.module-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.module-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: var(--module-color);
  background: var(--module-pale);
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 800;
}

.readiness {
  padding: 5px 7px;
  border-radius: 99px;
  color: var(--teal-dark);
  background: var(--teal-pale);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.readiness-learning {
  color: #80600d;
  background: var(--yellow-pale);
}

.module-card > strong {
  margin-top: 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.module-description {
  min-height: 42px;
  margin-top: 7px;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.45;
}

.module-result {
  display: grid;
  gap: 1px;
  margin-top: auto;
  padding-top: 14px;
}

.module-result strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.module-result small {
  color: var(--ink-muted);
  font-size: 9px;
}

.module-supporting {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.module-supporting > span {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--module-pale) 58%, transparent);
}

.module-supporting strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-supporting small {
  color: var(--ink-muted);
  font-size: 7px;
  line-height: 1.25;
}

.module-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 11px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 700;
}

.module-footer span:last-child {
  color: var(--module-color);
}

.workspace {
  scroll-margin-top: 18px;
  margin-top: 28px;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.search {
  display: flex;
  width: min(340px, 100%);
  min-height: 42px;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.search:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgb(8 120 110 / 9%);
}

.search span {
  color: var(--teal);
  font-size: 21px;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
}

.filters {
  display: flex;
  gap: 5px;
  margin-top: 26px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.filter {
  display: inline-flex;
  min-height: 38px;
  flex: none;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border: 0;
  border-radius: 10px;
  color: var(--ink-muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.filter span {
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--paper-deep);
  font-size: 10px;
}

.filter.is-active {
  color: #fff;
  background: var(--navy);
}

.filter.is-active span {
  color: var(--navy);
  background: #fff;
}

.list-head,
.alert-card {
  display: grid;
  grid-template-columns:
    minmax(210px, 1.08fr)
    minmax(190px, 1fr)
    minmax(120px, 0.62fr)
    minmax(230px, 1.28fr)
    32px;
  gap: 18px;
  align-items: center;
}

.list-head {
  margin-top: 18px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: #7a8587;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.alert-list {
  min-height: 220px;
}

.queue-limit {
  margin: 12px 0 2px;
  padding: 11px 14px;
  border: 1px solid #e4cf8f;
  border-radius: 10px;
  color: #735812;
  background: var(--yellow-pale);
  font-size: 10px;
  line-height: 1.45;
}

.alert-card {
  --alert-color: var(--teal);
  --alert-pale: var(--teal-pale);
  width: 100%;
  padding: 17px 14px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  animation: reveal 350ms ease forwards;
  animation-delay: calc(var(--alert-index) * 35ms);
}

.alert-risk,
.alert-anomaly {
  --alert-color: var(--orange);
  --alert-pale: var(--orange-pale);
}

.alert-buy,
.alert-portfolio {
  --alert-color: var(--blue);
  --alert-pale: var(--blue-pale);
}

.alert-capital {
  --alert-color: var(--yellow);
  --alert-pale: var(--yellow-pale);
}

.alert-supplier {
  --alert-color: #547c48;
  --alert-pale: #e3eddf;
}

.alert-operations {
  --alert-color: #8e6455;
  --alert-pale: #efe3dc;
}

.alert-card:hover {
  border-radius: 11px;
  background: #f7f3ec;
}

.alert-product {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.type-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  color: var(--alert-color);
  background: var(--alert-pale);
  font-family: Georgia, serif;
  font-weight: 800;
}

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

.product-copy strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-copy > span {
  display: block;
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 10px;
}

.reason,
.recommendation {
  color: #495b61;
  font-size: 12px;
  line-height: 1.45;
}

.effect strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 19px;
  font-weight: 500;
}

.effect span {
  color: var(--ink-muted);
  font-size: 9px;
}

.effect.is-cost strong {
  color: var(--blue);
}

.arrow {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--alert-color);
}

.severity {
  display: inline-flex !important;
  width: max-content;
  align-items: center;
  gap: 5px;
  font-size: 8px !important;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.severity::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c29a2c;
  content: "";
}

.severity-critical::before {
  background: #c83b2c;
}

.severity-high::before {
  background: var(--orange);
}

.severity-low::before {
  background: var(--teal);
}

.loading-state,
.empty-state,
.error-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 11px;
  color: var(--ink-muted);
  text-align: center;
  font-size: 13px;
}

.empty-state > span:last-child,
.error-state > span:last-child {
  max-width: 520px;
  line-height: 1.5;
}

.empty-mark,
.error-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: var(--teal);
  background: var(--teal-pale);
  font-family: Georgia, serif;
  font-size: 19px;
  font-weight: 800;
}

.error-state {
  color: #9a3c2c;
}

.error-mark {
  color: var(--orange);
  background: var(--orange-pale);
}

.loading-ring {
  width: 28px;
  height: 28px;
  border: 3px solid var(--paper-deep);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.coverage-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 14px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink-muted);
  background: rgb(255 253 248 / 55%);
  font-size: 10px;
}

.coverage-strip > div {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-weight: 700;
}

.coverage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgb(8 120 110 / 10%);
}

.footer-note {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 3px 0;
  color: var(--ink-muted);
  font-size: 10px;
}

.product-dialog {
  width: min(880px, calc(100vw - 28px));
  max-height: min(840px, calc(100vh - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 30px 90px rgb(18 43 53 / 28%);
}

.product-dialog::backdrop {
  background: rgb(18 43 53 / 48%);
  backdrop-filter: blur(4px);
}

.dialog-close {
  position: absolute;
  z-index: 2;
  top: 15px;
  right: 15px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 24px;
  cursor: pointer;
}

.dialog-inner {
  padding: clamp(24px, 4vw, 40px);
}

.dialog-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  padding-right: 48px;
}

.dialog-inner h2 {
  max-width: 640px;
  margin: 8px 0;
  font-family: Georgia, serif;
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 500;
  line-height: 1.06;
}

.dialog-subtitle {
  color: var(--ink-muted);
  font-size: 12px;
}

.portfolio-badge {
  flex: none;
  padding: 7px 10px;
  border-radius: 99px;
  color: var(--teal-dark);
  background: var(--teal-pale);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.portfolio-reduce {
  color: #80600d;
  background: var(--yellow-pale);
}

.portfolio-stop {
  color: var(--orange);
  background: var(--orange-pale);
}

.dialog-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin: 26px 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--line);
}

.dialog-stat {
  min-height: 105px;
  padding: 15px;
  background: #fff;
}

.dialog-stat small {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dialog-stat strong {
  display: block;
  overflow: hidden;
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-stat span {
  display: block;
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 9px;
}

.dialog-section {
  margin-top: 26px;
}

.dialog-section h3 {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.dialog-section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dialog-section-heading span {
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: var(--navy);
  font-size: 9px;
}

.dialog-alert {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: start;
  margin-top: 8px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: #f8f4ed;
}

.dialog-alert-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  color: var(--teal);
  background: var(--teal-pale);
  font-family: Georgia, serif;
  font-weight: 800;
}

.dialog-alert small,
.dialog-alert strong,
.dialog-alert span {
  display: block;
}

.dialog-alert small {
  margin-bottom: 4px;
  color: var(--teal);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dialog-alert strong {
  font-size: 12px;
}

.dialog-alert span span {
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 10px;
  line-height: 1.45;
}

.dialog-alert .dialog-effect {
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: 500;
}

.dialog-muted {
  padding: 16px;
  border-radius: 10px;
  color: var(--ink-muted);
  background: #f6f1e9;
  font-size: 11px;
}

.warehouse-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.warehouse-row {
  display: grid;
  grid-template-columns: 1fr repeat(3, 100px);
  gap: 12px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 11px;
}

.warehouse-row:last-child {
  border-bottom: 0;
}

.warehouse-row span:nth-child(n + 2) {
  text-align: right;
}

.warehouse-row.is-head {
  color: var(--ink-muted);
  background: #f5f0e9;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.read-only-note {
  margin: 24px 0 0;
  color: var(--ink-muted);
  font-size: 9px;
  line-height: 1.5;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes module-reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1120px) {
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-card {
    min-height: 238px;
  }

  .list-head {
    display: none;
  }

  .alert-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
  }

  .queue-limit {
    grid-column: 1 / -1;
  }

  .alert-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 13px;
    align-content: start;
    border: 1px solid var(--line);
    border-radius: 12px;
  }

  .alert-product,
  .reason,
  .recommendation {
    grid-column: 1 / -1;
  }

  .effect {
    grid-column: 1;
  }

  .arrow {
    grid-column: 2;
    grid-row: 4;
  }
}

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

  .opportunity-card {
    min-height: 185px;
  }

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

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

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

  .dialog-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding-inline: 13px;
  }

  .brand small,
  .mode-pill {
    display: none;
  }

  .sync-button {
    width: 42px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }

  .sync-icon {
    font-size: 20px;
  }

  .demo-banner {
    align-items: flex-start;
  }

  .hero {
    gap: 20px;
    padding-top: 52px;
  }

  .hero h1 {
    font-size: clamp(38px, 13vw, 58px);
  }

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

  .metric {
    min-height: 145px;
    padding: 16px;
  }

  .metric > strong {
    font-size: 31px;
  }

  .module-section {
    padding-top: 65px;
  }

  .section-heading,
  .workspace-heading {
    display: grid;
  }

  .section-heading > p {
    display: none;
  }

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

  .module-card {
    min-height: 225px;
  }

  .search {
    width: 100%;
  }

  .alert-list {
    grid-template-columns: 1fr;
  }

  .coverage-strip,
  .footer-note {
    display: grid;
  }

  .coverage-strip > span:last-child {
    display: none;
  }

  .dialog-title-row {
    display: grid;
  }

  .dialog-stats {
    grid-template-columns: 1fr;
  }

  .dialog-alert {
    grid-template-columns: 30px 1fr;
  }

  .dialog-alert .dialog-effect {
    grid-column: 2;
  }

  .warehouse-row {
    grid-template-columns: 1fr repeat(3, 64px);
    gap: 6px;
    padding-inline: 8px;
  }
}

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

/* --- v0.4: очередь решений, настройки, журнал, статус синхронизации --- */

.list-head,
.alert-card {
  grid-template-columns:
    minmax(200px, 1.05fr)
    minmax(180px, 1fr)
    minmax(120px, 0.6fr)
    minmax(230px, 1.3fr)
    minmax(96px, 0.42fr);
  align-items: start;
}

.alert-card {
  cursor: default;
}

.alert-card:hover {
  background: var(--panel);
}

.alert-card.is-resolved {
  opacity: 0.62;
}

.ghost-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-soft);
  background: var(--panel);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.ghost-button:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.menu-wrap {
  position: relative;
}

.menu {
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow-small);
}

.menu a {
  padding: 9px 11px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.menu a:hover {
  color: var(--teal-dark);
  background: var(--teal-pale);
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.notice div {
  display: grid;
  gap: 4px;
  width: 100%;
}

.notice span {
  color: var(--ink-muted);
  font-size: 13px;
}

.notice-mark {
  display: grid;
  width: 26px;
  height: 26px;
  flex: none;
  align-items: center;
  justify-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
}

.notice-sync {
  border-color: var(--teal);
  background: var(--teal-pale);
}

.notice-sync .notice-mark {
  background: var(--teal);
}

.notice-warning {
  border-color: var(--yellow);
  background: var(--yellow-pale);
}

.notice-warning .notice-mark {
  background: var(--yellow);
}

.progress {
  overflow: hidden;
  height: 6px;
  margin-top: 6px;
  border-radius: 99px;
  background: rgb(23 45 48 / 12%);
}

.progress-bar {
  width: 8%;
  height: 100%;
  border-radius: 99px;
  background: var(--teal);
  transition: width 400ms ease;
}

.metrics-note {
  margin: 10px 2px 0;
  color: var(--ink-muted);
  font-size: 12px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-top: 14px;
}

.field {
  display: grid;
  gap: 4px;
}

.field span {
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.field select,
.settings-field input,
.settings-field select {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--panel);
  font-size: 13px;
}

.toolbar-count {
  margin-left: auto;
  color: var(--ink-muted);
  font-size: 12px;
}

.card-actions {
  display: grid;
  justify-items: start;
  gap: 4px;
}

.link-button {
  padding: 0;
  border: 0;
  color: var(--teal-dark);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.doc-link {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.doc-link:hover {
  text-decoration: underline;
}

.doc-link.is-primary {
  color: var(--teal-dark);
}

.also {
  display: block;
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 11px;
}

.state-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
}

.state-open {
  color: var(--teal-dark);
  background: var(--teal-pale);
}

.state-snoozed {
  color: var(--yellow);
  background: var(--yellow-pale);
}

.state-done {
  color: var(--blue);
  background: var(--blue-pale);
}

.state-ignored {
  color: var(--ink-muted);
  background: var(--paper-deep);
}

.readiness-partial {
  color: var(--yellow);
  background: var(--yellow-pale);
}

.readiness-blocked {
  color: var(--orange);
  background: var(--orange-pale);
}

.queue-more {
  display: grid;
  justify-items: center;
  margin-top: 16px;
}

.error-hint {
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 12px;
}

.signal-list {
  margin: 6px 0 0;
  padding-left: 16px;
  color: var(--ink-muted);
  font-size: 12px;
}

.settings-form {
  display: grid;
  gap: 18px;
}

.settings-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.settings-grid-tight {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}

.settings-field {
  display: grid;
  gap: 4px;
}

.settings-field span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.settings-field small {
  color: var(--ink-muted);
  font-size: 11px;
}

.settings-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 13px;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.log-table {
  display: grid;
  gap: 2px;
  margin-top: 12px;
}

.log-row {
  display: grid;
  gap: 12px;
  padding: 9px 6px;
  border-bottom: 1px solid var(--line-soft);
  grid-template-columns: 120px minmax(140px, 1.4fr) 110px 110px minmax(140px, 1.6fr);
  align-items: center;
  color: var(--ink-soft);
  font-size: 13px;
}

.log-row.is-head {
  color: #7a8587;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.toast {
  position: fixed;
  z-index: 40;
  bottom: 22px;
  left: 50%;
  padding: 12px 18px;
  border-radius: 12px;
  color: #fff;
  background: var(--navy);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 700;
  transform: translateX(-50%);
}

.toast-error {
  background: var(--orange);
}

@media (max-width: 1080px) {
  .list-head {
    display: none;
  }

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

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

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

/* Явные display у .notice/.menu перекрывают атрибут hidden. */
[hidden] {
  display: none !important;
}
