:root {
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: #172b4d;
  background: #f4f7fb;
  --navy: #191863;
  --accent: #1465dc;
  --accent-2: #28adee;
  --accent-soft: #e7effb;
  --line: #dbe6f3;
  --muted: #64748b;
  --panel: #fff;
  --soft: #f7faff;
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

body {
  margin: 0;
  background: #f6f9fd;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(120deg, rgba(20, 101, 220, 0.08) 0 1px, transparent 1px 42px),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 54%, #eef5ff 100%);
}

.login-overlay.hidden {
  display: none;
}

.login-box {
  width: min(720px, calc(100vw - 32px));
  min-height: 650px;
  display: grid;
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(198, 216, 239, 0.9);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 38px 96px rgba(26, 72, 132, 0.15), 0 1px 0 rgba(255, 255, 255, 0.96) inset;
  backdrop-filter: blur(20px);
}

.login-box::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), transparent 42%),
    linear-gradient(135deg, rgba(20, 101, 220, 0.06), transparent 52%);
}

.login-step {
  min-height: 590px;
  display: grid;
  align-content: stretch;
  gap: 26px;
  padding: 82px 76px 66px;
  position: relative;
  z-index: 1;
  transition: transform 0.36s ease, opacity 0.26s ease;
}

.login-step.hidden {
  display: none;
}

.account-step,
.password-step {
  animation: loginSlideIn 0.32s ease both;
}

.login-window-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  height: 52px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid rgba(219, 230, 243, 0.82);
  background: rgba(248, 251, 255, 0.82);
}

.login-window-bar div {
  display: flex;
  gap: 8px;
}

.login-window-bar span {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #d7e2ee;
}

.login-window-bar span:nth-child(1) {
  background: #ff6b62;
}

.login-window-bar span:nth-child(2) {
  background: #ffbd4c;
}

.login-window-bar span:nth-child(3) {
  background: #00ca56;
}

.login-window-bar strong {
  color: #5d6d83;
  font-size: 13px;
  font-weight: 700;
}

.login-stage-line {
  position: absolute;
  left: 54px;
  right: 54px;
  bottom: 28px;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.login-stage-line span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #d5dfec;
  transition: width 0.24s ease, background 0.24s ease;
}

.login-stage-line span.active {
  width: 34px;
  background: var(--accent);
}

.login-brand-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.login-brand-pill {
  color: #466783;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  border: 1px solid #d8e5f4;
  border-radius: 999px;
  background: #f9fcff;
}

.login-logo {
  width: 190px;
}

.login-hero {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 42px 0 10px;
  text-align: center;
}

.login-hero p,
.login-copy p {
  margin: 0;
  color: var(--accent);
  font-weight: 700;
}

.login-hero h2,
.login-copy h2 {
  margin: 0;
  color: var(--navy);
  font-size: 52px;
  line-height: 1.1;
  font-weight: 800;
}

.login-hero span,
.login-copy span {
  max-width: 390px;
  color: #52637a;
  line-height: 1.75;
}

.login-hero span {
  justify-self: center;
  font-size: 16px;
}

.login-path {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 10px;
  padding: 7px;
  border: 1px solid #dce9f8;
  border-radius: 999px;
  background: rgba(248, 251, 255, 0.86);
}

.login-path span {
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #5f7289;
  font-size: 13px;
  font-weight: 700;
}

.login-path span.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px rgba(20, 101, 220, 0.18);
}

.login-preview {
  align-self: end;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 5px 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid #d6e6f7;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(20, 101, 220, 0.07);
}

.login-preview span {
  grid-row: span 2;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.login-preview strong {
  color: var(--navy);
  font-size: 16px;
}

.login-preview em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.login-copy {
  display: grid;
  justify-items: center;
  gap: 12px;
  align-content: center;
  min-height: 250px;
  text-align: center;
}

.login-next,
.login-submit {
  width: 100%;
  height: 54px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 12px 28px rgba(20, 101, 220, 0.22);
}

.back-btn {
  justify-self: start;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #43546d;
  padding: 0 14px;
}

.back-btn:hover {
  border-color: #9fc3f5;
  color: var(--accent);
}

.walkin-field {
  display: grid;
  gap: 8px;
  padding: 19px 21px;
  border: 1px solid #d7e6f7;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(25, 53, 94, 0.06);
}

.walkin-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-box input {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 0;
  padding: 0;
  outline: none;
  color: var(--navy);
  background: transparent;
  font-size: 20px;
  font-weight: 700;
}

.login-box p {
  min-height: 18px;
  margin: 0;
  font-size: 13px;
}

#loginError {
  color: #9b1c1c;
}

