/* Warm, quiet and spacious, in the spirit of Claude's own app. Phone first:
   big tap targets, one column, five tabs at the bottom. On wide screens the
   tabs become a sidebar. */
:root {
  --bg: #faf9f5; --side: #f3f1ea; --card: #fff; --soft: #f0eee6; --line: #e8e5da; --line-strong: #d6d2c4;
  --ink: #1f1e1d; --muted: #6f6c63; --accent: #1f1e1d; --accent-ink: #faf9f5; --brand: #c96442;
  --ok: #2f6b3c; --ok-bg: #eef4ea; --warn: #8a5a12; --warn-bg: #f8f0dc; --bad: #b3361f; --bad-bg: #f9ebe5;
  --focus: #c96442; --shadow: 0 1px 2px rgba(31,30,29,.04), 0 2px 8px rgba(31,30,29,.03);
  --radius: 16px; --radius-sm: 12px; --tabbar: 64px; --sidebar: 260px;
  --serif: ui-serif, "New York", Charter, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  color-scheme: light; font-size: 17px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #262624; --side: #1f1e1d; --card: #30302e; --soft: #34332f; --line: #3d3c37; --line-strong: #52504a;
    --ink: #f5f4ef; --muted: #a8a59c; --accent: #f5f4ef; --accent-ink: #1f1e1d; --brand: #d97757;
    --ok: #8fc79a; --ok-bg: #26332a; --warn: #e3b866; --warn-bg: #3a3122; --bad: #ee8b74; --bad-bg: #3d2722;
    --focus: #d97757; --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.icon { width: 21px; height: 21px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
details.account > summary { list-style: none; }
details.account > summary::-webkit-details-marker { display: none; }

/* Frame */
header.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  height: 56px; padding: 0 1rem; padding-top: env(safe-area-inset-top); box-sizing: content-box;
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: saturate(1.3) blur(12px); -webkit-backdrop-filter: saturate(1.3) blur(12px); }
.brand { font-family: var(--serif); font-size: 1.12rem; font-weight: 500; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: .25rem; margin-right: -6px; }
.bell { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; text-decoration: none; color: var(--muted); }
.bell:hover, .bell.active { background: var(--soft); color: var(--ink); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 600; line-height: 1; }
.bell .count { position: absolute; top: 5px; left: 22px; min-width: 17px; height: 17px; padding: 0 5px; font-size: 10.5px; box-shadow: 0 0 0 2px var(--bg); }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--ink); color: var(--bg); font-size: 12.5px; font-weight: 600; letter-spacing: .02em; }
main { max-width: 44rem; margin: 0 auto; padding: .75rem 1.1rem 2rem; }
body.signed-in main { padding-bottom: calc(var(--tabbar) + 2.5rem + env(safe-area-inset-bottom)); }
.sidebar { display: none; }

/* Account menu: a small card that drops from the avatar */
details.account { position: relative; }
details.account > summary { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; }
details.account[open] > summary::before { content: ""; position: fixed; inset: 0; z-index: 30; cursor: default; }
.popover { position: absolute; z-index: 31; right: 0; top: calc(100% + 6px); width: min(18rem, calc(100vw - 2rem)); padding: .4rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(31,30,29,.12); }
.menu a, .menu-button { display: flex; align-items: center; gap: .7rem; min-height: 44px; padding: .45rem .7rem; border-radius: 10px;
  color: var(--ink); text-decoration: none; font-size: .95rem; font-weight: 450; }
.menu .icon { color: var(--muted); width: 19px; height: 19px; }
.menu a:hover, .menu-button:hover, .menu a.active { background: var(--soft); }
.menu-who { display: flex; flex-direction: column; margin: 0; padding: .55rem .7rem .7rem; border-bottom: 1px solid var(--line); margin-bottom: .35rem; line-height: 1.35; }
.menu-who span { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; }
.menu form { margin: .35rem 0 0; padding-top: .35rem; border-top: 1px solid var(--line); }
button.menu-button { width: 100%; margin: 0; justify-content: flex-start; min-height: 44px; background: none; border: 0; font: inherit; font-size: .95rem; font-weight: 450; cursor: pointer; color: var(--ink); }

