/* Aetherlite Ops. Brand kit v1.1: Daintree #03282A, Abstract Teal #255859,
   Calming Blue-Green #3F807C, Flour #E9E5D8, White. Montserrat headings, Inter body. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('../fonts/montserrat-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('../fonts/montserrat-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --daintree: #03282a;
  --teal: #255859;
  --sea: #3f807c;
  --flour: #e9e5d8;

  --bg: #f5f3ed;
  --surface: #ffffff;
  --band: #ece7da;
  --tile: #e9e5d8;
  --line: #e2ddd0;
  --line-strong: #cfc7b5;
  --text: #102627;
  --text-2: #475959;
  --text-3: #5c6c6b;
  --heading: #03282a;
  --accent: #255859;
  --accent-hover: #1c4748;
  --accent-ink: #ffffff;
  --accent-text: #255859;
  --focus: #3f807c;
  --alert: #a3281d;
  --hover: rgba(3, 40, 42, 0.04);

  --ok-bg: #dcebe6;
  --ok-fg: #1d5551;
  --hold-bg: #f4e6c3;
  --hold-fg: #6e4c08;
  --need-bg: #f7deda;
  --need-fg: #94281e;
  --off-bg: #e8e5dd;
  --off-fg: #56625f;
  --bar-ok: #3f807c;
  --bar-hold: #d9a93f;
  --bar-need: #c4513f;
  --bar-off: #b9b3a5;

  --header-bg: #03282a;
  --header-text: #ffffff;
  --header-muted: rgba(255, 255, 255, 0.68);

  --shadow: 0 1px 2px rgba(3, 40, 42, 0.05), 0 6px 20px -8px rgba(3, 40, 42, 0.1);
  --radius: 14px;
  --radius-sm: 8px;
  --display: 'Montserrat', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #061a1b;
    --surface: #0b2526;
    --band: #0f2f30;
    --tile: #123738;
    --line: #1b3e3f;
    --line-strong: #2a5354;
    --text: #e5eeec;
    --text-2: #b2c5c2;
    --text-3: #95aba8;
    --heading: #f3f7f6;
    --accent: #7fc3ba;
    --accent-hover: #9ad3cb;
    --accent-ink: #052021;
    --accent-text: #8fd0c7;
    --focus: #7fc3ba;
    --alert: #f2a196;
    --hover: rgba(255, 255, 255, 0.04);
    --ok-bg: rgba(127, 195, 186, 0.15);
    --ok-fg: #a8ded6;
    --hold-bg: rgba(233, 190, 98, 0.15);
    --hold-fg: #eecb7f;
    --need-bg: rgba(242, 161, 150, 0.15);
    --need-fg: #f4ada3;
    --off-bg: rgba(255, 255, 255, 0.08);
    --off-fg: #a8b8b6;
    --bar-ok: #6fb5ac;
    --bar-hold: #d9b45a;
    --bar-need: #e07a6a;
    --bar-off: #4d6463;
    --header-bg: #03282a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent; /* buttons and cards have their own pressed states */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--body);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3 {
  font-family: var(--display);
  color: var(--heading);
  margin: 0;
  letter-spacing: -0.01em;
}

a {
  color: var(--accent-text);
}

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

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.icon {
  flex: none;
  vertical-align: -0.2em;
}

.num {
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--text-2);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .wrap {
    padding: 0 32px;
  }
}

/* ---------- Header ---------- */

.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  font: 800 15px/1 var(--display);
  letter-spacing: 0.26em;
}

.brand-sub {
  font: 600 10px/1 var(--display);
  letter-spacing: 0.32em;
  color: var(--header-muted);
}

.nav {
  display: flex;
  gap: 4px;
  margin-right: auto;
}

.nav a {
  color: var(--header-muted);
  text-decoration: none;
  font-weight: 500;
  padding: 18px 10px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.nav a:hover {
  color: #fff;
}

.nav a[aria-current='page'] {
  color: #fff;
  border-bottom-color: #7fc3ba;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sync {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: var(--header-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.sync:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d9a93f;
}

.sync.is-live .sync-dot {
  background: #7fc3ba;
  box-shadow: 0 0 0 3px rgba(127, 195, 186, 0.22);
}

.account {
  position: relative;
}

.account summary {
  list-style: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--flour);
  color: var(--daintree);
  display: grid;
  place-items: center;
  font: 700 13px/1 var(--display);
  cursor: pointer;
}

.account summary::-webkit-details-marker {
  display: none;
}

.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 240px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px -8px rgba(3, 40, 42, 0.3);
  padding: 12px;
}

.account-menu .who {
  font-weight: 600;
}

