:root {
  --navy-950: #061323;
  --navy-900: #071b33;
  --navy-800: #0b2c52;
  --blue-600: #1463ff;
  --blue-500: #1d7cff;
  --cyan-500: #21c6e8;
  --surface: #ffffff;
  --surface-2: #f5f8fc;
  --surface-3: #edf4fb;
  --line: #dfe7f1;
  --line-strong: #c8d6e7;
  --text: #102139;
  --muted: #65758d;
  --low: #23bd8d;
  --moderate: #ffcc22;
  --high: #ff8a22;
  --severe: #ff3d5f;
  --shadow: 0 18px 45px rgba(8, 25, 48, 0.13);
  --soft-shadow: 0 10px 26px rgba(8, 25, 48, 0.09);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --sidebar-width: 260px;
  --topbar-height: 76px;
  font-family: "Google Sans", "Product Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--surface-2);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% 10%, rgba(33,198,232,0.22), transparent 34rem),
    linear-gradient(140deg, #eaf3fb 0%, #f8fbff 44%, #eef5fb 100%);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  border-radius: 12px;
  font-weight: 700;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}
button:hover { transform: translateY(-1px); box-shadow: var(--soft-shadow); }
button:active { transform: translateY(0); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(29, 124, 255, 0.22);
  outline-offset: 2px;
}
a { color: inherit; }

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

.topbar {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(260px, 1fr) auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0 1.15rem 0 0;
  background: linear-gradient(90deg, var(--navy-950) 0%, var(--navy-900) 58%, #09254a 100%);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 16px 38px rgba(3, 12, 26, 0.26);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  height: 100%;
  padding: 0 1rem;
  color: #fff;
  text-decoration: none;
}
.brand-logo {
  width: 47px;
  height: 47px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.25);
  box-shadow: 0 0 0 7px rgba(33,198,232,0.08);
  flex: 0 0 auto;
}
.brand-copy { display: grid; line-height: 1.05; min-width: 0; }
.brand-copy strong {
  font-size: 1.62rem;
  letter-spacing: -0.06em;
  white-space: nowrap;
}
.brand-copy small {
  color: #9fb5d1;
  font-weight: 700;
  font-size: 0.76rem;
  white-space: nowrap;
}
.global-search {
  max-width: 680px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: center;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  padding: 0.55rem 0.8rem;
  color: #dcecff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.global-search input {
  width: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  min-height: 30px;
  font-weight: 400;
}
.global-search input::placeholder { color: #9eb2cf; }
.global-search input:focus-visible { outline: none; }
.global-search kbd {
  min-width: 28px;
  padding: 0.12rem 0.45rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  color: #aec2db;
  background: rgba(2, 10, 22, 0.38);
  text-align: center;
}
.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
}
.topbar-actions button {
  background: rgba(255,255,255,0.09);
  color: #e8f2ff;
  border-color: rgba(255,255,255,0.14);
  padding: 0.72rem 0.95rem;
}
.save-status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: #e6f2ff;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 0.72rem 0.9rem;
  white-space: nowrap;
  font-weight: 700;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #53d896;
  box-shadow: 0 0 0 5px rgba(83,216,150,0.13);
}

