/* 26day Dashboard v2 — Tail-Digit First, Smartphone Optimized */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f0f2f7;
  --surface: #ffffff;
  --primary: #1a1a2e;
  --accent: #e63946;
  --accent2: #2196f3;
  --text: #1a1a2e;
  --muted: #6b7280;
  --border: #e5e7eb;
  --hot: #fee2e2;
  --hot-text: #991b1b;
  --warm: #fef3c7;
  --warm-text: #92400e;
  --cool: #dbeafe;
  --cool-text: #1e40af;
  --low-conf: #f3f4f6;
  --low-conf-text: #6b7280;
  --radius: 12px;
  --shadow: 0 1px 4px rgba(0,0,0,.08);
}

html { font-size: 15px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Header ── */
.header {
  background: var(--primary);
  color: #fff;
  padding: 14px 16px 10px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.header h1 { font-size: 16px; font-weight: 700; }
.header .sub { font-size: 11px; color: #9ca3af; margin-top: 2px; }

/* ── Mockup banner ── */
.banner-mock {
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  padding: 4px 10px;
  font-size: 11px;
  color: #78350f;
  margin: 8px 12px 0;
  border-radius: 4px;
  display: inline-block;
}

/* ── Meta strip ── */
.meta-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}
.meta-strip b { color: var(--text); }

/* ── Section header ── */
.sec-head {
  padding: 14px 12px 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--muted);
}

/* ── Tail-digit overview grid ── */
.digit-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 0 12px 4px;
}
.d-cell {
  border-radius: 10px;
  padding: 8px 4px 6px;
  text-align: center;
  background: var(--surface);
  border: 2px solid transparent;
  box-shadow: var(--shadow);
  position: relative;
}
.d-cell.hot  { background: var(--hot);  border-color: #f87171; }
.d-cell.warm { background: var(--warm); border-color: #fbbf24; }
.d-cell .d-num     { font-size: 20px; font-weight: 800; line-height: 1; }
.d-cell .d-count   { font-size: 10px; color: var(--muted); margin-top: 2px; }
.d-cell .d-avg     { font-size: 10px; font-weight: 600; margin-top: 1px; }
.d-cell.hot  .d-avg  { color: var(--hot-text); }
.d-cell.warm .d-avg  { color: var(--warm-text); }
.d-cell .d-badge {
  position: absolute;
  top: -5px; right: -5px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 20px;
}

/* ── Strong candidate list ── */
.candidate-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px 4px;
}
.cand-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  border-left: 4px solid var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
}
.cand-card.warm { border-left-color: #f59e0b; }
.cand-digit {
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
  min-width: 36px;
  text-align: center;
}
.cand-card.warm .cand-digit { color: #d97706; }
.cand-info { flex: 1; }
.cand-title { font-size: 14px; font-weight: 700; }
.cand-detail { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cand-conf {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
}
.conf-high { background: var(--hot); color: var(--hot-text); }
.conf-mid  { background: var(--warm); color: var(--warm-text); }
.conf-low  { background: var(--low-conf); color: var(--low-conf-text); }

/* ── Tail section divider ── */
.tail-divider {
  background: var(--primary);
  color: #fff;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.tail-divider .tnum {
  font-size: 24px;
  font-weight: 900;
  min-width: 32px;
  line-height: 1;
}
.tail-divider .hot-tag {
  font-size: 10px;
  background: var(--accent);
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: auto;
}
.tail-divider .warm-tag {
  font-size: 10px;
  background: #f59e0b;
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: auto;
}

/* ── Machine card ── */
.machine-cards { display: flex; flex-direction: column; gap: 8px; padding: 8px 12px; }
.m-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px;
}
.m-card.low-conf { border: 1px dashed #d1d5db; background: #fafafa; }
.m-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.m-num { font-size: 18px; font-weight: 800; }
.m-name { font-size: 13px; color: var(--muted); flex: 1; }
.m-est-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}
.est-56 { background: var(--hot); color: var(--hot-text); }
.est-45 { background: var(--warm); color: var(--warm-text); }
.est-23 { background: var(--cool); color: var(--cool-text); }
.est-1  { background: var(--low-conf); color: var(--low-conf-text); }

.m-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  font-size: 12px;
  text-align: center;
}
.m-stat-label { color: var(--muted); font-size: 10px; }
.m-stat-val   { font-weight: 600; font-size: 13px; }

.m-note { font-size: 11px; color: var(--muted); margin-top: 6px; }
.m-note.warn { color: #d97706; }
.m-note.low  { color: var(--low-conf-text); font-style: italic; }

/* ── Setting estimate explanation ── */
.explain-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 8px 12px;
  padding: 12px;
  font-size: 13px;
}
.explain-box h3 { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.explain-row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--border); }
.explain-row:last-child { border-bottom: none; }
.explain-label { color: var(--muted); }
.explain-val   { font-weight: 600; }

/* ── Estimate warning ── */
.warning-est {
  background: #fee2e2;
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 11px;
  color: #7f1d1d;
  margin: 8px 12px 16px;
}
