:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #000000;
  --muted: #737373;
  --subtle: #6f6f6f;
  --line: #ededed;
  --line-strong: #d8d8d8;
  --soft: #f9f9f9;
  --pink: #ff4665;
  --light-pink: #ffcdea;
  --pink-soft: #fff3f7;
  --pink-strong: #ed3153;
  --green: #147a55;
  --green-soft: #edf8f3;
  --amber: #8a6400;
  --amber-soft: #fff8e6;
  --red: #b45345;
  --red-soft: #fff3f1;
  --blue: #316da8;
  --focus: #ff4665;
  --brand-gradient: linear-gradient(90deg, #fe7ac6 31%, #ff4665 84%);
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.055);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--pink); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, .button-link { min-height: 42px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.topbar {
  position: sticky;
  z-index: 100;
  top: 0;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
}
.topbar-inner {
  width: min(1500px, 100%);
  min-height: 56px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; color: var(--ink); }
.brand:hover { color: var(--ink); }
.vertus-wordmark { display: block; flex: 0 0 auto; width: 96px; height: 20px; color: currentColor; }
.brand-label {
  padding-left: 12px;
  border-left: 1px solid #d6d6d6;
  color: #6f6f6f;
  font-size: 12px;
  white-space: nowrap;
}
.top-actions { display: flex; align-items: center; gap: 9px; }
.top-actions form { margin: 0; }
.top-actions > a { color: #555555; font-size: 12px; }
.top-actions .home-link { color: var(--ink); }

main { width: min(1500px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 72px; }
footer {
  padding: 27px 20px 32px;
  border-top: 1px solid var(--line);
  background: var(--soft);
  color: #6f6f6f;
  text-align: center;
  font-size: 10px;
}

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: 38px; font-weight: 500; line-height: 1.08; letter-spacing: 0; }
h2 { margin-bottom: 0; font-size: 20px; font-weight: 500; line-height: 1.2; letter-spacing: 0; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #555555;
  font-size: 12px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.eyebrow::before { content: ""; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--brand-gradient); }
.lede { max-width: 760px; margin-bottom: 0; color: #666666; line-height: 1.45; }

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}
.metrics > div { min-width: 0; padding: 19px 20px; border-right: 1px solid var(--line); }
.metrics > div:last-child { border-right: 0; }
.metrics span, .metrics strong { display: block; }
.metrics span { color: var(--subtle); font-size: 11px; }
.metrics strong { overflow: hidden; margin-top: 5px; font-size: 23px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }

.capital-section { margin: 30px 0 24px; }
.capital-section-head { margin-bottom: 12px; }
.capital-environment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.capital-environment {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.capital-environment-live { border-left: 4px solid var(--pink); }
.capital-environment-paper { border-left: 4px solid var(--blue); }
.capital-environment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}
.capital-environment-head > strong {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 500;
}
.environment-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.environment-badge::before {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--line-strong);
  content: "";
}
.environment-live::before { background: var(--pink); }
.environment-paper::before { background: var(--blue); }
.capital-environment dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}
.capital-environment dl > div { min-width: 0; }
.capital-environment dt {
  color: var(--subtle);
  font-size: 10px;
}
.capital-environment dd {
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.capital-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(500px, 0.85fr);
  gap: 16px;
  align-items: stretch;
}
.capital-grid > .panel { height: 100%; }
.capital-chart-panel { display: flex; min-height: 390px; flex-direction: column; }
.capital-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 2px 0 8px;
  color: var(--subtle);
  font-size: 11px;
}
.capital-chart-head > div { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.capital-chart-head span { display: inline-flex; align-items: center; gap: 7px; }
.capital-chart-head strong { color: var(--ink); font-size: 11px; font-weight: 500; }
.legend-line { display: inline-block; width: 22px; height: 3px; border-radius: 2px; }
.legend-line.live-nav-line { background: #30343a; }
.legend-line.live-managed-line { background: var(--pink); }
.legend-line.paper-nav-line {
  height: 2px;
  background: repeating-linear-gradient(90deg, #9099a3 0 6px, transparent 6px 9px);
}
.legend-line.paper-managed-line { background: var(--blue); }
.capital-history-chart { display: block; width: 100%; min-height: 280px; margin-top: auto; overflow: visible; }
.capital-history-chart.mobile-chart { display: none; }
.capital-history-chart text { fill: #777777; font-size: 10px; }
.capital-grid-line { stroke: #ececec; stroke-width: 1; }
.capital-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}
.capital-line.live-nav-line { stroke: #30343a; stroke-width: 2.4; }
.capital-line.live-managed-line { stroke: var(--pink); }
.capital-line.paper-nav-line {
  stroke: #9099a3;
  stroke-dasharray: 6 4;
  stroke-width: 2.4;
}
.capital-line.paper-managed-line { stroke: var(--blue); }
.capital-dot { stroke: var(--paper); stroke-width: 2; vector-effect: non-scaling-stroke; }
.capital-dot.live-nav-dot { fill: #30343a; }
.capital-dot.live-managed-dot { fill: var(--pink); }
.capital-dot.paper-nav-dot { fill: #9099a3; }
.capital-dot.paper-managed-dot { fill: var(--blue); }
.capital-chart-empty {
  min-height: 280px;
  display: grid;
  place-items: center;
  color: var(--subtle);
  text-align: center;
}
.capital-strategies { min-height: 390px; }
.capital-strategies table { min-width: 100%; table-layout: fixed; }
.capital-strategies th:nth-child(1) { width: 28%; }
.capital-strategies th:nth-child(2) { width: 21%; }
.capital-strategies th:nth-child(3) { width: 21%; }
.capital-strategies th:nth-child(4) { width: 30%; }
.capital-strategies th, .capital-strategies td { padding-inline: 8px; }
.table-scroll.capital-table-scroll { max-height: 310px; }
.capital-value { min-width: 0; }
.capital-value strong { overflow-wrap: anywhere; }
.capital-value small { margin-top: 3px; }
.capital-empty-value { color: var(--subtle); }
.capital-bar {
  display: block;
  appearance: none;
  width: 100%;
  height: 4px;
  margin-top: 7px;
  overflow: hidden;
  border: 0;
  border-radius: 2px;
  background: #eeeeee;
}
.capital-bar::-webkit-progress-bar { border-radius: inherit; background: #eeeeee; }
.capital-bar::-webkit-progress-value { border-radius: inherit; background: var(--pink); }
.capital-bar::-moz-progress-bar { border-radius: inherit; background: var(--pink); }

.split { display: grid; grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); gap: 16px; margin: 16px 0; align-items: start; }
.panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.panel.full { margin: 16px 0; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head > span { color: var(--subtle); font-size: 11px; white-space: nowrap; }

.stack { display: grid; gap: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
label { display: block; color: #555555; font-size: 12px; font-weight: 500; }
label:not(.file-picker) > span { margin-left: 4px; color: var(--subtle); font-weight: 400; }
label:not(.check):not(.file-picker) > :is(input, select, textarea) { display: block; margin-top: 6px; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  outline: 0;
  background: var(--paper);
  color: var(--ink);
}
input, select { height: 46px; padding: 0 16px; }
select {
  appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23555' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 8px;
}
textarea { min-height: 92px; resize: vertical; padding: 13px 16px; border-radius: 18px; }
input:focus, select:focus, textarea:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 70, 101, 0.1); }
.check { display: flex; align-items: center; gap: 9px; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--pink); }

button, .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: fit-content;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 9px 15px;
  cursor: pointer;
  background: var(--paper);
  color: var(--ink);
  font-weight: 500;
}
button:hover, .button-link:hover { border-color: var(--pink); color: var(--pink); }
.primary { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.primary:hover { border-color: var(--pink); background: var(--pink); color: var(--paper); }
.quiet { min-height: 34px; padding: 6px 11px; background: var(--paper); }
.danger { min-height: 34px; padding: 6px 11px; border-color: #dfb5af; background: var(--paper); color: var(--red); }
.danger:hover { border-color: var(--red); background: var(--red-soft); color: var(--red); }

.alert { margin: 12px 0 18px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 10px; padding: 12px 14px; background: var(--soft); }
.alert.success { border-left-color: var(--green); background: var(--green-soft); }
.alert.warning { border-left-color: var(--amber); background: var(--amber-soft); color: #654d00; }
.alert.error { border-left-color: var(--red); background: var(--red-soft); color: #8f3f34; }

.table-scroll { width: 100%; max-height: 520px; overflow: auto; scrollbar-color: #c9c9c9 var(--soft); }
table { width: 100%; min-width: 880px; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { position: sticky; z-index: 2; top: 0; background: var(--soft); color: #6f6f6f; font-size: 10px; font-weight: 500; text-transform: uppercase; }
.sort-button {
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-transform: inherit;
  white-space: nowrap;
}
.sort-button::after { content: "\2195"; color: #a5a5a5; font-size: 11px; line-height: 1; }
.sortable-table th[aria-sort="ascending"] .sort-button::after { content: "\2191"; color: var(--pink); }
.sortable-table th[aria-sort="descending"] .sort-button::after { content: "\2193"; color: var(--pink); }
.controls-cell { width: 1%; white-space: nowrap; }
tbody tr:hover td { background: #fffafb; }
td strong, td small { display: block; }
td small { max-width: 520px; margin-top: 4px; overflow: hidden; color: var(--subtle); font-size: 11px; text-overflow: ellipsis; }
td code { color: #555555; font-size: 11px; word-break: break-all; }
.empty { padding: 32px 12px; color: var(--subtle); text-align: center; }
.actions, .release-controls { display: flex; flex-wrap: nowrap; align-items: center; gap: 7px; }
.actions form, .release-controls form { margin: 0; }
.controls-cell > form { margin: 0; }
.controls-cell button { white-space: nowrap; }
.expiry-form { display: grid; grid-template-columns: 178px auto; align-items: center; gap: 6px; }
.expiry-form input { width: 178px; height: 34px; padding-inline: 11px; }
.notes-row td { padding-top: 8px; padding-bottom: 14px; background: #fcfcfc; }
.notes-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.notes-form input { height: 38px; }
.notes-form button { min-height: 38px; }

.state, .stream-tag {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 3px 10px;
  color: #666666;
  background: var(--paper);
  font-size: 11px;
  font-weight: 500;
}
.stream-tag { color: var(--blue); }
.tone-good { color: var(--green) !important; border-color: #b9decf !important; background: var(--green-soft) !important; }
.tone-warn { color: var(--amber) !important; border-color: #ead9a8 !important; background: var(--amber-soft) !important; }
.tone-bad { color: var(--red) !important; border-color: #e5c1bb !important; background: var(--red-soft) !important; }
.tone-neutral { color: #666666 !important; }

.upload-row { display: grid; grid-template-columns: minmax(220px, 1fr) auto minmax(120px, 0.7fr); gap: 10px; align-items: center; margin-bottom: 16px; }
.file-picker { position: relative; min-height: 44px; display: flex; align-items: center; border: 1px dashed var(--line-strong); border-radius: 12px; padding: 9px 14px; cursor: pointer; }
.file-picker:hover { border-color: var(--pink); background: var(--pink-soft); }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-picker span { overflow: hidden; color: #666666; text-overflow: ellipsis; white-space: nowrap; }
.upload-status { color: var(--subtle); font-size: 12px; }

.login-shell {
  min-height: calc(100vh - 211px);
  padding: 16px 0;
  display: grid;
  grid-template-columns: minmax(0, 430px) minmax(360px, 1fr);
  gap: 72px;
  align-items: center;
}
.login-shell::after {
  content: "";
  min-height: 520px;
  border-radius: 24px;
  background: linear-gradient(145deg, #ffcdea 0%, #fe7ac6 48%, #ff4665 100%);
}
.login-panel { width: 100%; padding: 0; background: transparent; }
.login-panel h1 { font-size: 42px; }
.login-panel .stack { margin-top: 26px; }

.secret-panel { max-width: 900px; }
.secret-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.detail-grid div { border-top: 1px solid var(--line); padding-top: 10px; }
dt { color: #6f6f6f; font-size: 10px; text-transform: uppercase; }
dd { margin: 5px 0 0; color: var(--ink); }

.release-grid { display: grid; gap: 14px; }
.release-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(380px, 1.3fr) auto;
  gap: 24px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.release-card.latest { border-top: 4px solid var(--pink); }
.release-card h2 { margin-bottom: 8px; font-size: 22px; }
.release-card p { margin-bottom: 0; color: #666666; }
.release-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 18px; margin: 0; }
.release-meta div { min-width: 0; }
.release-meta code { display: block; overflow: hidden; color: #555555; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1180px) {
  .capital-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics > div:nth-child(2) { border-right: 0; }
  .metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .split { grid-template-columns: 1fr; }
  .release-card { grid-template-columns: 1fr; }
  .release-card .button-link { width: 100%; }
  .login-shell { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .login-shell::after { grid-row: 1; min-height: 190px; }
  .login-panel { grid-row: 2; max-width: 520px; margin: auto; }
}

@media (max-width: 650px) {
  .topbar-inner { padding: 0 16px; }
  .brand-label { display: none; }
  .top-actions > a:not(.home-link) { display: none; }
  main { width: min(100% - 32px, 1500px); padding-top: 30px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 29px; letter-spacing: 0; }
  .metrics, .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .metrics > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .metrics > div:last-child { border-bottom: 0; }
  .capital-environment-grid { grid-template-columns: 1fr; }
  .capital-environment dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .capital-strategies table { min-width: 560px; }
  .panel { padding: 17px; border-radius: 14px; }
  .capital-chart-panel { min-height: 0; }
  .capital-history-chart.desktop-chart { display: none; }
  .capital-history-chart.mobile-chart { display: block; min-height: 0; }
  .upload-row, .secret-row { grid-template-columns: 1fr; }
  .upload-row button, .secret-row button { width: 100%; }
  .release-meta { grid-template-columns: 1fr; }
  .login-shell { min-height: 0; padding-top: 0; }
  .login-shell::after { min-height: 160px; border-radius: 18px; }
  .login-panel h1 { font-size: 29px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
