:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --ink: #17231f;
  --muted: #68756f;
  --line: #dce3df;
  --brand: #285a4a;
  --brand-dark: #1e463a;
  --brand-soft: #e5f0eb;
  --accent: #efb655;
  --danger: #a33b32;
  --warning-soft: #fff3d8;
  --radius: 18px;
  --shadow: 0 8px 24px rgba(26, 48, 40, 0.07);
  font-family: Inter, "Noto Sans JP", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.offline-banner {
  position: sticky; top: 0; z-index: 100;
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 16px; color: #402d08; background: #ffd982;
  text-align: center; font-size: .85rem;
}
.offline-banner[hidden] { display: none; }

.app-header {
  position: sticky; top: 0; z-index: 40;
  height: 58px; padding: 0 18px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(244, 246, 243, .94); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(220, 227, 223, .8);
}
.brand { font-weight: 800; letter-spacing: .04em; }
.user-name { color: var(--muted); font-size: .9rem; }
.header-user { display: flex; align-items: center; gap: 8px; }
.logout-button { min-height: 36px; padding: 5px 9px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 9px; font-size: .72rem; }
.page-shell { max-width: 720px; margin: 0 auto; padding: 20px 16px 40px; }
.page-shell.with-nav { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }

.bottom-nav {
  position: fixed; left: 50%; bottom: 0; z-index: 50; transform: translateX(-50%);
  width: min(100%, 720px); min-height: 70px;
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px;
  background: rgba(255,255,255,.96); border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(20, 40, 32, .06); backdrop-filter: blur(16px);
}
.nav-record-form { display: contents; }
.nav-item {
  min-height: 52px; border: 0; background: none; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 13px;
}
.nav-item > span { font-size: 1.35rem; line-height: 1; }
.nav-item small { font-size: .68rem; }
.nav-primary { color: white; background: var(--brand); transform: translateY(-10px); box-shadow: 0 7px 16px rgba(40,90,74,.25); }
.nav-disabled { opacity: .4; }

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 1.5rem; line-height: 1.3; }
h2 { font-size: 1.15rem; line-height: 1.4; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.eyebrow { margin-bottom: 3px; color: var(--brand); font-size: .68rem; font-weight: 800; letter-spacing: .16em; }
.flash, .form-error { margin-bottom: 14px; padding: 13px 15px; border-radius: 13px; }
.flash-success { background: var(--brand-soft); color: var(--brand-dark); }
.form-error { background: #fbe9e7; color: var(--danger); border: 1px solid #f2c8c3; }

.login-page { display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(160deg, #e7efe9, #f7f5ec); }
.login-page .page-shell { width: 100%; }
.login-card { width: min(100%, 420px); margin: 7vh auto; padding: 30px 24px; background: var(--surface); border-radius: 26px; box-shadow: var(--shadow); }
.login-card h1 { margin-bottom: 4px; text-align: center; }
.login-card > .muted { margin-bottom: 28px; text-align: center; }
.login-mark { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 18px; color: white; background: var(--brand); font-size: 1.5rem; font-weight: 800; }
.stack-form { display: grid; gap: 18px; }
.stack-form label > span:first-child { display: block; margin-bottom: 7px; font-weight: 700; }
.stack-form input:not([type="checkbox"]), .input-control, textarea {
  width: 100%; min-height: 48px; padding: 11px 13px;
  color: var(--ink); background: #fbfcfb; border: 1px solid #cad5d0; border-radius: 12px;
}
textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
input:focus, textarea:focus { outline: 3px solid rgba(40,90,74,.16); border-color: var(--brand); }
.check-row { min-height: 44px; display: flex; align-items: center; gap: 10px; color: var(--muted); }
.check-row input { width: 21px; height: 21px; accent-color: var(--brand); }

.button { min-height: 48px; padding: 12px 18px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 14px; font-weight: 800; }
.button-primary { color: white; background: var(--brand); }
.button-primary:hover { background: var(--brand-dark); }
.button-secondary { color: var(--brand); background: var(--surface); border-color: var(--brand); }
.button-block { width: 100%; }

.home-hero { padding: 10px 0 18px; text-align: center; }
.date-label { color: var(--muted); font-weight: 700; }
.record-now { min-height: 64px; width: min(100%, 360px); border: 0; border-radius: 20px; color: white; background: var(--brand); font-size: 1.2rem; font-weight: 800; box-shadow: 0 10px 24px rgba(40,90,74,.22); }
.record-now span { margin-right: 8px; font-size: 1.6rem; vertical-align: -2px; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 26px; }
.summary-card { min-height: 92px; padding: 17px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.summary-card strong { color: var(--brand); font-size: 1.7rem; }
.summary-card span { color: var(--muted); font-size: .83rem; }
.warning-card { background: var(--warning-soft); }
.warning-card strong { color: #8a5d0a; }
.section-block { margin-top: 22px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; }
.section-heading a { color: var(--brand); font-size: .9rem; font-weight: 700; }

.record-list { display: grid; gap: 10px; }
.record-row { min-height: 72px; padding: 12px 15px; display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 10px; background: var(--surface); border-radius: 15px; box-shadow: var(--shadow); }
.record-row time { color: var(--brand); font-weight: 800; }
.record-row-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.record-row-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-row-main > span { color: var(--muted); font-size: .78rem; }
.status-pill { display: inline-block; padding: 3px 8px; color: #79530d; background: var(--warning-soft); border-radius: 999px; font-size: .72rem; font-style: normal; font-weight: 700; }
.empty-state { padding: 30px 18px; color: var(--muted); text-align: center; background: rgba(255,255,255,.65); border: 1px dashed #cdd7d2; border-radius: var(--radius); }
.empty-state > span { display: grid; place-items: center; width: 50px; height: 50px; margin: 0 auto 12px; color: var(--brand); background: var(--brand-soft); border-radius: 50%; font-size: 1.5rem; }
.empty-state.large { margin-top: 50px; padding: 46px 20px; }

.page-title-row { display: flex; justify-content: space-between; align-items: end; }
.page-title-row h1 { margin-bottom: 12px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; margin-bottom: 16px; background: #e2e8e4; border-radius: 13px; }
.segmented a { min-height: 42px; display: grid; place-items: center; border-radius: 10px; color: var(--muted); font-size: .86rem; font-weight: 700; }
.segmented a.active { color: var(--ink); background: white; box-shadow: 0 2px 8px rgba(20,40,32,.08); }
.record-card { padding: 17px; background: var(--surface); border: 1px solid #edf0ee; border-radius: var(--radius); box-shadow: var(--shadow); }
.record-card-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .82rem; }
.record-card h2 { margin: 10px 0 8px; }
.record-card p { margin: 0; display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: .82rem; }

.form-topbar { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px; margin-bottom: 14px; }
.form-topbar h1 { margin: 0; }
.back-link { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); font-size: 2rem; }
.save-status { color: var(--muted); font-size: .75rem; }
.save-status.saved { color: var(--brand); }
.save-status.error { color: var(--danger); }
.form-card, .question-section, .plain-card { margin-bottom: 15px; padding: 18px; background: var(--surface); border: 1px solid #edf0ee; border-radius: var(--radius); box-shadow: var(--shadow); }
.field-group { margin: 0 0 20px; padding: 0; border: 0; }
.field-group:last-child { margin-bottom: 0; }
.field-label, fieldset legend { display: block; margin-bottom: 10px; font-weight: 800; }
.required-mark { margin-left: 5px; color: var(--muted); font-size: .67rem; font-weight: 500; }
.question-section { position: relative; padding-top: 20px; }
.question-number { position: absolute; top: 18px; left: 17px; display: grid; place-items: center; width: 29px; height: 29px; color: white; background: var(--brand); border-radius: 9px; font-weight: 800; }
.question-title { padding-left: 42px; margin-bottom: 17px; }
.question-title h2 { margin-bottom: 2px; font-size: 1.25rem; }
.question-title p { margin-bottom: 0; color: var(--muted); font-size: .8rem; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice-card { position: relative; min-width: 0; }
.choice-card input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice-card span { min-height: 48px; padding: 9px 10px; display: flex; align-items: center; justify-content: center; color: #3d4a45; background: #f5f7f5; border: 1px solid #d7dfda; border-radius: 12px; text-align: center; font-size: .88rem; line-height: 1.35; }
.choice-card input:focus-visible + span { outline: 3px solid rgba(40,90,74,.2); }
.choice-card input:checked + span { color: white; background: var(--brand); border-color: var(--brand); box-shadow: 0 4px 10px rgba(40,90,74,.18); }
.choice-card.favorite span::before { content: ""; }
.more-options, .text-details { margin-top: 13px; border-top: 1px solid var(--line); }
.more-options summary, .text-details summary { min-height: 48px; display: flex; align-items: center; justify-content: space-between; color: var(--brand); font-weight: 700; list-style: none; cursor: pointer; }
.more-options summary::after, .text-details summary::after { content: "+"; font-size: 1.2rem; }
.more-options[open] summary::after, .text-details[open] summary::after { content: "−"; }
.more-options .choice-grid { padding: 4px 0 10px; }
.sub-options { margin-top: 13px; padding: 14px; background: #eef4f1; border-radius: 14px; }
.sub-options[hidden], .conditional-other[hidden] { display: none; }
.sub-options h3 { margin-bottom: 10px; }
.nested-fieldset { margin: 16px 0 0; padding: 14px 0 0; border: 0; border-top: 1px solid var(--line); }
.nested-fieldset legend { padding-top: 14px; }
.conditional-other { margin-top: 10px; }
.conditional-other > span { display: block; margin: 8px 0 6px; font-size: .85rem; font-weight: 700; }
.switch-row { margin-top: 12px; color: var(--ink); font-weight: 700; }
.save-actions { position: sticky; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 20; display: grid; grid-template-columns: 1fr 1.35fr; gap: 9px; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 24%); }

.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.detail-header h1 { margin-bottom: 10px; }
.detail-meta { margin-bottom: 20px; padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; color: var(--muted); background: #e9eeeb; border-radius: 14px; font-size: .82rem; }
.abc-card { position: relative; padding: 20px 18px 18px 62px; }
.abc-letter { position: absolute; top: 18px; left: 17px; width: 34px; height: 34px; display: grid; place-items: center; color: white; border-radius: 10px; font-weight: 900; }
.abc-a .abc-letter { background: #47729a; }
.abc-b .abc-letter { background: #a46143; }
.abc-c .abc-letter { background: var(--brand); }
.abc-card h2 { margin-bottom: 12px; }
.abc-card h3 { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.abc-card ul { margin: 0 0 10px; padding-left: 20px; }
.abc-card li { margin: 7px 0; line-height: 1.5; }
.note-box { margin-top: 14px; padding: 12px 14px; background: #f3f5f4; border-radius: 11px; }
.note-box strong { color: var(--muted); font-size: .76rem; }
.note-box p { margin: 5px 0 0; white-space: pre-wrap; line-height: 1.6; }
.responders { color: var(--muted); font-size: .85rem; }
.plain-card p { margin-bottom: 0; white-space: pre-wrap; line-height: 1.65; }

@media (min-width: 600px) {
  .choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .choice-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .page-shell { padding-left: 24px; padding-right: 24px; }
}

/* Phase 4: secure export workflow. */
.export-form { display: grid; gap: 13px; }
.export-card, .export-confirm-card, .free-text-preview { padding: 16px; background: var(--surface); border: 1px solid #edf0ee; border-radius: var(--radius); box-shadow: var(--shadow); }
.export-card h2, .free-text-preview h2 { margin-bottom: 13px; }
.export-card > label, .export-card .advanced-search-body > label { display: block; margin-top: 12px; }
.export-card label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.export-format-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.export-format-grid label { position: relative; }
.export-format-grid input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.export-format-grid span { min-height: 52px; display: grid !important; place-items: center; margin: 0 !important; color: var(--brand-dark) !important; background: #f5f7f5; border: 1px solid #d7dfda; border-radius: 12px; font-size: .9rem !important; }
.export-format-grid input:checked + span { color: white !important; background: var(--brand); border-color: var(--brand); }
.export-format-grid input:focus-visible + span { outline: 3px solid rgba(40,90,74,.2); }
.export-note { margin: 0; padding: 13px 14px; color: #53635c; background: #e9efec; border-radius: 13px; font-size: .78rem; line-height: 1.6; }
.export-confirm-card dl { margin: 0; display: grid; grid-template-columns: 42% 58%; }
.export-confirm-card dt, .export-confirm-card dd { min-height: 45px; margin: 0; padding: 11px 4px; border-bottom: 1px solid #edf1ef; }
.export-confirm-card dt { color: var(--muted); font-size: .8rem; }
.export-confirm-card dd { font-weight: 700; }
.privacy-warning { margin: 13px 0; padding: 15px; color: #6d4908; background: var(--warning-soft); border: 1px solid #ead8b4; border-radius: var(--radius); }
.privacy-warning p { margin: 6px 0 0; font-size: .8rem; line-height: 1.6; }
.free-text-preview { margin: 13px 0; }
.free-text-preview article { padding: 13px 0; border-top: 1px solid var(--line); }
.free-text-preview article:first-of-type { border-top: 0; }
.free-text-preview article > a { min-height: 44px; display: flex; align-items: center; color: var(--brand); font-weight: 800; }
.free-text-preview p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .82rem; line-height: 1.55; }
.export-inclusion-card { margin: 14px 0; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.export-inclusion-card > div { display: grid; gap: 3px; }
.export-inclusion-card > div span { color: var(--muted); font-size: .76rem; }
.export-inclusion-card .button { min-height: 44px; padding: 8px 11px; font-size: .78rem; }

@media (min-width: 600px) {
  .export-format-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Phase 2: faster entry points, sync states and quick recording. */
.save-status.pending { color: #93620b; }
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 14px; }
.entry-grid form { min-width: 0; }
.entry-button { width: 100%; min-height: 94px; padding: 13px 9px; display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; align-items: center; text-align: left; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow); }
.entry-button > span { grid-row: 1 / 3; font-size: 1.35rem; }
.entry-button strong { font-size: .95rem; }
.entry-button small { color: var(--muted); font-size: .68rem; }
.quick-entry { color: var(--brand-dark); }
.success-entry { background: #fff8e8; border-color: #f0dbab; }
.draft-section { padding: 15px; background: var(--warning-soft); border-radius: var(--radius); }
.draft-section .section-heading h2 { margin-bottom: 12px; color: #704c0b; }
.draft-row { box-shadow: none; border: 1px solid #ead8b4; }
.question-icon { position: absolute; top: 18px; left: 17px; display: grid; place-items: center; width: 31px; height: 31px; background: #fff1c9; border-radius: 9px; }
.success-question { background: #fffaf0; border-color: #efdcae; }
.saved-panel { margin-bottom: 15px; padding: 17px; color: var(--brand-dark); background: var(--brand-soft); border: 1px solid #c8ded4; border-radius: var(--radius); }
.saved-panel > strong { display: block; margin-bottom: 12px; font-size: 1.05rem; }
.saved-panel > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.saved-panel .button { min-height: 44px; padding: 9px; font-size: .82rem; }
.quick-lead { margin-bottom: 16px; color: var(--muted); }
.quick-card { padding: 18px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.quick-choice-grid { display: grid; gap: 10px; }
.quick-choice { position: relative; }
.quick-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.quick-choice span { min-height: 58px; padding: 12px 16px; display: flex; align-items: center; gap: 8px; color: #34443d; background: #f5f7f5; border: 1px solid #d6dfda; border-radius: 14px; font-weight: 700; }
.quick-choice input:checked + span { color: white; background: var(--brand); border-color: var(--brand); box-shadow: 0 5px 12px rgba(40,90,74,.18); }
.quick-choice input:focus-visible + span { outline: 3px solid rgba(40,90,74,.2); }
.quick-actions { display: grid; gap: 9px; margin-top: 14px; }
.placeholder-page p { max-width: 360px; margin: 0 auto 20px; line-height: 1.65; }

/* Phase 3: mobile search, statistics and neutral relationship views. */
select.input-control { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--brand) 50%), linear-gradient(135deg, var(--brand) 50%, transparent 50%); background-position: calc(100% - 17px) 20px, calc(100% - 12px) 20px; background-size: 5px 5px; background-repeat: no-repeat; }
.search-panel, .period-panel { margin-bottom: 18px; padding: 16px; background: var(--surface); border: 1px solid #edf0ee; border-radius: var(--radius); box-shadow: var(--shadow); }
.search-primary, .advanced-search-body { display: grid; gap: 13px; }
.search-panel label > span, .period-panel label > span, .advanced-search-body label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.custom-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
.custom-dates .input-control { min-width: 0; padding: 8px; font-size: .82rem; }
.advanced-search { margin-top: 14px; border-top: 1px solid var(--line); }
.advanced-search > summary { min-height: 52px; display: flex; align-items: center; justify-content: space-between; color: var(--brand); font-weight: 800; list-style: none; cursor: pointer; }
.advanced-search > summary::after { content: "+"; font-size: 1.2rem; }
.advanced-search[open] > summary::after { content: "−"; }
.advanced-search-body { padding: 4px 0 8px; }
.filter-fieldset { margin: 4px 0; padding: 13px 0 0; border: 0; border-top: 1px solid var(--line); }
.filter-fieldset legend { padding-top: 13px; }
.filter-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.filter-choice { position: relative; min-width: 0; }
.filter-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.filter-choice span { min-height: 44px; padding: 8px; display: grid; place-items: center; color: #435049; background: #f5f7f5; border: 1px solid #d7dfda; border-radius: 11px; text-align: center; font-size: .78rem; line-height: 1.3; }
.filter-choice input:checked + span { color: white; background: var(--brand); border-color: var(--brand); }
.filter-choice input:focus-visible + span { outline: 3px solid rgba(40,90,74,.2); }
.search-actions { display: grid; grid-template-columns: .85fr 1.25fr; gap: 8px; margin-top: 14px; }
.search-actions .button { padding-left: 8px; padding-right: 8px; font-size: .85rem; }
.result-heading { margin: 18px 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.result-heading > div { display: grid; gap: 2px; }
.result-heading > div span { color: var(--muted); font-size: .75rem; }
.filter-count { padding: 5px 9px; color: var(--brand-dark); background: var(--brand-soft); border-radius: 999px; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.success-pill { display: inline-block; margin-right: 4px; padding: 3px 8px; color: #70500d; background: #fff0be; border-radius: 999px; font-size: .72rem; }
.period-panel { display: grid; gap: 12px; }
.period-panel .custom-dates { margin-top: 0; }
.period-label { margin: 0 0 11px; color: var(--muted); text-align: center; font-size: .84rem; font-weight: 700; }
.overview-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-bottom: 12px; }
.overview-grid > div { min-height: 86px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--surface); border-radius: 15px; box-shadow: var(--shadow); }
.overview-grid strong { color: var(--brand); font-size: 1.55rem; }
.overview-grid span { margin-top: 3px; color: var(--muted); text-align: center; font-size: .72rem; }
.overview-grid .warning { background: var(--warning-soft); }
.overview-grid .warning strong { color: #855808; }
.overview-grid .success { background: #fff8e8; }
.neutral-note { margin: 10px 0; padding: 12px 14px; color: #54635c; background: #e9efec; border-radius: 13px; font-size: .75rem; line-height: 1.55; }
.stats-section { margin-top: 18px; padding: 16px; background: var(--surface); border: 1px solid #edf0ee; border-radius: var(--radius); box-shadow: var(--shadow); }
.stats-section h2 { margin-bottom: 11px; }
.section-note { margin: -5px 0 11px; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.stats-list { display: grid; }
.stats-row { border-top: 1px solid #edf1ef; }
.stats-row:first-child { border-top: 0; }
.stats-row > a:first-child { min-height: 49px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stats-row > a:first-child span { min-width: 0; line-height: 1.35; }
.stats-row strong { color: var(--brand); white-space: nowrap; }
.analysis-link { min-height: 38px; margin: -3px 0 5px; display: flex; align-items: center; justify-content: flex-end; color: var(--brand); font-size: .74rem; font-weight: 800; }
.analysis-link::after { content: " ›"; margin-left: 4px; }
.empty-compact { margin: 0; padding: 12px 0; text-align: center; }
.bar-list { display: grid; gap: 4px; }
.bar-list > a, .bar-list > div { min-height: 45px; display: grid; grid-template-columns: minmax(94px, 1.2fr) 1fr auto; align-items: center; gap: 8px; font-size: .78rem; }
.bar-list i { height: 9px; overflow: hidden; background: #e8eeeb; border-radius: 999px; }
.bar-list i b { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.bar-list strong { min-width: 35px; color: var(--brand); text-align: right; }
.bar-w-0 { width: 0; } .bar-w-10 { width: 10%; } .bar-w-20 { width: 20%; } .bar-w-30 { width: 30%; } .bar-w-40 { width: 40%; } .bar-w-50 { width: 50%; } .bar-w-60 { width: 60%; } .bar-w-70 { width: 70%; } .bar-w-80 { width: 80%; } .bar-w-90 { width: 90%; } .bar-w-100 { width: 100%; }
.comparison-table { display: grid; }
.comparison-table > div { min-height: 43px; display: grid; grid-template-columns: 1fr 58px 58px; align-items: center; border-top: 1px solid #edf1ef; font-size: .8rem; }
.comparison-table > div strong { color: var(--brand); text-align: center; }
.comparison-table .comparison-head { min-height: 34px; color: var(--muted); border-top: 0; font-size: .7rem; }
.analysis-hero { margin-bottom: 12px; padding: 18px; color: white; background: var(--brand); border-radius: var(--radius); box-shadow: var(--shadow); }
.analysis-hero p { margin-bottom: 5px; color: #dcebe5; font-size: .75rem; }
.analysis-hero h2 { margin-bottom: 13px; }
.analysis-hero a { min-height: 44px; padding: 9px 12px; display: flex; align-items: center; justify-content: center; color: var(--brand-dark); background: white; border-radius: 12px; font-weight: 800; }

@media (min-width: 600px) {
  .search-primary { grid-template-columns: repeat(3, 1fr); }
  .advanced-search-body { grid-template-columns: repeat(2, 1fr); }
  .filter-fieldset { grid-column: 1 / -1; }
  .filter-choice-grid { grid-template-columns: repeat(3, 1fr); }
  .overview-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Phase 5: safe administration, backup and recovery. */
.button-danger { color: #842f2f; background: #fff3f1; border: 1px solid #e7bdb7; }
.danger-zone { margin-top: 12px; }
.admin-menu { display: grid; gap: 9px; margin-bottom: 16px; }
.admin-menu a { min-height: 65px; padding: 13px 15px; display: flex; flex-direction: column; justify-content: center; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.admin-menu a span { margin-top: 3px; color: var(--muted); font-size: .75rem; }
.admin-card { margin-bottom: 14px; padding: 16px; background: var(--surface); border: 1px solid #edf0ee; border-radius: var(--radius); box-shadow: var(--shadow); }
.admin-card h2 { margin-bottom: 13px; }
.status-list { margin: 0; }
.status-list > div { min-height: 44px; display: grid; grid-template-columns: 38% 62%; align-items: center; border-top: 1px solid var(--line); }
.status-list > div:first-child { border-top: 0; }
.status-list dt { color: var(--muted); font-size: .76rem; }
.status-list dd { margin: 0; font-size: .8rem; font-weight: 700; }
.break-text { overflow-wrap: anywhere; }
.admin-list { display: grid; gap: 9px; }
.admin-list article { position: relative; min-height: 72px; padding: 12px 82px 12px 12px; display: grid; gap: 4px; background: #f6f8f7; border-radius: 12px; }
.admin-list article > span { color: var(--muted); font-size: .74rem; line-height: 1.4; }
.admin-list article > em, .admin-list article > form { position: absolute; top: 13px; right: 11px; }
.admin-list article form .button { min-height: 44px; padding: 8px 13px; }
.deleted-list article { padding-right: 90px; }
.create-user-card summary, .account-actions summary { min-height: 44px; display: flex; align-items: center; color: var(--brand); font-weight: 800; cursor: pointer; }
.admin-form { display: grid; gap: 11px; padding-top: 12px; }
.admin-form label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: .75rem; font-weight: 800; }
.user-list { display: grid; gap: 12px; }
.user-card header { display: flex; align-items: flex-start; justify-content: space-between; }
.user-card header > div { display: grid; gap: 3px; }
.user-card header span { color: var(--muted); font-size: .75rem; }
.account-actions { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 7px; margin: 8px 0 12px; }
.inline-form .button, .account-actions > form .button { min-height: 44px; padding: 8px 10px; }

@media (min-width: 600px) {
  .admin-menu { grid-template-columns: repeat(3, 1fr); }
  .admin-form.compact { grid-template-columns: 1fr 1fr; }
}
