/* Local Exposure leave planner.
   Clean, neutral app UI. Phones get an app bar and a bottom tab bar; from
   1024px a fixed sidebar takes over. One accent colour (LE orange-red) marks
   the primary action, today, and anything waiting on you. */

:root {
  /* Local Exposure brand, from localexposure.co.uk (Elementor globals). */
  --navy: #05091b;
  --bg: #05091b;
  --surface: #0b1127;
  --surface-2: #111a35;
  --line: rgba(203, 213, 225, .10);
  --line-2: rgba(203, 213, 225, .18);
  --text: #ffffff;
  --text-2: #cbd5e1;
  --text-3: #8391a7;
  --accent: #0ea5e9;
  --accent-hover: #38bdf8;
  --accent-soft: rgba(14, 165, 233, .14);
  --purple: #6b0ee9;
  --green: #4ee90e;
  --glow: linear-gradient(135deg, #0ea5e9 0%, #6b0ee9 100%);
  --ok: #4ee90e;
  --ok-soft: rgba(78, 233, 14, .12);
  --err: #ff7a7a;
  --err-soft: rgba(255, 92, 92, .12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .12);
  --closed: repeating-linear-gradient(135deg, rgba(203, 213, 225, .07) 0 1.5px, transparent 1.5px 6px), #080d22;
  --shadow-sm: none;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .02), 0 18px 40px -24px rgba(0, 0, 0, .8);
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Sora', 'Segoe UI', system-ui, sans-serif;
  --mono: 'Sora', ui-monospace, monospace;
  --sidebar: 252px;
  --tabbar: 64px;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text-2); min-height: 100vh;
  background:
    radial-gradient(60rem 30rem at 15% -10%, rgba(14, 165, 233, .14), transparent 60%),
    radial-gradient(50rem 28rem at 95% -5%, rgba(107, 14, 233, .16), transparent 60%),
    var(--bg) fixed;
  font: 400 16px/1.55 var(--font); letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