#loginAccountHint {
  color: #9b1c1c;
}

@keyframes loginSlideIn {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .login-overlay {
    padding: 14px;
    place-items: stretch;
  }

  .login-box {
    width: 100%;
    min-height: calc(100vh - 28px);
    border-radius: 22px;
  }

  .login-step {
    min-height: calc(100vh - 28px);
    padding: 70px 22px 58px;
  }

  .login-stage-line {
    left: 22px;
    right: 22px;
  }

  .login-hero h2,
  .login-copy h2 {
    font-size: 34px;
  }

  .login-logo {
    width: 148px;
  }

  .login-brand-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-window-bar {
    grid-template-columns: 1fr;
  }

  .login-window-bar strong {
    display: none;
  }
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  background: #fff;
  color: #172b4d;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 28px rgba(20, 101, 220, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.sidebar .brand {
  display: grid;
  gap: 10px;
}

.brand-logo {
  width: 138px;
  height: auto;
  display: block;
  padding: 6px 8px;
  border-radius: 7px;
  background: var(--navy);
}

.sidebar .brand-logo {
  width: 154px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f3c766;
  color: var(--navy);
  font-weight: 800;
}

.brand span,
.scope-box p,
.eyebrow,
.panel-head p,
.note {
  color: var(--muted);
}

.brand span {
  display: block;
  margin-top: 4px;
  color: #52637a;
  font-size: 12px;
}

nav {
  display: grid;
  gap: 6px;
}

nav button {
  border: 0;
  background: transparent;
  color: #43546d;
  display: flex;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 7px;
  text-align: left;
}

nav button.active,
nav button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.scope-box {
  margin-top: auto;
  padding: 12px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f3f8ff, #fff);
  border: 1px solid var(--line);
}

.scope-box p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}

.main {
  padding: 22px 26px 34px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: -22px -26px 22px;
  padding: 18px 26px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 26px rgba(15, 42, 86, 0.04);
}

.security-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: -8px 0 18px;
  padding: 12px 14px;
  border: 1px solid #b8d7ff;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #f4f8ff;
}

.security-banner.hidden {
  display: none;
}

.security-banner div {
  display: grid;
  gap: 4px;
}

.security-banner strong {
  color: var(--navy);
}

.security-banner span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

