:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  --color-canvas: #f4f7fa;
  --color-panel: #ffffff;
  --color-text: #172033;
  --color-muted: #68788c;
  --color-line: #dce4ec;
  --color-sidebar: #101c2e;
  --color-sidebar-soft: #17273d;
  --color-accent: #20b894;
  --color-accent-soft: #e8f8f3;
  --color-warning: #b86512;
  --color-warning-soft: #fff2df;
  --color-danger: #b83240;
  --color-danger-soft: #fdecee;
  --radius-sm: .55rem;
  --radius-md: .85rem;
  --radius-lg: 1.1rem;
  --shadow-panel: 0 .35rem 1.25rem rgb(15 23 42 / 5%);
}

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

html,
body {
  min-height: 100%;
}

html, body { max-width: 100%; overflow-x: hidden; }

@supports (overflow-x: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

html {
  background: var(--color-canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--color-text);
  background: var(--color-canvas);
  font-family: inherit;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

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

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px #6f4b00;
}

.visually-hidden {
  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 {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  min-height: 100vh;
  max-width: 100%;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 1.35rem 1rem 1rem;
  overflow-y: auto;
  color: #b7c5d5;
  background: var(--color-sidebar);
}

.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-height: 2.75rem;
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: .01em;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: .65rem;
  color: #082a25;
  background: var(--color-accent);
  font-size: .9rem;
  font-weight: 850;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 18%);
}

.desktop-nav {
  display: block;
  margin-top: 1.35rem;
}

.mobile-nav {
  display: none;
}

.nav {
  display: grid;
  gap: 1.15rem;
}

.sidebar-nav {
  min-width: 0;
}

.nav-group {
  display: grid;
  min-width: 0;
  gap: .22rem;
}

.nav-group h2 {
  margin: 0 0 .35rem;
  padding: 0 .7rem;
  color: #7f93aa;
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.sidebar-link {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 2.5rem;
  padding: .52rem .7rem;
  border-radius: var(--radius-sm);
  color: #bdcada;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  transition: color 120ms ease, background-color 120ms ease;
}

.sidebar-link:hover,
.sidebar-link:focus-visible {
  color: #ffffff;
  background: var(--color-sidebar-soft);
}

.sidebar-link.is-active,
.sidebar-link[aria-current="page"] {
  color: #ffffff;
  background: rgb(32 184 148 / 18%);
  box-shadow: inset .2rem 0 0 var(--color-accent);
}

.sidebar-boundary {
  margin: auto .7rem 0;
  padding-top: 1rem;
  border-top: 1px solid #2c3b50;
  color: #8294a9;
  font-size: .72rem;
  line-height: 1.45;
}

.workspace {
  min-width: 0;
  background: var(--color-canvas);
}

.workspace-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
  padding: .8rem 1.8rem;
  border-bottom: 1px solid var(--color-line);
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 1px 0 rgb(15 23 42 / 2%);
  backdrop-filter: blur(.65rem);
}

.console-name,
.safety-boundary {
  margin: 0;
}

.console-name {
  font-size: .95rem;
  font-weight: 750;
  letter-spacing: .01em;
}

.safety-boundary {
  margin-top: .1rem;
  color: var(--color-muted);
  font-size: .76rem;
}

.account-area {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .65rem .8rem;
  min-width: 0;
}

.mode-evidence {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.mode-label {
  color: #52677d;
  font-size: .75rem;
  font-weight: 700;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: .28rem .62rem;
  border: 1px solid rgb(32 184 148 / 34%);
  border-radius: 999px;
  color: #08745c;
  background: var(--color-accent-soft);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .03em;
}

.scan-mode-badge {
  border-color: #c9d5e1;
  color: #40536a;
  background: #edf2f6;
}

.operator {
  min-width: 0;
  color: var(--color-muted);
  font-size: .82rem;
  overflow-wrap: anywhere;
}

.logout-form {
  margin: 0;
}

.logout-form button {
  min-height: 2.5rem;
  padding: .48rem .72rem;
  border-color: #cbd6e1;
  color: #40536a;
  background: #ffffff;
}

.logout-form button:hover {
  border-color: #9fb0c2;
  color: var(--color-text);
  background: #f7f9fb;
}

.page {
  width: min(calc(100% - 3rem), 90rem);
  margin: 0 auto;
  padding: 1.8rem 0 3rem;
}

.page-heading {
  margin-bottom: 1.3rem;
}

.page-heading h1,
.public-page > h1 {
  margin: 0;
  color: var(--color-text);
  font-size: clamp(1.55rem, 2vw, 2rem);
  font-weight: 760;
  letter-spacing: -.025em;
  line-height: 1.2;
}

.page h2,
.public-page h2 {
  margin-top: 0;
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1.35;
}

.public-page {
  width: min(calc(100% - 2rem), 70rem);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(2rem, 8vh, 6rem) 0 3rem;
}

.panel,
.metric-card,
.login-card,
.card {
  min-width: 0;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-panel);
  box-shadow: var(--shadow-panel);
  overflow-wrap: anywhere;
}

