:root {
  --paper: #f7f3ea;
  --ink: #25231e;
  --muted: #716b60;
  --line: #d8cfbf;
  --panel: #fffaf0;
  --accent: #0e6f68;
  --accent-strong: #074c47;
  --gold: #b07823;
  --red: #a23b35;
  --shadow: 0 18px 55px rgba(60, 45, 22, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(37, 35, 30, 0.035) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(180deg, #fbf8f0 0%, var(--paper) 58%, #efe7d8 100%);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Noto Serif CJK SC", serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1.6fr);
  gap: 28px;
  align-items: end;
  padding: 24px clamp(18px, 4vw, 56px) 18px;
  background: rgba(247, 243, 234, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brandBlock {
  display: grid;
  gap: 12px;
}

.pageNav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
}

.pageNav a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  border: 1px solid rgba(138, 124, 101, 0.35);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.72);
}

.pageNav a:hover,
.pageNav a.active {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}

.kicker {
  margin: 0 0 5px;
  color: var(--accent);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 62px);
  font-weight: 500;
  line-height: 0.96;
}

.controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(95px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

label span {
  color: var(--muted);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 11px;
}

select,
button {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 250, 240, 0.85);
  color: var(--ink);
  font: 600 13px "Avenir Next", "Helvetica Neue", sans-serif;
}

select {
  width: 100%;
  padding: 0 10px;
}

button {
  padding: 0 15px;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

button:disabled {
  cursor: progress;
  opacity: 0.62;
}

main {
  width: min(1120px, calc(100vw - 36px));
  margin: 28px auto 70px;
}

.status {
  min-height: 28px;
  margin-bottom: 16px;
  color: var(--muted);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 13px;
}

.status strong {
  color: var(--accent-strong);
}

.managerBoard {
  margin-bottom: 26px;
}

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

.managerCard {
  display: grid;
  height: auto;
  min-height: 172px;
  gap: 18px;
  padding: 18px;
  text-align: left;
  background: rgba(255, 250, 240, 0.82);
  border: 1px solid rgba(138, 124, 101, 0.3);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(60, 45, 22, 0.08);
}

.managerCard:hover {
  border-color: rgba(14, 111, 104, 0.58);
  transform: translateY(-1px);
}

.managerCardHead,
.focusedHeader {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
}

.managerCardHead strong,
.focusedHeader h2 {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Noto Serif CJK SC", serif;
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
}

.managerCardHead span,
.sectionLabel,
.statBlock span,
.metaCell span,
.stateSectionHead span,
.watchItem summary span,
.emptyNote {
  color: var(--muted);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 12px;
}

.managerStats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: min(420px, 100%);
}

.statBlock {
  min-width: 0;
  padding: 10px;
  background: rgba(14, 111, 104, 0.055);
  border: 1px solid rgba(14, 111, 104, 0.14);
  border-radius: 6px;
}

.statBlock strong {
  display: block;
  overflow: hidden;
  color: var(--accent-strong);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: clamp(15px, 1.7vw, 20px);
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statBlock span {
  display: block;
  margin-top: 2px;
}

.miniTickers,
.postRelations {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.miniTickers span,
.relationBadge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  color: var(--muted);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 12px;
  border: 1px solid rgba(138, 124, 101, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
}

.focusedManager {
  padding: clamp(18px, 3vw, 26px);
  background: rgba(255, 250, 240, 0.76);
  border: 1px solid rgba(138, 124, 101, 0.3);
  border-radius: 8px;
  box-shadow: 0 14px 42px rgba(60, 45, 22, 0.09);
}

.sectionLabel {
  margin: 0 0 6px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.focusedHeader h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 56px);
}

.managerColumns {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(320px, 1.22fr);
  gap: 18px;
  margin-top: 22px;
}

.stateSection {
  min-width: 0;
}

.stateSectionHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.stateSectionHead h3 {
  margin: 0;
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stateSectionHead span {
  display: inline-flex;
  min-width: 24px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  color: var(--accent-strong);
  background: rgba(14, 111, 104, 0.08);
  border-radius: 999px;
}

.positionList,
.watchlistList {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.positionRow {
  display: grid;
  grid-template-columns: minmax(78px, 1fr) repeat(3, minmax(62px, 0.8fr));
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(138, 124, 101, 0.2);
  border-radius: 6px;
}

.tickerCell,
.metaCell strong {
  color: var(--ink);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  font-weight: 700;
}

.tickerCell strong {
  display: block;
  font-size: 14px;
}

.tickerCode {
  display: block;
  color: var(--muted);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 11px;
  font-weight: 400;
}

.watchItem summary .tickerCode {
  display: inline;
  margin-left: 4px;
}

.metaCell {
  min-width: 0;
}

.metaCell span,
.metaCell strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watchItem {
  margin: 0;
  padding: 0;
  color: inherit;
  border: 1px solid rgba(138, 124, 101, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.48);
}

.watchItem summary {
  display: flex;
  width: 100%;
  min-height: 44px;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  color: var(--ink);
}

.watchItem summary strong {
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
}

.watchItem p {
  margin: 0;
  padding: 0 12px 13px;
  color: #403a30;
  font-size: 14px;
  line-height: 1.65;
}

.emptyNote {
  margin: 14px 0 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.44);
  border: 1px dashed var(--line);
  border-radius: 6px;
}

.stream {
  display: grid;
  gap: 18px;
}

.dateDivider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 10px 0 4px;
  color: var(--muted);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dateDivider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.post {
  position: relative;
  padding: clamp(20px, 4vw, 34px);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 250, 240, 0.98), rgba(252, 246, 234, 0.94));
  border: 1px solid rgba(138, 124, 101, 0.28);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.post::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--accent);
  content: "";
}

