/* Yale identity colors (decision: whole app in Yale colors) */
:root {
  /* The program's own colors (decision #80). A program can override these three. */
  --brand: #00356b;
  --brand-2: #978d85;
  --brand-accent: #286dc0;
  --yale-blue: var(--brand);     /* headings and text in the main color */
  --yale-gray: var(--brand-2);
  --accent: var(--brand-accent); /* links */
  --on-brand: #ffffff;           /* text on the main color */
  --surface: #ffffff;            /* panels, cards, inputs */
  --bar-edge: #002a55;
  --ok: #24572a;
  --ok-wash: #e6efe6;
  --other-ink: #bbbbbb;
  --other-bg: #fbfaf9;
  --late: #4b3b8f;
  color-scheme: light;
  --white: #ffffff;
  --black: #000000;
  --ink: #1b1b1b;
  --muted: #6b635d;          /* Yale gray, darkened for readable text */
  --line: #ddd8d3;           /* Yale gray, tinted */
  --wash: #f6f4f2;           /* Yale gray, lightest tint */
  --blue-wash: #e8eef6;      /* Yale blue, lightest tint */
  --warn: #8a5a00;
  --warn-wash: #fbf3e2;
  --placeholder: #a39d97;     /* sample text in a box: lighter than --muted (Prompt 263) */
  --error: #9b1c1c;
  --error-wash: #fbeaea;
  --serif: "EB Garamond", "Garamond", "Georgia", serif;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.45;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--yale-blue); font-weight: 600; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
.eyebrow {
  font-size: .78rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--yale-blue); font-weight: 700; margin: 1.4em 0 .5em;
}
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Top bar */
.topbar { background: var(--brand); color: var(--on-brand); padding-top: env(safe-area-inset-top); }
.topbar .inner { display: block; max-width: 1100px; margin: 0 auto; padding: 12px 16px 0; }
.brand {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px;
  color: var(--on-brand); font-size: 1.35rem; font-weight: 600; letter-spacing: .01em;
}
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 16px; flex-wrap: wrap; flex: 1; }
.nav a { color: #d6e2f0; font-size: 1rem; }
.nav a.on, .nav a:hover { color: var(--on-brand); text-decoration: none; border-bottom: 2px solid var(--on-brand); }
main {
  max-width: 1100px; margin: 0 auto;
  padding: 22px max(16px, env(safe-area-inset-right)) 60px max(16px, env(safe-area-inset-left));
}

/* Panels and grids */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px;
}
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.two { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } h1 { font-size: 1.6rem; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }

/* Buttons and forms */
.btn {
  display: inline-block; background: var(--brand); color: var(--on-brand); border: 1px solid var(--brand);
  border-radius: 8px; padding: 8px 16px; font: inherit; font-size: 1rem; cursor: pointer;
}
.btn:hover { background: var(--bar-edge); text-decoration: none; }
.btn.ghost { background: var(--surface); color: var(--yale-blue); }
.btn.ghost:hover { background: var(--blue-wash); }
.btn.accent { background: var(--accent); border-color: var(--accent); }
.btn.danger { background: var(--surface); color: var(--error); border-color: #e3b8b8; }
.btn.small { padding: 4px 10px; font-size: .9rem; }
label { display: block; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--yale-blue); font-weight: 700; margin: 14px 0 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 1rem; padding: 8px 11px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.checks { display: flex; gap: 10px; flex-wrap: wrap; }
.check {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 14px; background: var(--surface); font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--ink); font-weight: 400; margin: 0;
}
.hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }

/* Flash messages */
.flash { border-radius: 8px; padding: 9px 14px; margin-bottom: 12px; background: var(--blue-wash); color: var(--yale-blue); }
.flash.warn { background: var(--warn-wash); color: var(--warn); }
.flash.error { background: var(--error-wash); color: var(--error); }

/* Chips and badges */
.chip { display: inline-block; background: var(--wash); border: 1px solid var(--line); border-radius: 99px; padding: 1px 10px; font-size: .85rem; margin: 2px 4px 2px 0; }
.badge { display: inline-block; border-radius: 99px; padding: 1px 10px; font-size: .82rem; }
.badge.blue { background: var(--blue-wash); color: var(--yale-blue); }
.badge.met { background: var(--ok-wash); color: var(--ok); }
.badge.new { background: var(--brand); color: var(--on-brand); }
.badge.gray { background: var(--wash); color: var(--muted); border: 1px solid var(--line); }

/* Cards (people) */
.card { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; color: var(--ink); }
.card:hover { border-color: var(--accent); text-decoration: none; }
.avatar {
  flex: none; width: 56px; height: 56px; border-radius: 10px; background: var(--brand); color: var(--on-brand);
  display: flex; align-items: center; justify-content: center; font-size: 1.25rem; font-weight: 600; object-fit: cover;
}
.avatar.lg { width: 132px; height: 160px; font-size: 2.6rem; border-radius: 12px; }
.card .name { font-weight: 600; color: var(--yale-blue); font-size: 1.08rem; }
.card .sub { font-size: .9rem; color: var(--muted); }
.locked { border: 1px dashed var(--yale-gray); border-radius: var(--radius); padding: 14px 16px; color: var(--muted); background: var(--wash); }
.locked + .panel, .locked + .eyebrow { margin-top: 16px; }

/* Calendar */
.cal { width: 100%; border-collapse: collapse; table-layout: fixed; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.cal th { background: var(--brand); color: var(--on-brand); font-weight: 600; padding: 6px; font-size: .9rem; }
.cal td { border: 1px solid var(--line); vertical-align: top; height: 92px; padding: 4px 6px; }
.cal td a.daylink { display: block; height: 100%; color: var(--ink); }
.cal td a.daylink:hover { text-decoration: none; }
.cal td:hover { background: var(--blue-wash); }
.cal .num { font-size: .95rem; }
.cal .other { color: var(--other-ink); background: var(--other-bg); }
.cal .session { background: var(--blue-wash); }
.cal .session .num { color: var(--yale-blue); font-weight: 700; }
.cal .today .num { background: var(--accent); color: #fff; border-radius: 99px; padding: 0 7px; }
.cal .tag { display: block; font-size: .7rem; color: var(--yale-blue); text-transform: uppercase; letter-spacing: .08em; }
@media (max-width: 640px) { .cal td { height: 64px; } .cal .tag { display: none; } }

/* Dinner picker */
.pick { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface); cursor: pointer; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink); margin: 0; font-size: 1rem; }
.pick:has(input:checked) { border-color: var(--yale-blue); background: var(--blue-wash); }
.pick input { width: 18px; height: 18px; accent-color: var(--yale-blue); }
.count { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 10px 0; margin-top: 12px; }

