:root {
  --bg: #f3f0ea;
  --bg-accent: #e6efe8;
  --ink: #1c2420;
  --muted: #5c6a62;
  --line: #c9d2cb;
  --surface: rgba(255, 255, 255, 0.72);
  --primary: #1f6b4f;
  --primary-ink: #f5fbf7;
  --warn: #9a5b12;
  --danger: #8b2e2e;
  --ok: #2a6b4a;
  --soon: #b45309;
  --expired: #9f1239;
  --radius: 10px;
  --font: "DM Sans", sans-serif;
  --display: "Fraunces", Georgia, serif;
  --shadow: 0 10px 30px rgba(28, 36, 32, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #d8ebe0 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, #efe4d4 0%, transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-accent) 100%);
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page {
  width: min(960px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
  padding-left: max(0px, env(safe-area-inset-left));
  padding-right: max(0px, env(safe-area-inset-right));
}

body.landing {
  background: #eef3ef;
}

body.landing .page {
  display: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  animation: rise 0.45s ease-out both;
}

.brand {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.nav a:not(.btn) {
  color: var(--muted);
  font-weight: 500;
}

h1 {
  font-family: var(--display);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
  animation: rise 0.5s ease-out 0.05s both;
}

.lede {
  margin: 0 0 1.5rem;
  color: var(--muted);
  max-width: 36rem;
  animation: rise 0.5s ease-out 0.1s both;
}

.hero-util {
  margin-bottom: 0.5rem;
}

.admin-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.not-found-panel {
  max-width: 36rem;
  margin: 2rem auto 0;
  padding: 1.75rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: rise 0.5s ease-out both;
}

.not-found-code {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: clamp(3rem, 10vw, 4.5rem);
  font-weight: 600;
  line-height: 1;
  color: var(--primary);
  letter-spacing: -0.04em;
  animation: rise 0.45s ease-out both;
}

.not-found-panel h1 {
  margin-bottom: 0.65rem;
}

.not-found-path {
  display: inline-block;
  margin-top: 0.15rem;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  background: rgba(28, 36, 32, 0.06);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  word-break: break-all;
}

.not-found-punch {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-style: italic;
}

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.admin-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-hero .lede {
  margin-bottom: 0;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  animation: rise 0.5s ease-out 0.1s both;
}

.admin-clear {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.admin-clear form {
  margin: 0;
}

.admin-clear-label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  margin-right: 0.15rem;
}

.admin-backup-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.75rem;
  animation: rise 0.55s ease-out 0.12s both;
}

.admin-panel-note {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.admin-backup-form,
.admin-restore-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: flex-start;
}

.admin-dest {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.admin-dest legend {
  padding: 0;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.admin-radio {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 500;
  cursor: pointer;
}

.admin-radio-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.admin-radio em {
  font-style: normal;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.88em;
}

.admin-file {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

.admin-file input[type="file"] {
  color: var(--ink);
  font-weight: 400;
}

@media (max-width: 900px) {
  .admin-backup-panel {
    grid-template-columns: 1fr;
  }
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  animation: rise 0.55s ease-out 0.15s both;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.6fr);
  gap: 1rem;
  animation: rise 0.55s ease-out 0.2s both;
}

.admin-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.admin-panel h2 {
  margin: 0 0 0.9rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.admin-panel-wide {
  min-width: 0;
}

.location-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.location-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.location-label {
  font-weight: 500;
}

.location-count {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.location-bar {
  height: 0.45rem;
  background: #e4ebe6;
  border-radius: 999px;
  overflow: hidden;
}

.location-bar span {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
}

.empty-inline {
  margin: 0;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.admin-user-name {
  font-weight: 600;
}

.admin-user-email {
  color: var(--muted);
  font-size: 0.85rem;
  word-break: break-word;
}

.admin-ip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 500;
}

.admin-time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 0.86rem;
}

.summary-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
}

.summary-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.summary-value {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 600;
}

.summary-alert {
  border-color: #e8b86a;
  background: rgba(255, 244, 230, 0.85);
}

.summary-alert .summary-value {
  color: var(--warn);
}

.sub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sub-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--ok);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: rise 0.5s ease-out both;
}

.sub-row:nth-child(1) { animation-delay: 0.18s; }
.sub-row:nth-child(2) { animation-delay: 0.24s; }
.sub-row:nth-child(3) { animation-delay: 0.3s; }
.sub-row:nth-child(4) { animation-delay: 0.36s; }

.sub-row.urgency-cancel_soon,
.sub-row.urgency-overdue_cancel {
  border-left-color: var(--soon);
}

.sub-row.urgency-expired {
  border-left-color: var(--expired);
}

.sub-row.urgency-renewing_soon {
  border-left-color: #2563eb;
}

.sub-row.status-cancelled {
  border-left-color: var(--muted);
  opacity: 0.78;
}

.sub-main {
  flex: 1;
  min-width: 0;
}

.sub-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.sub-name {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
}

.plan-tag {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(31, 107, 79, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
}

.chip {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #e8eee9;
  color: var(--muted);
}

.chip-cancel_soon,
.chip-overdue_cancel {
  background: #fff1db;
  color: var(--warn);
}

.chip-expired {
  background: #fde8ee;
  color: var(--expired);
}

.chip-renewing_soon {
  background: #e8f0ff;
  color: #1d4ed8;
}

.chip-cancelled {
  background: #ececec;
  color: #555;
}

.chip-ok {
  background: #e4f4eb;
  color: var(--ok);
}

.sub-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.sub-meta dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 0.15rem;
}

.sub-meta dd {
  margin: 0;
  font-weight: 500;
}

.muted {
  color: var(--muted);
  font-weight: 400;
}

.emphasis {
  color: var(--warn);
  font-weight: 700;
}

.sub-notes {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.sub-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  min-width: 6.5rem;
}

.sub-actions form {
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-ink);
}

.btn-primary:hover {
  background: #18563f;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
  width: 100%;
}

.btn-warn {
  background: #fff6ea;
  border-color: #e8b86a;
  color: var(--warn);
  width: 100%;
}

.btn-danger {
  background: #fff1f1;
  border-color: #e4b0b0;
  color: var(--danger);
  width: 100%;
}

.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  animation: rise 0.5s ease-out 0.15s both;
}

.empty p {
  color: var(--muted);
  margin: 0 0 1rem;
}

.form-section {
  max-width: 720px;
}

.sub-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  animation: rise 0.5s ease-out 0.12s both;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 1rem;
}

