:root {
  --ink: #172033;
  --muted: #738096;
  --muted-2: #97a0b0;
  --line: #dfe3eb;
  --line-soft: #ebedf2;
  --surface: #ffffff;
  --canvas: #f3f4f8;
  --sidebar: #101827;
  --sidebar-soft: #1a2437;
  --primary: #6671ec;
  --primary-dark: #4e58ce;
  --primary-soft: #eef0ff;
  --mint: #46a684;
  --mint-soft: #eaf8f3;
  --amber: #a96c12;
  --amber-soft: #fff3df;
  --rose: #bb5365;
  --rose-soft: #fff0f2;
  --sky: #3d79b8;
  --sky-soft: #ebf5ff;
  --shadow: 0 15px 40px rgba(27, 35, 58, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 16px;
}

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

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  padding: 26px 18px 20px;
  color: #f6f8ff;
  background:
    radial-gradient(circle at 15% 2%, rgba(102, 113, 236, 0.32), transparent 30%),
    var(--sidebar);
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 7px 26px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #11182a;
  background: linear-gradient(135deg, #87f0ca 0 48%, #7c85ff 48% 100%);
  box-shadow: 0 8px 20px rgba(76, 90, 218, 0.3);
}

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

.brand strong {
  font-size: 16px;
  letter-spacing: -0.01em;
}

.brand small {
  margin-top: 1px;
  color: #919db2;
  font-size: 11px;
}

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

.nav-label {
  margin: 12px 9px 6px;
  color: #7d899e;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-button {
  width: 100%;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #aab4c7;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  text-align: left;
  font-weight: 760;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-button:hover,
.nav-button:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  color: white;
}

.nav-button.active {
  background: #2d3855;
  color: white;
}

.nav-glyph {
  width: 23px;
  height: 23px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #a9b0ff;
  font-size: 10px;
  font-weight: 900;
}

.session-note {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px 7px 2px;
  display: flex;
  align-items: center;
  gap: 11px;
}

.session-note strong,
.session-note small {
  display: block;
}

.session-note strong {
  font-size: 12px;
}

.session-note small {
  color: #8b97ab;
  font-size: 10px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #5cc49d;
  box-shadow: 0 0 0 5px rgba(92, 196, 157, 0.12);
}

.main {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  height: 76px;
  padding: 0 36px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  gap: 20px;
}

.mobile-menu {
  display: none;
}

.search {
  width: min(520px, 52vw);
  display: flex;
  align-items: center;
  gap: 10px;
  color: #9aa3b2;
}

.search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.search input::placeholder {
  color: #909aab;
}

.search kbd {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f6f7fa;
  color: #8e98aa;
  padding: 3px 7px;
  font-size: 10px;
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.trusted-chip {
  border: 1px solid #d9ddef;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 7px 11px;
  font-size: 11px;
  font-weight: 800;
}

.signout-button {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--ink);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
}

a.signout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--canvas);
}

.auth-card {
  width: min(560px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 10px 0 12px;
}

.auth-card p {
  margin: 0 0 24px;
  color: var(--muted);
}

.content {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 34px 36px 64px;
}

.review-banner {
  border: 1px solid #bfe5d7;
  border-radius: 13px;
  background: #f1faf7;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
}

.review-banner strong {
  font-size: 12px;
}

.review-banner p {
  margin: 2px 0 0;
  color: #6d7d79;
  font-size: 11px;
}

.review-icon {
  width: 25px;
  height: 25px;
  border-radius: 7px;
  background: var(--mint);
  color: white;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-weight: 900;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 34px 0 30px;
}

.eyebrow {
  color: #5964d9;
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow.light {
  color: #aeb5ff;
}

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

h1 {
  margin: 5px 0 5px;
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -0.045em;
  line-height: 1.04;
}

h2 {
  margin: 4px 0 4px;
  font-size: 21px;
  letter-spacing: -0.022em;
}

h3 {
  margin-bottom: 4px;
}

.page-heading p,
.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.secondary-button,
.primary-button {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 850;
}

.secondary-button {
  border: 1px solid #d8ddea;
  background: white;
  color: #515b70;
}

.secondary-button:hover,
.secondary-button:focus-visible {
  border-color: #b8c0d2;
  color: var(--ink);
}

.primary-button {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: white;
  box-shadow: 0 7px 17px rgba(85, 96, 215, 0.22);
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--primary-dark);
}

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

.section-heading.compact {
  align-items: center;
}

.caption {
  color: var(--muted-2);
  font-size: 11px;
}

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

.area-card {
  position: relative;
  min-height: 184px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 17px;
  text-align: left;
  box-shadow: 0 2px 4px rgba(31, 39, 58, 0.02);
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
  overflow: hidden;
}

.area-card::after {
  content: "";
  position: absolute;
  inset: auto -30px -42px auto;
  width: 105px;
  height: 105px;
  border-radius: 50%;
  background: var(--area-soft);
  opacity: 0.9;
}

.area-card:hover,
.area-card:focus-visible,
.area-card.active {
  transform: translateY(-3px);
  border-color: var(--area);
  box-shadow: var(--shadow);
}

.area-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--area-soft);
  color: var(--area);
  font-weight: 900;
}

