:root {
  --ink: #111318;
  --muted: #747b87;
  --line: #d8dce3;
  --line-strong: #bcc2cc;
  --paper: #ffffff;
  --canvas: #f3f4f6;
  --signal: #265cff;
  --signal-soft: #eaf0ff;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --success: #087a55;
  --radius: 18px;
  --shadow: 0 24px 70px rgb(22 28 45 / 8%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  line-height: 1.45;
}

* { box-sizing: border-box; }

html { background: var(--canvas); scroll-behavior: smooth; }

body { margin: 0; min-width: 320px; background: var(--canvas); }

button, input, select, textarea { font: inherit; }

button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }

a { color: inherit; }

[hidden] { display: none !important; }

:focus-visible { outline: 3px solid rgb(38 92 255 / 35%); outline-offset: 2px; }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgb(216 220 227 / 80%);
  background: rgb(255 255 255 / 90%);
  backdrop-filter: blur(18px);
}

.form-site-header { position: relative; }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1220px, calc(100% - 32px));
  min-height: 64px;
  margin: 0 auto;
}

.brand-wordmark {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo { display: block; width: 154px; height: auto; }

.header-actions { display: flex; align-items: center; gap: 18px; }
.header-actions form { margin: 0; }

.text-link, .text-button {
  min-height: 44px;
  padding: 10px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 650;
  text-decoration: none;
}

.text-link:hover, .text-button:hover { color: var(--signal); }
.text-button.danger { color: var(--danger); font-weight: 600; }

.page-shell { width: min(1220px, calc(100% - 32px)); margin: 0 auto; padding: 58px 0 96px; }

.hero { display: flex; align-items: end; justify-content: space-between; gap: 32px; padding: 0 8px 38px; }
.eyebrow { margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.release-note-link { text-decoration-color: currentcolor; text-underline-offset: 3px; }
.release-note-link:hover { color: var(--signal); }
h1, h2, p { overflow-wrap: anywhere; }
h1 { max-width: 800px; margin: 0; font-size: clamp(38px, 6vw, 74px); line-height: .98; letter-spacing: -.055em; }
.lead { max-width: 680px; margin: 18px 0 0; color: #555c67; font-size: clamp(16px, 2vw, 20px); }
.hero-meta { display: grid; flex: 0 0 auto; gap: 6px; padding-bottom: 5px; color: var(--muted); font-size: 13px; text-align: right; }

.form-stepper { position: sticky; z-index: 20; top: 0; margin: 0 8px 22px; padding: calc(11px + env(safe-area-inset-top)) 16px 12px; border: 1px solid var(--line); border-radius: 13px; background: rgb(255 255 255 / 96%); box-shadow: 0 8px 30px rgb(22 28 45 / 7%); backdrop-filter: blur(14px); }
.stepper-copy { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 8px; }
.stepper-copy > div { display: grid; gap: 1px; }
.stepper-copy span { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.stepper-copy strong { font-size: 15px; letter-spacing: -.015em; }
.stepper-copy .draft-status { flex: 0 1 auto; max-width: 360px; text-align: right; }
progress { display: block; width: 100%; height: 4px; border: 0; border-radius: 999px; overflow: hidden; background: #e9ebef; }
progress::-webkit-progress-bar { background: #e9ebef; }
progress::-webkit-progress-value { border-radius: 999px; background: var(--signal); transition: width .25s ease; }
progress::-moz-progress-bar { background: var(--signal); }

.alert { margin: 0 8px 20px; padding: 14px 16px; border-radius: 12px; }
.alert-error { border: 1px solid #ffc9c5; background: var(--danger-soft); color: #7a2018; }

#posForm { display: grid; gap: 12px; }

.form-section {
  display: grid;
  grid-template-columns: 205px minmax(0, 1fr);
  overflow: clip;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  scroll-margin-top: 88px;
}

.form-section.conditional { border-style: dashed; }

.section-index { padding: 28px 22px; border-right: 1px solid var(--line); }
.section-index.compact { padding-top: 25px; }
.section-index.compact > span { display: block; margin-bottom: 16px; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.section-number { display: block; margin-bottom: 14px; font-size: 56px; font-weight: 330; line-height: 1; letter-spacing: -.055em; }
.section-index h2 { margin: 0; font-size: 18px; line-height: 1.15; letter-spacing: -.025em; text-transform: uppercase; }
.section-index p { margin: 10px 0 0; color: var(--muted); font-size: 12px; font-weight: 650; text-transform: uppercase; }

.section-content { min-width: 0; margin: 0; padding: 29px 30px 32px; border: 0; }
.section-content > * + * { margin-top: 26px; }
.section-content[disabled] { opacity: 1; }

.grid-2, .grid-3 { display: grid; gap: 26px 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }

.field { display: grid; align-content: start; gap: 7px; min-width: 0; }
.field-label { color: var(--ink); font-size: 14px; font-weight: 720; }
.field-label.required::after { content: " *"; color: var(--signal); }
.optional .field-label { color: var(--muted); font-weight: 560; }
.field-hint { color: var(--muted); font-size: 12px; }
.field-error { min-height: 0; color: var(--danger); font-size: 12px; font-weight: 620; }
.field-error:not(:empty) { min-height: 18px; }

.optional-disclosure { overflow: clip; border: 1px solid var(--line); border-radius: 12px; background: #fafbfc; }
.optional-disclosure summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-height: 52px; align-items: center; gap: 2px 16px; padding: 11px 14px; cursor: pointer; list-style: none; }
.optional-disclosure summary::-webkit-details-marker { display: none; }
.optional-disclosure summary span { font-size: 13px; font-weight: 720; }
.optional-disclosure summary small { grid-column: 1; color: var(--muted); font-size: 11px; }
.optional-disclosure summary::after { grid-column: 2; grid-row: 1 / 3; color: var(--muted); content: "+"; font-size: 22px; font-weight: 400; line-height: 1; }
.optional-disclosure[open] summary::after { content: "−"; }
.optional-fields { padding: 18px; border-top: 1px solid var(--line); background: #fff; }

input:not([type="radio"]):not([type="checkbox"]):not([type="file"]), select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid #c9ced7;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

textarea { min-height: 108px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #969eaa; }
input:focus, select:focus, textarea:focus { border-color: var(--signal); box-shadow: 0 0 0 3px rgb(38 92 255 / 12%); outline: 0; }
[aria-invalid="true"] { border-color: var(--danger) !important; background: #fffafa !important; }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.choice-group { min-width: 0; }
.choice-group > .field-error { display: block; margin-top: 8px; }

.segmented { display: grid; gap: 8px; margin-top: 10px; }
.segmented.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.segmented.narrow { max-width: 360px; }
.segmented label, .rating-scale label, .check-card { position: relative; cursor: pointer; }
.segmented input, .rating-scale input, .check-card input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.segmented span { display: grid; min-height: 48px; place-items: center; padding: 9px 12px; border: 1px solid #c9ced7; border-radius: 10px; background: #fff; font-weight: 650; text-align: center; }
.segmented input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }
.segmented input:focus-visible + span, .rating-scale input:focus-visible + span, .check-card input:focus-visible + span { outline: 3px solid rgb(38 92 255 / 35%); outline-offset: 2px; }

.rating-scale { display: grid; grid-template-columns: repeat(5, minmax(48px, 1fr)); gap: 8px; margin-top: 12px; }
.rating-scale span { display: grid; min-height: 56px; place-items: center; border: 1px solid #c9ced7; border-radius: 12px; font-size: 22px; font-weight: 720; }
.rating-scale input:checked + span { border-color: var(--signal); background: var(--signal); color: #fff; box-shadow: 0 8px 22px rgb(38 92 255 / 22%); }
.scale-labels { display: flex; justify-content: space-between; margin-top: 7px; color: var(--muted); font-size: 11px; }

.channel-panel { padding: 18px; border-radius: 13px; background: #f7f8fa; }
.channel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }

.check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.check-grid.compact-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.check-card span { display: flex; align-items: center; min-height: 52px; padding: 11px 12px 11px 42px; border: 1px solid #d3d7de; border-radius: 10px; background: #fff; font-size: 13px; }
.check-card span::before { position: absolute; left: 14px; width: 16px; height: 16px; border: 1.5px solid #9299a5; border-radius: 5px; content: ""; }
.check-card input:checked + span { border-color: #b8c8ff; background: var(--signal-soft); }
.check-card input:checked + span::before { border-color: var(--signal); background: var(--signal); box-shadow: inset 0 0 0 3px var(--signal-soft); }

.privacy-warning { display: grid; gap: 4px; padding: 15px 16px; border-left: 3px solid var(--ink); background: #f4f5f7; font-size: 13px; }
.privacy-warning span { color: #555c67; }
.upload-zone { display: grid; place-items: center; min-height: 128px; padding: 22px; border: 1.5px dashed #aab0bb; border-radius: 14px; background: #fbfbfc; cursor: pointer; text-align: center; }
.upload-zone:hover { border-color: var(--signal); background: #f7f9ff; }
.upload-zone input { max-width: 100%; margin-top: 14px; }
.photo-list { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-chip { padding: 8px 10px; border-radius: 8px; background: #eef0f3; color: #464c56; font-size: 12px; }

.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 10px; padding: 24px 8px; }
.form-footer-secondary { display: flex; align-items: center; gap: 18px; }
.draft-status { margin: 0; color: var(--muted); font-size: 13px; }
.button { display: inline-grid; min-height: 50px; place-items: center; padding: 12px 22px; border: 0; border-radius: 11px; cursor: pointer; font-weight: 740; text-decoration: none; }
.button-primary { background: var(--ink); color: #fff; box-shadow: 0 12px 28px rgb(17 19 24 / 18%); }
.button-primary:hover { background: var(--signal); }
.button-secondary { border: 1px solid #c9ced7; background: #fff; color: var(--ink); }
.button-secondary:hover { border-color: var(--ink); }
.button:disabled { cursor: wait; opacity: .55; }
.submit-button { min-width: 230px; }

.success-dialog { width: min(520px, calc(100% - 28px)); padding: 34px; border: 0; border-radius: 20px; box-shadow: 0 32px 100px rgb(17 19 24 / 28%); text-align: center; }
.success-dialog::backdrop { background: rgb(17 19 24 / 55%); backdrop-filter: blur(5px); }
.success-dialog h2 { margin: 0 0 18px; font-size: 30px; letter-spacing: -.04em; }
.success-dialog p { color: var(--muted); }
.success-dialog code { display: block; margin: 10px 0 28px; padding: 12px; border-radius: 8px; background: #f0f2f5; overflow-wrap: anywhere; }
.success-mark { display: grid; width: 56px; height: 56px; place-items: center; margin: 0 auto 20px; border-radius: 50%; background: #e7f8f1; color: var(--success); font-size: 28px; font-weight: 800; }

.login-shell { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.login-card .brand-wordmark { display: block; margin-bottom: 52px; }
.login-card .brand-logo { width: 210px; }
.login-card h1 { font-size: 38px; }
.login-form { display: grid; gap: 20px; margin-top: 32px; }
.login-form .button { margin-top: 8px; }
.login-card .alert { margin: 22px 0 0; }

.release-notes-page .hero { padding-left: 0; }
.release-list { display: grid; gap: 14px; }
.release-card { padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.release-card h2 { margin: 0 0 16px; font-size: 22px; letter-spacing: -.025em; }
.release-card ul { display: grid; gap: 9px; margin: 0; padding-left: 22px; color: #555c67; }

.admin-page .hero { padding-left: 0; }
.admin-page h1 { font-size: clamp(38px, 5vw, 64px); }
.admin-hero { align-items: center; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { display: grid; gap: 12px; padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { font-size: 36px; letter-spacing: -.04em; }
.stat .stat-date { font-size: 13px; letter-spacing: 0; }
.filter-card, .detail-card, .table-card { margin-top: 20px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.filter-card h2, .detail-card h2 { margin: 0 0 20px; }
.admin-filters { display: grid; grid-template-columns: 2fr 1.2fr 1fr 1fr auto; align-items: end; gap: 12px; }
.filter-actions { display: flex; align-items: center; gap: 14px; }
.filter-actions .button { min-height: 48px; }
.table-card h2 { margin: 0 0 20px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.section-heading span { color: var(--muted); font-size: 12px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 13px 10px; border-bottom: 1px solid #eceef1; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; }
td code { white-space: nowrap; }
td small { display: block; max-width: 340px; margin-top: 4px; color: var(--muted); }
.error-cell { max-width: 300px; color: #7a2018; }
.status-pill { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: #eef0f3; font-size: 11px; font-weight: 750; }
.status-synced { background: #e7f8f1; color: var(--success); }
.status-stored { background: #e7f8f1; color: var(--success); }
.status-problem { background: var(--danger-soft); color: var(--danger); }
.status-failed { background: var(--danger-soft); color: var(--danger); }
.status-pending, .status-syncing { background: #fff4d6; color: #7a5700; }
.rating-badge { display: inline-grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: var(--ink); color: #fff; font-weight: 800; }
.detail-page { width: min(1040px, calc(100% - 32px)); }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 24px; margin: 0; }
.detail-grid-spaced { margin-top: 24px; }
.detail-grid > div { min-width: 0; }
.detail-grid .wide { grid-column: 1 / -1; }
.detail-grid dt { margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 720; letter-spacing: .06em; text-transform: uppercase; }
.detail-grid dd { margin: 0; overflow-wrap: anywhere; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tag-list li { padding: 8px 10px; border-radius: 9px; background: var(--signal-soft); color: #1b3b9f; font-size: 13px; }
.empty-copy { margin: 0; color: var(--muted); }
.admin-photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.admin-photo-grid a { overflow: hidden; border-radius: 12px; background: #eef0f3; aspect-ratio: 4 / 3; }
.admin-photo-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.admin-photo-grid a:hover img { transform: scale(1.025); }
.admin-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.admin-nav a { padding: 8px 11px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 720; text-decoration: none; }
.admin-nav a:hover, .admin-nav a.active { background: #eef0f3; color: var(--ink); }
.access-card .eyebrow { margin-top: 0; }
.access-card h1 { margin-top: 10px; }
.access-card .lead { min-height: 52px; }
.access-link-form { display: grid; grid-template-columns: 2fr 1.3fr 1fr auto; align-items: end; gap: 12px; margin-top: 20px; }
.access-link-form label { display: grid; gap: 7px; min-width: 0; }
.access-link-form label > span { font-size: 13px; font-weight: 720; }
.created-access-link { margin-top: 20px; padding: 18px; border: 1px solid #a8d7c8; border-radius: 13px; background: #eefaf6; }
.created-access-link p { margin: 7px 0 14px; color: var(--muted); font-size: 13px; }
.copy-row { display: flex; gap: 10px; margin-bottom: 14px; }
.copy-row input { flex: 1; min-width: 0; font-family: ui-monospace, monospace; font-size: 12px; }
.copy-row .button { min-height: 48px; background: var(--ink); color: #fff; }
.status-active { background: #e7f8f1; color: var(--success); }
.status-expired, .status-limit_reached { background: #fff4d6; color: #7a5700; }
.status-revoked { background: var(--danger-soft); color: var(--danger); }
.danger-button { color: var(--danger); }
.dashboard-page { width: min(1400px, calc(100% - 48px)); }
.dashboard-hero { padding-bottom: 36px; }
.dashboard-hero > div, .analytics-form, .period-grid, .period-card, .filter-set { min-width: 0; }
.analytics-form input, .analytics-form select { min-width: 0; max-width: 100%; }
.analytics-filter-card { margin-top: 0; }
.analytics-filter-card .section-heading h2 { margin: 4px 0 0; }
.analytics-form { display: grid; gap: 22px; }
.period-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.period-card { min-width: 0; margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; }
.period-card-compare { background: #f7f8fa; }
.period-card legend { padding: 0 7px; font-size: 13px; font-weight: 800; }
.date-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.analytics-toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.toggle-line { display: flex; align-items: flex-start; gap: 11px; min-height: 66px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.toggle-line input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--signal); }
.toggle-line span { display: grid; gap: 3px; }
.toggle-line small { color: var(--muted); }
.filter-set { padding-top: 20px; border-top: 1px solid var(--line); }
.filter-set-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.filter-set-heading h3 { margin: 0; font-size: 18px; }
.filter-set-heading span { color: var(--muted); font-size: 12px; }
.analytics-form:not(:has(#independent_filters:checked)) .independent-filter-set { display: none; }
.analytics-basic-filters { display: grid; grid-template-columns: 2fr repeat(3, minmax(0, 1fr)); gap: 10px; }
.analytics-filter-groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.analytics-filter-group { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.analytics-filter-group summary { display: flex; align-items: center; justify-content: space-between; min-height: 43px; padding: 10px 12px; cursor: pointer; font-size: 12px; font-weight: 760; list-style: none; }
.analytics-filter-group summary::-webkit-details-marker { display: none; }
.analytics-filter-group summary::after { content: "+"; color: var(--muted); font-size: 18px; font-weight: 400; }
.analytics-filter-group[open] summary::after { content: "−"; }
.analytics-filter-group summary span { display: grid; width: 22px; height: 22px; place-items: center; margin-left: auto; margin-right: 8px; border-radius: 999px; background: var(--signal-soft); color: #1b3b9f; }
.analytics-check-list { display: grid; max-height: 210px; overflow-y: auto; padding: 0 10px 10px; border-top: 1px solid #f0f1f3; }
.analytics-check-list label { display: flex; align-items: flex-start; gap: 8px; padding: 8px 3px; font-size: 12px; cursor: pointer; }
.analytics-check-list input { margin-top: 2px; accent-color: var(--signal); }
.analytics-actions { display: flex; align-items: center; gap: 16px; }
.analytics-actions span { color: var(--muted); font-size: 12px; }
.comparison-context { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.comparison-context article { display: flex; align-items: flex-start; gap: 12px; padding: 17px 19px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.comparison-context p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.period-chip { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: var(--signal); color: #fff; font-weight: 850; }
.period-chip.period-b { background: #707782; }
.dashboard-warning { margin-top: 12px; padding: 13px 16px; border: 1px solid #f0d88a; border-radius: 11px; background: #fff8df; color: #654b00; font-size: 13px; }
.cohort-note { margin: 12px 2px 0; color: var(--muted); font-size: 12px; }
.metrics-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.metric-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.metric-card h2 { min-height: 34px; margin: 0 0 17px; font-size: 13px; line-height: 1.3; }
.metric-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.metric-values > div { min-width: 0; padding: 10px; border-radius: 10px; background: #f5f6f8; }
.metric-values span, .metric-values small { display: block; color: var(--muted); font-size: 10px; }
.metric-values strong { display: block; margin: 5px 0; font-size: 22px; letter-spacing: -.04em; }
.metric-delta { margin: 14px 0 0; font-size: 11px; }
.trend-good { color: #137659; }
.trend-bad { color: var(--danger); }
.trend-neutral { color: var(--muted); }
.analytics-card { margin-top: 20px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.analytics-card .section-heading h2 { margin: 4px 0 0; }
.problem-chart { display: grid; gap: 13px; margin-top: 22px; }
.problem-chart-row { display: grid; grid-template-columns: minmax(220px, 1.3fr) repeat(2, minmax(180px, 1fr)); align-items: center; gap: 16px; }
.problem-chart-row > a { color: var(--ink); font-size: 13px; font-weight: 720; }
.problem-period { display: grid; gap: 5px; }
.problem-period span { color: var(--muted); font-size: 10px; }
.problem-period progress { width: 100%; height: 10px; border: 0; border-radius: 999px; accent-color: var(--signal); }
.period-b-bar progress { accent-color: #707782; }
.analytics-table th { white-space: nowrap; }
.analytics-table th:not(:first-child), .analytics-table td:not(:first-child) { text-align: right; }
.analytics-table td:first-child { min-width: 230px; }

@media (max-width: 900px) {
  .page-shell { width: min(100% - 24px, 760px); padding-top: 36px; }
  .hero { align-items: start; flex-direction: column; padding: 0 4px 28px; }
  .hero-meta { text-align: left; }
  .form-stepper { margin-inline: 4px; }
  .form-section { grid-template-columns: 1fr; }
  .section-index { display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 14px; padding: 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .section-index p { grid-column: 2; margin-top: -8px; }
  .section-index.compact > span { margin: 0; }
  .section-number { margin: 0; font-size: 42px; }
  .section-content { padding: 24px 20px 28px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .access-link-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-actions { grid-column: 1 / -1; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-page { width: min(100% - 24px, 900px); }
  .analytics-filter-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-basic-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .problem-chart-row { grid-template-columns: minmax(180px, 1fr) repeat(2, minmax(150px, 1fr)); }
}

@media (max-width: 600px) {
  .header-inner { width: calc(100% - 24px); min-height: 58px; }
  .brand-logo { width: 132px; }
  .header-actions { gap: 12px; }
  .header-actions .text-link { display: none; }
  .page-shell { width: calc(100% - 16px); padding: 18px 0 58px; }
  h1 { font-size: 36px; line-height: 1; }
  .lead { margin-top: 10px; font-size: 15px; line-height: 1.4; }
  .hero { padding-bottom: 20px; }
  .hero-meta { display: none; }
  .form-stepper { top: 0; margin: 0 0 16px; padding: calc(9px + env(safe-area-inset-top)) 12px 10px; }
  .stepper-copy { align-items: center; margin-bottom: 6px; }
  .stepper-copy .draft-status { max-width: 155px; font-size: 10px; line-height: 1.25; }
  #posForm { gap: 8px; }
  .form-section { border-radius: 13px; box-shadow: 0 10px 28px rgb(22 28 45 / 6%); }
  .section-index { align-items: center; gap: 10px; padding: 12px 14px; }
  .section-index h2 { font-size: 15px; }
  .section-index p { margin-top: -3px; font-size: 10px; }
  .section-number, .section-index.compact > span { display: grid; width: auto; min-width: 32px; min-height: 24px; place-items: center; margin: 0; padding: 3px 7px; border-radius: 7px; background: #eef0f3; color: var(--muted); font-size: 11px; font-weight: 760; letter-spacing: .04em; }
  .section-content { padding: 17px 14px 20px; }
  .section-content > * + * { margin-top: 16px; }
  .grid-2, .grid-3, .split-row, .channel-grid, .check-grid, .check-grid.compact-checks { grid-template-columns: 1fr; gap: 14px; }
  .channel-grid, .check-grid, .check-grid.compact-checks { gap: 7px; }
  .field { gap: 5px; }
  .field-label { font-size: 13px; }
  input:not([type="radio"]):not([type="checkbox"]):not([type="file"]), select, textarea { min-height: 46px; padding: 9px 11px; }
  textarea { min-height: 96px; }
  .segmented { margin-top: 8px; }
  .segmented span { min-height: 46px; padding: 8px 10px; }
  .rating-scale { gap: 5px; }
  .rating-scale span { min-height: 48px; }
  .check-card span { min-height: 48px; padding-top: 9px; padding-bottom: 9px; }
  .channel-panel { padding: 14px; }
  .privacy-warning { padding: 12px 13px; }
  .upload-zone { min-height: 112px; padding: 18px; }
  .optional-disclosure summary { min-height: 48px; padding: 9px 12px; }
  .optional-fields { padding: 14px; }
  .form-footer { align-items: stretch; flex-direction: column-reverse; gap: 10px; padding: 16px 4px; }
  .form-footer-secondary { justify-content: space-between; }
  .button { min-height: 48px; }
  .submit-button { width: 100%; min-height: 52px; }
  .login-shell { align-items: start; padding: 12px; }
  .login-card { margin-top: 7vh; padding: 28px 22px; }
  .login-card .brand-wordmark { margin-bottom: 42px; }
  .stats-grid { grid-template-columns: 1fr; }
  .filter-card, .detail-card, .table-card { padding: 16px; }
  .admin-filters, .detail-grid { grid-template-columns: 1fr; }
  .access-link-form { grid-template-columns: 1fr; }
  .copy-row { align-items: stretch; flex-direction: column; }
  .admin-photo-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; }
  .admin-nav { order: 3; width: 100%; padding-bottom: 8px; overflow-x: auto; }
  .admin-nav + .header-actions { order: 2; margin-left: auto; }
  .header-inner > .brand-wordmark { order: 1; }
  .header-inner { flex-wrap: wrap; }
  .dashboard-page { max-width: 100%; overflow-x: clip; }
  .dashboard-hero > div { width: 100%; }
  .period-grid, .analytics-toggles, .comparison-context, .metrics-grid { grid-template-columns: minmax(0, 1fr); }
  .analytics-basic-filters, .analytics-filter-groups, .date-pair { grid-template-columns: minmax(0, 1fr); }
  .filter-set-heading, .analytics-actions { align-items: flex-start; flex-direction: column; }
  .problem-chart-row { grid-template-columns: 1fr; gap: 7px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
}

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