.account-menu .email {
  color: var(--text-2);
  font-size: 13px;
  margin-bottom: 10px;
  word-break: break-all;
}

@media (max-width: 767px) {
  .site-header .wrap {
    flex-wrap: wrap;
    gap: 0 12px;
    min-height: 0;
    padding-top: 12px;
  }
  .brand {
    margin-right: auto;
  }
  .brand-sub {
    display: none;
  }
  .nav {
    order: 3;
    width: 100%;
    margin: 4px 0 0 -10px;
  }
  .nav a {
    padding: 10px 10px 12px;
  }
  .sync-label {
    display: none;
  }
  .sync {
    padding: 0 10px;
  }
}

/* ---------- Page ---------- */

main {
  flex: 1;
  padding-bottom: 64px;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  padding: 32px 0 24px;
}

.eyebrow {
  font: 700 12px/1.2 var(--display);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 8px;
}

.page-title {
  font-size: clamp(26px, 4.2vw, 38px);
  font-weight: 700;
  line-height: 1.12;
}

.page-sub {
  margin: 8px 0 0;
  color: var(--text-2);
  font-size: 16px;
}

.crumbs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
  margin-bottom: 12px;
}

.crumbs:hover {
  color: var(--accent-text);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--hold-bg);
  color: var(--hold-fg);
  font-size: 14px;
}

.banner.is-error {
  background: var(--need-bg);
  color: var(--need-fg);
}

/* ---------- Buttons and inputs ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  background: var(--hover);
  border-color: var(--text-3);
}

.btn:active,
.show-card:active {
  transform: translateY(1px);
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-quiet {
  border-color: transparent;
  background: transparent;
}

.btn-block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.field .hint {
  font-weight: 400;
  color: var(--text-2);
  font-size: 13px;
}

.input,
.select,
textarea.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 16px;
  font-weight: 400;
}

textarea.input {
  min-height: 84px;
  resize: vertical;
  line-height: 1.45;
}

.select {
  appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  min-height: 44px;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  background: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.switch-track {
  position: relative;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background 0.15s;
}

.switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s;
}

.switch[aria-checked='true'] .switch-track {
  background: var(--accent);
}

.switch[aria-checked='true'] .switch-track::after {
  transform: translateX(16px);
}

/* ---------- Pills ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  background: var(--off-bg);
  color: var(--off-fg);
}

.pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill.is-ok {
  background: var(--ok-bg);
  color: var(--ok-fg);
}

.pill.is-hold {
  background: var(--hold-bg);
  color: var(--hold-fg);
}

.pill.is-need {
  background: var(--need-bg);
  color: var(--need-fg);
}

.open-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--alert);
  font-weight: 600;
}

/* ---------- Sign in ---------- */

.auth {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 48px 16px;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(63, 128, 124, 0.45), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(37, 88, 89, 0.55), transparent 60%),
    var(--daintree);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: 18px;
  padding: 36px 32px 28px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5);
}

.auth-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
  color: var(--heading);
}

.auth-brand .brand-mark {
  font-size: 18px;
}

.auth-brand .brand-sub {
  color: var(--text-2);
}

.auth h1 {
  font-size: 24px;
  font-weight: 700;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.form-error {
  margin: 0;
  color: var(--alert);
  font-size: 14px;
  font-weight: 500;
}

.form-error:empty {
  display: none;
}

.auth-links {
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-2);
}

.auth-foot {
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  text-align: center;
}

/* ---------- Loading and empty ---------- */

.state {
  padding: 72px 0;
  text-align: center;
  color: var(--text-2);
}

.state h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.state p {
  max-width: 46ch;
  margin: 0 auto 20px;
}

.spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 16px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Shows ---------- */

.show-list {
  display: grid;
  gap: 16px;
}

.show-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px 24px;
  align-items: center;
  padding: 20px 24px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}

.show-card:hover {
  border-color: var(--line-strong);
}

.show-card.is-past {
  opacity: 0.72;
}

.date-tile {
  width: 76px;
  padding: 10px 0 9px;
  border-radius: 12px;
  background: var(--tile);
  text-align: center;
  color: var(--heading);
}

.date-tile .m,
.date-tile .w {
  display: block;
  font: 700 11px/1.2 var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.date-tile .d {
  display: block;
  font: 800 30px/1.05 var(--display);
  font-variant-numeric: tabular-nums;
  margin: 2px 0;
}

.date-tile.is-tbd .d {
  font-size: 18px;
  line-height: 34px;
  letter-spacing: 0.08em;
}

.show-main {
  min-width: 0;
}

.show-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 6px;
}

