:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #171a1f;
  --muted: #667085;
  --line: #e4e7ec;
  --primary: #1f5eff;
  --primary-dark: #1548c8;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --success: #067647;
  --success-bg: #ecfdf3;
  --shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
}

[hidden] { display: none !important; }
button:focus-visible, .ruler-scroll:focus-visible { outline: 3px solid #1f5eff; outline-offset: 3px; }

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.6;
}
.container { width: min(960px, calc(100% - 32px)); margin: 0 auto; }
.site-header { background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(10px); }
.header-inner, .footer-inner { min-height: 60px; display: flex; align-items: center; gap: 10px; }
.brand { color: var(--text); text-decoration: none; font-weight: 800; }
.badge { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; color: var(--muted); }
.main { padding: 48px 0 64px; }
.hero { margin-bottom: 26px; }
.eyebrow { margin: 0 0 6px; color: var(--primary); font-weight: 700; font-size: 14px; }
h1 { font-size: clamp(32px, 6vw, 52px); line-height: 1.12; letter-spacing: -.03em; margin: 0; }
.lead { color: var(--muted); font-size: 18px; margin: 14px 0 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); margin-top: 20px; }
h2 { margin: 0 0 18px; font-size: 21px; }
.drop-zone { border: 2px dashed #cbd5e1; border-radius: 14px; padding: 30px 16px; text-align: center; transition: .15s ease; background: #fbfcfe; }
.drop-zone.dragover { border-color: var(--primary); background: #f2f6ff; }
.drop-main { font-weight: 700; margin: 0; }
.drop-sub { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
.file-name { margin: 12px 0 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.drop-zone.has-file { border: 2px solid #079455; background: #ecfdf3; }
.has-file .drop-main { color: #067647; font-size: 21px; }
.has-file .file-name { margin: 12px 0 4px; font-size: 24px; font-weight: 800; line-height: 1.4; color: #173b2b; }
.has-file #fileHint { margin: 16px auto; max-width: 520px; font-size: 14px; color: #344054; }
.has-file #fileSize { color: #475467; }
.has-file .secondary { background: white; color: #067647; border: 1px solid #75cba3; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.field { display: grid; gap: 7px; font-weight: 700; font-size: 14px; }
select, input[type="number"] { width: 100%; height: 46px; border: 1px solid #cfd4dc; border-radius: 10px; padding: 0 12px; background: #fff; color: var(--text); font: inherit; }
select:focus, input:focus { outline: 3px solid rgba(31,94,255,.14); border-color: var(--primary); }
.check-row { display: flex; align-items: center; gap: 9px; margin-top: 16px; color: #344054; font-size: 14px; }
.privacy-note { margin: 18px 0; border-radius: 10px; background: #f8fafc; padding: 10px 12px; color: #475467; font-size: 13px; }
.button { border: 0; border-radius: 10px; min-height: 44px; padding: 10px 16px; font: inherit; font-weight: 800; cursor: pointer; }
.button:disabled { cursor: not-allowed; opacity: .45; }
.primary { width: 100%; background: var(--primary); color: white; }
.primary:hover:not(:disabled) { background: var(--primary-dark); }
.secondary { background: #eef2ff; color: #3148a5; }
.ghost { background: transparent; border: 1px solid var(--line); color: #344054; }
.error { min-height: 22px; color: var(--danger); font-size: 14px; margin: 10px 0 0; }
.result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.stat-label { display: block; color: var(--muted); font-size: 13px; }
.stat strong { display: block; font-size: 28px; margin-top: 2px; }
.success-box { background: var(--success-bg); color: var(--success); border-radius: 12px; padding: 14px; font-weight: 700; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 12px 14px; vertical-align: top; }
th { background: #f8fafc; color: #475467; font-size: 13px; }
td { font-size: 14px; }
tr:last-child td { border-bottom: 0; }
.howto ol { margin: 0; padding-left: 22px; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; background: #fff; }
.footer-inner { justify-content: space-between; }

@media (max-width: 640px) {
  .main { padding-top: 32px; }
  .card { padding: 18px; border-radius: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .result-heading { display: grid; }
  .ghost { width: 100%; }
  .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; padding: 12px 0; }
}