.area-card h3 {
  margin: 16px 0 5px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.area-card p {
  margin-bottom: 15px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.area-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--area);
  font-size: 10px;
  font-weight: 850;
}

.area-card[data-accent="violet"] { --area: #6570eb; --area-soft: #eef0ff; }
.area-card[data-accent="sky"] { --area: var(--sky); --area-soft: var(--sky-soft); }
.area-card[data-accent="mint"] { --area: var(--mint); --area-soft: var(--mint-soft); }
.area-card[data-accent="amber"] { --area: var(--amber); --area-soft: var(--amber-soft); }
.area-card[data-accent="rose"] { --area: var(--rose); --area-soft: var(--rose-soft); }

.area-detail {
  display: none;
  margin-top: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px;
  box-shadow: 0 8px 26px rgba(27, 35, 58, 0.04);
}

.area-detail.visible {
  display: block;
  animation: reveal 200ms ease;
}

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

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.detail-head p {
  color: var(--muted);
  margin-bottom: 0;
}

.detail-badge,
.status-pill,
.priority-pill,
.timing-pill {
  border-radius: 999px;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 900;
}

.detail-badge {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-top: 15px;
}

.detail-item {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fafbfc;
  padding: 13px;
}

.detail-item.unhosted {
  border-style: dashed;
  background: #f7f8fa;
}

.detail-item strong,
.detail-item small {
  display: block;
}

.detail-item strong {
  font-size: 12px;
}

.detail-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.detail-item .status-pill {
  margin-top: 12px;
}

.detail-cta {
  width: 100%;
  margin-top: 10px;
  border: 1px solid #cfd4fb;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 8px 10px;
  font-size: 10px;
  font-weight: 900;
}

.unavailable-note {
  display: block;
  margin-top: 10px;
  color: #8b6470;
  font-size: 10px;
  font-weight: 850;
}

.workspace-tabs {
  margin-top: 14px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 4px;
}

.workspace-tab {
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 11px 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 850;
}

.workspace-tab:hover,
.workspace-tab:focus-visible {
  color: var(--ink);
}

.workspace-tab.active {
  border-bottom-color: var(--mint);
  color: #27745b;
}

.workspace-tab span {
  min-width: 19px;
  border-radius: 999px;
  background: var(--mint-soft);
  padding: 2px 6px;
  color: #27745b;
  text-align: center;
  font-size: 9px;
}

.mockup-panel {
  padding-top: 18px;
}

.mockup-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.mockup-heading h3 {
  margin: 4px 0;
  font-size: 18px;
}

.mockup-heading p,
.mockup-archive > p,
.mockup-empty p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
}

.gallery-link,
.mockup-link {
  border: 1px solid #bfe5d7;
  border-radius: 9px;
  background: var(--mint-soft);
  color: #27745b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 11px;
  text-decoration: none;
  font-size: 10px;
  font-weight: 900;
}

.gallery-link:hover,
.gallery-link:focus-visible,
.mockup-link:hover,
.mockup-link:focus-visible {
  border-color: var(--mint);
  background: #ddf4eb;
}

.mockup-context {
  margin-top: 14px;
  border: 1px solid #d9ddef;
  border-radius: 11px;
  background: #f7f8ff;
  color: #5f6982;
  padding: 11px 13px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 10px;
}

.mockup-context strong {
  color: var(--ink);
  white-space: nowrap;
}

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

.mockup-card {
  min-height: 230px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #fbfcfd;
  padding: 15px;
  display: flex;
  flex-direction: column;
}

.mockup-card.archived {
  min-height: 190px;
  border-style: dashed;
  background: #f8f8fa;
}

.mockup-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  color: #728096;
  font-size: 9px;
  font-weight: 850;
}