/* Phone tab bar */
.tabbar { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: flex; height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.tabbar > a { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11.5px; font-weight: 500; color: var(--muted); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.tabbar > a.active { color: var(--ink); }
.tabbar > a.active .icon { stroke-width: 2; }

/* Pages within a tab (Tasks, Callings, Interviews) */
.subnav { display: flex; gap: 1.4rem; margin: .25rem 0 1.25rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { padding: .55rem 0 .7rem; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem; white-space: nowrap; }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current] { color: var(--ink); border-bottom-color: var(--ink); }

@media (min-width: 960px) {
  body.signed-in { padding-left: var(--sidebar); }
  .sidebar { display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; width: var(--sidebar); overflow-y: auto;
    padding: 1.1rem .8rem .8rem; background: var(--side); border-right: 1px solid var(--line); }
  .sidebar > * { flex: none; }
  .sidebar .brand { display: block; padding: .3rem .7rem 1.4rem; white-space: normal; }
  .side-tabs { display: flex; flex-direction: column; gap: 2px; }
  .side-tabs a { display: flex; align-items: center; gap: .75rem; min-height: 42px; padding: .45rem .7rem; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: .95rem; }
  .side-tabs .icon { color: var(--muted); }
  .side-tabs a:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
  .side-tabs a.active { background: color-mix(in srgb, var(--ink) 8%, transparent); font-weight: 550; }
  .side-tabs a.active .icon { color: var(--ink); }
  .side-tabs .count { margin-left: auto; }
  .sidebar details.account { margin-top: auto; }
  .sidebar details.account > summary { display: flex; width: 100%; height: auto; gap: .65rem; padding: .5rem .6rem; border-radius: 12px; justify-content: flex-start; }
  .sidebar details.account > summary:hover, .sidebar details.account[open] > summary { background: color-mix(in srgb, var(--ink) 6%, transparent); }
  .account-name { font-size: .92rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar .popover { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; width: 100%; }
  body.signed-in header.top { display: none; }
  .tabbar { display: none; }
  body.signed-in main { padding: 3rem 3rem 4rem; max-width: 56rem; margin: 0 auto; }
}

/* Type */
h1 { font-family: var(--serif); font-size: 2rem; line-height: 1.2; letter-spacing: -.015em; font-weight: 500; margin: .5rem 0 1.5rem; }
h2 { font-size: 1.05rem; letter-spacing: -.005em; font-weight: 600; margin: 2rem 0 .6rem; }
h3 { font-size: 1rem; font-weight: 650; margin: 1.25rem 0 .4rem; }
p { margin: .5rem 0; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .88rem; margin: .1rem 0 .35rem; font-weight: 400; }
.late { color: var(--bad); }

/* Surfaces */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: .75rem; box-shadow: var(--shadow); }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .6rem; }
.tile { display: flex; align-items: center; gap: .9rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .9rem 1rem; text-decoration: none; color: var(--muted); font-size: .88rem; line-height: 1.35; box-shadow: var(--shadow); transition: border-color .15s; }
.tile:hover { border-color: var(--line-strong); }
.tile .icon { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--soft); color: var(--ink); }
.tile strong { display: block; font-size: 1rem; color: var(--ink); font-weight: 600; margin-bottom: .1rem; }
.tile.soon { opacity: .55; }

/* Today and simple lists: rows with a title and a quiet detail line */
.today { margin-bottom: 1.75rem; }
.today h2 { margin: 0 0 .5rem; font-size: .8rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.today h2 a { text-decoration: none; }
.today h2 a:hover { color: var(--ink); }
ul.list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
ul.list li + li { border-top: 1px solid var(--line); }
ul.list a { display: flex; align-items: center; gap: .9rem; padding: .85rem 1.05rem; text-decoration: none; min-height: 56px; }
ul.list a:hover { background: color-mix(in srgb, var(--ink) 3%, var(--card)); }
ul.list a > .icon { width: 38px; height: 38px; padding: 9px; border-radius: 11px; background: var(--soft); }
.list-title { display: block; font-weight: 550; }
.list-detail { display: block; color: var(--muted); font-size: .88rem; }
ul.list li.late .list-detail { color: var(--bad); }
ul.list li.late a { box-shadow: inset 3px 0 0 var(--bad); }
.empty { color: var(--muted); padding: 2rem 0; font-size: 1.05rem; }

/* Forms */
label { display: block; font-weight: 550; font-size: .94rem; margin: 1rem 0 .3rem; }
input[type=text], input[type=email], input[type=number], input[type=time], input[type=date], input[type=datetime-local],
input[type=search], input[type=password], input[type=tel], input[type=url], select, textarea {
  width: 100%; min-height: 46px; font: inherit; font-size: max(16px, 1rem); color: var(--ink); padding: .6rem .8rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--card); transition: border-color .15s, box-shadow .15s; }
