:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #65727e;
  --border: #d9e0e6;
  --surface: #ffffff;
  --canvas: #f4f6f8;
  --brand: #173f7a;
  --brand-hover: #0d2d5b;
  --danger: #ad2d2d;
  --focus: #f3a712;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: #1456a0; }
a:hover { color: #0b376b; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.shell { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { color: var(--ink); font-size: 1.1rem; font-weight: 700; text-decoration: none; }
.account { display: flex; align-items: center; gap: 16px; color: var(--muted); }
.account form { margin: 0; }
.main-content { padding-block: 40px 64px; }

h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.2; }
.eyebrow { margin: 0 0 6px; color: var(--brand); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.muted, .help { color: var(--muted); }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.narrow-page { max-width: 700px; margin-inline: auto; }

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
}
.button-primary { background: var(--brand); color: #fff; }
.button-primary:hover { background: var(--brand-hover); color: #fff; }
.button-secondary { background: #fff; border-color: var(--border); color: var(--ink); }
.button-danger { background: var(--danger); color: #fff; }
.button-small { min-height: 34px; padding: 5px 10px; font-size: .9rem; }
.button-full { width: 100%; }

.table-card, .form-card, .auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgb(23 32 42 / 5%);
}
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: #49545e; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.short-id { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 700; }
.destination { min-width: 300px; max-width: 520px; overflow-wrap: anywhere; }
.actions { display: flex; justify-content: flex-end; gap: 14px; white-space: nowrap; }
.danger-link { color: var(--danger); }
.empty-state { padding: 42px 16px; color: var(--muted); text-align: center; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge-success { background: #e0f4e9; color: #1b6840; }
.badge-warning { background: #fff0d2; color: #815300; }
.badge-muted { background: #e9edf1; color: #4e5964; }
.pagination { display: flex; justify-content: space-between; gap: 16px; padding: 14px 16px; border-top: 1px solid var(--border); color: var(--muted); }
.pagination div { display: flex; gap: 14px; }

.auth-card { max-width: 430px; margin: 7vh auto 0; padding: 32px; }
.form-card { margin-top: 24px; padding: 28px; }
.stacked-form { display: grid; gap: 20px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; }
.field input[type="text"], .field input[type="password"], .field input[type="url"], .field input[type="datetime-local"] {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #adb7c0;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.checkbox-field { display: flex; align-items: start; gap: 10px; }
.checkbox-field input { width: 20px; height: 20px; margin-top: 3px; }
.help { margin: 0; font-size: .9rem; }
.errorlist, .form-errors { margin: 0; color: #8b1e1e; }
.form-errors { padding: 10px 12px; border-radius: 5px; background: #fce8e8; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.destination-break { overflow-wrap: anywhere; color: var(--muted); }
.warning-text { color: #793030; font-weight: 650; }
.message { margin: 0 0 20px; padding: 11px 14px; border: 1px solid #b8ddc6; border-radius: 6px; background: #e8f6ed; color: #195d38; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 680px) {
  .shell { width: min(100% - 22px, 1180px); }
  .header-inner, .page-heading { align-items: flex-start; flex-direction: column; }
  .header-inner { padding-block: 13px; }
  .account { width: 100%; justify-content: space-between; }
  .main-content { padding-block: 28px 48px; }
  .page-heading .button { width: 100%; }
  .auth-card, .form-card { padding: 22px; }
}