.countdown {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.show-name {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}

.show-meta {
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 14px;
}

.show-next {
  margin: 10px 0 0;
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.show-next strong {
  font-weight: 600;
}

.show-next .soon {
  color: var(--alert);
  font-weight: 600;
}

.show-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, auto));
  gap: 4px 20px;
  text-align: right;
}

.stat dt {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat dd {
  margin: 2px 0 0;
  font: 700 20px/1.2 var(--display);
  color: var(--heading);
  font-variant-numeric: tabular-nums;
}

.stat dd small {
  display: block;
  font: 500 12.5px/1.3 var(--body);
  color: var(--text-2);
}

.show-go {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-weight: 600;
  color: var(--accent-text);
}

@media (max-width: 899px) {
  .show-card {
    grid-template-columns: auto 1fr;
    padding: 18px;
    gap: 16px;
  }
  .show-stats {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, 1fr);
    text-align: left;
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }
  .show-go {
    padding-top: 12px;
  }
}

@media (max-width: 480px) {
  .date-tile {
    width: 64px;
  }
  .date-tile .d {
    font-size: 26px;
  }
  .show-name {
    font-size: 18px;
  }
  .stat dd {
    font-size: 18px;
  }
}

/* ---------- Call sheet ---------- */

.sheet-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.sheet-tools .select {
  width: auto;
  max-width: min(26rem, 100%);
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.fact {
  padding: 18px 20px;
  border-left: 1px solid var(--line);
  min-width: 0;
}

.fact:first-child {
  border-left: 0;
}

.fact dt {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
}

.fact dd {
  margin: 6px 0 0;
  font: 700 24px/1.15 var(--display);
  color: var(--heading);
  font-variant-numeric: tabular-nums;
}

.fact dd .open-label {
  font: 700 18px/1.3 var(--display);
}

.fact small {
  display: block;
  margin-top: 4px;
  font: 500 13px/1.35 var(--body);
  color: var(--text-2);
}

.status-strip {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding: 14px 20px 16px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}

.status-bar {
  display: flex;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--line);
  gap: 2px;
}

.status-bar span {
  display: block;
  min-width: 4px;
}

.seg-ok {
  background: var(--bar-ok);
}

.seg-hold {
  background: var(--bar-hold);
}

.seg-need {
  background: var(--bar-need);
}

.seg-off {
  background: var(--bar-off);
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
}

.legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend b {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 767px) {
  .facts {
    grid-template-columns: 1fr 1fr;
  }
  .fact:nth-child(3) {
    border-left: 0;
  }
  .fact:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
  .fact {
    padding: 14px 16px;
  }
  .fact dd {
    font-size: 20px;
  }
  .status-strip {
    padding: 12px 16px 14px;
  }
}

.day {
  margin-top: 28px;
  overflow: hidden;
}

.day-head {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px 20px;
  background: var(--band);
  border-bottom: 1px solid var(--line);
}

.day-head .date-tile {
  width: 60px;
  padding: 6px 0;
  background: var(--surface);
}

.day-head .date-tile .d {
  font-size: 24px;
}

.day-title {
  flex: 1;
  min-width: 0;
}

.day-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}

.day-title h2 {
  font-size: 18px;
  font-weight: 700;
}

.day-type {
  color: var(--accent-text);
  font-weight: 600;
}

.day-window {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.day-window .muted {
  font-weight: 500;
  margin-left: 12px;
}

.day-notes {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text-2);
}

.day.is-undated .day-head {
  background: transparent;
  border-bottom-style: dashed;
}

.calls {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14.5px;
}

.calls th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--line);
}

.calls td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.calls tr:last-child td {
  border-bottom: 0;
}

.calls th:first-child,
.calls td:first-child {
  padding-left: 20px;
}

.calls th:last-child,
.calls td:last-child {
  padding-right: 20px;
}

.calls .c-time {
  width: 11.5rem;
}

.calls .c-pos {
  width: 6.5rem;
}

.calls .c-status {
  width: 8.5rem;
}

.calls .c-rate {
  width: 8rem;
  text-align: right;
}

.calls tbody tr {
  cursor: pointer;
}

.calls tbody tr:hover td {
  background: var(--hover);
}

.calls tr.is-released td {
  color: var(--text-3);
}

.calls tr.is-released .who {
  text-decoration: line-through;
}

.pos {
  font: 700 14px/1.4 var(--display);
  color: var(--heading);
}

.who {
  font-weight: 600;
  color: var(--text);
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.who:hover {
  text-decoration: underline;
}

.sub {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
}

.sub a {
  color: inherit;
}

.note {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
}

.note .icon {
  margin-top: 2px;
}

.time-travel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-weight: 500;
}