select { appearance: none; -webkit-appearance: none; padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; background-size: 18px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 10%, transparent); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--accent); vertical-align: -4px; margin: 0 .5rem 0 0; }
input[type=file] { font: inherit; font-size: .94rem; max-width: 100%; }
textarea { min-height: 7rem; resize: vertical; }
.field-error { color: var(--bad); font-size: .88rem; margin: .3rem 0 0; }
.invalid { border-color: var(--bad) !important; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 46px; font: inherit; font-size: .97rem; font-weight: 600;
  padding: .55rem 1.15rem; border-radius: var(--radius-sm); border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  cursor: pointer; text-decoration: none; margin-top: 1rem; transition: opacity .15s, background .15s; -webkit-tap-highlight-color: transparent; }
button:hover, .button:hover { opacity: .88; }
button:active, .button:active { transform: translateY(1px); }
button.secondary, .button.secondary { background: var(--card); color: var(--ink); border-color: var(--line-strong); }
button.secondary:hover, .button.secondary:hover { background: var(--soft); opacity: 1; }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.small.danger { background: var(--card); color: var(--bad); border-color: var(--line-strong); }
button.link { display: inline; min-height: 0; background: none; border: 0; color: inherit; padding: 0; margin: 0; font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
button.small, .button.small { min-height: 36px; padding: .3rem .8rem; margin: 0; font-size: .88rem; }
form.inline { display: inline; }
.flash, .error { display: flex; gap: .5rem; padding: .75rem 1rem; border-radius: var(--radius-sm); font-weight: 500; margin: 0 0 1rem; }
.flash { background: var(--ok-bg); color: var(--ok); }
.error { background: var(--bad-bg); color: var(--bad); }
fieldset { min-width: 0; }
fieldset.choice { border: 0; padding: 0; margin: 1rem 0 0; }
fieldset.choice legend { font-weight: 550; font-size: .94rem; margin-bottom: .25rem; padding: 0; }
fieldset.choice label, .checks label { display: flex; align-items: center; font-weight: 400; font-size: 1rem; margin: 0; min-height: 40px; }
.checks { columns: 2 14rem; column-gap: 1rem; }
.checks label { break-inside: avoid; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row input[type=text], .row input[type=file] { flex: 1 1 12rem; margin: 0; width: auto; }
.row button, .row .button { margin: 0; }
.pair { display: flex; gap: .5rem; }
.pair > * { flex: 1; min-width: 0; }
.inline-form select { width: auto; }
input.short { width: 6.5rem; }
/* Suggestions as you type (static/suggest.js). */
.suggest { position: relative; }
.suggest-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: .3rem; list-style: none;
  max-height: 18rem; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(31,30,29,.12); }
.suggest-list li { padding: .6rem .7rem; min-height: 44px; display: flex; align-items: center; border-radius: 8px; cursor: pointer; }
.suggest-list li:hover, .suggest-list li[aria-selected=true] { background: var(--soft); }
details summary { cursor: pointer; font-weight: 600; margin: .5rem 0; }
.filters .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0 .75rem; }
.filters > button, .filters > .button { margin-right: .4rem; }

/* Lists and tables */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: .95rem; }
th, td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-size: .78rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); background: var(--soft); }
.badge { display: inline-flex; align-items: center; padding: .1rem .55rem; border-radius: 999px; background: var(--soft); border: 1px solid var(--line);
  font-size: .78rem; font-weight: 550; color: var(--muted); margin: .1rem .2rem .1rem 0; white-space: nowrap; text-decoration: none; }