.panel,
.card {
  padding: 1.15rem;
}

.metric-card {
  padding: 1.1rem;
}

.login-card {
  max-width: 32rem;
  margin: 1.5rem auto 0;
  padding: clamp(1.25rem, 4vw, 2rem);
  border-radius: var(--radius-lg);
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(20rem, .92fr);
  width: 100%;
  max-width: 70rem;
  min-width: 0;
  margin-top: 1.25rem;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: 0 .8rem 2.5rem rgb(15 23 42 / 10%);
}

.login-brand-panel {
  display: flex;
  min-width: 0;
  min-height: 34rem;
  flex-direction: column;
  gap: 2rem;
  padding: clamp(1.5rem, 5vw, 3.25rem);
  color: #d9e5ef;
  background: var(--color-sidebar);
}

.brand-copy {
  display: grid;
  line-height: 1.15;
}

.brand-copy small {
  margin-top: .18rem;
  color: #8fa2b7;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.login-message {
  margin: auto 0;
}

.login-message .eyebrow {
  color: #73d8c0;
}

.login-message h2 {
  margin: .7rem 0 1rem;
  color: #ffffff;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -.045em;
  line-height: 1.08;
}

.login-message > p:last-child {
  max-width: 31rem;
  margin: 0;
  color: #b7c5d5;
}

.login-boundaries {
  padding-top: 1rem;
  border-top: 1px solid #2d4058;
}

.login-boundaries strong {
  display: block;
  color: #ffffff;
  font-size: .85rem;
}

.login-boundaries p {
  margin: .35rem 0 0;
  color: #93a6bb;
  font-size: .78rem;
}

.login-layout .login-card {
  display: flex;
  max-width: none;
  min-width: 0;
  margin: 0;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 3rem);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.login-card h2 {
  margin-bottom: .35rem;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.login-intro,
.form-boundary,
.section-description {
  color: #52677d;
}

.login-intro {
  margin: 0 0 .75rem;
}

.security-form {
  min-width: 0;
}

.login-submit {
  width: 100%;
  margin-top: .35rem;
}

.form-boundary {
  margin: 1rem 0 0;
  padding-top: .9rem;
  border-top: 1px solid var(--color-line);
  font-size: .76rem;
}

.page > .panel + .panel,
.page > .card + .card {
  margin-top: 1rem;
}

.metrics-grid,
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 1rem;
}

.safety-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1.2rem;
  border: 1px solid #e6c99f;
  border-left: .3rem solid var(--color-warning);
  border-radius: var(--radius-md);
  background: var(--color-warning-soft);
  box-shadow: var(--shadow-panel);
}

.safety-banner h2,
.safety-banner p {
  margin: 0;
}

.safety-banner h2 {
  margin-top: .12rem;
}

.safety-banner h2 + p {
  margin-top: .4rem;
  font-weight: 700;
}

.safety-banner .safety-rule {
  max-width: 75rem;
  margin-top: .55rem;
  color: #52677d;
  font-size: .88rem;
}

.safety-banner .write-gate-warning {
  margin-top: .55rem;
  color: #6f3908;
  font-size: .88rem;
  font-weight: 700;
}

.safety-icon {
  display: inline-grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border-radius: .75rem;
  color: #6f3908;
  background: #ffe5bd;
  font-size: .9rem;
  font-weight: 850;
}

.eyebrow {
  margin: 0 0 .25rem;
  color: #52677d;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .1em;
  line-height: 1.35;
  text-transform: uppercase;
}

.metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.metric-card {
  position: relative;
  border-top: .22rem solid var(--color-line);
}

.metric-card p {
  margin: 0;
}

.metric-label {
  color: #52677d;
  font-size: .8rem;
  font-weight: 750;
}

.metric-card .metric-value,
.cards .card p {
  margin: .35rem 0 0;
  font-size: 1.45rem;
  font-weight: 750;
  line-height: 1.2;
}

