:root {
  --ink: #172033;
  --muted: #687287;
  --line: #dfe4ec;
  --panel: #ffffff;
  --background: #f4f6fa;
  --primary: #3157d5;
  --primary-dark: #2445b6;
  --accent: #2eb79a;
  --danger: #c93f55;
  --warning: #e49b24;
  --radius: 16px;
  --shadow: 0 12px 35px rgba(31, 42, 68, .08);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 0, rgba(49, 87, 213, .09), transparent 28rem),
    var(--background);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  line-height: 1.7;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
.site-header {
  background: rgba(255, 255, 255, .9);
  border-bottom: 1px solid rgba(223, 228, 236, .85);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { color: var(--ink); font-size: 1.05rem; font-weight: 800; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
nav { display: flex; gap: 22px; }
nav a, .nav-button { color: var(--muted); font-size: .92rem; font-weight: 650; }
.nav-button { border: 0; background: transparent; cursor: pointer; font-family: inherit; padding: 0; }
.nav-button:hover { color: var(--primary); text-decoration: underline; }
main.container { padding-block: 48px 72px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.35rem); line-height: 1.18; letter-spacing: -.035em; margin-bottom: 14px; }
h2 { font-size: 1.25rem; }
.lead { color: var(--muted); max-width: 720px; margin-bottom: 0; }
.muted { color: var(--muted); }
.eyebrow { color: var(--primary); font-weight: 800; font-size: .76rem; letter-spacing: .17em; text-transform: uppercase; margin-bottom: 8px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 28px; margin-bottom: 34px; }
.card { background: var(--panel); border: 1px solid rgba(223, 228, 236, .9); border-radius: var(--radius); box-shadow: var(--shadow); }
.check-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; align-items: stretch; }
.upload-card { padding: clamp(20px, 4vw, 42px); }
.feature-flow { display: grid; gap: 14px; }
.feature-flow .compact {
  display: grid;
  align-content: center;
  border-color: transparent;
}
.feature-flow .compact:nth-child(1) {
  background: #edf3ff;
  border-left: 5px solid #3157d5;
}
.feature-flow .compact:nth-child(2) {
  background: #f4efff;
  border-left: 5px solid #8057d9;
}
.feature-flow .compact:nth-child(3) {
  background: #eaf8f4;
  border-left: 5px solid #269b82;
}
.feature-flow .compact:nth-child(1) .step-number { color: #3157d5; }
.feature-flow .compact:nth-child(2) .step-number { color: #8057d9; }
.feature-flow .compact:nth-child(3) .step-number { color: #21836f; }
.stack { display: grid; gap: 20px; }
label { display: grid; gap: 7px; font-size: .92rem; font-weight: 700; }
input[type="text"], input[type="password"], textarea {
  width: 100%;
  border: 1px solid #ccd3df;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 12px 14px;
}
input:focus, textarea:focus { border-color: var(--primary); outline: 3px solid rgba(49, 87, 213, .12); }
.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 750;
  justify-content: center;
  padding: 10px 17px;
  transition: .18s ease;
}
.button:hover { text-decoration: none; transform: translateY(-1px); }
.button.primary { background: var(--primary); color: white; box-shadow: 0 8px 20px rgba(49, 87, 213, .2); }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { background: white; border-color: var(--line); color: var(--ink); }
.button.large { min-height: 54px; }
.button:disabled { cursor: wait; opacity: .65; transform: none; }
.drop-zone {
  min-height: 290px;
  align-content: center;
  justify-items: center;
  text-align: center;
  border: 2px dashed #b9c4d8;
  border-radius: 14px;
  background: #fafbfe;
  padding: 32px;
  cursor: pointer;
  transition: .18s ease;
}
.drop-zone:hover, .drop-zone.dragging { border-color: var(--primary); background: #f4f7ff; }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone span, .drop-zone small { color: var(--muted); font-weight: 500; }
.drop-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--primary); color: white !important; font-weight: 900 !important; letter-spacing: .06em; }
.rules-overview { margin-top: 42px; }
.rules-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.rule-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.rule-card { padding: 20px; box-shadow: none; }
.rule-words { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; }
.ng-word { color: var(--danger); text-decoration: line-through; text-decoration-thickness: 1px; }
.rule-arrow { color: var(--muted); }
.rule-card p { color: var(--muted); font-size: .85rem; margin: 10px 0 0; }
.compact { padding: 24px; box-shadow: none; }
.compact p { color: var(--muted); margin-bottom: 0; font-size: .93rem; }
.step-number, .section-index { color: var(--primary); font-size: .76rem; font-weight: 900; letter-spacing: .12em; }
.auth-card { max-width: 460px; margin: 4vh auto 0; padding: clamp(24px, 5vw, 42px); }
.alert { border-radius: 10px; margin-bottom: 22px; padding: 12px 15px; }
.alert-error { color: #8f2637; background: #fff0f2; border: 1px solid #f4c7cf; }
.alert-success { color: #156b59; background: #edfaf7; border: 1px solid #bde9df; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 42px; }
.summary-card { background: var(--ink); color: #fff; border-radius: 14px; padding: 22px; display: grid; gap: 2px; }
.summary-card strong { font-size: 2rem; line-height: 1.2; }
.summary-card span { color: #b9c2d5; font-size: .85rem; }
.result-section + .result-section { margin-top: 48px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-heading > div { display: flex; align-items: center; gap: 12px; }
.section-heading h2 { margin: 0; }
.count-badge, .tag, .severity, .status { display: inline-flex; border-radius: 999px; font-size: .76rem; font-weight: 800; padding: 4px 10px; }
.count-badge { background: #e9edfa; color: var(--primary); }
.results-list { display: grid; gap: 14px; }
.result-card { background: white; border: 1px solid var(--line); border-left: 5px solid var(--primary); border-radius: 12px; padding: 22px; }
.result-card.severity-high { border-left-color: var(--danger); }
.result-card.severity-medium { border-left-color: var(--warning); }
.result-card.severity-low { border-left-color: var(--accent); }
.result-card h3 { font-size: 1.1rem; margin: 12px 0 18px; }
.result-meta { display: flex; justify-content: space-between; }
.tag { color: var(--primary); background: #edf1ff; }
.severity { color: var(--muted); background: #f0f2f6; }
.result-details { display: grid; gap: 14px; margin: 0; }
.result-details div { display: grid; grid-template-columns: 110px 1fr; gap: 18px; }
.result-details dt { color: var(--muted); font-size: .82rem; font-weight: 800; }
.result-details dd { margin: 0; }
.context { color: #475167; background: #f7f8fb; border-radius: 8px; padding: 10px 12px; }
.empty-state { text-align: center; color: var(--muted); padding: 46px 20px; border: 1px dashed #c9d0dc; border-radius: 12px; background: rgba(255, 255, 255, .55); }
.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { padding: 15px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f8f9fc; color: var(--muted); font-size: .78rem; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
.status.active { color: #14705d; background: #e5f8f3; }
.status.inactive { color: #747d90; background: #eceff4; }
.actions { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.actions form { display: inline; }
.link-button { border: 0; background: transparent; padding: 0; color: var(--primary); font: inherit; cursor: pointer; }
.link-button.danger { color: var(--danger); }
.form-card { max-width: 820px; padding: clamp(22px, 4vw, 38px); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.checkbox { display: flex; align-items: center; gap: 9px; }
.checkbox input { width: 18px; height: 18px; }
.required { color: var(--danger); font-size: .73rem; }

@media (max-width: 760px) {
  .header-inner, .page-heading { align-items: flex-start; flex-direction: column; }
  .header-inner { padding-block: 14px; }
  nav { flex-wrap: wrap; gap: 8px 16px; }
  main.container { padding-top: 34px; }
  .check-layout, .rule-grid, .summary-grid, .form-grid { grid-template-columns: 1fr; }
  .feature-flow { grid-template-columns: 1fr; }
  .rules-actions { justify-content: stretch; }
  .rules-actions .button { width: 100%; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .result-details div { grid-template-columns: 1fr; gap: 4px; }
  .drop-zone { min-height: 230px; }
}