.badge.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
ul.people { list-style: none; padding: 0; margin: 0 0 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
ul.people li { padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
ul.people li:last-child { border-bottom: 0; }
ul.people li > a:first-child, ul.people li > div > a:first-child { font-weight: 600; text-decoration: none; }
/* Directory rows with a box to pick people for the map; the whole box area is the tap target. */
ul.people li.pick { display: flex; align-items: center; gap: .5rem; padding-right: .25rem; }
ul.people li.pick > div { flex: 1; min-width: 0; }
.pick-box { position: relative; display: flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; margin: 0; cursor: pointer; }
.pick-box input[type=checkbox] { width: 24px; height: 24px; margin: 0; }
.lists a.badge { text-decoration: none; }
dl.card dt { font-size: .82rem; font-weight: 600; color: var(--muted); margin-top: .6rem; }
dl.card dt:first-child { margin-top: 0; }
dl.card dd { margin: .1rem 0 0; }
.instructions { white-space: pre-line; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.tabs .button, .tabs button { margin: 0; }
.segmented { display: flex; gap: 2px; padding: 3px; margin: 0 0 .75rem; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; }
.segmented a { flex: 1; display: grid; place-items: center; min-height: 40px; padding: 0 1rem; border-radius: 9px; font-size: .94rem; font-weight: 550; color: var(--muted); text-decoration: none; white-space: nowrap; }
.segmented a[aria-current] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
@media (min-width: 601px) { .segmented { display: inline-flex; } .segmented + .tabs { display: inline-flex; margin-left: .5rem; vertical-align: top; } }

/* Boards (tasks, callings): columns on wide screens, a stack on phones */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; align-items: start; }
.board .column h2 { margin: .75rem 0 .5rem; font-size: .82rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
a.card.task { display: block; text-decoration: none; color: var(--ink); margin-bottom: .5rem; }
a.card.task:hover { border-color: var(--line-strong); }
a.card.task strong { font-weight: 600; }
a.card.task.late { box-shadow: inset 3px 0 0 var(--bad), var(--shadow); }
.moves { display: flex; flex-wrap: wrap; gap: .4rem; }
.moves form { margin: 0; }
.moves button { margin: 0; }
.card.note p { margin: .25rem 0; }
.slots { display: flex; flex-wrap: wrap; gap: .4rem; }
.slots form { margin: 0; }
.slots button { margin: 0; }
.slots.radios label { display: flex; align-items: center; font-weight: 500; margin: 0; min-height: 44px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: .45rem .8rem; background: var(--card); cursor: pointer; }
.slots.radios label:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.map { height: 26rem; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: .75rem; }
.map.small { height: 18rem; }
ol.stops li { padding: .35rem 0; }

/* Meetings */
ol.agenda { list-style: none; padding: 0; }
ol.agenda > li { margin: .5rem 0; }
ol.agenda > li.done strong { text-decoration: line-through; color: var(--muted); }
button.check { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; font-size: 1.05rem; flex: none; }
.note-line { margin: .25rem 0 .25rem 3rem; }

/* Sacrament meeting */
fieldset.talk, fieldset.hymn { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .9rem .9rem; margin: .6rem 0; }
fieldset.talk legend, fieldset.hymn legend { font-weight: 600; padding: 0 .3rem; }
.present h2 { font-size: 1.6rem; }
.present .say, .present-all .say { font-size: 1.4rem; line-height: 1.55; }
.present .cue, .present-all .cue { background: var(--soft); border-radius: var(--radius-sm); padding: .6rem .9rem; color: var(--muted); }
.present-nav { display: flex; justify-content: space-between; gap: .75rem; margin-top: 2rem; }
.present-nav .button { flex: 1; font-size: 1.1rem; min-height: 56px; }
.bulletin header { text-align: center; }
.bulletin dl { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem 1rem; margin: 1rem 0; }
.bulletin dt { font-weight: 600; }
.bulletin dd { margin: 0; text-align: right; }

/* Notifications */
.notice { display: block; text-decoration: none; color: var(--ink); }
.notice.unread { box-shadow: inset 3px 0 0 var(--ink), var(--shadow); }

/* Messages */
.msg { border-bottom: 1px solid var(--line); padding: .75rem 0; }
.msg:last-child { border-bottom: 0; }
.msg-head, .msg-actions { margin: 0; }
.msg-body { white-space: pre-line; margin: .25rem 0; overflow-wrap: anywhere; }
.msg-actions { font-size: .85rem; display: flex; gap: .9rem; align-items: center; color: var(--muted); }
.replies { margin-left: 1rem; padding-left: .9rem; border-left: 2px solid var(--line); }
.compose { margin-top: 1rem; }
.compose textarea { width: 100%; min-height: 5rem; }

/* Vault */
.secret code { display: inline-block; font-size: 1.2rem; padding: .35rem .6rem; background: var(--soft); border-radius: 8px; overflow-wrap: anywhere; }

@media (max-width: 600px) {
  :root { font-size: 16px; }
  h1 { font-size: 1.75rem; }
  table.stack, table.stack tbody { display: block; }
  table.stack thead { display: none; }
  table.stack tr { display: block; border-bottom: 1px solid var(--line); padding: .5rem 0; }
  table.stack tr:last-child { border-bottom: 0; }
  table.stack td { display: block; border: 0; padding: .15rem .9rem; }
  .board { grid-template-columns: 1fr; gap: 0; }
  .board:has(.card) .column:not(:has(.card)), .board:not(:has(.card)) .column:not(:first-child) { display: none; }
  form.card > button:last-child, .card > form > button:last-child { width: 100%; }
  form.filters > button, form.filters > .button { width: auto; flex: 1; white-space: nowrap; padding-left: .6rem; padding-right: .6rem; }
  form.filters { display: flex; flex-wrap: wrap; gap: 0 .5rem; }
  form.filters > :not(button):not(.button) { flex: 0 0 100%; }
  form.filters > button, form.filters > .button { margin-right: 0; }
}

@media print {
  header.top, nav, .sidebar, .tabbar, footer, .no-print, .flash { display: none !important; }
  body, body.signed-in { background: #fff; color: #000; padding: 0; }
  main { padding: 0 !important; }
}

/* Queue cards: a link plus small action buttons. */
.qcard { margin-bottom: .5rem; padding: .75rem .9rem; }
.qcard .qlink { display: block; text-decoration: none; color: var(--ink); }
.qcard .qlink strong { font-weight: 600; }
.qcard .qlink > .muted { display: block; font-size: .86rem; }
.qcard.late { box-shadow: inset 3px 0 0 var(--bad), var(--shadow); }
.qcard .moves { margin-top: .6rem; }
.qcard .moves form { display: contents; }
.qcard .button.small, .qcard button.small { min-height: 36px; }


/* Back link above pages that sit below a menu page. */
a.back { display: inline-flex; align-items: center; min-height: 44px; margin: -.25rem 0 -.25rem -.25rem; padding: 0 .25rem; color: var(--muted); font-size: .94rem; text-decoration: none; }
a.back:hover { color: var(--ink); }

/* Dragging cards between lanes (static/board.js). */
.qcard[data-drops] { cursor: grab; -webkit-touch-callout: none; user-select: none; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; opacity: .95; box-shadow: 0 10px 30px rgba(0,0,0,.18); rotate: 1.5deg; }
.drag-source { opacity: .35; }
.board.dragging { cursor: grabbing; align-items: stretch; user-select: none; -webkit-user-select: none; }
.board.dragging .column { min-height: 6rem; }
.board.dragging .column { display: block !important; }
.board.dragging .column.drop-ok { outline: 2px dashed var(--line-strong); outline-offset: 4px; border-radius: 12px; }
.board.dragging .column.drop-over { outline-color: var(--brand); background: var(--soft); }
.board.dragging .column:not(.drop-ok) { opacity: .45; }

/* Week calendar: a list of days on phones, a time grid on wide screens.
   Open times are light bands; bookings sit on top in the leader's color. */
.tint0 { --tint: #c96442; } .tint1 { --tint: #4f7a8a; } .tint2 { --tint: #6b7f3a; } .tint3 { --tint: #8a5a9a; } .tint4 { --tint: #a07a2a; }
.week-head { display: flex; align-items: center; gap: .6rem; margin: .25rem 0 .75rem; }
.week-head strong { font-family: var(--serif); font-weight: 500; font-size: 1.15rem; min-width: 9.5rem; text-align: center; }
.week-head .button { min-width: 40px; }
.day-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr)); gap: .4rem; margin: .5rem 0 1rem; }
.day-pick a { display: flex; flex-direction: column; align-items: center; padding: .5rem .25rem; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--muted); font-size: .8rem; background: var(--card); }
.day-pick b { font-size: .95rem; font-weight: 550; color: var(--ink); }
.day-pick a[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.day-pick a[aria-current] b { color: var(--bg); }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 1rem; }
.week-strip a { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: .35rem 0 .45rem; border-radius: 12px; text-decoration: none; color: var(--muted); font-size: .78rem; position: relative; }
.week-strip b { font-size: 1.05rem; font-weight: 550; color: var(--ink); }
.week-strip a.today { background: var(--ink); color: var(--bg); }
.week-strip a.today b { color: var(--bg); }
.week-strip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); position: absolute; bottom: 3px; }
.week-hours { display: none; }
.week-day { scroll-margin-top: 70px; padding: .5rem 0 .75rem; border-top: 1px solid var(--line); }
.week-day h2 { margin: 0 0 .4rem; font-size: .95rem; font-weight: 600; }
.week-day h2 { text-transform: none; letter-spacing: 0; }
.week-day h2 span { color: var(--muted); font-weight: 500; }
.week-day.today h2 { color: var(--brand); }
.week-track { display: flex; flex-direction: column; gap: 6px; }
.week-empty { margin: 0; font-size: .9rem; }
.cal-item { display: block; padding: .45rem .7rem; border-radius: 10px; font-size: .9rem; line-height: 1.35; text-decoration: none; color: var(--ink);
  border-left: 3px solid var(--tint); }