.sidebar {
  position: fixed;
  z-index: 40;
  top: var(--topbar-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #07192f 0%, #08264a 62%, #061527 100%);
  color: #ddecff;
  box-shadow: 18px 0 38px rgba(5, 20, 39, 0.2);
}
.sidebar-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 1rem;
  overflow-y: auto;
}
.sidebar-action { padding-bottom: 0.35rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.page-nav { display: grid; gap: 0.25rem; }
.nav-group {
  margin: 1rem 0 0.35rem;
  color: #7e9bbc;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}
.page-nav button {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 0.65rem;
  text-align: left;
  width: 100%;
  padding: 0.88rem 0.9rem;
  color: #ddebff;
  border-radius: 14px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.page-nav button:hover,
.page-nav button.active {
  background: rgba(29,124,255,0.16);
  border-color: rgba(33,198,232,0.24);
  color: #fff;
  transform: none;
}
.sidebar-card {
  margin-top: auto;
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255,255,255,0.07);
  color: #c9d8ec;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.sidebar-card p { margin: 0.65rem 0 0; }
.version-pill {
  display: inline-flex;
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
  background: rgba(33,198,232,0.18);
  color: #bff5ff;
  font-size: 0.75rem;
  font-weight: 700;
}

.workspace {
  margin-left: var(--sidebar-width);
  padding: calc(var(--topbar-height) + 1.6rem) 2rem 3rem;
}
.page-panel[hidden] { display: none !important; }
.page-panel { display: grid; gap: 1.4rem; }

.hero-panel, .card {
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(200,214,231,0.9);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.hero-panel {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.8rem;
  background:
    radial-gradient(circle at 90% 0%, rgba(33,198,232,0.22), transparent 25rem),
    rgba(255,255,255,0.9);
}
.hero-panel h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.075em;
  line-height: 1;
}
.hero-panel p { margin: 0.55rem 0 0; color: var(--muted); max-width: 830px; }
.eyebrow {
  margin: 0 0 0.3rem !important;
  color: #5c79a0 !important;
  text-transform: uppercase;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  font-weight: 800;
}
.hero-actions, .button-row, .form-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }

.primary {
  background: linear-gradient(135deg, var(--blue-600), #09a6e8);
  color: #fff;
  border: 0;
  padding: 0.86rem 1.1rem;
  box-shadow: 0 12px 24px rgba(20,99,255,0.28);
}
.wide { width: 100%; justify-content: center; display: inline-flex; gap: 0.4rem; }
.ghost { background: #fff; color: #18324e; padding: 0.76rem 0.95rem; }
.ghost.small { padding: 0.5rem 0.75rem; font-size: 0.86rem; }
.danger { color: #cc2143 !important; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 1rem;
}
.summary-card {
  position: relative;
  overflow: hidden;
  display: block;
  text-align: left;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: var(--soft-shadow);
}
.summary-card::after {
  content: "";
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(29,124,255,0.16), rgba(33,198,232,0.25));
}
.summary-card span { display: block; color: #435a78; font-weight: 700; font-size: 0.86rem; }
.summary-card strong { display: block; margin-top: 0.35rem; font-size: 2rem; letter-spacing: -0.05em; }
.summary-card small { color: #5e718b; font-weight: 400; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.35fr) minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 1rem;
  align-items: stretch;
}
.card { padding: 1.25rem; }
.xl-card { grid-row: span 2; }
.card-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.compact-heading { align-items: center; }
.card h2, .card h3 { margin: 0; letter-spacing: -0.035em; }
.card p { color: var(--muted); margin: 0.25rem 0 0; }
.mini-link { color: var(--blue-600); font-weight: 700; font-size: 0.86rem; }

.matrix-wrap {
  display: grid;
  grid-template-columns: 34px minmax(320px, 1fr);
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 0.5rem;
  overflow: auto;
}
.axis-label {
  color: #3d5473;
  font-weight: 800;
  text-align: center;
}
.y-axis { writing-mode: vertical-rl; transform: rotate(180deg); }
.x-axis { grid-column: 2; }
.risk-matrix {
  display: grid;
  grid-template-columns: 52px repeat(5, minmax(72px, 1fr));
  gap: 0.38rem;
  min-width: 500px;
}
.matrix-label {
  min-height: 34px;
  display: grid;
  place-items: center;
  color: #526782;
  font-weight: 700;
  font-size: 0.82rem;
}
.matrix-cell {
  min-height: 78px;
  display: grid;
  place-items: center;
  gap: 0.05rem;
  padding: 0.45rem 0.25rem;
  border: 2px solid rgba(255,255,255,0.9);
  border-radius: 13px;
  color: #101f32;
  text-align: center;
  box-shadow: 0 10px 18px rgba(12, 28, 48, 0.08);
}
.matrix-cell .count { font-size: 1.22rem; font-weight: 800; line-height: 1; }
.matrix-cell .band { font-size: 0.72rem; font-weight: 700; line-height: 1; }
.matrix-cell span:last-child { font-size: 0.64rem; font-weight: 400; opacity: 0.88; line-height: 1; }
.matrix-cell.low { background: var(--low); color: #fff; }
.matrix-cell.moderate { background: var(--moderate); }
.matrix-cell.high { background: var(--high); color: #fff; }
.matrix-cell.severe { background: var(--severe); color: #fff; }
.matrix-cell.active { outline: 4px solid rgba(20,99,255,0.36); outline-offset: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; color: var(--muted); font-weight: 400; }
.band-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 0.45rem; }
.band-dot.low { background: var(--low); }
.band-dot.moderate { background: var(--moderate); }
.band-dot.high { background: var(--high); }
.band-dot.severe { background: var(--severe); }

.chart-box {
  min-height: 310px;
  display: grid;
  place-items: center;
}
.chart-box svg { width: 100%; height: auto; max-height: 330px; }
.chart-caption { color: var(--muted); font-size: 0.82rem; font-weight: 400; }
.chart-click-label, .bubble-group { cursor: pointer; }

.stack-list { display: grid; gap: 0.65rem; }
.stack-item {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 0.9rem;
  background: #f8fbff;
  width: 100%;
  text-align: left;
  box-shadow: none;
}
.stack-item strong { display: block; font-weight: 700; }
.stack-item p { margin-top: 0.35rem; }
.clickable-card:hover { background: #eef7ff; border-color: #b9d7ff; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.24rem 0.55rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.76rem;
  white-space: nowrap;
}
.band-low { background: rgba(35,189,141,0.14); color: #047454; }
.band-moderate { background: rgba(255,204,34,0.2); color: #806100; }
.band-high { background: rgba(255,138,34,0.18); color: #a34700; }
.band-severe { background: rgba(255,61,95,0.16); color: #bf1839; }
.empty-state {
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  padding: 1rem;
  background: #f8fbff;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 1rem;
}
.mini-bars { display: grid; gap: 0.62rem; margin-top: 0.75rem; }
.mini-bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 36px;
  gap: 0.5rem;
  align-items: center;
  color: #435a78;
  font-weight: 400;
  background: transparent;
  border: 0;
  border-radius: 12px;
  padding: 0.3rem;
  box-shadow: none;
  text-align: left;
}
.mini-bar-row:hover { background: #f4f9ff; transform: none; }
.mini-bar-row strong { font-weight: 700; }
.mini-bar-track {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: #e7eef7;
  overflow: hidden;
}
.mini-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-600), var(--cyan-500));
}

.word-cloud {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 0.45rem 0.75rem;
  min-height: 300px;
  padding: 0.8rem;
  border-radius: 18px;
  background: linear-gradient(135deg, #f7fbff, #eef7ff);
  border: 1px solid var(--line);
}
.cloud-word {
  border: 0;
  background: transparent;
  color: #0f4ea8;
  padding: 0.18rem 0.28rem;
  border-radius: 10px;
  font-weight: 400;
  box-shadow: none;
}
.cloud-word:nth-child(3n) { color: #0d8aaa; }
.cloud-word:nth-child(4n) { color: #a34700; }
.cloud-word:nth-child(5n) { color: #047454; }
.cloud-word:hover { background: rgba(20,99,255,0.09); box-shadow: none; }

.filter-blocks { display: grid; gap: 1rem; }
fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
legend, label { color: #334865; font-weight: 700; }
.segmented-wrap { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 0.5rem; }
.segmented-wrap.compact { gap: 0.4rem; }
.segmented-btn,
.score-btn {
  background: #f7fbff;
  border-color: var(--line);
  color: #273f5e;
  padding: 0.55rem 0.75rem;
  box-shadow: none;
}
.segmented-btn.active,
.score-btn.active {
  background: linear-gradient(135deg, #0d4fd4, #16a6df);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(20,99,255,0.22);
}
.segmented-btn.mini { padding: 0.36rem 0.48rem; font-size: 0.78rem; border-radius: 10px; }
.active-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: #eaf3ff;
  color: #24496f;
  font-weight: 400;
}

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 18px; }
.risk-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1320px;
  background: #fff;
}
.risk-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #edf4fb;
  color: #223a58;
  text-align: left;
  padding: 0.85rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 700;
}
.risk-table th button {
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  color: inherit;
  font-weight: 700;
}
.risk-table td {
  padding: 0.72rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-weight: 400;
}
.risk-table tr:hover td { background: #f7fbff; }
.table-input, .table-select {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 9px;
  padding: 0.35rem 0.45rem;
  color: var(--text);
  font-weight: 400;
}
.table-input:focus, .table-select:focus {
  background: #fff;
  border-color: var(--blue-500);
  outline: none;
  box-shadow: 0 0 0 3px rgba(29,124,255,0.12);
}
.table-title { min-width: 230px; }
.table-title .table-input { font-weight: 500; }
.table-title small, .table-notes small { display: block; color: var(--muted); margin-top: 0.2rem; font-weight: 400; }
.table-notes { min-width: 280px; }
.table-note-input { min-height: 86px; background: #f9fcff; border-color: var(--line); resize: vertical; }
.table-score { display: flex; gap: 0.18rem; flex-wrap: nowrap; }
.score-dot {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 9px;
  font-size: 0.76rem;
  font-weight: 700;
  box-shadow: none;
}
.score-dot.active { background: var(--blue-600); color: #fff; border-color: var(--blue-600); }
.table-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.table-actions button { padding: 0.42rem 0.55rem; font-size: 0.78rem; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 1rem;
}
.span-2 { grid-column: span 2; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 0.78rem 0.85rem;
  background: #fff;
  color: var(--text);
  margin-top: 0.35rem;
  font-weight: 400;
}
textarea { resize: vertical; }
label small, .notes-entry small { display: block; color: var(--muted); font-weight: 400; margin-top: 0.4rem; }
.risk-page-form { display: grid; gap: 1.35rem; }
.form-section-heading {
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
}
.form-section-heading h2, .form-section-heading h3 { margin: 0; }
.if-card textarea { border-left: 5px solid var(--blue-500); }
.then-card textarea { border-left: 5px solid var(--cyan-500); }
.score-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 1rem;
}
.score-picker {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  background: #f8fbff;
}
.score-choice-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 0.55rem;
}
.score-choice-grid .score-btn {
  display: grid;
  gap: 0.18rem;
  min-height: 122px;
  text-align: left;
  align-content: start;
  padding: 0.75rem;
  font-weight: 400;
}
.score-btn strong { font-size: 1.25rem; font-weight: 700; }
.score-btn span { font-weight: 500; }
.score-btn small { opacity: 0.86; font-weight: 400; line-height: 1.2; }
.rating-preview {
  padding: 1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #f2f8ff, #fff);
  border: 1px solid var(--line);
  font-weight: 400;
}

.history-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  background: #f8fbff;
}
.history-panel h3, .history-panel h4 { margin: 0 0 0.75rem; }
.history-list { display: grid; gap: 0.55rem; }
.history-list div {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 0.75rem;
}
.history-list strong { text-transform: capitalize; font-weight: 700; }
.history-list span { color: var(--muted); margin-left: 0.45rem; font-size: 0.82rem; }
.history-list p { margin: 0.35rem 0 0; color: var(--text); }
.notes-archive pre {
  white-space: pre-wrap;
  font: inherit;
  font-weight: 400;
  color: #2a3d57;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  max-height: 260px;
  overflow: auto;
}
.muted { color: var(--muted); }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 1rem;
}
.data-card { grid-column: 1 / -1; }
.settings-list { display: grid; gap: 0.75rem; margin-top: 1rem; }
.setting-row {
  display: grid;
  grid-template-columns: 54px minmax(140px, 0.6fr) minmax(260px, 1fr);
  gap: 0.65rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f8fbff;
}
.setting-score {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #e7f0fb;
  font-weight: 700;
}

.report-preview { display: grid; gap: 1rem; }
.report-box, .action-row {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  box-shadow: var(--soft-shadow);
}
.report-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.report-box strong { font-size: 1.8rem; }
.risk-list, .action-list { display: grid; gap: 0.8rem; }
.action-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: start;
}
.action-row button { margin-top: 0.5rem; padding: 0.4rem 0.7rem; }

.guidance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 1.2rem;
}
.guidance-grid article {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  background: #f8fbff;
}
.guidance-wide { grid-column: 1 / -1; background: linear-gradient(135deg, #eef7ff, #fff) !important; }
.guidance-grid li { margin-bottom: 0.35rem; }
.guidance-grid p, .guidance-grid li { color: #314761; font-weight: 400; }

.toast {
  position: fixed;
  right: 1.3rem;
  bottom: 1.3rem;
  z-index: 90;
  max-width: 360px;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: var(--navy-900);
  color: #fff;
  box-shadow: var(--shadow);
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }

.bubble.low { fill: var(--low); }
.bubble.moderate { fill: var(--moderate); }
.bubble.high { fill: var(--high); }
.bubble.severe { fill: var(--severe); }
.bubble-count { fill: #0d2038; font-weight: 700; font-size: 13px; pointer-events: none; }
.bubble-label { fill: #31496a; font-weight: 400; font-size: 11px; pointer-events: none; }
.axis-text, .axis-title { fill: #526782; font-weight: 400; font-size: 12px; }
.chart-box text { font-family: "Google Sans", "Product Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

@media (max-width: 1380px) {
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .xl-card { grid-column: 1 / -1; grid-row: auto; }
}
@media (max-width: 1250px) {
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  :root { --sidebar-width: 0px; --topbar-height: auto; }
  .topbar {
    position: sticky;
    grid-template-columns: 1fr;
    padding: 0.8rem;
  }
  .brand { padding: 0; height: auto; }
  .sidebar {
    position: sticky;
    top: 0;
    width: auto;
    height: auto;
  }
  .sidebar-inner { padding: 0.85rem; }
  .page-nav { grid-template-columns: repeat(2, 1fr); }
  .nav-group, .sidebar-card, .sidebar-action { grid-column: 1 / -1; }
  .workspace { margin-left: 0; padding: 1rem; }
  .summary-grid, .dashboard-grid, .breakdown-grid, .settings-grid, .score-panel-grid, .guidance-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2, .data-card, .guidance-wide { grid-column: auto; }
  .score-choice-grid { grid-template-columns: 1fr; }
  .hero-panel { flex-direction: column; }
}
@media print {
  .no-print, .topbar, .sidebar { display: none !important; }
  .workspace { margin: 0; padding: 0; }
  body { background: #fff; }
  .card, .hero-panel { box-shadow: none; border: 1px solid #ccc; }
}

.category-settings-card {
  grid-column: 1 / -1;
}
.category-settings-list {
  max-height: 520px;
  overflow: auto;
  padding-right: 0.25rem;
}
.category-setting-row {
  display: grid;
  grid-template-columns: 54px minmax(220px, 1fr) 90px auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f8fbff;
}
.category-setting-row label {
  min-width: 0;
}
.category-usage {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .category-setting-row {
    grid-template-columns: 44px 1fr;
  }
  .category-usage,
  .category-setting-row button {
    grid-column: 2;
    justify-self: start;
  }
}

/* TripTrap 5.4 refinements */
.global-search {
  max-width: 640px;
  margin: 0.35rem 0;
  padding: 0.42rem 0.75rem;
  border-radius: 14px;
}
.global-search input { min-height: 26px; }
.global-search kbd { padding: 0.08rem 0.38rem; }
.menu-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-weight: 800;
}
.menu-icon.dashboard { color: #4dd8ff; background: rgba(77,216,255,0.12); }
.menu-icon.register { color: #9ecbff; background: rgba(158,203,255,0.12); }
.menu-icon.actions { color: #67e4b5; background: rgba(103,228,181,0.12); }
.menu-icon.add { color: #ffd166; background: rgba(255,209,102,0.14); }
.menu-icon.report { color: #b79cff; background: rgba(183,156,255,0.14); }
.menu-icon.guidance { color: #ff9f7a; background: rgba(255,159,122,0.14); }
.menu-icon.settings { color: #d1def2; background: rgba(209,222,242,0.12); }
.breakdown-grid { grid-template-columns: repeat(4, minmax(180px, 1fr)); }
.project-settings-card, .category-settings-card { grid-column: 1 / -1; }
.project-settings-list, .category-settings-list { max-height: 520px; overflow: auto; padding-right: 0.2rem; }
.project-setting-row, .category-setting-row {
  display: grid;
  grid-template-columns: 54px minmax(220px, 1fr) 90px auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f8fbff;
}
.field-help { margin: 0.15rem 0 0.7rem; color: var(--muted); font-size: 0.9rem; }
.report-hero-box {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  background: linear-gradient(135deg, #ffffff, #eef8ff);
}
.report-columns.four-cols { grid-template-columns: repeat(4, 1fr); }
.report-table-wrap { overflow: auto; }
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.report-table th, .report-table td {
  padding: 0.72rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.report-table th { background: #eef5fc; color: #334b68; font-weight: 700; }
.copy-report-block {
  white-space: pre-wrap;
  font-family: inherit;
  color: #253a55;
  background: #f7fbff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  margin: 0;
}
.link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 0.75rem;
}
.link-grid a {
  display: block;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  color: #0b55b7;
  text-decoration: none;
  font-weight: 600;
}
.link-grid a:hover { border-color: #7ec9ff; box-shadow: var(--soft-shadow); }
@media (max-width: 1100px) {
  .breakdown-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .report-columns.four-cols { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .global-search { max-width: none; margin: 0.2rem 0; }
  .topbar-actions { flex-wrap: wrap; }
  .project-setting-row, .category-setting-row { grid-template-columns: 40px 1fr; }
  .project-setting-row .category-usage, .category-setting-row .category-usage { grid-column: 2; }
  .project-setting-row button, .category-setting-row button { grid-column: 2; justify-self: start; }
  .report-columns.four-cols, .link-grid { grid-template-columns: 1fr; }
  .report-hero-box { flex-direction: column; }
}
