:root {
  color-scheme: light;
  --ink: #15231f;
  --muted: #62716c;
  --paper: #ffffff;
  --soft: #f0f4f1;
  --line: #d8e1dc;
  --navy: #10251f;
  --green: #16734b;
  --green-dark: #0c5134;
  --mint: #dff3e8;
  --blue: #2c6482;
  --amber: #b46810;
  --red: #a7352d;
  --gray: #7b8883;
  --shadow: 0 18px 50px rgba(18, 44, 35, .1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Yu Gothic UI", sans-serif;
  line-height: 1.65;
}
button, select { font: inherit; }
a { color: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  inset: 0 0 auto;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 0 28px;
  color: #fff;
  background: rgba(12, 30, 24, .95);
  border-bottom: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(14px);
}
.brand { font-weight: 900; letter-spacing: .02em; text-decoration: none; }
.site-header nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.site-header nav a {
  padding: 7px 10px;
  border-radius: 8px;
  color: rgba(255,255,255,.82);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}
.site-header nav a:hover, .site-header nav a:focus-visible { color: #fff; background: rgba(255,255,255,.1); }

.hero {
  color: #fff;
  background:
    radial-gradient(circle at 76% 22%, rgba(48, 176, 111, .22), transparent 28%),
    linear-gradient(125deg, #0c1c17 0%, #143c2c 58%, #0e2b3b 100%);
}
.hero__inner {
  width: min(1180px, calc(100% - 32px));
  min-height: 540px;
  margin: 0 auto;
  padding: 72px 0 66px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  align-items: center;
  gap: 58px;
}
.eyebrow {
  margin: 0 0 10px;
  color: #cf8734;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
}
.hero .eyebrow { color: #70d3a4; }
h1, h2, p { margin-top: 0; }
h1 {
  margin-bottom: 18px;
  font-size: clamp(48px, 7vw, 84px);
  line-height: .99;
  letter-spacing: -.045em;
}
.hero__lead { max-width: 660px; margin-bottom: 24px; color: rgba(255,255,255,.82); font-size: 18px; }
.mode-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(118, 229, 170, .35);
  border-radius: 10px;
  color: #e8fff2;
  background: rgba(28, 129, 80, .17);
  font-size: 14px;
}
.mode-banner__dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #67dda1; box-shadow: 0 0 0 5px rgba(103,221,161,.13); }

.hero__status {
  padding: 30px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  box-shadow: 0 26px 70px rgba(0,0,0,.24);
  backdrop-filter: blur(14px);
}
.status-label { margin-bottom: 8px; color: rgba(255,255,255,.58); font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.status-heading-row { display: flex; align-items: center; gap: 12px; }
.status-heading-row h2 { margin: 0; font-size: clamp(25px, 3vw, 38px); line-height: 1.15; }
.status-dot { width: 13px; height: 13px; flex: 0 0 auto; border-radius: 50%; background: var(--gray); box-shadow: 0 0 0 6px rgba(255,255,255,.08); }
.status-dot--normal { background: #67dda1; }
.status-dot--warning { background: #ffc15c; }
.status-dot--error { background: #ff756b; }
.status-dot--stopped { background: #b9c2bf; }
.status-dot--loading { animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .42; } }
.status-detail { min-height: 52px; margin: 12px 0 18px; color: rgba(255,255,255,.72); }
.hero-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.hero-meta div { padding: 10px 12px; border-radius: 8px; background: rgba(0,0,0,.17); }
.hero-meta dt { color: rgba(255,255,255,.55); font-size: 11px; font-weight: 800; }
.hero-meta dd { margin: 3px 0 0; font-size: 14px; font-weight: 850; }
.hero-actions { display: flex; gap: 10px; margin-top: 16px; }
.hero-actions select, .hero-actions button { min-height: 42px; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; color: #fff; background: rgba(0,0,0,.24); }
.hero-actions select { flex: 1; padding: 7px 10px; }
.hero-actions select option { color: var(--ink); background: #fff; }
.hero-actions button { padding: 7px 14px; font-weight: 850; cursor: pointer; }
.hero-actions button:hover { background: rgba(255,255,255,.14); }

.summary-strip {
  width: min(1180px, calc(100% - 32px));
  margin: -34px auto 0;
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.summary-strip article { min-width: 0; padding: 20px 22px; border-right: 1px solid var(--line); }
.summary-strip article:last-child { border-right: 0; }
.summary-strip__safety { background: #eef8f2; }
.summary-strip__label { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .06em; }
.summary-strip strong { display: block; overflow: hidden; color: var(--ink); font-size: 24px; text-overflow: ellipsis; white-space: nowrap; }
.summary-strip small { display: block; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.metric-positive { color: var(--green) !important; }
.metric-negative { color: var(--red) !important; }

.content-section {
  width: min(1180px, calc(100% - 32px));
  margin: 22px auto 0;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 12px 36px rgba(18, 44, 35, .06);
}
.content-section--alerts { margin-top: 36px; }
.content-section--note { color: var(--muted); background: #f8faf9; box-shadow: none; }
.content-section--note p:last-child { margin-bottom: 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.section-heading h2 { margin: 0; font-size: clamp(26px, 3.3vw, 39px); line-height: 1.12; letter-spacing: -.03em; }
.section-note { margin: 0; color: var(--muted); font-size: 13px; }
.section-note--below { margin-top: 14px; }
.count-badge, .mode-chip {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--blue);
  background: #eaf3f7;
  font-size: 13px;
  font-weight: 900;
}
.mode-chip { color: var(--green-dark); background: var(--mint); }

.alert-list { display: grid; gap: 10px; }
.alert-card { display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: start; padding: 15px 16px; border: 1px solid var(--line); border-left-width: 5px; border-radius: 9px; background: #fafcfb; }
.alert-card--normal { border-left-color: var(--green); background: #f1faf5; }
.alert-card--warning { border-left-color: var(--amber); background: #fff9ef; }
.alert-card--error { border-left-color: var(--red); background: #fff5f4; }
.alert-card__icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--gray); font-weight: 900; }
.alert-card--normal .alert-card__icon { background: var(--green); }
.alert-card--warning .alert-card__icon { background: var(--amber); }
.alert-card--error .alert-card__icon { background: var(--red); }
.alert-card h3 { margin: 0 0 2px; font-size: 16px; }
.alert-card p { margin: 0; color: var(--muted); font-size: 14px; }
.alert-card time { color: var(--muted); font-size: 12px; white-space: nowrap; }

.evaluation-status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.evaluation-status-grid article { min-width: 0; padding: 18px; border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: 9px; background: #f5fafc; }
.evaluation-status-grid span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.evaluation-status-grid strong { display: block; margin-top: 3px; font-size: 20px; line-height: 1.35; }
.evaluation-status-grid small { display: block; margin-top: 4px; color: var(--muted); }
.evaluation-status-note { margin: 13px 0 0; color: var(--muted); font-size: 13px; }

.flow-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.flow-item { position: relative; min-height: 145px; padding: 18px 17px 16px; border: 1px solid var(--line); border-top: 5px solid var(--gray); border-radius: 9px; background: #fafcfb; }
.flow-item--done { border-top-color: var(--green); }
.flow-item--ready { border-top-color: var(--green); }
.flow-item--ready .flow-state { color: var(--green-dark); background: var(--mint); }
.flow-item--active { border-top-color: var(--blue); background: #f1f8fb; box-shadow: 0 0 0 2px rgba(44,100,130,.08); }
.flow-item--warning { border-top-color: var(--amber); background: #fff9ef; }
.flow-item--stopped { border-top-color: var(--gray); background: #f3f5f4; }
.flow-item--waiting_market { border-top-color: var(--blue); background: #f1f8fb; }
.flow-item--waiting_market .flow-state { color: var(--blue); background: #dfedf3; }
.flow-calendar { margin: 0 0 20px; padding: 12px 16px; border-left: 4px solid var(--blue); background: #f1f8fb; font-size: 16px; line-height: 1.7; }
.flow-item__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.flow-item time { color: var(--muted); font-size: 12px; font-weight: 900; }
.flow-state { padding: 2px 8px; border-radius: 999px; color: var(--muted); background: #e8ecea; font-size: 11px; font-weight: 900; }
.flow-item--done .flow-state { color: var(--green-dark); background: var(--mint); }
.flow-item--active .flow-state { color: var(--blue); background: #dfedf3; }
.flow-item--warning .flow-state { color: #86510f; background: #f8e7c9; }
.flow-item h3 { margin: 0 0 5px; font-size: 17px; line-height: 1.3; }
.flow-item p { margin: 0; color: var(--muted); font-size: 13px; }

.progress-panel { padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: #f8faf9; }
.progress-panel__headline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.progress-panel__headline span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.progress-panel__headline strong { display: block; margin-top: 2px; font-size: 20px; }
.progress-track { height: 9px; margin-top: 18px; overflow: hidden; border-radius: 999px; background: #dfe6e2; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), #44a877); transition: width .35s ease; }
.progress-note { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.candidate-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 12px; }
.filter-button { min-height: 37px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fff; font-weight: 800; cursor: pointer; }
.filter-button:hover, .filter-button.is-active { color: #fff; border-color: var(--green); background: var(--green); }

.table-shell { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { position: sticky; top: 0; z-index: 1; color: var(--muted); background: #f4f7f5; font-size: 12px; font-weight: 900; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f7faf8; }
.candidate-row--position { background: #fffaf0; }
.candidate-row--position:hover { background: #fff5df; }
.candidate-row--stopped { background: #f7f8f7; }
.candidate-row--stopped .code-name strong { color: #59645f; }
.slot-cell { color: var(--muted); font-weight: 900; }
.numeric-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.muted-cell { color: var(--muted); }
.position-count { color: #86510f; font-weight: 900; white-space: nowrap; }
.code-name { display: flex; flex-direction: column; min-width: 220px; }
.code-name strong { color: var(--ink); }
.code-name small { color: var(--muted); }
.stock-name-link { color: inherit; text-decoration: underline; text-decoration-color: rgba(31, 122, 82, .35); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.stock-name-link:hover strong, .stock-name-link:focus-visible strong { color: var(--green); }
.stock-name-link:focus-visible { border-radius: 3px; outline: 2px solid var(--green); outline-offset: 3px; }
.row-chip { display: inline-flex; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 900; white-space: nowrap; }
.row-chip--day { color: #7f4f0f; background: #f8e8cc; }
.row-chip--swing { color: #245a73; background: #e2eff5; }
.row-chip--primary { color: var(--green-dark); background: var(--mint); }
.row-chip--carried { color: #86510f; background: #f8e7c9; }
.row-chip--reserve { color: #5f6965; background: #e9edeb; }
.row-chip--monitoring { color: var(--green-dark); background: #dff3e8; }
.row-chip--position { color: #86510f; background: #f8e7c9; }
.row-chip--stopped { color: #7c3430; background: #f7dfdc; }
.row-chip--waiting { color: #4f646d; background: #e5eef2; }
.empty-state { padding: 32px; border: 1px dashed #b8c5bf; border-radius: 9px; color: var(--muted); text-align: center; background: #f8faf9; }

.system-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.system-card { padding: 18px; border: 1px solid var(--line); border-radius: 9px; background: #fafcfb; }
.system-card__top { display: flex; align-items: center; gap: 9px; }
.system-card__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gray); }
.system-card--healthy .system-card__dot { background: var(--green); box-shadow: 0 0 0 5px rgba(22,115,75,.1); }
.system-card--warning .system-card__dot { background: var(--amber); }
.system-card h3 { margin: 0; font-size: 17px; }
.system-card p { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.system-card small { display: block; margin-top: 8px; color: var(--muted); }
.system-card .system-card__detail { font-size: 14px; line-height: 1.7; }
.system-card__action { display: inline-block; margin-top: 12px; font-size: 14px; text-decoration: underline; }

footer { width: min(1180px, calc(100% - 32px)); margin: 24px auto 0; padding: 24px 0 40px; display: flex; justify-content: space-between; gap: 18px; color: var(--muted); border-top: 1px solid var(--line); font-size: 13px; }
footer a { color: var(--blue); font-weight: 850; text-decoration: none; }
footer a:hover { text-decoration: underline; }
noscript { display: block; padding: 20px; text-align: center; }

@media (max-width: 1020px) {
  .hero__inner { grid-template-columns: 1fr; min-height: 0; gap: 34px; padding: 62px 0 70px; }
  .hero__status { max-width: 720px; }
  .summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-strip article:nth-child(3) { border-right: 0; }
  .summary-strip article:nth-child(n+4) { border-top: 1px solid var(--line); }
  .flow-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .system-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .site-header { align-items: flex-start; flex-direction: column; gap: 4px; padding: 12px 18px; }
  .site-header nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .hero__inner { width: min(100% - 28px, 1180px); padding: 48px 0 62px; }
  h1 { font-size: clamp(45px, 15vw, 66px); }
  .mode-banner { align-items: flex-start; flex-wrap: wrap; }
  .hero__status { padding: 22px; }
  .hero-meta { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .summary-strip article, .summary-strip article:nth-child(3) { border-right: 1px solid var(--line); border-top: 1px solid var(--line); }
  .summary-strip article:nth-child(odd) { border-right: 1px solid var(--line); }
  .summary-strip article:nth-child(even) { border-right: 0; }
  .summary-strip article:first-child, .summary-strip article:nth-child(2) { border-top: 0; }
  .summary-strip article:last-child { grid-column: 1 / -1; }
  .content-section { padding: 22px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .flow-list { grid-template-columns: 1fr 1fr; }
  .evaluation-status-grid { grid-template-columns: 1fr; }
  .progress-panel__headline { grid-template-columns: 1fr 1fr; }
  .alert-card { grid-template-columns: auto 1fr; }
  .alert-card time { grid-column: 2; }
  footer { flex-direction: column; }
}

@media (max-width: 480px) {
  .summary-strip { grid-template-columns: 1fr; }
  .summary-strip article, .summary-strip article:nth-child(odd) { border-right: 0; border-top: 1px solid var(--line); }
  .summary-strip article:first-child { border-top: 0; }
  .summary-strip article:last-child { grid-column: auto; }
  .flow-list, .system-grid { grid-template-columns: 1fr; }
  .progress-panel__headline { grid-template-columns: 1fr; }
  .filter-button { flex: 1 1 42%; }
}
.message-log-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -6px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f6f9f8;
}
.message-log-toolbar__control { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.message-log-toolbar label { color: var(--ink); font-size: 13px; font-weight: 900; }
.message-log-toolbar select, .message-log-toolbar button {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #b8c9c2;
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
}
.message-log-toolbar select { min-width: 250px; }
.message-log-toolbar button { font-weight: 800; cursor: pointer; }
.message-log-toolbar button:hover:not(:disabled) { color: #fff; border-color: var(--green); background: var(--green); }
.message-log-toolbar button:disabled { cursor: default; opacity: .55; }
.message-log-toolbar__status { margin: 0; color: var(--muted); font-size: 12px; text-align: right; }
.message-list { display: grid; gap: 9px; }
.message-card {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 9px;
  background: #fafcfb;
}
.message-card--trade { border-left-color: var(--green); background: #f2faf6; }
.message-card--complete { border-left-color: var(--green); }
.message-card--progress { border-left-color: var(--blue); background: #f1f8fb; }
.message-card--warning, .message-card--stopped { border-left-color: var(--amber); background: #fff9ef; }
.message-card--error { border-left-color: var(--red); background: #fff5f4; }
.message-card--user_action {
  border: 2px solid #d99a00;
  border-left: 8px solid #c98200;
  background: #fff2a8;
  box-shadow: 0 0 0 3px rgba(217, 154, 0, .18), 0 8px 18px rgba(102, 73, 0, .12);
}
.message-card--resolved { border-left-color: var(--green); background: #edf9f2; }
.message-card__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.message-card__time { color: var(--muted); font-size: 12px; font-weight: 850; white-space: nowrap; font-variant-numeric: tabular-nums; }
.message-card__category { padding: 2px 7px; border-radius: 999px; color: var(--blue); background: #e4eff4; font-size: 10px; font-weight: 900; white-space: nowrap; }
.message-card--trade .message-card__category, .message-card--complete .message-card__category { color: var(--green-dark); background: var(--mint); }
.message-card--warning .message-card__category, .message-card--stopped .message-card__category { color: #86510f; background: #f8e7c9; }
.message-card--error .message-card__category { color: #8d2f29; background: #f7dfdc; }
.message-card--user_action .message-card__category { color: #5d3b00; background: #ffd54d; }
.message-card--user_action .message-card__text { color: #3e2b00; font-weight: 800; }
.message-card--resolved .message-card__category { color: var(--green-dark); background: var(--mint); }
.message-card__text { margin: 0; color: var(--ink); font-size: 14px; }
.message-pnl { font-weight: 900; white-space: nowrap; }
.message-pnl--positive { color: var(--green); }
.message-pnl--negative { color: var(--red); }

@media (max-width: 720px) {
  .message-log-toolbar { align-items: stretch; flex-direction: column; }
  .message-log-toolbar__control { align-items: stretch; flex-direction: column; }
  .message-log-toolbar select { width: 100%; min-width: 0; }
  .message-log-toolbar__status { text-align: left; }
  .message-card { grid-template-columns: 1fr; gap: 7px; }
}

/* AIシミュレーション専用表示 */
.hero--ai {
  background:
    radial-gradient(circle at 78% 18%, rgba(77, 169, 255, .24), transparent 30%),
    radial-gradient(circle at 16% 78%, rgba(54, 205, 142, .16), transparent 34%),
    linear-gradient(128deg, #071a24 0%, #0d3040 50%, #123727 100%);
}
.hero--ai .hero__inner { min-height: 590px; }
.safety-banners { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 13px; }
.safety-banner { padding: 7px 12px; border: 1px solid rgba(121, 216, 174, .42); border-radius: 999px; color: #dffbed; background: rgba(21, 117, 77, .22); font-size: 13px; font-weight: 900; }
.safety-banner--strong { color: #fff4cf; border-color: rgba(255, 193, 92, .55); background: rgba(187, 113, 15, .28); }
.safety-banner--shadow { color: #fff2ce; border-color: rgba(255, 193, 92, .55); background: rgba(187, 113, 15, .28); }
.safety-banner--eligible { color: #e8fff2; border-color: rgba(103, 221, 161, .65); background: rgba(28, 129, 80, .34); }
.simulation-disclaimer { max-width: 680px; margin: 0; color: rgba(255,255,255,.64); font-size: 13px; }
.hero-meta--ai { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hero-meta--ai dd { overflow-wrap: anywhere; }
.summary-strip--pnl { width: min(1500px, calc(100% - 32px)); grid-template-columns: minmax(0, 1fr); }
.summary-strip--pnl article { border-right: 0; }
.pnl-selected-summary { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 5px 0; }
.pnl-selected-summary span, .pnl-monthly-breakdown span { color: var(--muted); font-size: 13px; font-weight: 800; }
.pnl-selected-summary strong { overflow: visible; font-size: 26px; }
.pnl-calendar-card { padding: 18px 20px !important; }
.pnl-calendar__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.pnl-calendar__nav { display: grid; grid-template-columns: 34px minmax(120px, auto) 34px; align-items: center; gap: 7px; }
.pnl-calendar__nav button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #f5f8f6;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.pnl-calendar__nav button:hover:not(:disabled), .pnl-calendar__nav button:focus-visible { color: #fff; background: var(--green-dark); }
.pnl-calendar__nav button:disabled { opacity: .35; cursor: default; }
.pnl-calendar__nav span { color: var(--ink); text-align: center; font-size: 14px; font-weight: 900; white-space: nowrap; }
.pnl-calendar__help { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.pnl-calendar__scroll { max-width: 100%; overflow-x: auto; padding-bottom: 6px; scrollbar-width: auto; }
.pnl-calendar__scroll:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.pnl-calendar__weekdays, .pnl-calendar { display: grid; min-width: 1120px; grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, 1.12fr); gap: 7px; }
.pnl-calendar__weekdays { margin-bottom: 7px; color: var(--muted); text-align: center; font-size: 15px; font-weight: 900; }
.pnl-calendar__weekdays span:last-child { color: var(--green-dark); }
.pnl-calendar__day, .pnl-calendar__weekly { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; min-height: 160px; padding: 12px 9px; border-radius: 9px; }
.pnl-calendar__day {
  border: 1px solid #e3eae6;
  color: var(--ink);
  background: #fafcfb;
  font: inherit;
}
button.pnl-calendar__day { cursor: pointer; }
button.pnl-calendar__day:hover, button.pnl-calendar__day:focus-visible { border-color: var(--green); background: #eef8f2; }
.pnl-calendar__day.is-selected { border-color: var(--green-dark); box-shadow: inset 0 0 0 2px var(--green-dark); background: #edf8f2; }
.pnl-calendar__day.is-outside-month { color: #718079; background: #f0f3f1; }
.pnl-calendar__day.is-friday { border-right-color: #bdcec6; }
.pnl-calendar__date { align-self: stretch; display: flex; align-items: center; justify-content: center; border-right: 1px solid var(--line); padding-right: 7px; font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.pnl-calendar__day.is-outside-month .pnl-calendar__date { font-size: 15px; }
.pnl-breakdown { display: grid; gap: 6px; min-width: 0; }
.pnl-breakdown__row { display: grid; justify-items: center; gap: 1px; line-height: 1.2; }
.pnl-breakdown__label { color: var(--muted); font-size: 12px; font-weight: 800; }
.pnl-breakdown__row--total { border-top: 1px solid #d5e2da; padding-top: 6px; }
.pnl-breakdown__row--total .pnl-breakdown__label { color: var(--ink); }
.pnl-calendar__amount { font-size: 22px; font-weight: 850; font-variant-numeric: tabular-nums; letter-spacing: -.025em; white-space: nowrap; }
.pnl-breakdown__row--total .pnl-calendar__amount { font-size: 24px; font-weight: 900; }
.pnl-calendar__amount--empty { color: #7b8883; font-weight: 700; }
.pnl-calendar__weekly {
  grid-template-columns: 38px minmax(0, 1fr);
  border: 1px solid #c7d9d0;
  background: #edf6f1;
}
.pnl-calendar__week-date { display: grid; justify-items: center; gap: 3px; border-right: 1px solid #c7d9d0; padding-right: 7px; line-height: 1.25; }
.pnl-calendar__weekly-label { color: var(--green-dark); font-size: 13px; font-weight: 800; }
.pnl-calendar__weekly-count { color: var(--muted); font-size: 11px; white-space: nowrap; }
.pnl-calendar__missing { grid-column: 1 / -1; color: var(--muted); text-align: center; font-size: 12px; }
.pnl-period-card { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(260px, 1fr); align-items: center; gap: 18px; border-top: 1px solid var(--line); background: #f5faf7; }
.pnl-monthly-breakdown { display: grid; gap: 5px; width: min(100%, 420px); }
.pnl-monthly-breakdown > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.pnl-period-card [hidden] { display: none; }
.pnl-monthly-breakdown strong { flex-shrink: 0; }
.pnl-monthly-breakdown > div:last-child { padding-top: 5px; border-top: 1px solid var(--line); }
.pnl-period-card strong { overflow: visible; font-size: 30px; line-height: 1.25; }
.pnl-period-card small { white-space: normal; }
.content-section--wide { width: min(1500px, calc(100% - 32px)); }
.qualification-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.qualification-grid article { padding: 20px; border: 1px solid var(--line); border-top: 5px solid var(--blue); border-radius: 10px; background: #f6fafc; }
.qualification-grid span, .qualification-grid small { display: block; color: var(--muted); }
.qualification-grid span { font-size: 12px; font-weight: 900; }
.qualification-grid strong { display: block; margin: 4px 0; font-size: 28px; }
.qualification-card--strict { border-top-color: var(--gray) !important; background: #f5f6f5 !important; }
.qualification-card--simulation { border-top-color: var(--amber) !important; background: #fff9ef !important; }
.realtime-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.realtime-grid article { min-width: 0; padding: 20px; border: 1px solid var(--line); border-top: 5px solid var(--blue); border-radius: 10px; background: #f6fafc; }
.realtime-grid span, .realtime-grid small { display: block; color: var(--muted); }
.realtime-grid span { font-size: 12px; font-weight: 900; }
.realtime-grid strong { display: block; margin: 4px 0; overflow-wrap: anywhere; font-size: 21px; line-height: 1.35; }
.realtime-safety-note { margin: 14px 0 0; padding: 13px 15px; border-left: 5px solid var(--amber); border-radius: 8px; color: #6e4716; background: #fff9ef; font-size: 13px; }
.realtime-safety-note--ready { border-left-color: var(--green); color: var(--green-dark); background: #f1faf5; }
.opening-ai-guide { margin: 0 0 16px; padding: 20px; border: 1px solid #d5e4dc; border-left: 6px solid var(--green); border-radius: 12px; background: linear-gradient(145deg, #f7fbf9, #edf7f2); }
.opening-ai-guide__heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.opening-ai-guide__heading .eyebrow { margin-bottom: 3px; }
.opening-ai-guide__heading h3 { margin: 0; color: var(--ink); font-size: clamp(22px, 2vw, 29px); }
.opening-ai-guide__time { padding: 7px 12px; border: 1px solid rgba(21, 117, 77, .3); border-radius: 999px; color: var(--green-dark); background: #fff; font-size: 13px; font-weight: 900; white-space: nowrap; }
.opening-ai-guide__lead { margin: 12px 0 15px; color: #40564d; font-size: 14px; line-height: 1.75; }
.opening-ai-guide__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.opening-ai-guide__grid article { min-width: 0; padding: 14px 15px; border: 1px solid #d8e5df; border-radius: 9px; background: rgba(255,255,255,.82); }
.opening-ai-guide__grid span, .opening-ai-guide__grid small { display: block; color: var(--muted); }
.opening-ai-guide__grid span { font-size: 11px; font-weight: 900; }
.opening-ai-guide__grid strong { display: block; margin: 5px 0 6px; color: var(--ink); font-size: 17px; line-height: 1.35; }
.opening-ai-guide__grid small { font-size: 11px; line-height: 1.65; }
.market-overview {
  display: grid;
  grid-template-columns: minmax(220px, .9fr) repeat(3, minmax(220px, 1fr));
  gap: 10px;
  margin: 0 0 10px;
}
.market-overview article {
  min-width: 0;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(150deg, #fbfdfc, #f1f7f4);
}
.market-overview__connection {
  color: #fff;
  border-color: #174b3a !important;
  background: linear-gradient(145deg, #0b2f29, #145442) !important;
}
.market-overview__label { display: block; color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .06em; }
.market-overview__label small { margin-left: 5px; color: #74877f; font-size: 10px; letter-spacing: .02em; }
.market-overview__connection .market-overview__label { color: rgba(255,255,255,.7); }
.market-overview__connection-state { display: flex; align-items: center; gap: 9px; margin: 8px 0 5px; font-size: clamp(17px, 1.45vw, 20px); white-space: nowrap; }
.market-overview__connection small { color: rgba(255,255,255,.74); font-size: 11px; line-height: 1.45; }
.market-overview__dot { width: 11px; height: 11px; flex: 0 0 auto; border-radius: 50%; background: #93a39d; box-shadow: 0 0 0 4px rgba(255,255,255,.09); }
.market-overview__dot--connected { background: #62e7a7; box-shadow: 0 0 0 4px rgba(98,231,167,.16), 0 0 12px rgba(98,231,167,.65); }
.market-overview__dot--warning { background: #ffc15c; }
.market-overview__dot--error { background: #ff776d; }
.market-overview__dot--waiting { background: #a8bab3; }
.market-overview__quote strong { display: block; margin: 5px 0 2px; color: var(--ink); font-size: clamp(22px, 2vw, 30px); font-variant-numeric: tabular-nums; line-height: 1.15; white-space: nowrap; }
.market-overview__change { display: block; min-height: 19px; color: var(--muted); font-size: 12px; font-weight: 850; font-variant-numeric: tabular-nums; }
.market-overview__quote time { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.table-shell--wide { max-height: none; overflow-y: visible; }
.ai-candidate-table { min-width: 1360px; }
.ai-candidate-table th { position: static; }
.candidate-group-row th { padding-top: 8px; padding-bottom: 8px; color: #28483c; text-align: center; background: #e8f1ed; border-right: 2px solid #c7d7d0; }
.candidate-group-row th[rowspan] { text-align: left; vertical-align: bottom; }
.candidate-field-row th:nth-child(1), .candidate-field-row th:nth-child(4), .candidate-field-row th:nth-child(8) { border-left: 2px solid #b8cbc2; }
.ai-candidate-table tbody td:nth-child(5), .ai-candidate-table tbody td:nth-child(8), .ai-candidate-table tbody td:nth-child(12) { border-left: 2px solid #d4dfda; }
.candidate-row--primary { box-shadow: inset 5px 0 0 var(--green); }
.candidate-row--reserve { box-shadow: inset 5px 0 0 var(--gray); background: #fafbfa; }
.candidate-row--carried { box-shadow: inset 5px 0 0 var(--amber); background: #fff8e9; }
.candidate-row--carried:hover { background: #fff1ce; }
.code-cell { max-width: 260px; overflow-wrap: anywhere; font-family: Consolas, "SFMono-Regular", monospace; font-size: 12px; }
.event-table { min-width: 1750px; table-layout: auto; }
.event-id, .event-status, .event-reason { max-width: 320px; overflow-wrap: anywhere; word-break: break-word; }
.event-id, .event-status { font-family: Consolas, "SFMono-Regular", monospace; font-size: 12px; }
.event-reason { min-width: 220px; white-space: normal; }
.ai-decision { display: inline-block; min-width: 66px; padding: 4px 9px; border-radius: 999px; text-align: center; font-size: 12px; font-weight: 900; white-space: nowrap; }
.ai-decision--enter { color: #fff; background: var(--green); }
.ai-decision--exit { color: #fff; background: var(--red); }
.ai-decision--hold { color: #66420d; background: #f8e7c9; }
.ai-decision--block { color: #fff; background: var(--gray); }
.ai-decision--not-applicable { color: var(--muted); background: #e8ecea; }
.hybrid-state { min-width: 150px; white-space: normal; }

@media (max-width: 1020px) {
  .market-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opening-ai-guide__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-strip--pnl { grid-template-columns: 1fr; }
  .summary-strip--pnl article { border-right: 1px solid var(--line); }
  .summary-strip--pnl .pnl-calendar-card { border-right: 0; }
  .summary-strip--pnl article:nth-child(n+2) { border-top: 1px solid var(--line); }
  .summary-strip--pnl article:last-child { border-right: 0; }
  .pnl-period-card { min-height: 150px; }
}
@media (max-width: 720px) {
  .market-overview { grid-template-columns: 1fr; }
  .hero-meta--ai, .qualification-grid, .realtime-grid { grid-template-columns: 1fr; }
  .opening-ai-guide { padding: 16px; }
  .opening-ai-guide__heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .opening-ai-guide__grid { grid-template-columns: 1fr; }
  .summary-strip--pnl { grid-template-columns: 1fr; }
  .summary-strip--pnl article { border-right: 0; border-top: 1px solid var(--line); }
  .summary-strip--pnl article:first-child { border-top: 0; }
  .pnl-calendar__heading { align-items: stretch; flex-direction: column; gap: 12px; }
  .pnl-calendar__nav { grid-template-columns: 34px 1fr 34px; }
  .pnl-calendar-card { padding: 16px 12px !important; }
  .pnl-selected-summary { gap: 8px 16px; }
  .pnl-selected-summary strong { font-size: 22px; }
  .pnl-period-card { grid-template-columns: minmax(0, 1fr); }
}
