/* Flight Scraper — polished, mobile-first */

:root {
  --ink: #0b1220;
  --ink-soft: #334155;
  --muted: #64748b;
  --paper: #ffffff;
  --paper-2: #f1f5f9;
  --line: #e2e8f0;
  --blue: #2563eb;
  --blue-deep: #1d4ed8;
  --blue-soft: #dbeafe;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #dc2626;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.04);
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.04);
  --font-brand: "Syne", sans-serif;
  --font-ui: "Outfit", sans-serif;
  --radius: 16px;
  --radius-sm: 12px;
  --pad: max(1rem, env(safe-area-inset-left));
  --pad-r: max(1rem, env(safe-area-inset-right));
  --content: 100%;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(1000px 480px at 10% -10%, rgba(37, 99, 235, 0.14), transparent 55%),
    radial-gradient(800px 420px at 100% 0%, rgba(59, 130, 246, 0.1), transparent 50%),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 45%, #f1f5f9 100%);
  background-attachment: fixed;
}

a {
  color: var(--blue-deep);
  text-decoration: none;
  transition: color 0.15s var(--ease);
}
a:hover { color: var(--blue); }

.shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* —— Top bar —— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding:
    max(0.5rem, env(safe-area-inset-top))
    var(--pad-r)
    0.5rem
    var(--pad);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(1.2) blur(14px);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}
.topbar-inner {
  width: min(100%, var(--content));
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  container-type: inline-size;
  container-name: topbar;
}
.brand-link {
  font-family: var(--font-brand);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--ink);
  line-height: 1.05;
  flex-shrink: 0;
  transition: color 0.15s var(--ease), transform 0.2s var(--ease);
}
.brand-link:hover {
  color: var(--blue-deep);
  transform: translateY(-1px);
}
.brand-short {
  display: inline-block;
  font-size: 1.15rem;
  letter-spacing: -0.04em;
  padding: 0.15rem 0.1rem;
}
.brand-full {
  display: none;
  font-size: 0.82rem;
  max-width: 5.5rem;
}

/* When the header row has room, show full name instead of FS */
@container topbar (min-width: 300px) {
  .brand-short { display: none; }
  .brand-full { display: inline-block; }
}

/* Fallback if container queries unavailable */
@supports not (container-type: inline-size) {
  .brand-short { display: inline-block; }
  .brand-full { display: none; }
  @media (min-width: 300px) {
    .brand-short { display: none; }
    .brand-full { display: inline-block; }
  }
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  min-width: 0;
}
.topbar nav {
  display: flex;
  gap: 0.25rem;
  min-width: 0;
}
.topbar nav a {
  flex: 0 0 auto;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 550;
  background: transparent;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.topbar nav a.active {
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-weight: 650;
}
.topbar nav a:hover {
  background: var(--paper-2);
  color: var(--ink);
}
.topbar nav a.active:hover {
  background: var(--blue-soft);
  color: var(--blue-deep);
}

.topbar form { margin: 0; flex-shrink: 0; }
.topbar form button {
  margin: 0;
  min-height: 2.2rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
}

/* —— Main —— */
main {
  width: min(100%, var(--content));
  margin: 0 auto;
  padding: 1rem var(--pad) calc(2.5rem + env(safe-area-inset-bottom)) var(--pad-r);
  flex: 1;
}

.page-hero {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.page-hero .lede {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.page-hero .lede + .lede { margin-top: 0.25rem; }
.page-hero .lede.warn {
  color: var(--warn);
  font-weight: 550;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--ink-soft);
}
.back-link:hover { color: var(--blue-deep); }

@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.section {
  margin-bottom: 0.9rem;
  padding: 1.05rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  animation: riseIn 0.5s var(--ease) both;
}
.section:nth-of-type(2) { animation-delay: 0.04s; }
.section:nth-of-type(3) { animation-delay: 0.08s; }
.section:nth-of-type(4) { animation-delay: 0.12s; }

.section h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-brand);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.section h3 {
  margin: 1.35rem 0 0.5rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.section h3:first-of-type {
  margin-top: 0.35rem;
  padding-top: 0;
  border-top: 0;
}

.section-watcher {
  --pill-h: 4.15rem;
}
.section-watcher .row-actions {
  margin-bottom: 0.85rem;
}
.section-watcher .row-actions form {
  flex: 1 1 100%;
  width: 100%;
}
.section-watcher .row-actions > button,
.section-watcher .row-actions form button {
  width: 100%;
  min-width: 0;
  min-height: var(--pill-h);
  height: var(--pill-h);
  padding-top: 0;
  padding-bottom: 0;
  justify-content: center;
}
.section-watcher .meta {
  margin-bottom: 0;
}
.section-watcher .meta span {
  justify-content: center;
  min-height: var(--pill-h);
  box-sizing: border-box;
}
.section-watcher .enable-block {
  margin-top: 1rem;
  margin-bottom: 0;
  text-align: center;
}

.meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.meta span {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.75rem;
  background: linear-gradient(180deg, #fff, var(--paper-2));
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.meta b {
  color: var(--ink);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  text-transform: none;
}

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

.ac-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.ac-card {
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}
.ac-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.ac-card-top strong {
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}
.ac-card .row-actions {
  margin: 0;
}
.schedule-toggle {
  margin: 0.35rem 0 0.75rem;
}
.schedule-toggle button {
  flex: 1 1 100%;
  width: 100%;
  min-height: 3.25rem;
  margin-top: 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.test-form {
  margin: 0;
}
.test-form button,
.test-btn {
  width: 100%;
  min-height: 3.25rem;
  margin-top: 0.85rem;
  font-size: 1.05rem;
  font-weight: 700;
}
.form-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 1.35rem 0 1rem;
}
.save-settings-btn {
  width: 100%;
  min-height: 3.25rem;
  font-size: 1.05rem;
  font-weight: 700;
}

code {
  font-family: ui-monospace, "Cascadia Code", SFMono-Regular, monospace;
  font-size: 0.82em;
  color: var(--blue-deep);
  background: var(--blue-soft);
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
}

label {
  display: block;
  margin: 0.85rem 0 0.35rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-soft);
}
label.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.3rem 0.7rem 0.3rem 0;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
label.inline-check:has(input:checked) {
  border-color: rgba(37, 99, 235, 0.45);
  background: var(--blue-soft);
  color: var(--blue-deep);
}

.day-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  margin: 0.55rem 0 0.85rem;
}
.day-pill {
  flex: 1 1 0;
  margin: 0;
  cursor: pointer;
}
.day-pill input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.day-pill span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.day-pill input:checked + span {
  background: var(--blue);
  color: #fff;
}
.day-pill input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.28);
}