.metric-value span {
  color: var(--color-muted);
  font-size: .78rem;
  font-weight: 700;
}

.metric-card .metric-state {
  margin-top: .55rem;
  color: #52677d;
  font-size: .76rem;
  line-height: 1.4;
}

.metric-warning {
  border-top-color: var(--color-warning);
}

.metric-danger {
  border-top-color: var(--color-danger);
}

.metric-warning .metric-value {
  color: var(--color-warning);
}

.metric-danger .metric-value {
  color: var(--color-danger);
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 1rem;
}

.overview-panel {
  min-width: 0;
  padding: 1.2rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-panel);
  box-shadow: var(--shadow-panel);
}

.overview-panel h2,
.overview-panel > p {
  margin-top: 0;
}

.overview-panel > p:not(.eyebrow) {
  color: var(--color-muted);
}

.attention-panel {
  border-left: .24rem solid var(--color-warning);
}

.evidence-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin: 1rem 0 0;
}

.evidence-summary div {
  min-width: 0;
  padding: .8rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: var(--color-canvas);
}

.evidence-summary dt {
  color: #52677d;
  font-size: .75rem;
  font-weight: 700;
}

.evidence-summary dd {
  margin: .35rem 0 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.evidence-note {
  margin: .85rem 0 0;
  color: #52677d;
  font-size: .76rem;
}

.panel-links {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 1rem;
}

.panel-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: .45rem .7rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  color: #40536a;
  background: #ffffff;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
}

.panel-links a:hover,
.panel-links a:focus-visible {
  border-color: #9fb0c2;
  color: var(--color-text);
  background: #f7f9fb;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  width: max-content;
  max-width: 100%;
  padding: .32rem .58rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 750;
  line-height: 1.25;
}

.status-badge::before {
  width: .42rem;
  height: .42rem;
  flex: 0 0 .42rem;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-guardrail {
  padding-left: .4rem;
  border-left: 1px solid currentColor;
  font-weight: 800;
}

.status-ok {
  border-color: rgb(32 184 148 / 25%);
  color: #08745c;
  background: var(--color-accent-soft);
}

.status-warning {
  border-color: rgb(184 101 18 / 22%);
  color: #8a4508;
  background: var(--color-warning-soft);
}

.status-danger {
  border-color: rgb(184 50 64 / 22%);
  color: var(--color-danger);
  background: var(--color-danger-soft);
}

.status-neutral {
  border-color: #d9e2ea;
  color: #52677d;
  background: #edf2f6;
}

.table-wrap { max-width: 100%; overflow-x: auto;
  width: 100%;
  min-width: 0;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-panel);
  box-shadow: var(--shadow-panel);
  -webkit-overflow-scrolling: touch;
}

.table-wrap:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px #6f4b00;
}

.table-wrap table {
  width: 100%;
  min-width: 46rem;
  border-collapse: collapse;
  color: var(--color-text);
  font-size: .86rem;
}

.table-section {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .85rem;
}

.section-heading h2,
.section-heading p {
  margin: 0;
}

.section-heading > span {
  color: #52677d;
  font-size: .82rem;
}

.data-table th {
  color: #4e6075;
  background: #f7f9fb;
}

.cell-code {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}

.cell-value,
.cell-code {
  overflow-wrap: anywhere;
}

th,
td {
  padding: .72rem .85rem;
  border-bottom: 1px solid var(--color-line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  color: #4e6075;
  background: #f7f9fb;
  font-size: .73rem;
  font-weight: 750;
  letter-spacing: .035em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fafcfd;
}

label {
  display: grid;
  gap: .4rem;
  margin: .9rem 0;
  color: #34465b;
  font-size: .86rem;
  font-weight: 700;
}

.form-control,
input:not([type]),
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="time"],
input[type="week"],
select,
textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: .68rem .78rem;
  border: 1px solid #cbd6e1;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  background: #fbfcfd;
}

.form-control:hover,
input:not([type]):hover,
input[type="text"]:hover,
input[type="password"]:hover,
input[type="email"]:hover,
input[type="search"]:hover,
input[type="url"]:hover,
input[type="tel"]:hover,
input[type="number"]:hover,
input[type="date"]:hover,
input[type="datetime-local"]:hover,
input[type="month"]:hover,
input[type="time"]:hover,
input[type="week"]:hover,
select:hover,
textarea:hover {
  border-color: #9fb0c2;
}