p a, td a { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
p a:hover, td a:hover { text-decoration-color: var(--accent); }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.02em; font-weight: 650; color: var(--text); }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; margin-top: 1.5em; }
p { margin: 0 0 .9em; }
.mono { font-family: var(--mono); font-size: .88em; font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.small { font-size: .86rem; }
.thin { font-weight: 400; color: var(--text-3); }
.r { text-align: right; }
.grow { flex: 1; min-width: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--text); color: var(--bg); padding: .5rem .8rem; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- shell: phones and tablets ---------- */
.sidebar { display: none; }
.appbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(.55rem + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) .55rem max(16px, env(safe-area-inset-left));
  background: rgba(5, 9, 27, .78);
  backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid var(--line);
}
.appbar-actions { display: flex; gap: .25rem; }
.appbar-actions form { margin: 0; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 650; letter-spacing: -.02em; }
.brand:hover { color: inherit; }
.brand-logo { display: block; height: 26px; width: auto; }
.side-app { margin: -.6rem .5rem .6rem; font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.brand-mark { display: block; width: 32px; height: 32px; }
.brand-name { display: grid; line-height: 1.1; font-size: 1.05rem; }
.brand-name small { font-size: .72rem; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: transparent; border: 0; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover, .icon-btn.on { background: var(--surface-2); color: var(--text); }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding: 0 max(6px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(6px, env(safe-area-inset-left));
  background: rgba(8, 13, 34, .86);
  backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  position: relative; display: grid; justify-items: center; gap: 2px;
  padding: 6px 0; font-size: .68rem; font-weight: 550; color: var(--text-3);
}
.tabbar a.on { color: var(--text); }
.tabbar a.on .icon { color: var(--accent); }
.tabbar .tab-book .icon {
  width: 46px; height: 32px; padding: 5px 0; border-radius: 999px;
  background: var(--glow); color: #fff !important; stroke-width: 2.2;
  box-shadow: 0 0 18px -4px rgba(14, 165, 233, .7);
}
.tabbar .count { position: absolute; top: 2px; left: calc(50% + 6px); }
.main {
  max-width: 1120px; margin: 0 auto;
  padding: 1.25rem max(16px, env(safe-area-inset-right)) calc(var(--tabbar) + 2rem + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
body.bare .main { padding-bottom: 3rem; }

/* ---------- shell: desktop ---------- */
@media (min-width: 1024px) {
  .appbar, .tabbar { display: none; }
  .shell .sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 30;
    display: flex; flex-direction: column; gap: .25rem;
    padding: 1.1rem .8rem 1rem; overflow-y: auto;
    background: rgba(5, 9, 27, .92); border-right: 1px solid var(--line);
  }
  .sidebar .brand { padding: .2rem .5rem 1.1rem; }
  .side-label { margin: 1.1rem .7rem .35rem; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
  .side-nav { display: grid; gap: 2px; }
  .side-nav a {
    display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 10px;
    font-size: .94rem; font-weight: 500; color: var(--text-2);
  }
  .side-nav a .icon { width: 20px; height: 20px; color: var(--text-3); }
  .side-nav a:hover { background: var(--surface-2); color: var(--text); }
  .side-nav a.on { background: linear-gradient(90deg, rgba(14, 165, 233, .16), rgba(107, 14, 233, .10)); color: var(--text); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); }
  .side-nav a.on .icon { color: var(--accent); }
  .side-nav .count { margin-left: auto; }
  .side-user {
    margin: auto 0 0; display: flex; align-items: center; gap: .65rem;
    padding: .7rem .5rem 0; border-top: 1px solid var(--line);
  }
  .side-user-name { flex: 1; min-width: 0; display: grid; font-size: .9rem; font-weight: 600; line-height: 1.2; }
  .side-user-name small { font-weight: 400; color: var(--text-3); font-size: .78rem; }
  .shell .main { margin-left: var(--sidebar); max-width: none; padding: 2rem clamp(1.5rem, 4vw, 3.5rem) 4rem; }
  .shell .main > * { max-width: 1120px; margin-left: auto; margin-right: auto; }
  .shell .main.wide > * { max-width: 1600px; }
}
.avatar {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: .78rem; font-weight: 700;
}
.count {
  display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: var(--navy); font-size: .7rem; font-weight: 700; line-height: 1;
}

/* ---------- page furniture ---------- */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: .25rem 0 1.5rem; }
.eyebrow { margin: 0 0 .35rem; font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.eyebrow a:hover { color: var(--accent); }
.display { margin: 0; font-size: clamp(1.75rem, 4.2vw, 2.5rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.12; color: var(--text); }
.display .thin { background: var(--glow); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 600; }
.card {
  background: linear-gradient(180deg, rgba(17, 26, 53, .72), rgba(11, 17, 39, .72));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1rem, 2.5vw, 1.5rem); margin-bottom: 1.25rem; box-shadow: var(--shadow);
}
.card.narrow { max-width: 680px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }
.grid-2 > .card, .stack > .card { margin-bottom: 0; }
.stack { display: grid; gap: 1rem; }
.flash {
  padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; font-size: .95rem;
  border: 1px solid transparent;
}
.flash-ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.flash-error { background: var(--err-soft); color: var(--err); border-color: color-mix(in srgb, var(--err) 25%, transparent); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .55rem 1.15rem; border-radius: 12px;
  font: 600 .95rem var(--font); letter-spacing: -.01em; cursor: pointer;
  color: #fff; border: 1.5px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--glow) border-box;
  box-shadow: 0 0 22px -6px rgba(14, 165, 233, .55), 0 0 30px -10px rgba(107, 14, 233, .6);
  transition: box-shadow .2s ease, transform .1s ease;
}
.btn:hover { color: #fff; box-shadow: 0 0 28px -4px rgba(14, 165, 233, .7), 0 0 36px -8px rgba(107, 14, 233, .75); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--line-2); box-shadow: none; }
.btn-ghost:hover { background: #17213f; color: var(--text); box-shadow: none; }
.btn-small { min-height: 36px; padding: .35rem .85rem; font-size: .88rem; border-radius: 10px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.link-btn { background: none; border: 0; padding: .35rem .2rem; font: 500 .9rem var(--font); color: var(--text-2); cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.link-btn:hover { color: var(--err); text-decoration-color: currentColor; }
.year-nav { display: flex; gap: .35rem; flex-wrap: wrap; }
.year-nav a {
  display: inline-flex; align-items: center; min-height: 38px; padding: .35rem .85rem; border-radius: 10px;
  font-size: .88rem; font-weight: 550; color: var(--text); background: var(--surface-2); border: 1px solid var(--line-2);
}
.year-nav a:hover { color: var(--text); background: var(--surface-2); }

/* ---------- forms ---------- */
label { display: grid; gap: .35rem; font-size: .88rem; font-weight: 600; color: var(--text); }
::placeholder { color: var(--text-3); }
input, select, textarea {
  width: 100%; min-height: 46px; padding: .6rem .8rem;
  font: 400 1rem var(--font); color: var(--text);
  background: #080d22; border: 1px solid var(--line-2); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238a92a1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .85rem center;
}
textarea { min-height: 96px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--text-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
input[type="color"] { width: 46px; padding: 4px; }
input[type="date"] { min-width: 0; color-scheme: dark; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 1rem; }
.checks { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.check { display: flex; align-items: center; gap: .6rem; min-height: 44px; font-weight: 500; }
.check input { width: 20px; height: 20px; min-height: 0; padding: 0; margin: 0; accent-color: var(--accent); box-shadow: none; }
.check.warn { padding: .3rem .8rem; border-radius: 10px; background: var(--warn-soft); color: var(--warn); }
.hint { margin: -.4rem 0 0; font-size: .84rem; font-weight: 400; color: var(--text-2); }
label .hint { margin: 0; }
fieldset.pattern { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .4rem; margin: 0; padding: .9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
fieldset.pattern legend { padding: 0 .35rem; font-size: .88rem; font-weight: 600; }
fieldset.pattern label { justify-items: center; font-size: .75rem; font-weight: 550; color: var(--text-2); }
fieldset.pattern select { min-height: 40px; padding: .4rem 1.4rem .4rem .5rem; text-align: center; background-position: right .45rem center; }
/* "Just tell me" booking box */
.tell { border-color: rgba(14, 165, 233, .35); box-shadow: 0 0 0 1px rgba(14, 165, 233, .08), 0 0 40px -18px rgba(14, 165, 233, .55); }
.tell-form label { font-size: 1.05rem; font-weight: 700; }
.tell-row { display: flex; gap: .6rem; }
.tell-row input { flex: 1; min-width: 0; font-size: 1.05rem; }
.tell-form .hint { margin: .5rem 0 0; }
.tell .flash { margin: 1rem 0 0; }
.understood { margin-top: 1.1rem; padding: 1rem 1.1rem; border-radius: 12px; background: rgba(14, 165, 233, .08); border: 1px solid rgba(14, 165, 233, .25); }
.understood-label { margin: 0 0 .25rem; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.understood-main { margin: 0 0 .2rem; font-size: 1.15rem; color: var(--text); }
.understood-days { margin: 0 0 .6rem; color: var(--text-2); }
.understood .clash { margin: .5rem 0; }
.understood-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .8rem; }
.form-title { margin-bottom: 1rem; }
@media (max-width: 639px) {
  .tell-row { flex-direction: column; }
  .understood-actions .btn { flex: 1; }
}
.preview { margin: 0; padding: .75rem .9rem; border-radius: 12px; background: var(--surface-2); font-size: .92rem; font-weight: 550; }
.preview:empty { display: none; }
.preview .bad { display: block; color: var(--err); font-weight: 500; }

/* ---------- sign in ---------- */
.auth { max-width: 400px; margin: min(12vh, 120px) auto 0; padding: 0 0 2rem; }
.auth::before {
  content: ''; display: block; width: 206px; height: 29px; margin-bottom: 2rem;
  background: url('/static/le-logo.svg') no-repeat left center / contain;
}
.auth .display { margin-bottom: 1.5rem; }
.btn-google { width: 100%; gap: .7rem; min-height: 50px; font-size: 1rem; }
.btn-google svg { background: #fff; border-radius: 50%; padding: 3px; width: 24px; height: 24px; }
.auth > .btn-google + p { margin-top: .6rem; }
.or { display: flex; align-items: center; gap: .8rem; margin: 1.4rem 0; color: var(--text-3); font-size: .85rem; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }

/* ---------- overview ---------- */
.balance-head { display: flex; align-items: center; gap: clamp(1rem, 4vw, 2rem); flex-wrap: wrap; }
.dial {
  --size: 148px;
  width: var(--size); height: var(--size); flex: none; border-radius: 50%;
  display: grid; place-content: center; text-align: center;
  background:
    radial-gradient(closest-side, #0b1127 82%, transparent 83% 100%),
    conic-gradient(from 0deg, #0ea5e9, #6b0ee9 calc(var(--p) * 1turn), rgba(203, 213, 225, .08) 0);
  filter: drop-shadow(0 0 18px rgba(14, 165, 233, .25));
}
.dial-num { color: var(--text); font-size: 2.5rem; font-weight: 700; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.dial-unit { margin-top: .2rem; font-size: .75rem; font-weight: 550; color: var(--text-3); }
.ledger { margin: 0; flex: 1 1 200px; display: grid; }
.ledger div { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.ledger div:last-child { border-bottom: 0; }
.ledger dt { color: var(--text-2); font-size: .92rem; }
.ledger dd { margin: 0; font-family: var(--mono); font-weight: 500; }
.summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; color: var(--text-2); }
.summary strong { font-size: 2rem; font-weight: 650; letter-spacing: -.03em; color: var(--text); }

.fortnight { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day {
  min-height: 96px; min-width: 0; padding: .55rem; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(8, 13, 34, .7); display: flex; flex-direction: column; gap: .3rem;
}
.day.weekend { background: var(--closed); border-color: transparent; }
.day.is-today { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.day-label { font-size: .82rem; font-weight: 600; white-space: nowrap; color: var(--text); }
.day-label .mono { font-family: var(--font); font-size: 1em; font-weight: 500; color: var(--text-3); }
.tag {
  --c: var(--text-3);
  display: block; padding: .2rem .45rem; border-radius: 6px; font-size: .76rem; font-weight: 550; line-height: 1.3;
  background: color-mix(in srgb, var(--c) 22%, transparent); color: color-mix(in srgb, var(--c) 45%, #fff);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tag-pending { background: transparent; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 55%, transparent); }
.tag-away { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
.tag-closed { background: var(--surface-2); color: var(--text-2); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: .7rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list form { margin: 0; }

/* ---------- pills, swatches, tables ---------- */
.pill {
  display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .55rem; border-radius: 999px;
  font-size: .74rem; font-weight: 600; text-transform: capitalize; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2);
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-approved { background: var(--ok-soft); color: var(--ok); }
.pill-pending { background: var(--warn-soft); color: var(--warn); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 4px; background: var(--c); vertical-align: -1px; flex: none; }
.swatch-pending { background: repeating-linear-gradient(135deg, var(--text-3) 0 2px, transparent 2px 4px); box-shadow: inset 0 0 0 1.5px var(--text-3); }
.swatch-closed { background: var(--closed); box-shadow: inset 0 0 0 1px var(--line-2); }
.swatch-away { background: color-mix(in srgb, var(--c) 15%, transparent); box-shadow: inset 0 0 0 2px var(--c); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -.25rem; padding: 0 .25rem; }
table { width: 100%; border-collapse: collapse; }
th { padding: .5rem .6rem; text-align: left; font-size: .76rem; font-weight: 600; color: var(--text-3); border-bottom: 1px solid var(--line); white-space: nowrap; }
th.r { text-align: right; }
td { padding: .75rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: .94rem; color: var(--text-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(14, 165, 233, .04); }
tr.dim td { color: var(--text-3); }
td form { margin: 0; }
input.num { width: 6rem; min-height: 40px; text-align: right; font-family: var(--mono); }

/* ---------- approvals ---------- */
.request .big { margin: 0 0 .5rem; font-size: clamp(1.2rem, 3vw, 1.45rem); font-weight: 650; letter-spacing: -.02em; }
blockquote { margin: .8rem 0; padding: .6rem .9rem; border-radius: 10px; background: var(--surface-2); color: var(--text-2); }
.clash { padding: .6rem .9rem; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: .92rem; }
.decide { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.decide label { flex: 1 1 260px; }

/* ---------- wall planner ---------- */
.planner-card { padding: .5rem 0 1rem; overflow: hidden; background: #0d1430; }
.planner-card .legend, .planner-card > p { padding: 0 1.25rem; }
.planner-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scrollbar-width: thin; }
.planner { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.planner th, .planner td { padding: 0; border: 0; }
.planner tbody tr:hover td { background: transparent; }
.planner thead th { position: sticky; top: 0; z-index: 2; background: #0d1430; }
.planner th.h { width: 36px; min-width: 36px; padding: .5rem 0 .55rem; text-align: center; border-bottom: 1px solid var(--line); }
.planner th.h span { display: block; }
.planner th.h .mono { font-family: var(--font); font-size: .66rem; font-weight: 500; color: var(--text-3); }
.planner th.h span:last-child { font-size: .9rem; font-weight: 600; color: var(--text); }
.planner th.wkend span:last-child, .planner th.closed span:last-child { color: var(--text-3); }
.planner th.today span:last-child { width: 26px; height: 26px; margin: 1px auto 0; line-height: 26px; border-radius: 50%; background: var(--accent); color: var(--navy); }
.planner .who-cell {
  position: sticky; left: 0; z-index: 3; background: #0d1430;
  min-width: 168px; max-width: 190px; padding: 0 .9rem 0 1.25rem; text-align: left;
  font-size: .9rem; font-weight: 550; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-right: 1px solid var(--line); box-shadow: 8px 0 14px -10px rgba(0, 0, 0, .7);
}
.planner thead .who-cell { z-index: 4; border-bottom: 1px solid var(--line); }
.planner td.d { position: relative; height: 44px; border-bottom: 1px solid var(--line); }
.planner td.d + td.d { border-left: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
.planner tbody tr:last-child td { border-bottom: 0; }
.planner td.wkend, .planner td.closed { background: var(--closed); }
.planner td.nonwork:not(.wkend):not(.closed) { background: var(--closed); opacity: .8; }
.planner td.today { box-shadow: inset 1.5px 0 0 var(--accent), inset -1.5px 0 0 var(--accent); }
/* Leave is one bar per run of days: square inside the run, rounded at its ends. */
.mark { --c: var(--text-3); position: absolute; inset: 10px -1px; display: block; background: var(--c); }
.mark.run-start { left: 4px; border-top-left-radius: 7px; border-bottom-left-radius: 7px; }
.mark.run-end { right: 4px; border-top-right-radius: 7px; border-bottom-right-radius: 7px; }
.mark.pending { background: repeating-linear-gradient(135deg, var(--c) 0 3px, color-mix(in srgb, var(--c) 25%, transparent) 3px 7px); }
/* WTA (working away): an outline, so it reads as "where they are", not "off". */
.mark.away { background: color-mix(in srgb, var(--c) 12%, transparent); box-shadow: inset 0 2px 0 var(--c), inset 0 -2px 0 var(--c); }
.mark.away.run-start { box-shadow: inset 0 2px 0 var(--c), inset 0 -2px 0 var(--c), inset 2px 0 0 var(--c); }
.mark.away.run-end { box-shadow: inset 0 2px 0 var(--c), inset 0 -2px 0 var(--c), inset -2px 0 0 var(--c); }
.mark.away.run-start.run-end { box-shadow: inset 0 0 0 2px var(--c); }
.mark.am { right: 50%; border-radius: 7px 0 0 7px; }
.mark.pm { left: 50%; border-radius: 0 7px 7px 0; }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 1rem; font-size: .85rem; color: var(--text-2); }
.legend > span { display: inline-flex; align-items: center; gap: .45rem; }

/* ---------- admin ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 1rem; }
.tile {
  display: flex; gap: .9rem; align-items: flex-start; padding: 1.1rem 1.2rem;
  background: linear-gradient(180deg, rgba(17, 26, 53, .72), rgba(11, 17, 39, .72));
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s, box-shadow .2s;
}
.tile:hover { color: inherit; border-color: rgba(14, 165, 233, .45); transform: translateY(-1px); box-shadow: 0 0 26px -10px rgba(14, 165, 233, .6); }
.tile .icon { padding: 8px; width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.tile span { display: grid; gap: .15rem; }
.tile small { color: var(--text-2); font-size: .86rem; }
.types { display: grid; }
.type-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.type-row input[name="name"] { flex: 1 1 200px; width: auto; }
.type-row .check { min-height: 36px; font-size: .88rem; }
.type-row input.num { width: 4.5rem; }
.type-row .rule { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 500; color: var(--text-2); }
.type-row .rule input.num { width: 4rem; min-height: 36px; padding: .3rem .5rem; }
.linkbox { display: flex; gap: .5rem; margin: .9rem 0 1rem; }
.linkbox input { font-family: var(--mono); font-size: .8rem; }

/* ---------- tablets ---------- */
@media (min-width: 640px) and (max-width: 1023px) {
  .main { max-width: 900px; }
}
/* The two-week view becomes a list below 900px: seven columns get too narrow for names. */
@media (max-width: 899px) {
  .fortnight { grid-template-columns: 1fr; gap: 0; }
  .day { flex-direction: row; flex-wrap: wrap; align-items: center; min-height: 48px; padding: .55rem 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
  .day:last-child { border-bottom: 0; }
  .day.weekend { display: none; }
  .day.is-today { box-shadow: none; }
  .day.is-today .day-label { color: var(--accent); }
  .day-label { width: 6.2rem; flex: none; }
  .tag { display: inline-block; font-size: .78rem; }
}
/* Desktop: let the planner's day columns share the space so a whole month fits. */
@media (min-width: 1024px) {
  .planner { width: 100%; }
  .planner th.h { width: auto; min-width: 28px; }
}

/* ---------- phones ---------- */
@media (max-width: 639px) {
  body { font-size: 15.5px; }
  .hero { margin-bottom: 1.1rem; }
  .hero > .btn { display: none; } /* the tab bar's Book button does this job */
  .card { border-radius: 14px; }
  .dial { --size: 120px; }
  .dial-num { font-size: 2rem; }
  fieldset.pattern { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .planner .who-cell { min-width: 104px; max-width: 116px; padding-left: .9rem; font-size: .82rem; }
  .planner th.h { width: 32px; min-width: 32px; }
  .planner-card .legend, .planner-card > p { padding: 0 1rem; }
  .decide .btn { flex: 1; }
  .linkbox { flex-direction: column; }
  /* Tables that make sense as cards on narrow screens. */
  .stacked thead { display: none; }
  .stacked tr { display: grid; grid-template-columns: 1fr auto; gap: .25rem .75rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .stacked tr:last-child { border-bottom: 0; }
  .stacked td { padding: 0; border: 0; }
  .stacked tbody tr:hover td { background: none; }
}

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