:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #1c2733;
  --muted: #6b7784;
  --line: #dfe4e9;
  --brand: #004AAD;
  --brand-ink: #ffffff;
  --gold: #FAB900;
  --accent: #1a7f5a;
  --warn: #b4531a;
  --err: #c0392b;
  --rec: #fff6d9;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
h1, h2, h4 { margin: 0 0 .5rem; }
h2 { font-size: 1.05rem; }
h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-top: 1rem; }
a { color: var(--brand); }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: .9rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* top bar */
.topbar {
  position: relative;
  display: flex; justify-content: center; align-items: center;
  background: #fff; color: var(--ink); padding: .5rem 1rem;
  border-bottom: 3px solid var(--gold);
}
.brand { display: flex; align-items: center; }
.brand .logo { height: 54px; width: auto; display: block; }
.brand span { display: none; }
.topbar .meta { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); display: flex; gap: 1rem; align-items: center; font-size: .8rem; }
.topbar .ver { color: var(--muted); }
.topbar .logout { color: var(--brand); text-decoration: none; font-weight: 600; }
@media (max-width: 560px) { .topbar .ver { display: none; } }

.wrap { max-width: 780px; margin: 0 auto; padding: 1rem 1rem 4rem; }
.note { color: var(--muted); font-size: .9rem; margin: .5rem 0 1rem; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 1.1rem 1.2rem; margin-bottom: 1rem;
}

label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .25rem; }
label.inline { display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; margin: 0 1rem .4rem 0; }
input, select, textarea {
  width: 100%; padding: .55rem .6rem; border: 1px solid var(--line);
  border-radius: 7px; font: inherit; background: #fff; color: var(--ink);
}
input[type=checkbox], input[type=radio] { width: auto; }
textarea { resize: vertical; }
.field { margin-bottom: .8rem; }
.field.checks { display: flex; flex-wrap: wrap; align-items: center; padding-top: 1.2rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.row { display: flex; align-items: center; gap: .8rem; margin-top: .6rem; }

button {
  border: 0; border-radius: 7px; padding: .55rem .9rem; font: inherit; font-weight: 600;
  cursor: pointer; background: #e7ebef; color: var(--ink);
}
button.primary { background: var(--brand); color: #fff; }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
button.small { padding: .3rem .55rem; font-size: .85rem; }
button:disabled { opacity: .6; cursor: default; }

.crow { display: grid; grid-template-columns: 1fr 90px 40px; gap: .5rem; margin-bottom: .5rem; }
.crow .ccount { text-align: right; }

.pill { background: #eef4f9; color: var(--brand); border-radius: 7px; padding: .5rem .7rem; font-size: .88rem; margin: .3rem 0 .8rem; }
.tag { background: var(--gold); color: #1c2733; border-radius: 5px; padding: 0 .35rem; font-size: .7rem; text-transform: uppercase; font-weight: 700; }
.extras { margin: .4rem 0 .8rem; }
.extras summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .9rem; }
.extras .grid2 { margin-top: .7rem; }

.assumptions { background: #fbf7ea; border: 1px solid #eadfb8; border-radius: 7px; padding: .5rem .8rem; margin-top: .7rem; font-size: .88rem; }
.assumptions ul { margin: .3rem 0 0; padding-left: 1.1rem; }

.err { color: var(--err); font-weight: 600; }
.warn { color: var(--warn); }

/* result */
.headline { font-size: 1.05rem; font-weight: 700; margin: 0 0 .6rem; }
table.lines, table.slider { width: 100%; border-collapse: collapse; margin: .3rem 0 .5rem; }
table.lines td { padding: .3rem .2rem; border-bottom: 1px solid var(--line); }
table.lines tr.sum td { font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 0; }
table.slider th, table.slider td { padding: .35rem .4rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
table.slider th { text-align: right; color: var(--muted); font-size: .78rem; text-transform: uppercase; }
table.slider th:first-child, table.slider td:first-child { text-align: left; }
table.slider tr.rec { background: var(--rec); font-weight: 700; }

.pricebox {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: .6rem; background: #f0f5f9; border-radius: 9px; padding: .9rem; margin: .8rem 0;
}
.pricebox div { display: flex; flex-direction: column; }
.pricebox span { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.pricebox strong { font-size: 1.15rem; }

.warnbox { background: #fbf1e9; border: 1px solid #e9cdb6; border-radius: 7px; padding: .5rem .8rem; margin-top: .8rem; font-size: .9rem; }
.warnbox ul { margin: .3rem 0 0; padding-left: 1.1rem; }

/* login */
.login-body { display: flex; min-height: 100vh; align-items: center; justify-content: center; background: var(--bg); }
.login-wrap { display: flex; flex-direction: column; align-items: center; gap: 1.3rem; width: 340px; max-width: 92vw; }
.login-logo { width: 300px; max-width: 100%; height: auto; display: block; }
.login-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 1.8rem 2rem; width: 100%; text-align: center;
  box-shadow: 0 10px 34px rgba(0, 74, 173, .10);
}
.login-card h1 { color: var(--brand); font-size: 1.3rem; margin-top: 0; }
.login-card .sub { color: var(--muted); margin: 0 0 1.2rem; }
.login-card label { text-align: left; font-weight: 600; }
.login-card button { width: 100%; background: var(--brand); color: #fff; margin-top: 1rem; padding: .65rem; }
.login-card .err { margin: 0 0 .8rem; }
