:root {
  --navy: #14205a;
  --navy-2: #1d3278;
  --red: #e8313a;
  --red-dark: #b81f28;
  --ink: #17203a;
  --muted: #5c6784;
  --line: #d9deea;
  --bg: #eef1f7;
  --card: #ffffff;
  --ok: #0c7a43;
  --warn: #8a4b08;
  --shadow: 0 8px 24px rgba(20, 32, 90, 0.08);
  --nav: 72px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Avenir Next", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.4;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--navy); }
img { max-width: 100%; }

.app { min-height: 100vh; }
.topbar {
  height: 10px;
  background: linear-gradient(var(--navy) 0 6px, var(--red) 6px 10px);
}
.header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.header { display: block; padding: 8px 12px 10px; }
.header img.brand-logo { width: 100%; height: auto; max-height: 132px; object-fit: contain; background: white; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick .btn { margin-top: 0; min-height: 48px; font-size: 15px; }
.auth img { width: min(100%, 420px); height: auto; display: block; margin: 0 auto; }
.header .name { font-weight: 800; color: var(--navy); line-height: 1.1; }
.header .name small { display: block; color: var(--red); font-weight: 800; letter-spacing: .02em; }
.practice {
  background: var(--red);
  color: white;
  padding: 10px 14px;
  font-weight: 800;
}
.practice span { display: block; font-weight: 600; font-size: 14px; }
main { padding: 14px 14px calc(var(--nav) + 24px); max-width: 860px; }
h1 { font-size: 28px; margin: 4px 0 8px; color: var(--navy); line-height: 1.1; }
h2 { font-size: 18px; margin: 18px 0 8px; color: var(--navy); }
.sub { color: var(--muted); margin: 0 0 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat {
  background: var(--navy);
  color: white;
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
  text-decoration: none;
}
.stat b { display: block; font-size: 28px; line-height: 1; }
.stat span { font-size: 13px; font-weight: 700; }
.card {
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  margin: 10px 0;
}
.card h3 { margin: 0 0 4px; font-size: 20px; }
.card p { margin: 4px 0; }
.meta { color: var(--muted); font-size: 15px; }
.chip {
  display: inline-block;
  background: #e7ebf6;
  color: var(--navy);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 13px;
  font-weight: 800;
}
.chip.late { background: #fde8ea; color: var(--red-dark); }
.chip.example { background: #fde8ea; color: var(--red-dark); }
.banner {
  background: #fff4f4;
  border: 2px solid var(--red);
  color: #8d1420;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
}
.error {
  background: #fde8ea;
  color: #8d1420;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
}
.oknote { color: var(--ok); font-weight: 700; }
label { display: block; font-weight: 700; margin: 10px 0 4px; color: var(--navy); }
input, select, textarea {
  width: 100%;
  min-height: 48px;
  border: 2px solid #c5cce0;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}
textarea { min-height: 90px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 0;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  margin-top: 8px;
}
.btn.red { background: var(--red); color: white; }
.btn.navy { background: var(--navy); color: white; }
.btn.ghost { background: white; color: var(--navy); border: 2px solid var(--navy); }
.btn.ok { background: var(--ok); color: white; }
.btn.giant { min-height: 84px; font-size: 24px; letter-spacing: .02em; }
.btn.half { width: calc(50% - 4px); }
.split { display: flex; gap: 8px; }
.split .btn { margin-top: 8px; }
.nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--nav) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--navy);
  display: flex;
  z-index: 6;
}
.nav a {
  flex: 1;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
}
.nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -4px 0 var(--red); }
.auth {
  max-width: 460px;
  margin: 0 auto;
  padding: 18px 16px 32px;
}
.auth img { width: 100%; height: auto; }
.auth .slogan { color: var(--red); font-weight: 900; letter-spacing: .04em; margin: 8px 0; }
.lines { width: 100%; border-collapse: collapse; }
.lines td { border-top: 1px solid var(--line); padding: 8px 0; vertical-align: top; }
.lines .num { text-align: right; font-weight: 800; white-space: nowrap; }
.stepper { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.stepper span {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  background: #e7ebf6;
  border-radius: 999px;
  padding: 4px 8px;
}
.stepper span.on { background: var(--navy); color: white; }
.stepper span.done { background: #d9f3e4; color: var(--ok); }
.drive-name { font-size: 34px; line-height: 1.05; margin: 6px 0; color: var(--navy); }
.hidden { display: none; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 700; margin: 8px 0; }
.check input { width: 22px; height: 22px; min-height: 22px; margin-top: 2px; }

@media (min-width: 900px) {
  .nav {
    top: 0; bottom: 0; right: auto; width: 220px; height: auto;
    flex-direction: column; padding: 18px 10px;
  }
  .nav a { flex: 0; min-height: 52px; border-radius: 12px; justify-content: flex-start; padding: 0 14px; }
  .nav a[aria-current="page"] { background: var(--red); box-shadow: none; }
  .app { margin-left: 220px; }
  main { padding-bottom: 32px; }
}