.time-none {
  color: var(--text-3);
}

.call-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
}

.call-item {
  border-bottom: 1px solid var(--line);
}

.call-item:last-child {
  border-bottom: 0;
}

.call-item button {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  width: 100%;
  padding: 14px 16px;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  font-size: 14.5px;
}

.call-item button:active {
  background: var(--hover);
}

.call-item .ci-top {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
  flex-wrap: wrap;
}

.call-item .ci-time {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}

.call-item .ci-duty {
  grid-column: 1 / -1;
  color: var(--text-2);
  font-size: 13.5px;
}

.call-item .ci-foot {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.call-item .ci-rate {
  margin-left: auto;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}

.call-item .ci-note {
  grid-column: 1 / -1;
  margin-top: 0;
}

.call-item.is-released .ci-name {
  text-decoration: line-through;
  color: var(--text-3);
}

@media (max-width: 767px) {
  .calls {
    display: none;
  }
  .call-list {
    display: block;
  }
  .day-head {
    padding: 12px 16px;
    gap: 12px;
  }
  .day-head .date-tile {
    width: 52px;
  }
  .day-title h2 {
    font-size: 16px;
  }
  .day-window .muted {
    margin-left: 8px;
  }
}

.section-title {
  margin: 44px 0 12px;
  font-size: 22px;
  font-weight: 700;
}

.lines {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

.lines th,
.lines td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.lines thead th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
}

.lines th:first-child,
.lines td:first-child {
  padding-left: 20px;
}

.lines th:last-child,
.lines td:last-child {
  padding-right: 20px;
}

.lines .r {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.lines tbody td:first-child {
  font-weight: 600;
}

.lines tfoot th,
.lines tfoot td {
  border-bottom: 0;
  font-weight: 600;
}

.lines tfoot tr:first-child th,
.lines tfoot tr:first-child td {
  border-top: 2px solid var(--line-strong);
}

.lines tfoot .grand th,
.lines tfoot .grand td {
  border-top: 2px solid var(--accent);
  font: 700 17px/1.3 var(--display);
  color: var(--heading);
  padding-top: 14px;
  padding-bottom: 14px;
}

.lines-scroll {
  overflow-x: auto;
}

@media (max-width: 767px) {
  .lines th:first-child,
  .lines td:first-child {
    padding-left: 16px;
  }
  .lines th:last-child,
  .lines td:last-child {
    padding-right: 16px;
  }
  .lines .hide-sm {
    display: none;
  }
}

.foot-note {
  margin: 20px 0 0;
  font-size: 14px;
  color: var(--text-2);
}

/* ---------- Edit dialog ---------- */

dialog.sheet {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.45);
}

dialog.sheet::backdrop {
  background: rgba(3, 26, 27, 0.55);
}

.dlg-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 4px;
}

.dlg-head h2 {
  font-size: 20px;
  font-weight: 700;
}

.dlg-head p {
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 14px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: -6px -10px 0 0;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--hover);
  color: var(--text);
}

.dlg-body {
  display: grid;
  gap: 18px;
  padding: 18px 24px;
}

.status-choices {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  border: 0;
  margin: 0;
  padding: 0;
}

.status-choices legend {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  padding: 0;
}

.status-choices label {
  position: relative;
}

.status-choices input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.status-choices span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.status-choices span::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bar-off);
}

.status-choices .s-ok span::before {
  background: var(--bar-ok);
}

.status-choices .s-hold span::before {
  background: var(--bar-hold);
}

.status-choices .s-need span::before {
  background: var(--bar-need);
}

.status-choices input:checked + span {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: var(--hover);
}

.status-choices input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.two-up {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dlg-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--line);
}

.dlg-foot .actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.dlg-foot a {
  font-size: 14px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

@media (max-width: 560px) {
  dialog.sheet {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
    max-height: 92vh;
  }
  .status-choices {
    grid-template-columns: 1fr 1fr;
  }
  .dlg-head,
  .dlg-body,
  .dlg-foot {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ---------- Toasts and footer ---------- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 50;
  display: grid;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 32px);
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--daintree);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.4);
  animation: rise 0.18s ease-out;
}

.toast.is-error {
  background: #7b1f16;
}

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

.site-footer {
  padding: 20px 0 28px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 13px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  justify-content: space-between;
}

.site-footer .warn {
  color: var(--alert);
  font-weight: 600;
}