.field-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.field-grid label.full {
  grid-column: 1 / -1;
}

.field-grid input,
.field-grid select,
.field-grid textarea {
  font: inherit;
  font-weight: 400;
  font-size: 1rem;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  background: #fff;
  min-height: 44px;
  width: 100%;
  max-width: 100%;
}

.field-grid input:focus,
.field-grid select:focus,
.field-grid textarea:focus {
  outline: 2px solid rgba(31, 107, 79, 0.35);
  border-color: var(--primary);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.form-actions .btn-ghost {
  width: auto;
}

.flash-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.flash {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-weight: 500;
}

.flash-success {
  background: #e4f4eb;
  color: var(--ok);
}

.flash-error {
  background: #fde8ee;
  color: var(--expired);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-avatar {
  border-radius: 50%;
  flex-shrink: 0;
}

.nav-logout {
  width: auto;
  padding: 0.4rem 0.7rem;
}

.landing-shell {
  min-height: 100vh;
  width: 100%;
}

.landing-flash {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: min(480px, calc(100% - 2rem));
  margin: 0;
}

.landing-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  min-height: 100vh;
  width: 100%;
}

.landing-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2.5rem;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1.5rem, 5vw, 4.5rem);
  background:
    radial-gradient(ellipse 70% 50% at 0% 0%, #d8ebe0 0%, transparent 55%),
    linear-gradient(165deg, #f3f0ea 0%, #e6efe8 100%);
  animation: rise 0.5s ease-out both;
}

.landing-brand {
  font-size: clamp(2rem, 3.5vw, 2.6rem);
  align-self: flex-start;
}

.landing-copy {
  max-width: 36rem;
  margin: auto 0;
}

.landing-copy h1 {
  font-size: clamp(1.85rem, 3.6vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  max-width: 16ch;
  animation: rise 0.55s ease-out 0.06s both;
}

.landing-copy .lede {
  font-size: 1.08rem;
  margin: 0 0 1.1rem;
  animation: rise 0.55s ease-out 0.12s both;
}

.free-note {
  display: inline-block;
  margin: 0;
  font-weight: 600;
  color: var(--primary);
  font-size: 1rem;
  animation: rise 0.55s ease-out 0.18s both;
}

.landing-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  background:
    radial-gradient(ellipse 80% 60% at 80% 20%, #dfece4 0%, transparent 55%),
    #1f6b4f;
  animation: rise 0.55s ease-out 0.1s both;
}

.signin-panel {
  width: min(100%, 420px);
  background: #fff;
  border: none;
  border-radius: 16px;
  padding: 2.25rem 2rem 2rem;
  box-shadow: 0 22px 50px rgba(12, 28, 20, 0.22);
}

.signin-panel h2 {
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.signin-blurb {
  margin: 0 0 1.4rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.signin-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.signin-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
}

.signin-field input {
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  background: #fff;
  min-height: 48px;
}

.signin-field input:focus {
  outline: 2px solid rgba(31, 107, 79, 0.35);
  border-color: var(--primary);
}

.btn-google {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.12);
  min-height: 52px;
  padding: 0.75rem 1.1rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
}

.btn-google:hover {
  background: #f8f9fa;
  border-color: #c6c6c6;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(60, 64, 67, 0.16);
}

.google-icon {
  flex-shrink: 0;
}

.signin-fineprint {
  margin: 1rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
}

.landing-points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  animation: rise 0.55s ease-out 0.22s both;
}

.landing-points h3 {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.landing-points p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(28, 36, 32, 0.48);
  backdrop-filter: blur(4px);
  animation: rise 0.35s ease-out both;
}

.consent-overlay[hidden],
.cookie-banner[hidden] {
  display: none !important;
}

.consent-card {
  width: min(34rem, 100%);
  background: #f7f4ee;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(28, 36, 32, 0.18);
  padding: 1.4rem 1.35rem 1.25rem;
}

.consent-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.consent-card h2 {
  margin: 0 0 0.85rem;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.consent-copy {
  color: var(--ink);
  font-size: 0.95rem;
  margin-bottom: 1.1rem;
}

.consent-copy p {
  margin: 0 0 0.75rem;
}

.consent-copy p:last-child {
  margin-bottom: 0;
}

.consent-muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom));
  background: rgba(247, 244, 238, 0.96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(28, 36, 32, 0.08);
  animation: rise 0.4s ease-out both;
}