.postMeta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 12px;
}

.postMeta span,
.tags span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(14, 111, 104, 0.2);
  border-radius: 999px;
  background: rgba(14, 111, 104, 0.06);
}

.postMeta .manager {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
  text-transform: uppercase;
}

.postMeta .importance.high {
  border-color: rgba(162, 59, 53, 0.28);
  background: rgba(162, 59, 53, 0.08);
  color: var(--red);
}

.postMeta .importance.medium {
  border-color: rgba(176, 120, 35, 0.32);
  background: rgba(176, 120, 35, 0.08);
  color: var(--gold);
}

.post h2 {
  margin: 0 0 12px;
  max-width: 760px;
  font-size: clamp(22px, 3.1vw, 34px);
  font-weight: 500;
  line-height: 1.16;
}

.body {
  margin: 0;
  color: #363229;
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.84;
  white-space: pre-wrap;
}

.postRelations {
  margin-top: 14px;
}

.relationBadge.held {
  color: var(--accent-strong);
  border-color: rgba(14, 111, 104, 0.25);
  background: rgba(14, 111, 104, 0.08);
}

.relationBadge.watched {
  color: var(--gold);
  border-color: rgba(176, 120, 35, 0.3);
  background: rgba(176, 120, 35, 0.08);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
  color: var(--muted);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 12px;
}

details {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 13px;
}

summary {
  width: fit-content;
  padding-top: 14px;
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 700;
}

.evidence {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.evidenceItem {
  padding: 12px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(138, 124, 101, 0.2);
  border-radius: 6px;
}

.evidenceItem strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.evidenceItem code {
  display: block;
  margin-top: 6px;
  color: var(--accent-strong);
  white-space: normal;
}

.empty {
  padding: 52px 20px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.52);
}

.empty h2 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 500;
}

.empty p {
  margin: 0;
  color: var(--muted);
}

.dashboardMain {
  width: min(1180px, calc(100vw - 36px));
}

.dashboardEmpty {
  text-align: left;
}

.dashboardSummary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.summaryBlock,
.metricBlock {
  min-width: 0;
  padding: 12px;
  background: rgba(14, 111, 104, 0.055);
  border: 1px solid rgba(14, 111, 104, 0.14);
  border-radius: 6px;
}

.summaryBlock strong,
.summaryBlock span,
.metricBlock strong,
.metricBlock span,
.runMetaLine,
.runStatus,
.hotspotLine,
.artifactLine,
.errorNote {
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
}

.summaryBlock strong,
.metricBlock strong {
  display: block;
  overflow: hidden;
  color: var(--accent-strong);
  font-size: clamp(16px, 2vw, 22px);
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summaryBlock span,
.metricBlock span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.dashboardStream {
  display: grid;
  gap: 14px;
}

.runRow {
  padding: clamp(18px, 3vw, 24px);
  background: rgba(255, 250, 240, 0.86);
  border: 1px solid rgba(138, 124, 101, 0.28);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(60, 45, 22, 0.08);
}

.runRow.partial {
  border-left-color: var(--gold);
}

.runRow.error,
.runRow.missing {
  border-left-color: var(--red);
}

.runRowHead {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
}

.runMetaLine {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.runRow h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 500;
  line-height: 1.08;
}

.runStatus {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 10px;
  color: white;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--accent);
  border-radius: 999px;
}

.runStatus.partial {
  background: var(--gold);
}

.runStatus.error,
.runStatus.missing {
  background: var(--red);
}

.runMetrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.hotspotLine,
.artifactLine {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.hotspotLine span,
.artifactLine span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid rgba(138, 124, 101, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
}

.artifactLine .present {
  color: var(--accent-strong);
  border-color: rgba(14, 111, 104, 0.25);
  background: rgba(14, 111, 104, 0.08);
}

.artifactLine .absent {
  color: var(--muted);
  text-decoration: line-through;
}

.errorNote {
  margin: 14px 0 0;
  padding: 10px 12px;
  color: var(--red);
  font-size: 13px;
  line-height: 1.5;
  background: rgba(162, 59, 53, 0.06);
  border: 1px solid rgba(162, 59, 53, 0.16);
  border-radius: 6px;
}

@media (max-width: 860px) {
  .topbar {
    position: static;
    grid-template-columns: 1fr;
    align-items: start;
  }

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

  .managerGrid,
  .managerColumns,
  .dashboardSummary,
  .runMetrics {
    grid-template-columns: 1fr;
  }

  .focusedHeader {
    display: grid;
  }
}

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

  main {
    width: min(100vw - 24px, 1120px);
    margin-top: 18px;
  }

  .managerStats,
  .positionRow {
    grid-template-columns: 1fr;
  }

  .managerCardHead {
    display: grid;
  }

  .post {
    padding: 18px;
  }
}