.hour-slider,
.dot-slider {
  margin: 0.35rem 0 1.1rem;
  padding: 0.35rem 0.15rem 0;
  touch-action: none;
  user-select: none;
}
.hour-slider-rail,
.dot-slider-rail {
  position: relative;
  height: 2.75rem;
  margin: 0 1.35rem;
}
.hour-slider-rail::before,
.dot-slider-rail::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 0.45rem;
  margin-top: -0.225rem;
  border-radius: 999px;
  background: var(--blue-soft);
}
.hour-slider-fill,
.dot-slider-fill {
  position: absolute;
  top: 50%;
  height: 0.45rem;
  margin-top: -0.225rem;
  border-radius: 999px;
  background: var(--blue);
  pointer-events: none;
  z-index: 1;
}
.hour-dot {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 2;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  cursor: grab;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(37, 99, 235, 0.28);
  transition: box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}
.hour-dot:hover,
.hour-dot.is-active {
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.14), 0 6px 16px rgba(37, 99, 235, 0.35);
}
.hour-dot.is-active {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.06);
  z-index: 3;
}
.hour-dot:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.28), 0 4px 12px rgba(37, 99, 235, 0.28);
}
.hour-slider-scale,
.dot-slider-scale {
  display: flex;
  justify-content: space-between;
  margin: 0.35rem 1.35rem 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.form-row {
  display: grid;
  gap: 0.25rem 0.75rem;
}
.form-row > div { min-width: 0; }

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  max-width: none;
  padding: 0.78rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
textarea {
  resize: vertical;
  min-height: 4.2rem;
  line-height: 1.4;
  font-family: ui-monospace, "Cascadia Code", SFMono-Regular, monospace;
  font-size: 0.92rem;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  flex-shrink: 0;
  border: 1.5px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  position: relative;
}
input[type="checkbox"]:checked {
  background: var(--blue);
  border-color: var(--blue);
}
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 45%;
  width: 0.26rem;
  height: 0.48rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -60%) rotate(45deg);
}

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  margin-top: 0.85rem;
  padding: 0.65rem 1.2rem;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 650;
  font-size: 0.94rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
button:hover, .btn:hover {
  background: var(--blue-deep);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}
button:active, .btn:active { transform: translateY(1px); }
button:disabled, .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
button.secondary, .btn.secondary {
  background: #fff;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  box-shadow: none;
}
button.secondary:hover, .btn.secondary:hover {
  background: var(--paper-2);
  color: var(--ink);
  box-shadow: none;
}
button.danger, .btn.danger {
  background: var(--danger);
  color: #fff;
}
button.danger:hover {
  background: #b91c1c;
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.22);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
}
.row-actions form { margin: 0; flex: 1 1 calc(50% - 0.25rem); }
.row-actions > button,
.row-actions form button {
  margin-top: 0;
  width: 100%;
}