.cal-item.open { background: color-mix(in srgb, var(--tint) 9%, var(--bg)); color: var(--muted); border-left-style: dashed; }
.cal-item.booked { background: color-mix(in srgb, var(--tint) 16%, var(--card)); box-shadow: var(--shadow); }
.cal-item.booked .when { font-weight: 600; margin-right: .35rem; }
.cal-item.booked .muted { display: block; font-size: .82rem; }
.cal-item.ward-event { --tint: var(--line-strong); background: repeating-linear-gradient(135deg, var(--soft) 0 6px, var(--bg) 6px 12px); color: var(--muted); }
.cal-item.ward-event strong { color: var(--ink); font-weight: 600; }
.week-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .85rem; color: var(--muted); }
.week-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; background: var(--tint); vertical-align: -1px; }
@media (min-width: 960px) {
  body.signed-in main:has(.week) { max-width: 80rem; }
  .week-strip { display: none; }
  .week { display: grid; grid-template-columns: 3.4rem repeat(7, minmax(0, 1fr)); grid-template-rows: auto 1fr; column-gap: 0;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
  .week-hours { display: block; position: relative; grid-row: 2; grid-column: 1; height: calc(var(--hours, 13) * 3.2rem); }
  .week-hours span { position: absolute; top: var(--t); right: .4rem; transform: translateY(-50%); font-size: .7rem; color: var(--muted); }
  .week-hours span:first-child { transform: none; }
  .week-day { display: contents; }
  .week-day:nth-of-type(1) > * { grid-column: 2; } .week-day:nth-of-type(2) > * { grid-column: 3; }
  .week-day:nth-of-type(3) > * { grid-column: 4; } .week-day:nth-of-type(4) > * { grid-column: 5; }
  .week-day:nth-of-type(5) > * { grid-column: 6; } .week-day:nth-of-type(6) > * { grid-column: 7; }
  .week-day:nth-of-type(7) > * { grid-column: 8; }
  .week-day h2 { grid-row: 1; padding: .6rem .5rem; margin: 0; text-align: center; font-size: .85rem; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
  .week-day h2 span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
  .week-day.today h2 { background: color-mix(in srgb, var(--brand) 8%, var(--card)); }
  .week-track { grid-row: 2; position: relative; display: block; height: calc(var(--hours, 13) * 3.2rem); border-left: 1px solid var(--line);
    background: repeating-linear-gradient(to bottom, transparent 0 calc(3.2rem - 1px), var(--line) calc(3.2rem - 1px) 3.2rem); }
  .week-empty { display: none; }
  .cal-item { position: absolute; top: var(--t); height: var(--h); overflow: hidden; padding: .2rem .35rem; font-size: .74rem; border-radius: 6px;
    left: calc(2px + (100% - 4px) * var(--lane) / var(--lanes)); width: calc((100% - 4px) / var(--lanes) - 2px); }
  .cal-item.open .muted { display: none; }
  .cal-item.open.busy > * { visibility: hidden; }
  .cal-item.booked { z-index: 1; min-height: 3.2rem; }
  .cal-item.booked .when { display: block; font-size: .7rem; }
  .cal-item.booked strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cal-item.booked .muted { font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cal-item.ward-event .when, .cal-item.ward-event strong { display: block; }
  .cal-item.ward-event .muted { display: none; }
}

/* A red dot on a tab with something new in it (unread messages) */
.tab-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--bg); }
.tabbar a { position: relative; }
.tabbar .tab-dot { position: absolute; top: 9px; left: calc(50% + 7px); }
.side-tabs .tab-dot { margin-left: auto; box-shadow: none; }

/* Map pins: people kept on the map across searches, numbered */
.pins { margin: 0 0 .75rem; padding-left: 1.4rem; }
.pins li { padding: .25rem 0; }
.pins li a.remove { float: right; margin-left: .5rem; }
.pick-list li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.pin-num { display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: #fff; font: 600 13px/1 system-ui, sans-serif;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }

/* App users: roles read as badges; the checkboxes open on "Change role" */
.role-list .badge { margin: 0 .25rem .25rem 0; }
.role-edit { margin-top: .35rem; }
.role-edit summary { cursor: pointer; font-size: .9rem; color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.role-edit form { margin-top: .5rem; }