/* Stats */
.stat { font-size: 2.4rem; color: var(--yale-blue); font-weight: 600; line-height: 1; }
.bar { height: 10px; background: var(--wash); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar > span { display: block; height: 100%; background: var(--brand); }
table.plain { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.plain th { text-align: left; color: var(--yale-blue); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; border-bottom: 2px solid var(--yale-blue); padding: 6px 4px; }
table.plain td { border-bottom: 1px solid var(--line); padding: 6px 4px; }
table.plain td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Concierge */
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 260px; max-height: 60vh; overflow-y: auto; padding: 4px; }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 12px; white-space: pre-wrap; }
.msg.me { align-self: flex-end; background: var(--brand); color: var(--on-brand); }
.msg.bot { align-self: flex-start; background: var(--wash); border: 1px solid var(--line); }
.msg .cost { display: block; font-size: .72rem; color: var(--muted); margin-top: 6px; }
/* Which agent answered (#107): a small label above the answer */
.msg .agent-label { display: block; width: max-content; font-size: .68rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.msg .agent-note { display: block; font-size: .75rem; font-style: italic; color: var(--muted); margin-bottom: 6px; }

/* Sign-in */
.auth { max-width: 440px; margin: 40px auto; }
.auth .crest { text-align: center; color: var(--yale-blue); font-size: 2.3rem; font-weight: 600; margin-bottom: 4px; }
.auth .tag { text-align: center; color: var(--muted); margin-bottom: 18px; font-style: italic; }

.plan { text-align: center; }
.plan .price { font-size: 2.2rem; color: var(--yale-blue); font-weight: 600; }
.plan.current { border: 2px solid var(--yale-blue); }
.plan ul { text-align: left; padding-left: 20px; }

/* ---------- Installable app and phone layout ---------- */
.brand img { border-radius: 6px; }
.nav svg { display: none; }
.install { display: flex; gap: 14px; align-items: center; }
.install img { flex: none; border-radius: 14px; }
.install p { margin: 2px 0; }
[hidden] { display: none !important; }

@media (max-width: 760px) {
  body { font-size: 18px; }
  .brand { font-size: 1.2rem; gap: 8px; }
  /* Main navigation becomes a bottom tab bar, within thumb reach */
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; gap: 0; flex-wrap: nowrap;
    background: var(--brand); border-top: 1px solid var(--bar-edge);
    padding: 4px max(4px, env(safe-area-inset-left)) calc(4px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-right));
  }
  .nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 0 4px; font-size: .68rem; color: #b9c9dc; border-radius: 8px; min-width: 0;
  }
  .nav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .nav a.on, .nav a:hover { border-bottom: 0; color: var(--on-brand); background: rgba(255, 255, 255, .08); }
  .nav svg { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  main { padding-top: 16px; }
  .panel { padding: 14px 14px; }
  .avatar.lg { width: 96px; height: 116px; font-size: 2rem; }
  .btn { padding: 10px 16px; }
  input, select, textarea { font-size: 16px !important; } /* stops iOS from zooming into fields */
  .msg { max-width: 92%; }
  .chat { max-height: none; min-height: 50vh; }
}

@media (max-width: 760px) { body.signed-in .count { bottom: calc(66px + env(safe-area-inset-bottom)); } }

/* Interest picker on My card */
.picked { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; min-height: 30px; align-items: center; }
button.chip { font: inherit; font-size: .9rem; cursor: pointer; }
.chip.on { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.tree { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--wash); }
.crumbs { margin-bottom: 8px; font-size: .95rem; }
.crumb { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.crumb:disabled { color: var(--yale-blue); font-weight: 600; cursor: default; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  font: inherit; font-size: .95rem; padding: 6px 13px; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--yale-gray); background: var(--surface); color: var(--yale-blue);
}
.choice:hover { border-color: var(--accent); background: var(--blue-wash); }
.choice.on { background: var(--blue-wash); border-color: var(--yale-blue); font-weight: 600; }
.linkedin { display: inline-flex; align-items: center; gap: 6px; }
.linkedin svg { width: 16px; height: 16px; fill: currentColor; }

/* Photo drop zone on My card */
.dropzone { position: relative; display: block; margin: 0; cursor: pointer; border-radius: 14px; outline: 2px dashed transparent; outline-offset: 4px; text-transform: none; letter-spacing: 0; }
.dropzone:hover, .dropzone.over { outline-color: var(--accent); }
.dropzone .dropzone-tip {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
  background: rgba(0, 53, 107, .72); color: #fff; border-radius: 12px; font-size: .9rem; font-weight: 600; line-height: 1.2;
  opacity: 0; transition: opacity .15s;
}
.dropzone:hover .dropzone-tip, .dropzone.over .dropzone-tip { opacity: 1; }
@media (hover: none) { .dropzone .dropzone-tip { opacity: .85; top: auto; height: 34px; border-radius: 0 0 12px 12px; font-size: .75rem; } .dropzone .dropzone-tip br { display: none; } }

/* Password checklist on sign-up */
.rules { list-style: none; padding: 0; margin: 8px 0 0; font-size: .88rem; color: var(--muted); }
.rules li::before { content: "○ "; }
.rules li.pass { color: var(--ok); }
.rules li.pass::before { content: "✓ "; }
.rules.show-fail li:not(.pass) { color: var(--error); }

