@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg: #f3f6fb;
  --bg-soft: #eef3f8;
  --surface: rgba(255, 255, 255, 0.985);
  --surface-strong: #ffffff;
  --surface-muted: #f6f9fc;
  --primary: #215287;
  --primary-deep: #12365e;
  --primary-soft: #eaf1f8;
  --primary-glow: rgba(33, 82, 135, 0.18);
  --ink: #102033;
  --ink-soft: #55657b;
  --ink-faint: #7d8ca0;
  --line: #d7e0ea;
  --line-strong: #c5d1de;
  --danger: #c24d64;
  --success: #1f7a4f;
  --warning: #b66f18;
  --shadow: 0 18px 42px rgba(16, 32, 51, 0.07);
  --shadow-soft: 0 8px 18px rgba(16, 32, 51, 0.05);
  --shadow-button: 0 12px 24px rgba(18, 54, 94, 0.18);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(33, 82, 135, 0.06), transparent 18%),
    radial-gradient(circle at top right, rgba(33, 82, 135, 0.06), transparent 26%),
    linear-gradient(180deg, #f8fafc 0%, #f3f6fb 58%, #edf2f7 100%);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 9.9px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

body.app-body {
  overflow-x: hidden;
}

body.auth-body {
  overflow-x: hidden;
}

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

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

.surface-card,
.sidebar,
.context-rail-inner,
.login-showcase,
.login-panel {
  background: var(--surface);
  border: 1px solid rgba(213, 223, 234, 0.95);
  box-shadow: var(--shadow);
  backdrop-filter: saturate(120%) blur(10px);
  min-width: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr) 158px;
  gap: 5px;
  min-height: 100vh;
  padding: 6px;
  align-items: start;
}

.app-shell.layout-wide-data {
  grid-template-columns: 186px minmax(0, 1fr);
}

.app-shell.layout-wide-data .sidebar {
  grid-row: 1 / span 2;
}

.app-shell.layout-wide-data .context-rail {
  grid-column: 2;
}

