/* WESMUN 2027: deep teal and rose gold, from the conference crest.
   Fonts: Cinzel (WESMUN, headings, names), Varela Round (text, and labels in capitals).
   Both are served from this website (fonts/, SIL Open Font License), so no visitor's address goes to Google. */

@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(../fonts/cinzel-latin-ext-400-normal.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: 'Cinzel';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(../fonts/cinzel-latin-400-normal.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: 'Cinzel';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(../fonts/cinzel-latin-ext-600-normal.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: 'Cinzel';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(../fonts/cinzel-latin-600-normal.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: 'Cinzel';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(../fonts/cinzel-latin-ext-700-normal.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: 'Cinzel';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(../fonts/cinzel-latin-700-normal.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: 'Cinzel';
  font-style: normal;
  font-display: swap;
  font-weight: 800;
  src: url(../fonts/cinzel-latin-ext-800-normal.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: 'Cinzel';
  font-style: normal;
  font-display: swap;
  font-weight: 800;
  src: url(../fonts/cinzel-latin-800-normal.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: 'Varela Round';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(../fonts/varela-round-latin-ext-400-normal.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: 'Varela Round';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(../fonts/varela-round-latin-400-normal.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;
}

:root {
  /* WESMUN 2027 crest colours: deep teal and rose gold */
  --black: #0a2826;         /* page background */
  --coal: #0d302e;          /* header, alternate sections */
  --panel: #103634;         /* cards and panels */
  --panel-2: #154340;
  --card: #0b2a28;          /* team cards */
  --gold: #d8a77d;          /* rose gold */
  --gold-hi: #f6dcc2;       /* the light on the metal */
  --gold-lo: #a8744d;       /* the shadow on the metal */
  --gold-soft: rgba(216, 167, 125, 0.14);
  --metal: linear-gradient(180deg, #f6dcc2 0%, #e2b58c 38%, #b98157 62%, #e7c19d 100%);
  --ink: #0b2b29;           /* text on rose gold */
  --text: #f4e9dc;
  --muted: #a9bfb9;
  --line: #24504b;
  --danger: #e8727a;      /* rose red: warnings and "time is up" */
  --ok: #7fd6c2;          /* mint teal: "here", saved, success */
  --font: "Varela Round", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-mark: "Cinzel", "Trajan Pro", Georgia, "Times New Roman", serif;   /* the WESMUN wordmark, like the crest */
  --font-display: "Cinzel", "Trajan Pro", Georgia, "Times New Roman", serif; /* names and headings, like the crest */
  --font-label: "Varela Round", "Segoe UI", system-ui, Arial, sans-serif;     /* menu, roles, labels, buttons (in capitals) */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--black);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  /* keep the footer at the bottom of the window, even on short pages */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; width: 100%; }
body > main.wrap { width: min(1080px, 100% - 2.5rem); }
html { scroll-behavior: smooth; }
/* Lenis smooth scrolling on the home page (motion.js): it does the gliding, so the browser must not as well */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }
[data-lenis-prevent] { overscroll-behavior: contain; }
section[id] { scroll-margin-top: 1rem; }

h1, h2, h3 {
  font-family: var(--font);
  font-weight: 400;
  color: var(--gold);
  line-height: 1.2;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(1.7rem, 3.6vw, 2.3rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1em; max-width: 68ch; }
a { color: var(--gold); }
a:hover { color: var(--text); }
.muted { color: var(--muted); }
.wrap { width: min(1080px, 100% - 2.5rem); margin-inline: auto; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Small uppercase line above a heading, like "WELCOME MESSAGE" */
.kicker {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.4rem;
}

/* ---------- Header ---------- */
/* The header sticks to the top. It slides away when you scroll down and comes back when
   you scroll up or move the mouse to the top of the screen (see WES.autoHideHeader). */
.site-header {
  background: var(--coal);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease;
}
.site-header.is-hidden { transform: translateY(-105%); }
.site-header.is-floating { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem 2rem; flex-wrap: wrap; padding-block: 0.7rem; }
.brand { font-family: var(--font-mark); font-weight: 800; letter-spacing: 0.08em; font-size: 1.35rem; color: var(--gold); text-decoration: none; }
.brand:hover { color: var(--gold); }
#nav { display: flex; align-items: center; gap: 0.3rem 1.4rem; flex-wrap: wrap; }
#nav a, .link-btn {
  font-family: var(--font);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  padding: 0.3rem 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  cursor: pointer;
}
#nav a:hover, .link-btn:hover { color: var(--gold); }
#nav a[aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold); }
#nav a.nav-pill { border: 1px solid var(--gold); border-radius: 999px; padding: 0.25rem 0.85rem; color: var(--gold); }
#nav a.nav-pill:hover, #nav a.nav-pill[aria-current="page"] { background: var(--gold); color: var(--ink); }
.menu-btn { display: none; font: inherit; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; background: none; color: var(--gold); border: 1px solid var(--gold); border-radius: 999px; padding: 0.3rem 0.9rem; cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font);
  font-size: 0.88rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.65rem 1.25rem;
  border: 2px solid var(--gold);
  background: var(--gold);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  border-radius: 999px;
}
.btn:hover { background: transparent; color: var(--gold); }
.btn[disabled] { opacity: 0.55; cursor: wait; }
.btn.ghost { background: transparent; color: var(--gold); }
.btn.ghost:hover { background: var(--gold-soft); }
.btn.small { padding: 0.35rem 0.8rem; font-size: 0.75rem; }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: rgba(232, 114, 122, 0.12); }
.btn-row { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1.2rem; }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding-block: clamp(2.5rem, 7vw, 4.5rem) clamp(2rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--line);
}
.hero p { margin-inline: auto; }
.hero .kicker { margin-bottom: 0.6rem; }
.logo {
  font-family: var(--font-mark);
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: clamp(2.6rem, 10vw, 5rem);
  line-height: 1;
  margin: 0;
  color: var(--gold);
}
.accent { width: 48px; height: 3px; background: var(--gold); border: 0; margin: 1.1rem auto; }
.accent.left { margin-left: 0; }
.theme { font-size: 1.15rem; color: var(--text); margin: 0 auto 1.5rem; }

.countdown { display: flex; justify-content: center; gap: clamp(0.5rem, 2vw, 0.9rem); flex-wrap: wrap; }
.cd-box { min-width: 4.6rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 0.55rem 0.5rem 0.45rem; }
.cd-box b { display: block; font-weight: 400; font-size: clamp(1.4rem, 4vw, 1.9rem); color: var(--gold); line-height: 1.1; font-variant-numeric: tabular-nums; }
.cd-box span { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.cd-live { font-size: 1.2rem; color: var(--gold); }
.hero .btn-row { justify-content: center; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(2rem, 5vw, 3.2rem); }
.section.alt { background: var(--coal); border-block: 1px solid var(--line); }
.section-title { margin-bottom: 1.5rem; }
.section-title h2 { margin: 0; }
.section-title::after { content: ""; display: block; width: 48px; height: 3px; background: var(--gold); margin-top: 0.7rem; }
.section-title.center { text-align: center; }
.section-title.center::after { margin-inline: auto; }

/* ---------- Team ---------- */
/* Rows of cards, centred so 2 SGs sit on one line and the 3 below on the next.
   Each card: tall picture on top that fades into a black name/role section. */
.people-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.2rem; }
.people-row + .people-row { margin-top: 1.4rem; }
.person-card {
  flex: 0 1 210px;
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  color: var(--gold);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.person-card:hover, .person-card:focus-visible { transform: translateY(-4px); border-color: var(--gold); color: var(--gold); }
.people-row.big .person-card { flex-basis: 250px; }
.pic { position: relative; aspect-ratio: 3 / 4; background: var(--panel-2); overflow: hidden; }
.pic .photo { display: flex; width: 100%; height: 100%; object-fit: cover; }
.pic::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 45%; background: linear-gradient(to bottom, rgba(11, 42, 40, 0), var(--card)); pointer-events: none; }
.person-card .info { padding: 0.2rem 1.1rem 1.1rem; margin-top: -1.6rem; position: relative; z-index: 1; }
.person-card .name { display: block; font-size: 1.1rem; line-height: 1.3; color: var(--gold); }
.people-row.big .person-card .name { font-size: 1.2rem; }
.person-card .title { display: block; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); margin-top: 0.25rem; }
.person-card .sub { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 0.2rem; }
.initials { display: flex; align-items: center; justify-content: center; color: var(--gold); font-size: 2.6rem; }
.committee-group { margin-top: 1.8rem; }
.committee-group h3 { text-align: center; margin-bottom: 0.9rem; }
.empty { color: var(--muted); }

/* Support contact on the home page */
.support { text-align: center; }
.support p { margin-inline: auto; }
.support .mail { font-size: 1.15rem; }

/* ---------- Profile page ---------- */
.back { margin: 1.4rem 0 0; font-size: 0.85rem; }
.back a { text-decoration: none; }
.profile { display: grid; grid-template-columns: 260px 1fr; gap: clamp(1.3rem, 4vw, 2.5rem); align-items: start; padding-block: 1.4rem 3rem; max-width: 900px; }
.profile .pic { border-radius: 14px; border: 1px solid var(--line); }
.profile .pic .initials { font-size: 4rem; }
.profile h1 { margin-bottom: 0.15rem; }
.profile-title { color: var(--gold); font-size: 1.05rem; margin-bottom: 0.2rem; }
.bio { white-space: pre-line; }
.contact { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.8rem; margin-top: 1.4rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.contact-k { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.contact a { overflow-wrap: anywhere; }

/* ---------- Panels, forms ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: clamp(1rem, 3vw, 1.6rem); }
.panel.narrow { max-width: 460px; }
.page-head { padding-block: clamp(1.6rem, 4vw, 2.6rem) 0.8rem; }
label { display: block; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.35rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="time"], input[type="date"], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 0.55rem 0.75rem;
  background: var(--black);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
}
input[type="time"], input[type="date"] { color-scheme: dark; }
input::placeholder, textarea::placeholder { color: #6b6b6b; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
select option, select optgroup { background: var(--black); color: var(--text); }
input:disabled, select:disabled { opacity: 0.5; }
textarea { min-height: 9rem; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 0.9rem; }
textarea.prose { font-family: var(--font); font-size: 1rem; min-height: 7rem; }
.field { margin-bottom: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 1.1rem; }
.check { display: flex; align-items: center; gap: 0.6rem; margin: 0.4rem 0 1rem; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--gold); }
.check label { margin: 0; text-transform: none; letter-spacing: 0; font-size: 1rem; color: var(--text); }
.status { min-height: 1.5em; margin: 0.8rem 0 0; color: var(--muted); }
.status.error { color: var(--danger); }
.status.good { color: var(--ok); }
.notice { border-left: 3px solid var(--gold); background: var(--panel-2); border-radius: 0 8px 8px 0; padding: 0.7rem 1rem; margin: 1rem 0; }
.notice b { color: var(--gold); font-weight: 400; }

.photo-field { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.day-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0 0 1rem; }
.day-tab { font: inherit; font-size: 0.85rem; padding: 0.4rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; }
.day-tab[aria-selected="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.day-tab .today { font-size: 0.7rem; margin-left: 0.4rem; opacity: 0.8; }
.schedule .kind { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.photo-field .avatar { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); background: var(--panel-2); font-size: 1.4rem; }

/* ---------- Badges ---------- */
.badge { display: inline-block; font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 0.12rem 0.55rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); white-space: nowrap; }
.badge.t100, .badge.t80 { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.badge.t60 { border-color: var(--gold); color: var(--gold); }

/* ---------- Dashboard ---------- */
.now-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.slot { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem; }
.slot.live { border-color: var(--gold); }
.slot .k { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.5rem; }
.slot .big { font-size: 1.2rem; color: var(--text); line-height: 1.25; margin: 0 0 0.4rem; }
.slot p { margin-bottom: 0.3rem; }

.schedule { list-style: none; margin: 1rem 0 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); }
.schedule li { display: grid; grid-template-columns: 8.5rem 1fr auto; gap: 0.3rem 1rem; padding: 0.75rem 1.2rem; border-bottom: 1px solid var(--line); align-items: baseline; }
.schedule li:last-child { border-bottom: 0; }
.schedule .time { font-size: 0.9rem; color: var(--gold); font-variant-numeric: tabular-nums; }
.schedule li.done, .schedule li.done .time { color: var(--muted); }
.schedule li.now { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--gold); }
.tag { font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; background: var(--gold); color: var(--ink); padding: 0.1rem 0.45rem; border-radius: 999px; margin-left: 0.6rem; }

/* ---------- Find a member ---------- */
.results { display: grid; gap: 0.8rem; margin-top: 1.2rem; }
.result { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 10px; padding: 0.9rem 1.1rem; display: grid; grid-template-columns: 1fr auto; gap: 0.6rem 1.2rem; align-items: center; }
.result.t100, .result.t80 { border-left-color: var(--gold); }
.result h3 { margin: 0 0 0.2rem; color: var(--text); }
.result p { margin: 0.15rem 0; }
.where { color: var(--gold); }

/* ---------- Admin ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); margin-top: 1rem; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 0.55rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 0.7rem; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); background: var(--coal); }
tr:last-child td { border-bottom: 0; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn + .btn { margin-left: 0.4rem; }
.stack > * + * { margin-top: 2rem; }
.com-row { display: grid; grid-template-columns: 1fr 9rem 1fr auto auto; gap: 0.6rem; align-items: center; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.sched-row { display: grid; grid-template-columns: 1.6fr 9.25rem 9.25rem 1.5fr 1.7fr auto; /* times wide enough for "08:30 AM" */ gap: 0.5rem; align-items: center; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.duty-row { display: grid; grid-template-columns: 1.4fr 1.6fr 7.5rem 9.25rem 9.25rem auto; gap: 0.5rem; align-items: center; padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
#f-duty-add { margin-top: 0.6rem; }
.hint { font-size: 0.82rem; color: var(--muted); margin: 0.35rem 0 0; }
/* Manage: per-person permissions */
.perm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 0.6rem; margin: 1rem 0; }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.65rem 0.8rem; border: 1px solid var(--line); border-radius: 10px; }
.perm-row > div { min-width: 0; display: flex; flex-direction: column; }
.perm-row .hint { margin: 0.15rem 0 0; }
.perm-row select { width: auto; flex: none; max-width: 48%; }
.perm-row.changed { border-color: var(--gold); }
/* Extra Meet calls for one person: a tick box per call, gold when ticked */
.perm-meet { margin: 0 0 1rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.perm-meet[hidden] { display: none; }
.perm-meet h3 { margin: 0 0 0.2rem; font-size: 1rem; }
.perm-meet .hint { margin: 0 0 0.7rem; }
.perm-meet-list { display: block; }
.perm-meet-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.8rem; }
.perm-meet-sub { margin: 0 0 0.4rem; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.7; }
.perm-chip { display: inline-flex; align-items: center; gap: 0.32rem; margin: 0; padding: 0.2rem 0.55rem 0.2rem 0.4rem; border: 1px solid var(--line); border-radius: 999px;
  font-size: 0.78rem; line-height: 1.3; letter-spacing: 0; text-transform: none; white-space: nowrap; color: var(--text); cursor: pointer; }
/* WESMUN tick box: a rose-gold frame; ticked = rose-gold metal with a dark tick; blocked = a red cross */
.perm-chip input { appearance: none; -webkit-appearance: none; flex: none; width: 0.78rem; height: 0.78rem; margin: 0; padding: 0;
  border: 1.25px solid var(--gold-lo); border-radius: 4px; background: rgba(8, 30, 28, 0.6); display: grid; place-content: center;
  cursor: pointer; transition: background 0.15s, border-color 0.15s, box-shadow 0.15s; }
.perm-chip input::before { content: ''; width: 0.46rem; height: 0.46rem; transform: scale(0); transition: transform 0.15s ease-out;
  background: var(--ink, #0b2b29); clip-path: polygon(14% 44%, 0 65%, 40% 100%, 100% 22%, 84% 8%, 38% 68%); }
.perm-chip input:checked { background: var(--metal); border-color: var(--gold-hi); box-shadow: 0 0 6px rgba(246, 220, 194, 0.35); }
.perm-chip input:checked::before { transform: scale(1); }
.perm-chip input:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.perm-chip:hover input:not(:checked) { border-color: var(--gold); }
.perm-chip.blocked input { border-color: #e06c6c; background: rgba(224, 108, 108, 0.15); }
.perm-chip.blocked input::before { transform: scale(1); width: 0.44rem; height: 0.44rem; background: #f0a0a0;
  clip-path: polygon(20% 0, 50% 30%, 80% 0, 100% 20%, 70% 50%, 100% 80%, 80% 100%, 50% 70%, 20% 100%, 0 80%, 30% 50%, 0 20%); }
.perm-chip.on { border-color: var(--gold); background: rgba(216, 167, 125, 0.12); color: var(--gold-hi); }
.perm-chip.blocked { border-color: rgba(224, 108, 108, 0.6); background: rgba(224, 108, 108, 0.1); color: #f0a0a0; }
.perm-chip.blocked span { text-decoration: line-through; }
.duty-list { list-style: none; margin: 0.4rem 0 0; padding: 0; font-size: 0.92rem; }
.duty-list li { padding: 0.25rem 0; border-top: 1px solid var(--line); }
.duty-list li.on { color: var(--gold); }
.sched-head { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); border-bottom: 0; padding-bottom: 0; }
.log { list-style: none; margin: 0; padding: 0; max-height: 20rem; overflow-y: auto; }
.log li { padding: 0.45rem 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.member-group { margin-top: 1.8rem; }
.member-group h2 { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.2rem; }
/* every group's table has the same columns, so they line up down the page */
.member-group table { table-layout: fixed; }
.member-group th, .member-group td { overflow-wrap: anywhere; }
.member-group th:nth-child(1) { width: 20%; }
.member-group th:nth-child(2) { width: 28%; }
.member-group th:nth-child(3) { width: 14%; }
.member-group th:nth-child(4) { width: 16%; }
.member-group th:nth-child(5) { width: 22%; }
.member-group table:not(.with-email) th:nth-child(1) { width: 26%; }
.member-group table:not(.with-email) th:nth-child(2) { width: 32%; }
.member-group table:not(.with-email) th:nth-child(3) { width: 18%; }
.member-group table:not(.with-email) th:nth-child(4) { width: 24%; }
.member-group td a[href^="mailto:"] { overflow-wrap: anywhere; }
.member-group:last-child { margin-bottom: 3rem; }
/* phones: each person becomes a small card instead of a wide table */
@media (max-width: 700px) {
  .member-group .table-wrap { overflow: visible; }
  .member-group table, .member-group tbody, .member-group tr, .member-group td { display: block; width: auto; min-width: 0; }
  .member-group thead { display: none; }
  .member-group tr { padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--line); }
  .member-group tr:last-child { border-bottom: 0; }
  .member-group td { border: 0; padding: 0.15rem 0; }
  .member-group td.mg-name { font-weight: 700; font-size: 1.02rem; padding-bottom: 0.35rem; }
  .member-group td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 6.2rem; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
  .member-group td.mg-empty { display: none; }
}
.group-count { font-size: 0.75rem; color: var(--ink); background: var(--gold); border-radius: 999px; padding: 0.05rem 0.55rem; }
#filter + #groups { margin-top: 0.4rem; }
.log time { color: var(--muted); margin-right: 0.8rem; font-size: 0.88rem; }

/* ---------- Map ---------- */
.map-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.8rem 1rem; align-items: end; margin-bottom: 1rem; }
.map-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.8rem; align-items: center; }
.map-layout { display: grid; grid-template-columns: 1fr 280px; gap: 1.2rem; align-items: start; margin-bottom: 2.5rem; }
.viewport { overflow: auto; max-height: 74vh; border: 1px solid rgba(216, 167, 125, 0.3); border-radius: 14px; background: transparent;
  touch-action: pan-x pan-y; /* one finger moves the map; a pinch zooms the map (see map.js), not the page */
  overscroll-behavior: contain; cursor: grab; }
.viewport.dragging, .viewport.dragging * { cursor: grabbing !important; }
.viewport svg { display: block; width: 100%; height: auto; }
.info h3 { margin-bottom: 0.3rem; }

/* Map colours: one beige for every building, grey paths, dark green pitches and grass,
   and the site gold to mark where you are going. */
.sv-ground { fill: transparent; } /* the page's own teal shows through */
.sv-path-edge { fill: #061f1d; stroke: #061f1d; stroke-width: 9; } /* the black outline round the paths */
.sv-path { fill: #2f5c57; stroke: #2f5c57; stroke-width: 1.5; } /* the thin stroke hides seams where path pieces meet */
.sv-path.indoor { fill: #3a6a64; stroke: #3a6a64; }  /* corridors: smooth floor, a little lighter */
.sv-path.outdoor { fill: url(#paving); stroke: #3b5e58; } /* outside: paving slabs */
.pv-slab { fill: #345f59; }
.pv-joint { fill: none; stroke: #27504b; stroke-width: 1.2; }
.sv-grass { fill: #24602a; stroke: #24602a; stroke-width: 1.5; } /* same green as the pitches */
/* Buildings in rose gold (the gradient is drawn in map.js), with dark green names */
.room { fill: url(#bldg); stroke: #061f1d; stroke-width: 2; cursor: pointer; transition: filter 0.2s; }
.room.s-pitch { fill: #24602a; }
.room.s-stairs { fill: #2d5f8f; }
.room.s-stairs:hover, .room.s-stairs:focus { fill: #3670a6; filter: none; }
.step-line { stroke: rgba(255, 255, 255, 0.35); stroke-width: 2; pointer-events: none; }
.room.s-paved { fill: #2f5c57; }
.room.s-shade { fill: url(#bldg-soft); stroke-dasharray: 8 5; }
.room:hover, .room:focus { filter: brightness(1.12); outline: none; }
.room.s-pitch:hover, .room.s-pitch:focus { fill: #2c6f32; filter: none; }
.room.s-paved:hover, .room.s-paved:focus { fill: #3a6c66; filter: none; }
.room.locked { cursor: not-allowed; }
.room.is-from { stroke: #f6dcc2; stroke-width: 4; stroke-dasharray: none; }
/* Where you are going: dark green with rose gold writing */
.room.is-to, .room.is-to:hover { fill: #0b2b29; stroke: #f6dcc2; stroke-width: 3; stroke-dasharray: none; filter: drop-shadow(0 0 8px rgba(216, 167, 125, 0.7)); }
.room-label { fill: #0b2b29; font-family: "Varela Round", "Segoe UI", Arial, sans-serif; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.room-label.on-dark { fill: #f4e9dc; }
.room-label.on-pick { fill: #f6dcc2; }
.exit-bg { fill: #c62828; stroke: #7f1414; stroke-width: 1; pointer-events: none; }
.stairs-bg { fill: #1f5fa8; stroke: #123c6e; stroke-width: 1; pointer-events: none; }
.exit-label { fill: #ffffff; font-family: "Varela Round", "Segoe UI", Arial, sans-serif; font-size: 10px; text-anchor: middle; dominant-baseline: middle; letter-spacing: 0.06em; pointer-events: none; }
.pitch-line { fill: none; stroke: rgba(255, 255, 255, 0.85); stroke-width: 2; pointer-events: none; }
.route-layer { pointer-events: none; }
.route-casing { fill: none; stroke: #0b2b29; stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; }
.route { fill: none; stroke: #d8a77d; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.route-flow { fill: none; stroke: #0b2b29; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 0.1 14; animation: route-flow 0.9s linear infinite; }
@keyframes route-flow { to { stroke-dashoffset: -14.1; } }
@media (prefers-reduced-motion: reduce) { .route-flow { animation: none; } }
.route-start { fill: #f4e9dc; stroke: #061f1d; stroke-width: 3; }
.route-end { fill: #f6dcc2; stroke: #061f1d; stroke-width: 3; }
.route-end-dot { fill: #0b2b29; }
.you-dot { fill: #f6dcc2; stroke: #061f1d; stroke-width: 4; }
.you-ring { fill: rgba(246, 220, 194, 0.12); stroke: rgba(246, 220, 194, 0.5); stroke-width: 1.5; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--coal); padding-block: 1.8rem 1.4rem; color: var(--muted); font-size: 0.92rem; margin-top: auto; }
.foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.4rem 2rem; }
.foot-copy { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 0.78rem; text-align: center; }
.foot p { margin: 0 0 0.35rem; }
.foot-k { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.site-footer a { color: var(--text); }
.site-footer a:hover { color: var(--gold); }
.socials { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.social { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.9rem 0.4rem 0.6rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; }
.social svg { width: 20px; height: 20px; color: var(--gold); }
.social:hover { border-color: var(--gold); }

@media (max-width: 900px) { /* phones and iPads held upright: the tile menu */
  .menu-btn { display: inline-block; }
  #nav { display: none; width: 100%; flex-direction: column; align-items: flex-start; gap: 0.2rem; padding-top: 0.4rem; }
  #nav.open { display: flex; }
  #nav a.nav-pill { margin-top: 0.4rem; }
}

@media (max-width: 820px) {
  .map-layout { grid-template-columns: 1fr; }
  .profile { grid-template-columns: 1fr; }
  /* (phones: the photo and the text centred, so there is no empty space on the right) */
  .profile .pic { width: 100%; max-width: 300px; margin-inline: auto; }
  .profile-text { text-align: center; }
  .profile .accent.left { margin-inline: auto; }
  .profile .contact { justify-content: center; }
  .schedule li { grid-template-columns: 1fr; }
  .result { grid-template-columns: 1fr; }
  .com-row { grid-template-columns: 1fr; }
  .sched-row, .duty-row { grid-template-columns: 1fr 1fr; }
  .duty-row > :first-child { grid-column: 1 / -1; }
  .sched-row > :first-child { grid-column: 1 / -1; }
  .sched-head { display: none; }
}

/* =====================================================================
   Gala layer: the grand, art-deco look. Everything stays black, one gold
   and white; motion switches off for people who ask for reduced motion.
   ===================================================================== */

/* Faint art-deco pattern and a warm light from the top, behind every page */
body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(216, 167, 125, 0.10), transparent 70%),
    var(--black);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23d4af37' stroke-width='1'%3E%3Cpath d='M40 0 L80 40 L40 80 L0 40 Z'/%3E%3Cpath d='M40 14 L66 40 L40 66 L14 40 Z'/%3E%3Cpath d='M40 0 V14 M80 40 H66 M40 80 V66 M0 40 H14'/%3E%3C/g%3E%3C/svg%3E");
}

/* Glass menu bar with a gold hairline */
.site-header {
  background: rgba(10, 40, 38, 0.72);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid rgba(216, 167, 125, 0.28);
}
.brand { text-shadow: 0 0 18px rgba(216, 167, 125, 0.35); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  min-height: min(92vh, 900px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(216, 167, 125, 0.28);
  isolation: isolate;
}
.hero-inner { position: relative; z-index: 2; }
.hero-rays {
  position: absolute;
  left: 50%; top: 45%;
  width: 180vmax; height: 180vmax;
  transform: translate(-50%, -50%);
  z-index: 0;
  background: repeating-conic-gradient(from 0deg, rgba(216, 167, 125, 0.07) 0deg 2deg, transparent 2deg 12deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, rgba(0, 0, 0, 0.6) 25%, transparent 55%);
  mask-image: radial-gradient(circle, #000 0%, rgba(0, 0, 0, 0.6) 25%, transparent 55%);
  animation: rays-turn 140s linear infinite;
}
@keyframes rays-turn { to { transform: translate(-50%, -50%) rotate(360deg); } }
.hero-glow {
  position: absolute;
  left: 50%; top: 42%;
  width: min(900px, 120vw); height: min(520px, 80vw);
  transform: translate(-50%, -50%);
  z-index: 0;
  background: radial-gradient(ellipse, rgba(216, 167, 125, 0.22), transparent 65%);
  filter: blur(10px);
  animation: glow-breathe 7s ease-in-out infinite;
}
@keyframes glow-breathe { 50% { opacity: 0.65; transform: translate(-50%, -50%) scale(1.06); } }
.sparkles { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }

/* The sky behind the home screens (see WES.sky): rays of light from the top and drifting gold sparkles.
   It stays still while the page scrolls over it. */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; contain: paint; }
@supports (overflow: clip) { .sky { overflow: clip; } }
.sky canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sky-rays {
  position: absolute; left: 50%; top: 22%;
  width: 160vmax; height: 160vmax;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg, rgba(216, 167, 125, 0.055) 0deg 2deg, transparent 2deg 12deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, rgba(0, 0, 0, 0.55) 25%, transparent 55%);
  mask-image: radial-gradient(circle, #000 0%, rgba(0, 0, 0, 0.55) 25%, transparent 55%);
}

.hero .kicker { letter-spacing: 0.42em; color: var(--gold); }
.hero #dates { letter-spacing: 0.18em; color: var(--muted); }
.logo {
  font-size: clamp(3.4rem, 13vw, 8rem);
  letter-spacing: 0.08em;
  margin: 0.2rem 0;
  filter: drop-shadow(0 0 28px rgba(216, 167, 125, 0.35));
}
/* A light sweeps across the gold wordmark */
.logo.shine {
  background: linear-gradient(110deg, var(--gold) 0%, var(--gold) 42%, #fff1e3 50%, var(--gold) 58%, var(--gold) 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine-sweep 6.5s ease-in-out infinite;
}
@keyframes shine-sweep { 0%, 35% { background-position: 100% 0; } 75%, 100% { background-position: 0 0; } }

/* Art-deco ornament: line, diamond, line */
.ornament { display: flex; align-items: center; justify-content: center; gap: 0.7rem; margin: 0.9rem auto; max-width: 420px; }
.ornament span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.ornament span:last-child { background: linear-gradient(90deg, var(--gold), transparent); }
.ornament i { width: 10px; height: 10px; border: 1px solid var(--gold); transform: rotate(45deg); box-shadow: 0 0 12px rgba(216, 167, 125, 0.6); position: relative; }
.ornament i::after { content: ""; position: absolute; inset: 2px; background: var(--gold); }
.theme { font-size: clamp(1.1rem, 2.4vw, 1.4rem); letter-spacing: 0.04em; }

.cd-box {
  min-width: 5.4rem;
  border: 1px solid rgba(216, 167, 125, 0.45);
  background: linear-gradient(180deg, rgba(216, 167, 125, 0.08), rgba(0, 0, 0, 0.6));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6), 0 10px 30px -12px rgba(216, 167, 125, 0.35);
  padding: 0.8rem 0.6rem 0.6rem;
}
.cd-box b { font-family: var(--font-mark); font-weight: 700; font-size: clamp(1.7rem, 5vw, 2.6rem); text-shadow: 0 0 16px rgba(216, 167, 125, 0.45); }

.scroll-cue { position: absolute; left: 50%; bottom: 1.4rem; z-index: 2; transform: translateX(-50%); width: 26px; height: 42px; border: 1px solid rgba(216, 167, 125, 0.6); border-radius: 14px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--gold); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Gold ribbon ---------- */
.ticker { overflow: hidden; background: var(--gold); color: var(--ink); border-block: 1px solid var(--gold-lo); }
.ticker-track { display: flex; width: max-content; }
/* (moves only once it holds its words: see home.js) */
.ticker-track.go { animation: ticker 38s linear infinite; }
.ticker-track span { font-family: var(--font-mark); font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; font-size: 0.95rem; padding: 0.7rem 1.6rem; white-space: nowrap; }
.ticker-track span::after { content: "\25C6"; margin-left: 3.2rem; font-size: 0.7rem; vertical-align: middle; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Numbers ---------- */
.stats-section { padding-block: clamp(2.2rem, 5vw, 3.4rem); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; text-align: center; }
.stat { padding: 1.2rem 0.6rem; border: 1px solid rgba(216, 167, 125, 0.25); border-radius: 14px; background: linear-gradient(180deg, rgba(216, 167, 125, 0.06), transparent); }
.stat b { display: block; font-family: var(--font-mark); font-weight: 800; font-size: clamp(2.4rem, 7vw, 3.6rem); color: var(--gold); line-height: 1; text-shadow: 0 0 22px rgba(216, 167, 125, 0.4); font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 0.5rem; font-size: 0.78rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); }

/* ---------- Section titles: Cinzel with a deco ornament ---------- */
.section-title h2 { font-family: var(--font-mark); font-weight: 700; letter-spacing: 0.08em; font-size: clamp(1.5rem, 3.4vw, 2.2rem); }
.section-title::after {
  width: 160px; height: 12px; background: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='12' viewBox='0 0 160 12'%3E%3Cg fill='%23d4af37'%3E%3Crect x='0' y='5.5' width='66' height='1'/%3E%3Crect x='94' y='5.5' width='66' height='1'/%3E%3Cpath d='M80 0 L86 6 L80 12 L74 6 Z'/%3E%3Cpath d='M70 6 L72 4 L74 6 L72 8 Z M86 6 L88 4 L90 6 L88 8 Z'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  margin-top: 0.8rem;
}
.section.alt { background: linear-gradient(180deg, rgba(216, 167, 125, 0.035), transparent 40%), var(--coal); border-block: 1px solid rgba(216, 167, 125, 0.18); }

/* ---------- Buttons: a light passes over them ---------- */
.btn { position: relative; overflow: hidden; box-shadow: 0 8px 24px -10px rgba(216, 167, 125, 0.55); transition: background 0.2s, color 0.2s, box-shadow 0.25s, transform 0.2s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 30px -10px rgba(216, 167, 125, 0.7); }
.btn::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent); transform: skewX(-20deg); transition: left 0.6s ease; pointer-events: none; }
.btn:hover::after { left: 130%; }
.btn.ghost, .btn.danger, .btn.small { box-shadow: none; }

/* ---------- Team cards: gold frame, glow and a slow zoom ---------- */
.person-card { border-color: rgba(216, 167, 125, 0.28); box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.9); transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.35s, box-shadow 0.35s; position: relative; }
.person-card::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(216, 167, 125, 0); border-radius: 10px; z-index: 2; pointer-events: none; transition: border-color 0.35s; }
.person-card:hover, .person-card:focus-visible { transform: translateY(-6px); box-shadow: 0 0 0 1px var(--gold), 0 24px 50px -18px rgba(216, 167, 125, 0.45); }
.person-card:hover::before, .person-card:focus-visible::before { border-color: rgba(216, 167, 125, 0.55); }
/* Head Directors: the hover's gold border, always on */
.person-card.head { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 18px 40px -24px rgba(0, 0, 0, 0.9); }
.person-card.head::before { border-color: rgba(216, 167, 125, 0.55); }
.person-card.head:hover, .person-card.head:focus-visible { box-shadow: 0 0 0 1px var(--gold), 0 24px 50px -18px rgba(216, 167, 125, 0.45); }
.pic .photo { transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.person-card:hover .pic .photo { transform: scale(1.06); }
.pic .initials { font-family: var(--font-mark); font-weight: 700; font-size: 3rem; background: radial-gradient(circle at 50% 40%, rgba(216, 167, 125, 0.18), transparent 70%), var(--panel-2); text-shadow: 0 0 20px rgba(216, 167, 125, 0.5); }
.person-card .name { font-family: var(--font-mark); font-weight: 700; letter-spacing: 0.04em; }
.committee-group h3 { font-family: var(--font-mark); letter-spacing: 0.12em; text-transform: uppercase; }

/* Panels and cards elsewhere get the same gold hairline */
.panel, .slot, .stat, .cd-box, .table-wrap, .schedule, .result { border-color: rgba(216, 167, 125, 0.22); }
.slot.live { box-shadow: 0 0 0 1px var(--gold), 0 16px 40px -20px rgba(216, 167, 125, 0.5); }

/* Footer: gold hairline and ornament */
.site-footer { position: relative; border-top: 1px solid rgba(216, 167, 125, 0.28); }
.site-footer::before { content: ""; position: absolute; left: 50%; top: -6px; width: 12px; height: 12px; margin-left: -6px; transform: rotate(45deg); background: var(--black); border: 1px solid var(--gold); }
.site-footer .brand { font-size: 1.5rem; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reveal.in { opacity: 1; transform: none; }
/* home page: fading away goes a little quicker, and things that leave at the top drift up */
.reveal:not(.in) { transition-duration: 0.5s, 0.6s; }
.reveal.gone-up { transform: translateY(-18px); }

@media (prefers-reduced-motion: reduce) {
  .hero-rays, .hero-glow, .logo.shine, .ticker-track.go, .scroll-cue span { animation: none; }
  .btn::after { display: none; }
  .reveal, .reveal.gone-up { transform: none; } /* fade only, no sliding */
}
@media (max-width: 760px) {
  .hero { min-height: 86vh; }
  .scroll-cue { display: none; }
  .countdown { flex-wrap: nowrap; gap: 0.4rem; }
  .cd-box { min-width: 0; flex: 1 1 0; max-width: 5.2rem; padding: 0.6rem 0.2rem 0.45rem; }
  .cd-box span { font-size: 0.56rem; letter-spacing: 0.08em; }
}

/* Smoother menu: glides up when you scroll down, and back down when you scroll up.
   (Kept on even with "reduce motion": it is a short, gentle slide.) */
.site-header { transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.6s ease, background 0.4s ease; will-change: transform; }

/* The school's address */
.address { font-style: normal; line-height: 1.6; margin: 0 auto 1rem; color: var(--text); }
.address strong { color: var(--gold); font-weight: 400; font-family: var(--font-mark); letter-spacing: 0.06em; }
.site-footer .address { margin: 0 0 0.5rem; font-size: 0.88rem; color: var(--muted); }
.site-footer .address strong { font-size: 0.95rem; }

/* ---------- Smooth page changes (every browser, including iPhones) ----------
   Leaving: the moment you tap a link the page fades out and a thin rose gold bar runs across
   the top, so you can see it is working (see WES.go). Arriving: the new page rises in gently,
   the top first and then the content. The menu bar stays where it is. */
@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes page-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
body > main > :not(.hero) { animation: page-rise 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
body > main > :nth-child(2):not(.hero) { animation-delay: 0.07s; }
body > main > :nth-child(3):not(.hero) { animation-delay: 0.13s; }
body > main > :nth-child(n+4):not(.hero) { animation-delay: 0.18s; }
.site-footer { animation: page-rise 0.6s ease 0.2s both; }
body > main, .site-footer { transition: opacity 0.22s ease, transform 0.22s ease; }
html.leaving body > main, html.leaving .site-footer { opacity: 0; transform: translateY(-8px); }
.page-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 300; pointer-events: none;
  background: var(--metal); box-shadow: 0 0 10px rgba(246, 220, 194, 0.6); transform: scaleX(0); transform-origin: left; opacity: 0; }
html.leaving .page-progress { opacity: 1; animation: page-progress 3s cubic-bezier(0.1, 0.7, 0.2, 1) 0.1s both; }
@keyframes page-progress { from { transform: scaleX(0); } to { transform: scaleX(0.92); } }
/* "Reduce motion" switched on (iPhone: Settings > Accessibility > Motion): no sliding, but pages
   still fade softly in and out, which is easy on the eyes. */
@keyframes page-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  body > main > :not(.hero), .site-footer { animation-name: page-fade !important; animation-duration: 0.4s !important; }
  html.leaving body > main, html.leaving .site-footer { transform: none; }
  html.leaving .page-progress { animation-name: page-progress-still; }
}
@keyframes page-progress-still { from { transform: scaleX(0.15); } to { transform: scaleX(0.6); } }
.scroll-cue { transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s; }
.scroll-cue:hover { border-color: var(--gold); box-shadow: 0 0 18px rgba(216, 167, 125, 0.45); transform: translateX(-50%) translateY(2px); }

/* =====================================================================
   Crest theme: deep teal, metallic rose gold, filigree on the sides.
   ===================================================================== */

/* Teal with a soft mottled texture, like the conference cards */
body {
  background:
    radial-gradient(ellipse 90% 60% at 50% -5%, rgba(41, 120, 112, 0.55), transparent 70%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(5, 25, 24, 0.7), transparent 70%),
    var(--black);
}
body::before {
  /* plain, not blended: a full-screen blend has to be worked out again on every scroll movement */
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Fonts */
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.02em; }
.kicker, #nav a, .link-btn, .btn, label, th, .badge, .tag, .day-tab, .slot .k, .contact-k, .foot-k,
.cd-box span, .stat span, .person-card .title, .group-count, .back a, .menu-btn, .schedule .kind, .hint {
  font-family: var(--font-label);
  font-weight: 500;
}
#nav a, .link-btn { letter-spacing: 0.12em; font-size: 0.9rem; }
.btn { letter-spacing: 0.14em; font-size: 0.92rem; }
.kicker { letter-spacing: 0.3em; font-size: 0.82rem; }

/* Metallic rose gold lettering, like the names on the cards */
.metal, .section-title h2, .page-head h1, .profile h1, .person-card .name, .stat b, .cd-box b, .brand {
  background: var(--metal);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold);
}
.section-title h2 { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.06em; font-size: clamp(1.8rem, 4.2vw, 2.8rem); filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35)); }
.page-head h1, .profile h1 { font-size: clamp(2rem, 5vw, 3.2rem); text-transform: uppercase; letter-spacing: 0.04em; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35)); }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; text-shadow: none; filter: drop-shadow(0 0 10px rgba(216, 167, 125, 0.3)); }
.brand-crest { width: 34px; height: auto; -webkit-text-fill-color: initial; }

/* Hero: the crest above the wordmark */
.hero-crest { display: block; width: clamp(150px, 22vw, 230px); height: auto; margin: 0 auto 0.4rem; filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 30px rgba(216, 167, 125, 0.25)); animation: crest-float 7s ease-in-out infinite; }
@keyframes crest-float { 50% { transform: translateY(-6px); } }
.logo { font-size: clamp(3.2rem, 12vw, 7.4rem); }
.logo.shine {
  background: linear-gradient(110deg, #e2b58c 0%, #f6dcc2 20%, #b98157 40%, #fff1e3 50%, #b98157 60%, #f6dcc2 80%, #e2b58c 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.35)) drop-shadow(0 0 30px rgba(216, 167, 125, 0.3));
}
.hero-rays { background: repeating-conic-gradient(from 0deg, rgba(216, 167, 125, 0.06) 0deg 2deg, transparent 2deg 12deg); }
.hero-glow { background: radial-gradient(ellipse, rgba(64, 160, 148, 0.35), transparent 65%); }
.hero-bottom { position: absolute; left: 50%; bottom: 0.4rem; transform: translateX(-50%); width: min(760px, 92vw); z-index: 2; pointer-events: none; opacity: 0.9; }
.hero-bottom svg { display: block; width: 100%; height: auto; }

/* Rose gold buttons, ribbon and countdown */
.btn { background: var(--metal); border-color: var(--gold); color: var(--ink); }
.btn:hover { background: transparent; color: var(--gold); }
.btn.ghost, .btn.danger { background: transparent; }
.btn.ghost { color: var(--gold); }
.btn.danger { color: var(--danger); }
.ticker { background: var(--metal); }
.ticker-track span { font-family: var(--font-label); font-weight: 600; letter-spacing: 0.3em; }
.cd-box, .stat { background: linear-gradient(180deg, rgba(216, 167, 125, 0.10), rgba(5, 25, 24, 0.55)); }
.cd-box b, .stat b { font-family: var(--font-display); font-weight: 400; text-shadow: none; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35)); }
.tag, .group-count, .badge.t100, .badge.t80 { background: var(--metal); }

/* Team cards: teal, framed in rose gold, names in the card lettering */
.person-card { background: var(--card); }
.person-card .name { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.05em; font-size: 1.2rem; }
.people-row.big .person-card .name { font-size: 1.4rem; }
.person-card .title { letter-spacing: 0.16em; font-size: 0.82rem; color: var(--gold); }
.pic .initials { font-family: var(--font-display); background: radial-gradient(circle at 50% 40%, rgba(216, 167, 125, 0.18), transparent 70%), var(--panel-2); color: var(--gold); }
.committee-group h3 { font-family: var(--font-label); font-weight: 500; letter-spacing: 0.3em; color: var(--gold); }

/* Glass menu in teal */
.site-header { background: rgba(10, 40, 38, 0.78); border-bottom-color: rgba(216, 167, 125, 0.35); }
.section.alt { background: linear-gradient(180deg, rgba(216, 167, 125, 0.04), transparent 40%), var(--coal); }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="time"], input[type="date"], select, textarea { background: rgba(5, 25, 24, 0.6); }
select option, select optgroup { background: var(--coal); }

/* ---------- Filigree down the sides of the page ---------- */
.flourish { position: fixed; top: 0; bottom: 0; width: clamp(70px, 8vw, 150px); z-index: -1; pointer-events: none; opacity: 0.85; display: flex; flex-direction: column; justify-content: space-around; overflow: hidden; }
.flourish.left { left: 0; }
.flourish.right { right: 0; transform: scaleX(-1); }
.flourish svg { display: block; width: 100%; height: auto; flex: none; }
@media (max-width: 1100px) { .flourish { opacity: 0.35; width: 60px; } }
@media (max-width: 760px) { .flourish { display: none; } }

/* Footer brand with the crest */
.site-footer .brand-crest { width: 40px; }

/* room at the bottom of the hero for the filigree band and the scroll button */
.hero { padding-bottom: clamp(6rem, 12vh, 8rem); }
.hero-bottom { bottom: 0.3rem; }
.scroll-cue { bottom: clamp(3.6rem, 7vh, 4.6rem); }
.flourish { width: clamp(60px, 7vw, 140px); }
@media (max-width: 760px) { .hero #dates { letter-spacing: 0.08em; font-size: 0.72rem; } }

/* ---------- Fonts: Cinzel headings, Varela Round labels in spaced capitals ---------- */
h1, h2, h3, .section-title h2, .page-head h1, .profile h1, .person-card .name, .cd-box b, .stat b { font-family: var(--font-display); font-weight: 700; }
.section-title h2 { letter-spacing: 0.08em; }
.person-card .name { letter-spacing: 0.04em; font-size: 1.05rem; }
.people-row.big .person-card .name { font-size: 1.2rem; }
.kicker, #nav a, .link-btn, .btn, label, th, .badge, .tag, .day-tab, .slot .k, .contact-k, .foot-k,
.cd-box span, .stat span, .person-card .title, .group-count, .back a, .menu-btn, .schedule .kind, .committee-group h3, .ticker-track span {
  font-family: var(--font-label);
  font-weight: 400;
}
#nav a, .link-btn { font-size: 0.8rem; letter-spacing: 0.1em; }
.btn { font-size: 0.82rem; letter-spacing: 0.12em; }
.kicker { font-size: 0.74rem; letter-spacing: 0.26em; }
.person-card .title { font-size: 0.72rem; letter-spacing: 0.12em; }
.ticker-track span { font-size: 0.82rem; letter-spacing: 0.26em; }
.schedule .kind { font-size: 0.66rem; letter-spacing: 0.1em; }
.day-tab { font-size: 0.82rem; }

/* ---------- Gold and green: every other section flips to rose gold with green writing ---------- */
.section.alt {
  background: linear-gradient(180deg, #f3d8bd 0%, #e2b58c 55%, #cf9a6e 100%);
  color: var(--ink);
  border-block: 1px solid var(--gold-lo);
  position: relative;
}
.section.alt p, .section.alt .muted, .section.alt .empty, .section.alt .address { color: #173e3b; }
.section.alt .kicker, .section.alt .committee-group h3, .section.alt .address strong { color: var(--ink); }
.section.alt .section-title h2, .section.alt h2, .section.alt h3 {
  background: none;
  -webkit-text-fill-color: var(--ink);
  color: var(--ink);
  filter: drop-shadow(0 1px 0 rgba(255, 241, 227, 0.6));
}
.section.alt .section-title::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='12' viewBox='0 0 160 12'%3E%3Cg fill='%230b2b29'%3E%3Crect x='0' y='5.5' width='66' height='1'/%3E%3Crect x='94' y='5.5' width='66' height='1'/%3E%3Cpath d='M80 0 L86 6 L80 12 L74 6 Z'/%3E%3Cpath d='M70 6 L72 4 L74 6 L72 8 Z M86 6 L88 4 L90 6 L88 8 Z'/%3E%3C/g%3E%3C/svg%3E");
}
.section.alt a:not(.btn):not(.person-card) { color: var(--ink); text-decoration-color: rgba(11, 43, 41, 0.5); }
.section.alt a:not(.btn):not(.person-card):hover { color: #000; }
.section.alt .btn { background: var(--ink); border-color: var(--ink); color: var(--gold-hi); box-shadow: 0 10px 24px -12px rgba(11, 43, 41, 0.7); }
.section.alt .btn:hover { background: transparent; color: var(--ink); }
.section.alt .btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.section.alt .btn.ghost:hover { background: rgba(11, 43, 41, 0.1); }
.section.alt .person-card { border-color: rgba(11, 43, 41, 0.45); box-shadow: 0 20px 40px -22px rgba(11, 43, 41, 0.8); }
.section.alt .person-card:hover { box-shadow: 0 0 0 1px var(--ink), 0 26px 50px -18px rgba(11, 43, 41, 0.75); }

/* ---------- My committee ---------- */
.com-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 0.6rem 1.4rem; margin-bottom: 1rem; }
.com-tools .field { margin: 0; min-width: 220px; }
.com-tools .day-tabs { margin: 0; }
.com-summary { display: grid; grid-template-columns: 1.1fr 1fr 1.3fr; gap: 1.2rem 2rem; margin-bottom: 1.6rem; }
.slot-k { font-family: var(--font-label); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.5rem; }
.com-count { font-size: 1.1rem; margin: 0 0 0.5rem; }
.com-count b { font-family: var(--font-display); font-size: 2.6rem; line-height: 1; background: var(--metal); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.meter { height: 8px; border-radius: 99px; background: rgba(5, 25, 24, 0.6); border: 1px solid var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--metal); transition: width 0.6s cubic-bezier(0.22, 0.61, 0.36, 1); }
.small-note { font-size: 0.8rem; margin: 0.5rem 0 0; }
.plain-list { list-style: none; margin: 0; padding: 0; font-size: 0.92rem; }
.plain-list li { padding: 0.35rem 0; border-top: 1px solid var(--line); }
.plain-list li:first-child { border-top: 0; }
.plain-list li.on { color: var(--gold); }
.pill { display: inline-block; font-family: var(--font-label); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.15rem 0.6rem; border-radius: 999px; white-space: nowrap; }
.pill-in { background: rgba(127, 214, 194, 0.16); color: var(--ok); border: 1px solid rgba(127, 214, 194, 0.45); }
.pill-out { background: rgba(5, 25, 24, 0.5); color: var(--muted); border: 1px solid var(--line); }
.com-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem 1rem; margin: 0.4rem 0 0.8rem; }
.com-head h2 { margin: 0; }
.filter-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.filter-tabs .day-tab[aria-selected="true"] { background: var(--metal); color: var(--ink); border-color: var(--gold); }
#search + .delegate-grid { margin-top: 0.9rem; }
.delegate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 0.9rem; }
.delegate-card { background: var(--panel); border: 1px solid rgba(216, 167, 125, 0.22); border-left: 3px solid var(--line); border-radius: 12px; padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.55rem; transition: border-color 0.3s; }
.delegate-card.is-in { border-left-color: var(--ok); }
.dc-top { display: flex; justify-content: space-between; gap: 0.6rem; align-items: start; }
.dc-top h3 { margin: 0; font-size: 1rem; letter-spacing: 0.03em; color: var(--text); }
.dc-top p { margin: 0.15rem 0 0; font-size: 0.85rem; }
textarea.note { min-height: 3.2rem; font-size: 0.92rem; }
.dc-note-row { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; }
.note-meta { margin: 0; font-size: 0.75rem; color: var(--muted); }

/* ---------- Check-in ---------- */
.scan-panel { margin-bottom: 1.2rem; }
.scan-row { display: flex; gap: 0.6rem; }
.scan-row input { font-size: 1.3rem; letter-spacing: 0.06em; padding: 0.75rem 0.9rem; }
.cam { width: 100%; max-width: 480px; border-radius: 12px; border: 1px solid var(--gold); margin-top: 0.8rem; background: #000; }
.scan-result { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; padding: 1rem 1.1rem; border-radius: 12px; border: 1px solid; animation: page-in 0.35s ease both; }
.scan-result p { margin: 0.1rem 0; }
.scan-result.ok { background: rgba(127, 214, 194, 0.12); border-color: rgba(127, 214, 194, 0.6); }
.scan-result.warn { background: rgba(216, 167, 125, 0.12); border-color: var(--gold); }
.scan-result.bad { background: rgba(232, 114, 122, 0.12); border-color: var(--danger); }
.scan-big { font-family: var(--font-display); font-size: 1.5rem; color: var(--text); }
.scan-result.ok .scan-big { color: var(--ok); }
.scan-result.bad .scan-big { color: var(--danger); font-size: 1.15rem; font-family: var(--font); }
.scan-photo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); flex: none; font-size: 1.4rem; }
.h-small { font-size: 1.15rem; }
.find-list { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.find-list li { display: flex; align-items: center; gap: 0.8rem; padding: 0.5rem 0; border-top: 1px solid var(--line); }
.find-list li:first-child { border-top: 0; }
.mini-photo { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 1px solid var(--gold); flex: none; font-size: 0.85rem; }
.fl-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.fl-text .muted { font-size: 0.82rem; }

@media (max-width: 820px) {
  .com-summary { grid-template-columns: 1fr; }
  .scan-row { flex-direction: column; }
}

/* ---------- Menu: your tools in a dropdown under your name ---------- */
.btn { white-space: nowrap; }
.nav-more { position: relative; }
.nav-more-btn {
  font-family: var(--font-label); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: var(--metal); color: var(--ink); border: 1px solid var(--gold); border-radius: 999px;
  padding: 0.3rem 0.85rem; cursor: pointer;
}
.nav-more-btn .caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; transition: transform 0.25s; }
.nav-more.open .caret { transform: rotate(180deg); }
.nav-more-btn[aria-current="page"] { box-shadow: 0 0 0 2px rgba(216, 167, 125, 0.35); }
.nav-more-panel {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 210px; z-index: 60;
  display: flex; flex-direction: column; padding: 0.5rem;
  background: rgba(10, 40, 38, 0.96); border: 1px solid rgba(216, 167, 125, 0.4); border-radius: 12px;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
}
.nav-more.open .nav-more-panel { opacity: 1; visibility: visible; transform: none; transition: opacity 0.22s ease, transform 0.22s ease; }
#nav .nav-more-panel a, #nav .nav-more-panel .link-btn { padding: 0.55rem 0.7rem; border-radius: 8px; border-bottom: 0; text-align: left; }
#nav .nav-more-panel a:hover, #nav .nav-more-panel .link-btn:hover { background: var(--gold-soft); }
#nav .nav-more-panel a[aria-current="page"] { background: var(--gold-soft); color: var(--gold); }
.nav-more-panel .link-btn { border-top: 1px solid var(--line) !important; margin-top: 0.3rem; border-radius: 0 0 8px 8px; }
@media (max-width: 900px) { /* phones and iPads held upright: the tile menu */
  /* in the phone menu, show the tools as a plain list */
  .nav-more-btn { display: none; }
  .nav-more-panel { position: static; opacity: 1; visibility: visible; transform: none; background: none; border: 0; box-shadow: none; padding: 0; min-width: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
  #nav .nav-more-panel a, #nav .nav-more-panel .link-btn { padding: 0.3rem 0; }
}

/* The map is for tapping, not selecting text (double-clicking used to highlight room names) */
.viewport, .viewport svg, .viewport text { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }

/* ---------- About ---------- */
.about-intro { max-width: 820px; }
.about-intro p { max-width: none; }
.about-lead { font-size: clamp(1.1rem, 2.2vw, 1.3rem); line-height: 1.6; }
.about-pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin: 1.8rem 0 2.2rem; }
.pillar { background: rgba(255, 241, 227, 0.35); border: 1px solid rgba(11, 43, 41, 0.25); border-radius: 14px; padding: 1.2rem 1.3rem; }
.pillar h3 { margin: 0 0 0.4rem; font-size: 1.25rem; text-transform: uppercase; letter-spacing: 0.08em; }
.pillar p { margin: 0; }
.about-sub { font-size: 1.15rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 2rem 0 0.9rem; }
.about-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.9rem; counter-reset: step; }
.step { position: relative; padding: 1rem 1.1rem 1rem 3.4rem; border-left: 2px solid rgba(11, 43, 41, 0.35); }
.step b { position: absolute; left: 0.9rem; top: 0.95rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--gold-hi); font-family: var(--font-display); font-size: 0.95rem; }
.step h4 { margin: 0 0 0.3rem; font-family: var(--font-display); font-size: 1rem; letter-spacing: 0.03em; color: var(--ink); }
.step p { margin: 0; font-size: 0.95rem; }
.about-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0.5rem 2.5rem; }
.about-columns p { max-width: none; }
.about-list { margin: 0; padding-left: 1.2rem; }
.about-list li { margin: 0.35rem 0; }
.about-list li::marker { content: "\25C6  "; color: var(--ink); font-size: 0.7em; }
.section.alt .about-sub, .section.alt .pillar h3 { color: var(--ink); }

/* ---------- WESMUN Assistant (on the gold Support section) ---------- */
.assistant { max-width: 760px; margin: 1.6rem auto; text-align: left; background: var(--black); color: var(--text); border: 1px solid var(--gold-lo); border-radius: 18px; box-shadow: 0 24px 50px -26px rgba(11, 43, 41, 0.9); overflow: hidden; }
.section.alt .assistant p { color: var(--text); }
.as-head { display: flex; align-items: center; gap: 0.9rem; padding: 1rem 1.2rem; background: linear-gradient(180deg, rgba(216, 167, 125, 0.14), transparent); border-bottom: 1px solid rgba(216, 167, 125, 0.25); }
.as-head img { flex: none; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4)); }
.as-head h3, .section.alt .assistant .as-head h3 { margin: 0; font-size: 1.1rem; letter-spacing: 0.06em; text-transform: uppercase; background: var(--metal); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: none; }
.as-head p, .section.alt .assistant .as-head p { margin: 0.15rem 0 0; font-size: 0.88rem; color: var(--muted); }
.as-clear { margin-left: auto; flex: none; font-family: var(--font-label); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; background: none; color: var(--gold); border: 1px solid rgba(216, 167, 125, 0.5); border-radius: 999px; padding: 0.3rem 0.8rem; cursor: pointer; }
.as-clear:hover { background: var(--gold-soft); }
.as-gate { padding: 1.4rem 1.2rem; text-align: center; }
.section.alt .assistant .as-gate .btn { background: var(--metal); color: var(--ink); border-color: var(--gold); }
.as-log { max-height: 420px; min-height: 160px; overflow-y: auto; padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: 0.7rem; scroll-behavior: smooth; }
.as-msg { max-width: 85%; padding: 0.65rem 0.9rem; border-radius: 14px; line-height: 1.5; font-size: 0.95rem; animation: page-in 0.3s ease both; }
.as-msg p { margin: 0 0 0.45rem; max-width: none; }
.as-msg p:last-child { margin-bottom: 0; }
.as-msg ul { margin: 0.2rem 0 0.4rem; padding-left: 1.2rem; }
.as-msg.bot { align-self: flex-start; background: var(--panel-2); border: 1px solid rgba(216, 167, 125, 0.18); border-bottom-left-radius: 4px; }
.as-msg.me { align-self: flex-end; background: var(--metal); color: var(--ink); border-bottom-right-radius: 4px; }
.section.alt .assistant .as-msg.me p { color: var(--ink); }
.as-msg.error { border-color: rgba(232, 114, 122, 0.6); }
/* questions sent to the WESMUN team (it did not know), and the team's reply */
.as-msg.me.asked { opacity: 0.85; }
.as-msg.bot.team { border-color: rgba(216, 167, 125, 0.65); box-shadow: 0 0 0 1px rgba(216, 167, 125, 0.15); }
.as-msg.bot.waiting { opacity: 0.75; font-style: italic; }
.as-from { display: block; margin-bottom: 0.2rem; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
/* Assistant questions: replying */
.report-card.al-waiting { border-color: rgba(216, 167, 125, 0.55); }
.al-reply { margin-top: 0.6rem; padding: 0.6rem 0.8rem; border-left: 2px solid var(--gold); background: rgba(216, 167, 125, 0.06); border-radius: 0 8px 8px 0; }
.al-reply p { margin: 0; white-space: pre-wrap; }
.al-reply-form { margin-top: 0.7rem; }
.al-reply-form textarea { width: 100%; min-height: 3.2rem; resize: vertical; }
.al-reply-form .btn-row { margin-top: 0.4rem; }
.as-msg a, .section.alt .assistant .as-msg a:not(.btn) { color: var(--gold-hi); }
.as-msg.typing { display: flex; gap: 0.3rem; padding: 0.8rem 1rem; }
.as-msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: as-dot 1.1s ease-in-out infinite; }
.as-msg.typing span:nth-child(2) { animation-delay: 0.15s; }
.as-msg.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes as-dot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.as-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; padding: 0 1.2rem 0.8rem; }
.as-chip { font: inherit; font-size: 0.82rem; background: rgba(216, 167, 125, 0.1); color: var(--text); border: 1px solid rgba(216, 167, 125, 0.35); border-radius: 999px; padding: 0.35rem 0.8rem; cursor: pointer; }
.as-chip:hover { border-color: var(--gold); background: var(--gold-soft); }
.as-form { display: flex; gap: 0.6rem; align-items: flex-end; padding: 0.8rem 1.2rem; border-top: 1px solid rgba(216, 167, 125, 0.2); }
.as-form textarea { min-height: 2.7rem; max-height: 140px; resize: none; font-family: var(--font); font-size: 0.98rem; line-height: 1.4; }
.section.alt .assistant .as-form .btn { background: var(--metal); color: var(--ink); border-color: var(--gold); }
.section.alt .assistant .as-form .btn:hover { background: transparent; color: var(--gold); }
.as-foot, .section.alt .assistant .as-foot { margin: 0; padding: 0 1.2rem 0.9rem; font-size: 0.75rem; color: var(--muted); max-width: none; }
@media (prefers-reduced-motion: reduce) { .as-msg.typing span { animation: none; opacity: 0.7; } }

/* The side vine: panels sit edge to edge so the stem runs unbroken down the page */
.flourish { justify-content: flex-start; gap: 0; }
.flourish svg { margin: -1px 0; } /* overlap a hair, so no seam shows between panels */

/* ---------- The opening section fades in, piece by piece, once it is ready ----------
   (index.html adds "intro" straight away and "intro-in" when fonts, crest and dates are in) */
html.intro .hero-inner > *, html.intro .hero-bottom, html.intro .scroll-cue { opacity: 0; }
html.intro .hero-rays, html.intro .hero-glow, html.intro .sparkles, html.intro .flourish { opacity: 0; }
html.intro.intro-in .hero-rays, html.intro.intro-in .hero-glow, html.intro.intro-in .sparkles { opacity: 1; transition: opacity 1.8s ease; }
html.intro.intro-in .flourish { opacity: 0.85; transition: opacity 1.6s ease 0.4s; }
html.intro.intro-in .hero-inner > * { animation: intro-rise 0.95s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
html.intro.intro-in .hero-inner > :nth-child(2) { animation-delay: 0.3s; }
html.intro.intro-in .hero-inner > :nth-child(3) { animation-delay: 0.42s; }
html.intro.intro-in .hero-inner > :nth-child(4) { animation-delay: 0.6s; }
html.intro.intro-in .hero-inner > :nth-child(5) { animation-delay: 0.72s; }
html.intro.intro-in .hero-inner > :nth-child(6) { animation-delay: 0.84s; }
html.intro.intro-in .hero-inner > :nth-child(7) { animation-delay: 0.96s; }
html.intro.intro-in .hero-inner > :nth-child(8) { animation-delay: 1.1s; }
/* the crest settles in first, then keeps its gentle float */
html.intro.intro-in .hero-crest { animation: intro-crest 1.2s cubic-bezier(0.22, 0.61, 0.36, 1) both, crest-float 7s ease-in-out 1.2s infinite; }
/* the ornament's lines draw outwards from the diamond */
html.intro.intro-in .hero .ornament span { animation: intro-draw 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) 0.7s both; }
html.intro.intro-in .hero .ornament span:first-child { transform-origin: right center; }
html.intro.intro-in .hero .ornament span:last-child { transform-origin: left center; }
html.intro.intro-in .hero-bottom { animation: intro-fade 1.2s ease 1.15s both; }
html.intro.intro-in .scroll-cue { animation: intro-fade 1s ease 1.5s both; }
@keyframes intro-rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes intro-crest { from { opacity: 0; transform: translateY(-12px) scale(0.86); } to { opacity: 1; transform: none; } }
@keyframes intro-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes intro-fade { from { opacity: 0; } to { opacity: 1; } }
.hero #dates { min-height: 1.4em; } /* keeps its space while the dates load */

/* The side vines stay still while you move between pages */
.flourish.left { view-transition-name: flourish-left; }
.flourish.right { view-transition-name: flourish-right; }
::view-transition-group(flourish-left), ::view-transition-group(flourish-right) { animation-duration: 0s; }


/* ==========================================================================
   New for the app: announcements, food, song vote, speakers' list
   ========================================================================== */
.danger-text, .link-btn.danger-text, #nav .danger-text { color: var(--danger); }
.link-btn.danger-text:hover { color: #f4a3a8; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 0.88em; background: rgba(5, 25, 24, 0.6); border: 1px solid var(--line); border-radius: 6px; padding: 0.05rem 0.35rem; }
/* small rose gold dot: something new */
.new-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-hi); box-shadow: 0 0 0 3px rgba(246, 220, 194, 0.18); margin-left: 0.45rem; vertical-align: 0.15em; animation: dot-pulse 2.2s ease-in-out infinite; }
.nav-more-btn .new-dot { background: var(--ink); box-shadow: none; margin: 0; }
@keyframes dot-pulse { 50% { box-shadow: 0 0 0 6px rgba(246, 220, 194, 0); } }
.chip { font: inherit; font-size: 0.82rem; background: rgba(216, 167, 125, 0.08); color: var(--text); border: 1px solid rgba(216, 167, 125, 0.35); border-radius: 999px; padding: 0.3rem 0.75rem; cursor: pointer; transition: background 0.2s, border-color 0.2s, transform 0.2s; }
.chip:hover { border-color: var(--gold); background: var(--gold-soft); transform: translateY(-1px); }
.icon-btn { font: inherit; width: 2rem; height: 2rem; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.icon-btn:hover:not([disabled]) { color: var(--gold); border-color: rgba(216, 167, 125, 0.4); background: var(--gold-soft); }
.icon-btn.danger-text:hover:not([disabled]) { color: var(--danger); border-color: rgba(232, 114, 122, 0.4); background: rgba(232, 114, 122, 0.1); }
.icon-btn[disabled] { opacity: 0.25; cursor: default; }
.filter-tabs .day-tab[aria-pressed="true"] { background: var(--metal); color: var(--ink); border-color: var(--gold); }
.day-tab { transition: background 0.2s, color 0.2s, border-color 0.2s; }
.day-tab:hover { border-color: rgba(216, 167, 125, 0.6); }

/* ---------- Announcements ---------- */
.ann-compose { margin-bottom: 1.6rem; }
.ann-compose textarea.prose { min-height: 5rem; }
.ann-options { display: flex; flex-wrap: wrap; align-items: end; gap: 0.4rem 1.4rem; }
.ann-options .field { margin: 0; min-width: 230px; }
.ann-options .check { margin: 0 0 0.6rem; }
.ann-options .btn { margin-left: auto; }
.ann-list { display: flex; flex-direction: column; gap: 0.9rem; max-width: 820px; }
.ann-card { background: var(--panel); border: 1px solid rgba(216, 167, 125, 0.22); border-left: 3px solid var(--line); border-radius: 14px; padding: 1rem 1.2rem 0.8rem; }
.ann-card.pinned { border-left-color: var(--gold); }
.ann-card.important { border-left-color: var(--gold-hi); background: linear-gradient(100deg, rgba(216, 167, 125, 0.12), var(--panel) 45%); }
.ann-card.is-new { animation: ann-in 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
@keyframes ann-in { from { opacity: 0; transform: translateY(-10px) scale(0.98); } }
.ann-top { display: flex; justify-content: space-between; align-items: start; gap: 0.8rem; }
.ann-top h2 { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: 0.03em; color: var(--text); margin: 0 0 0.45rem; }
.ann-tags { display: flex; gap: 0.4rem; flex: none; }
.ann-tags .tag { margin: 0; }
.pill-imp { background: rgba(246, 220, 194, 0.14); color: var(--gold-hi); border: 1px solid rgba(246, 220, 194, 0.5); }
.ann-card p { max-width: none; }
.ann-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; font-size: 0.8rem; color: var(--muted); margin: 0.2rem 0 0; }
.ann-meta .pill { margin-left: 0.2rem; }
.ann-actions { margin-left: auto; display: flex; gap: 1rem; }
.ann-actions .link-btn { font-size: 0.72rem; }

/* ---------- Food ---------- */
.food-head, .timer-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; }
.food-section { margin: 1.4rem 0 2.6rem; }
.food-soon { text-align: center; max-width: 36rem; margin: 2rem auto 3rem; padding: 2.4rem 1.6rem; }
.food-soon h2 { margin: .3rem 0 .6rem; }
.food-soon[hidden] { display: none; }
.meal-list { display: flex; flex-direction: column; gap: 0.8rem; }
.meal { display: grid; grid-template-columns: 96px 1fr; gap: 1.2rem; background: var(--panel); border: 1px solid rgba(216, 167, 125, 0.22); border-radius: 14px; padding: 1rem 1.2rem; transition: border-color 0.3s, opacity 0.3s; }
.meal.live { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 16px 40px -20px rgba(216, 167, 125, 0.5); }
.meal.over { opacity: 0.6; }
.meal-time { display: flex; flex-direction: column; border-right: 1px solid var(--line); padding-right: 1rem; }
.meal-time b { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; color: var(--gold); line-height: 1.1; }
.meal-time span { font-size: 0.82rem; color: var(--muted); }
.meal h3 { font-family: var(--font-display); color: var(--text); margin: 0 0 0.2rem; letter-spacing: 0.03em; }
.meal-place { margin: 0 0 0.4rem; font-size: 0.88rem; }
.meal-items { margin: 0; padding-left: 1.1rem; }
.meal-items li::marker { content: "\25C6  "; color: var(--gold); font-size: 0.65em; }
.food-tools { display: flex; flex-wrap: wrap; gap: 0.7rem 1rem; align-items: center; margin-bottom: 1rem; }
.food-tools input { max-width: 280px; }
.food-tools .filter-tabs .day-tab { text-transform: capitalize; }
.rest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.rest { background: var(--panel); border: 1px solid rgba(216, 167, 125, 0.22); border-radius: 14px; padding: 1.1rem 1.2rem; }
.rest-head h3 { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: 0.04em; margin: 0 0 0.1rem; }
.rest-head p { font-size: 0.88rem; margin: 0 0 0.4rem; }
.menu { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.menu li { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.32rem 0; }
.menu .dish { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0.4rem; }
.menu .dots { flex: 1; border-bottom: 1px dotted rgba(216, 167, 125, 0.35); transform: translateY(-0.25em); min-width: 1rem; }
.menu .price { font-family: var(--font-display); font-weight: 600; color: var(--gold); white-space: nowrap; }
.diet { font-family: var(--font-label); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ok); border: 1px solid rgba(127, 214, 194, 0.4); border-radius: 999px; padding: 0 0.4rem; }
.food-editor .ed-list { display: flex; flex-direction: column; gap: 0.8rem; margin-bottom: 1.6rem; }
.food-editor > .panel { margin-bottom: 1.4rem; }
.ed-row { display: flex; flex-direction: column; gap: 0.6rem; animation: page-in 0.35s ease both; }
.ed-grid { display: grid; grid-template-columns: 110px 150px 150px 1fr 1fr; gap: 0.6rem; }
.ed-grid.rest-grid-ed { grid-template-columns: 1.2fr 1fr 1fr 1.4fr; }
.ed-row textarea.prose { min-height: 6.4rem; }
.ed-row textarea { min-height: 7rem; }
.ed-row-foot { display: flex; justify-content: flex-end; }
.editor-bar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 0.8rem; padding: 0.9rem 0; background: linear-gradient(180deg, transparent, var(--black) 30%); }
.editor-bar .status { margin: 0 auto 0 0; }
@media (max-width: 900px) {
  .ed-grid { grid-template-columns: 1fr 1fr 1fr; }
  .ed-grid > :nth-child(4) { grid-column: 1 / 3; }
  .ed-grid.rest-grid-ed { grid-template-columns: 1fr 1fr; }
  .ed-grid.rest-grid-ed > :nth-child(4) { grid-column: auto; }
}
@media (max-width: 760px) {
  .ed-grid { grid-template-columns: 1fr 1fr; }
  .ed-grid > :first-child, .ed-grid > :nth-child(4), .ed-grid > :nth-child(5) { grid-column: 1 / -1; }
  .ed-grid.rest-grid-ed > * { grid-column: 1 / -1; }
  .meal { grid-template-columns: 1fr; gap: 0.5rem; }
  .meal-time { flex-direction: row; align-items: baseline; gap: 0.5rem; border-right: 0; padding: 0; }
  .rest-grid { grid-template-columns: 1fr; }
}

/* ---------- Song vote ---------- */
.song-top { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 1rem 2rem; margin-bottom: 1.2rem; }
.song-state { margin: 0; }
.song-run .btn-row { margin-top: 0; }
.vote-pips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.pip { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--gold); transition: background 0.35s, transform 0.35s; }
.pip.full { background: var(--metal); transform: scale(1.08); }
.pip-text { font-size: 0.82rem; margin-left: 0.4rem; }
.song-add { display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 0 0.8rem; align-items: end; margin-bottom: 1.6rem; }
.song-add .field { margin: 0; }
.song-add .status { grid-column: 1 / -1; margin-top: 0.5rem; }
.song-add .status:empty { display: none; }
.song-list { list-style: none; margin: 0 0 2rem; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; max-width: 820px; }
.song { display: grid; grid-template-columns: 2.6rem 1fr auto; gap: 0.9rem; align-items: center; background: var(--panel); border: 1px solid rgba(216, 167, 125, 0.2); border-radius: 14px; padding: 0.75rem 1rem; position: relative; }
.song.is-new { animation: ann-in 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.song.first { border-color: var(--gold); box-shadow: 0 14px 34px -22px rgba(216, 167, 125, 0.6); }
.song-rank { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; text-align: center; color: var(--muted); }
.song.first .song-rank { background: var(--metal); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.song-main { min-width: 0; }
.song-title { margin: 0; font-size: 1.05rem; color: var(--text); overflow-wrap: anywhere; }
.song-artist { margin: 0; font-size: 0.85rem; }
.song-bar { height: 4px; border-radius: 99px; background: rgba(5, 25, 24, 0.6); margin-top: 0.45rem; overflow: hidden; }
.song-bar span { display: block; height: 100%; background: var(--metal); transition: width 0.6s cubic-bezier(0.22, 0.61, 0.36, 1); }
.song-actions { display: flex; gap: 1rem; margin-top: 0.35rem; }
.song-actions .link-btn { font-size: 0.7rem; padding: 0; }
.vote-btn { font: inherit; display: flex; flex-direction: column; align-items: center; gap: 0.05rem; min-width: 3.6rem; padding: 0.4rem 0.6rem; border-radius: 12px; border: 1px solid rgba(216, 167, 125, 0.45); background: transparent; color: var(--gold); cursor: pointer; transition: background 0.25s, color 0.25s, transform 0.15s, border-color 0.25s; }
.vote-btn:hover:not([disabled]) { background: var(--gold-soft); border-color: var(--gold); }
.vote-btn:active:not([disabled]) { transform: scale(0.94); }
.vote-btn.on, .vote-btn.on:hover:not([disabled]) { background: var(--metal); color: var(--ink); border-color: var(--gold); }
.vote-btn.on:hover:not([disabled]) { filter: brightness(1.08); }
.vote-btn.on .vote-heart { animation: heart-pop 0.4s ease; }
.vote-btn[disabled] { opacity: 0.45; cursor: default; }
.vote-btn.on[disabled] { opacity: 0.8; }
.vote-heart { font-size: 1.1rem; line-height: 1; }
.vote-btn b { font-weight: 400; font-size: 0.85rem; }
@keyframes heart-pop { 40% { transform: scale(1.35); } }
.song-list.played .song { opacity: 0.55; }
.song-empty { padding: 1rem 0; }
@media (max-width: 760px) {
  .song-top { grid-template-columns: 1fr 1fr; }
  .song-run { grid-column: 1 / -1; }
  .song-add { grid-template-columns: 1fr; gap: 0.6rem; }
  .song { grid-template-columns: 2rem 1fr auto; gap: 0.6rem; padding: 0.7rem 0.8rem; }
}

/* ---------- Speakers' list and timer ---------- */
.timer-head-tools { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.timer-head-tools .btn { flex: none; }
.timer-head-tools select { min-width: 180px; }
.timer-app { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1.2rem; align-items: start; }
.timer-card { text-align: center; display: flex; flex-direction: column; align-items: center; }
.speaker-name { font-family: var(--font-display); font-size: clamp(1.5rem, 3.4vw, 2.2rem); font-weight: 600; letter-spacing: 0.04em; color: var(--text); margin: 0 0 0.6rem; min-height: 1.3em; max-width: none; }
.speaker-name.empty-name { color: var(--muted); font-size: 1.2rem; font-family: var(--font); }
.speaker-name.swap { animation: name-in 0.5s cubic-bezier(0.22, 0.61, 0.36, 1); }
@keyframes name-in { from { opacity: 0; transform: translateY(8px); filter: blur(3px); } }
.ring-wrap { position: relative; width: min(300px, 70vw); aspect-ratio: 1; margin: 0.4rem auto 1.2rem; }
.ring-wrap .ring { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: none; stroke: rgba(5, 25, 24, 0.7); stroke-width: 10; }
.ring-bar { fill: none; stroke: url(#ring-metal); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 552.92; stroke-dashoffset: 0; filter: drop-shadow(0 0 6px rgba(216, 167, 125, 0.35)); }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.clock { font-family: var(--font-display); font-weight: 600; font-size: clamp(3rem, 9vw, 4.4rem); line-height: 1; color: var(--gold-hi); font-variant-numeric: tabular-nums; transition: color 0.4s; }
.clock-sub { font-size: 0.85rem; color: var(--muted); margin-top: 0.4rem; letter-spacing: 0.06em; }
.timer-card.low .clock { color: #f3c08f; }
.timer-card.low .ring-bar { animation: ring-pulse 1s ease-in-out infinite; }
.timer-card.over .clock { color: var(--danger); }
.timer-card.over .ring-track { stroke: rgba(232, 114, 122, 0.35); animation: over-flash 1.2s ease-in-out infinite; }
@keyframes ring-pulse { 50% { filter: drop-shadow(0 0 14px rgba(246, 220, 194, 0.8)); } }
@keyframes over-flash { 50% { stroke: rgba(232, 114, 122, 0.75); } }
.timer-controls { display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; margin-bottom: 1rem; }
.timer-controls .btn { min-width: 7.5rem; }
.speech-time { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.speech-time .slot-k { margin: 0; }
.speech-time .filter-tabs { justify-content: center; }
.sound-check { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0.2rem 0 0; cursor: pointer; }
.sound-check input { accent-color: var(--gold); }
.queue-head { display: flex; justify-content: space-between; align-items: baseline; }
.queue-add { display: flex; gap: 0.5rem; margin-bottom: 0.7rem; }
.quick-add { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.4rem; }
.queue-card .status:empty { display: none; }
.queue { list-style: none; margin: 0.4rem 0 0.8rem; padding: 0; }
.q-item { display: flex; align-items: center; gap: 0.7rem; padding: 0.45rem 0.2rem; border-top: 1px solid var(--line); }
.q-item.is-new { animation: page-in 0.35s ease both; }
.q-item:first-child { border-top: 0; }
.q-item:first-child .q-name { color: var(--gold); }
.q-item.me { background: var(--gold-soft); border-radius: 8px; }
.q-num { width: 1.8rem; height: 1.8rem; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); font-size: 0.8rem; color: var(--muted); }
.q-item:first-child .q-num { border-color: var(--gold); color: var(--gold); }
.q-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.q-tools { display: flex; gap: 0.1rem; }
.q-empty { padding: 0.6rem 0; }
.you-next { background: var(--metal); color: var(--ink); border-radius: 10px; padding: 0.5rem 0.8rem; margin: 0.2rem 0 0.6rem; animation: page-in 0.4s ease both; }
.spoken summary { cursor: pointer; color: var(--muted); font-size: 0.88rem; margin-bottom: 0.4rem; }
.spoken .plain-list { font-size: 0.88rem; }
@media (max-width: 860px) {
  .timer-app { grid-template-columns: 1fr; }
  .q-tools .icon-btn { width: 2.3rem; height: 2.3rem; }
}
/* Full screen (for the projector): just the speaker, the clock and who is next */
body.display-mode .site-header, body.display-mode .site-footer, body.display-mode .flourish,
body.display-mode .kicker, body.display-mode .page-head h1, body.display-mode #com-pick,
body.display-mode #controls, body.display-mode #speech-time, body.display-mode #keys,
body.display-mode .queue-add, body.display-mode .quick-add, body.display-mode #clear, body.display-mode .spoken,
body.display-mode .q-tools, body.display-mode #status { display: none !important; }
body.display-mode main.wrap { width: min(1400px, 100% - 3rem); }
body.display-mode .page-head { padding: 1rem 0 0; }
body.display-mode .timer-app { grid-template-columns: 1.5fr 1fr; align-items: center; min-height: calc(100vh - 6rem); }
body.display-mode .timer-card, body.display-mode .queue-card { background: transparent; border-color: transparent; }
body.display-mode .ring-wrap { width: min(54vh, 44vw); }
body.display-mode .clock { font-size: min(13vh, 9vw); }
body.display-mode .speaker-name { font-size: min(7vh, 4.5vw); }
body.display-mode .q-item { font-size: 1.5rem; padding: 0.7rem 0.2rem; }
body.display-mode .q-num { width: 2.4rem; height: 2.4rem; font-size: 1rem; }
body.display-mode .queue li:nth-child(n+7) { display: none; }

/* ---------- Menu groups: invisible on wide screens, tidy tiles on phones ---------- */
.nav-group { display: contents; }
.nav-k { display: none; }
@media (max-width: 900px) { /* phones and iPads held upright: the tile menu */
  /* The menu floats over the page (so nothing below jumps) and glides in and out:
     it is always there, just faded and lifted a little while closed. */
  .site-header .bar { position: static; }
  #nav, #nav.open {
    display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 1.2rem;
    position: absolute; left: 0; right: 0; top: 100%; z-index: 51;
    padding: 0.9rem 1.25rem 1.3rem; background: var(--coal); border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -24px rgba(0, 0, 0, 0.8);
    max-height: calc(100vh - 72px); max-height: calc(100dvh - 72px); overflow-y: auto;
    overscroll-behavior: contain; /* scrolling the menu never scrolls the page behind it */
    opacity: 0; visibility: hidden; transform: translateY(-12px); pointer-events: none;
    transition: opacity 0.28s ease, transform 0.38s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0s linear 0.38s;
  }
  #nav.open {
    opacity: 1; visibility: visible; transform: none; pointer-events: auto;
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  /* the tiles ripple in, top to bottom */
  #nav .nav-k, #nav a, #nav .link-btn { transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1); }
  #nav:not(.open) .nav-k, #nav:not(.open) a, #nav:not(.open) .link-btn { opacity: 0; transform: translateY(-6px); transition-duration: 0.2s; transition-delay: 0s !important; }
  #nav.open .nav-group > :nth-child(n+3) { transition-delay: 0.03s; }
  #nav.open .nav-group > :nth-child(n+5) { transition-delay: 0.06s; }
  #nav.open .nav-more-panel > * { transition-delay: 0.09s; }
  #nav.open .nav-more-panel > :nth-child(n+4) { transition-delay: 0.12s; }
  #nav.open .nav-more-panel > :nth-child(n+8) { transition-delay: 0.15s; }
  .nav-group, .nav-more-panel { display: grid !important; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
  .nav-more { width: 100%; }
  #nav > * { flex-shrink: 0; } /* a long menu scrolls; it never squeezes or spills into a second column */
  .nav-k { display: block; grid-column: 1 / -1; margin: 0 0 0.15rem; font-family: var(--font-label); font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
  #nav a, #nav .nav-more-panel a {
    display: flex; align-items: center; gap: 0.4rem; min-height: 3rem;
    padding: 0.7rem 0.85rem; font-size: 0.76rem; letter-spacing: 0.08em; line-height: 1.25;
    border: 1px solid rgba(216, 167, 125, 0.2); border-radius: 12px; background: rgba(255, 255, 255, 0.03);
  }
  #nav a[aria-current="page"], #nav .nav-more-panel a[aria-current="page"] { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
  #nav a:hover, #nav .nav-more-panel a:hover { border-color: rgba(216, 167, 125, 0.5); background: var(--gold-soft); }
  /* Sign out: a clear pill across the bottom, instead of the odd half-line */
  #nav .nav-more-panel .link-btn {
    grid-column: 1 / -1; margin-top: 0.4rem; padding: 0.75rem; text-align: center;
    border: 1px solid rgba(216, 167, 125, 0.5) !important; border-radius: 999px !important; background: none;
  }
  /* Menu open: the page stays still, and the area under the menu dims; tap it to close */
  html.menu-open { overflow: hidden; } /* only on html: on body it would unstick the header */
  html.menu-open .site-header { transform: none; }
  html.menu-open .menu-shade { opacity: 1; visibility: visible; transition: opacity 0.3s ease; }
}
.menu-shade {
  position: fixed; left: 0; right: 0; bottom: 0; top: 0; z-index: 49;
  background: rgba(3, 18, 17, 0.6); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0s linear 0.3s;
  -webkit-tap-highlight-color: transparent;
}


/* ---------- Colour polish (still teal and rose gold) ---------- */
/* Text boxes sit a little deeper than the cards around them, so forms read clearly */
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="time"], input[type="date"], select, textarea {
  background: #061c1b; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}
/* A thin polished rose gold edge along the top of each card, like the rim of the crest */
.panel, .slot, .meal, .rest, .song, .ann-card, .delegate-card, .result { position: relative; }
.panel::before, .slot::before, .meal::before, .rest::before, .song::before, .ann-card::before, .delegate-card::before, .result::before {
  content: ""; position: absolute; top: -1px; left: 14%; right: 14%; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(246, 220, 194, 0.7) 30%, rgba(216, 167, 125, 0.95) 50%, rgba(246, 220, 194, 0.7) 70%, transparent);
}
/* Speakers' timer: the last 10 seconds glow brighter rose gold; red only once time is over */
.timer-card.low .clock { color: #ffe9d2; text-shadow: 0 0 22px rgba(246, 220, 194, 0.55); }
.timer-card.low .ring-bar { stroke-width: 12; }
/* Committee accents: each committee has its own shade of teal or gold (set by the page as --accent) */
.com-accent { color: var(--accent, var(--gold)); }
.com-chip { display: inline-flex; align-items: center; gap: 0.4rem; }
.com-chip::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--accent, var(--gold)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, var(--gold)) 22%, transparent); flex: none; }
.timer-card[style*="--accent"], .com-summary[style*="--accent"] { border-top: 2px solid var(--accent); }

/* ==========================================================================
   Pager calls, documents, emergency, offline, awards, feedback, My ID
   ========================================================================== */

/* ---------- Emergency alert: the one place that is red, not teal ---------- */
.emergency { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 1.2rem;
  background: radial-gradient(circle at 50% 30%, rgba(150, 28, 40, 0.97), rgba(70, 8, 16, 0.98)); animation: em-in 0.4s ease both; }
.emergency::before { content: ""; position: absolute; inset: 0; border: 6px solid rgba(255, 200, 200, 0.5); animation: em-pulse 1.4s ease-in-out infinite; pointer-events: none; }
.em-card { max-width: 560px; text-align: center; color: #fff; }
.em-k { font-family: var(--font-label); letter-spacing: 0.35em; text-transform: uppercase; font-size: 0.9rem; color: #ffd6d6; margin: 0 auto 0.6rem; }
.em-card h2 { font-family: var(--font); font-size: clamp(1.6rem, 6vw, 2.4rem); color: #fff; line-height: 1.3; margin: 0 0 1rem; }
.em-card p { margin-inline: auto; }
.em-meta, .em-help { color: #ffd6d6; }
.emergency .btn.em-ok { background: #fff; color: #7a0d18; border-color: #fff; margin-top: 0.6rem; box-shadow: none; }
.emergency .btn.em-ok:hover { background: transparent; color: #fff; }
.emergency-bar { position: fixed; left: 0; right: 0; top: 0; z-index: 120; font: inherit; font-size: 0.9rem; text-align: center; cursor: pointer;
  padding: 0.5rem 1rem; background: #9b1c2a; color: #fff; border: 0; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); animation: em-in 0.4s ease both; }
html.has-emergency .site-header { top: 2.3rem; }
@keyframes em-in { from { opacity: 0; } }
@keyframes em-pulse { 50% { border-color: rgba(255, 200, 200, 0.12); } }
.em-panel { margin-top: 2.4rem; max-width: 820px; border-color: rgba(232, 114, 122, 0.45) !important; }
.em-panel .slot-k { color: var(--danger); }
.em-live { color: #ffd6d6; background: rgba(155, 28, 42, 0.35); border-radius: 10px; padding: 0.6rem 0.8rem; }

/* ---------- Offline note ---------- */
.offline-note { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 110; max-width: calc(100% - 2rem);
  background: var(--panel-2); color: var(--text); border: 1px solid var(--gold); border-radius: 14px; padding: 0.5rem 1rem; font-size: 0.88rem; text-align: center; width: max-content;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.7); animation: page-in 0.4s ease both; }

/* ---------- Pager calls ---------- */
.pager-call { display: grid; grid-template-columns: 1fr auto; gap: 1rem 2rem; align-items: center; margin-bottom: 2rem; }
.pager-call-main .field:last-child { margin-bottom: 0; }
.pager-where { font-family: var(--font-display); font-size: 1.3rem; color: var(--text); margin: 0 0 0.8rem; }
.pager-call > .status { grid-column: 1 / -1; margin: 0; }
.pager-call > .status:empty { display: none; }
.pager-btn { position: relative; width: 168px; height: 168px; border-radius: 50%; border: 1px solid var(--gold); cursor: pointer;
  font-family: var(--font-label); font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.35; padding: 1.4rem;
  background: var(--metal); color: var(--ink); box-shadow: 0 18px 40px -16px rgba(216, 167, 125, 0.7); transition: transform 0.2s, box-shadow 0.3s, background 0.3s, color 0.3s; }
.pager-btn:hover:not([disabled]) { transform: translateY(-2px) scale(1.02); }
.pager-btn:active:not([disabled]) { transform: scale(0.96); }
.pager-btn[disabled] { cursor: default; }
.pager-btn .pager-ring { position: absolute; inset: -1px; border-radius: 50%; border: 2px solid var(--gold); opacity: 0; pointer-events: none; }
.pager-btn.waiting { background: var(--panel-2); color: var(--gold-hi); }
.pager-btn.waiting .pager-ring { animation: pager-ring 1.8s ease-out infinite; }
.pager-btn.coming { background: rgba(127, 214, 194, 0.16); color: var(--ok); border-color: var(--ok); box-shadow: none; }
.pager-btn .pager-cancel { display: block; margin-top: 6px; font-size: 0.72em; font-weight: 400; opacity: 0.8; } /* (your call is live: pressing again cancels it) */
@keyframes pager-ring { 0% { opacity: 0.8; transform: scale(1); } 100% { opacity: 0; transform: scale(1.35); } }
.call-list { display: flex; flex-direction: column; gap: 0.7rem; max-width: 820px; margin-bottom: 1.4rem; }
.call { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem 1.2rem; flex-wrap: wrap; position: relative;
  background: var(--panel); border: 1px solid rgba(216, 167, 125, 0.22); border-left: 3px solid var(--accent, var(--gold)); border-radius: 14px; padding: 0.85rem 1.1rem; animation: page-in 0.35s ease both; }
.call.open { box-shadow: 0 0 0 1px rgba(216, 167, 125, 0.35), 0 14px 30px -20px rgba(216, 167, 125, 0.6); }
.call.done, .call.cancelled { opacity: 0.6; animation: none; }
.call-where { margin: 0; font-family: var(--font-display); font-size: 1.15rem; color: var(--text); display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.call-where a { color: var(--text); }
.call-note { margin: 0.2rem 0 0; }
.call-meta { margin: 0.25rem 0 0; font-size: 0.85rem; color: var(--muted); }
.call-to.me { color: var(--gold-hi); font-weight: 700; }
#who-search { margin-bottom: 0.45rem; }
.call.open .call-state { color: var(--gold-hi); }
.call.taken .call-state { color: var(--ok); }
.call-actions { display: flex; align-items: center; gap: 0.8rem; }
@media (max-width: 640px) {
  .pager-call { grid-template-columns: 1fr; justify-items: center; }
  .pager-call-main { width: 100%; }
  .call-actions { width: 100%; }
  .call-actions .btn { flex: 1; }
}

/* ---------- Documents ---------- */
.doc-add { margin-bottom: 1.8rem; }
.doc-add-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 0 0.8rem; }
.file-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; text-transform: none; letter-spacing: 0;
  min-height: 6.5rem; border: 1.5px dashed rgba(216, 167, 125, 0.45); border-radius: 12px; background: rgba(5, 25, 24, 0.45); cursor: pointer; transition: border-color 0.2s, background 0.2s; text-align: center; padding: 0.8rem; }
.file-drop:hover, .file-drop.over { border-color: var(--gold); background: var(--gold-soft); }
.file-drop.has-file { border-style: solid; border-color: var(--ok); }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop-k { font-family: var(--font-label); font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.doc-add-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.9rem; }
.doc-add-foot .status { margin: 0; }
.doc-add-foot .btn, .fb-foot .btn { flex: none; }
@media (max-width: 640px) { .doc-add-foot, .fb-foot { flex-direction: column-reverse; align-items: stretch; } }
.upload-bar { height: 4px; border-radius: 99px; background: rgba(5, 25, 24, 0.6); margin-top: 0.7rem; overflow: hidden; }
.upload-bar span { display: block; height: 100%; width: 0; background: var(--metal); transition: width 0.2s; }
.doc-tools { display: flex; flex-wrap: wrap; gap: 0.7rem 1rem; align-items: center; margin-bottom: 1rem; }
.doc-tools input { max-width: 280px; }
.doc-list { display: flex; flex-direction: column; gap: 0.6rem; max-width: 900px; }
.doc { display: flex; align-items: center; gap: 0.8rem 1rem; flex-wrap: wrap; position: relative; background: var(--panel); border: 1px solid rgba(216, 167, 125, 0.22); border-radius: 14px; padding: 0.75rem 1rem; transition: border-color 0.2s, transform 0.2s; }
.doc:hover { border-color: rgba(216, 167, 125, 0.5); }
.doc-open { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 0.9rem; text-decoration: none; color: var(--text); }
.doc-icon { flex: none; width: 2.8rem; height: 3.4rem; display: grid; place-items: end center; padding-bottom: 0.4rem; border-radius: 6px 14px 6px 6px;
  background: linear-gradient(160deg, rgba(216, 167, 125, 0.25), rgba(216, 167, 125, 0.06)); border: 1px solid var(--accent, var(--gold));
  font-family: var(--font-label); font-size: 0.62rem; letter-spacing: 0.1em; color: var(--accent, var(--gold)); }
.doc-text { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.doc-title { font-size: 1.02rem; overflow-wrap: anywhere; }
.doc-meta { font-size: 0.8rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; }
.doc-actions { display: flex; align-items: center; gap: 0.9rem; }
@media (max-width: 640px) { .doc-add-grid { grid-template-columns: 1fr; } .doc-actions { width: 100%; justify-content: space-between; } }

/* ---------- Awards ---------- */
.awards-head h1 { background: var(--metal); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.award-editor { margin-bottom: 2rem; }
.award-add { display: grid; grid-template-columns: 1.1fr 1fr 1.3fr auto; gap: 0 0.8rem; align-items: end; }
.award-add .field { margin: 0; }
#aw-who { margin-top: 0.4rem; }
.award-rows { list-style: none; margin: 1rem 0 0; padding: 0; }
.award-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; flex-wrap: wrap; padding: 0.55rem 0.2rem 0.55rem 0.7rem; border-top: 1px solid var(--line); border-left: 3px solid var(--accent, var(--line)); }
.award-row.is-revealed { background: var(--gold-soft); }
.award-row-tools { display: flex; align-items: center; gap: 0.2rem; }
.award-row-tools .btn { margin-right: 0.4rem; }
.award-group { margin-bottom: 2.2rem; }
.award-group-title { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: 0.06em; }
.award-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.award { position: relative; text-align: center; padding: 1.4rem 1.1rem 1.2rem; border-radius: 16px; overflow: hidden;
  background: linear-gradient(170deg, rgba(216, 167, 125, 0.16), var(--panel) 55%); border: 1px solid rgba(216, 167, 125, 0.45);
  box-shadow: 0 18px 40px -26px rgba(216, 167, 125, 0.7); animation: award-in 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.award::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255, 241, 227, 0.16) 50%, transparent 65%); background-size: 250% 100%; animation: foil 5s ease-in-out infinite; pointer-events: none; }
.award-name { font-family: var(--font-label); font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); margin: 0 auto 0.5rem; }
.award-winner { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; color: var(--text); margin: 0 auto 0.2rem; }
.award-country { color: var(--muted); margin: 0 auto 0.6rem; }
.award .com-chip { margin-top: 0.2rem; }
@keyframes award-in { from { opacity: 0; transform: translateY(14px) scale(0.97); } }
@keyframes foil { 0%, 100% { background-position: 120% 0; } 50% { background-position: -20% 0; } }
.award-empty { padding: 2rem 0; }
/* the reveal: full screen, crest, award, then the winner rising in rose gold */
.award-reveal { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; overflow: hidden; background: rgba(4, 20, 19, 0.96); opacity: 0; transition: opacity 0.5s ease; }
.award-reveal.in { opacity: 1; }
.award-reveal.out { opacity: 0; }
.reveal-rays { position: absolute; left: 50%; top: 45%; width: 160vmax; height: 160vmax; transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg, rgba(216, 167, 125, 0.06) 0deg 5deg, transparent 5deg 15deg); animation: rays-turn 60s linear infinite;
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 55%); mask-image: radial-gradient(circle, #000 0%, transparent 55%); }
.reveal-inner { position: relative; text-align: center; padding: 1.5rem; }
.reveal-inner > * { margin-inline: auto; opacity: 0; }
.award-reveal.in .reveal-crest { animation: reveal-up 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) 0.1s both; }
.award-reveal.in .reveal-award { animation: reveal-up 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) 0.6s both; }
.award-reveal.in .reveal-name { animation: reveal-name 1.4s cubic-bezier(0.22, 0.61, 0.36, 1) 1.6s both; }
.award-reveal.in .reveal-country { animation: reveal-up 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) 2.4s both; }
.award-reveal.in .reveal-close { animation: reveal-up 0.6s ease 3.2s both; }
.reveal-crest { width: 92px; filter: drop-shadow(0 8px 24px rgba(216, 167, 125, 0.45)); }
.reveal-award { font-family: var(--font-label); letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); font-size: clamp(0.85rem, 2.4vw, 1.1rem); margin: 1rem auto 0.8rem; max-width: none; }
.reveal-name { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.4rem, 9vw, 5rem); line-height: 1.1; max-width: 14ch; margin: 0 auto 0.6rem;
  background: var(--metal); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 4px 18px rgba(216, 167, 125, 0.35)); }
.reveal-country { color: var(--text); font-size: clamp(1rem, 3vw, 1.4rem); margin: 0 auto 1.6rem; }
@keyframes reveal-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes reveal-name { from { opacity: 0; transform: translateY(30px) scale(0.92); filter: blur(8px); } to { opacity: 1; transform: none; filter: drop-shadow(0 4px 18px rgba(216, 167, 125, 0.35)); } }
@media (max-width: 760px) { .award-add { grid-template-columns: 1fr; gap: 0.2rem; } .award-add .btn { margin-top: 0.6rem; } }
@media (prefers-reduced-motion: reduce) { .award::after, .reveal-rays { animation: none; } }

/* ---------- Feedback ---------- */
.fb-tabs { margin-bottom: 1.2rem; }
.fb-form { max-width: 640px; }
.fb-q { padding: 0.7rem 0; border-top: 1px solid var(--line); }
.fb-q:first-child { border-top: 0; }
.fb-label { margin: 0 0 0.3rem; font-size: 1.02rem; }
.fb-stars { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.stars { display: flex; gap: 0.15rem; }
.star { font-size: 2rem; line-height: 1; width: 2.6rem; height: 2.6rem; display: grid; place-items: center; background: none; border: 0; cursor: pointer;
  color: rgba(216, 167, 125, 0.25); transition: color 0.2s, transform 0.2s; padding: 0; }
.star:hover { transform: scale(1.12); color: rgba(216, 167, 125, 0.55); }
.star.on { color: var(--gold); text-shadow: 0 0 14px rgba(246, 220, 194, 0.45); }
.star-word { font-size: 0.85rem; min-width: 5rem; }
.fb-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.fb-foot .status { margin: 0; }
.fb-sums { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.fb-sum-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; margin-bottom: 0.4rem; }
.fb-sum-head h3 { margin: 0; color: var(--text); }
.fb-row { display: grid; grid-template-columns: 7.5rem 1fr 2.2rem; gap: 0.6rem; align-items: center; padding: 0.3rem 0; font-size: 0.9rem; }
.fb-bar { height: 6px; border-radius: 99px; background: rgba(5, 25, 24, 0.6); overflow: hidden; }
.fb-bar span { display: block; height: 100%; background: var(--metal); transition: width 0.8s cubic-bezier(0.22, 0.61, 0.36, 1); }
.fb-score { font-family: var(--font-display); color: var(--gold); text-align: right; }
.fb-comments { max-width: 820px; }
.fb-comment { margin: 0; }

/* ---------- Dashboard: ID barcode and feedback reminder ---------- */
.day-extras { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-top: 1rem; }
.id-code { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 10px; overflow: hidden; }
.barcode { background: #fff; padding: 0.6rem; border-radius: 10px; }
.barcode svg { display: block; width: 100%; height: 70px; }
.id-num { font-family: var(--font-display); letter-spacing: 0.18em; text-align: center; color: var(--gold-hi); margin: 0.5rem 0 0.2rem; max-width: none; }
.id-big { position: fixed; inset: 0; z-index: 160; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 1.5rem; animation: em-in 0.3s ease both; transition: opacity 0.3s; }
.id-big.out { opacity: 0; }
.id-big .barcode { width: min(560px, 100%); padding: 1rem 0; }
.id-big .barcode svg { height: 34vw; max-height: 190px; }
.id-big-name { color: #0a2826; font-family: var(--font-display); font-size: 1.4rem; margin: 0; }
.id-big-num { color: #0a2826; font-family: var(--font-display); font-size: 1.6rem; letter-spacing: 0.2em; margin: 0; }
.id-big-hint { color: #4b5d5a; font-size: 0.85rem; margin: 0; }
.fb-prompt { border-color: var(--gold) !important; }
.fb-prompt .btn { margin-top: 0.4rem; }

/* Tablets and small laptops: tighten the menu so it stays on one line */
@media (min-width: 901px) and (max-width: 1000px) {
  #nav { gap: 0.3rem 0.85rem; }
  #nav a, #nav .link-btn { font-size: 0.74rem; letter-spacing: 0.07em; }
  .nav-more-btn { font-size: 0.72rem; padding: 0.28rem 0.7rem; }
  .bar { gap: 0.6rem 1.2rem; }
  .brand { font-size: 1.15rem; }
}

/* ---------- Loading: soft placeholders while information arrives, then a gentle fade in ---------- */
@keyframes sk-shine { from { background-position: 120% 0; } to { background-position: -20% 0; } }
.schedule li.skeleton span, .sk-line {
  display: block; height: 0.85rem; border-radius: 6px;
  background: linear-gradient(100deg, rgba(216, 167, 125, 0.07) 30%, rgba(216, 167, 125, 0.16) 50%, rgba(216, 167, 125, 0.07) 70%);
  background-size: 250% 100%; animation: sk-shine 1.4s ease-in-out infinite;
}
.schedule li.skeleton span:nth-child(1) { width: 6.5rem; }
.schedule li.skeleton span:nth-child(2) { width: 70%; }
.schedule li.skeleton span:nth-child(3) { width: 5rem; }
.sk-line { margin: 0 0 0.7rem; width: 85%; }
.sk-line.short { width: 40%; height: 0.65rem; }
.sk-line.mid { width: 60%; }
/* real rows and cards fade in softly as they replace the placeholders */
@keyframes soft-in { from { opacity: 0; transform: translateY(4px); } }
.schedule li:not(.skeleton) { animation: soft-in 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.schedule li:nth-child(2):not(.skeleton) { animation-delay: 0.03s; }
.schedule li:nth-child(3):not(.skeleton) { animation-delay: 0.06s; }
.schedule li:nth-child(4):not(.skeleton) { animation-delay: 0.09s; }
.schedule li:nth-child(5):not(.skeleton) { animation-delay: 0.12s; }
.schedule li:nth-child(n+6):not(.skeleton) { animation-delay: 0.15s; }
.slot > :not(.sk-line) { animation: soft-in 0.35s ease both; }
@media (prefers-reduced-motion: reduce) {
  .schedule li.skeleton span, .sk-line { animation: none; }
  .schedule li:not(.skeleton), .slot > :not(.sk-line) { animation-name: page-fade !important; } /* fade only, no movement */
}

/* ---------- Phones and tablets: the same look, much lighter to draw ----------
   Big spinning or blurred layers are hard work for phones (iPhone Safari can even close the
   page), and a blurred menu bar is redrawn on every scroll, which makes scrolling stutter in
   Chrome. On touch screens these are swapped for still, solid versions that look the same. */
.hero-glow { filter: none; } /* the gradient is already soft; the blur only cost speed */
@media (pointer: coarse), (max-width: 1024px) {
  .hero-rays { width: 130vmax; height: 130vmax; animation: none; }
  .site-header, html.menu-open .site-header { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(10, 40, 38, 0.96); }
  .menu-shade { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(3, 18, 17, 0.72); }
  .nav-more-panel { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .hero-crest { filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45)); }
  .brand { text-shadow: none; }
}
.my-votes { font-family: var(--font-display); font-size: 1.6rem; line-height: 1; background: var(--metal); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* iPads held upright: three tiles per row in the menu, so it is not too tall */
@media (min-width: 600px) and (max-width: 900px) {
  .nav-group, .nav-more-panel { grid-template-columns: 1fr 1fr 1fr; }
  #nav, #nav.open { padding-inline: max(1.25rem, calc((100% - 1080px) / 2)); }
}
/* the sign-in code: big, evenly spaced digits */
.code-input { font-size: 1.6rem !important; letter-spacing: 0.5em; text-align: center; font-variant-numeric: tabular-nums; padding-left: 1rem !important; }
.code-input::placeholder { color: rgba(216, 167, 125, 0.25); }

/* ---------- Sign in: a calm welcome screen, the card in the middle and the footer out of the way ---------- */
.login-main { display: flex; flex-direction: column; justify-content: center; align-items: center;
  min-height: calc(100vh - 60px); min-height: calc(100svh - 60px); padding-block: 1.5rem 3rem; }
.login-main .page-head { text-align: center; padding-top: 0; width: 100%; max-width: 460px; }
.login-main .page-head p { margin-inline: auto; }
.login-main .panel { width: 100%; max-width: 460px; }
.login-crest { display: block; margin: 0 auto 0.6rem; width: 84px; height: auto; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45)); }

/* the offline note: above the iPhone home bar, tap to hide, and never over the open menu */
.offline-note { bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); font: inherit; font-size: 0.85rem; cursor: pointer; display: flex; align-items: center; gap: 0.6rem; }
.offline-note[hidden] { display: none; }
.offline-x { font-size: 1.1rem; line-height: 1; color: var(--gold); }
html.menu-open .offline-note { display: none; }

/* time boxes: never cut off the time (some browsers squeeze "AM" / "PM" out of narrow boxes) */
input[type="time"] { min-width: 0; font-variant-numeric: tabular-nums; }
.sched-row > *, .duty-row > *, .ed-grid > * { min-width: 0; }

/* ---------- iPhone / iPad: date and time boxes ----------
   Safari gives these boxes their own minimum width and ignores "width: 100%", so they stuck out
   past the edge of their panel (Manage page: First day, Opening time, schedule times; Food editor).
   Dropping Safari's own look lets them size like every other box; the text lines up on the left too. */
input[type="date"], input[type="time"] {
  -webkit-appearance: none; appearance: none;
  display: block; min-width: 0; max-width: 100%; width: 100%;
  min-height: 2.6rem; line-height: 1.4;
}
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
input[type="date"]::-webkit-calendar-picker-indicator, input[type="time"]::-webkit-calendar-picker-indicator { opacity: 0.7; filter: invert(0.8) sepia(0.4); cursor: pointer; }

/* ---------- Song vote: search the real catalogue, album covers ---------- */
.song-add { display: block; }
.song-add .field { margin: 0 0 0.6rem; }
.song-add .hint { margin: 0.4rem 0 0; }
.song { grid-template-columns: 2.6rem auto 1fr auto; }
.song-art { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; border: 1px solid rgba(216, 167, 125, 0.35); background: rgba(5, 25, 24, 0.6); display: block; flex: none; }
.empty-art { display: block; }
.song-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.song-results:empty { display: none; }
.result-note { padding: 0.5rem 0.2rem; font-size: 0.9rem; }
.result-btn { font: inherit; width: 100%; display: flex; align-items: center; gap: 0.8rem; text-align: left; cursor: pointer;
  background: rgba(5, 25, 24, 0.45); color: var(--text); border: 1px solid rgba(216, 167, 125, 0.2); border-radius: 12px; padding: 0.45rem 0.6rem;
  transition: border-color 0.2s, background 0.2s, transform 0.15s; animation: soft-in 0.3s ease both; }
.result-btn:hover { border-color: var(--gold); background: var(--gold-soft); }
.result-btn:active { transform: scale(0.99); }
.result-btn .song-art { width: 44px; height: 44px; }
.result-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.result-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-artist { font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-add { flex: none; font-family: var(--font-label); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.35rem 0.8rem; border-radius: 999px; background: var(--metal); color: var(--ink); }
@media (max-width: 760px) { .song { grid-template-columns: 2rem auto 1fr auto; } .song-art { width: 42px; height: 42px; } }

/* songs waiting for approval */
.pending-box { margin-bottom: 1.4rem; border-color: rgba(216, 167, 125, 0.45) !important; }
.pending-box .hint { margin: 0 0 0.7rem; }
.pending-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.pending-row { display: flex; align-items: center; gap: 0.8rem; padding: 0.45rem 0.6rem; border-radius: 12px; background: rgba(5, 25, 24, 0.45);
  border: 1px solid rgba(216, 167, 125, 0.18); animation: soft-in 0.3s ease both; }
.pending-row .song-art { width: 44px; height: 44px; }
.pending-tools { display: flex; gap: 0.4rem; flex: none; }
@media (max-width: 520px) { .pending-row { flex-wrap: wrap; } .pending-tools { width: 100%; justify-content: flex-end; } }
.day-tab[disabled] { opacity: 0.35; cursor: not-allowed; }

/* the vine moves with the page (see WES.flourishes); the track holds the panels edge to edge */
.flourish-track { display: flex; flex-direction: column; flex: none; will-change: transform; }
.flourish-track svg { display: block; width: 100%; height: auto; flex: none; margin: -1px 0; }

/* ---------- Check-in and meals: what you are scanning for, and session attendance ---------- */
.scan-modes { margin: -0.2rem 0 1rem; }
.scan-modes .slot-k { margin: 0 0 0.45rem; }
.scan-mode-tabs, .session-tabs { margin: 0 0 1rem; }
.session-tabs { margin-top: 0.8rem; }
.scan-warn { color: var(--gold); font-weight: 600; }
.fl-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.scan-panel ~ .panel .meter { margin: 0.2rem 0 0.8rem; }
#nfc-btn:disabled { opacity: 1; border-color: var(--ok); color: var(--ok); }
/* the scan box: even gaps, the two buttons side by side, and no empty space at the bottom */
.scan-panel .scan-row { gap: 0.7rem; }
.scan-panel .btn-row { margin-top: 1rem; gap: 0.6rem; }
.scan-panel .btn-row .btn { flex: 1 1 0; justify-content: center; text-align: center; }
.scan-panel .status:empty { display: none; }
/* (a plugged-in card reader is for computers: the hint is left out on phones) */
@media (pointer: coarse) { .scan-panel .hint { display: none; } }

/* iPhone NFC: while iPhone's "Ready to Scan" sheet covers the bottom half of the screen, the top half shows
   what was just scanned, big and clear (see liveView in checkin.js) */
.nfc-live { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; gap: 0.9rem;
  padding: calc(1.1rem + var(--top, env(safe-area-inset-top, 0px))) 1.1rem 0; background: #071f1d; animation: tab-in 0.2s ease both; }
.nfc-live[hidden] { display: none; }
.nfc-live-top { display: flex; align-items: center; gap: 0.8rem; }
.nfc-live .nfc-live-back { display: grid; place-items: center; flex: none; width: 42px; height: 42px; padding: 0; border-radius: 50%; color: var(--gold);
  background: rgba(12, 44, 41, 0.82); border: 1px solid rgba(216, 167, 125, 0.4); }
.nfc-live .nfc-live-back svg { width: 22px; height: 22px; margin-left: -2px; }
.nfc-live .nfc-live-back:active { transform: scale(0.9); }
.nfc-live-k { margin: 0; font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.nfc-live-k b { color: var(--gold); font-weight: 600; }
.nfc-live .scan-result { margin: 0; min-height: 7.5rem; }
.nfc-live .scan-big { font-size: 1.7rem; }
.nfc-live-wait { margin: 0; display: grid; place-items: center; min-height: 7.5rem; padding: 1rem; text-align: center; border-radius: 12px;
  border: 1px dashed rgba(216, 167, 125, 0.45); color: var(--muted); }
.nfc-live-count { margin: 0; color: var(--muted); font-size: 0.9rem; }
.nfc-live-count b { color: var(--text); }

/* ---------- Dashboard: my meals ---------- */
.meal-list { list-style: none; margin: 0.3rem 0 0.4rem; padding: 0; }
.meal-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.8rem; padding: 0.45rem 0; border-top: 1px solid var(--line); }
.meal-list li:first-child { border-top: 0; }
.meal-state { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.meal-list li.got .meal-state { color: var(--ok); font-weight: 600; }
.meal-list li.now .meal-state { color: var(--gold); font-weight: 600; }
.meal-list li.missed .meal-state { color: var(--danger); }

/* ---------- Keep the page clear of the side vines ----------
   The vines sit in fixed side strips; the content column leaves room for them, so text and
   cards never run underneath (tablets and narrow windows used to overlap them). */
:root { --vine-w: 0px; } /* the vines are switched off (VINES in common.js); was clamp(60px, 7vw, 140px) */
.flourish { width: var(--vine-w); }
body > main.wrap, body > main:not(.wrap) .wrap, body > .site-footer .wrap { width: min(1080px, 100% - 2 * (var(--vine-w) + 1.5rem)); }
@media (max-width: 1100px) {
  :root { --vine-w: 0px; } /* (was 40px, with the vines) */
  .flourish { opacity: 0.5; }
  body > main.wrap, body > main:not(.wrap) .wrap, body > .site-footer .wrap { width: min(1080px, 100% - 2 * (var(--vine-w) + 1.25rem)); }
}
@media (max-width: 760px) { /* no vines on phones */
  body > main.wrap, body > main:not(.wrap) .wrap, body > .site-footer .wrap { width: min(1080px, 100% - 2.5rem); }
}

/* =====================================================================
   Inside the app (html.app): an app layout instead of the website's.
   No website header, footer or vines; a bottom tab bar; app Home and More pages.
   ===================================================================== */
html.app .site-header, html.app .site-footer, html.app .flourish, html.app .web-only, html.app .menu-shade { display: none !important; }
html.app body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
html.app body > main.wrap, html.app body > main:not(.wrap) .wrap { width: min(760px, 100% - 2rem); }
html.app main { padding-top: calc(0.6rem + env(safe-area-inset-top)); }
html.app .page-head { padding-top: 1rem; }
html.app .page-head h1, html.app .app-title { font-size: clamp(1.7rem, 7vw, 2.3rem); }
html.app .offline-note { bottom: calc(86px + env(safe-area-inset-bottom)); }
html.app .hero { min-height: 0; }

/* The bottom tab bar */
.app-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 0.35rem 0.4rem calc(0.4rem + env(safe-area-inset-bottom));
  background: rgba(6, 26, 25, 0.97); border-top: 1px solid rgba(216, 167, 125, 0.28);
  box-shadow: 0 -10px 30px -12px rgba(0, 0, 0, 0.6);
}
.app-tab {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.18rem;
  padding: 0.35rem 0 0.2rem; color: var(--muted); text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.app-tab .ic { width: 26px; height: 26px; transition: transform 0.2s ease; }
.app-tab .tab-label { font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; }
.app-tab[aria-current="page"] { color: var(--gold); }
.app-tab[aria-current="page"]::before { content: ""; position: absolute; top: -0.36rem; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--metal); }
.app-tab:active .ic { transform: scale(0.88); }
.ic { display: inline-flex; width: 22px; height: 22px; flex: none; }
.ic svg { width: 100%; height: 100%; }
.tab-dot { position: absolute; top: 0.3rem; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px rgba(6, 26, 25, 0.97); }

/* App Home */
.ah-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.1rem 0 0.9rem; }
.ah-hello { margin: 0; color: var(--muted); font-size: 0.95rem; }
.ah-top h1 { margin: 0.1rem 0 0.35rem; font-size: clamp(1.9rem, 8vw, 2.6rem); line-height: 1.1; }
.ah-top p { margin: 0; }
.ah-crest { width: 54px; height: auto; opacity: 0.95; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4)); }
.ah-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 1rem 1.1rem;
  margin-bottom: 0.8rem; box-shadow: 0 14px 30px -22px rgba(0, 0, 0, 0.8);
}
.ah-card .k { margin: 0 0 0.35rem; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 0.45rem; }
.ah-card p { margin: 0.15rem 0; }
.ah-now { border-color: rgba(216, 167, 125, 0.45); background: linear-gradient(160deg, rgba(216, 167, 125, 0.13), rgba(216, 167, 125, 0.02)), var(--panel); }
.ah-now.live { border-color: rgba(127, 214, 194, 0.55); }
.ah-now .meter { margin-top: 0.7rem; }
.ah-big { font-family: var(--font-display); font-size: 1.35rem; color: var(--text); line-height: 1.25; }
.ah-mid { font-size: 1.05rem; color: var(--text); }
.ah-count { font-size: 1.1rem; color: var(--text); }
.ah-count b { font-family: var(--font-display); font-size: 2.6rem; color: var(--gold); margin-right: 0.15rem; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(127, 214, 194, 0.6); animation: live-pulse 1.8s infinite; }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 8px rgba(127, 214, 194, 0); } 100% { box-shadow: 0 0 0 0 rgba(127, 214, 194, 0); } }
.ah-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.ah-pair .ah-card { margin-bottom: 0.8rem; }
.ah-meals .meal-list { margin: 0; }
.ah-section { margin-top: 1.2rem; }
.ah-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.55rem; }
.ah-head h2 { margin: 0; font-size: 1.05rem; letter-spacing: 0.08em; }
.ah-head a { font-size: 0.85rem; }
.ah-news { display: flex; flex-direction: column; gap: 0.5rem; }
.ah-news-item { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.8rem 1rem; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: var(--text); }
.ah-news-item.important { border-left: 3px solid var(--danger); }
.ah-news-title { font-weight: 600; }
.ah-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.ah-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.45rem; min-height: 88px;
  position: relative; padding: 0.8rem 0.25rem; border-radius: 16px; background: var(--panel); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; font: inherit; font-size: 0.82rem; text-align: center; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: transform 0.15s ease, border-color 0.2s;
}
.ah-tile .ic { width: 28px; height: 28px; color: var(--gold); }
.ah-tile:active { transform: scale(0.96); border-color: var(--gold); }
.ah-tile .tab-dot { top: 0.55rem; left: auto; right: 0.6rem; }

/* App More */
.app-title { margin: 1.1rem 0 0.9rem; }
.am-me { display: flex; align-items: center; gap: 0.9rem; padding: 1rem; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 1.2rem; }
.am-me p { margin: 0.1rem 0; }
.am-photo { width: 56px; height: 56px; border-radius: 50%; flex: none; object-fit: cover; border: 1px solid var(--gold); font-family: var(--font-display); font-size: 1.25rem; background: var(--panel-2); }
.am-name { font-size: 1.15rem; font-weight: 600; color: var(--text); }
.am-group { margin-bottom: 1.1rem; }
.am-group h2 { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.45rem 0.3rem; }
.am-list { border-radius: 16px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); }
.am-row {
  position: relative; display: flex; align-items: center; gap: 0.85rem; width: 100%; padding: 0.95rem 1rem;
  color: var(--text); text-decoration: none; font: inherit; background: none; border: 0; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.am-row + .am-row { border-top: 1px solid var(--line); }
.am-row .ic { color: var(--gold); }
.am-row:active { background: rgba(216, 167, 125, 0.08); }
.am-label { flex: 1; }
.am-row .tab-dot { position: static; box-shadow: none; }
.am-chev { color: var(--muted); font-size: 1.3rem; line-height: 1; }
.am-out, .am-out .ic { color: var(--danger); }
.am-foot { text-align: center; font-size: 0.8rem; margin: 1.5rem 0 0.5rem; }

/* Sign in with a password: show/hide button, and the links under the form */
.pw-row { position: relative; }
.pw-row input { padding-right: 4.6rem; }
.pw-show { position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%); font: inherit; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); background: none; border: 0; padding: 0.4rem 0.5rem; cursor: pointer; }
.login-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem 1rem; margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.login-links .link-btn { font-size: 0.88rem; }

/* ---------- App: the back bar on pages opened from Home or More ---------- */
.app-bar { display: none; }
html.app .app-bar {
  position: sticky; top: 0; z-index: 80; display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  min-height: 52px; padding: 0.3rem 0.6rem; padding-top: calc(0.3rem + env(safe-area-inset-top));
  background: rgba(6, 26, 25, 0.96); border-bottom: 1px solid rgba(216, 167, 125, 0.22);
}
html.app .app-bar::after { content: ""; width: 72px; } /* balances the back button, so the title sits in the middle */
.app-back {
  display: inline-flex; align-items: center; gap: 0.1rem; min-width: 72px; padding: 0.45rem 0.4rem; border: 0; border-radius: 10px;
  background: none; color: var(--gold); font: inherit; font-size: 0.95rem; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.app-back .ic { width: 22px; height: 22px; }
.app-back:active { background: rgba(216, 167, 125, 0.12); }
.app-bar-title { margin: 0; text-align: center; font-family: var(--font-display); font-size: 1rem; letter-spacing: 0.06em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.app.has-app-bar main { padding-top: 0.2rem; }
html.app.has-app-bar .page-head { padding-top: 0.6rem; }
html.app.has-app-bar .page-head h1 { font-size: clamp(1.5rem, 6vw, 2rem); }

/* ---------- App: Schedule tab (your timeline) ---------- */
.ag-top { padding-top: 1rem; }
.ag-top .app-title { margin: 0; }
.ag-top p { margin: 0.2rem 0 0; }
.ag-days { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0.5rem; margin: 1rem 0; }
.ag-day {
  display: flex; flex-direction: column; align-items: center; gap: 0.1rem; padding: 0.55rem 0.3rem; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text); font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ag-day-n { font-weight: 700; font-size: 0.95rem; }
.ag-day-d { font-size: 0.74rem; color: var(--muted); }
.ag-day[aria-selected="true"] { background: var(--metal); border-color: var(--gold); color: #0a2826; }
.ag-day[aria-selected="true"] .ag-day-d { color: rgba(10, 40, 38, 0.75); }
.ag-banner { margin: 0 0 1rem; padding: 0.8rem 1rem; border-radius: 14px; border: 1px dashed rgba(216, 167, 125, 0.5); color: var(--muted); }
.ag-banner b { color: var(--gold); }
.ag-list { list-style: none; margin: 0; padding: 0 0 1rem; position: relative; }
.ag-list.is-empty::before { display: none; } /* (no timeline line beside "Coming soon": set by agenda.js) */
.ag-list::before { content: ""; position: absolute; left: calc(3.2rem + 0.45rem + 0.65rem - 1px); top: 0.6rem; bottom: 1rem; width: 2px; background: linear-gradient(var(--line), rgba(36, 80, 75, 0.2)); }
.ag-item { display: grid; grid-template-columns: 3.2rem 1.3rem 1fr; gap: 0 0.45rem; margin-bottom: 0.75rem; }
.ag-time { text-align: right; padding-top: 0.85rem; line-height: 1.2; }
.ag-time b { display: block; font-size: 0.95rem; color: var(--text); font-variant-numeric: tabular-nums; }
.ag-time span { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ag-dot { position: relative; z-index: 1; width: 12px; height: 12px; margin: 1.05rem auto 0; border-radius: 50%; background: #0a2826; border: 2px solid var(--line); }
.ag-card { min-width: 0; padding: 0.75rem 0.9rem; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.ag-card p { margin: 0; }
.ag-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-bottom: 0.3rem; }
.ag-kind, .ag-flag, .ag-len { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.12rem 0.5rem; border-radius: 99px; }
.ag-kind { color: var(--muted); border: 1px solid var(--line); }
.ag-len { color: var(--muted); margin-left: auto; padding-right: 0; }
.ag-flag.now { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--ok); border: 1px solid rgba(127, 214, 194, 0.5); }
.ag-flag.soon { color: #0a2826; background: var(--metal); }
.ag-title { font-size: 1.05rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.ag-room { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.4rem; font-size: 0.9rem; text-decoration: none; color: var(--gold); }
.ag-room .ic { width: 17px; height: 17px; }
.ag-go { margin-left: auto; font-size: 0.78rem; color: var(--muted); }
.ag-meal { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.45rem !important; padding-top: 0.45rem; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--muted); }
.ag-meal .ic { width: 16px; height: 16px; }
.ag-meal.got { color: var(--ok); }
.ag-meal.now { color: var(--gold); font-weight: 600; }
.ag-meal.missed { color: var(--danger); }
.ag-card .meter { margin-top: 0.6rem; }
.k-session .ag-dot { border-color: var(--gold); }
.k-break .ag-card { background: rgba(16, 54, 52, 0.55); }
.k-duty .ag-card { border-style: dashed; border-color: rgba(216, 167, 125, 0.55); }
.k-duty .ag-kind { color: var(--gold); border-color: rgba(216, 167, 125, 0.55); }
.ag-item.past { opacity: 0.5; }
.ag-item.live .ag-card { border-color: rgba(127, 214, 194, 0.6); box-shadow: 0 0 0 1px rgba(127, 214, 194, 0.25), 0 16px 30px -20px rgba(127, 214, 194, 0.5); }
.ag-item.live .ag-dot { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 0 5px rgba(127, 214, 194, 0.18); }
.ag-item.next .ag-dot { background: var(--gold); border-color: var(--gold); }
.ag-empty { padding: 1.5rem 0; text-align: center; }

/* ---------- App: More tab ---------- */
.app-more { padding-top: 1rem; }
.am-hero {
  position: relative; overflow: hidden; margin: 0.4rem 0 1.4rem; padding: 1.2rem; border-radius: 22px;
  background: radial-gradient(120% 90% at 100% 0%, rgba(216, 167, 125, 0.22), transparent 60%), linear-gradient(160deg, #154340, #0d2e2c);
  border: 1px solid rgba(216, 167, 125, 0.4); box-shadow: 0 20px 40px -26px rgba(0, 0, 0, 0.9);
}
.am-hero::after { content: ""; position: absolute; right: -30px; bottom: -40px; width: 170px; height: 178px; background: url(../img/crest-small.png) center / contain no-repeat; opacity: 0.08; pointer-events: none; }
.am-hero-top { display: flex; align-items: center; gap: 0.95rem; }
.am-hero .am-photo { width: 64px; height: 64px; font-size: 1.4rem; border-width: 2px; box-shadow: 0 0 0 4px rgba(216, 167, 125, 0.15); }
.am-who { min-width: 0; }
.am-hero .am-name { margin: 0 0 0.3rem; font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; line-height: 1.2; }
.am-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0; font-size: 0.85rem; color: var(--muted); }
.am-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-top: 1rem; }
.am-facts > * { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.6rem 0.75rem; border-radius: 12px; background: rgba(5, 25, 24, 0.45); color: var(--text); text-decoration: none; font-size: 0.92rem; }
.am-k { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.am-hero-btns { margin-top: 1rem; position: relative; z-index: 1; }
.am-hero-btns .btn { display: inline-flex; align-items: center; gap: 0.5rem; }
.am-hero-btns .btn .ic { width: 20px; height: 20px; }
.am-hero-btns p { margin: 0; }
.am-group { margin-bottom: 1.5rem; }
.am-group h2 { font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.6rem 0.2rem; font-family: inherit; }
.am-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
@media (min-width: 560px) { .am-tiles { grid-template-columns: repeat(4, 1fr); } }
.am-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.55rem; padding: 1rem 0.4rem 0.85rem;
  border-radius: 18px; background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none; text-align: center;
  -webkit-tap-highlight-color: transparent; transition: transform 0.15s ease, border-color 0.2s, background 0.2s;
}
.am-tile:active { transform: scale(0.95); border-color: var(--gold); background: var(--panel-2); }
.am-tile-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: var(--gold);
  background: linear-gradient(160deg, rgba(216, 167, 125, 0.22), rgba(216, 167, 125, 0.06)); border: 1px solid rgba(216, 167, 125, 0.3); }
.am-tile-ic .ic { width: 24px; height: 24px; }
.am-tile-label { font-size: 0.8rem; line-height: 1.2; }
.am-tile .tab-dot { top: 0.6rem; left: auto; right: 0.7rem; }
.am-list { border-radius: 18px; }
.am-row-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(216, 167, 125, 0.12); color: var(--gold); flex: none; }
.am-row-ic .ic { width: 19px; height: 19px; }
.am-out .am-row-ic { background: rgba(232, 114, 122, 0.12); color: var(--danger); }
.am-foot { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; margin: 2rem 0 0.5rem; font-size: 0.8rem; }
.am-foot img { opacity: 0.7; margin-bottom: 0.3rem; }
.am-foot p { margin: 0; letter-spacing: 0.08em; }

/* (the countdown note spans the full width, like the cards under it) */
.ag-banner { max-width: none; }
/* "Announcements" is the longest tab name: smaller letters so all five fit on a phone */
.app-tab .tab-label { letter-spacing: 0.03em; white-space: nowrap; }
@media (max-width: 420px) {
  .app-tabs { grid-template-columns: 1fr 1fr 0.8fr 1.4fr 1fr; } /* Announcements gets a bit more room, Map a bit less */
  .app-tab .tab-label { font-size: 0.64rem; letter-spacing: 0; text-transform: none; }
}

/* No sideways swiping on phones. The hero rays and the moving ticker are wider than the screen;
   Chrome clips them, but iPhone Safari let you swipe into them, so they are clipped harder here
   (paint containment), and the page itself never scrolls sideways. */
html { overflow-x: hidden; }
@supports (overflow: clip) { html { overflow-x: clip; } }
/* (the body too: an iPhone home-screen app still let you swipe into the wide rays behind the home page) */
body { max-width: 100%; }
@supports (overflow: clip) { body { overflow-x: clip; } }
/* Added to the Home Screen: the page itself only moves up and down (and still zooms). Lists, tables and
   the map that scroll sideways are their own scroll boxes, so they still swipe sideways. */
html.ios-app, html.ios-app body { touch-action: pan-y pinch-zoom; overscroll-behavior-x: none; }
/* In the app itself the page never zooms: no pinch, no double-tap zoom (the map zooms by itself) */
html.app, html.app body { touch-action: manipulation; }
html.app.ios-app, html.app.ios-app body { touch-action: pan-y; }
.hero, .ticker { position: relative; overflow: hidden; contain: paint; }
@supports (overflow: clip) { .hero, .ticker { overflow: clip; } }

/* ---------- The app's frame (app-shell.html): pages above, the tab bar below, never reloading ---------- */
html.shell, html.shell body { height: 100%; margin: 0; overflow: hidden; background: #0a2826; }
html.shell body { display: flex; flex-direction: column; padding: 0 !important; }
html.shell body::before { display: none; }
html.shell #view { flex: 1; width: 100%; min-height: 0; border: 0; display: block; background: #0a2826; } /* (only the app frame; the Food page has its own #view) */
html.shell .app-tabs { position: relative; flex: none; }
html.shell body.kb:not(.kb-move) .app-tabs { display: none; } /* keyboard open (kept while the keyboard is still moving over it) */
/* Pages inside the frame: no room needed for a tab bar of their own */
html.app.framed body { padding-bottom: 1rem; }
html.app.framed .offline-note { bottom: 1rem; }


/* ---------- Android: dropdowns as a sheet from the bottom (like iPhone) ---------- */
.sheet-shade {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(2, 12, 11, 0); transition: background 0.25s ease;
}
.sheet-shade.in { background: rgba(2, 12, 11, 0.6); }
.sheet {
  width: min(560px, 100%); max-height: 72vh; display: flex; flex-direction: column;
  padding: 0.5rem 0.9rem calc(0.9rem + env(safe-area-inset-bottom));
  background: #123b38; border: 1px solid rgba(216, 167, 125, 0.3); border-bottom: 0; border-radius: 22px 22px 0 0;
  box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, 0.8);
  transform: translateY(100%); transition: transform 0.26s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.sheet-shade.in .sheet { transform: none; }
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: rgba(216, 167, 125, 0.35); margin: 0.2rem auto 0.6rem; flex: none; }
.sheet-title { margin: 0 0 0.6rem; text-align: center; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); flex: none; }
.sheet-list { overflow-y: auto; overscroll-behavior: contain; border-radius: 16px; background: rgba(5, 25, 24, 0.5); border: 1px solid var(--line); }
.sheet-group { margin: 0; padding: 0.7rem 1rem 0.35rem; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); background: rgba(5, 25, 24, 0.4); }
.sheet-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; width: 100%; min-height: 50px; padding: 0.7rem 1rem;
  background: none; border: 0; border-top: 1px solid rgba(36, 80, 75, 0.7); color: var(--text); font: inherit; font-size: 1rem; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sheet-list > .sheet-opt:first-child, .sheet-group + .sheet-opt { border-top: 0; }
.sheet-opt:active { background: rgba(216, 167, 125, 0.1); }
.sheet-opt[aria-selected="true"] { color: var(--gold); font-weight: 600; }
.sheet-opt:disabled { color: var(--muted); opacity: 0.6; }
.sheet-tick { width: 22px; height: 22px; flex: none; color: var(--gold); }
.sheet-tick svg { width: 100%; height: 100%; }
.sheet-cancel {
  flex: none; margin-top: 0.6rem; min-height: 50px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel);
  color: var(--gold); font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer;
}
.sheet-cancel:active { background: var(--panel-2); }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-shade { transition: none; } }

/* ---------- App: pages slide in like an app (from the right; from the left when you go back; tabs fade) ---------- */
@keyframes app-from-right { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes app-from-left { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes app-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
html.app body > main > :not(.hero) { animation: none; }
html.app.in-forward body > main { animation: app-from-right 0.34s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
html.app.in-back body > main { animation: app-from-left 0.3s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
html.app.in-tab body > main { animation: app-fade 0.26s ease both; }
html.app.leaving body > main { opacity: 0; transform: translateX(-16px); }
html.app .page-progress { display: none; }
@media (prefers-reduced-motion: reduce) {
  html.app.in-forward body > main, html.app.in-back body > main, html.app.in-tab body > main { animation: app-fade 0.2s ease both; }
  html.app.leaving body > main { transform: none; }
}

/* Pull down to refresh: a plain arrow turns as you pull, and spins while it reloads */
.pull { position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; z-index: 120; width: 36px; height: 36px; display: grid; place-items: center; /* (always fully on screen) */
  border-radius: 50%; background: #123b38; color: var(--muted); border: 1px solid rgba(216, 167, 125, 0.35); box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.7);
  opacity: 0; pointer-events: none; will-change: transform, opacity; transform: translate3d(-50%, 0, 0); }
.pull svg { display: block; transition: color 0.15s; }
.pull.ready { border-color: var(--gold); color: var(--gold); }
.pull.spin svg { animation: pull-spin 0.65s linear infinite; }
@keyframes pull-spin { from { rotate: 0deg; } to { rotate: 360deg; } }

/* Flags next to country names */
.flag { font-size: 1.15em; line-height: 1; margin-right: 0.3em; vertical-align: -0.08em; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }

/* ---------- Home: you, your prep, the live countdown ---------- */
.ah-me { display: flex; align-items: center; gap: 1rem; text-decoration: none; color: var(--text);
  background: radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--accent, #d8a77d) 22%, transparent), transparent 60%), var(--panel);
  border-color: color-mix(in srgb, var(--accent, #d8a77d) 45%, var(--line)); }
.ah-me-flag { font-size: 3rem; line-height: 1; flex: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35)); font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.ah-me-text { min-width: 0; }
.ah-topics { display: flex; flex-direction: column; gap: 0.15rem; margin-top: 0.4rem !important; font-size: 0.85rem; color: var(--text); }
.ah-topics span { padding-left: 0.6rem; border-left: 2px solid var(--accent, var(--gold)); }
.ah-prep { display: block; text-decoration: none; color: var(--text); }
.ah-prep-top { display: flex; align-items: baseline; justify-content: space-between; }
.ah-prep-pct { font-family: var(--font-display); font-size: 1.3rem; color: var(--gold); }
.ah-prep .meter { margin: 0.35rem 0 0.55rem; }
.prep-late { color: var(--danger) !important; }
.ah-cd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.45rem; margin: 0.35rem 0 0.6rem; }
.cd-cell { display: flex; flex-direction: column; align-items: center; padding: 0.55rem 0.2rem; border-radius: 12px; background: rgba(5, 25, 24, 0.45); border: 1px solid rgba(216, 167, 125, 0.25); }
.cd-cell b { font-family: var(--font-display); font-size: 1.7rem; line-height: 1.1; color: var(--gold); font-variant-numeric: tabular-nums; }
.cd-cell span { font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

/* ---------- Prep page ---------- */
.prep-page .panel { margin-bottom: 1rem; }
/* Documents, inside Prep: replaces the short guide list for everyone the documents are for */
html.has-docs #prep-guides { display: none !important; }
.prep-docs-section { margin: 1.6rem 0 1.4rem; scroll-margin-top: 5rem; }
.prep-docs-section > .h-small { margin-bottom: 0.9rem; }
.prep-docs-section .doc-add { margin-bottom: 1.2rem; }
.prep-id { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1rem; padding: 1.2rem; border-radius: 20px; border: 1px solid color-mix(in srgb, var(--accent, #d8a77d) 45%, var(--line));
  background: radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--accent, #d8a77d) 24%, transparent), transparent 60%), var(--panel); }
.prep-flag { font-size: 3.6rem; line-height: 1; flex: none; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.prep-who p { margin: 0.1rem 0; }
.prep-switch { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin: 0.15rem 0 0.35rem; }
.prep-switch select { width: auto; max-width: 100%; min-width: 0; font-weight: 600; }
.prep-country { font-family: var(--font-display); font-size: 1.6rem; color: var(--text); }
.prep-topics { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.prep-topics li { margin: 0.15rem 0; }
.prep-topics li::marker { content: counter(list-item, upper-alpha) ". "; color: var(--gold); font-weight: 700; }
.prep-progress { display: flex; align-items: center; gap: 1.1rem; }
.prep-progress p { margin: 0.15rem 0; }
.prep-ring { position: relative; width: 84px; height: 84px; flex: none; }
.prep-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(5, 25, 24, 0.6); stroke-width: 8; }
.ring-fg { fill: none; stroke: var(--gold); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(0.22, 0.61, 0.36, 1); }
.prep-pct { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 1.15rem; color: var(--text); }
.prep-big { font-size: 1.15rem; font-weight: 600; color: var(--text); }
.prep-list { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.prep-list li { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0.2rem 0.8rem; padding: 0.7rem 0; border-top: 1px solid var(--line); }
.prep-list li:first-child { border-top: 0; }
.prep-list li .small-note { grid-column: 2; margin: 0; }
.prep-list li.done .prep-label { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(216, 167, 125, 0.5); }
.prep-check { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); background: none; cursor: pointer; display: grid; place-items: center; padding: 0; transition: background 0.2s, border-color 0.2s; }
.prep-check[aria-checked="true"] { background: var(--gold); border-color: var(--gold); }
.prep-check[aria-checked="true"]::after { content: ""; width: 10px; height: 6px; border: solid #0a2826; border-width: 0 0 2.5px 2.5px; transform: translateY(-2px) rotate(-45deg); }
.prep-check:disabled { cursor: default; }
.prep-file { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.8rem 1rem; border-radius: 14px; background: rgba(5, 25, 24, 0.45); border: 1px solid var(--line); }
.prep-file p { margin: 0.1rem 0 0; }
.pill-wait { background: rgba(216, 167, 125, 0.12); color: var(--gold); border: 1px solid rgba(216, 167, 125, 0.4); }
.prep-feedback { margin: 0.8rem 0 0; padding: 0.7rem 1rem; border-left: 3px solid var(--gold); background: rgba(216, 167, 125, 0.07); border-radius: 0 12px 12px 0; }
.prep-feedback p { margin: 0; }
.prep-feedback cite { display: block; margin-top: 0.3rem; font-size: 0.8rem; color: var(--muted); font-style: normal; }
.prep-docs { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.prep-docs li { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.6rem 0; border-top: 1px solid var(--line); }
.prep-docs li:first-child { border-top: 0; }
.prep-docs a { display: inline-flex; align-items: center; gap: 0.5rem; }
.prep-docs .ic { width: 20px; height: 20px; color: var(--gold); }
.prep-topic-inputs { display: grid; gap: 0.45rem; }
.prep-paper-list { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.prep-paper-list > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.65rem 0; border-top: 1px solid var(--line); }
.pp-who { display: flex; flex-direction: column; }
.pp-act { display: flex; gap: 0.4rem; }
.pp-review { width: 100%; }
.pp-review textarea { width: 100%; margin-top: 0.3rem; }
.prep-cheats details { border-top: 1px solid var(--line); }
.prep-cheats summary { cursor: pointer; padding: 0.85rem 0; font-weight: 600; color: var(--text); list-style: none; display: flex; justify-content: space-between; }
.prep-cheats summary::-webkit-details-marker { display: none; }
.prep-cheats summary::after { content: "+"; color: var(--gold); font-size: 1.2rem; line-height: 1; }
.prep-cheats details[open] summary::after { content: "−"; }
.prep-cheats dl { margin: 0 0 0.9rem; }
.prep-cheats dt { color: var(--gold); font-weight: 600; margin-top: 0.6rem; }
.prep-cheats dd { margin: 0.15rem 0 0; color: var(--text); }
.prep-phrases { margin: 0 0 0.9rem; padding-left: 1.1rem; }
.prep-phrases li { margin: 0.3rem 0; }
.prep-words { color: var(--text); line-height: 1.7; }

/* ---------- Notes and votes ---------- */
.live-page .panel { margin-bottom: 1rem; }
.live-vote { border-color: color-mix(in srgb, var(--accent, #d8a77d) 40%, var(--line)); }
.live-vote.open { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(216, 167, 125, 0.35), 0 20px 40px -26px rgba(216, 167, 125, 0.5); }
.live-vote .k { display: flex; align-items: center; gap: 0.45rem; margin: 0 0 0.35rem; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.vote-kind { margin-left: auto; padding: 0.1rem 0.5rem; border-radius: 99px; border: 1px solid var(--line); font-size: 0.66rem; }
.vote-title { margin: 0 0 0.6rem; font-family: var(--font-display); font-size: 1.35rem; line-height: 1.25; color: var(--text); }
.vote-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 0.55rem; margin: 0.8rem 0 0.5rem; }
.vote-btn { min-height: 64px; border-radius: 16px; border: 2px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; font-size: 1.1rem; font-weight: 700; cursor: pointer; transition: transform 0.12s, background 0.2s, border-color 0.2s; -webkit-tap-highlight-color: transparent; }
.vote-btn:active { transform: scale(0.96); }
.vote-btn.v-for[aria-pressed="true"] { background: rgba(127, 214, 194, 0.2); border-color: var(--ok); color: var(--ok); }
.vote-btn.v-against[aria-pressed="true"] { background: rgba(232, 114, 122, 0.18); border-color: var(--danger); color: var(--danger); }
.vote-btn.v-abstain[aria-pressed="true"] { background: rgba(216, 167, 125, 0.18); border-color: var(--gold); color: var(--gold); }
.vote-bars { display: flex; flex-direction: column; gap: 0.45rem; margin: 0.7rem 0 0.4rem; }
.vote-bar { display: grid; grid-template-columns: 5.2rem 1fr 2.2rem; align-items: center; gap: 0.6rem; }
.vb-label { font-weight: 600; }
.vb-track { height: 14px; border-radius: 99px; background: rgba(5, 25, 24, 0.6); border: 1px solid var(--line); overflow: hidden; }
.vb-fill { display: block; height: 100%; width: 0; border-radius: 99px; transition: width 0.6s cubic-bezier(0.22, 0.61, 0.36, 1); }
.v-for .vb-fill { background: var(--ok); }
.v-against .vb-fill { background: var(--danger); }
.v-abstain .vb-fill { background: var(--gold); }
.vote-bar b { text-align: right; font-variant-numeric: tabular-nums; }
.vote-result { display: inline-block; margin: 0 0 0.4rem; padding: 0.2rem 0.8rem; border-radius: 99px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.85rem; }
.vote-result.passed { color: var(--ok); background: rgba(127, 214, 194, 0.14); border: 1px solid rgba(127, 214, 194, 0.5); }
.vote-result.failed { color: var(--danger); background: rgba(232, 114, 122, 0.12); border: 1px solid rgba(232, 114, 122, 0.45); }
.vote-result.small { font-size: 0.72rem; margin: 0; white-space: nowrap; }
.vote-who summary { cursor: pointer; color: var(--gold); margin-top: 0.6rem; }
.vote-who ul { list-style: none; margin: 0.5rem 0 0; padding: 0; columns: 2; column-gap: 1rem; }
.vote-who li { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.2rem 0; break-inside: avoid; font-size: 0.9rem; }
.vw.v-for { color: var(--ok); } .vw.v-against { color: var(--danger); } .vw.v-abstain { color: var(--gold); } .vw.v-none { color: var(--muted); }
.vote-hist { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.vote-hist li { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.55rem 0; border-top: 1px solid var(--line); }
.vote-hist li:first-child { border-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0 0.8rem; }
.vote-proj { position: fixed; inset: 0; z-index: 300; display: flex; flex-direction: column; justify-content: center; gap: 1.2rem; padding: 6vh 8vw;
  background: radial-gradient(120% 90% at 50% 0%, #154340, #071d1c 70%); color: var(--text); cursor: pointer; }
.vp-com { margin: 0; font-size: clamp(1rem, 2vw, 1.6rem); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
.vp-title { margin: 0; font-family: var(--font-display); font-size: clamp(2rem, 5vw, 4.2rem); line-height: 1.15; }
.vote-proj .vote-bars { gap: 1.2rem; }
.vote-proj .vote-bar { grid-template-columns: 12rem 1fr 6rem; font-size: clamp(1.3rem, 2.8vw, 2.4rem); }
.vote-proj .vb-track { height: clamp(26px, 4vh, 48px); }
.vp-foot { margin: 0; font-size: clamp(1.2rem, 2.6vw, 2.2rem); color: var(--muted); letter-spacing: 0.06em; }
.vp-hint { position: absolute; bottom: 1.2rem; right: 1.6rem; margin: 0; font-size: 0.85rem; color: var(--muted); }
.notes-paused { margin: 0.5rem 0 0.8rem; }
.note-compose { display: grid; gap: 0.45rem; margin: 0.6rem 0 1rem; }
.note-compose textarea { width: 100%; }
.note-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.note-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.note { padding: 0.7rem 0.9rem; border-radius: 16px 16px 16px 4px; background: var(--panel-2); border: 1px solid var(--line); max-width: 92%; }
.note.sent { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: rgba(216, 167, 125, 0.12); border-color: rgba(216, 167, 125, 0.35); }
.note.unread { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(216, 167, 125, 0.35); }
.note-head { display: flex; justify-content: space-between; gap: 0.8rem; margin: 0 0 0.25rem; font-size: 0.85rem; }
.note-text { margin: 0; white-space: pre-wrap; word-break: break-word; }
.note-tools { display: flex; gap: 0.9rem; margin: 0.35rem 0 0; font-size: 0.8rem; }

/* ---------- Reporting and blocking ---------- */
.report-dialog { width: min(26rem, calc(100vw - 2rem)); background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem; }
.report-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.report-dialog textarea { width: 100%; margin-top: 0.7rem; }
/* Report a problem (report.html) */
main.wrap.narrow { max-width: 44rem; }
#rep-form fieldset { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
#rep-form legend { padding: 0; }
.report-reasons { display: grid; gap: 0.15rem; margin-top: 0.7rem; }
.report-reasons label { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0; cursor: pointer; }
.blocked-list, .paused-list { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.4rem; }
.blocked-row { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.report-list { display: grid; gap: 0.8rem; }
.report-card { display: grid; gap: 0.4rem; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; min-width: 0; }
.report-card p { margin: 0; }
.report-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.report-text { margin: 0.2rem 0; padding: 0.6rem 0.8rem; border-left: 3px solid var(--danger); background: var(--panel-2); border-radius: 0 8px 8px 0; white-space: pre-wrap; word-break: break-word; }

/* ---------- Smoother in the app ---------- */
/* No full-screen grain layer (one less layer to draw on every scroll) */
html.app body::before { display: none; }
/* A quicker, lighter slide-in */
@keyframes app-from-right { from { opacity: 0.35; transform: translate3d(18px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes app-from-left { from { opacity: 0.35; transform: translate3d(-18px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes app-fade { from { opacity: 0.4; } to { opacity: 1; } }
html.app.in-forward body > main { animation-duration: 0.22s; }
html.app.in-back body > main { animation-duration: 0.2s; }
html.app.in-tab body > main { animation-duration: 0.18s; }
/* Anything set to appear on scroll is just shown */
html.app .reveal { opacity: 1 !important; transform: none !important; }
/* Scrolling inside the app frame stays inside it, and never bounces past the top or bottom of the page
   (on iPhone a page in the frame that bounced showed white past its end, and could stay like that) */
html.app.framed, html.app.framed body { overscroll-behavior-y: none; }

/* The app's tabs: one page per tab, kept alive; only the tab you are on shows (instant switching) */
#views { position: relative; flex: 1; min-height: 0; }
#views .view { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block;
  visibility: hidden; pointer-events: none; }

/* ---------- App background ----------
   Like the website: deep teal lit softly from the top and a fine grain, edge to edge (no vines down the sides,
   even on wide screens). It is drawn once, behind the pages, and never moves while you scroll. */
:root {
  --app-vines: 0px;
  --app-col: calc(100% - 2 * var(--app-vines)); /* the middle part, between the vines */
  /* the same teal light as the website's pages (body, in the crest theme), and the same faint grain */
  --app-light: radial-gradient(ellipse 60% 48% at 50% -6%, rgba(41, 120, 112, 0.5), transparent 70%);
  --app-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.03 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
#views {
  background-color: #0a2826;
  background-image: var(--app-light);
  background-size: var(--app-col) 100%;
  background-position: center;
  background-repeat: no-repeat;
}
#views .view {
  background-color: transparent; /* the vines on #views show at the sides */
  background-image: var(--app-grain), var(--app-light), linear-gradient(#0a2826, #0a2826);
  background-size: 220px 220px, var(--app-col) 100%, var(--app-col) 100%, var(--app-col) 100%;
  background-position: 0 0, center, center, center;
  background-repeat: repeat, no-repeat, no-repeat, no-repeat;
}
/* the pages themselves are see-through, so the background above shows behind them */
html.app.framed, html.app.framed body { background: transparent; }
/* Drawn: the page you see (the only one you can touch), the one under it (Back is instant), a page fading out
   behind a new tab, a page about to fade in (drawing itself, still invisible), and a page sliding away. */
#views .view.on, #views .view.under, #views .view.keep, #views .view.prep, #views .view.leaving { visibility: visible; }
#views .view.on { pointer-events: auto; }
#views .view.prep { opacity: 0; }
#views .view.waiting { visibility: hidden; pointer-events: none; }
/* Opening a page: it fades and slides in on top. Closing it: it slides away. Switching tabs: a cross-fade. */
/* (the page shows straight away and settles smoothly: quick to start, gentle to finish) */
#views .view.slide-in { animation: view-fade 0.32s cubic-bezier(0.2, 0.7, 0.3, 1) both, view-slide 0.42s cubic-bezier(0.2, 0.75, 0.25, 1) both; box-shadow: -18px 0 40px -20px rgba(0, 0, 0, 0.8); }
@keyframes view-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes view-slide { from { transform: translate3d(48px, 0, 0); } to { transform: none; } }
#views .view.leaving { animation: view-out 0.28s ease-in both; pointer-events: none; }
#views .view.tab-in { animation: tab-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1) 0.04s both; } /* (starts as the old page is almost gone: never an empty screen) */
/* The page you leave (or that a new page opens over) fades out at the same time: never two pages mixed together */
#views .view.fade-away { animation: fade-away 0.18s ease-out both; }
#views .view.under.fade-away { animation-duration: 0.18s; } /* (under a page opening on top) */
@keyframes fade-away { from { opacity: 1; } to { opacity: 0; } }
@keyframes view-in { from { opacity: 0; transform: translate3d(36px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes view-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translate3d(42px, 0, 0); } }
@keyframes tab-in { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #views .view.slide-in, #views .view.leaving, #views .view.tab-in, #views .view.fade-away { animation: none; } }
/* Inside the app's frames the frame itself moves, so the page inside does not slide again */
html.app.framed body > main { animation: none !important; }

/* ---------- App: the back button (replaces the bar across the top) ----------
   It sits above the page's heading and scrolls away with the page, so it never floats over what you are reading. */
html.app .app-bar { position: absolute; top: calc(0.7rem + env(safe-area-inset-top)); left: 0.8rem; z-index: 80; display: block;
  min-height: 0; padding: 0; background: none; border: 0; }
html.app .app-bar::after { display: none; }
html.app .app-back {
  display: grid; place-items: center; width: 42px; height: 42px; min-width: 0; padding: 0; border-radius: 50%;
  color: var(--gold); background: rgba(12, 44, 41, 0.82); border: 1px solid rgba(216, 167, 125, 0.4);
  box-shadow: 0 8px 22px -10px rgba(0, 0, 0, 0.85); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: transform 0.12s ease, background 0.2s;
}
html.app .app-back svg { width: 22px; height: 22px; margin-left: -2px; }
html.app .app-back:active { transform: scale(0.9); background: rgba(216, 167, 125, 0.2); }
/* room for it above the page's heading */
html.app.has-app-bar main { padding-top: 3.6rem; }
html.app.has-app-bar .page-head { padding-top: 0.2rem; }

/* A page kept ready, being drawn behind the one you see because a finger is on its link */
#views .view.warm { visibility: visible; z-index: 0 !important; }
/* A thin gold line while a page that was not kept ready loads */
#views::after { content: ""; position: absolute; top: 0; left: 0; height: 3px; width: 0; z-index: 99999; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, #b98157, #f6dcc2, #b98157); box-shadow: 0 0 10px rgba(216, 167, 125, 0.6); }
#views.loading::after { opacity: 1; animation: views-loading 1.6s cubic-bezier(0.1, 0.7, 0.2, 1) both; }
@keyframes views-loading { from { width: 0; } to { width: 85%; } }

/* ---------- Privacy policy, terms of use, delete my account ---------- */
.legal .page-head h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); }
.legal-text { max-width: 44rem; padding-bottom: 2.5rem; }
.legal-text h2 { font-size: 1.15rem; margin: 2rem 0 0.6rem; color: var(--gold); letter-spacing: 0.04em; }
.legal-text p, .legal-text li { line-height: 1.7; }
.legal-text p { margin: 0 0 0.8rem; }
.legal-text ul, .legal-box ul { margin: 0 0 0.8rem; padding-left: 1.2rem; display: grid; gap: 0.45rem; }
.legal-text strong { color: var(--text); font-weight: 600; }
.legal-lead { font-size: 1.08rem; color: var(--text); }
.legal-links { margin-top: 2rem; color: var(--muted); }
.legal-box { margin-bottom: 1rem; }
.legal-box h2 { font-size: 1.05rem; margin: 0 0 0.6rem; color: var(--gold); }
.legal-box ul + h2 { margin-top: 1.2rem; }
.legal form.panel, .legal #signed-out, .legal #done { margin-bottom: 1rem; display: grid; gap: 0.6rem; justify-items: start; }
.legal form.panel[hidden], .legal #signed-out[hidden], .legal #done[hidden] { display: none; }
.foot-legal { font-size: 0.85rem; }
.login-legal { max-width: 460px; margin: 1rem 0 2rem; }
.public-note { margin: 2.5rem 0 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.public-note .link-btn { font-size: inherit; }
.consent-hint { margin: -0.6rem 0 1rem 1.7rem; }
.foot-legal a { white-space: nowrap; }


/* ---------- iPhone home-screen app: the page runs on up behind the clock ----------
   (Added to the Home Screen, the status bar is see-through and the page draws behind it. html.ios-app is set
   only there, by the start-up script; --top is the clock's height, from the phone. Everywhere else: no change.) */
html.ios-app { --top: env(safe-area-inset-top, 0px); --left: env(safe-area-inset-left, 0px); --right: env(safe-area-inset-right, 0px); }
/* the header's glass carries on up behind the clock (and slides away with the header when you scroll down) */
html.ios-app .site-header { padding-top: var(--top); }
/* the red emergency bar, and the header under it, start below the clock */
html.ios-app .emergency-bar { padding-top: calc(0.5rem + var(--top)); }
html.ios-app.has-emergency .site-header { top: calc(2.3rem + var(--top)); }
/* turned sideways: keep the page clear of the notch */
html.ios-app body { padding-left: var(--left); padding-right: var(--right); }
/* the app's frame: its pages run up behind the clock as well. A page inside the frame can't see the clock's
   height, so the frame measures it and gives it to each page as --top (see giveTop in shell.js). */
html.ios-app.shell body { padding: 0 var(--right) 0 var(--left) !important; }
html.ios-app.app main { padding-top: calc(0.6rem + var(--top)); }
html.ios-app.app .app-bar { top: calc(0.7rem + var(--top)); }
/* pages with the floating back button: room for it below the clock, so it never covers the heading */
html.ios-app.app.has-app-bar main { padding-top: calc(3.6rem + var(--top)); }
/* behind the clock: nothing at the top of a page (the page's own background shows), and once you scroll, a soft
   shade that fades out downwards with no edge, so what scrolls up goes under the clock instead of through it */
html.ios-app.app:not(.shell) body::after { content: ""; position: fixed; top: 0; left: 0; right: 0; height: calc(var(--top) + 22px); z-index: 79; pointer-events: none;
  /* exactly the app's own background at that spot (the same teal, glow and grain as #views .view in the frame), so it matches */
  background: var(--app-grain) 0 0 / 220px 220px repeat, var(--app-light) 0 0 / 100vw 100vh no-repeat, #0a2826;
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 var(--top), transparent 100%); mask-image: linear-gradient(180deg, #000 0, #000 var(--top), transparent 100%);
  opacity: 0; transition: opacity 0.2s ease; }
html.ios-app.app.scrolled:not(.shell) body::after { opacity: 1; }
html.ios-app .pull { top: calc(8px + var(--top)); }
/* iPhone leaves a strip under the app's window, filled with the page's background colour: make that the tab
   bar's colour, so the tab bar looks like it runs down to the bottom of the screen */
html.ios-app.shell, html.ios-app.shell body { background-color: #061a19; }
/* Manage: "Head / Assistant" + "Director of ..." side by side */
.dir-pick { display: grid; grid-template-columns: 8.5rem 1fr; gap: 0.5rem; }
.dir-pick[hidden] { display: none; }
/* Home page Directors: same cards as the rest of the team, one group per team (Director of IT,
   Director of Security...), groups side by side where they fit */
#directors .committee-group + .committee-group { margin-top: 1.8rem; }
#directors .committee-group:first-child { margin-top: 0; }
@media (min-width: 700px) {
  #directors { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.8rem 3rem; }
  #directors .committee-group { margin-top: 0 !important; }
  #directors .committee-group { flex: 0 0 auto; max-width: 100%; }
  #directors .person-card { flex: 0 0 210px; } /* a team's cards stay in one row, at the usual size */
  /* teams side by side line up: every card in a row is as tall as the tallest one */
  #directors .committee-group { display: flex; flex-direction: column; }
  #directors .committee-group .people-row { flex: 1; align-items: stretch; flex-wrap: nowrap; }
}

/* Home page Chiefs of Staff: three per row (two rows of three) */
@media (min-width: 700px) { #cos { max-width: calc(3 * 210px + 2 * 1.2rem); margin-inline: auto; } }

/* ---------- WESMUN drop-down lists (opened by WES.dropdowns in common.js) ---------- */
select.wes-open { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.wes-menu {
  position: fixed; z-index: 10050; overflow-y: auto; overscroll-behavior: contain; padding: 6px;
  background: linear-gradient(180deg, #0f3532, #0a2826); color: var(--text);
  border: 1px solid rgba(216, 167, 125, 0.55); border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(246, 220, 194, 0.12);
  font-family: var(--font); font-size: 0.97rem;
  animation: wes-menu-in 0.14s ease-out;
  scrollbar-width: thin; scrollbar-color: rgba(216, 167, 125, 0.6) transparent;
}
.wes-menu.up { animation-name: wes-menu-up; }
@keyframes wes-menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes wes-menu-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.wes-menu::-webkit-scrollbar { width: 6px; }
.wes-menu::-webkit-scrollbar-track { background: transparent; margin: 8px 0; }
.wes-menu::-webkit-scrollbar-thumb { background: rgba(216, 167, 125, 0.55); border-radius: 6px; }
.wes-menu::-webkit-scrollbar-button { display: none; height: 0; }
.wes-opt {
  position: relative; padding: 0.55rem 2.1rem 0.55rem 0.8rem; border-radius: 8px; cursor: pointer;
  line-height: 1.3; -webkit-tap-highlight-color: transparent; user-select: none;
}
.wes-opt.in-group { padding-left: 1.2rem; }
.wes-opt.on { background: var(--gold-soft); color: var(--gold-hi); }
.wes-opt.sel { color: var(--gold-hi); background: rgba(216, 167, 125, 0.2); }
.wes-opt.sel::after { content: ''; position: absolute; right: 0.85rem; top: 50%; width: 0.38rem; height: 0.7rem; margin-top: -0.45rem;
  border: solid var(--gold); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.wes-opt.off { opacity: 0.4; cursor: default; }
.wes-group {
  padding: 0.7rem 0.8rem 0.3rem; font-family: var(--font-label); font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold);
}
.wes-group:first-child { padding-top: 0.35rem; }
@media (prefers-reduced-motion: reduce) { .wes-menu { animation: none; } }

/* Home page numbers (3 Days · 16 Committees · 500+ Delegates): one row on phones too, like on a computer */
@media (max-width: 600px) {
  .stats { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0.5rem; }
  .stat { padding: 0.9rem 0.25rem; }
  .stat b { font-size: clamp(1.7rem, 8.5vw, 2.4rem); }
  .stat span { font-size: 0.62rem; letter-spacing: 0.1em; margin-top: 0.4rem; }
}

/* Manage, "Everyone": fits the page on computers (the buttons wrap instead of the table sliding sideways);
   on phones and narrow windows each person is a small card (everything shows, no sliding left and right) */
.people-table { min-width: 0; }
.people-table td.actions { white-space: nowrap; }
/* Manage: a heading row above each team */
.people-table tr.team-row th { text-align: left; padding: 1.1rem 0.6rem 0.4rem; color: var(--gold); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; border-bottom: 1px solid var(--line); background: transparent; }
.people-table tbody tr.team-row:first-child th { padding-top: 0.5rem; }
/* Manage: sections and teams fold away by their heading */
#app > section.folded > :not(.fold-head):not(style) { display: none !important; }
#app > section.folded .section-title { margin-bottom: 0; }
#app h2[role="button"] { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 0.6rem; }
#app h2[role="button"]::after, .team-fold::after { content: ""; width: 0.45em; height: 0.45em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); margin-top: -0.2em; transition: transform 0.15s; flex: none; }
#app h2[aria-expanded="false"]::after, .team-fold[aria-expanded="false"]::after { transform: rotate(-45deg); margin-top: 0; }
#app h2[role="button"]:focus-visible, .team-fold:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
#app > section.panel.folded { padding-bottom: 1rem; }
#app > section.panel.folded > h2 { margin-bottom: 0; }
.team-fold { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; }
@media (max-width: 1200px) {
  .table-wrap:has(.people-table) { overflow-x: visible; }
  .people-table, .people-table tbody, .people-table tr, .people-table td { display: block; width: auto; min-width: 0; }
  .people-table thead { display: none; }
  .people-table tr.team-row, .people-table tr.team-row th { display: block; padding-left: 0.85rem; }
  .people-table tr { padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--line); }
  .people-table tr:last-child { border-bottom: 0; }
  .people-table td { border: 0; padding: 0.1rem 0; font-size: 0.86rem; overflow-wrap: anywhere; }
  .people-table td:empty, .people-table td[data-label]:empty { display: none; }
  .people-table td.pt-name { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-weight: 700; font-size: 1rem; padding-bottom: 0.3rem; }
  .people-table td[data-label] { display: grid; grid-template-columns: 6rem 1fr; align-items: baseline; }
  .people-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
  .people-table td.actions { display: flex; flex-wrap: wrap; gap: 0.4rem; text-align: left; white-space: normal; padding-top: 0.5rem; }
  .people-table td.actions { width: auto; min-width: 0; }
  .people-table td.actions .btn, .people-table td.actions .btn + .btn { margin: 0; }
}
.people-table td.pt-name > span:not(.badge) { display: block; }
.people-table td.pt-name .badge { margin-top: 0.25rem; } /* the role, under the name */
@media (max-width: 1200px) { .people-table td.pt-name .badge { display: inline-flex; flex: none; margin-top: 0; } }

/* Marks: a delegate's percentages, the committee's standings, and each chair's mark */
.mk-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.mk-stat { padding: 0.9rem 0.5rem; text-align: center; border: 1px solid rgba(216, 167, 125, 0.25); border-radius: 14px; background: rgba(216, 167, 125, 0.06); }
.mk-stat b { display: block; font-family: var(--font-mark); font-size: clamp(1.4rem, 5vw, 2.2rem); color: var(--gold); line-height: 1.1; font-variant-numeric: tabular-nums; }
.mk-stat span { display: block; margin-top: 0.35rem; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.mk-page > * + * { margin-top: 1rem; }
.mk-awards { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.6rem; }
.mk-awards li { padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.mk-awards .k { margin: 0; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.mk-awards .who { margin: 0.2rem 0 0; font-weight: 700; overflow-wrap: anywhere; }
.mk-table { min-width: 0; }
.mk-table th:not(:nth-child(2)), .mk-table td:not(:nth-child(2)) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mk-table td:nth-child(2) { overflow-wrap: anywhere; }
.mk-card { background: var(--panel); border: 1px solid rgba(216, 167, 125, 0.22); border-radius: 12px; margin-top: 0.5rem; }
.mk-card summary { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.75rem 1rem; cursor: pointer; }
.mk-card summary b { overflow-wrap: anywhere; }
.mk-body { padding: 0 1rem 1rem; }
.mk-piece { padding: 0.75rem 0; border-top: 1px solid var(--line); }
.mk-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.mk-head h3 { margin: 0; font-size: 1rem; }
.mk-head p { margin: 0.1rem 0 0; }
.mk-form { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 0.5rem; margin-top: 0.6rem; }
.mk-form textarea { width: 100%; }
.mk-form .btn-row, .mk-form .mk-slot { grid-column: 1 / -1; }
.mk-form .btn-row { align-items: center; }
@media (max-width: 520px) { .mk-form { grid-template-columns: minmax(0, 1fr); } }
.mk-card { scroll-margin-top: 5.5rem; }

/* ---------- Messages: group chats (chat.html) ---------- */
.chat { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 1rem; align-items: start; margin-bottom: 2rem; }
.chat-side { display: flex; flex-direction: column; gap: 0.7rem; }
.chat-side .btn { align-self: flex-start; }
.chat-list { display: flex; flex-direction: column; gap: 0.4rem; }
.chat-item { display: flex; align-items: center; gap: 0.7rem; width: 100%; padding: 0.7rem 0.8rem; border-radius: 14px; background: var(--panel);
  border: 1px solid var(--line); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.chat-item:hover { border-color: rgba(216, 167, 125, 0.45); }
.chat-item.on { border-color: var(--gold); background: rgba(216, 167, 125, 0.1); }
.chat-av { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--gold-soft);
  border: 1px solid rgba(216, 167, 125, 0.4); color: var(--gold-hi); font-size: 0.85rem; letter-spacing: 0.04em; }
.chat-av.small { width: 32px; height: 32px; font-size: 0.75rem; }
.chat-item-main { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 0.1rem; }
.chat-item-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.chat-item-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-when { flex: none; font-size: 0.72rem; }
.chat-last { font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-badge { flex: none; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--gold); color: var(--ink);
  font-size: 0.75rem; font-weight: 700; display: grid; place-items: center; }
.chat-none { padding: 1rem 0.2rem; margin: 0; }
.chat-empty { padding: 2rem 1rem; text-align: center; border: 1px dashed var(--line); border-radius: 14px; margin: 0; }

.chat-room { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  height: min(720px, calc(100dvh - 14rem)); min-height: 380px; }
.chat-room[hidden] { display: none; }
/* opening a chat (and going back to the list): it comes in softly; its messages fade in when they arrive */
.chat-room-in { animation: chat-room-in 0.24s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes chat-room-in { from { opacity: 0; transform: translateY(8px); } }
.chat-msgs-in { animation: chat-msgs-in 0.22s ease-out; }
@keyframes chat-msgs-in { from { opacity: 0; } }
/* (on a phone the list and a chat take turns: the one going fades out first; see chat.js) */
.chat-out { opacity: 0; transform: translateY(-4px); transition: opacity 0.14s ease, transform 0.14s ease; pointer-events: none; }
/* a message on its way */
.chat-msg.pending { opacity: 0.6; }
/* an open chat in the app: the page itself never scrolls (the chat fills the screen exactly) */
html.chat-lock, html.chat-lock body { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .chat-room-in, .chat-msgs-in { animation: none; } .chat-out { transition: none; } }
.chat-top { display: flex; align-items: center; gap: 0.7rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); background: var(--coal); }
.chat-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-title b { font-size: 1.02rem; }
.chat-title .muted { font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* (the group's name is a button: tap it to see who is in the group) */
button.chat-title { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 6px; }
button.chat-title:hover .muted, button.chat-title:focus-visible .muted { text-decoration: underline; }
.chat-people-list { list-style: none; margin: 0.4rem 0 0; padding: 0; width: 100%; max-height: min(55dvh, 26rem); overflow-y: auto; text-align: left;
  border-top: 1px solid var(--line); overscroll-behavior: contain; }
.chat-people-list li { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.2rem; border-bottom: 1px solid var(--line); }
.chat-people-list li > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.chat-people-list b { font-weight: 600; overflow-wrap: anywhere; }
.chat-people-list .muted { font-size: 0.8rem; }
.chat-back { display: none; background: none; border: 0; color: var(--gold); font-size: 2rem; line-height: 1; padding: 0 0.3rem 0.2rem 0; cursor: pointer; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; overscroll-behavior: contain; }
.chat-msg { max-width: min(78%, 34rem); align-self: flex-start; padding: 0.55rem 0.8rem 0.4rem; border-radius: 16px 16px 16px 4px;
  background: var(--panel-2, #14403d); border: 1px solid var(--line); display: flex; flex-direction: column; }
.chat-msg.cont { margin-top: -0.3rem; border-top-left-radius: 8px; }
.chat-msg.mine { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: rgba(216, 167, 125, 0.14); border-color: rgba(216, 167, 125, 0.4); }
.chat-msg.mine.cont { border-top-right-radius: 8px; border-top-left-radius: 16px; }
.chat-from { font-size: 0.78rem; color: var(--gold); margin-bottom: 0.15rem; }
.chat-role { color: var(--muted); }
.chat-text { white-space: pre-wrap; word-break: break-word; line-height: 1.4; }
/* a deleted message (only the site's owner sees these) */
.chat-msg.gone { opacity: 0.6; border-style: dashed; border-color: rgba(232, 114, 122, 0.55); }
.chat-gone { font-size: 0.72rem; color: var(--danger); margin-bottom: 0.2rem; }
/* the site's owner: every other group, to look into (read only) */
.chat-list-head { margin: 0.9rem 0.4rem 0.3rem; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.chat-item.watching .chat-av { border-style: dashed; }
.chat-watch { margin: 0; padding: 0.8rem 1rem; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--muted); text-align: center; background: var(--coal); }
.chat-meta { align-self: flex-end; display: flex; gap: 0.6rem; align-items: center; margin-top: 0.2rem; font-size: 0.68rem; color: var(--muted); }
.chat-x { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; opacity: 0; transition: opacity 0.2s; }
.chat-msg:hover .chat-x, .chat-x:focus-visible { opacity: 1; }
@media (hover: none) { .chat-x { opacity: 0.8; } }
.chat-send { display: flex; gap: 0.6rem; align-items: flex-end; padding: 0.7rem; border-top: 1px solid var(--line); background: var(--coal); }
.chat-send textarea { flex: 1; resize: none; font: inherit; min-height: 44px; max-height: 140px; border-radius: 22px; padding: 0.65rem 1rem; line-height: 1.35; }
.chat-send .btn { flex: none; border-radius: 22px; min-height: 44px; }
.chat-room .status { margin: 0; padding: 0 1rem; }
.chat-room .status:empty { display: none; }

.chat-dlg { width: min(30rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 16px; padding: 1.3rem; }
.chat-dlg::backdrop { background: rgba(0, 0, 0, 0.6); }
.chat-dlg h2 { margin-top: 0; }
.chat-dlg input { width: 100%; }
.chat-people { max-height: 40vh; overflow-y: auto; display: flex; flex-direction: column; gap: 0.2rem; border: 1px solid var(--line); border-radius: 12px; padding: 0.3rem; }
.chat-person { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.5rem; border-radius: 10px; cursor: pointer; }
.chat-person:hover { background: rgba(255, 255, 255, 0.04); }
.chat-person.on { background: rgba(216, 167, 125, 0.12); }
.chat-person input { width: auto; flex: none; accent-color: var(--gold); }
.chat-person > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.chat-person .muted { font-size: 0.78rem; }
.chat-dlg .btn-row { align-items: center; }
.chat-del { margin-left: auto; color: var(--danger); }

/* A short heading, so the whole chat fits on the screen (its height is set to the space left: see chat.js) */
.chat-head { padding-block: 1rem 0.6rem; }
.chat-head h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0.1rem 0 0; }
.chat-head .muted { margin: 0.25rem 0 0; font-size: 0.9rem; }
.chat-head + .notice + .chat, .chat { margin-bottom: 1rem; }

/* Phones and the app: the list, or one group full height (with a back arrow) */
@media (max-width: 800px) {
  .chat { grid-template-columns: minmax(0, 1fr); }
  .chat-empty { display: none; }
  body.chat-open .chat-side, body.chat-open .page-head { display: none; }
  .chat-back { display: block; }
  .chat-room { height: calc(100dvh - 9rem); min-height: 320px; }
  html.app .chat-room { height: calc(100dvh - 7.5rem - env(safe-area-inset-bottom, 0px)); }
  .chat-msg { max-width: 86%; }
}

/* ---------- Scrollbars: rose gold on teal, everywhere (the page, chats, lists, menus) ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(6, 26, 25, 0.55); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #f6dcc2, #d8a77d 45%, #a8744d); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #f6dcc2, #e2b58c 45%, #b98157); background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-corner { background: transparent; }
/* (inside boxes: a slimmer bar on a see-through track) */
.chat-msgs::-webkit-scrollbar, .chat-people::-webkit-scrollbar, .chat-list::-webkit-scrollbar, dialog ::-webkit-scrollbar { width: 7px; }
.chat-msgs::-webkit-scrollbar-track, .chat-people::-webkit-scrollbar-track, dialog ::-webkit-scrollbar-track { background: transparent; margin: 6px 0; }
/* Firefox (it has no ::-webkit-scrollbar; Chrome ignores those when these are set, so Firefox only) */
@supports (-moz-appearance: none) {
  * { scrollbar-width: thin; scrollbar-color: #d8a77d rgba(6, 26, 25, 0.55); }
}

/* Photos and files in Messages */
.chat-attach { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: transparent; color: var(--gold); cursor: pointer; }
.chat-attach:hover { border-color: var(--gold); background: var(--gold-soft); }
.chat-attach svg { width: 22px; height: 22px; }
.chat-file-chip { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.5rem 1rem; border-top: 1px solid var(--line);
  background: var(--coal); font-size: 0.88rem; }
.chat-file-chip[hidden] { display: none; }
.chat-file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-img { display: block; margin: 0.15rem 0 0.3rem; border-radius: 12px; overflow: hidden; line-height: 0; }
.chat-img img { display: block; max-width: min(280px, 100%); max-height: 320px; width: auto; height: auto; object-fit: cover; background: rgba(0, 0, 0, 0.2); }
.chat-file { display: flex; align-items: center; gap: 0.6rem; margin: 0.15rem 0 0.3rem; padding: 0.5rem 0.6rem; border-radius: 10px;
  background: rgba(0, 0, 0, 0.18); border: 1px solid var(--line); color: var(--text); text-decoration: none; min-width: 0; }
.chat-file:hover { border-color: var(--gold); }
.chat-file-ic { flex: none; padding: 0.35rem 0.4rem; border-radius: 6px; background: var(--gold-soft); color: var(--gold-hi); font-size: 0.65rem; letter-spacing: 0.05em; }
.chat-file-text { display: flex; flex-direction: column; min-width: 0; }
.chat-file-text b { font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.chat-file-text .muted { font-size: 0.72rem; }

/* A photo from Messages, full screen */
.chat-view { position: fixed; inset: 0; z-index: 2147483000; display: flex; flex-direction: column; background: rgba(4, 18, 17, 0.94);
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); animation: chat-view-in 0.18s ease-out; }
.chat-view.out { opacity: 0; transition: opacity 0.2s; }
@keyframes chat-view-in { from { opacity: 0; } to { opacity: 1; } }
.chat-view-bar { display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem 1rem; }
.chat-view-name { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: 0.85rem; }
.chat-view-name span { color: var(--muted); font-size: 0.75rem; }
.chat-view-x { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--gold-hi);
  font-size: 1.7rem; line-height: 1; cursor: pointer; }
.chat-view-x:hover { border-color: var(--gold); }
.file-view-frame { flex: 1; min-height: 0; width: 100%; border: 0; background: #fff; }
.chat-view-img { flex: 1; min-height: 0; width: 100%; object-fit: contain; padding: 0 0.8rem; cursor: zoom-out; }
.chat-view-text { margin: 0; max-width: none; width: 100%; padding: 0.8rem 1.2rem 1.2rem; text-align: center; white-space: pre-wrap; word-break: break-word; }

/* Team locations (Directors of IT) */
.loc-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem; margin: 0.4rem 0 1rem; }
.loc-sum { margin: 0; }
.loc-sum b { color: var(--gold-hi); font-weight: 600; }
.loc-test { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; font-size: 0.85rem; }
.loc-search { max-width: 360px; }
.loc-list { display: flex; flex-direction: column; gap: 0.5rem; }
.loc-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) auto; align-items: center; gap: 0.8rem;
  padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.loc-row.on { border-color: rgba(127, 214, 194, 0.45); }
.loc-who { display: flex; flex-direction: column; min-width: 0; }
.loc-who b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-who .muted, .loc-bits { font-size: 0.8rem; }
.loc-where { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; min-width: 0; }
.loc-foot { font-size: 0.8rem; margin-top: 1rem; }
@media (max-width: 640px) {
  .loc-row { grid-template-columns: minmax(0, 1fr) auto; }
  .loc-where { grid-column: 1 / -1; grid-row: 2; }
}
/* The one-time "location sharing" screen in the app */
.loc-ask { position: fixed; inset: 0; z-index: 2147483000; display: grid; place-items: center; padding: 1.2rem;
  padding-top: calc(1.2rem + env(safe-area-inset-top, 0px)); background: rgba(4, 18, 17, 0.9); overflow-y: auto; }
.loc-ask-card { width: min(440px, 100%); padding: 1.6rem 1.4rem 1.4rem; border-radius: 18px; border: 1px solid rgba(216, 167, 125, 0.4);
  background: var(--panel); box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.9); }
.loc-ask-ic { width: 52px; height: 52px; margin-bottom: 0.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-hi); }
.loc-ask-ic svg { width: 28px; height: 28px; }
.loc-ask h2 { margin: 0 0 0.6rem; font-size: 1.3rem; }
.loc-ask p, .loc-ask li { font-size: 0.92rem; line-height: 1.5; }
.loc-ask ul { margin: 0.4rem 0 0.8rem; padding-left: 1.2rem; }
.loc-ask li { margin-bottom: 0.35rem; }
.loc-ask .btn { width: 100%; margin-top: 0.4rem; }

/* ---------- Team dropdown (Directors, Chairs) and the group headings in your menu ---------- */
.nav-drop-btn { display: inline-flex; align-items: center; gap: 0.4rem; }
.nav-drop-btn .caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; transition: transform 0.25s; }
.nav-drop.open .nav-drop-btn .caret { transform: rotate(180deg); }
.nav-drop:has(a[aria-current="page"]) .nav-drop-btn, .nav-drop.open .nav-drop-btn { color: var(--gold); }
.nav-more-panel.nav-drop-panel { left: 0; right: auto; min-width: 170px; }
.nav-more-panel.nav-mine { max-height: calc(100vh - 110px); overflow-y: auto; min-width: 260px; } /* wide enough that no item wraps */
@media (min-width: 901px) {
  #nav .nav-mine > a, #nav .nav-mine > .link-btn { white-space: nowrap; }
  /* a line between the quick links at the top (Announcements, Pager calls) and Your tools */
  .nav-mine > a + .nav-sub { border-top: 1px solid var(--line); padding-top: 0.55rem; margin-top: 0.4rem; }
}
.nav-more-panel .nav-sub { display: block; margin: 0.45rem 0 0.1rem; padding: 0 0.7rem; font-family: var(--font-label); font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.nav-more-panel .nav-sub:first-of-type { margin-top: 0.1rem; }
@media (max-width: 900px) {
  /* phones: no Team button, just Directors and Chairs as two tiles with the others */
  .nav-drop, .nav-drop .nav-drop-panel { display: contents !important; }
  .nav-drop-btn { display: none !important; }
  .nav-more-panel.nav-mine { max-height: none; overflow: visible; }
  #nav .nav-more-panel .nav-sub { margin: 0.6rem 0 0; padding: 0; }
}
.nav-more-panel .nav-sub ~ .nav-sub { border-top: 1px solid var(--line); padding-top: 0.55rem; margin-top: 0.4rem; }
@media (max-width: 900px) { #nav .nav-more-panel .nav-sub ~ .nav-sub { border-top: 0; padding-top: 0; } }

/* Menu icons: a small icon beside each item in your dropdown and in the phone menu (not in the wide top bar).
   Items marked wide-only / narrow-only show on one of the two (Support, Messages). */
#nav .nav-ic { display: none; }
@media (min-width: 901px) { #nav a.narrow-only { display: none !important; } }
#nav .nav-more-panel a, #nav .nav-more-panel .link-btn { display: flex; align-items: center; gap: 0.6rem; }
#nav .nav-more-panel .nav-ic { display: inline-flex; width: 17px; height: 17px; color: var(--gold); opacity: 0.85; }
@media (max-width: 900px) {
  #nav .wide-only { display: none !important; }
  #nav a, #nav .nav-more-panel a { gap: 0.55rem; padding-inline: 0.75rem; }
  #nav .nav-ic, #nav .nav-more-panel .nav-ic { display: inline-flex; width: 19px; height: 19px; color: var(--gold); opacity: 0.9; }
  #nav .nav-t { flex: 1; min-width: 0; }
  .nav-group, .nav-more-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); } /* two even columns */
  @media (min-width: 600px) { .nav-group, .nav-more-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); } } /* iPads upright: three */
  #nav .nav-more-panel .link-btn { display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
  /* each group gets a thin rule above its heading, so the groups read as separate blocks */
  #nav .nav-more-panel .nav-sub, #nav .nav-more-panel .nav-sub ~ .nav-sub { border-top: 1px solid var(--line); padding-top: 0.9rem; margin-top: 0.5rem; }
}

/* Tabs between the committee's pages (Committee, Speakers' list, Notes & votes) */
.sec-tabs { display: flex; gap: 0.45rem; overflow-x: auto; margin: 0.2rem 0 1.4rem; padding-bottom: 2px; scrollbar-width: none; }
.sec-tabs::-webkit-scrollbar { display: none; }
.sec-tab { flex: none; padding: 0.5rem 1rem; border: 1px solid rgba(216, 167, 125, 0.3); border-radius: 999px; background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-label); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text); text-decoration: none; white-space: nowrap; }
.sec-tab:hover { border-color: var(--gold); color: var(--gold); }
.sec-tab[aria-current="page"] { background: var(--metal); color: var(--ink); border-color: var(--gold); }
body.display-mode .sec-tabs { display: none !important; } /* (full-screen speakers' list) */
/* (one segmented bar, so it never looks like the page's own buttons, and fits a phone) */
.sec-tabs { gap: 0; padding: 4px; border: 1px solid rgba(216, 167, 125, 0.35); border-radius: 999px; background: rgba(0, 0, 0, 0.18); max-width: 560px; overflow: visible; }
.sec-tab { flex: 1 1 0; min-width: 0; text-align: center; border-color: transparent; background: none; padding: 0.55rem 0.5rem; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .sec-tab { font-size: 0.62rem; letter-spacing: 0.06em; padding: 0.55rem 0.3rem; } }

.committee-group[id] { scroll-margin-top: 80px; }
html.app .committee-group[id] { scroll-margin-top: 64px; }
html.app .sheet-shade { padding-bottom: calc(70px + env(safe-area-inset-bottom)); } /* (above the app's tab bar) */

/* Home page team (Secretariat, Chiefs of Staff, Directors, Chairs): smaller cards in one line that
   scrolls sideways, instead of wrapping down the page */
.section .people-row {
  flex-wrap: nowrap !important; justify-content: safe center; gap: 0.8rem;
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; overscroll-behavior-x: contain;
  padding: 8px 4px 12px; margin-inline: -4px; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: rgba(216, 167, 125, 0.45) transparent;
}
.section .people-row::-webkit-scrollbar { height: 6px; }
.section .people-row::-webkit-scrollbar-thumb { background: rgba(216, 167, 125, 0.45); border-radius: 3px; }
.section .people-row + .people-row { margin-top: 0.6rem; }
.section .person-card, #directors .person-card { flex: 0 0 160px !important; scroll-snap-align: start; }
.section .people-row.big .person-card { flex-basis: 185px !important; }
.section .person-card:hover, .section .person-card:focus-visible { transform: translateY(-3px); }
.section .person-card .info { padding: 0.15rem 0.75rem 0.8rem; margin-top: -1.2rem; }
.section .person-card .name { font-size: 0.92rem; }
.section .people-row.big .person-card .name { font-size: 1.02rem; }
.section .person-card .title { font-size: 0.6rem; letter-spacing: 0.1em; }
.section .person-card .sub { font-size: 0.72rem; }
.section .pic .initials { font-size: 2.2rem; }
#cos { max-width: none !important; }
#directors .committee-group { min-width: 0; }
.committee-group h3 { margin-bottom: 0.4rem; }
@media (max-width: 600px) {
  .section .person-card, #directors .person-card { flex-basis: 128px !important; }
  .section .people-row.big .person-card { flex-basis: 150px !important; }
  .section .person-card .name { font-size: 0.8rem; }
  .section .people-row.big .person-card .name { font-size: 0.9rem; }
  .section .person-card .title { font-size: 0.55rem; }
  .section .person-card .info { padding: 0.1rem 0.6rem 0.7rem; }
}

/* Home page team: Secretariat / Directors / Chairs tabs, and a row to pick one group */
.team-tabs { margin: 0 auto 0.9rem; max-width: 460px; }
.team-tabs .sec-tab { cursor: pointer; font-family: var(--font-label); }
.team-tabs .sec-tab[aria-selected="true"] { background: var(--metal); color: var(--ink); border-color: var(--gold); }
.team-sub { display: flex; justify-content: safe center; gap: 0.45rem; overflow-x: auto; margin: 0 auto 1.4rem; padding: 2px 2px 6px; scrollbar-width: none; }
.team-sub::-webkit-scrollbar { display: none; }
.team-sub[hidden] { display: none; }
.team-chip { flex: none; padding: 0.42rem 0.9rem; border: 1px solid rgba(216, 167, 125, 0.3); border-radius: 999px; background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-label); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text); white-space: nowrap; cursor: pointer; }
.team-chip:hover { border-color: var(--gold); color: var(--gold); }
.team-chip[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.team-tabs:not(:has(+ .team-sub:not([hidden]))) { margin-bottom: 1.6rem; }
.team-panel[hidden], .team-panel .committee-group[hidden] { display: none !important; }
.team-panel { min-height: 200px; }
#chairs .committee-group:first-child, #directors-section > .committee-group:first-child { margin-top: 0; }
.team-panel, .team-panel .committee-group[id] { scroll-margin-top: 140px; } /* (land with the tabs still on screen) */
html.app .team-panel, html.app .team-panel .committee-group[id] { scroll-margin-top: 150px; }

/* Team cards a bit bigger on PC */
@media (min-width: 900px) {
  .section .person-card, #directors .person-card { flex-basis: 205px !important; }
  .section .people-row.big .person-card { flex-basis: 240px !important; }
  .section .person-card .name { font-size: 1.05rem; }
  .section .people-row.big .person-card .name { font-size: 1.18rem; }
  .section .person-card .title { font-size: 0.66rem; }
  .section .person-card .sub { font-size: 0.8rem; }
  .section .pic .initials { font-size: 2.8rem; }
}

/* Phones: team card rows run to the screen edge (no hard cut a little before it);
   the first card still lines up with the text above */
@media (max-width: 760px) {
  .section .people-row {
    margin-inline: calc(50% - 50vw); padding-inline: calc(50vw - 50%);
    scroll-padding-inline: 1.25rem; /* (the page's side gap; a % here would count the whole row, so 0, and the first card would snap to the edge) */
  }
  html.app .section .people-row { scroll-padding-inline: 1rem; }
}

/* Website on PC: team cards wrap onto more rows (all visible) instead of one row that
   scrolls sideways; phones and the app keep the sideways row */
@media (min-width: 761px) {
  html:not(.app) .section .people-row {
    flex-wrap: wrap !important; overflow: visible; scroll-snap-type: none;
    justify-content: center; margin-inline: 0; padding: 8px 0 4px;
  }
}

/* Website on PC: a group's cards share one row, shrinking a little to fit when needed
   (only a very long group, about 8 or more, goes onto a second row) */
@media (min-width: 761px) {
  html:not(.app) .section .person-card, html:not(.app) #directors .person-card {
    flex: 1 1 0 !important; min-width: 120px; max-width: 205px;
  }
  html:not(.app) .section .people-row.big .person-card { max-width: 240px; }
  #directors-section > #cos-section { margin-bottom: 1.8rem; } /* (only while it is first: after Director of IT it sits in the teams list) */
}

/* Website on PC: The Team section uses the whole width between the side vines (not just the
   1080px text column), so a full row of cards keeps its full size */
@media (min-width: 761px) {
  html:not(.app) body > main:not(.wrap) #team > .wrap { width: min(1500px, 100% - 2 * (var(--vine-w) + 0.9rem)); }
  html:not(.app) .section .person-card, html:not(.app) #directors .person-card { width: 205px; min-width: 96px; } /* (so a group asks for full-size cards; small windows can still fit six) */
  html:not(.app) .section .people-row.big .person-card { width: 240px; }
}

/* Assistant questions (the owner's page) */
.al-list { display: grid; gap: 0.8rem; margin-top: 1rem; }
.report-text.al-q { border-left-color: var(--gold); }
.al-a { margin: 0; white-space: pre-wrap; word-break: break-word; }
/* Earlier votes: the chairs' Delete link */
.vote-hist li > span:first-child { flex: 1; }
.vote-hist .link-btn.danger { color: var(--danger); font-size: 0.72rem; background: none; border: 0; padding: 0.2rem 0; cursor: pointer; }
.vote-hist .link-btn.danger:hover { text-decoration: underline; }
/* WESMUN pop-ups (WES.confirm, WES.alert, WES.prompt in common.js), in place of the browser's own */
.wes-dlg { width: min(25rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; overflow: auto;
  background: radial-gradient(circle at 50% 0%, rgba(216, 167, 125, 0.12), transparent 60%), var(--panel); color: var(--text);
  border: 1px solid var(--gold-lo); border-radius: 18px; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(246, 220, 194, 0.06) inset; }
.wes-dlg.danger { border-color: rgba(232, 114, 122, 0.55); }
.wes-dlg::backdrop { background: rgba(3, 18, 17, 0.7); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.wes-dlg[open] { animation: wes-dlg-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); }
.wes-dlg[open]::backdrop { animation: wes-dlg-fade 0.22s ease-out; }
@keyframes wes-dlg-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes wes-dlg-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wes-dlg[open], .wes-dlg[open]::backdrop { animation: none; } }
.wes-dlg-in { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 1.4rem 1.4rem 1.2rem; margin: 0; }
.wes-dlg-crest { width: 40px; height: 42px; margin-bottom: 0.5rem; filter: drop-shadow(0 4px 12px rgba(216, 167, 125, 0.35)); }
.wes-dlg-title { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: 0.04em; margin: 0 0 0.5rem; color: var(--gold-hi);
  background: var(--metal); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.wes-dlg.danger .wes-dlg-title { background: none; -webkit-text-fill-color: currentColor; color: var(--text); }
.wes-dlg-text { margin: 0 0 0.6rem; color: var(--muted); line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.wes-dlg-text:first-of-type { color: var(--text); }
.wes-dlg-input { width: 100%; margin: 0.2rem 0 0.4rem; text-align: center; }
.wes-dlg-area { text-align: left; resize: vertical; min-height: 9rem; max-height: 50vh; line-height: 1.45; font: inherit; } /* (a longer text, like a description) */
.wes-dlg-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin-top: 0.8rem; width: 100%; }
.wes-dlg-btns .btn { min-width: 7.5rem; }
/* Vines only frame the home page's opening section (WES.flourishes): every other page has none, so
   its content uses the space they kept free (the same side margin as on phones) */
html:not(:has(.hero)) { --vine-w: 0.75rem; }
html:not(:has(.hero)) .flourish { display: none; }

/* ---------- Home: the first screen ends just above the committee strip, so the strip shows without scrolling.
   On shorter screens the crest and the title get a little smaller so everything still fits. ---------- */
html:not(.app) .hero {
  min-height: calc(100vh - 104px); min-height: calc(100svh - 104px); /* (the menu bar is about 59px, the strip about 45px) */
  padding-top: clamp(1rem, 5vh, 4.5rem); padding-bottom: clamp(4.6rem, 10.5vh, 8rem);
}
html:not(.app) .hero-crest { width: clamp(100px, min(22vw, 22vh), 230px); }
html:not(.app) .logo { font-size: clamp(2.8rem, min(12vw, 12vh), 7.4rem); }
@media (min-width: 761px) and (max-height: 760px) { /* short laptop screens: a tighter first screen */
  html:not(.app) .hero-crest { width: clamp(90px, 18vh, 230px); margin-bottom: 0.2rem; }
  html:not(.app) .logo { font-size: clamp(2.6rem, 11vh, 7.4rem); }
  html:not(.app) .hero .ornament { margin-block: 0.4rem; }
  html:not(.app) .hero .countdown { margin-block: 0.5rem 0.7rem; }
  html:not(.app) .hero .cd-box { padding-block: 0.4rem 0.3rem; }
}

/* The softer sky on every other page (see WES.sky): dimmer rays and two slow pools of light drifting
   across the background, so plain pages like the Dashboard don't feel flat. */
.sky.soft .sky-rays { opacity: 0.6; animation: sky-turn 240s linear infinite; }
.sky-glow { position: absolute; inset: -20%; pointer-events: none;
  background:
    radial-gradient(38% 32% at 22% 30%, rgba(216, 167, 125, 0.075), transparent 70%),
    radial-gradient(42% 36% at 78% 72%, rgba(64, 168, 150, 0.10), transparent 70%);
  animation: sky-drift 38s ease-in-out infinite alternate; }
@keyframes sky-drift { from { transform: translate3d(-4%, -3%, 0) scale(1); } to { transform: translate3d(5%, 4%, 0) scale(1.12); } }
@keyframes sky-turn { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sky.soft .sky-rays, .sky-glow { animation: none; } }
/* Phones and tablets: this background stays still. The rays took 4 minutes per turn and the light drifted over
   38 seconds, too slow to notice, but the phone redrew those huge layers on every scroll. */
@media (pointer: coarse), (max-width: 1024px) { .sky.soft .sky-rays, .sky-glow { animation: none; } }

/* ---------- WESMUN Meet (video calls, website only: meet.html) ---------- */
.meet-rooms { display: grid; gap: 0.7rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 0.5rem; }
.meet-room { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.8rem; padding: 0.9rem 1rem; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
/* (the name and status keep room to read; with two buttons on a narrow card, the buttons go underneath) */
.meet-room-btns { flex: none; margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.4rem; }
.meet-room.live { border-color: rgba(127, 214, 194, 0.55); box-shadow: 0 0 0 1px rgba(127, 214, 194, 0.15) inset; }
.meet-room-main { flex: 1 1 10rem; min-width: 0; }
.meet-room-name { margin: 0; font-family: var(--font-display); font-weight: 700; color: var(--gold-hi); }
.meet-room-main .small, .meet-person .small, .meet-msg .small { margin: 0.1rem 0 0; font-size: 0.78rem; }
.meet-tip { margin-top: 1rem; font-size: 0.85rem; }
/* Meet: private calls (set up with the people you pick) */
.meet-private { margin: 0 0 0.9rem; }
.meet-private-form { margin-top: 0.7rem; }
.meet-private-form h2 { margin-top: 0; }
.meet-private-people { max-height: 22rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.2rem; border: 1px solid var(--line); border-radius: 12px; padding: 0.3rem; }
/* (each person: like the people picker in Chat) */
.meet-private-people label { display: flex; align-items: center; gap: 0.7rem; margin: 0; padding: 0.5rem 0.6rem; border-radius: 10px; cursor: pointer;
  text-transform: none; letter-spacing: 0; font-size: 0.95rem; color: var(--text); }
.meet-private-people label:hover { background: rgba(255, 255, 255, 0.04); }
.meet-private-people label.on { background: rgba(216, 167, 125, 0.12); }
.meet-private-people input { flex: none; width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--gold); }
.meet-private-people label > span { display: flex; flex-direction: column; min-width: 0; }
.meet-private-people .small { margin: 0; font-size: 0.78rem; }
html.in-meet, html.in-meet body { overflow: hidden; }
.meet-call { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; background: #061a19; color: var(--text);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.meet-call[hidden] { display: none; }
.meet-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.6rem 1rem; min-height: 44px; }
.meet-title { margin: 0; display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; }
.meet-title b { font-family: var(--font-display); color: var(--gold-hi); }
.meet-note { margin: 0; font-size: 0.85rem; color: var(--gold); text-align: right; }
.meet-body { flex: 1; min-height: 0; display: flex; gap: 0.6rem; padding: 0 0.6rem; }
.meet-stage { flex: 1; min-width: 0; display: grid; gap: 0.5rem; align-content: center; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); overflow-y: auto; }
.meet-stage[data-n="1"] { grid-template-columns: minmax(0, 900px); justify-content: center; }
.meet-stage[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.meet-stage.has-screen { display: flex; flex-direction: column; align-content: stretch; }
.meet-main { flex: 1; min-height: 0; display: flex; gap: 0.5rem; }
.meet-main .meet-tile { flex: 1; aspect-ratio: auto; }
.meet-strip { display: flex; gap: 0.5rem; overflow-x: auto; flex: none; padding-bottom: 0.2rem; }
.meet-strip .meet-tile { flex: 0 0 160px; }
.meet-tile { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #0d302e; border: 2px solid transparent; transition: border-color 0.15s; }
.meet-tile.speaking { border-color: var(--ok); }
.meet-tile.hand { border-color: var(--gold); }
.meet-tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.meet-tile.screen video { object-fit: contain; }
.meet-tile video.mirror { transform: scaleX(-1); }
.meet-face { width: 100%; height: 100%; display: grid; place-items: center; }
.meet-avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-size: 1.4rem; color: var(--ink); background: var(--metal); }
.meet-strip .meet-avatar { width: 40px; height: 40px; font-size: 0.95rem; }
.meet-name { position: absolute; left: 0.4rem; bottom: 0.4rem; max-width: calc(100% - 0.8rem); margin: 0; padding: 0.15rem 0.5rem; border-radius: 8px; background: rgba(4, 18, 17, 0.72);
  font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 0.3rem; }
.meet-muted { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--danger); } /* (a red dot: muted) */
.meet-side { width: 320px; flex: none; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.meet-side[hidden] { display: none; }
.meet-side-head { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); }
.meet-x { background: none; border: 0; color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0 0.3rem; }
.meet-people { flex: 1; overflow-y: auto; padding: 0.4rem 0.6rem; }
.meet-people[hidden] { display: none; }
.meet-person { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0; border-bottom: 1px solid rgba(36, 80, 75, 0.5); }
.meet-person .avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; line-height: 1; overflow: hidden; }
.meet-person-main { flex: 1; min-width: 0; }
.meet-person-main p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meet-actions { display: flex; flex-wrap: wrap; gap: 0.2rem 0.6rem; justify-content: flex-end; max-width: 45%; }
.mini-link { background: none; border: 0; padding: 0.15rem 0; color: var(--gold); font: inherit; font-size: 0.78rem; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.mini-link.danger { color: var(--danger); }
.meet-rules { margin: 0.3rem 0 0.7rem; padding: 0.75rem 0.8rem 0.6rem; border: 1px solid rgba(216, 167, 125, 0.35); border-radius: 14px;
  background: radial-gradient(circle at 100% 0%, rgba(216, 167, 125, 0.12), transparent 60%), var(--panel-2); box-shadow: inset 0 1px 0 rgba(246, 220, 194, 0.08); }
.meet-rules-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.35rem; padding-bottom: 0.4rem; border-bottom: 1px solid rgba(216, 167, 125, 0.2); }
.meet-rules-head h3 { margin: 0; font-family: var(--font-display); font-size: 0.95rem; letter-spacing: 0.08em; background: var(--metal); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
.meet-rules-head span { white-space: nowrap; font-family: var(--font-label); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.meet-rule { display: flex; align-items: center; gap: 0.6rem; margin: 0; padding: 0.42rem 0; font-size: 0.9rem; letter-spacing: 0; text-transform: none; color: var(--text); cursor: pointer; }
.meet-rule + .meet-rule { border-top: 1px solid rgba(36, 80, 75, 0.6); }
.meet-rule-ic { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); background: var(--black); transition: color 0.2s, border-color 0.2s, background 0.2s; }
.meet-rule-ic svg { width: 16px; height: 16px; }
.meet-rule.on .meet-rule-ic { color: var(--gold-hi); border-color: var(--gold); background: var(--gold-soft); }
.meet-rule-name { flex: 1; min-width: 0; }
.meet-rule-state { font-family: var(--font-label); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.meet-rule.on .meet-rule-state { color: var(--gold); }
.meet-switch { -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 42px; height: 24px; margin: 0; border-radius: 999px; cursor: pointer;
  background: var(--black); border: 1px solid var(--line); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5); transition: background 0.2s, border-color 0.2s; }
.meet-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #5f7a75; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); transition: transform 0.2s ease, background 0.2s; }
.meet-switch:checked { background: linear-gradient(180deg, #2a5a55, #1c4a46); border-color: var(--gold); }
.meet-switch:checked::after { transform: translateX(18px); background: var(--metal); box-shadow: 0 0 8px rgba(216, 167, 125, 0.55), 0 1px 2px rgba(0, 0, 0, 0.5); }
.meet-switch:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.meet-rules-foot { margin: 0.35rem 0 0; font-size: 0.72rem; line-height: 1.4; color: var(--muted); }
.meet-end { display: block; width: 100%; margin-top: 0.7rem; }
@media (prefers-reduced-motion: reduce) { .meet-switch, .meet-switch::after, .meet-rule-ic { transition: none; } }
.meet-btn.locked { opacity: 0.6; }
.meet-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.meet-chat[hidden] { display: none; }
/* The chat, in WESMUN colours: rose-gold bubbles for your own messages, teal ones for everyone else */
.meet-side { border-color: rgba(216, 167, 125, 0.3); background: radial-gradient(circle at 100% 0%, rgba(216, 167, 125, 0.1), transparent 55%), var(--panel); }
.meet-side-head { border-bottom-color: rgba(216, 167, 125, 0.22); }
.meet-side-head b { font-family: var(--font-display); letter-spacing: 0.08em; background: var(--metal); -webkit-background-clip: text; background-clip: text; color: transparent; }
.meet-chat-log { flex: 1; overflow-y: auto; padding: 0.7rem 0.8rem; display: flex; flex-direction: column; }
.meet-chat-log:empty::before { content: "No messages yet. Say hello to everyone in the call."; margin: auto; padding: 1rem; text-align: center; color: var(--muted); font-size: 0.85rem; }
.meet-msg { display: flex; align-items: flex-start; gap: 0.45rem; max-width: 88%; margin-top: 0.55rem; }
.meet-msg:first-child { margin-top: 0; }
.meet-msg.cont { margin-top: 0.18rem; }
.meet-msg.cont:not(.mine) { padding-left: calc(28px + 0.45rem); }
.meet-msg.mine { align-self: flex-end; }
.meet-msg-av { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; overflow: hidden; object-fit: cover;
  font-size: 0.68rem; line-height: 1; border: 1px solid rgba(216, 167, 125, 0.5); background: var(--panel-2); color: var(--gold-hi); }
.meet-msg-body { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.meet-msg.mine .meet-msg-body { align-items: flex-end; }
.meet-msg-meta { margin: 0 0 0.2rem; display: flex; align-items: baseline; gap: 0.4rem; font-size: 0.72rem; }
.meet-msg-meta b { font-family: var(--font-label); font-weight: 600; letter-spacing: 0.06em; color: var(--gold-hi); }
.meet-msg-meta span { color: var(--muted); }
.meet-bubble { margin: 0; padding: 0.45rem 0.75rem; border-radius: 4px 14px 14px 14px; background: var(--panel-2); border: 1px solid rgba(216, 167, 125, 0.18);
  font-size: 0.92rem; line-height: 1.4; overflow-wrap: anywhere; }
.meet-msg.mine .meet-bubble { border-radius: 14px 4px 14px 14px; background: linear-gradient(160deg, #ecc8a4, #c8956b 60%, #b98157); color: #0b2b29; border-color: transparent;
  box-shadow: 0 6px 16px -10px rgba(216, 167, 125, 0.8); }
.meet-msg.cont .meet-bubble { border-radius: 14px; }
.meet-chat-form { display: flex; gap: 0.4rem; padding: 0.6rem; border-top: 1px solid rgba(216, 167, 125, 0.22); background: rgba(6, 26, 25, 0.35); }
.meet-chat-form input { flex: 1; min-width: 0; border-radius: 999px; padding: 0.5rem 0.9rem; background: #0b2b29; border: 1px solid rgba(216, 167, 125, 0.3); }
.meet-chat-form input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216, 167, 125, 0.18); }
.meet-chat-form .btn { border-radius: 999px; }
.meet-bar { display: flex; justify-content: center; gap: 0.4rem; padding: 0.6rem 0.5rem 0.7rem; flex-wrap: wrap; }
.meet-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.2rem; min-width: 62px; padding: 0.45rem 0.5rem; border-radius: 12px;
  background: #0f3634; border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 0.7rem; cursor: pointer; }
.meet-btn[hidden] { display: none; }
.meet-btn .mi svg { width: 22px; height: 22px; display: block; }
.meet-btn.on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-hi); }
.meet-btn.leave { background: #7a2d33; border-color: #a2434b; }
.meet-btn:disabled { opacity: 0.45; cursor: default; }
.meet-dot { position: absolute; top: 6px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.meet-dot[hidden] { display: none; }
@media (max-width: 760px) {
  .meet-stage { grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
  .meet-stage[data-n="1"] { grid-template-columns: 1fr; align-content: center; }
  .meet-stage[data-n="2"] { grid-template-columns: 1fr; }
  .meet-tile { aspect-ratio: 4 / 3; }
  .meet-strip .meet-tile { flex-basis: 110px; }
  .meet-body { position: relative; }
  .meet-side { position: absolute; left: 0; right: 0; bottom: 0; top: 30%; width: auto; z-index: 2; border-radius: 16px 16px 0 0; }
  .meet-btn { min-width: 0; flex: 1; padding: 0.4rem 0.2rem; font-size: 0.62rem; }
  .meet-bar { flex-wrap: nowrap; gap: 0.25rem; }
  .meet-top { position: relative; }
  .meet-note:empty { display: none; }
  .meet-note { position: absolute; left: 1rem; right: 1rem; top: 100%; z-index: 3; text-align: center; background: rgba(4, 18, 17, 0.88); padding: 0.4rem; border-radius: 8px; }
}
.meet-meter { height: 10px; border-radius: 6px; background: var(--card); border: 1px solid var(--line); overflow: hidden; margin: 0.4rem 0 0.6rem; }
.meet-meter span { display: block; height: 100%; width: 0; background: var(--ok); }
.meet-meter span.warn { background: var(--danger); }

/* ---------- The tab bar, floating (like Instagram): a see-through glass pill lifted off the bottom of the screen,
   icons only, with a soft pill behind the tab you are on. The pages run on underneath it, so you see them through
   the glass. Each page leaves room at its bottom (--tabs-space, from the frame), and while a page shows a
   full-screen pop-up (the NFC scanner, an emergency alert, a sheet) the bar steps aside (see shell.js). ---------- */
:root { --tabs-lift: max(14px, calc(env(safe-area-inset-bottom) - 2px)); }
.app-tabs {
  left: 14px; right: 14px; bottom: var(--tabs-lift);
  grid-template-columns: repeat(5, 1fr); align-items: center; gap: 2px;
  height: 58px; padding: 5px; border-radius: 999px;
  background: rgba(10, 40, 38, 0.5); border: 1px solid rgba(255, 241, 227, 0.12); border-top-color: rgba(255, 241, 227, 0.2);
  box-shadow: 0 16px 34px -12px rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6);
  transition: opacity 0.22s ease, transform 0.26s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.app-tab { height: 100%; justify-content: center; padding: 0; border-radius: 999px; color: rgba(236, 228, 214, 0.78); transition: background-color 0.2s ease, color 0.2s ease; }
.app-tab .ic { width: 26px; height: 26px; }
/* (the names stay for screen readers, but are not shown, like Instagram) */
.app-tab .tab-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.app-tab[aria-current="page"] { background: rgba(216, 167, 125, 0.2); color: var(--gold); }
.app-tab[aria-current="page"]::before { display: none; }
.app-tab[aria-current="page"] .ic svg { stroke-width: 2; }
.tab-dot { top: 9px; left: calc(50% + 7px); box-shadow: none; }
/* pages outside the frame, with a bar of their own */
html.app body { padding-bottom: calc(58px + var(--tabs-lift) + 16px); }
html.app .offline-note { bottom: calc(58px + var(--tabs-lift) + 10px); }
/* In the app's frame the bar floats over the pages, which reach right down to the bottom of the screen */
html.shell .app-tabs { position: fixed; }
html.shell body.popup .app-tabs { opacity: 0; transform: translateY(24px); pointer-events: none; }
html.shell, html.shell body, html.ios-app.shell, html.ios-app.shell body { background-color: #0a2826; }
html.app.framed body { padding-bottom: calc(var(--tabs-space, 90px) + 0.8rem); }
html.app.framed .offline-note { bottom: calc(var(--tabs-space, 90px) + 0.5rem); }
html.app.framed .editor-bar { bottom: var(--tabs-space, 90px); }
/* A thinner scrollbar in the app */
html.app ::-webkit-scrollbar { width: 4px; height: 4px; }
html.app ::-webkit-scrollbar-track { background: transparent; }
html.app ::-webkit-scrollbar-thumb { background: rgba(216, 167, 125, 0.5); border: 0; border-radius: 4px; }
html.app { scrollbar-width: thin; scrollbar-color: rgba(216, 167, 125, 0.5) transparent; }

/* ---------- Less empty space at the top of the app's pages ---------- */
html.app main { padding-top: calc(0.2rem + env(safe-area-inset-top)); }
html.ios-app.app main { padding-top: calc(0.2rem + var(--top)); }
html.app .page-head { padding-top: 0.4rem; padding-bottom: 0.5rem; }
html.app .ah-top { padding-top: 0.5rem; }
html.app.has-app-bar main { padding-top: 3.5rem; }
html.ios-app.app.has-app-bar main { padding-top: calc(3.5rem + var(--top)); }
html.app.has-app-bar .page-head { padding-top: 0.1rem; }

/* ---------- Smoother switching ----------
   The pill behind the tab you are on glides to the next tab with a little spring; the tapped icon pops. */
.app-tabs .tab-pill { position: absolute; top: 5px; bottom: 5px; left: 0; width: 0; border-radius: 999px; pointer-events: none;
  background: rgba(216, 167, 125, 0.2); box-shadow: inset 0 1px 0 rgba(255, 241, 227, 0.08); }
.app-tabs.pill-ready .tab-pill { transition: transform 0.42s cubic-bezier(0.34, 1.32, 0.5, 1), width 0.3s ease; }
.app-tabs.has-pill .app-tab[aria-current="page"] { background: none; }
.app-tabs.pill-ready .app-tab[aria-current="page"] .ic { animation: tab-pop 0.36s cubic-bezier(0.34, 1.5, 0.5, 1); }
.app-tab:active .ic { transform: scale(0.86); transition-duration: 0.08s; }
@keyframes tab-pop { 0% { transform: scale(0.82); } 100% { transform: none; } }
#views .view.slide-in, #views .view.tab-in, #views .view.leaving, #views .view.fade-away { will-change: opacity, transform; }
@media (prefers-reduced-motion: reduce) { .app-tabs.pill-ready .tab-pill { transition: none; } .app-tabs.pill-ready .app-tab[aria-current="page"] .ic { animation: none; } }

/* In the app, Team, About, Support... open as pages of their own: only that section of the home page shows */
html.solo main > :not(.solo-keep) { display: none !important; }
html.solo main > .solo-keep { margin-top: 0; }

/* ---------- iPad (and other big screens) in the app: use the room ---------- */
/* (Phones, and the iPad mini held upright, keep the phone layout. The website has its own layout.) */
@media (min-width: 900px) {
  /* the tab bar: a pill in the middle, not stretched from edge to edge */
  html.app .app-tabs { left: 0; right: 0; margin-inline: auto; width: min(560px, 100% - 28px); }
  /* pages: wider */
  html.app body > main.wrap, html.app body > main:not(.wrap) .wrap { width: min(1040px, 100% - 4rem); }
  /* Home: the countdown (or what is on now) on the left, your place and up next stacked on the right */
  html.app main.app-home { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); column-gap: 0.8rem; align-items: start; align-content: start; }
  html.app main.app-home > * { grid-column: 1 / -1; min-width: 0; }
  html.app main.app-home > .ah-now { grid-column: 1; align-self: stretch; margin-bottom: 0.8rem; }
  html.app main.app-home > .ah-pair { grid-column: 2; align-self: stretch; display: flex; flex-direction: column; gap: 0.8rem; margin-bottom: 0.8rem; }
  html.app main.app-home > .ah-pair .ah-card { flex: 1; margin-bottom: 0; }
  html.app .ah-quick { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  /* More: more tiles in a row */
  html.app .am-tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  /* Map: the map gets the room, the room details beside it */
  html.app .map-layout { grid-template-columns: minmax(0, 1fr) 300px; }
}

/* A rose gold section on its own in the app (About, Support): the whole page is gold, top to bottom, so no teal
   shows above it, below it, behind the tab bar or behind the clock (common.js sets --solo-top as you scroll) */
html.app.framed.solo.solo-light { background: #e2b58c; }
html.app.framed.solo.solo-light body { background: linear-gradient(180deg, #f3d8bd 0%, #e2b58c 55%, #cf9a6e 100%); min-height: 100vh; }
html.solo.solo-light main > .solo-keep { background: none; border-block: 0; }
html.ios-app.app.solo.solo-light:not(.shell) body::after { background: var(--solo-top, #f3d8bd); }

/* Team card rows that scroll sideways cut off whatever spills out of them: the cards' soft shadow (34px below a
   card) was cut 12px under the cards in a hard line, so the strip behind the cards looked a different colour from
   the page below. Room for the whole shadow, then the same space taken back, so nothing else moves. */
.section .people-row { padding-bottom: 40px; margin-bottom: -16px; } /* (taking back only 16px leaves a clear gap before the next team's heading) */
/* Website on PC: those rows wrap instead of scrolling, so nothing is cut off and the padding above is already
   replaced; the taken-back 28px only pulled each row over the next (Secretariat rows overlapped, team headings
   touched the cards above). Plain spacing there, a little more between teams. */
@media (min-width: 761px) {
  html:not(.app) .section .people-row { margin-bottom: 0; }
  html:not(.app) .section .people-row + .people-row { margin-top: 1.4rem; }
  html:not(.app) #directors { row-gap: 2.6rem; }
  html:not(.app) #directors-section > #cos-section { margin-bottom: 2.6rem; }
}

/* Check-in on a device that reads NFC cards itself (the app, Chrome on Android): no box for a plugged-in reader,
   "Tap cards (NFC)" is the big gold button, Sound sits under it */
.scan-panel.nfc-ready .scan-row, .scan-panel.nfc-ready .hint { display: none; }
.scan-panel.nfc-ready #code-label { margin-bottom: 0; }
.scan-panel.nfc-ready .btn-row { flex-wrap: wrap; margin-top: 0.8rem; }
.scan-panel.nfc-ready #nfc-btn { flex: 1 1 100%; padding-block: 1rem; font-size: 1rem; }
.scan-panel.nfc-ready #nfc-btn:disabled { background: none; box-shadow: none; }
.scan-panel.nfc-ready #sound-btn { flex: 1 1 100%; }

/* Home page: "Does WESMUN have an app?" under About */
.about-app-q { margin: 1.8rem 0 0.4rem; font-size: 1.25rem; }
.about-app-a a { white-space: nowrap; }

/* Admin: activity log filters (search, who, when, and kind chips) */
.log-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.6rem 0 0.2rem; }
.log-filters input { flex: 1 1 14rem; min-width: 0; }
.log-filters select { flex: 0 1 11rem; min-width: 0; }
.chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.chip .chip-n { opacity: 0.7; margin-left: 0.3rem; font-size: 0.75rem; }
.log li .log-kind { display: inline-block; margin-right: 0.5rem; font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--gold); }