/* Card popup overlay */
.card-dialog {
  width: min(860px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 18px 20px 8px;
  border: 0; border-radius: 16px; background: var(--wash); color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 25, 50, .35); overflow-y: auto; overscroll-behavior: contain;
}
.card-dialog::backdrop { background: rgba(0, 30, 60, .55); backdrop-filter: blur(2px); }
.card-dialog[open] { animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.dialog-close {
  position: sticky; top: 0; float: right; z-index: 2; margin: -6px -8px 0 8px;
  width: 38px; height: 38px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--surface); color: var(--yale-blue); font-size: 1.05rem; cursor: pointer;
}
.dialog-close:hover { background: var(--blue-wash); }
.saved-note { color: var(--ok); }
body:has(.card-dialog[open]) { overflow: hidden; }
@media (max-width: 760px) {
  /* On phones the popup becomes a full-height sheet that slides up */
  .card-dialog {
    width: 100vw; max-width: 100vw; height: calc(100dvh - 24px); max-height: none; margin: 24px 0 0;
    border-radius: 18px 18px 0 0; padding: 14px 14px calc(16px + env(safe-area-inset-bottom));
  }
  .card-dialog[open] { animation: sheet .2s ease-out; }
  @keyframes sheet { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
}

.contact-btns { margin-top: 10px; gap: 8px; }

/* Class schedule on the calendar (decision #77) */
.badge.warn { background: var(--warn-wash); color: var(--warn); border: 1px solid #ecd6a8; }
.cal .ev { display: block; margin-top: 3px; font-size: .72rem; line-height: 1.25; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .ev.class { color: var(--muted); }
.cal .ev.late_class { color: var(--late); }
.cal .ev.event { color: var(--warn); font-weight: 600; }
.ev.block { color: var(--error) !important; font-weight: 600; }
@media (max-width: 640px) { .cal .ev { font-size: .6rem; } }
.event-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.event-row:last-of-type { border-bottom: 0; }
.admin-add summary { cursor: pointer; }
.admin-add[open] summary { margin-bottom: 8px; }

/* Drag-and-drop box for every document upload (decision #78) */
.filedrop { position: relative; display: flex; align-items: center; gap: 14px; margin: 8px 0; padding: 18px 20px; border: 2px dashed var(--line); border-radius: 12px; background: var(--wash); cursor: pointer; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink); transition: border-color .15s, background .15s; }
.filedrop:hover, .filedrop.over { border-color: var(--accent); background: var(--blue-wash); }
.filedrop.has-file { border-style: solid; border-color: var(--yale-blue); }
.filedrop input[type=file] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.filedrop-icon { font-size: 1.6rem; color: var(--yale-blue); }
.filedrop-name { margin-left: auto; color: var(--yale-blue); font-weight: 600; }


/* Dark mode (decision #81): follows the device unless the person picks Light or Dark.
   The program's main color stays on bars and buttons; text tints are mixed from it so they read on dark. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --yale-blue: color-mix(in srgb, var(--brand) 28%, #eef2f7);
  --accent: color-mix(in srgb, var(--brand-accent) 40%, #ffffff);
  --yale-gray: color-mix(in srgb, var(--brand-2) 70%, #ffffff);
  --ink: #e9e5e0;
  --muted: #aaa39c;
  --surface: #1c2027;
  --wash: #121418;
  --line: #343a44;
  --blue-wash: color-mix(in srgb, var(--brand) 30%, #161a20);
  --warn: #f0c46b;
  --warn-wash: #352a12;
  --placeholder: #6f6963;
  --error: #ff9c9c;
  --error-wash: #3b1d1d;
  --ok: #9fd5a5;
  --ok-wash: #1d3121;
  --other-ink: #5b616a;
  --other-bg: #16191e;
  --late: #c7b9ff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --yale-blue: color-mix(in srgb, var(--brand) 28%, #eef2f7);
    --accent: color-mix(in srgb, var(--brand-accent) 40%, #ffffff);
    --yale-gray: color-mix(in srgb, var(--brand-2) 70%, #ffffff);
    --ink: #e9e5e0;
    --muted: #aaa39c;
    --surface: #1c2027;
    --wash: #121418;
    --line: #343a44;
    --blue-wash: color-mix(in srgb, var(--brand) 30%, #161a20);
    --warn: #f0c46b;
    --warn-wash: #352a12;
  --placeholder: #6f6963;
    --error: #ff9c9c;
    --error-wash: #3b1d1d;
    --ok: #9fd5a5;
    --ok-wash: #1d3121;
    --other-ink: #5b616a;
    --other-bg: #16191e;
    --late: #c7b9ff;
  }
}
.brand-logo { height: 30px; width: auto; max-width: 150px; object-fit: contain; border-radius: 4px; background: #fff; padding: 2px; }

/* Program look picker (decision #80) */
.look fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.look fieldset:disabled { opacity: .55; }
.color-pick { position: relative; max-width: 380px; margin: 8px 0 12px; }
.color-pick > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 8px 36px 8px 10px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); cursor: pointer; position: relative; }
.color-pick > summary::-webkit-details-marker { display: none; }
.color-pick > summary::after { content: "▾"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.color-pick .chips { display: flex; flex: none; }
.color-pick .chips i { width: 20px; height: 24px; display: block; }
.color-pick .chips i:first-child { border-radius: 6px 0 0 6px; width: 26px; }
.color-pick .chips i:last-child { border-radius: 0 6px 6px 0; }
.color-pick .chips i.rainbow { width: 66px; border-radius: 6px; background: conic-gradient(#a51c30, #e87722, #c9a227, #2a6e3f, #003da5, #4e2a84, #a51c30); }
.swatches { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); display: flex; flex-direction: column; gap: 0;
  max-height: 60vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18); padding: 4px; }
.swatch { display: flex; align-items: center; gap: 10px; margin: 0; padding: 7px 10px; border-radius: 8px; cursor: pointer; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink); font-size: .95rem; }
.swatch:hover { background: var(--blue-wash, rgba(0,0,0,.05)); }
.swatch:has(input:checked) { font-weight: 600; background: var(--blue-wash, rgba(0,0,0,.05)); }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .three { grid-template-columns: 1fr; } }
.hex { gap: 6px; flex-wrap: nowrap; }
.hex input[type=color] { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); flex: none; cursor: pointer; }
.hex input[type=text] { font-family: ui-monospace, Menlo, monospace; text-transform: uppercase; }
.brand-preview { display: flex; align-items: center; gap: 12px; margin: 6px 0; }
.brand-preview img { max-height: 64px; max-width: 160px; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.fun-photo { margin: 0 0 16px; overflow: hidden; padding: 0; }
.fun-photo img { display: block; width: 100%; max-height: 220px; object-fit: cover; }
/* the framed Home page image (#124): the banner is as tall as its crop needs */
.fun-photo.framed img { max-height: 75vh; height: auto; }
.framed-views { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; }
.framed-views figure { margin: 0; flex: 3 1 260px; }
.framed-views figure.phone { flex: 1 1 120px; max-width: 180px; }
.framed-views img { display: block; width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.framed-views figcaption { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.framed-views p { flex-basis: 100%; margin: 0; }
.fun-photo figcaption { padding: 10px 16px; font-style: italic; color: var(--muted); }

/* Undo and schedule review (decisions #83, #84) */
.undo-flash { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom)); width: min(640px, calc(100% - 24px));
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 10px 12px 10px 16px;
  background: var(--brand); color: var(--on-brand); box-shadow: 0 6px 24px rgba(0, 0, 0, .28); border-radius: 10px; }
.undo-flash .btn.ghost { background: var(--on-brand); color: var(--brand); border-color: var(--on-brand); white-space: nowrap; }
.undo-flash .x { background: none; border: 0; color: var(--on-brand); font-size: 1.1rem; cursor: pointer; padding: 0 4px; opacity: .8; }
@media (max-width: 640px) { .signed-in .undo-flash { bottom: calc(76px + env(safe-area-inset-bottom)); } }
.undo-flash .btn { padding: 3px 12px; }
.flash.leaving { opacity: 0; transition: opacity .4s; }
table.review { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.review th { text-align: left; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--yale-blue); border-bottom: 2px solid var(--line); padding: 6px 8px; position: sticky; top: 0; background: var(--surface); }
table.review td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.review tr.off td { opacity: .45; text-decoration: line-through; }
table.review tr.past td:nth-child(2)::after { content: " · past"; color: var(--muted); font-size: .8rem; }

/* Admin sections that fold up (decision #87) */
details.admin-section > summary.eyebrow {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 4px 0; border-radius: 6px; user-select: none;
}
details.admin-section > summary.eyebrow::-webkit-details-marker { display: none; }
details.admin-section > summary.eyebrow::before {
  content: "▸"; display: inline-block; transition: transform .15s; font-size: .95rem; line-height: 1;
}
details.admin-section[open] > summary.eyebrow::before { transform: rotate(90deg); }
details.admin-section > summary.eyebrow:hover { text-decoration: underline; }
details.admin-section > summary.eyebrow:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
details.admin-section:not([open]) > summary.eyebrow { margin-bottom: .2em; }
details.admin-section:not([open]) > summary.eyebrow::after { content: "Show"; margin-left: auto; font-weight: 600; letter-spacing: .04em; text-transform: none; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { details.admin-section > summary.eyebrow::before { transition: none; } }

/* Edit forms that open inside a list row (#85, #86) */
.item { border-bottom: 1px solid var(--line); }
.item .event-row { border-bottom: 0; }
.item:last-of-type { border-bottom: 0; }
.item-edit { background: var(--wash); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0 0 10px; }
.item-edit label { margin-top: 4px; }

/* Faculty and program staff (decision #91) */
.badge.staff { background: color-mix(in srgb, var(--brand-2) 22%, var(--surface)); color: var(--yale-blue); border: 1px solid color-mix(in srgb, var(--brand-2) 55%, transparent); }
fieldset.affiliation { border: 1px solid var(--line); border-radius: 10px; padding: 6px 14px 10px; margin: 14px 0 4px; }
fieldset.affiliation legend { font-weight: 600; padding: 0 6px; }
fieldset.affiliation .check { display: flex; margin: 4px 0; }
fieldset.affiliation .affiliation-roles { gap: 8px; flex-wrap: wrap; }
fieldset.affiliation .affiliation-roles .check { flex: 1 1 160px; }
fieldset.affiliation .open-to-dinners[hidden] { display: none; }
.admin-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.admin-row:last-of-type { border-bottom: 0; }

/* ---------- Header (decision #93): title and program, light/dark switch, + Dinner, menu,
   "still to meet" boxes and wide tabs ---------- */
.bar-top { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 46px; height: 46px; border-radius: 50%; background: #fff; padding: 4px; flex: none; }
.brand .brand-logo { height: 46px; max-width: 160px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.12; min-width: 0; }
.brand-name { font-size: 1.75rem; font-weight: 700; letter-spacing: .01em; }
.brand-sub { font-size: .95rem; opacity: .88; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .right { display: flex; align-items: center; gap: 12px; flex: none; }

/* Light / Auto / Dark (#195): three spots on one track; the white knob slides under the one picked */
.theme-switch { --seg: 26px; position: relative; display: inline-flex; align-items: center; padding: 2px; border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .18); color: var(--on-brand); flex: none; }
.theme-switch .knob { position: absolute; top: 2px; left: 2px; width: var(--seg); height: calc(100% - 4px); border-radius: 99px;
  background: #fff; transition: transform .15s; }
.theme-switch[data-pos="auto"] .knob { transform: translateX(var(--seg)); }
.theme-switch[data-pos="dark"] .knob { transform: translateX(calc(2 * var(--seg))); }
.theme-switch button { position: relative; z-index: 1; width: var(--seg); height: 22px; padding: 0; border: 0; background: none;
  color: inherit; font-size: .9rem; line-height: 1; cursor: pointer; border-radius: 99px; }
.theme-switch button[aria-checked="true"] { color: #1d1d1f; }
.theme-switch button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { .theme-switch .knob { transition: none; } }
.gear summary:focus-visible, .btn.plus:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.theme-switch.floating { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 12px; z-index: 5;
  background: var(--surface); color: var(--yale-blue); border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; }
.theme-switch.floating { border-color: var(--line); background: var(--surface); padding: 2px; }
.theme-switch.floating .knob { background: var(--brand); }
.theme-switch.floating button[aria-checked="true"] { color: var(--on-brand); }
.theme-switch.floating button:focus-visible { outline-color: var(--brand); }

.btn.plus { background: #fff; color: var(--brand); border: 1px solid #fff; font-weight: 700; font-size: 1.05rem; padding: 7px 16px; white-space: nowrap; }
.btn.plus:hover { background: #eef2f7; text-decoration: none; }

.gear { position: relative; }
.gear summary { list-style: none; width: 42px; height: 42px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .45); border-radius: 10px; color: var(--on-brand); }
.gear summary::-webkit-details-marker { display: none; }
.gear summary:hover, .gear[open] summary { background: rgba(255, 255, 255, .12); }
.gear svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.gear .menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 240px; padding: 6px;
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.gear .menu a, .gear .menu-btn { display: block; width: 100%; padding: 9px 12px; border-radius: 8px; text-align: left;
  color: var(--yale-blue); background: none; border: 0; font: inherit; font-size: 1rem; cursor: pointer; }
.gear .menu a:hover, .gear .menu-btn:hover { background: var(--blue-wash); text-decoration: none; }
.gear .menu-btn[role="menuitemcheckbox"]::before { content: "○ "; }
.gear .menu-btn[role="menuitemcheckbox"][aria-checked="true"]::before { content: "● "; }
.gear .menu form { margin: 0; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }

.meet-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
.meet-row > .meet:only-child { grid-column: 1 / -1; }
.meet { color: var(--on-brand); background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 12px; padding: 10px 16px 14px; min-width: 0; }
.meet-label { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meet-num { font-size: 1.05rem; font-weight: 600; }
.meet-num b { font-size: 2.2rem; font-weight: 700; margin-right: 4px; line-height: 1.1; }
.meet-bar { height: 7px; margin-top: 4px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, .22); }
.meet-bar span { display: block; height: 100%; border-radius: 99px; background: #fff; transition: width .2s; }
.meet-pick { display: inline-block; width: auto; max-width: 70%; padding: 1px 24px 1px 8px; font: inherit; font-size: 1rem;
  color: var(--on-brand); background-color: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .45); border-radius: 8px; }
.meet-pick option { color: #111; background: #fff; }

.meet-tail { display: none; }
@media (min-width: 761px) {
  .nav.tabs { display: flex; gap: 6px; margin-top: 12px; }
  .nav.tabs a { flex: 1; text-align: center; padding: 10px 0 12px; font-size: 1.3rem; font-weight: 700;
    color: rgba(255, 255, 255, .86); border: 0; border-radius: 10px 10px 0 0; }
  .nav.tabs a:hover { color: #fff; background: rgba(255, 255, 255, .08); text-decoration: none; border: 0; }
  .nav.tabs a.on { background: var(--wash); color: var(--yale-blue); border: 0; }
}
@media (max-width: 760px) {
  .topbar .inner { padding: 8px 12px 10px; }
  .bar-top { gap: 8px; }
  .brand-mark, .brand .brand-logo { height: 36px; }
  .brand-mark { width: 36px; padding: 3px; }
  .brand .brand-logo { max-width: 80px; }
  .brand-name { font-size: 1.25rem; }
  .meet-suffix, .brand-sub { display: none; }
  .meet-tail { display: inline; font-weight: 400; opacity: .9; }
  .topbar .right { gap: 8px; }
  .theme-switch { --seg: 24px; }
  .btn.plus { font-size: .9rem; padding: 6px 10px; }
  .gear summary { width: 36px; height: 36px; }
  .meet-row { gap: 8px; margin-top: 8px; }
  .meet { padding: 6px 10px 9px; border-radius: 10px; }
  .meet-label { font-size: .74rem; }
  .meet-pick { font-size: .74rem !important; padding: 0 16px 0 4px; max-width: 100%; }
  .meet-num { font-size: .85rem; }
  .meet-num b { font-size: 1.5rem; }
  .meet-bar { height: 5px; }
}

/* Dinners tab, recap and follow-ups (decisions #94, #95) */
.dinner-actions { gap: 10px; align-items: stretch; margin-bottom: 6px; }
.dinner-search { flex: 1; min-width: 220px; margin: 0; }
.dinner-search input { width: 100%; height: 100%; }
.dinner-row { margin-bottom: 12px; }
.dinner-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; font-size: 1.1rem; }
.dinner-head .place { text-decoration: underline; text-underline-offset: 3px; }
.faces { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 10px; }
.face { display: flex; flex-direction: column; align-items: center; width: 84px; text-align: center; color: var(--ink); font-size: .9rem; line-height: 1.15; }
.face:hover { text-decoration: none; }
.face .avatar { margin-bottom: 4px; }
.recap-peek { margin: 6px 0 0; }
.empty { text-align: center; padding: 18px 0; }
.private-tag { font-size: .72rem; letter-spacing: .04em; text-transform: none; font-weight: 600; color: var(--muted); margin-left: 6px; }
.followup { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.followup:last-of-type { border-bottom: 0; }
.followup .fu-check { margin: 2px 0 0; }
.followup .fu-check input { width: 20px; height: 20px; accent-color: var(--brand); cursor: pointer; }
.followup .fu-text { flex: 1; }
.followup .x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; padding: 2px 6px; }
.followup .x:hover { color: var(--error); }
.fu-add { margin-top: 10px; gap: 8px; }
.late { color: var(--late, #b3261e); font-weight: 600; }
@media (max-width: 760px) { .dinner-actions .btn { flex: 1 1 100%; text-align: center; } .face { width: 70px; font-size: .8rem; } }
.todos .todo-done { margin-top: 10px; }
.todos .todo-done summary { cursor: pointer; color: var(--muted); }

/* To-do history, several people per to-do, Undo (decision #97) */
.followup .fu-mark { width: 20px; text-align: center; color: var(--ok); font-weight: 700; margin-top: 1px; }
.followup.removed .fu-mark { color: var(--muted); }
.followup.done .fu-text, .followup.removed .fu-text { color: var(--muted); }
.followup.done .fu-text { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.followup.done .fu-meta, .followup.removed .fu-meta { text-decoration: none; }
.fu-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.fu-meta > span + span::before { content: "·"; margin-right: 10px; color: var(--line); }
.chips-pick { border: 0; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips-pick legend { padding: 0; margin-bottom: 4px; }
.chip-pick { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border: 1px solid var(--line); border-radius: 99px;
  font-size: .9rem; cursor: pointer; background: var(--surface); }
.chip-pick:has(input:checked) { background: var(--blue-wash); border-color: var(--brand-accent); color: var(--yale-blue); }
.chip-pick input { accent-color: var(--brand); margin: 0; }
.todo-removed summary { cursor: pointer; color: var(--muted); }

/* Add to calendar (#99) */
.addcal { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.addcal > a.small { color: var(--muted); }
.event-actions { flex-shrink: 0; }
@media (max-width: 640px) {
  .event-row:has(.event-actions) { flex-direction: column; }
}

/* Who's in town (#100) */
.whos h2 { font-size: 1.15rem; }
.whos-scroll { overflow-x: auto; margin-top: 12px; position: relative; }
.whos-grid { border-collapse: collapse; width: 100%; font-size: .9rem; }
.whos-grid th, .whos-grid td { padding: 4px 6px; text-align: center; border-bottom: 1px solid var(--line); }
.whos-grid th.wk { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 0; }
.whos-grid th.who { text-align: left; font-weight: normal; white-space: nowrap; }
.whos-grid thead a { color: inherit; }
.whos-grid .wk-start { border-left: 2px solid var(--ink, #222); }  /* between the names and each class weekend (#160) */
.st.in { color: #1f6b3f; font-weight: bold; background: color-mix(in srgb, #2e7d4f 14%, transparent); }
.st.plan { background: var(--wash); color: var(--ink, inherit); font-size: .75rem; font-weight: bold; text-transform: uppercase; letter-spacing: .04em; }
.st.out { color: var(--muted); }
.st.usual { color: color-mix(in srgb, #2e7d4f 55%, transparent); }  /* usually free, not confirmed (#159) */
.st.key { display: inline-block; min-width: 1.4em; text-align: center; border-radius: 4px; }
.sr, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .st.in { color: #7fd6a2; } }
:root[data-theme="dark"] .st.in { color: #7fd6a2; }

/* Chat bubble (#101) */
.chat-fab { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: inline-flex; align-items: center; gap: 10px;
  padding: 5px 20px 5px 5px; border-radius: 999px; cursor: pointer; background: var(--brand); color: var(--on-brand);
  border: 3px solid color-mix(in srgb, var(--brand) 55%, #6fa3e8); box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
  font-family: var(--serif); font-size: 1.15rem; font-weight: 700; white-space: nowrap; max-width: calc(100vw - 40px); }
.chat-fab-icon { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; flex-shrink: 0; display: grid; place-items: center;
  border: 2px solid var(--on-brand); background: rgba(255, 255, 255, .12); }
.chat-fab-icon img { width: 100%; height: 100%; object-fit: cover; }
.chat-fab-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.chat-fab-label { overflow: hidden; text-overflow: ellipsis; }
.chat-fab:hover { filter: brightness(1.08); }
.chat-fab:focus-visible { outline: 3px solid var(--accent, #286dc0); outline-offset: 3px; }
.chat-open .chat-fab { box-shadow: 0 0 0 3px var(--on-brand), 0 0 0 6px var(--brand); }
.chat-panel { position: fixed; right: 20px; bottom: 92px; z-index: 61; width: min(400px, calc(100vw - 40px));
  height: min(600px, calc(100vh - 130px)); display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--brand); color: var(--on-brand); }
.chat-head b { flex: 1; }
.chat-head .btn.ghost { color: var(--on-brand); border-color: rgba(255, 255, 255, .6); background: transparent; }
.chat-head .x { background: none; border: 0; color: var(--on-brand); font-size: 1.1rem; cursor: pointer; padding: 4px 6px; }
.chat-avatar { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: rgba(255, 255, 255, .15); flex-shrink: 0; }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-avatar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.chat-panel .chat { flex: 1; max-height: none; min-height: 0; padding: 12px; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; }
.chat-foot { padding: 0 12px 8px; }
.mascot-preview { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
@media (max-width: 760px) {
  .signed-in .chat-fab { bottom: calc(76px + env(safe-area-inset-bottom)); right: 14px; font-size: 1rem; padding-right: 16px; }
  .chat-fab-icon { width: 38px; height: 38px; }
  .chat-panel { inset: 0; width: auto; height: auto; border-radius: 0; border: 0; z-index: 80;
    padding-bottom: env(safe-area-inset-bottom); }
  .chat-open .chat-fab { display: none; }
}
body.signed-in main { padding-bottom: 96px; }  /* room so the chat bubble never covers the last item */

/* People filters (#106): the search stays out; the rest folds away */
.people-filters { margin-bottom: 14px; }
.people-filters > .row { margin-bottom: 10px; }
.people-filters details.filters { padding: 0; }
.people-filters details.filters > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-weight: 600; }
.people-filters details.filters > summary::-webkit-details-marker { display: none; }
.people-filters details.filters > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.people-filters details.filters[open] > summary::before { transform: rotate(90deg); }
.people-filters .filters-count { background: var(--brand); color: var(--on-brand); border-radius: 99px; padding: 0 9px; font-size: .8rem; font-weight: 600; }
.people-filters .filters-toggle { margin-left: auto; font-weight: 500; color: var(--muted); font-size: .9rem; }
.people-filters .filters-toggle::after { content: "Show"; }
.people-filters details[open] .filters-toggle::after { content: "Hide"; }
.people-filters details.filters[open] > summary { border-bottom: 1px solid var(--line); }
.people-filters details.filters > :not(summary) { margin-left: 14px; margin-right: 14px; }
.people-filters details.filters > .row:last-child { margin-bottom: 14px; }
.filters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; margin-top: 12px; }
.filters-grid label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); margin: 0; }
.filters-grid select { text-transform: none; letter-spacing: 0; font-weight: 400; width: 100%; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.chips .chip { text-decoration: none; color: inherit; margin: 0; }
.chips .chip:hover { border-color: var(--brand-accent); }
.install-dialog { width: min(480px, calc(100vw - 32px)); padding-bottom: 16px; }
.install-dialog .install { margin: 4px 0 10px; }
.install-dialog h2 { margin: 0 0 4px; font-size: 1.25rem; }
.install-dialog [data-how] p { margin: 8px 0; }
@media (max-width: 760px) { .install-dialog { width: 100vw; height: fit-content; margin: auto 0 0; border-radius: 18px 18px 0 0; } }
@media (max-width: 560px) {
  .filters-grid { grid-template-columns: 1fr 1fr; gap: 8px 10px; }
  .filters-grid label { font-size: .72rem; }
  .filters-grid select { font-size: .9rem; padding-left: 8px; padding-right: 22px; }
}

/* Security log (#107) */
.security-log td { vertical-align: top; }
.security-log .sec-source code { word-break: break-all; font-size: .8rem; }
.sec-preview { margin: 6px 0 0; padding: 6px 10px; border-left: 3px solid var(--warn); background: var(--warn-wash); color: var(--ink, inherit); font-size: .85rem; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 560px) {
  .security-log th:nth-child(2), .security-log td:nth-child(2) { display: none; }
}

/* The auto-off pop-up and alert email preview (#109) */
.agents-alert { border: 2px solid var(--error); border-radius: 14px; padding: 18px 20px; max-width: 440px; width: calc(100% - 32px); background: var(--surface); color: var(--ink); }
.agents-alert::backdrop { background: rgba(0, 0, 0, .45); }
.agents-alert h2 { margin: 0 0 8px; color: var(--error); }
.email-preview { white-space: pre-wrap; word-break: break-word; font-family: inherit; background: var(--wash);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.email-preview { width: 100%; height: 620px; margin-top: 10px; font-size: .9rem; }

.starters .starter-guest { margin-bottom: 10px; }
.starters ul { margin: 4px 0 0; padding-left: 20px; }
.starters li { margin: 2px 0; }

/* Restaurants (#113) */
.places { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-top: 14px; }
.place .dollars { color: var(--ok); font-weight: 700; letter-spacing: .04em; }
.place-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 6px; color: var(--muted); }
.place-meta .stars, .place-stars b { color: var(--accent); }
.place-filters { gap: 8px; align-items: center; }
.add-place { margin: 12px 0 0; }
.add-place summary { cursor: pointer; }
.place-stars { text-align: right; line-height: 1.5; white-space: nowrap; }
.facts, .hours { list-style: none; padding: 0; margin: 6px 0; }
.facts li { margin: 3px 0; }
.hours li { margin: 1px 0; }
.review { border-top: 1px solid var(--line); padding: 8px 0; }
.review:first-of-type { border-top: 0; }
@media (max-width: 760px) { .place-stars { text-align: left; margin-top: 8px; } }
.place-filters label { text-transform: none; letter-spacing: 0; font-size: .95rem; margin: 0; }

/* The Class filter on the people page (#118): one box per class at the school */
fieldset.class-pick { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
fieldset.class-pick legend { font-weight: 600; padding: 0; margin-bottom: 4px; width: 100%; }
fieldset.class-pick .check { margin: 0; }

/* Demo logins on the sign-in page (#120) */
.demo-logins .demo-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.demo-logins .demo-buttons form { flex: 1 1 140px; }
.demo-logins .demo-buttons .btn { width: 100%; }
.demo-logins .demo-creds { margin-top: 10px; color: var(--muted); }
.demo-logins .demo-creds summary { cursor: pointer; }
.demo-logins .demo-creds code { font-size: .78rem; overflow-wrap: anywhere; }

/* Give me a tour (#121, #149): a bar docked at the bottom of the screen. The page gets room at the bottom the height
   of the bar, so nothing is ever stuck behind it; the part being explained gets an outline. Nothing is dimmed. */
.tour-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; background: var(--surface); color: var(--ink);
  border-top: 3px solid #f0a500; box-shadow: 0 -8px 28px rgba(0, 0, 0, .22);
  padding: 12px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: flex; gap: 10px 20px; align-items: center; justify-content: center; flex-wrap: wrap; }
.tour-text { flex: 1 1 420px; max-width: 760px; min-width: 0; max-height: 30vh; overflow-y: auto; }
.tour-bar h2 { margin: 0 0 2px; font-size: 1.1rem; }
.tour-bar .tour-body { line-height: 1.4; }
.tour-bar .tour-count { opacity: .7; }
.tour-buttons { display: flex; gap: 8px; align-items: center; flex: 0 1 auto; }
.tour-gap { flex: 1; }
body.touring { padding-bottom: calc(var(--tour-h, 0px) + 16px); }
body.touring .chat-fab { bottom: calc(var(--tour-h, 0px) + 20px); }
body.touring .chat-panel { bottom: calc(var(--tour-h, 0px) + 92px); height: min(600px, calc(100vh - var(--tour-h, 0px) - 110px)); }
body.touring .undo-flash { bottom: calc(var(--tour-h, 0px) + 18px); }
.tour-lit { outline: 3px solid #f0a500 !important; outline-offset: 4px; border-radius: 10px; }
.tour-lit.tour-lit-in { outline-offset: -3px; }
@media (max-width: 760px) {
  .tour-text { flex-basis: 100%; }
  .tour-buttons { flex-basis: 100%; }
  body.touring .chat-fab { bottom: calc(var(--tour-h, 0px) + 12px); }
  body.touring .chat-panel { bottom: 0; height: auto; }  /* full screen over the bar while it's open */
}

/* A picture dropped into a box shows at once, waiting to be saved (#122) */
.brand-preview:empty { display: none; }
.brand-preview .pic-new { color: var(--accent); font-weight: 600; }

/* Administrator invitation and reminder emails shown as text (#123) */
.email-text{white-space:pre-wrap;font:inherit;font-size:.95rem;background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:12px;margin:10px 0 0;overflow-wrap:anywhere}
details.reminder summary{cursor:pointer}
.recap-rating { border: 0; border-bottom: 1px solid var(--line); padding: 0 0 14px; margin: 0 0 14px; }
.recap-rating legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
.frame-pick { position: relative; flex: 1 1 100% !important; max-width: 420px; }
.frame-pick img { cursor: crosshair; }
.frame-dot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 3px solid #fff;
  background: var(--brand); box-shadow: 0 0 0 2px rgba(0,0,0,.45); pointer-events: none; }

/* A light main color (Princeton orange, #156): black text on it (--on-brand), and every main-color block outlined
   in black so the orange reads as a shape. Set by theme.light_brand; the Admin color preview toggles it too. */
.brand-light .topbar { border-bottom: 2px solid #000; }
.brand-light .btn:not(.ghost):not(.plus), .brand-light .chip.on, .brand-light .chat-fab { border-color: #000; }
.brand-light .btn.plus { color: #000; border-color: #000; }
.brand-light .gear summary, .brand-light .meet, .brand-light .meet-pick { border-color: #000; }
.brand-light .meet { background: rgba(255, 255, 255, .2); }
.brand-light .meet-bar { background: rgba(0, 0, 0, .15); box-shadow: inset 0 0 0 1px #000; }
.brand-light .meet-bar span { background: #000; }
.brand-light .gear summary:hover, .brand-light .gear[open] summary { background: rgba(0, 0, 0, .08); }
.brand-light .cal th, .brand-light .msg.me, .brand-light .badge.new,
.brand-light .people-filters .filters-count, .brand-light .bar > span, .brand-light .chat-head { box-shadow: inset 0 0 0 1px #000; }
.brand-light .chat-head .btn.ghost { border-color: #000; }
.brand-light .undo-flash { border: 2px solid #000; }
.brand-light .chat-fab-icon { background: rgba(0, 0, 0, .08); }
@media (max-width: 760px) {
  .brand-light .nav { border-top: 2px solid #000; }
  .brand-light .nav a.on, .brand-light .nav a:hover { background: rgba(0, 0, 0, .1); }
}
/* Headings and labels go black on a light main color (orange text on white is hard to read); dark mode keeps its
   own tint, which outranks this. The tabs' words go black on the orange too. */
html.brand-light { --yale-blue: #000; }
.brand-light .nav a { color: rgba(0, 0, 0, .78); }
.brand-light .nav a.on, .brand-light .nav a:hover { color: #000; }
.brand-light .nav.tabs a { color: rgba(0, 0, 0, .78); }
.brand-light .nav.tabs a.on, .brand-light .nav.tabs a:hover { color: #000; }

/* Two-tone sets (Penn, #157): the second color fills the "still to meet" boxes, the light/dark switch and the
   concierge button, instead of a lighter shade of the main color. */
.brand-two .meet { background: var(--brand-2); border-color: rgba(255, 255, 255, .4); }
.brand-two .meet-bar { background: rgba(0, 0, 0, .3); }
.brand-two .theme-switch { background: var(--brand-2); border-color: rgba(255, 255, 255, .5); }
.brand-two .chat-fab { background: var(--brand-2); border-color: color-mix(in srgb, var(--brand-2) 55%, #fff); }
.brand-two.chat-open .chat-fab, .brand-two .chat-open .chat-fab { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--brand-2); }

/* Cost & security (#195): the technical parts sit in smaller, quieter type */
.tech { font-size: .85rem; }
.tech .panel { padding: 10px 14px; }
.tech summary { cursor: pointer; }
.tech .security-log td, .tech .security-log th { font-size: .8rem; padding: 4px 6px; vertical-align: top; }
.tech .security-log code { font-size: .75rem; word-break: break-all; }
.tech .nowrap { white-space: nowrap; }
.tech details.inline { display: inline; }
.btn.tiny { font-size: .75rem; padding: 2px 8px; }

/* RSVP (#196) */
.panel.rsvp { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.panel.rsvp form, .invitations form { display: inline; margin: 0; }

/* Plan a dinner: pick the night (#199). One row of upcoming dinner nights with how many are free; scrolls sideways on phones */
.night-pick { display: flex; gap: 8px; align-items: flex-start; overflow-x: auto; padding: 2px 2px 8px; margin: 0 0 10px; scrollbar-width: thin; }
.night-pick .night { flex: none; display: flex; flex-direction: column; align-items: center; padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; line-height: 1.2; }
.night-pick .night span { font-size: .8rem; color: var(--muted, #666); }
.night-pick .night:hover { border-color: var(--brand); }
.night-pick .night.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.night-pick .night.on span { color: var(--on-brand); opacity: .85; }
.night-pick .night-other { flex: none; align-self: center; font-size: .9rem; }
.night-pick .night-other summary { cursor: pointer; color: var(--link, var(--brand)); white-space: nowrap; }

/* Plan a dinner: the quiet hours-and-link line under Restaurant (#201) */
.place-line { color: var(--muted); }
.place-line.closed { color: var(--warn); }
.place-line a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }

.whos-grid tr.you th.who { font-weight: 700; font-size: 1.05rem; line-height: 20px; }  /* your own line, first; set each night right in it */
.whos-grid tr.you td.st { padding: 3px 4px; vertical-align: top; }  /* two lines: your switch, then Dinner if you're booked */
.whos-grid tr.you th.who { vertical-align: top; padding-top: 4px; }
.you-dinner { min-height: 1.5em; margin-top: 3px; font-size: .75rem; font-weight: bold; text-transform: uppercase; letter-spacing: .04em; }
.you-dinner a { display: inline-block; padding: 0 8px; border-radius: 4px; background: var(--wash); color: var(--ink, inherit); text-decoration: none; }
.whos-grid tr.you td.st.plan { background: transparent; }
.night-switch button { text-transform: none; letter-spacing: normal; }
.night-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; vertical-align: middle; }
.night-switch button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .75rem; line-height: 1.45;
  padding: 0 9px; cursor: pointer; }
.night-switch button + button { border-left: 1px solid var(--line); }
.night-switch button.on { background: var(--brand); color: var(--on-brand); font-weight: bold; }
.night-switch button.on.usual { background: color-mix(in srgb, var(--brand) 45%, transparent); }  /* from your card, not confirmed */
.night-switch button:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

.list-head { margin: 10px 0 4px; }  /* the admin calendar list: what may move a dinner, above the folded class days */

/* Who's in town: which classes the grid shows (#225) */
.class-menu { display: inline-block; position: relative; margin-top: 8px; }
.class-menu > summary { cursor: pointer; list-style: none; border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; font-size: .85rem; }
.class-menu > summary::-webkit-details-marker { display: none; }
.class-menu > summary::after { content: " ▾"; color: var(--muted); }
.class-menu-list { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 240px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 18px rgba(0,0,0,.12);
  display: flex; flex-direction: column; gap: 4px; width: max-content; max-width: min(92vw, 420px); }
.class-menu-list .check { white-space: nowrap; }
/* My card: your upcoming nights (#225) */
.my-nights-row { display: flex; flex-wrap: wrap; gap: 8px; }
.my-night-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 6px 10px; min-width: 96px; text-align: center; }
.my-night-cell .you-dinner { min-height: 1.2em; margin-top: 0; }

/* Calendar page (#232): a compact month first, icons only (hover or open a day for details), and the nights
   shown in Who's in town below outlined on it */
.cal.compact td { height: 54px; padding: 3px 5px; }
.cal.compact .icons { display: block; margin-top: 2px; font-size: .8rem; line-height: 1.1; white-space: nowrap; overflow: hidden; }
.cal.compact .icons span { margin-right: 2px; }
.cal.compact td.in-grid { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-key { margin: 6px 0 14px; }
.cal-key .key-outline { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 4px; padding: 0 5px; }
@media (max-width: 640px) { .cal.compact td { height: 44px; } .cal.compact .icons { font-size: .66rem; } }

/* Looking for somewhere new (#213): the trip from Plan a dinner to Restaurants and back */
.new-place { margin-top: 4px; }
.plan-trip { border-left: 4px solid var(--accent); margin-bottom: 12px; }
.plan-trip.spread { flex-wrap: wrap; gap: 8px; align-items: center; }

/* + Add restaurant (#214): what a look-up just added comes first, outlined, on that one load */
.card.place.just-added { border: 2px solid var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }

/* Where classes meet (#215): the distance on restaurant cards and pages, and the setting */
.away { color: var(--muted); margin-top: 2px; }
fieldset.venue { border: 1px solid var(--line); border-radius: 10px; padding: 6px 14px 10px; margin: 14px 0 4px; }
fieldset.venue legend { font-weight: 600; padding: 0 6px; }
.warn-text { color: var(--warn); }

/* Admin groups (#218): Program setup, Calendar, Members, Security & usage, each folding its sections */
details.admin-group { border-top: 1px solid var(--line); padding: 6px 0; }
details.admin-group:last-of-type { border-bottom: 1px solid var(--line); }
details.admin-group > summary.admin-group-title { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  font-family: var(--serif, inherit); font-size: 1.35rem; font-weight: 700; color: var(--yale-blue); padding: 8px 0; }
details.admin-group > summary.admin-group-title::-webkit-details-marker { display: none; }
details.admin-group > summary.admin-group-title::before { content: "▸"; transition: transform .15s; font-size: 1rem; }
details.admin-group[open] > summary.admin-group-title::before { transform: rotate(90deg); }
details.admin-group > summary.admin-group-title:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
details.admin-group > details.admin-section, details.admin-group > .panel { margin-left: 22px; }

/* Cohorts in this program (#219): one line each, Graduate at the end */
.cohort-list { list-style: none; padding: 0; margin: 4px 0 10px; }
.cohort-list li { gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cohort-list li form { margin: 0; }
.add-cohort { gap: 8px; }

/* Address suggestions (#220) */
.address-box { position: relative; }
.address-suggest { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 4px 0; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.address-suggest[hidden] { display: none; }
.address-suggest li { padding: 7px 12px; cursor: pointer; }
.address-suggest li:hover, .address-suggest li[aria-selected="true"] { background: var(--blue-wash); }

/* The app icon choice on the Admin page (Prompt 252) */
.icon-choice { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 4px; margin-top: 14px; }
.icon-choice legend { font-weight: 700; padding: 0 6px; }
.icon-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.icon-option { text-transform: none; letter-spacing: normal; font-weight: 400; font-size: .95rem; color: var(--ink, inherit); display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; margin: 0; }
.icon-option:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.icon-option.off { cursor: not-allowed; opacity: .6; }
.icon-option img, .icon-option .icon-blank { width: 56px; height: 56px; border-radius: 12px; flex: none; }
.icon-option .icon-blank { display: grid; place-items: center; border: 2px dashed var(--line); color: var(--muted, #777); font-size: 1.4rem; }
.icon-option > span:last-child { display: flex; flex-direction: column; gap: 2px; }

/* Sample text in a box is italic and a lighter gray, so it can't be mistaken for something typed (Prompt 263) */
::placeholder { font-style: italic; color: var(--placeholder, #a39d97); opacity: 1; }
/* Where classes meet isn't set yet (Prompt 263) */
.venue-missing { background: var(--warn-wash); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); border-radius: 8px;
  padding: 8px 12px; margin: 4px 0 10px; font-size: .9rem; }
/* An upload that was refused (Prompt 273): red, with a thick left bar, so it can't be missed */
.upload-refused { background: var(--error-wash); color: var(--error); border: 1px solid color-mix(in srgb, var(--error) 45%, transparent);
  border-left: 6px solid var(--error); border-radius: 8px; padding: 12px 14px; margin: 4px 0 12px; font-weight: 500; }
.upload-refused b { color: var(--error); }
.upload-refused a { color: var(--error); text-decoration: underline; font-weight: 600; }
.tour-need { margin: 0; color: var(--warn); }

/* Which class a schedule is for (Prompt 265) */
.class-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.none-above { margin: 14px 0 0; }
.schedule-waiting { position: sticky; top: 0; z-index: 15; background: var(--warn-wash); color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px;
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }

/* Placecard's "are you sure?" box (Prompt 274): red and pink, over a dimmed page, in place of the browser's own */
.ask-dialog { border: 1px solid color-mix(in srgb, var(--error) 45%, transparent); border-top: 6px solid var(--error);
  border-radius: 14px; background: var(--error-wash); color: var(--ink); padding: 20px 22px 18px;
  width: min(460px, calc(100vw - 32px)); box-shadow: 0 18px 48px rgba(0, 0, 0, .35); }
.ask-dialog::backdrop { background: rgba(20, 10, 10, .55); }
.ask-dialog h2 { margin: 0 0 8px; color: var(--error); font-size: 1.2rem; line-height: 1.3; text-transform: none; letter-spacing: 0; }
.ask-dialog .ask-body { margin: 0 0 4px; white-space: pre-line; }
.ask-dialog .ask-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.ask-dialog .ask-ok { background: var(--error); border-color: var(--error); color: #fff; }
.ask-dialog .ask-ok:hover { filter: brightness(1.1); }
.ask-dialog .btn.ghost { background: var(--surface); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ask-dialog .ask-ok { color: #2a0f0f; } }
:root[data-theme="dark"] .ask-dialog .ask-ok { color: #2a0f0f; }
