:root {
  color-scheme: light;
  --ink: #16212f;
  --muted: #667188;
  --line: #d8e0eb;
  --paper: #f7f9fb;
  --surface: #ffffff;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --warn: #8a4b12;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.app-version-badge {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  border: 1px solid rgba(22, 33, 47, 0.14);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 20px rgba(22, 33, 47, 0.12);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  pointer-events: none;
}

@media print {
  .app-version-badge { display: none; }
}

a { color: inherit; }

.shell {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.page-header {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.title-row {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
}

h1, h2 {
  margin: 0;
  line-height: 1.25;
}

h1 { font-size: clamp(28px, 4vw, 44px); }
h2 { font-size: 26px; }

.lead {
  margin: 12px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.home-link,
button,
.official-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  min-height: 40px;
  padding: 0 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.home-link,
.official-link {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.notice {
  margin: 22px 0 0;
  border: 1px solid #f6d583;
  background: #fff8df;
  color: var(--warn);
  padding: 14px 16px;
  line-height: 1.7;
  font-weight: 700;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.meta-row span {
  border: 1px solid var(--line);
  background: #f7fafc;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
}

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

.metric {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 18px;
}

.metric dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric dd {
  margin: 8px 0 0;
  font-size: 24px;
  font-weight: 800;
}

.toolbar {
  display: grid;
  grid-template-columns: 2fr repeat(5, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
}

.table-wrap {
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1080px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: #f3f6fa;
  font-size: 12px;
  white-space: nowrap;
}

.item-title {
  max-width: 460px;
  font-weight: 800;
  line-height: 1.5;
}

.item-desc {
  margin: 6px 0 0;
  max-width: 460px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.badge {
  display: inline-flex;
  margin: 0 6px 6px 0;
  border-radius: 999px;
  background: #e8f3f1;
  color: var(--accent-dark);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.nowrap { white-space: nowrap; }

@media (max-width: 960px) {
  .shell { width: min(100% - 24px, 1440px); }
  .title-row { display: grid; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .summary-grid,
  .toolbar { grid-template-columns: 1fr; }
  .page-header { padding: 20px; }
}