.mockup-card-meta span:last-child {
  border-radius: 999px;
  background: #eef0f5;
  padding: 4px 7px;
  white-space: nowrap;
}

.mockup-card h3 {
  margin: 15px 0 6px;
  font-size: 15px;
  letter-spacing: -0.015em;
}

.mockup-card p {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.mockup-link {
  width: 100%;
  margin-top: auto;
}

.mockup-archive {
  margin-top: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fafbfc;
  padding: 13px;
}

.mockup-archive summary {
  color: #515c72;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.mockup-archive summary span {
  margin-left: 5px;
  border-radius: 999px;
  background: #edf0f5;
  padding: 2px 6px;
  font-size: 9px;
}

.archived-grid {
  grid-template-columns: minmax(0, 1fr);
  max-width: 430px;
}

.mockup-verified {
  margin: 14px 0 0;
  color: var(--muted-2);
  font-size: 9px;
}

.mockup-empty {
  margin-top: 15px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 18px;
}

.status-pill {
  background: #eef0f5;
  color: #657087;
}

.forecasting-section {
  scroll-margin-top: 92px;
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(27, 35, 58, 0.05);
}

.forecasting-section > .section-heading {
  margin: 0;
  padding: 22px;
  border-bottom: 1px solid var(--line-soft);
}

.forecasting-section > .section-heading p {
  max-width: 820px;
}

.calculator-loading,
.calculator-toolbar,
.calculator-local-boundary,
.calculator-form,
.calculator-results {
  margin: 18px;
}

.calculator-loading {
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.calculator-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.calculator-toolbar label {
  flex: 1;
  max-width: 520px;
}

.calculator-toolbar label span,
.calculator-field > span {
  display: block;
  margin-bottom: 5px;
  color: #657087;
  font-size: 10px;
  font-weight: 850;
}

.calculator-toolbar select,
.calculator-field > input,
.calculator-field > select,
.money-field {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d8dde8;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}

.calculator-toolbar select,
.calculator-field > input,
.calculator-field > select {
  padding: 0 11px;
}

.calculator-local-boundary {
  border: 1px solid #ead7ad;
  border-radius: 11px;
  background: #fff9ed;
  color: #705c39;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 11px;
}

.calculator-local-boundary strong {
  color: #8b611c;
  white-space: nowrap;
}

.calculator-form,
.calculator-card {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #fbfbfd;
  padding: 17px;
}

.calculator-form-head,
.calculator-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.calculator-form-head h3,
.calculator-card-head h3 {
  margin: 3px 0 0;
  font-size: 17px;
}

.version-chip,
.calculator-pill {
  border-radius: 999px;
  background: #edf0f5;
  color: #69758a;
  padding: 6px 9px;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 900;
}

.calculator-pill.ok {
  background: var(--mint-soft);
  color: #28765d;
}

.calculator-pill.bad {
  background: var(--rose-soft);
  color: #9c4050;
}

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

.calculator-fieldset {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.calculator-field.wide {
  grid-column: span 2;
}

.money-field {
  display: flex;
  align-items: center;
  overflow: hidden;
}

.money-field b {
  padding-left: 10px;
  color: #8c96a7;
  font-size: 9px;
}

.money-field input {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 0;
  outline: 0;
  padding: 0 10px;
  background: transparent;
  color: var(--ink);
}

.money-field.suffix input {
  padding-left: 10px;
}

.money-field.suffix b {
  padding: 0 10px 0 0;
}

.calculator-check {
  grid-column: span 2;
  align-self: end;
  min-height: 42px;
  border: 1px solid #d8dde8;
  border-radius: 9px;
  background: #fff;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #5f6b7e;
  font-size: 10px;
}

.calculator-actions {
  margin-top: 15px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.calculator-status {
  margin-top: 12px;
  border-radius: 9px;
  background: #eef1f6;
  color: #657087;
  padding: 9px 11px;
  font-size: 10px;
}

.calculator-status.success {
  background: var(--mint-soft);
  color: #28765d;
}

.calculator-status.error {
  background: var(--rose-soft);
  color: #9c4050;
}

.calculator-status.pending {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

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

.calculator-results {
  display: grid;
  grid-template-columns: minmax(270px, 0.65fr) minmax(0, 1.35fr);
  gap: 14px;
}

.calculator-card {
  margin: 0;
  background: #fff;
}

.calculator-card.invalid {
  border-color: #efc9cf;
}

.calculator-source,
.calculator-note {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.allocation-rows {
  margin-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.allocation-rows > div,
.allocation-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 11px;
}

.allocation-rows small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.allocation-total {
  border-bottom: 0;
  color: var(--primary-dark);
}

.calculator-error {
  border-radius: 8px;
  background: var(--rose-soft);
  color: #9c4050;
  padding: 9px;
  font-size: 10px;
}

.forecast-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 13px;
}

.forecast-metrics div {
  border-radius: 9px;
  background: #f4f5f8;
  padding: 10px;
}

.forecast-metrics span,
.forecast-metrics strong {
  display: block;
}

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

.forecast-metrics strong {
  margin-top: 4px;
  font-size: 13px;
}

.forecast-boundary {
  margin-top: 10px;
  border: 1px solid #dbe0ed;
  border-radius: 9px;
  background: #f8f9fc;
  padding: 9px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: #657087;
  font-size: 10px;
}

.forecast-boundary b {
  color: var(--ink);
}

.forecast-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
}

.forecast-table {
  min-width: 100%;
  border-collapse: collapse;
  font-size: 9px;
  white-space: nowrap;
}

.forecast-table th,
.forecast-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 7px 8px;
  text-align: right;
}

.forecast-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: white;
  text-align: left;
}

.forecast-table thead th {
  color: var(--muted);
}

.forecast-table .closing-row {
  font-weight: 850;
}

.forecast-table .negative {
  color: var(--rose);
  background: var(--rose-soft);
}

.calculator-default-note {
  margin: 18px;
  border: 1px solid #ead7ad;
  border-radius: 10px;
  background: #fff9ed;
  color: #705c39;
  padding: 11px 13px;
  font-size: 10px;
}

.calculator-tool-form {
  background: #fff;
}

.calculator-intro {
  max-width: 880px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.calculator-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compact-button {
  padding: 7px 10px;
}

.calculator-name {
  display: block;
  max-width: 520px;
  margin-top: 15px;
}

.calculator-field small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.calculator-primary-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-top: 16px;
}

.calculator-primary-fields.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.calculator-primary-fields.single-field {
  grid-template-columns: minmax(0, 1fr);
  max-width: 642px;
}

.calculator-primary-fields .calculator-field > input,
.calculator-name > input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d8dde8;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  padding: 0 11px;
}

.calculator-payment-entry {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.calculator-top-recalculate {
  justify-self: start;
}

.calculator-field input:disabled,
.calculator-field select:disabled,
.compact-money input:disabled {
  background: #f2f3f6;
  color: #6c7688;
  opacity: 1;
}

.projection-tabs {
  margin: 18px 18px 0;
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f5f6f9;
  padding: 4px;
}

.projection-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 850;
}

.projection-tabs button.active {
  background: white;
  color: var(--primary-dark);
  box-shadow: 0 3px 10px rgba(27, 35, 58, 0.08);
}

.bucket-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 15px;
}