/* —— Aircraft table —— */
.ac-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.15rem;
}
.ac-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.ac-table th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.35rem 0.55rem 0.55rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ac-table td {
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  vertical-align: middle;
  white-space: nowrap;
}
.ac-table tbody tr:last-child td {
  border-bottom: none;
}
.ac-table .ac-reg .pill-reg {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.ac-name {
  margin-left: 0.45rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.ac-table .last-check {
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.ac-settings-table tbody td {
  vertical-align: middle;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  line-height: 1;
}
.ac-settings-table .ac-cell {
  display: flex;
  align-items: center;
  min-height: 1.85rem;
}
.ac-settings-table .ac-name-cell {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-settings-table .inline-form {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding: 0;
  border: 0;
  height: 1.85rem;
}
.ac-settings-table .pill-link,
.ac-settings-table .enable-pill,
.ac-settings-table .pill-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: auto;
  height: 1.85rem;
  min-height: 1.85rem;
  max-height: 1.85rem;
  margin: 0;
  padding: 0 0.6rem;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transform: none;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.ac-settings-table .enable-pill {
  min-width: 2.75rem;
}
.ac-settings-table .enable-pill.is-on {
  color: #fff;
  background: var(--blue);
}
.ac-settings-table .enable-pill.is-on:hover {
  background: var(--blue-deep);
}
.ac-settings-table .enable-pill.is-off {
  color: #fff;
  background: var(--danger);
}
.ac-settings-table .enable-pill.is-off:hover {
  background: #b91c1c;
}
.ac-settings-table .pill-x {
  min-width: 2.75rem;
  width: auto;
  padding: 0 0.6rem;
  color: #fff;
  background: var(--danger);
  font-size: 1rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}
.ac-settings-table .pill-x:hover {
  color: #fff;
  background: #b91c1c;
}
.ac-settings-table .pill-x:active,
.ac-settings-table .enable-pill:active {
  transform: none;
}
.ac-add-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}
.ac-add-form #registration {
  flex: 0 0 auto;
  width: 6.5rem;
  max-width: 6.5rem;
  text-transform: uppercase;
}
.ac-add-form #name {
  flex: 1 1 auto;
  min-width: 0;
}
.ac-add-form .ac-add-btn {
  flex: 0 0 auto;
  width: 2.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
}

.badge,
.pill-link {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
}
.badge.online {
  color: #fff;
  background: var(--ok);
}
.badge.online:hover {
  background: #166534;
}
.badge.offline {
  color: #475569;
  background: rgba(100, 116, 139, 0.12);
}
.badge.unknown {
  color: var(--warn);
  background: rgba(180, 83, 9, 0.12);
}
.pill-link {
  color: var(--blue-deep);
  background: var(--blue-soft);
  text-transform: none;
  letter-spacing: 0.02em;
}
.pill-link:hover {
  color: #fff;
  background: var(--blue);
}

.flash {
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  border-radius: 12px;
  font-weight: 550;
  animation: riseIn 0.35s var(--ease) both;
}
.flash.ok {
  background: rgba(21, 128, 61, 0.1);
  color: var(--ok);
  border: 1px solid rgba(21, 128, 61, 0.18);
}
.flash.error {
  background: rgba(220, 38, 38, 0.08);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.16);
}

.site-footer { display: none; }

/* —— Login —— */
.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(1.25rem, env(safe-area-inset-top)) 1rem max(1.25rem, env(safe-area-inset-bottom));
  position: relative;
  overflow: hidden;
}
.login-screen::before,
.login-screen::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}
.login-screen::before {
  width: 70vmax;
  height: 70vmax;
  top: -30%;
  right: -25%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.18), transparent 65%);
}
.login-screen::after {
  width: 50vmax;
  height: 50vmax;
  bottom: -20%;
  left: -20%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.12), transparent 65%);
}
.login-panel {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  padding: 1.85rem 1.4rem 1.6rem;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 20px;
  box-shadow: var(--shadow);
  animation: riseIn 0.55s var(--ease) both;
}
.login-panel .brand {
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: clamp(1.7rem, 7vw, 2.25rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
  margin: 0 0 0.4rem;
}
.login-panel .sub {
  margin: 0 0 1.35rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.login-panel form label { margin-top: 0.95rem; }
.login-panel button {
  width: 100%;
  margin-top: 1.35rem;
}

/* —— Tablet+ —— */
@media (min-width: 640px) {
  :root {
    --pad: 1.25rem;
    --pad-r: 1.25rem;
    --content: min(100% - 2.5rem, 34rem);
  }

  .topbar nav a {
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
  }

  .meta {
    grid-template-columns: repeat(4, 1fr);
  }
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
  .row-actions form { flex: 0 0 auto; }
  .row-actions > button,
  .row-actions form button { width: auto; min-width: 7.5rem; }
  .section-watcher .row-actions form { flex: 1 1 100%; width: 100%; }
  .section-watcher .row-actions > button,
  .section-watcher .row-actions form button {
    width: 100%;
    min-width: 0;
  }

}

/* —— Large screens: centered column, airy —— */
@media (min-width: 960px) {
  :root {
    --content: min(40vw, 38rem);
    --pad: 1.5rem;
    --pad-r: 1.5rem;
  }

  main { padding-top: 1.5rem; }
  .section { padding: 1.25rem 1.35rem; }
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