.app-shell.layout-wide-data .context-rail-inner {
  position: static;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.app-shell.layout-wide-data .logout-form {
  grid-column: 1 / -1;
}

.sidebar {
  position: sticky;
  top: 6px;
  min-height: calc(100vh - 12px);
  padding: 10px 8px;
  border-radius: var(--radius-xl);
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: visible;
}

.sidebar-toggle {
  position: absolute;
  top: 50%;
  right: -15px;
  transform: translateY(-50%);
  width: 28px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(33, 82, 135, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
  color: var(--primary-deep);
  box-shadow: 0 10px 18px rgba(16, 32, 51, 0.08);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.sidebar-toggle svg {
  width: 14px;
  height: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(160deg, #1f4d84 0%, #173f6e 100%);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(18, 54, 94, 0.24);
}

.brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand-title,
.page-title,
.login-title,
.login-form-title,
.section-head h2,
.module-card h2,
.module-card h3 {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  letter-spacing: -0.03em;
}

.brand-title {
  font-size: 0.82rem;
  font-weight: 700;
}

.brand-subtitle {
  color: var(--ink-faint);
  font-size: 0.56rem;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.nav {
  display: grid;
  gap: 2px;
  justify-items: stretch;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 6px 8px;
  border-radius: 9px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.66rem;
  border: 1px solid transparent;
  transition: 0.2s ease;
  overflow: hidden;
  flex-wrap: nowrap;
}

.nav-icon {
  flex: 0 0 11px;
  width: 11px;
  height: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.nav-icon svg {
  width: 11px;
  height: 11px;
}

.nav-text {
  min-width: 0;
  white-space: nowrap;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-link:hover {
  color: var(--ink);
  background: rgba(234, 241, 248, 0.94);
  border-color: rgba(33, 82, 135, 0.12);
}

.nav-link.active {
  color: var(--primary-deep);
  background: linear-gradient(180deg, #f3f7fb 0%, #edf3f9 100%);
  border-color: rgba(33, 82, 135, 0.18);
  box-shadow: 0 8px 18px rgba(33, 82, 135, 0.1);
}

.workspace-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 44px minmax(0, 1fr) 158px;
}

body.sidebar-collapsed .app-shell.layout-wide-data {
  grid-template-columns: 44px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  padding-left: 10px;
  padding-right: 10px;
}

body.sidebar-collapsed .brand {
  justify-content: center;
}

body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .nav-text {
  display: none;
}

body.sidebar-collapsed .nav-link {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

body.sidebar-collapsed .sidebar-toggle {
  transform: translateY(-50%) rotate(180deg);
}

.page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 5px;
  padding: 9px 11px;
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.page-toolbar::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, rgba(33, 82, 135, 0.16) 100%);
}

.page-kicker,
.section-label,
.context-card-title {
  display: inline-block;
  color: var(--ink-faint);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-kicker {
  color: var(--primary-deep);
}

.page-title {
  margin-top: 5px;
  font-size: clamp(1.02rem, 1.12vw, 1.28rem);
  line-height: 1.08;
}

.page-toolbar-main {
  display: grid;
  gap: 2px;
}

.page-subtitle {
  max-width: 620px;
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 0.71rem;
}

.toolbar-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.toolbar-actions {
  justify-content: flex-end;
}

.toolbar-actions form,
.button-row form {
  margin: 0;
}

.page-content {
  display: grid;
  gap: 6px;
}

.context-rail-inner {
  position: sticky;
  top: 8px;
  display: grid;
  gap: 5px;
  padding: 7px;
  border-radius: var(--radius-xl);
}

.context-card {
  padding: 8px 9px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.context-card.tone-primary {
  background: linear-gradient(180deg, #f5f8fc 0%, #edf3f9 100%);
  border-color: rgba(33, 82, 135, 0.18);
}

.context-card.tone-accent {
  background: linear-gradient(180deg, #fbfdff 0%, #f3f7fd 100%);
}

.context-card-value {
  margin-top: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.context-card-meta,
.bullet-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--ink-soft);
}

.context-card-meta li,
.bullet-list li {
  line-height: 1.6;
}

.section-card,
.summary-item {
  padding: 9px 10px;
  border-radius: var(--radius-xl);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
}

.section-head h2,
.module-card h2,
.module-card h3 {
  font-size: 0.88rem;
  line-height: 1.12;
}

.section-copy,
.helper-text {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 0.69rem;
}

.dashboard-grid,
.summary-grid,
.warning-grid,
.settings-grid {
  display: grid;
  gap: 5px;
}

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

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

.module-card {
  display: grid;
  gap: 5px;
  position: relative;
  overflow: hidden;
  min-height: 142px;
}

.module-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-deep) 0%, rgba(18, 54, 94, 0.08) 100%);
}

.module-headline {
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

.module-headline > div {
  display: grid;
  gap: 3px;
}

.module-icon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(180deg, #eef3f8 0%, #e3ebf4 100%);
  color: var(--primary-deep);
  border: 1px solid rgba(33, 82, 135, 0.12);
}

.module-icon svg {
  width: 9px;
  height: 9px;
}

.module-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.module-fact {
  display: inline-flex;
  align-items: center;
  min-height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid rgba(33, 82, 135, 0.12);
  background: linear-gradient(180deg, #f5f8fc 0%, #edf3f9 100%);
  color: var(--primary-deep);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.module-note {
  margin: -2px 0 0;
  color: var(--ink-soft);
  font-size: 0.66rem;
  line-height: 1.5;
}

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

.module-detail {
  display: grid;
  gap: 4px;
  padding: 5px 6px;
  border-radius: 12px;
  border: 1px solid rgba(33, 82, 135, 0.12);
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fc 100%);
}

.module-detail strong {
  color: var(--primary-deep);
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.module-detail span {
  color: var(--ink-soft);
  font-size: 0.66rem;
  line-height: 1.45;
}

.summary-item {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.summary-item strong {
  font-size: 0.78rem;
  line-height: 1.2;
}

.detail-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.detail-chip,
.pill-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 5px;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 700;
}

.detail-chip {
  background: rgba(234, 241, 248, 0.94);
  border: 1px solid rgba(33, 82, 135, 0.12);
  color: var(--primary-deep);
}

.pill-tag {
  background: #f5f8fb;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  white-space: nowrap;
}

.form-grid {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

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

label {
  display: grid;
  gap: 5px;
}

label > span {
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 600;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="file"],
select {
  width: 100%;
  min-height: 28px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(33, 82, 135, 0.42);
  box-shadow: 0 0 0 3px rgba(33, 82, 135, 0.11);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  max-width: 100%;
}

.button::before,
.button::after {
  content: none !important;
  display: none !important;
}

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

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

.button-primary {
  background: linear-gradient(180deg, #1f4d84 0%, #163c68 100%);
  color: #fff;
  border-color: rgba(18, 54, 94, 0.9);
  box-shadow: var(--shadow-button);
}

.button-secondary {
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  color: var(--primary-deep);
  border-color: var(--line-strong);
  box-shadow: 0 4px 12px rgba(16, 32, 51, 0.04);
}

.button-soft {
  background: linear-gradient(180deg, #f3f7fb 0%, #ebf1f8 100%);
  color: var(--primary-deep);
  border-color: rgba(33, 82, 135, 0.12);
}

.button-primary:hover:not(:disabled) {
  box-shadow: 0 16px 28px rgba(18, 54, 94, 0.2);
}

.button-secondary:hover:not(:disabled),
.button-soft:hover:not(:disabled) {
  border-color: rgba(33, 82, 135, 0.22);
  box-shadow: 0 10px 18px rgba(16, 32, 51, 0.06);
}

.button-success {
  background: linear-gradient(180deg, #269764 0%, #1f7a4f 100%);
  color: #fff;
  border-color: rgba(31, 122, 79, 0.4);
  box-shadow: 0 12px 24px rgba(31, 122, 79, 0.2);
}

.button-success:hover:not(:disabled) {
  box-shadow: 0 16px 28px rgba(31, 122, 79, 0.24);
}

.button-full {
  width: 100%;
}

.empty-panel {
  display: grid;
  gap: 6px;
}

.empty-panel strong {
  font-size: 0.84rem;
}

.narrative-text {
  color: var(--ink);
  line-height: 1.75;
}

.table-commentary {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.commentary-stack {
  display: grid;
  gap: 7px;
}

.commentary-block {
  padding: 9px 10px;
  border-radius: 14px;
  border: 1px solid rgba(33, 82, 135, 0.12);
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fc 100%);
}

.key-status-panel {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  border-radius: 14px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

.key-status-panel strong {
  font-size: 0.84rem;
}

.connection-status-panel {
  margin-top: 8px;
  display: grid;
  gap: 4px;
  padding: 8px 9px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
}

.connection-status-panel.is-success {
  border-color: rgba(31, 122, 79, 0.26);
  background: rgba(31, 122, 79, 0.08);
  color: #145338;
}

.connection-status-panel.is-error {
  border-color: rgba(194, 77, 100, 0.22);
  background: rgba(194, 77, 100, 0.08);
  color: #8d3246;
}

.table-card {
  padding-bottom: 7px;
}

.table-wrap {
  margin-top: 6px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.data-table {
  width: 100%;
  min-width: 980px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
}

.data-table th,
.data-table td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.38;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f7fb;
  color: #6f8098;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.data-table tbody tr:nth-child(even) td {
  background: #fbfdff;
}

.data-table tbody tr:hover td {
  background: #f7fbff;
}

.label-head,
.label-cell {
  width: 28%;
}

.label-cell {
  font-weight: 700;
  color: var(--ink);
  overflow-wrap: break-word;
  word-break: normal;
}

.value-head,
.value-cell,
.index-cell {
  text-align: center;
  white-space: nowrap;
}

.value-head,
.value-cell {
  width: 10%;
}

.formula-head,
.formula-cell {
  width: 22%;
}

.formula-cell {
  color: var(--ink-soft);
  overflow-wrap: break-word;
  word-break: normal;
}

.index-head,
.index-cell {
  width: 4%;
  min-width: 38px;
}

.index-cell {
  font-weight: 700;
  color: var(--ink);
}

.data-table-state .label-cell {
  width: 28%;
}

.data-table-state .formula-cell {
  width: 26%;
}

.data-table-state .value-cell {
  width: 12%;
}

.data-table-state {
  min-width: 900px;
}

.flash-stack {
  display: grid;
  gap: 6px;
}

.flash {
  padding: 8px 9px;
  border-radius: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.73rem;
}

.flash-success {
  color: var(--success);
  border-color: rgba(31, 122, 79, 0.22);
  background: rgba(31, 122, 79, 0.06);
}

.flash-error {
  color: var(--danger);
  border-color: rgba(194, 77, 100, 0.22);
  background: rgba(194, 77, 100, 0.06);
}

.auth-shell {
  min-height: 100vh;
  padding: 12px;
}

.login-shell-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 14px;
  max-width: 980px;
  margin: 0 auto;
  align-items: stretch;
}

.login-showcase,
.login-panel {
  border-radius: 24px;
  padding: 18px;
}

.login-title {
  margin-top: 10px;
  font-size: clamp(1.32rem, 1.8vw, 1.88rem);
  line-height: 1.06;
}

.login-copy {
  margin-top: 10px;
  max-width: 560px;
  color: var(--ink-soft);
}

.login-highlights {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.login-highlight-card {
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(248, 250, 252, 0.94));
  border: 1px solid rgba(213, 223, 234, 0.9);
}

.login-highlight-card strong {
  display: block;
  margin-top: 8px;
  font-size: 0.92rem;
}

.login-highlight-card p {
  margin: 8px 0 0;
  color: var(--ink-soft);
}

.login-form-title {
  margin-top: 8px;
  font-size: 1.55rem;
}

.top-actions-row {
  margin-top: 8px;
}

.commentary-context-form {
  margin-top: 8px;
}

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

.field-span-3 {
  grid-column: 1 / -1;
}

.commentary-context-form label {
  display: grid;
  gap: 5px;
  color: var(--ink-soft);
  font-weight: 600;
}

.commentary-context-form input,
.commentary-context-form select,
.commentary-context-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px 8px;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.commentary-context-form input:focus,
.commentary-context-form select:focus,
.commentary-context-form textarea:focus {
  outline: none;
  border-color: rgba(33, 82, 135, 0.35);
  box-shadow: 0 0 0 3px rgba(33, 82, 135, 0.09);
}

.button-success {
  background: linear-gradient(180deg, #2f9b60 0%, #257e4d 100%);
  color: #fff;
  border-color: rgba(31, 122, 79, 0.88);
  box-shadow: 0 12px 24px rgba(31, 122, 79, 0.18);
}

.button-success:hover:not(:disabled) {
  box-shadow: 0 16px 28px rgba(31, 122, 79, 0.22);
}

.button-success.is-ready {
  position: relative;
  animation: readyPulse 1.4s ease-in-out infinite;
}

.final-report-progress {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(31, 122, 79, 0.18);
  background: linear-gradient(180deg, #f7fcf9 0%, #eef8f1 100%);
  display: grid;
  gap: 6px;
}

.final-report-progress.is-hidden,
.button.is-hidden {
  display: none;
}

.final-report-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.progress-bar-shell {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(31, 122, 79, 0.12);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #2f9b60 0%, #49be79 100%);
  border-radius: inherit;
  transition: width 0.35s ease;
}

.final-report-progress[data-state="failed"],
.final-report-progress[data-state="cancelled"] {
  border-color: rgba(194, 77, 100, 0.2);
  background: linear-gradient(180deg, #fff7f9 0%, #fff0f3 100%);
}

.final-report-progress[data-state="failed"] .progress-bar-fill,
.final-report-progress[data-state="cancelled"] .progress-bar-fill {
  background: linear-gradient(90deg, #c24d64 0%, #d76a7f 100%);
}

.final-report-progress[data-state="completed"] {
  border-color: rgba(31, 122, 79, 0.28);
  background: linear-gradient(180deg, #f6fcf8 0%, #eaf8ef 100%);
}

.progress-success-message,
.final-report-progress[data-state="completed"] [data-progress-message] {
  color: #15633e;
  font-weight: 700;
}

.commentary-formula {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-style: italic;
}

@keyframes readyPulse {
  0%,
  100% {
    box-shadow: 0 12px 24px rgba(31, 122, 79, 0.18);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 18px 30px rgba(31, 122, 79, 0.3);
    transform: translateY(-1px);
  }
}

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

  .context-rail {
    grid-column: 2;
  }

  .context-rail-inner {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .logout-form {
    grid-column: 1 / -1;
  }

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

@media (max-width: 1023px) {
  .sidebar-toggle {
    display: none;
  }

  .app-shell,
  .app-shell.layout-wide-data {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .app-shell.layout-wide-data .sidebar,
  .app-shell.layout-wide-data .context-rail,
  .app-shell.layout-wide-data .logout-form,
  .app-shell.layout-wide-data .context-rail-inner {
    grid-column: auto;
    grid-row: auto;
  }

  .sidebar,
  .context-rail-inner {
    position: static;
    min-height: auto;
  }

  .page-toolbar {
    flex-direction: column;
  }

  .dashboard-grid,
  .settings-grid,
  .warning-grid,
  .summary-grid,
  .field-grid,
  .commentary-context-grid,
  .login-shell-card {
    grid-template-columns: 1fr;
  }

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

  .login-showcase,
  .login-panel {
    padding: 18px;
  }
}

