:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f7f8fa;
  --text: #1c2430;
  --text-muted: #64748b;
  --border: #e5e9f0;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --positive: #15803d;
  --positive-bg: #e7f8ee;
  --neutral: #52525b;
  --neutral-bg: #eef0f3;
  --negative: #c02626;
  --negative-bg: #fdecec;
  --pending: #a16207;
  --pending-bg: #fdf6e3;
  --shadow: 0 1px 3px rgba(28, 36, 48, 0.06);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); }

.site-header {
  background: linear-gradient(180deg, var(--accent-soft), var(--bg));
  border-bottom: 1px solid var(--border);
  padding: 20px 0 16px;
}
.header-row { display: flex; align-items: center; justify-content: space-between; }
.brand { margin: 0; font-size: 25px; letter-spacing: -0.02em; }
.header-actions { display: flex; align-items: center; gap: 12px; }
#lang-toggle {
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
  border-radius: 999px; padding: 4px 14px; cursor: pointer; font-size: 12px; font-weight: 600;
}
#lang-toggle:hover { border-color: var(--accent); color: var(--accent); }
.share-bar { display: flex; align-items: center; gap: 6px; position: relative; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
  cursor: pointer; text-decoration: none;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-toast {
  position: absolute; top: 36px; right: 0; white-space: nowrap;
  background: var(--text); color: var(--bg); border-radius: 6px;
  padding: 3px 10px; font-size: 11px; z-index: 10;
}
.brand span { color: var(--accent); }
.tagline { margin: 2px 0 0; color: var(--text-muted); font-size: 13px; }
.about { margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.about summary { cursor: pointer; display: inline-block; color: var(--text-muted); }
.about summary:hover { color: var(--accent); }
.about p { margin: 6px 0 0; max-width: 720px; line-height: 1.7; }

.market-tabs { display: flex; gap: 8px; margin: 18px 0 0; border-bottom: 2px solid var(--border); }
.market-tab {
  background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px;
  color: var(--text-muted); padding: 8px 18px; cursor: pointer; font-size: 15px; font-weight: 600;
}
.market-tab:hover { color: var(--text); }
.market-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.form-chip {
  display: inline-block; border: 1px solid var(--border); border-radius: 4px;
  color: var(--text-muted); font-size: 11px; padding: 0 5px; margin-right: 2px;
  vertical-align: 1px; white-space: nowrap;
}

.controls {
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center; justify-content: space-between;
  margin: 18px 0 10px;
}
.date-nav { display: flex; gap: 6px; align-items: center; }
.date-nav button, .pager button, #today-btn, #clear-date-btn {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 6px 10px; cursor: pointer; font-size: 13px;
}
.date-nav button:hover, .pager button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pager button:disabled { opacity: 0.4; cursor: default; }
#clear-date-btn { display: none; color: var(--text-muted); }
#clear-date-btn.visible { display: inline-block; }
#date-input {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 5px 8px; font-size: 13px;
}
#search-input {
  flex: 1; min-width: 220px; max-width: 380px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 7px 12px; font-size: 13px;
}
#search-input:focus, #date-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.tab {
  background: none; border: 1px solid transparent; border-radius: 999px;
  color: var(--text-muted); padding: 5px 14px; cursor: pointer; font-size: 13px;
}
.tab:hover { color: var(--text); background: var(--surface-soft); }
.tab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.tab .count { font-variant-numeric: tabular-nums; opacity: 0.8; margin-left: 2px; }
.tab-positive.active { color: var(--positive); border-color: var(--positive); background: var(--positive-bg); }
.tab-negative.active { color: var(--negative); border-color: var(--negative); background: var(--negative-bg); }

.table-container {
  overflow-x: auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow);
}
table { border-collapse: collapse; width: 100%; min-width: 760px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-soft); }
th { font-size: 12px; color: var(--text-muted); font-weight: 600; white-space: nowrap; position: sticky; top: 0; background: var(--surface-soft); }
.col-time { width: 110px; }
.col-code { width: 64px; }
.col-name { width: 180px; }
.col-verdict { width: 96px; }
.col-conf { width: 72px; }
td.time { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text-muted); }
td.code { font-variant-numeric: tabular-nums; }
td.conf { font-variant-numeric: tabular-nums; text-align: right; color: var(--text-muted); }
td.title a { color: var(--text); text-decoration: none; }
td.title a:hover { color: var(--accent); text-decoration: underline; }
.summary-toggle {
  background: none; border: none; color: var(--accent); cursor: pointer;
  font-size: 12px; padding: 0; margin-left: 6px;
}
.summary-row td, tbody tr.summary-row:hover td {
  background: var(--surface-soft); font-size: 13px; color: var(--text-muted);
}
.summary-row ul { margin: 4px 0; padding-left: 18px; }
.empty { text-align: center; color: var(--text-muted); padding: 32px 0 !important; }

.badge {
  display: inline-block; border-radius: 999px; padding: 2px 10px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-positive { color: var(--positive); background: var(--positive-bg); }
.badge-neutral { color: var(--neutral); background: var(--neutral-bg); }
.badge-negative { color: var(--negative); background: var(--negative-bg); }
.badge-pending { color: var(--pending); background: var(--pending-bg); animation: pulse 1.6s ease-in-out infinite; }
.badge-failed { color: var(--text-muted); background: var(--neutral-bg); }
@keyframes pulse { 50% { opacity: 0.45; } }

.low-confidence { opacity: 0.65; }

.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 16px 0 4px; }
#page-info { color: var(--text-muted); font-size: 13px; }
.refresh-note { text-align: center; color: var(--text-muted); font-size: 12px; margin: 4px 0 24px; }

.site-footer { border-top: 1px solid var(--border); background: var(--surface-soft); padding: 16px 0 28px; }
.site-footer p { color: var(--text-muted); font-size: 12px; margin: 4px 0; }
.site-footer .author { font-size: 13px; color: var(--text); }
