:root {
  --primary: #0b4f90;
  --secondary: #2e9b4b;
  --accent: #f3ba61;
  --highlight: #17a8d8;
  --bg: #e8f4fb;
  --ink: #0f2f46;
  --surface-soft: #f2f9fd;
  --surface-mid: #dbf0e2;
  --surface-hard: #c3e6d0;
  --line: #79c291;
  --muted: #1f5c4e;
}

body {
  background: radial-gradient(circle at top left, #f3fbff 0%, #e8f4fb 46%, #d8ecde 100%);
  color: var(--ink);
}

@media (min-width: 993px) {
  nav .nav-wrapper .brand-logo {
    left: 0.75rem;
    transform: none;
  }

  .app-nav-container.container,
  .app-main-container.container {
    width: 99%;
    max-width: 2200px;
  }

  nav .nav-wrapper ul.right {
    margin-right: 0;
  }
}

nav {
  background-color: var(--primary);
  border-bottom: 1px solid var(--line);
}

nav a,
nav .brand-logo {
  color: #fffbe8 !important;
}

nav .brand-logo {
  display: inline-flex;
  align-items: center;
  height: 64px;
  line-height: 64px;
}

.nav-clock {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fffbe8;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
  pointer-events: none;
  padding-left: 8px;
}

.nav-divider {
  width: 1px;
  background: rgba(255, 255, 255, 0.25);
  height: 32px;
  margin: auto 4px;
  align-self: center;
}

nav ul li.nav-divider {
  padding: 0;
  line-height: 64px;
  display: flex;
  align-items: center;
}

.nav-external {
  opacity: 0.75;
}

nav .brand-logo.app-wordmark {
  font-weight: 900;
  letter-spacing: 2px;
  font-size: 2rem;
  color: #ffffff !important;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

@media (max-width: 992px) {
  nav .brand-logo {
    left: 50% !important;
    transform: translateX(-50%) !important;
    height: 56px;
    line-height: 56px;
  }

  nav .brand-logo.app-wordmark {
    font-size: 1.7rem;
  }

  nav .sidenav-trigger {
    position: absolute;
    right: 0.75rem;
    left: auto;
    margin: 0;
    color: #fffbe8 !important;
  }

  nav .sidenav-trigger .mi {
    color: #fffbe8 !important;
  }
}

.sidenav li > a {
  color: var(--ink);
}

.sidenav li > a.icon-label {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}

.sidenav li > a.icon-label .mi {
  line-height: 1;
}

h1, h2, h3, h4, h5, h6,
p,
li,
span,
label {
  color: var(--ink);
}

h5 {
  font-size: 1.45rem;
}

a {
  color: #0b4f90;
}

a:hover {
  color: #0a3e72;
}

.icon-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.icon-label > .mi {
  font-size: 1em;
  line-height: 1;
  transform: translateY(0.1em);
}

.mi {
  font-family: "Material Symbols Outlined";
  font-weight: 400;
  font-style: normal;
  font-size: inherit;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  font-variation-settings:
    "FILL" 0,
    "wght" 500,
    "GRAD" 0,
    "opsz" 24;
}

.mi.mi-xs {
  font-size: 0.85em;
}

.race-card {
  border-top: 5px solid var(--secondary);
  min-height: 220px;
}

.action-card {
  border-left: 5px solid var(--secondary);
}

.forecast {
  margin-top: 8px;
  color: #466126;
  font-weight: 600;
}

.race-status {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.race-status.status-pending {
  background: #e7f0c9;
  color: #425727;
}

.race-status.status-confirmed {
  background: #b4ce75;
  color: #2f461f;
}

.race-status.status-predicted {
  background: #4a8f3a;
  color: #f5ffef;
}

.race-status.status-nobet {
  background: #e65100;
  color: #fff3e0;
}

.race-status.status-done {
  background: #2f6b2d;
  color: #f4ffea;
}

.grade-badge {
  display: inline-block;
  min-width: 2.6rem;
  margin-left: 6px;
  text-align: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.2;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.35);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.grade-badge.grade-g1 {
  background: linear-gradient(135deg, #d64848 0%, #8f1f1f 100%);
  color: #fff6de;
}

.grade-badge.grade-g2 {
  background: linear-gradient(135deg, #c49a2e 0%, #7d5d17 100%);
  color: #fff8e6;
}

.grade-badge.grade-g3 {
  background: linear-gradient(135deg, #e9c95a 0%, #c79f2f 100%);
  color: #fff9e6;
}

.table-wrap {
  overflow-x: auto;
}

.dashboard-table {
  min-width: 920px;
}

.dashboard-layout {
  display: flex;
  flex-wrap: wrap;
}

.dashboard-main-col,
.dashboard-side-col {
  display: flex;
}

.dashboard-main-card,
.dashboard-filter-card {
  width: 100%;
}

.dashboard-side-stack {
  width: 100%;
}

.dashboard-summary-card {
  width: 100%;
  margin-top: 16px;
}

.dashboard-prediction-card {
  width: 100%;
  margin-top: 16px;
}

/* P&L report (収支レポート) */
.pnl-hero {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: flex-start;
}

.pnl-hero-left {
  flex: 0 0 auto;
  background: #f5f5f5;
  border-radius: 6px;
  padding: 8px 12px;
  min-width: 90px;
}

.pnl-hero-right {
  flex: 1 1 auto;
  background: #f5f5f5;
  border-radius: 6px;
  padding: 8px 12px;
}

.pnl-hero-label,
.pnl-profit-label {
  font-size: 0.7rem;
  color: #888;
  margin-bottom: 2px;
}

.pnl-hero-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}

.pnl-hero-value.pred-item-good { color: #1a7a3c; }
.pnl-hero-value.pred-item-ok   { color: #c47a00; }
.pnl-hero-value.pred-item-poor { color: #c53737; }

.pred-bar-fill.pred-bar-good { background: #1a7a3c; }
.pred-bar-fill.pred-bar-ok   { background: #c47a00; }
.pred-bar-fill.pred-bar-poor { background: #c53737; }

.pnl-profit-value {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
}

.pnl-wld {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.pnl-wld-item {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}

.pnl-win  { background: #e6f4ec; color: #1a7a3c; }
.pnl-lose { background: #fdeaea; color: #c53737; }
.pnl-draw { background: #f0f0f0; color: #666; }

.pnl-pattern-table .pnl-pattern-name {
  font-size: 0.75rem;
  color: #444;
  text-align: left !important;
  font-weight: normal;
  white-space: nowrap;
}

/* Prediction report KPI grid */
.pred-meta {
  font-size: 0.82rem;
  color: #777;
  margin-bottom: 12px;
}

.pred-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.pred-kpi-item {
  background: #f5f5f5;
  border-radius: 6px;
  padding: 8px 10px;
}

.pred-kpi-label {
  font-size: 0.7rem;
  color: #888;
  margin-bottom: 2px;
  white-space: nowrap;
}

.pred-kpi-value {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.1;
}

.pred-item-good .pred-kpi-value { color: #1a7a3c; }
.pred-item-ok   .pred-kpi-value { color: #c47a00; }
.pred-item-poor .pred-kpi-value { color: #c53737; }

.pred-bar-wrap {
  background: #ddd;
  border-radius: 2px;
  height: 4px;
  margin: 4px 0 3px;
  overflow: hidden;
}

.pred-bar-fill {
  height: 100%;
  border-radius: 2px;
  max-width: 100%;
}

.pred-item-good .pred-bar-fill { background: #1a7a3c; }
.pred-item-ok   .pred-bar-fill { background: #c47a00; }
.pred-item-poor .pred-bar-fill { background: #c53737; }

.pred-kpi-sub {
  font-size: 0.68rem;
  color: #aaa;
  margin-top: 1px;
}

.pred-full-hit {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: #444;
  margin-bottom: 12px;
  padding: 6px 10px;
  background: #eef3ff;
  border-radius: 6px;
  border-left: 3px solid #4a6fa5;
}

.pred-band-section {
  margin-top: 10px;
}

.pred-band-title {
  font-size: 0.75rem;
  color: #777;
  font-weight: 600;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.builder-report-section {
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.builder-report-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #333;
}
.builder-report-roi {
  font-size: 0.82rem;
  font-weight: 600;
}

.pred-band-table {
  width: 100%;
  font-size: 0.78rem;
  border-collapse: collapse;
}

.pred-band-table th,
.pred-band-table td {
  text-align: center;
  padding: 4px 5px;
  border-bottom: 1px solid #eee;
}

.pred-band-table th:first-child,
.pred-band-table td:first-child {
  text-align: left;
  color: #888;
  font-size: 0.72rem;
  font-weight: normal;
  white-space: nowrap;
}

.pred-band-table th {
  font-size: 0.72rem;
  font-weight: 600;
  color: #555;
}

.pred-band-table td.pred-rate-good { color: #1a7a3c; font-weight: 600; }
.pred-band-table td.pred-rate-ok   { color: #c47a00; font-weight: 600; }
.pred-band-table td.pred-rate-poor { color: #c53737; }

.dashboard-summary-list {
  margin-top: 0;
  margin-bottom: 0;
}

.dashboard-summary-list li {
  margin-bottom: 8px;
}

.dashboard-summary-list li .mi {
  margin-right: 2px;
}

.dashboard-main-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.dashboard-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.dashboard-filter-form .input-field {
  margin-top: 0;
  margin-bottom: 16px;
}

.dashboard-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-mobile-list {
  display: none;
}

.dashboard-race-card {
  border: 1px solid rgba(74, 143, 58, 0.35);
  border-radius: 12px;
  background: rgba(229, 239, 202, 0.92);
  margin-bottom: 12px;
  overflow: hidden;
}

.dashboard-race-link {
  display: block;
  padding: 12px;
  color: inherit;
}

.dashboard-race-link:hover {
  color: inherit;
}

.dashboard-race-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.dashboard-race-mainline {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.dashboard-race-time {
  font-size: 1.1rem;
  font-weight: 800;
}

.dashboard-race-place {
  font-size: 0.92rem;
  color: #435c2a;
}

.dashboard-race-name {
  margin-top: 6px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

.dashboard-race-resultline {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #465c2f;
}

.dashboard-race-more {
  border-top: 1px dashed rgba(74, 143, 58, 0.45);
  padding: 8px 12px 10px;
}

.dashboard-race-more > summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: #456129;
  font-weight: 700;
}

.dashboard-race-more > ul {
  margin-top: 8px;
  margin-bottom: 0;
}

.dashboard-race-more > ul li {
  margin-bottom: 4px;
}

.dashboard-filter-disclosure > summary {
  cursor: pointer;
  list-style: none;
  margin-bottom: 8px;
}

.dashboard-filter-disclosure > summary::-webkit-details-marker {
  display: none;
}

.dashboard-filter-disclosure > .dashboard-filter-form {
  display: block;
}

.result-profit-positive {
  color: #1e4fb8;
  font-weight: 800;
}

.result-profit-negative {
  color: #c53737;
  font-weight: 400;
}

.pace-summary {
  background: var(--surface-soft);
  border-left: 4px solid var(--primary);
}

.pace-top-row {
  margin-top: 8px;
  line-height: 2.2;
}

.compact-table td,
.compact-table th {
  padding-top: 8px;
  padding-bottom: 8px;
}

.card,
.card-panel {
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.teal.lighten-4 {
  background-color: #dce9bf !important;
  color: #314a1f !important;
}

.card .card-title,
.card .card-content,
.card-panel,
.card-panel p {
  color: var(--ink);
}

table.striped > tbody > tr:nth-child(odd) {
  background-color: rgba(180, 206, 117, 0.22);
}

table.highlight > tbody > tr:hover {
  background-color: rgba(74, 143, 58, 0.16);
}

table thead {
  background: #c8da9e;
}

table thead th,
table td {
  padding: 8px 6px;
  line-height: 1.4;
  font-size: 0.9rem;
  vertical-align: middle;
  box-sizing: border-box;
}

table thead th {
  color: #3e5627;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table td {
  color: var(--ink);
  border-bottom: 1px solid rgba(124, 156, 69, 0.24);
}


tr.race-row {
  cursor: pointer;
}

tr.race-row:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.horse-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  border: 1px solid #7ea452;
  background: #dfeac5;
  color: #365221;
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1;
}

a.horse-link {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px dotted var(--primary);
}

a.horse-link:hover {
  border-bottom-style: solid;
}

.frame-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 4px;
  border: 1px solid #2d6f95;
  background: #d8edf9;
  color: #113f5a;
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1;
}


.overlay-ticket-line {
  display: block;
  line-height: 1.6;
}

.overlay-ticket-line + .overlay-ticket-line {
  margin-top: 6px;
}

.chip {
  background: #d6e4b3;
  color: #334c20;
}

.bet-item {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(74, 143, 58, 0.3);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(238, 245, 220, 0.96) 0%, rgba(227, 238, 199, 0.96) 100%);
  box-shadow: 0 1px 2px rgba(40, 67, 23, 0.1);
}

.bet-suggestion-list {
  margin-top: 0;
  margin-bottom: 0;
  padding-left: 0;
  list-style: none;
}

.bet-suggestion-list > li {
  list-style: none;
}

.bet-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  line-height: 1.4;
}

.bet-type-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  background: #d3e5a8;
  border: 1px solid rgba(74, 143, 58, 0.4);
  color: #334f1f;
}

.bet-ticket {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #2f4a1c;
}

.bet-meta {
  margin-top: 4px;
  font-size: 0.9rem;
  color: #5b7138;
}

.bet-rationale {
  margin-top: 6px;
  color: #465b2c;
  font-size: 0.9rem;
  line-height: 1.45;
}

.race-detail-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 12px;
}

.race-detail-page .detail-section {
  margin: 0;
}

.detail-accordion {
  border: 1px solid rgba(74, 143, 58, 0.28);
  border-radius: 12px;
  padding: 12px;
  background: rgba(236, 243, 216, 0.7);
}

.detail-accordion > summary {
  list-style: none;
  cursor: pointer;
}

.detail-accordion > summary::-webkit-details-marker {
  display: none;
}

.detail-accordion > summary h5 {
  display: inline-block;
  margin: 0 0 10px;
  padding-right: 18px;
  position: relative;
}

.detail-accordion > summary h5::after {
  content: "▾";
  position: absolute;
  right: 0;
  top: 0;
  font-size: 0.9rem;
  color: #4d6930;
  transition: transform 0.2s ease;
}

.detail-accordion[open] > summary h5::after {
  transform: rotate(180deg);
}

.detail-accordion > :not(summary) {
  margin-top: 10px;
}

.race-detail-page h5 {
  margin-top: 0;
  margin-bottom: 14px;
}

.race-detail-page ul.browser-default {
  margin-top: 0;
  margin-bottom: 0;
}

.race-detail-page table {
  margin-top: 10px;
}

.race-detail-page cite {
  display: block;
  margin-top: 10px;
}

.race-overview-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

.race-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.race-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.race-title-row h4 {
  margin: 0;
}

.race-detail-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.race-nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.race-nav-link {
  padding: 0 10px;
  white-space: nowrap;
}

.race-finished-box {
  text-align: right;
}

.race-updated-meta {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.race-detail-header h4 {
  margin-top: 0;
}

.race-overview-left li,
.race-overview-right li {
  margin-bottom: 8px;
}

.race-overview-right {
  margin-top: 0;
}

.race-overview-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.race-overview-block {
  border: 1px solid rgba(74, 143, 58, 0.25);
  border-radius: 10px;
  background: rgba(240, 247, 225, 0.75);
  padding: 10px 12px;
}

.race-overview-block h6 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  font-weight: 800;
  color: #42602a;
  letter-spacing: 0.02em;
}

.race-overview-list {
  margin: 0;
  padding-left: 1.1rem;
}

.race-overview-list li {
  margin-bottom: 6px;
}

.race-overview-name {
  font-weight: 700;
  color: #2f4a1c;
}

.race-overview-metrics {
  padding-left: 0;
  list-style: none;
}

.race-overview-metrics li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 4px;
  border-bottom: 1px dashed rgba(74, 143, 58, 0.22);
}

.race-overview-metrics li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.race-overview-label {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #4d6832;
  margin-right: 6px;
}

.race-overview-value {
  font-weight: 700;
  color: #2f4a1c;
}

.race-quality-footer {
  margin-top: 8px;
  text-align: right;
  font-size: 0.62rem;
  line-height: 1.25;
  color: rgba(47, 74, 28, 0.55);
  letter-spacing: 0.01em;
}

.race-result-table {
  margin-top: 14px;
}

/* ── 買い目提案カード ─────────────────────────────── */
.bet-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.bet-card {
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  padding: 12px 16px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

.bet-card-hit {
  border-left: 4px solid #2e7d32;
  background: rgba(46,125,50,0.04);
}

.bet-card-miss {
  border-left: 4px solid rgba(0,0,0,0.15);
}

.bet-card-low-ev {
  opacity: 0.6;
}

.bet-card-ev-row {
  display: flex;
  gap: 6px;
  margin: 4px 0 2px;
  flex-wrap: wrap;
}

.ev-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 4px;
}
.ev-positive { background: #e8f5e9; color: #2e7d32; }
.ev-neutral  { background: #f5f5f5; color: #757575; }
.ev-negative { background: #fbe9e7; color: #c62828; }

.confidence-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 4px;
}
.conf-A { background: #e8f5e9; color: #1b5e20; }
.conf-B { background: #e3f2fd; color: #0d47a1; }
.conf-C { background: #fff3e0; color: #e65100; }
.conf-D { background: #fbe9e7; color: #b71c1c; }

.bet-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.bet-card-detail {
  font-size: 0.88rem;
  color: #555;
  flex: 1;
}

.bet-card-points {
  font-size: 0.82rem;
  color: #888;
  white-space: nowrap;
}

.bet-card-ticket {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.bet-card-ticket-type {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: #607d8b;
  border-radius: 4px;
  padding: 1px 8px;
  white-space: nowrap;
}

.bet-card-ticket-body {
  font-size: 0.95rem;
  font-weight: 500;
}

.bet-card-result {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,0.08);
  font-size: 0.88rem;
  flex-wrap: wrap;
}

.bet-card-result-return {
  color: #555;
}

.bet-summary-row {
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.03);
  border-radius: 8px;
  font-size: 0.9rem;
}

/* ── レース分類バッジ ────────────────────────────── */
.race-type-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.rtype-断然 {
  background: #1565c0;
  color: #fff;
}

.rtype-本命 {
  background: #00796b;
  color: #fff;
}

.rtype-混戦 {
  background: #e65100;
  color: #fff;
}

.rtype-波乱 {
  background: #b71c1c;
  color: #fff;
}

.rtype-超波乱 {
  background: #6a1b9a;
  color: #fff;
}

.settings-page {
  max-width: 1600px;
}

.settings-lead {
  margin: 0 0 12px;
  color: #3f5528;
  font-size: 0.9rem;
}

.settings-form-panel {
  border: 1px solid rgba(74, 143, 58, 0.28);
  border-radius: 12px;
}

.settings-group {
  border: 1px solid rgba(74, 143, 58, 0.25);
  border-radius: 10px;
  background: rgba(233, 242, 210, 0.72);
  padding: 10px 12px 4px;
  margin-bottom: 12px;
}

.settings-group > summary {
  cursor: pointer;
  font-weight: 700;
  color: #2f4a1c;
  padding-bottom: 6px;
}

.settings-group > summary::-webkit-details-marker {
  display: none;
}

.settings-subhead {
  margin: 6px 0 2px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #4d6832;
}

.settings-row {
  margin-bottom: 0;
}

.settings-active-switch {
  padding-top: 1.5rem;
}

.settings-checkbox-line {
  padding-top: 0.6rem;
}

.settings-submit-line {
  margin-top: 8px;
}

/* スティッキー保存バー */
.settings-sticky-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 253, 240, 0.97);
  border-bottom: 1px solid rgba(74, 143, 58, 0.3);
  border-radius: 2px 2px 0 0;
  margin: -24px -24px 16px;
  padding: 10px 24px;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.07);
}

.settings-sticky-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.settings-form-errors {
  color: #c62828;
  font-size: 0.88rem;
  flex: 1;
}

.settings-rebuild-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
}

/* 重み合計インジケーター */
.settings-weight-sum {
  margin-left: 12px;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--muted);
}

.settings-sum-ok {
  color: var(--secondary);
  font-weight: 700;
}

.settings-sum-warn {
  color: #c62828;
  font-weight: 700;
}

/* スライダー値表示 */
.settings-range-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

/* フィールドエラー */
.settings-field-error {
  display: block;
  font-size: 0.8rem;
  color: #c62828;
  margin-top: 2px;
}

/* 再作成パネル */
.settings-run-now-panel {
  border: 1px solid rgba(240, 140, 40, 0.4) !important;
  border-radius: 2px !important;
  background: rgba(255, 245, 220, 0.6) !important;
  margin-top: 16px;
}

.settings-run-now-head {
  font-weight: 700;
  color: #7a4000;
  margin-bottom: 10px;
  font-size: 1rem;
}

/* SNS予想ソーステーブル */
.sns-sources-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
  font-size: 0.88rem;
}

.sns-sources-table th {
  text-align: left;
  padding: 4px 6px;
  border-bottom: 2px solid rgba(74, 143, 58, 0.3);
  color: #4d6832;
  font-weight: 700;
  white-space: nowrap;
}

.sns-sources-table td {
  padding: 3px 4px;
  vertical-align: middle;
}

.sns-sources-table .sns-col-weight {
  width: 80px;
}

.sns-sources-table .sns-col-del {
  width: 40px;
}

.sns-input-label,
.sns-input-url {
  width: 100%;
  border: 1px solid #c8d9b3;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 0.88rem;
  background: #fff;
  box-sizing: border-box;
}

.sns-input-weight {
  width: 70px;
  border: 1px solid #c8d9b3;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 0.88rem;
  background: #fff;
  text-align: right;
}

.sns-del-btn {
  padding: 0 4px !important;
  min-width: 0 !important;
}

/* Evaluation table: rank row highlights */
tr.eval-rank-1 td { background-color: #fffde7 !important; }
tr.eval-rank-2 td { background-color: #f5f5f5 !important; }
tr.eval-rank-3 td { background-color: #fff3e0 !important; }

.eval-rank-badge {
  font-size: 0.95rem;
  font-weight: 700;
  margin-right: 3px;
  vertical-align: middle;
}

.eval-rank-badge-1 { color: #c79a00; }
.eval-rank-badge-2 { color: #5e5e5e; }
.eval-rank-badge-3 { color: #a0522d; }

.eval-total-cell {
  white-space: nowrap;
}

.eval-total-val {
  font-weight: 700;
  vertical-align: middle;
}

.eval-total-val {
  font-size: 0.9rem;
}

.eval-score-bar-track {
  height: 3px;
  background: #e0e0e0;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 3px;
  min-width: 40px;
}

.eval-score-bar-fill {
  height: 100%;
  background: #888;
  border-radius: 2px;
  max-width: 100%;
}

tr.eval-rank-1 .eval-score-bar-fill { background: #c79a00; }
tr.eval-rank-2 .eval-score-bar-fill { background: #9e9e9e; }
tr.eval-rank-3 .eval-score-bar-fill { background: #c07040; }

/* Score heat colors for individual score cells */
td.score-hi {
  background-color: #e3f2fd !important;
  color: #1565c0;
  font-weight: 600;
}

.score-hi-text { color: #1565c0; font-weight: 600; }

/* ── popularity chart ── */
.pop-chart-wrap {
  position: relative;
  width: 100%;
  height: 260px;
  margin-bottom: 16px;
}

.pop-chart-canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ── popularity move cards ── */
.pop-move-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 8px;
}
.pop-move-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 6px;
  min-width: 120px;
  border-left: 4px solid transparent;
}
.pop-move-up {
  background: #e8f5e9;
  border-left-color: #43a047;
}
.pop-move-down {
  background: #fce4ec;
  border-left-color: #e53935;
}
.pop-move-horse {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}
.pop-move-horseno {
  font-size: 0.75rem;
  min-width: 22px;
  height: 22px;
  line-height: 22px;
}
.pop-move-name {
  white-space: nowrap;
}
.pop-move-ranks {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
}
.pop-move-from {
  color: #777;
}
.pop-move-arrow {
  font-size: 1rem;
  font-weight: 700;
}
.pop-move-up .pop-move-arrow { color: #43a047; }
.pop-move-down .pop-move-arrow { color: #e53935; }
.pop-move-to {
  font-weight: 700;
}
.pop-move-up .pop-move-to { color: #2e7d32; }
.pop-move-down .pop-move-to { color: #c62828; }
.pop-move-delta {
  font-size: 0.75rem;
  color: #999;
}
.pop-move-odds {
  font-size: 0.75rem;
  color: #555;
}

.result-hit-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, #1b5e20, #2e7d32);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12), inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

.result-miss-text {
  color: rgba(0, 0, 0, 0.58);
  font-weight: 600;
}

.race-bet-result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.race-bet-section,
.race-result-section {
  min-width: 0;
}

@media (max-width: 900px) {
  .race-detail-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .race-title-row {
    width: 100%;
    display: block;
  }

  .race-title-row h4 {
    font-size: 2rem;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .race-nav-links {
    width: 100%;
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .race-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 1px solid rgba(74, 143, 58, 0.35);
    border-radius: 8px;
    background: rgba(223, 234, 197, 0.9);
  }

  .race-detail-actions {
    width: 100%;
    align-items: flex-start;
  }

  .race-finished-box {
    width: 100%;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .race-finished-box .grey-text {
    margin-top: 0 !important;
  }
}

@media (min-width: 993px) {
  .race-overview-stack {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  }
}

@media (min-width: 993px) {
  .race-detail-page {
    padding-left: 28px;
    padding-right: 28px;
  }

  .race-bet-result-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }

  .detail-accordion > summary h5::after {
    display: none;
  }
}

@media (max-width: 992px) {
  .dashboard-main-col,
  .dashboard-side-col {
    display: block;
  }

  .dashboard-side-col {
    order: -1;
  }

  .dashboard-main-col {
    order: 0;
  }

  .dashboard-table-view {
    display: none;
  }

  .dashboard-mobile-list {
    display: block;
  }

  .dashboard-main-card .card-content,
  .dashboard-filter-card .card-content {
    padding: 14px;
  }

  /* ── 収支レポート モバイル最適化 ── */
  .dashboard-summary-card .card-content,
  .dashboard-prediction-card .card-content {
    padding: 16px;
  }

  .dashboard-summary-card .card-title,
  .dashboard-prediction-card .card-title {
    font-size: 1.15rem;
    margin-bottom: 12px;
  }

  .pnl-hero {
    flex-direction: column;
    gap: 12px;
  }

  .pnl-hero-left,
  .pnl-hero-right {
    padding: 14px 16px;
  }

  .pnl-hero-label,
  .pnl-profit-label {
    font-size: 0.85rem;
  }

  .pnl-hero-value {
    font-size: 2.4rem;
  }

  .pnl-profit-value {
    font-size: 1.6rem;
  }

  .pred-kpi-sub {
    font-size: 0.82rem;
    color: #888;
  }

  .pnl-wld {
    gap: 8px;
    justify-content: center;
  }

  .pnl-wld-item {
    font-size: 0.95rem;
    padding: 6px 14px;
    border-radius: 6px;
  }

  .pnl-pattern-table {
    font-size: 0.92rem;
  }

  .pnl-pattern-table .pnl-pattern-name {
    font-size: 0.88rem;
  }

  .pnl-pattern-table th,
  .pnl-pattern-table td {
    padding: 8px 6px;
  }

  /* ── 予想レポート KPI モバイル最適化 ── */
  .pred-meta {
    font-size: 0.92rem;
    margin-bottom: 14px;
  }

  .pred-kpi-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .pred-kpi-item {
    padding: 14px 16px;
  }

  .pred-kpi-label {
    font-size: 0.88rem;
    margin-bottom: 4px;
  }

  .pred-kpi-value {
    font-size: 2rem;
  }

  .pred-bar-wrap {
    height: 6px;
    margin: 6px 0 4px;
  }

  .pred-kpi-sub {
    font-size: 0.82rem;
  }

  .pred-full-hit {
    font-size: 1rem;
    padding: 10px 14px;
  }

  /* ── 距離別テーブル モバイル最適化 ── */
  .pred-band-title {
    font-size: 0.9rem;
    margin-bottom: 8px;
  }

  .pred-band-table {
    font-size: 0.92rem;
  }

  .pred-band-table th,
  .pred-band-table td {
    padding: 8px 6px;
  }

  .pred-band-table th:first-child,
  .pred-band-table td:first-child {
    font-size: 0.85rem;
  }

  .pred-band-table th {
    font-size: 0.85rem;
  }

  .dashboard-filter-disclosure:not([open]) > .dashboard-filter-form {
    display: none;
  }

  .race-detail-page {
    gap: 14px;
    padding: 0 6px;
  }

  .detail-accordion {
    padding: 10px;
  }

  .race-bet-result-grid {
    gap: 14px;
  }

  .race-detail-page table {
    margin-top: 8px;
    font-size: 0.9rem;
  }
}

@media (min-width: 993px) {
  .dashboard-filter-disclosure > summary {
    display: none;
  }
}

.btn {
  background-color: var(--secondary);
}

.btn:hover,
.btn:focus {
  background-color: #3f7d32;
}

.btn-flat {
  color: #52722f;
}

.dropdown-content,
ul.dropdown-content.select-dropdown {
  background: #e7f0ce;
  border: 1px solid var(--line);
}

.dropdown-content li > span {
  color: #415828;
}

.dropdown-content li:hover,
.dropdown-content li.active {
  background: #e8f2cd;
}

input:not([type]):focus:not([readonly]),
input[type="text"]:focus:not([readonly]),
input[type="number"]:focus:not([readonly]),
input[type="date"]:focus:not([readonly]),
textarea.materialize-textarea:focus:not([readonly]) {
  border-bottom: 1px solid var(--primary);
  box-shadow: 0 1px 0 0 var(--primary);
}

input:not([type]),
input[type="text"],
input[type="number"],
input[type="date"],
.select-wrapper input.select-dropdown {
  color: var(--ink);
  border-bottom: 1px solid #a8c475;
}

.input-field > label,
.input-field > label.active {
  color: var(--muted) !important;
}

.input-field .prefix.active {
  color: var(--primary);
}

.win5-page-card {
  border-top: 5px solid var(--secondary);
}

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

.win5-point-form {
  min-width: 280px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-left: auto;
  justify-content: flex-end;
}

.win5-point-input-wrap {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.win5-point-label {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.2;
}

.win5-point-input {
  width: 150px;
  height: 48px;
  padding: 0 12px;
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  background: #eef5da;
  border: 1px solid #b8c990 !important;
  border-radius: 8px;
  box-sizing: border-box;
  margin: 0 !important;
}

.win5-point-input:focus {
  border-color: #6d8e3d !important;
  box-shadow: 0 0 0 2px rgba(109, 142, 61, 0.2) !important;
}

.win5-point-input::-webkit-outer-spin-button,
.win5-point-input::-webkit-inner-spin-button {
  margin: 0;
}

.win5-point-submit {
  height: 48px;
  line-height: 48px;
  padding: 0 22px;
  font-weight: 700;
}

.win5-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.win5-table {
  min-width: 1050px;
}

.win5-detail-link {
  margin-left: 6px;
  font-size: 0.85rem;
}

/* 荒れ指数バッジ */
.win5-chaos-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
}

.win5-chaos-low  { background: #e8f4fb; color: #1a5080; }
.win5-chaos-mid  { background: #fff3cd; color: #7a5000; }
.win5-chaos-high { background: #fde8cc; color: #8b3500; }
.win5-chaos-ultra { background: #fde8e8; color: #8b1c1c; }

.win5-dangon-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #d1f0d9;
  color: #155c28;
  border: 1px solid #6dba8a;
  cursor: help;
}

/* プリセットボタン */
.win5-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.win5-preset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid #b8c990;
  background: #eef5da;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.win5-preset:hover {
  background: #ddedb5;
  border-color: #8aaa52;
  color: var(--ink);
}

.win5-preset-active {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #fff;
}

.win5-preset-active:hover {
  background: #27883f;
  color: #fff;
}

/* メタチップ拡張 */
.win5-chip-warn {
  background: #fdedc8;
  color: #7a4a00;
}

.win5-chip-ok {
  background: #d6f0de;
  color: #1a5c30;
}

.win5-chip-queued {
  background: #e8eaf6;
  color: #3949ab;
  animation: win5-pulse 1.6s ease-in-out infinite;
}

@keyframes win5-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.win5-chip-estimated {
  border: 1px dashed #c0a060;
}

.win5-approx {
  font-size: 0.78rem;
  opacity: 0.8;
}

.win5-diff {
  font-size: 0.82rem;
  color: #b85000;
  font-weight: 700;
}

.win5-diff-over {
  font-size: 0.82rem;
  color: #1a5c30;
  font-weight: 700;
}

/* 進捗サマリー */
.win5-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.win5-progress-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
}

.win5-hit-badge {
  background: #d1f0d9;
  color: #155c28;
  border: 1px solid #6dba8a;
}

.win5-miss-badge {
  background: #fde8e8;
  color: #8b1c1c;
  border: 1px solid #e09090;
}

.win5-progress-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.win5-progress-complete {
  color: var(--secondary);
  font-weight: 700;
}

/* テーブル行の的中/不的中ハイライト */
.win5-row-hit td {
  background: rgba(100, 200, 120, 0.08) !important;
}

.win5-row-miss td {
  background: rgba(220, 80, 80, 0.06) !important;
  opacity: 0.75;
}

/* 判定バッジ */
.win5-verdict {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.win5-verdict-hit {
  background: #d1f0d9;
  color: #155c28;
  border: 1px solid #6dba8a;
}

.win5-verdict-miss {
  background: #fde8e8;
  color: #8b1c1c;
  border: 1px solid #e09090;
}

.win5-verdict-pending {
  color: #aaa;
}

/* 買い目：馬番+馬名chip */
.win5-horse-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #d6e4b3;
  color: #334c20;
  border-radius: 999px;
  padding: 1px 8px 1px 2px;
  font-size: 0.82rem;
  margin: 2px 2px;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
}

.win5-horse-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 992px) {
  .win5-head {
    flex-direction: column;
  }

  .win5-point-form {
    width: 100%;
    align-items: flex-end;
    justify-content: flex-end;
  }

  .win5-point-input {
    width: 100%;
    max-width: 220px;
  }

  .win5-horse-name {
    display: none;
  }

  .win5-horse-chip {
    padding: 1px 4px;
    max-width: unset;
  }
}