.bucket-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfbfd;
  padding: 13px;
}

.bucket-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin-bottom: 14px;
}

.bucket-card-head > strong {
  min-width: 0;
  font-size: 12px;
}

.compact-money {
  width: 88px;
  min-width: 88px;
  min-height: 36px;
}

.compact-money input {
  height: 34px;
  padding-right: 4px;
  text-align: right;
}

.readonly-label,
.bucket-computed span,
.percentage-total span,
.retained-summary span,
.forecast-total-income span,
.annual-results span,
.annual-results small {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.bucket-card output {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.forecast-bucket .calculator-field {
  display: block;
  margin-top: 10px;
}

.bucket-computed {
  margin-top: 12px;
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}

.bucket-computed output {
  font-size: 14px;
}

.bucket-computed.shortfall {
  color: #a34253;
}

.bucket-computed.shortfall span {
  color: #a34253;
}

.percentage-total,
.retained-summary,
.forecast-total-income {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f9fc;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.percentage-total strong,
.retained-summary strong,
.forecast-total-income strong {
  font-size: 14px;
}

.percentage-total.invalid,
.retained-summary.shortfall,
.forecast-total-income.shortfall {
  border-color: #edc5cc;
  background: var(--rose-soft);
  color: #a34253;
}

.percentage-warning {
  margin: 7px 0 0;
  color: #b43f53;
  font-size: 10px;
  font-weight: 800;
}

.annual-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-top: 16px;
}

.annual-results article {
  border: 1px solid #d6daef;
  border-radius: 13px;
  background: #f8f9ff;
  padding: 16px;
}

.annual-results output {
  display: block;
  margin: 5px 0;
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 900;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.queue-section {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(27, 35, 58, 0.04);
}

.queue-section > .section-heading {
  margin: 0;
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.snapshot-meta {
  display: grid;
  justify-items: end;
  gap: 2px;
  color: var(--muted);
  font-size: 10px;
}

.snapshot-meta span:first-child {
  color: var(--ink);
  font-weight: 850;
}

.queue-toolbar {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: #fbfbfd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.capacity-warning {
  border-bottom: 1px solid #ead7ad;
  background: #fff9ed;
  color: #705c39;
  padding: 11px 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 10px;
}

.capacity-warning strong {
  flex: 0 0 auto;
  color: #8b611c;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-button {
  border: 1px solid transparent;
  border-radius: 9px;
  background: #edeff4;
  color: #6d7789;
  padding: 7px 10px;
  font-size: 10px;
  font-weight: 850;
}

.filter-button.active {
  border-color: #d6daf7;
  background: white;
  color: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(52, 62, 100, 0.08);
}

.queue-legend {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 10px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
  margin-right: 4px;
}

.legend-dot.active { background: var(--mint); }
.legend-dot.approval { background: var(--amber); }

.queue-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.summary-cell {
  background: white;
  padding: 13px 16px;
}

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

.summary-cell strong {
  font-size: 18px;
  letter-spacing: -0.03em;
}

.summary-cell span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.queue-table-wrap {
  overflow-x: auto;
}

.queue-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
}

.queue-table th,
.queue-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.queue-table th:first-child,
.queue-table td:first-child {
  padding-left: 22px;
}

.queue-table th:last-child,
.queue-table td:last-child {
  padding-right: 22px;
  text-align: right;
}

.queue-table th {
  color: #8b95a6;
  background: #fbfbfd;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.queue-table tr:last-child td {
  border-bottom: 0;
}

.task-title {
  min-width: 235px;
}

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

.task-detail {
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
}

.task-detail summary {
  color: var(--primary-dark);
  cursor: pointer;
  font-weight: 820;
}

.task-detail p {
  max-width: 520px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.task-title strong {
  font-size: 12px;
}

.task-title small {
  color: var(--muted-2);
  font-size: 9px;
}

.owner-cell,
.blocker-cell {
  color: #596479;
  font-size: 10px;
}

.blocker-cell {
  max-width: 250px;
  line-height: 1.45;
}

.priority-pill.normal { background: #eef1f5; color: #647086; }
.priority-pill.high { background: var(--amber-soft); color: #996118; }
.priority-pill.urgent { background: var(--rose-soft); color: #b34759; }
.priority-pill.low { background: #eff5f3; color: #5b7a70; }

.timing-pill.now { background: var(--mint-soft); color: #267b60; }
.timing-pill.next { background: var(--sky-soft); color: #316fae; }
.timing-pill.conditional { background: var(--amber-soft); color: #996118; }
.timing-pill.parked { background: #f1f2f5; color: #747e8f; }
.timing-pill.done { background: var(--primary-soft); color: #5964ca; }

.proceed-button {
  min-width: 82px;
  border: 1px solid #d7dce8;
  border-radius: 9px;
  background: white;
  color: #536078;
  padding: 8px 10px;
  font-size: 10px;
  font-weight: 900;
}

.proceed-button:hover,
.proceed-button:focus-visible {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.proceed-button.previewed {
  border-color: #bfe6d7;
  background: var(--mint-soft);
  color: #27785e;
}

.running-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: #27785e;
  font-size: 10px;
  font-weight: 900;
}

.running-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px var(--mint-soft);
}

.security-section {
  margin-top: 26px;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 14px;
}

.security-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 23px;
}

.security-card p,
.security-card li {
  color: var(--muted);
  font-size: 11px;
}

.security-card ul {
  padding-left: 18px;
  margin-bottom: 0;
}

.security-card li + li {
  margin-top: 8px;
}

.dark-card {
  border-color: #252f44;
  background:
    radial-gradient(circle at 96% 5%, rgba(100, 112, 235, 0.28), transparent 34%),
    var(--sidebar);
  color: white;
}

.dark-card p,
.dark-card li {
  color: #aeb7c9;
}

.gate-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  gap: 10px;
}

.gate-list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  padding: 11px;
}

.gate-list b {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.proceed-dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  border: 0;
  border-radius: 18px;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(12, 18, 32, 0.32);
}

.proceed-dialog::backdrop {
  background: rgba(11, 17, 29, 0.68);
  backdrop-filter: blur(3px);
}

.proceed-dialog form {
  padding: 22px;
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line-soft);
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: #6c7688;
  font-size: 22px;
  line-height: 1;
}

.approval-summary {
  margin: 16px 0;
  border: 1px solid #e2e5ed;
  border-radius: 13px;
  background: #f8f9fb;
  overflow: hidden;
}

.approval-summary > div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  padding: 10px 13px;
  border-bottom: 1px solid #e7e9ef;
  font-size: 11px;
}

.approval-summary > div:last-child {
  border-bottom: 0;
}

.approval-summary dt {
  color: var(--muted);
  font-weight: 780;
}

.approval-summary dd {
  margin: 0;
  font-weight: 720;
}

.acceptance-box {
  border-left: 3px solid var(--primary);
  background: var(--primary-soft);
  padding: 11px 13px;
  color: #4f5870;
  font-size: 11px;
}

.duplicate-warning {
  margin-top: 15px;
  border: 1px solid #bfe5d7;
  border-radius: 11px;
  background: var(--mint-soft);
  color: #39715f;
  padding: 10px 12px;
  display: grid;
  gap: 2px;
  font-size: 10px;
}

.field-label {
  display: block;
  margin: 16px 0 6px;
  color: #657086;
  font-size: 10px;
  font-weight: 850;
}

.proceed-dialog select {
  width: 100%;
  border: 1px solid #d9deea;
  border-radius: 10px;
  background: white;
  padding: 10px 12px;
  color: var(--ink);
}

.confirm-check {
  margin-top: 15px;
  border: 1px solid #ead9b8;
  border-radius: 11px;
  background: #fff9ed;
  padding: 11px 12px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #786442;
  font-size: 10px;
}

.confirm-check input {
  margin-top: 2px;
  accent-color: var(--primary);
}

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

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  max-width: 370px;
  border-radius: 12px;
  background: var(--sidebar);
  color: white;
  padding: 12px 15px;
  box-shadow: 0 16px 40px rgba(11, 18, 31, 0.28);
  font-size: 11px;
  font-weight: 720;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.empty-search {
  padding: 40px 22px;
  color: var(--muted);
  text-align: center;
}

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

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

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

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

  .trusted-chip {
    display: none;
  }

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

  .calculator-results {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: 20px 0 50px rgba(10, 17, 30, 0.28);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    width: 100%;
  }

  .topbar {
    height: 64px;
    padding: 0 16px;
  }

  .mobile-menu {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    padding: 7px 9px;
    color: var(--ink);
    font-size: 11px;
    font-weight: 850;
  }

  .search {
    flex: 1;
    width: auto;
  }

  .search kbd,
  a.signout-button {
    display: none;
  }

  .content {
    padding: 22px 15px 42px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 28px;
  }

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

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

  .mockup-context {
    flex-direction: column;
  }

  .mockup-context strong {
    white-space: normal;
  }

  .snapshot-meta {
    justify-items: start;
  }

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

  .security-section {
    grid-template-columns: 1fr;
  }

  .calculator-fields,
  .forecast-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calculator-toolbar,
  .calculator-local-boundary {
    align-items: stretch;
    flex-direction: column;
  }

  .calculator-toolbar label {
    max-width: none;
  }

  .bucket-grid,
  .calculator-primary-fields.three-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calculator-local-boundary strong {
    white-space: normal;
  }
}

@media (max-width: 540px) {
  .review-banner p {
    font-size: 10px;
  }

  h1 {
    font-size: 33px;
  }

  .area-grid,
  .detail-list,
  .mockup-grid {
    grid-template-columns: 1fr;
  }

  .workspace-tabs {
    overflow-x: auto;
  }

  .workspace-tab {
    white-space: nowrap;
  }

  .mockup-card {
    min-height: 0;
  }

  .area-card {
    min-height: 160px;
  }

  .queue-legend {
    display: none;
  }

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

  .approval-summary > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

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

  .dialog-actions button {
    width: 100%;
  }

  .calculator-fields,
  .forecast-metrics,
  .calculator-primary-fields,
  .calculator-primary-fields.three-up,
  .bucket-grid,
  .annual-results {
    grid-template-columns: 1fr;
  }

  .calculator-field.wide,
  .calculator-check {
    grid-column: auto;
  }

  .calculator-form-head,
  .calculator-card-head,
  .calculator-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .calculator-actions button {
    width: 100%;
  }

  .calculator-top-recalculate {
    width: 100%;
  }

  .calculator-head-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .projection-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .projection-tabs button {
    padding-inline: 10px;
  }
}

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