:root {
  --ink: #1b2430; --muted: #627084; --line: #dfe4ea; --bg: #f4f6f9; --card: #fff;
  --brand: #8f1d2a; --brand-2: #b92733; --ok: #1a7f4b; --warn: #b46a00; --bad: #b3261e; --info: #2b5d9c;
  --ok-bg: #e4f4ea; --warn-bg: #fdf0d9; --bad-bg: #fbe5e3; --info-bg: #e5eefa; --mute-bg: #eceff3;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0 0 6px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

header.top { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); padding: 0 20px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
header.top .logo { font-weight: 700; padding: 10px 0; line-height: 1.2; display: flex; align-items: center; gap: 10px; color: var(--ink); }
header.top .logo:hover { text-decoration: none; }
header.top .logo img { width: 40px; height: 40px; }
header.top .logo small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
header.top nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
header.top nav a { color: var(--muted); padding: 18px 12px 15px; border-bottom: 3px solid transparent; }
header.top nav a:hover { text-decoration: none; color: var(--ink); }
header.top nav a.on { color: var(--brand-2); border-bottom-color: var(--brand-2); font-weight: 600; }
header.top .who { font-size: 13px; text-align: right; }
header.top .who a { color: var(--brand-2); margin-left: 10px; }
main { max-width: 1240px; margin: 0 auto; padding: 22px 20px 60px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.kpi .v { font-size: 26px; font-weight: 700; color: var(--brand); }
.kpi .v small { font-size: 15px; font-weight: 400; color: var(--muted); }
.kpi .l { font-size: 13px; color: var(--muted); }
.bar { height: 6px; background: var(--mute-bg); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--brand-2); }
.two { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 980px) { .two { grid-template-columns: 1fr; } }
.sticky { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }

table.t { width: 100%; border-collapse: collapse; }
table.t th, table.t td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.t th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: #fafbfc; }
table.t tr.grp td { background: #f0f3f7; font-weight: 600; }
.scroll { overflow-x: auto; }

.pill { display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: 12.5px; white-space: nowrap; background: var(--mute-bg); color: var(--muted); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }

button, .btn { font: inherit; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; display: inline-block; }
button:hover, .btn:hover { background: #f3f5f8; text-decoration: none; }
button.primary, .btn.primary { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
button.primary:hover, .btn.primary:hover { background: var(--brand); }
button.danger { color: var(--bad); }
button.link { border: none; background: none; padding: 0; color: var(--brand-2); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.sm { padding: 3px 9px; font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

input[type=text], input[type=password], input[type=url], select, textarea { font: inherit; width: 100%; padding: 7px 9px; border: 1px solid #c9d1db; border-radius: 6px; background: #fff; color: var(--ink); }
textarea { resize: vertical; min-height: 60px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #e9b3b8; outline-offset: 0; border-color: var(--brand-2); }
input:disabled, select:disabled, textarea:disabled { background: #f3f5f8; color: #48566a; }
label.f { display: block; margin-bottom: 10px; }
label.f > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 3px; }
label.f > em { display: block; font-size: 12.5px; color: var(--muted); font-style: normal; margin-bottom: 3px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cols3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .cols2, .cols3 { grid-template-columns: 1fr; } }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 14px 0 16px; flex-wrap: wrap; }
.tabs button { border: none; background: none; border-bottom: 3px solid transparent; border-radius: 0; padding: 9px 14px; color: var(--muted); }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand-2); font-weight: 600; }

.note { padding: 10px 14px; border-radius: 6px; background: var(--info-bg); color: #1d3f6e; margin-bottom: 14px; font-size: 14px; }
.note.warn { background: var(--warn-bg); color: #6b4100; }
.note.bad { background: var(--bad-bg); color: #7d1b15; }
.note.ok { background: var(--ok-bg); color: #10522f; }
.note ul { margin: 6px 0 0; padding-left: 20px; }

.plo { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.plo .head { display: grid; grid-template-columns: 90px minmax(0, 1fr) 190px 190px; gap: 10px; align-items: start; }
@media (max-width: 860px) { .plo .head { grid-template-columns: 1fr; } }
.plo .more { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.hint { font-size: 12.5px; margin-top: 4px; }
.hint.low { color: var(--warn); }
.hint.fit { color: var(--ok); }

.ref h3 { color: var(--brand); }
.ref .q { white-space: pre-line; font-size: 13.5px; margin-bottom: 10px; }
.pre { white-space: pre-line; }
.tl { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 6px 14px; align-items: start; }
.tl > div { padding: 7px 0; border-bottom: 1px solid var(--line); }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; }

.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 42%) 1fr; background: #fff; }
.auth-side { position: relative; overflow: hidden; color: #fff; padding: 32px 40px; display: flex; flex-direction: column;
  background: linear-gradient(135deg, #a3222f 0%, #7f1a27 55%, #4f0f1a 100%); }
.auth-side::before, .auth-side::after { content: ''; position: absolute; top: -20%; width: 90px; height: 140%; background: rgba(255, 255, 255, .06); transform: skewX(-18deg); }
.auth-side::before { left: 46%; }
.auth-side::after { left: 74%; width: 150px; background: rgba(255, 255, 255, .04); }
.auth-side > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; }
.auth-brand img { width: 40px; height: 40px; background: #fff; border-radius: 8px; padding: 3px; }
.auth-date { margin-top: 10px; font-size: 12px; letter-spacing: .6px; opacity: .75; }
.auth-pitch { margin-top: auto; padding: 40px 0 16px; max-width: 460px; }
.auth-pitch h2 { font-size: 30px; line-height: 1.25; font-weight: 700; letter-spacing: -.3px; margin: 0 0 14px; }
.auth-pitch p { opacity: .85; margin: 0 0 16px; }
.auth-pitch ul { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.auth-pitch li { padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, .18); opacity: .92; }
.auth-main { display: flex; flex-direction: column; align-items: center; padding: 32px 24px 20px; }
.auth-box { margin: auto 0; width: 100%; max-width: 384px; text-align: center; }
.auth-box > img { width: 64px; height: 64px; }
.auth-box h1 { font-size: 30px; font-weight: 700; letter-spacing: -.4px; margin: 14px 0 4px; color: #0f1729; }
.auth-box .sub { color: var(--muted); margin-bottom: 22px; }
.auth-box form { text-align: left; }
.auth-box input { height: 44px; border-radius: 8px; }
.auth-box button.primary { width: 100%; height: 44px; border-radius: 8px; font-weight: 500; margin-top: 6px; }
.auth-box .help { margin-top: 16px; color: var(--muted); font-size: 14px; }
.auth-box .note { margin-top: 12px; text-align: left; }
.auth-foot { font-size: 12px; color: var(--muted); text-align: center; padding-top: 24px; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-side { padding: 22px 20px 26px; }
  .auth-pitch { padding: 26px 0 0; }
  .auth-pitch h2 { font-size: 22px; }
  .auth-pitch ul { display: none; }
}
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #1b2430; color: #fff; padding: 9px 18px; border-radius: 6px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 20; max-width: 90vw; }
#toast.on { opacity: .96; }
#toast.err { background: var(--bad); }
.modal { position: fixed; inset: 0; background: rgba(20, 30, 45, .45); display: flex; align-items: center; justify-content: center; z-index: 10; padding: 16px; }
.modal > div { background: #fff; border-radius: 10px; padding: 20px 22px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; }
code.pw { font-size: 20px; background: var(--mute-bg); padding: 4px 12px; border-radius: 6px; user-select: all; }

.survey { max-width: 860px; margin: 0 auto; padding: 22px 16px 60px; }
.survey .q { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.opts { display: flex; gap: 6px 16px; flex-wrap: wrap; margin-top: 8px; }
.opts label { display: flex; gap: 5px; align-items: center; cursor: pointer; }
@media (max-width: 900px) {
  header.top { gap: 0 16px; }
  header.top .who { margin-left: auto; }
  header.top nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  header.top nav a { padding: 10px 12px 8px; white-space: nowrap; }
}
.rich p { margin: 0 0 6px; }
.rich p:last-child { margin-bottom: 0; }
.box { border: 1px solid #c9d1db; border-radius: 6px; background: #f3f5f8; padding: 8px 10px; font-size: 14px; margin-bottom: 10px; }
label.f .box { font-weight: 400; margin-bottom: 0; }
.guide { max-width: 980px; margin: 0 auto; }
.g-top { grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 760px) { .g-top { grid-template-columns: 1fr; } }
.g-flow { margin: 0; padding-left: 20px; }
.g-flow li { margin-bottom: 6px; }
.g-toc { list-style: none; margin: 0; padding: 0; }
.g-toc li { padding: 2px 0 2px 12px; }
.g-toc li.sec { font-weight: 600; padding: 8px 0 2px; }
.g-toc li.sec:first-child { padding-top: 0; }
.g-toc button.link { text-align: left; }
.g-sec { margin: 26px 0 12px; font-size: 19px; color: var(--brand); scroll-margin-top: 12px; }
.g-step { scroll-margin-top: 12px; }
.g-step h3 { font-size: 17px; display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.g-no { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-2); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.g-body ul { margin: 0 0 8px; padding-left: 22px; }
.g-body li { margin-bottom: 3px; }
.g-step figure { margin: 12px 0 0; }
.g-step figure img { display: block; max-width: 100%; height: auto; margin: 0 auto; border: 1px solid var(--line); border-radius: 6px; cursor: zoom-in; box-shadow: 0 1px 4px rgba(20, 30, 45, .08); }
.g-step figcaption { text-align: center; font-size: 13px; color: var(--muted); margin-top: 6px; font-style: italic; }
.g-faq { padding: 8px 0; border-bottom: 1px solid var(--line); }
.g-faq:last-child { border-bottom: none; }
.g-faq p { margin: 2px 0 0; }
.modal.zoom > div { max-width: min(1400px, 96vw); padding: 8px; cursor: zoom-out; }
.modal.zoom img { display: block; max-width: 100%; height: auto; }