.cookie-banner-inner {
  width: min(960px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-banner-inner p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 46rem;
}

@media (max-width: 900px) {
  /* Phones: one column, ordered headline -> sign-in -> free note -> points.
     The wrappers are unwrapped so their children can be reordered. */
  .landing-split {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    background:
      radial-gradient(ellipse 70% 50% at 0% 0%, #d8ebe0 0%, transparent 55%),
      linear-gradient(165deg, #f3f0ea 0%, #e6efe8 100%);
  }

  .landing-left,
  .landing-copy {
    display: contents;
  }

  .landing-brand {
    order: 1;
    font-size: 1.7rem;
    padding: max(1rem, env(safe-area-inset-top)) 1.25rem 0.75rem;
  }

  .landing-copy h1 {
    order: 2;
    max-width: none;
    font-size: clamp(1.55rem, 6.5vw, 1.95rem);
    margin: 0 0 0.6rem;
    padding: 0 1.25rem;
  }

  .landing-copy .lede {
    order: 3;
    font-size: 1rem;
    margin: 0 0 0.9rem;
    padding: 0 1.25rem;
  }

  .landing-right {
    order: 4;
    align-items: stretch;
    padding: 0.35rem 1.25rem 1rem;
  }

  .free-note {
    order: 5;
    display: block;
    padding: 1rem 1.25rem 0;
  }

  .landing-points {
    order: 6;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
  }

  .signin-panel {
    width: 100%;
    padding: 1.35rem 1.2rem 1.25rem;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(12, 28, 20, 0.28);
  }

  .signin-panel h2 {
    font-size: 1.55rem;
  }

  .signin-blurb {
    margin-bottom: 1.1rem;
  }

  .admin-grid,
  .admin-backup-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page {
    width: min(960px, calc(100% - 1.25rem));
    padding: 1rem 0 calc(2.25rem + env(safe-area-inset-bottom));
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
  }

  .nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .user-chip {
    max-width: 100%;
    flex: 1 1 100%;
    order: -1;
  }

  .nav a:not(.btn) {
    padding: 0.45rem 0.35rem;
  }

  .nav .btn {
    flex: 1 1 calc(50% - 0.5rem);
    min-height: 44px;
    width: auto;
  }

  .nav-logout {
    flex: 1 1 100%;
  }

  h1 {
    font-size: clamp(1.55rem, 7vw, 1.95rem);
  }

  .lede {
    font-size: 0.98rem;
    margin-bottom: 1.15rem;
  }

  .admin-hero,
  .hero-util.admin-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-toolbar {
    width: 100%;
  }

  .admin-toolbar .btn {
    flex: 1 1 auto;
    min-height: 44px;
  }

  .admin-clear {
    width: 100%;
  }

  .admin-clear .btn {
    min-height: 40px;
  }

  .summary {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .summary-item {
    padding: 0.85rem 0.95rem;
  }

  .sub-row {
    flex-direction: column;
    padding: 0.95rem;
  }

  .sub-actions {
    flex-direction: row;
    flex-wrap: wrap;
    min-width: 0;
    width: 100%;
  }

  .sub-actions .btn,
  .sub-actions form {
    flex: 1 1 calc(50% - 0.25rem);
  }

  .sub-actions .btn {
    width: 100%;
    min-height: 44px;
  }

  .sub-meta {
    grid-template-columns: 1fr;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .form-actions .btn,
  .form-actions .btn-ghost {
    width: 100%;
    min-height: 44px;
  }

  .table-wrap {
    margin: 0 -0.25rem;
    padding-bottom: 0.25rem;
  }

  .admin-table {
    font-size: 0.85rem;
    min-width: 640px;
  }

  .consent-overlay {
    padding: 0.75rem;
    padding-top: max(0.75rem, env(safe-area-inset-top));
    align-items: end;
  }

  .consent-card {
    width: 100%;
    max-height: min(88dvh, 100%);
    overflow-y: auto;
    padding: 1.2rem 1.1rem calc(1.1rem + env(safe-area-inset-bottom));
    border-radius: 14px 14px 0 0;
  }

  .consent-card h2 {
    font-size: 1.25rem;
  }

  .consent-card .btn {
    width: 100%;
    min-height: 48px;
  }

  .cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-banner-inner .btn {
    width: 100%;
    min-height: 44px;
  }

  .btn:hover {
    transform: none;
  }
}

@media (max-width: 420px) {
  .landing-brand,
  .landing-copy h1,
  .landing-copy .lede,
  .landing-right,
  .free-note,
  .landing-points {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .nav .btn {
    flex: 1 1 100%;
  }

  .sub-actions .btn,
  .sub-actions form {
    flex: 1 1 100%;
  }
}