.print-head {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Print: a clean black-on-white call sheet ---------- */

@media print {
  :root {
    --bg: #fff;
    --surface: #fff;
    --band: #f1efe8;
    --tile: #f1efe8;
    --line: #d9d4c7;
    --line-strong: #a9a291;
    --text: #000;
    --text-2: #333;
    --text-3: #555;
    --heading: #000;
    --accent-text: #255859;
    --shadow: none;
    color-scheme: light;
  }
  @page {
    margin: 12mm;
  }
  body {
    font-size: 11pt;
    background: #fff;
  }
  .site-header,
  .site-footer,
  .sheet-tools,
  .crumbs,
  .toasts,
  .foot-note,
  .banner {
    display: none !important;
  }
  .print-head {
    display: flex;
    justify-content: space-between;
    font: 700 9pt/1.2 var(--display);
    letter-spacing: 0.2em;
    padding-bottom: 6pt;
    border-bottom: 1.5pt solid #000;
  }
  .wrap {
    max-width: none;
    padding: 0;
  }
  .page-head {
    padding: 12pt 0 10pt;
  }
  .card {
    border-color: var(--line);
    box-shadow: none;
    break-inside: avoid;
  }
  .day {
    margin-top: 12pt;
  }
  .calls {
    display: table !important;
  }
  .call-list {
    display: none !important;
  }
  .calls tbody tr {
    break-inside: avoid;
  }
  .pill {
    border: 1px solid currentColor;
    background: none !important;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
}

/* ---------- Layout states and small pieces ---------- */

.site-header:empty,
.site-footer:empty {
  display: none;
}

body.is-auth {
  background: var(--daintree);
}

body.is-auth main {
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

[tabindex='-1']:focus {
  outline: none;
}

.show-card {
  position: relative;
}

.show-name a {
  color: inherit;
  text-decoration: none;
}

.show-card:hover .show-name a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.stretched::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.stretched:focus-visible {
  outline: none;
}

.stretched:focus-visible::after {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.summary {
  overflow: hidden;
}

.status-strip .status-bar {
  margin-bottom: 4px;
}

.calls tr.is-open td:first-child {
  box-shadow: inset 3px 0 0 var(--bar-need);
}

.next-day {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  vertical-align: super;
}

.dlg-body > .hint {
  margin: -8px 0 0;
  font-size: 13px;
  color: var(--text-2);
}

.status-choices[disabled] span,
.input[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.dlg-head a {
  color: inherit;
}

.toast-btn {
  margin-left: 4px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: transparent;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.toast-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.site-footer a {
  color: inherit;
}

.sync[disabled] {
  cursor: progress;
  opacity: 0.75;
}

@media print {
  body,
  .calls,
  .lines {
    font-size: 9.5pt;
  }
  .page-title {
    font-size: 20pt;
  }
  .page-sub {
    font-size: 10pt;
  }
  .fact {
    padding: 8pt 10pt;
  }
  .fact dd {
    font-size: 15pt;
  }
  .status-strip {
    padding: 6pt 10pt 8pt;
    font-size: 9pt;
  }
  .day {
    break-inside: auto;
  }
  .day-head {
    padding: 6pt 10pt;
    gap: 10pt;
  }
  .day-head .date-tile {
    width: 40px;
    padding: 2px 0;
  }
  .day-head .date-tile .d {
    font-size: 15px;
  }
  .day-title h2 {
    font-size: 12pt;
  }
  .calls th,
  .calls td,
  .lines th,
  .lines td {
    padding: 4pt 6pt;
  }
  .calls th:first-child,
  .calls td:first-child,
  .lines th:first-child,
  .lines td:first-child {
    padding-left: 10pt;
  }
  .calls th:last-child,
  .calls td:last-child,
  .lines th:last-child,
  .lines td:last-child {
    padding-right: 10pt;
  }
  .calls .c-time {
    width: 10.5rem;
    white-space: nowrap;
  }
  .calls .c-pos {
    width: 6.5rem;
  }
  .calls .c-status {
    width: 6.5rem;
  }
  .calls .c-rate {
    width: 5.5rem;
  }
  .sub,
  .note {
    font-size: 8.5pt;
    margin-top: 0;
  }
  .pill {
    font-size: 8pt;
    padding: 0 6px;
  }
  .section-title {
    margin: 14pt 0 6pt;
    font-size: 13pt;
    break-after: avoid;
  }
  .lines tfoot .grand th,
  .lines tfoot .grand td {
    font-size: 11pt;
    padding-top: 6pt;
    padding-bottom: 6pt;
  }
  .day-head {
    break-after: avoid;
  }
  .calls tr.is-open td:first-child {
    box-shadow: none;
  }
  .lines-scroll {
    overflow: visible;
  }
}