h1,
h2 {
  margin: 0;
  color: var(--navy);
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.search,
.form-grid input,
.form-grid select,
.stack-form input,
.stack-form select,
.stack-form textarea {
  height: 38px;
  border: 1px solid #ccd9eb;
  border-radius: 7px;
  background: #fff;
  padding: 0 10px;
  outline: none;
}

.stack-form textarea {
  min-height: 74px;
  height: auto;
  padding: 9px 10px;
  resize: vertical;
}

.json-input {
  width: 100%;
  min-height: 270px;
  resize: vertical;
  border: 1px solid #ccd9eb;
  border-radius: 7px;
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  outline: none;
}

.search {
  min-width: 280px;
}

.user-chip,
.primary {
  height: 38px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.danger {
  height: 34px;
  border: 1px solid #fecaca;
  background: #fff7f7;
  color: #9b1c1c;
  border-radius: 7px;
  padding: 0 10px;
}

.select-small {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 8px;
}

.mini-btn {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 9px;
  margin-left: 6px;
  color: #172b4d;
}

.mini-btn:hover,
.tab-btn:hover {
  border-color: #9fc3f5;
  background: #f4f8ff;
}

.inline-input,
.inline-number {
  width: 100%;
  min-width: 80px;
  height: 32px;
  border: 1px solid #ccd9eb;
  border-radius: 7px;
  padding: 0 8px;
}

.inline-number {
  max-width: 86px;
}

.file-path-input {
  min-width: 260px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.edit-form {
  margin: 16px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faff;
}

.legacy-panel {
  margin: 12px 0 0;
  padding: 12px;
  border: 1px solid #e4ecef;
  border-radius: 8px;
  background: #f8fbff;
}

.legacy-panel p {
  margin: 6px 0 10px;
  color: var(--muted);
}

.legacy-panel div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.legacy-panel span {
  display: inline-flex;
  border-radius: 6px;
  padding: 4px 7px;
  background: #edf5ff;
  font-size: 12px;
}

.legacy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.legacy-actions .mini-btn {
  margin-left: 0;
}

.legacy-actions .mini-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.project-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 12px;
  margin-bottom: 14px;
}

.overview-main,
.overview-side {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.overview-main {
  padding: 14px;
}

.overview-title {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.overview-title h2 {
  font-size: 20px;
  line-height: 1.35;
}

.overview-title p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

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

.overview-grid div,
.overview-side div {
  padding: 9px;
  border-radius: 7px;
  background: #f4f8f9;
}

.overview-grid span,
.overview-side span,
.detail-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.overview-grid strong,
.overview-side strong {
  display: block;
  color: var(--navy);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.overview-side {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.user-chip {
  border: 1px solid #ccd9eb;
  background: #fff;
  padding: 0 12px;
}

.primary {
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 0 12px;
}

.view {
  display: none;
  gap: 18px;
}

.view.active {
  display: grid;
}

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

.metrics article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
}

.metrics article,
.panel {
  padding: 16px;
}

.metrics strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 28px;
}

.trial-handoff {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 1.25fr);
  gap: 16px;
  padding: 18px;
  border: 1px solid #c9ddf6;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f5f9ff);
}

.trial-handoff.ok {
  border-color: #bfdccf;
}

.trial-handoff.warn {
  border-color: #f0d59b;
  background: linear-gradient(180deg, #fff, #fffaf0);
}

.trial-handoff.danger {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff, #fff6f6);
}

.trial-handoff-main {
  display: grid;
  align-content: center;
  gap: 8px;
}

.trial-handoff-main h2 {
  font-size: 24px;
}

.trial-handoff-main p,
.trial-handoff-main small {
  margin: 0;
  color: #52637a;
  line-height: 1.6;
}

.trial-handoff-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.trial-handoff-stats div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: #fff;
}

.trial-handoff-stats span,
.trial-handoff-stats small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.trial-handoff-stats strong {
  color: var(--navy);
  font-size: 20px;
}

.trial-handoff-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

.trial-handoff-actions .mini-btn {
  margin-left: 0;
  background: #fff;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.panel-head h2 {
  font-size: 17px;
}

.panel-head > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.check-list,
.log-list {
  display: grid;
  gap: 10px;
}

.check-list p,
.log-list p {
  margin: 0;
  padding: 10px;
  border-radius: 7px;
  background: #f4f8ff;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  white-space: nowrap;
  background: #edf5ff;
  color: #42526e;
}

.badge.ok {
  background: #e6f5ee;
  color: #157347;
}

.badge.warn {
  background: #fff5d8;
  color: #806100;
}

.badge.info {
  background: #e3f1f7;
  color: var(--accent);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  background: #f7fafb;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.password-panel.must-change {
  border-color: #f0d59b;
  background: #fffdf6;
  box-shadow: inset 4px 0 0 #f3b33d;
}

.password-callout {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #f0d59b;
  border-radius: 8px;
  background: #fff8e7;
}

.password-callout.hidden {
  display: none;
}

.password-callout strong {
  color: #8a5b00;
}

.password-callout span {
  color: #52637a;
  line-height: 1.55;
}

.stack-form {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.trial-issues {
  display: grid;
  gap: 8px;
}

.trial-issues article {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faff;
}

.trial-issues article > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.trial-issues p {
  margin: 0;
  color: #52637a;
  line-height: 1.5;
}

.trial-issues small {
  color: var(--muted);
}

.issue-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.issue-actions .mini-btn {
  margin-left: 0;
}

.create-drawer {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
}

.create-drawer summary {
  padding: 9px 10px;
  cursor: pointer;
  color: #172b4d;
  font-weight: 700;
}

.create-drawer .stack-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0 10px 10px;
}

.create-drawer .primary {
  grid-column: 1 / -1;
}

.project-layout {
  grid-template-columns: minmax(520px, 0.95fr) minmax(0, 1.05fr);
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.tab-btn {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 12px;
}

.tab-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.legacy-table {
  min-width: 760px;
}

.legacy-table tr.selected-row td {
  background: #eef5ff;
}

.oa-project-list {
  display: grid;
  gap: 6px;
  max-height: calc(100vh - 270px);
  overflow: auto;
  padding-right: 4px;
}

.oa-project-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.85fr);
  gap: 10px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 9px 10px;
  color: inherit;
  text-align: left;
}

.oa-project-row:hover,
.oa-project-row.selected {
  border-color: #9fc3f5;
  background: #fbfdfd;
}

.oa-project-row.selected {
  box-shadow: inset 3px 0 0 var(--accent);
}

.oa-project-main {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.oa-project-title strong,
.oa-project-title span,
.oa-project-meta span,
.oa-project-side span,
.oa-project-side b,
.oa-project-side small {
  display: block;
}

.oa-project-title strong {
  color: #172b4d;
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.oa-project-title span,
.oa-project-meta,
.oa-project-side small {
  color: var(--muted);
  font-size: 12px;
}

.oa-project-meta {
  display: grid;
  gap: 4px;
  line-height: 1.35;
}

.oa-project-meta span {
  overflow-wrap: anywhere;
}

.oa-project-side {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-items: stretch;
}

.oa-project-side span,
.oa-project-side em {
  min-width: 0;
  padding: 7px 8px;
  border-radius: 6px;
  background: #f7faff;
}

.oa-project-side b {
  margin-bottom: 3px;
  color: #172b4d;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.oa-project-side em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-style: normal;
}

.project-filter-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
}

.project-filter-bar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.project-filter-bar .select-small {
  width: 100%;
}

.check-filter {
  align-content: end;
}

.check-filter input {
  width: auto;
  height: auto;
}

.project-summary-line,
.list-footer,
.project-work-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.project-summary-line {
  padding: 8px 10px;
  border-radius: 7px;
  background: #f4f8ff;
}

.project-summary-line span {
  font-weight: 700;
  color: var(--navy);
}

.list-footer {
  justify-content: space-between;
  margin-top: 10px;
}

.project-work-tabs {
  margin: 0 0 12px;
}

.oa-project-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.7fr);
  gap: 12px;
  margin-bottom: 12px;
}

.oa-project-identity,
.oa-money-strip,
.oa-field-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.oa-project-identity {
  padding: 14px;
}

.oa-project-identity h2 {
  margin-top: 7px;
  font-size: 20px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.oa-project-identity p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.oa-money-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.oa-money-strip div {
  padding: 12px;
  background: #fff;
}

.oa-money-strip span,
.oa-field-table span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.oa-money-strip strong {
  display: block;
  color: #172b4d;
  font-size: 17px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.oa-project-ledger {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.oa-field-section {
  padding: 10px;
}

.oa-field-section h3 {
  margin: 0 0 10px;
  color: #172b4d;
  font-size: 15px;
}

.oa-field-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: var(--line);
}

.oa-field-table div {
  min-width: 0;
  padding: 7px 8px;
  background: #fff;
}

.oa-field-table div.wide {
  grid-column: 1 / -1;
}

.oa-field-table strong {
  display: block;
  min-height: 19px;
  color: #172b4d;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.stage-strip {
  display: grid;
  grid-template-columns: repeat(11, minmax(78px, 1fr));
  gap: 5px;
  margin: 8px 0 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.stage-strip button {
  min-height: 68px;
  display: grid;
  gap: 4px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 7px;
  text-align: left;
}

.stage-strip button.done {
  border-color: #b8d7ff;
  background: #f4f8ff;
}

.stage-strip button.active {
  border-color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.stage-strip b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #eef4f5;
  color: #172b4d;
}

.stage-strip span {
  color: #172b4d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.stage-strip em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.edit-drawer {
  margin-bottom: 12px;
  border: 1px solid #e1eaed;
  border-radius: 8px;
  background: #f8fbff;
}

.edit-drawer summary {
  padding: 10px 12px;
  cursor: pointer;
  color: var(--navy);
  font-weight: 700;
}

.edit-drawer .edit-form {
  padding: 0 12px 12px;
}

.missing-hints {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.missing-hints.has-missing {
  border-color: #f0d59b;
  background: #fff8e7;
}

.missing-hints.complete {
  border-color: #bcdcca;
  background: #f0f8f3;
}

.missing-hints strong {
  color: var(--navy);
}

.missing-hints span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.project-card {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  text-align: left;
  padding: 12px;
}

.project-card.selected {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.project-card strong,
.project-card span {
  display: block;
}

.project-card span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

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

.detail-grid div {
  padding: 10px;
  border-radius: 7px;
  background: #f5f8f9;
}

.stage-entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.stage-entry {
  min-height: 82px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 3px 8px;
  align-items: start;
  border: 1px solid #e2ecee;
  border-radius: 7px;
  background: #fff;
  padding: 9px;
  text-align: left;
}

.stage-entry.active {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.stage-entry b {
  grid-row: span 3;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #e7effb;
}

.stage-entry span {
  padding: 0;
  background: transparent;
  color: var(--navy);
  font-weight: 700;
}

.stage-entry small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.stage-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
  gap: 12px;
  align-items: start;
}

.stage-workspace .stage-entry-grid {
  grid-template-columns: 1fr;
}

.stage-detail-panel {
  min-height: 320px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.stage-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.stage-summary-grid div {
  display: block;
  min-width: 0;
  padding: 9px;
  border-radius: 7px;
  background: #f5f8f9;
}

.stage-summary-grid span {
  display: block;
  margin: 0 0 4px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.stage-summary-grid strong {
  display: block;
  color: var(--navy);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.stage-record-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.stage-record-summary div {
  min-width: 0;
  padding: 9px;
  border-radius: 7px;
  background: #edf5f6;
}

.stage-record-summary span {
  display: block;
  margin: 0 0 4px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.stage-record-summary strong {
  display: block;
  color: var(--navy);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.stage-edit-line {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.stage-edit-line .mini-btn {
  margin-left: 0;
}

.empty-hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.section-title {
  margin: 12px 0 10px;
}

.project-progress-line {
  margin: 14px 0;
}

.project-progress-line .progress {
  margin: 8px 0 0;
}

.workspace-pane {
  display: none;
}

.workspace-pane.active {
  display: block;
}

.compact-grid {
  margin: 16px 0;
}

.sub-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.timeline-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  max-height: 220px;
  overflow: auto;
}

.amount-records {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.amount-ledger-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.amount-ledger-summary div {
  min-width: 0;
  padding: 10px;
  border-radius: 7px;
  background: var(--soft);
}

.amount-ledger-summary span,
.amount-ledger-summary small,
.file-type-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.amount-ledger-summary strong {
  display: block;
  margin: 4px 0;
  color: #172b4d;
  font-size: 18px;
}

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

.ledger-box {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.file-type-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.file-type-summary div {
  padding: 9px;
  border-radius: 7px;
  background: var(--soft);
}

.file-type-summary strong {
  display: block;
  margin-top: 3px;
  color: #172b4d;
  font-size: 18px;
}

.file-ledger {
  display: grid;
  gap: 8px;
}

.file-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 74px auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.file-row > div:first-child {
  display: grid;
  gap: 5px;
  justify-items: start;
}

.file-row-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.file-row-main strong {
  color: #172b4d;
  overflow-wrap: anywhere;
}

.file-row-main small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.file-row-kind {
  justify-self: start;
  padding: 5px 8px;
  border-radius: 999px;
  background: #edf5ff;
  color: #172b4d;
  font-size: 12px;
}

.file-row-actions {
  display: flex;
  gap: 6px;
}

.file-row-actions .mini-btn {
  margin-left: 0;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ops-grid article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faff;
}

.ops-grid span,
.ops-grid small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.ops-grid strong {
  display: block;
  margin: 5px 0;
  color: var(--navy);
  font-size: 17px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ops-grid article.wide {
  grid-column: 1 / -1;
}

.ops-health,
.ops-launch,
.ops-readiness {
  display: grid;
  gap: 8px;
}

.ops-health.ok,
.ops-launch.ok,
.ops-readiness.ok {
  border-color: #bcdcca;
  background: #f0f8f3;
}

.ops-health.warn,
.ops-launch.warn,
.ops-readiness.warn {
  border-color: #f0d59b;
  background: #fff8e7;
}

.ops-health.danger,
.ops-launch.danger,
.ops-readiness.danger {
  border-color: #fecaca;
  background: #fff7f7;
}

.ops-launch strong {
  font-size: 22px;
}

.ops-launch p {
  margin: 0;
  color: #52637a;
  line-height: 1.55;
}

.launch-items {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.launch-items em {
  padding: 5px 8px;
  border: 1px solid #dbe6f3;
  border-radius: 999px;
  background: #fff;
  color: #52637a;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.launch-items em.ok {
  border-color: #bcdcca;
  color: #16723b;
}

.launch-items em.warn {
  border-color: #f0d59b;
  color: #8a5b00;
}

.launch-items em.danger {
  border-color: #fecaca;
  color: #9b1c1c;
}

.readiness-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.readiness-list p {
  min-width: 0;
  display: grid;
  grid-template-columns: 64px minmax(72px, 0.55fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 8px;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: #fff;
}

.readiness-list b {
  justify-self: start;
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef5ff;
  color: #52637a;
  font-size: 12px;
}

.readiness-list span {
  color: var(--navy);
  font-weight: 700;
}

.readiness-list small {
  overflow-wrap: anywhere;
}

.readiness-list p.ok b {
  background: #e8f6ee;
  color: #16723b;
}

.readiness-list p.warn b {
  background: #fff2cf;
  color: #8a5b00;
}

.readiness-list p.danger b {
  background: #fee2e2;
  color: #9b1c1c;
}

.trial-next-step {
  display: grid;
  gap: 7px;
  margin-top: 4px;
  padding: 10px;
  border: 1px dashed #c9d7ea;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.trial-next-step b {
  color: var(--navy);
}

.trial-next-step p {
  margin: 0;
  color: #52637a;
  line-height: 1.55;
}

.trial-next-step .mini-btn {
  justify-self: start;
  margin-left: 0;
}

.ops-alerts {
  display: grid;
  gap: 6px;
}

.ops-alerts p {
  margin: 0;
  color: #52637a;
  line-height: 1.5;
}

.timeline-list p {
  margin: 0;
  padding: 9px;
  border-radius: 7px;
  background: #f3f7f8;
}

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

.board-column {
  min-height: 160px;
  padding: 12px;
  border: 1px solid #e4ecef;
  border-radius: 8px;
  background: #f7faff;
}

.board-column .panel-head {
  margin-bottom: 10px;
}

.board-card {
  width: 100%;
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  text-align: left;
}

.board-card span,
.board-card small {
  color: var(--muted);
}

.amount-summary strong {
  display: block;
  margin-top: 5px;
}

.secondary-action {
  margin-left: 8px;
  background: #315f75;
}

.progress {
  height: 10px;
  margin: 16px 0;
  border-radius: 999px;
  background: #e5ecee;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: #1d7b76;
}

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

.stage-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e5ecee;
  border-radius: 7px;
}

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

.stage-main small {
  color: var(--muted);
  font-size: 12px;
}

.stage-note {
  min-width: 0;
}

.stage-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stage-actions .mini-btn {
  margin-left: 0;
}

.source {
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 12px;
}

.source.legacy {
  color: #744e00;
  background: #fff3cc;
}

.source.local {
  color: #135d3d;
  background: #e3f6ec;
}

@media (max-width: 980px) {
  .app-shell,
  .metrics,
  .trial-handoff,
  .trial-handoff-stats,
  .grid.two,
  .project-layout,
  .project-overview,
  .project-filter-bar,
  .oa-project-row,
  .oa-project-head,
  .oa-project-ledger,
  .missing-hints,
  .overview-grid,
  .stage-list,
  .stage-entry-grid,
  .stage-workspace,
  .stage-summary-grid,
  .stage-record-summary,
  .amount-ledger-summary,
  .amount-ledger-grid,
  .file-type-summary,
  .file-row,
  .board {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .topbar,
  .top-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .stage-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .stage-actions {
    grid-column: 2;
  }

  .stage-edit-line {
    grid-template-columns: 1fr;
  }

  .oa-project-list {
    max-height: none;
  }

  .oa-project-side,
  .oa-money-strip,
  .oa-field-table {
    grid-template-columns: 1fr;
  }

  .stage-strip {
    grid-template-columns: repeat(11, 96px);
  }

  .file-row-actions {
    flex-wrap: wrap;
  }

  .secondary-action {
    margin: 8px 0 0;
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .project-list,
  .legacy-actions,
  .project-work-tabs,
  .edit-drawer,
  .danger,
  [data-export-project],
  [data-print-project] {
    display: none !important;
  }

  .app-shell,
  .view.active,
  .project-layout {
    display: block;
  }

  .main,
  .panel {
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .oa-project-ledger,
  .amount-ledger-grid {
    grid-template-columns: 1fr;
  }
}