.form-control:focus,
input:not([type]):focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="month"]:focus,
input[type="time"]:focus,
input[type="week"]:focus,
select:focus,
textarea:focus {
  border-color: var(--color-accent);
  background: #ffffff;
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: .58rem .9rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #ffffff;
  background: #0c8067;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background-color 120ms ease;
}

.button-primary {
  border-color: #0c8067;
  color: #ffffff;
  background: #0c8067;
}

.button:hover,
button:hover,
.button-primary:hover {
  background: #096b56;
}

.button-quiet {
  border-color: #cbd6e1;
  color: #40536a;
  background: #ffffff;
}

.button-quiet:hover {
  border-color: #9fb0c2;
  color: var(--color-text);
  background: #f7f9fb;
}

.button:disabled,
button:disabled,
input:disabled,
select:disabled,
textarea:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .58;
}

.notice,
.error,
.empty-state {
  margin: 0 0 1rem;
  padding: .9rem 1rem;
  border: 1px solid;
  border-radius: var(--radius-sm);
}

.notice {
  border-color: rgb(184 101 18 / 24%);
  color: #75410d;
  background: var(--color-warning-soft);
}

.error {
  border-color: rgb(184 50 64 / 26%);
  color: #8d2430;
  background: var(--color-danger-soft);
}

.empty-state {
  color: #52677d;
  background: #f8fafc;
  text-align: center;
  white-space: normal;
}

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

.empty-state-content {
  display: grid;
  justify-items: center;
  gap: .3rem;
  padding: .5rem;
}

.empty-state-icon {
  width: 2rem;
  height: 2rem;
  margin-bottom: .15rem;
  color: #68788c;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-state strong {
  color: #34465b;
  font-size: .9rem;
}

.empty-state span {
  margin-top: .3rem;
  font-size: .8rem;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin: .85rem 0 0;
  color: #52677d;
  font-size: .82rem;
}

.pagination > span:not(.button) {
  min-width: 5rem;
  text-align: center;
}

.is-disabled {
  pointer-events: none;
  cursor: not-allowed;
  opacity: .58;
}

.settings-boundary {
  display: flex;
  align-items: start;
  gap: .8rem;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid #e6c99f;
  border-left: .25rem solid var(--color-warning);
  border-radius: var(--radius-md);
  color: #6f3908;
  background: var(--color-warning-soft);
}

.settings-boundary h2,
.settings-boundary p {
  margin: 0;
}

.settings-boundary p {
  margin-top: .25rem;
  color: #75410d;
}

.settings-boundary-icon,
.confirmation-icon,
.error-state-icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: .7rem;
  color: #6f3908;
  background: #ffe5bd;
  font-weight: 850;
}

.settings-section,
.confirmation-panel,
.error-state {
  min-width: 0;
  padding: 1.2rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-panel);
  box-shadow: var(--shadow-panel);
}

.settings-section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .9rem;
}

.settings-section-heading h2,
.settings-section-heading p {
  margin: 0;
}

.settings-section-heading > span:not(.status-badge) {
  color: #52677d;
  font-size: .8rem;
}

.revision-section,
.proposal-history {
  margin-bottom: 1rem;
}

.revision-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: .75rem;
}

.revision-item {
  min-width: 0;
  padding: .85rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

.revision-item > span {
  display: block;
  font-weight: 750;
}

.revision-item dl {
  display: grid;
  gap: .5rem;
  margin: .7rem 0 0;
}

.revision-item dl div {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: .55rem;
}

.revision-item dt {
  color: #52677d;
  font-size: .76rem;
}

.revision-item dd {
  min-width: 0;
  margin: 0;
  font-size: .8rem;
  overflow-wrap: anywhere;
}

.revision-item code,
.review-request code,
.confirmation-summary code,
.confirmation-phrase {
  font-family: "Cascadia Mono", Consolas, monospace;
}

.settings-empty {
  margin: 0;
  color: #52677d;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  gap: 1rem;
  margin-bottom: 1rem;
}

.proposal-section,
.review-section {
  align-self: start;
}

.section-description {
  margin: -.25rem 0 1rem;
  font-size: .84rem;
}

.review-form {
  padding: 1rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

.review-request {
  display: grid;
  min-width: 0;
  gap: .2rem;
}

.review-request strong {
  font-size: .83rem;
}

.review-request code {
  color: #52677d;
  font-size: .74rem;
  overflow-wrap: anywhere;
}

.proposal-history .table-wrap {
  box-shadow: none;
}

.confirmation-panel {
  max-width: 52rem;
  margin: 0 auto;
  padding: clamp(1.1rem, 4vw, 1.6rem);
}

.confirmation-heading {
  display: flex;
  align-items: start;
  gap: .85rem;
}

.confirmation-heading h2,
.confirmation-heading p {
  margin: 0;
}

.confirmation-heading > div > p:last-child {
  margin-top: .35rem;
  color: #52677d;
}

.confirmation-summary {
  min-width: 0;
  margin: 1.15rem 0;
  padding: 1rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

.confirmation-summary dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin: 0;
}

.confirmation-summary dl div {
  min-width: 0;
}

.confirmation-summary dt {
  color: #52677d;
  font-size: .76rem;
  font-weight: 700;
}

.confirmation-summary dd {
  min-width: 0;
  margin: .25rem 0 0;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.confirmation-boundary {
  padding: .85rem .95rem;
  border: 1px solid rgb(184 101 18 / 24%);
  border-radius: var(--radius-sm);
  color: #75410d;
  background: var(--color-warning-soft);
  font-size: .84rem;
}

.confirmation-form {
  margin-top: 1rem;
}

.confirmation-phrase {
  display: block;
  padding: .65rem .75rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  color: #34465b;
  background: #f8fafc;
  font-size: .8rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.error-state {
  max-width: 38rem;
  margin: 1rem auto 0;
  text-align: center;
}

.error-state-icon {
  margin: 0 auto .8rem;
  color: var(--color-danger);
  background: var(--color-danger-soft);
}

.error-state h2 {
  margin-bottom: .5rem;
  font-size: clamp(1.4rem, 4vw, 1.9rem);
}

.error-state > p:not(.eyebrow) {
  margin: 0 auto 1rem;
  color: #52677d;
}

.review-form + .review-form {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-line);
}

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 12rem minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: .75rem;
  }

  .sidebar-link {
    padding-inline: .6rem;
  }

  .page {
    width: min(calc(100% - 2rem), 90rem);
  }

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

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

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

  .sidebar {
    position: static;
    min-height: auto;
    height: auto;
    padding: .8rem 1rem;
    overflow: visible;
  }

  .desktop-nav,
  .sidebar-boundary {
    display: none;
  }

  .mobile-nav {
    display: block;
    margin-top: .7rem;
  }

  .mobile-nav > summary {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0 .8rem;
    border: 1px solid #34465d;
    border-radius: var(--radius-sm);
    color: #e4ebf2;
    background: var(--color-sidebar-soft);
    font-weight: 700;
    list-style: none;
    cursor: pointer;
  }

  .mobile-nav > summary::-webkit-details-marker {
    display: none;
  }

  .mobile-nav > summary::after {
    width: .55rem;
    height: .55rem;
    margin-left: auto;
    border-right: .13rem solid currentColor;
    border-bottom: .13rem solid currentColor;
    content: "";
    transform: rotate(45deg);
    transition: transform 120ms ease;
  }

  .mobile-nav[open] > summary {
    margin-bottom: .85rem;
  }

  .mobile-nav[open] > summary::after {
    transform: rotate(225deg);
  }

  .mobile-nav .sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem .7rem;
    padding-bottom: .3rem;
  }

  .mobile-nav .sidebar-link {
    min-height: 2.75rem;
  }

  .workspace-header {
    position: static;
    min-height: auto;
    padding: .75rem 1rem;
    flex-wrap: wrap;
  }

  .account-area {
    width: 100%;
    justify-content: space-between;
  }

  .page {
    width: min(calc(100% - 1rem), 90rem);
    padding-top: 1rem;
  }

  .public-page {
    width: min(calc(100% - 1rem), 70rem);
    padding-top: 1.5rem;
  }

  .login-layout {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .login-brand-panel {
    min-height: auto;
    padding: 1.25rem;
  }

  .login-message {
    margin: 1rem 0;
  }

  .login-message h2 {
    font-size: 1.8rem;
  }

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

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

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

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

  .safety-banner > .mode-badge {
    grid-column: 2;
  }

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

  .panel,
  .card,
  .metric-card,
  .login-card,
  .settings-section,
  .confirmation-panel,
  .error-state {
    padding: 1rem;
  }
}

@media (max-width: 420px) {
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .pagination .button {
    width: 100%;
  }

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

  .safety-banner {
    grid-template-columns: 1fr;
  }

  .safety-banner > .mode-badge {
    grid-column: 1;
  }
}

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