/* One plain, careful look. How an occasion's page looks, and how much of that a
   couple chooses, is a topic of its own (docs/open-questions.md, "Look and
   media").

   fest's brand is the bunting (tools/brand.py draws it): colour lives only in
   its three pennants, the interface is in ink. So the accent is the ink, in
   both schemes; the pennant tokens and the colours in tools/brand.py are one
   decision. */

:root {
  --paper: #faf8f5;
  --surface: #ffffff;
  --ink: #23201c;
  --ink-soft: #6b645b;
  --line: #e4ded5;
  --accent: var(--ink);
  --accent-ink: var(--paper);
  --pennant-1: #b23a62;
  --pennant-2: #d99a2b;
  --pennant-3: #3d5a80;
  --alert: #9a2f22;
  --tint: #f1e6da;
  --ok: #3d6b45;
  --ok-soft: #e3efe3;
  --warn: #7f5300;
  --warn-soft: #f7ecd2;
  --new: #2f5a8a;
  --new-soft: #e1eaf5;
  --band: #efe7dc;
  --radius: 14px;
  --measure: 34rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171512;
    --surface: #201d19;
    --ink: #f1ece4;
    --ink-soft: #a89f92;
    --line: #36312a;
    --pennant-1: #e0789b;
    --pennant-2: #f0bd45;
    --pennant-3: #86a6cf;
    --alert: #e58c7d;
    --tint: #33291f;
    --ok: #8cc394;
    --ok-soft: #1f2e21;
    --warn: #e0b25c;
    --warn-soft: #33281a;
    --new: #8fb5e0;
    --new-soft: #1c2735;
    --band: #2d2822;
  }
}

[hidden] {
  display: none !important;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.55;
}

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

.masthead {
  padding: 1.25rem 1rem 0;
  max-width: var(--measure);
  margin: 0 auto;
}

/* The lockup (templates/_brand.svg): line and word in the text colour, the
   pennants in theirs. Sized by its height; the width follows. */
.brand {
  display: inline-block;
  color: var(--ink);
  line-height: 0;
  border-radius: 4px;
}

.brand-lockup {
  display: block;
  width: auto;
  height: 1.6rem;
}

.brand-lockup .pennant-1 {
  fill: var(--pennant-1);
  stroke: var(--pennant-1);
}

.brand-lockup .pennant-2 {
  fill: var(--pennant-2);
  stroke: var(--pennant-2);
}

.brand-lockup .pennant-3 {
  fill: var(--pennant-3);
  stroke: var(--pennant-3);
}

/* On the start page the lockup is the heading. */
.start-brand {
  margin: 0 0 1.25rem;
  line-height: 0;
}

.start-brand .brand-lockup {
  height: 3.25rem;
}

main {
  padding: 2rem 1rem 3rem;
  max-width: var(--measure);
  margin: 0 auto;
}

/* Who makes fest, quietly at the foot of its own pages; not on the couple's
   page for its guests (templates/occasion.html). */
.colophon {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1rem 2rem;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.8rem;
}

.colophon a {
  color: var(--ink-soft);
  text-decoration: none;
}

.colophon a:hover,
.colophon a:focus-visible {
  color: var(--ink);
  text-decoration: underline;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
}

.card + .card {
  margin-top: 1rem;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.2;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

h2 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.kicker {
  margin: 0 0 0.5rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lead {
  margin: 0 0 1.5rem;
  color: var(--ink-soft);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.card > :last-child,
.card > form > :last-child {
  margin-bottom: 0;
}

.state {
  margin: 0 0 1rem;
}

.hint,
small {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.hint {
  margin: 0 0 1rem;
}

/* A note below a form keeps its distance from the form's button. */
.fields + .hint {
  margin-top: 1.75rem;
}

form {
  margin: 0;
}

/* -- The page everyone sees -- */

.announcement {
  padding: 1.5rem 0.5rem 0;
  text-align: center;
}

.announcement h1 {
  font-size: clamp(2.2rem, 9vw, 3.4rem);
  margin-bottom: 1rem;
}

.announcement .lead {
  white-space: pre-line;
}

.parts {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
}

.part {
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
}

.part:last-child {
  border-bottom: 1px solid var(--line);
}

.part h2 {
  margin-bottom: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.part .day {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.3;
  text-wrap: balance;
}

.part .detail {
  margin: 0.35rem 0 0;
  overflow-wrap: anywhere;
}

.part .note {
  margin: 0.75rem 0 0;
  color: var(--ink-soft);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.separator {
  margin: 0 0.35em;
  color: var(--ink-soft);
}

.is-open {
  color: var(--ink-soft);
  font-style: italic;
}

/* What kind of page this is, said once and kindly: set apart, not alarming. */
.notice {
  margin: 2rem auto 0;
  max-width: 28rem;
  padding: 1rem 1.25rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-wrap: pretty;
}

.more {
  margin: 1.5rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* Leaving one's details: below the dates, set apart as an offer. */
.join {
  margin: 2.5rem auto 0;
  max-width: 28rem;
  text-align: center;
  text-wrap: pretty;
}

.join .actions {
  justify-content: center;
}

.details .field > strong {
  font-weight: 500;
}

.details .saved {
  margin-bottom: 0.75rem;
  color: var(--ink);
  font-weight: 500;
}

.aside {
  margin: 2rem 0 0;
  text-align: center;
  font-size: 0.9rem;
}

/* -- Lists in the couple's area -- */

.rows,
.changes,
.plain,
.errors {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.change-detail {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* Words that would go out as they are: kept apart from the labels around them. */
.change-detail.quoted {
  margin-top: 0.25rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--line);
  white-space: pre-line;
}

.changes li + li {
  margin-top: 0.75rem;
}

.change-detail {
  margin-left: 1.75rem;
}

.check {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.check input {
  flex: none;
  inline-size: 1.1rem;
  block-size: 1.1rem;
  accent-color: var(--accent);
}

.errors {
  color: var(--alert);
}

/* -- Forms -- */

.fields {
  display: grid;
  gap: 1.1rem;
}

.fields > .hint {
  margin: 0;
}

/* A button is as wide as its words, not as wide as the form. */
.fields > .button {
  justify-self: start;
}

.field,
.field label {
  display: grid;
  gap: 0.3rem;
}

.field.pair {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.6rem;
}

input[type="text"],
input[type="tel"],
input[type="date"],
input[type="time"],
select,
textarea {
  inline-size: 100%;
  min-block-size: 2.6rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

select {
  inline-size: auto;
}

textarea {
  resize: vertical;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.button {
  display: inline-block;
  padding: 0.6rem 1.15rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.button.quiet {
  background: transparent;
  color: var(--accent);
}

.button.small {
  flex: none;
  padding: 0.3rem 0.8rem;
  font-size: 0.9rem;
}

.button.danger {
  border-color: var(--alert);
  color: var(--alert);
}

.button:focus-visible,
.brand:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* -- The budget -- */

h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.figure {
  margin: 0 0 1.25rem;
  font-size: 1.75rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.soft {
  color: var(--ink-soft);
}

.sums {
  margin: 0 0 1rem;
}

.sums > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--line);
}

.sums > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.sums dt {
  color: var(--ink-soft);
}

.sums dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* The moment someone has to decide: stated plainly, set apart, no alarm. */
.decision {
  padding: 1rem 1.25rem;
  border: 1px solid var(--alert);
  border-radius: var(--radius);
}

.decision p {
  margin: 0 0 0.5rem;
}

.decision .decision-fact {
  color: var(--alert);
  font-size: 1.15rem;
}

.decision > :last-child {
  margin-bottom: 0;
}

.is-short {
  color: var(--alert);
}

.is-tight {
  font-style: italic;
}

.history li + li {
  margin-top: 0.5rem;
}

.category {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.category > .row {
  border-top: 0;
  padding: 0 0 0.5rem;
}

.category .items {
  margin: 0 0 0.5rem 0;
  padding-left: 0.9rem;
  border-left: 2px solid var(--line);
}

.category .items .row:first-child {
  padding-top: 0.75rem;
}

.category-action {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
}

.row-detail.quoted {
  margin-top: 0.25rem;
  white-space: pre-line;
}

.field.pair.even {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

select.wide {
  inline-size: 100%;
}

/* -- The programme as a tree -- */

/* On the page everyone sees: what refines a day, below the day. */
.below {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
}

.below li + li {
  margin-top: 0.7rem;
}

.below-title,
.below-detail {
  margin: 0;
  overflow-wrap: anywhere;
}

.below-detail {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.below .note {
  margin-top: 0.25rem;
  font-size: 0.95rem;
}

.below .below {
  margin-top: 0.4rem;
  font-size: 0.95rem;
}

.below .below li + li {
  margin-top: 0.3rem;
}

.below .below .below-title {
  color: var(--ink-soft);
}

/* In the couple's area: days, and indented below each what refines it. */
.tree {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.tree > li + li {
  border-top: 1px solid var(--line);
}

.tree .row {
  border-top: 0;
  padding: 0.75rem 0;
}

.tree .tree {
  margin: 0 0 0.5rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--line);
}

.tree .tree .row {
  padding: 0.5rem 0;
}

.tree-action {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.row-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.35rem;
}

.button.arrow {
  padding: 0.3rem 0.6rem;
}

/* A change to a part below a day, in the review: as far in as the part is. */
.changes .level-1 {
  margin-left: 1.25rem;
}

.changes .level-2 {
  margin-left: 2.5rem;
}

.changes .level-3 {
  margin-left: 3.75rem;
}

.changes .level-4 {
  margin-left: 5rem;
}

/* What a change replaces. */
.change-detail.was {
  font-style: italic;
}

/* What is stored now, when someone else saved while a form was open. */
.stored {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stored p {
  margin: 0;
  overflow-wrap: anywhere;
}

.stored .quoted {
  margin-top: 0.25rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--line);
  color: var(--ink-soft);
  white-space: pre-line;
}

/* -- The couple's wide pages: the programme and the guest list, a bar on top
   and a panel on request (the planning surface's section at the end). -- */

main.wide {
  max-width: 96rem;
  padding-top: 1.25rem;
}

body:has(main.wide) .masthead,
body:has(main.wide) .colophon {
  max-width: 96rem;
}

.planbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 2rem;
  margin: 0 0 1.25rem;
}

.planbar-title {
  min-width: 0;
  margin-right: auto;
}

.planbar h1 {
  margin: 0;
}

.planbar-sums {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.planbar-sums b {
  font-weight: 600;
}

.planbar-actions {
  margin: 0;
}

.count {
  display: inline-block;
  min-inline-size: 1.5em;
  margin-left: 0.35rem;
  padding: 0 0.4em;
  border-radius: 999px;
  background: var(--accent-ink);
  color: var(--accent);
  font-size: 0.85rem;
  text-align: center;
}

.state {
  display: inline-block;
  margin: 0;
  padding: 0.05rem 0.45rem;
  border-radius: 6px;
  font-size: 0.8rem;
  white-space: nowrap;
}

/* What is out is the usual case: said quietly, so that what waits stands out. */
.state.is-out {
  padding-inline: 0;
  color: var(--ink-soft);
}

.state.is-new {
  background: var(--new-soft);
  color: var(--new);
}

.state.is-changed,
.state.is-moved {
  background: var(--warn-soft);
  color: var(--warn);
}

.money-note {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
}

.is-tight {
  color: var(--warn);
}

.surface-actions {
  margin: 0.75rem 0 0;
}

.panel {
  min-width: 0;
  padding: 1.5rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  scroll-margin-top: 1rem;
}

.panel h2 {
  font-size: 1.4rem;
}

.panel > :last-child {
  margin-bottom: 0;
}

.panel-actions {
  margin-top: 1rem;
}

.panel-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.panel-section h3:first-child {
  margin-top: 0;
}

.panel-summary {
  margin: 0 0 0.5rem;
}

.panel .quoted {
  padding-left: 0.75rem;
  border-left: 2px solid var(--line);
  color: var(--ink-soft);
  white-space: pre-line;
}

/* -- The couple's area: the programme and the guest list as two tabs -- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.1rem;
  margin: 0 0 0.35rem;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tabs a {
  padding-block: 0.15rem;
  border-bottom: 2px solid transparent;
  color: var(--ink-soft);
  text-decoration: none;
}

.tabs a:hover,
.tabs a:focus-visible {
  color: var(--accent);
}

.tabs a[aria-current="page"] {
  border-bottom-color: var(--accent);
  color: var(--ink);
}

/* -- The guest list: what the list shows -- */

/* Below the bar the same distance as the programme's toolbar keeps. */
.filters {
  margin: 0.75rem 0;
}

.filter-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.45rem;
}

.filter-label {
  margin-right: 0.2rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.chip {
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}

.chip:hover,
.chip:focus-visible {
  border-color: var(--accent);
}

.chip.active {
  border-color: var(--accent);
  background: var(--tint);
}

.chip .num {
  margin-left: 0.2rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.missing {
  color: var(--warn);
  font-size: 0.85rem;
}

/* A person: first and last name side by side, the mobile number below them
   at full width, so that a whole number stays readable in a narrow panel. */
.name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.4rem;
}

.name-row input[type="tel"] {
  grid-column: 1 / -1;
}

/* A postal address: street and number, postcode and town, side by side. */
.address {
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.address legend {
  margin-bottom: 0.3rem;
  padding: 0;
}

/* The country list is as wide as the form: a select is otherwise as wide as
   its longest name, which pushes a phone's page sideways. */
.address select {
  inline-size: 100%;
  min-inline-size: 0;
}

.address label {
  min-inline-size: 0;
}

.address-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(4.5rem, 7rem);
  gap: 0.4rem;
}

.address-row.is-place {
  grid-template-columns: minmax(4.5rem, 7rem) minmax(0, 1fr);
}

/* Whole addresses proposed while the street is typed (static/forms.js). */
.address-proposals {
  display: grid;
  gap: 0.1rem;
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.address-proposals button {
  inline-size: 100%;
  padding: 0.45rem 0.6rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.address-proposals button:hover,
.address-proposals button:focus-visible {
  background: var(--tint);
  outline: none;
}

/* What the official directories do not confirm: a warning, not an error. */
.address-findings {
  margin: 0;
  padding: 0.6rem 0.8rem;
  list-style: none;
  border-radius: 6px;
  background: var(--warn-soft);
  color: var(--warn);
}

.address-findings li + li {
  margin-top: 0.3rem;
}

/* The envelope as it will be printed, drawn like one. */
.envelope {
  margin: 0 0 1.25rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

.envelope figcaption {
  margin-bottom: 0.4rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.envelope p {
  margin: 0;
}

.envelope .line {
  display: block;
  overflow-wrap: anywhere;
}

.replaced s {
  color: var(--ink-soft);
}

.tag {
  display: inline-block;
  margin: 0 0.25rem 0.2rem 0;
  padding: 0 0.45rem;
  border-radius: 6px;
  background: var(--new-soft);
  color: var(--new);
  font-size: 0.8rem;
  white-space: nowrap;
}

/* A household's persons, each with side and circles, in the panel. */
.persons-edit {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.persons-edit legend,
.choices legend {
  margin-bottom: 0.3rem;
  padding: 0;
}

.choices {
  margin: 0;
  padding: 0;
  border: 0;
}

.person-edit {
  display: grid;
  gap: 0.45rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.person-edit.new {
  border-style: dashed;
}

/* Rows that grow: «+ Weitere Person» adds one (static/forms.js). */
.rows {
  display: grid;
  gap: 0.75rem;
}

.add-row {
  justify-self: start;
}

/* Inside the new persons of a household the rows need no box of their own. */
.person-edit.new .rows .person-edit.new {
  padding: 0;
  border: 0;
}

/* Where the post goes when an Adresszusatz is given. */
.envelope.delivery {
  margin: 0;
}

.ticks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
}

.tick,
.field label.tick {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.95rem;
}

.tick input {
  inline-size: 1.1rem;
  block-size: 1.1rem;
  margin: 0;
  accent-color: var(--accent);
}

.circle-list li + li {
  margin-top: 0.3rem;
}

/* -- Who sees a part and who is invited: a column of the planning surface -- */

.seen-by {
  display: inline-block;
  padding: 0 0.45rem;
  border-radius: 6px;
  background: var(--ok-soft);
  color: var(--ok);
  white-space: nowrap;
}

.seen-by.is-planning {
  background: var(--line);
  color: var(--ink-soft);
}

.seen-by.is-invited {
  background: var(--new-soft);
  color: var(--new);
}

/* What a part follows from the part above: said quietly. */
.seen-by.follows,
.tag.follows {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
}

.state.is-planning {
  background: var(--line);
  color: var(--ink-soft);
}

.ticks.stacked {
  flex-direction: column;
  align-items: flex-start;
}

.tick.disabled {
  color: var(--ink-soft);
  opacity: 0.6;
}

/* -- The planning surface (fest.web.surface): the days as cards in the order of
   their dates, the programme as rows on one grid of columns, the items as lines
   below their part, a value written where it stands. Made for a desktop and an
   iPad held either way; a phone gets the rows stacked. With the page's script
   (static/plan.js) the bar and a day's band stay in view while scrolling, and
   the surface folds; without it every row is open. -- */

.plan .planbar {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0;
  padding: 0.5rem 0 0.6rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.plan .planbar-sums a {
  color: inherit;
  text-decoration: none;
}

.plan .planbar-sums a:hover,
.plan .planbar-sums a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.plan .planbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.cell-status {
  flex-basis: 100%;
  margin: 0;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 0.9rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: 0.75rem 0;
}

.levels {
  display: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.has-script .levels {
  display: inline-flex;
}

.levels button {
  border: 0;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
}

.levels button + button {
  border-left: 1px solid var(--line);
}

.levels button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

/* One grid of columns for every row: the title, when, where, who, published,
   planned, the frame. An item's line uses the same columns for its title,
   number, price, where it is bought, bought, amount. */
.programme {
  container: programme / inline-size;
  display: grid;
  gap: 0.75rem;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.95rem;
  line-height: 1.4;
}

.programme .row {
  display: grid;
  grid-template-columns:
    minmax(0, 2.5fr) minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1.5fr)
    minmax(0, 0.95fr) minmax(0, 1fr) minmax(0, 0.8fr);
  column-gap: 0.5rem;
  align-items: start;
  justify-content: stretch;
  padding: 0.3rem 0.6rem;
  border-top: 1px solid var(--line);
}

.programme .row:first-child {
  padding-top: 0.3rem;
}

.programme .c {
  min-width: 0;
}

.programme .c-planned,
.programme .c-frame {
  text-align: right;
}

.programme .head,
.programme .item-head {
  border-top: 0;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.programme .head {
  padding-block: 0 0.1rem;
}

.programme .head .c,
.programme .item-head .c {
  padding-inline: 0.35rem;
}

.programme .head .c-title {
  padding-left: 0.35rem;
}

.has-script .programme .head .c-title {
  padding-left: 2.35rem;
}

/* A day, and the occasion as a whole: a card each; its band says what the day
   is, also when the day is closed. */
.card-day {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.card-day > .row:first-child {
  border-top: 0;
}

.programme .band {
  padding-block: 0.6rem;
  border-radius: 11px 11px 0 0;
  background: var(--band);
}

.has-script .programme .band {
  position: sticky;
  top: var(--bar-height, 0px);
  z-index: 3;
  cursor: pointer;
}

.has-script .card-day:not(.is-unfolded) .band {
  border-radius: 11px;
}

.programme .c-title {
  display: flex;
  align-items: flex-start;
  gap: 0.15rem;
}

.title-wrap,
.band-text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.band-date {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.weekday {
  padding-left: 0.4rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.band-date .cell input[name="value"] {
  font-weight: 650;
}

/* A day's own small actions stand on its date line: the title below keeps the
   width of the column. */
.band-acts {
  display: flex;
  flex: none;
  margin-left: auto;
}

.band-title,
.band-title input[name="value"] {
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  line-height: 1.25;
}

span.band-title {
  padding: 0.25rem 0.4rem;
}

.programme .summary {
  padding: 0 0.4rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.has-script .card-day.is-unfolded .summary {
  display: none;
}

/* A part below a day: as far in as it is refined. */
.programme .lvl-1 > .c-title,
.programme .lvl-1 .item > .c-title,
.programme .items.lvl-1 .c-title {
  padding-left: 1.1rem;
}

.programme .lvl-2 > .c-title,
.programme .items.lvl-2 .c-title {
  padding-left: 2.2rem;
}

.programme .lvl-3 > .c-title,
.programme .items.lvl-3 .c-title {
  padding-left: 3.3rem;
}

.programme .lvl-4 > .c-title,
.programme .items.lvl-4 .c-title {
  padding-left: 4.4rem;
}

.programme .items.lvl-5 .c-title {
  padding-left: 5.5rem;
}

.programme .row.is-selected {
  background: var(--tint);
}

.fold,
.fold-space {
  display: none;
  flex: none;
  inline-size: 2rem;
  block-size: 2rem;
}

.has-script .fold {
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink-soft);
  font-size: 0.9rem;
  cursor: pointer;
}

.has-script .fold-space {
  display: inline-block;
}

.fold:hover,
.fold:focus-visible {
  background: var(--paper);
  color: var(--ink);
}

.row-more {
  display: inline-grid;
  flex: none;
  place-items: center;
  inline-size: 2rem;
  block-size: 2rem;
  border-radius: 6px;
  color: var(--ink-soft);
  text-decoration: none;
}

.row-more:hover,
.row-more:focus-visible {
  background: var(--paper);
  color: var(--accent);
}

/* A cell: what it holds, as plain text until it is written in. */
.cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.4rem;
  margin: 0;
}

.cell input[name="value"] {
  flex: 1 1 5rem;
  min-width: 0;
  inline-size: 100%;
  min-block-size: 2rem;
  padding: 0.2rem 0.4rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-overflow: ellipsis;
}

.cell input[name="value"]:hover {
  border-color: var(--line);
}

.cell input[name="value"]:focus {
  border-color: var(--accent);
  outline: none;
  background: var(--surface);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent);
}

.cell input[name="value"]::placeholder {
  color: var(--ink-soft);
  font-style: italic;
  opacity: 1;
}

/* Provisional: italic, as in the sketch; fixed stands upright. */
.cell.is-provisional input[name="value"],
.cell-text.is-provisional {
  font-style: italic;
}

.c-planned .cell input[name="value"],
.c-frame .cell input[name="value"] {
  text-align: right;
}

.cell-new input[name="value"]::placeholder {
  color: var(--accent);
  font-style: normal;
}

.cell-text {
  display: block;
  padding: 0.2rem 0.4rem;
}

/* «fix» and «pro Person» show while the cell is written in; «pro Person» also
   while it holds. */
.tick-fix,
.tick-per {
  display: none;
  align-items: center;
  gap: 0.25rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
  white-space: nowrap;
}

.cell:focus-within .tick-fix,
.cell:focus-within .tick-per,
.cell.has-error .tick-fix,
.tick-per.is-on {
  display: inline-flex;
}

.cell.has-error input[name="value"] {
  border-color: var(--alert);
}

.cell-error {
  flex-basis: 100%;
  margin: 0.15rem 0 0.25rem;
  padding-inline: 0.4rem;
  color: var(--alert);
  font-size: 0.8rem;
}

.cell.is-saving {
  opacity: 0.6;
}

.programme .who {
  display: block;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  color: inherit;
  font-size: 0.85rem;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.programme .who:hover,
.programme .who:focus-visible {
  background: var(--paper);
}

.programme .row:not(.head) > .c-state {
  padding-top: 0.3rem;
  font-size: 0.85rem;
}

.programme .was {
  display: block;
  margin-top: 0.2rem;
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-style: italic;
}

.programme .money {
  display: block;
  padding: 0.25rem 0.4rem 0;
  font-variant-numeric: tabular-nums;
}

.money.is-short {
  color: var(--alert);
  font-weight: 600;
}

.money.is-tight {
  color: var(--warn);
  font-weight: 600;
}

.programme .money-note {
  display: block;
  margin: 0.1rem 0 0;
  padding-inline: 0.4rem;
  font-size: 0.75rem;
}

.money-note.is-short {
  color: var(--alert);
}

.items-toggle {
  display: none;
  margin-top: 0.1rem;
  padding: 0.15rem 0.4rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.has-script .items-toggle {
  display: inline-block;
}

.items-toggle:hover,
.items-toggle:focus-visible {
  background: var(--paper);
}

/* Items: lines below their part, smaller, on a tint. */
.items {
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 70%, var(--surface));
}

.programme .items .row {
  border-top: 1px dashed var(--line);
  padding-block: 0.1rem;
  font-size: 0.9rem;
}

.programme .items .item-head {
  border-top: 0;
  padding-block: 0.35rem 0;
  font-size: 0.64rem;
}

.programme .items .c-title {
  padding-left: 0.35rem;
}

.has-script .programme .items .c-title {
  margin-left: 2.15rem;
}

.bought {
  display: inline-block;
  padding-top: 0.1rem;
  color: var(--ok);
  font-size: 0.8rem;
}

.programme .add .cell {
  flex: 1;
}

.sub-narrow {
  display: none;
}

/* Fingers on a tablet: everything one taps is at least 44 pixels. */
@media (pointer: coarse) {
  .cell input[name="value"] {
    min-block-size: 2.75rem;
  }

  .has-script .fold,
  .fold-space,
  .row-more {
    inline-size: 2.75rem;
    block-size: 2.75rem;
  }

  .items-toggle {
    min-block-size: 2.75rem;
  }

  .levels button {
    padding-block: 0.65rem;
  }

  .tick-fix input,
  .tick-per input {
    inline-size: 1.4rem;
    block-size: 1.4rem;
  }
}

/* An iPad held upright: who and the publication move under the title. */
@container programme (max-width: 1000px) {
  .programme .row {
    grid-template-columns:
      minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 0.8fr);
  }

  .programme .items .row {
    grid-template-columns:
      minmax(0, 2fr) minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 0.9fr) 2.75rem;
  }

  .programme .part > .c-who,
  .programme .part > .c-state,
  .programme .band > .c-who,
  .programme .band > .c-state,
  .programme .head > .c-who,
  .programme .head > .c-state,
  .programme .items .c-state {
    display: none;
  }

  .sub-narrow {
    display: block;
    padding: 0 0.4rem 0.2rem;
    font-size: 0.8rem;
  }

  .sub-narrow .who {
    display: inline;
    padding: 0;
    font-size: inherit;
  }
}

/* A phone: the rows stack. Planning is made for a tablet or a desktop. */
@container programme (max-width: 640px) {
  .programme .row,
  .programme .items .row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .programme .row > .c-title {
    grid-column: 1 / -1;
  }

  .programme .head,
  .programme .item-head {
    display: none;
  }

  .programme .c-planned,
  .programme .c-frame {
    text-align: left;
  }
}

/* The panel: from the right, for what is no cell. It never covers the whole
   page: the row it works on stays in view, and with room enough the surface
   moves aside for it. */
.plan .panel {
  --drawer: min(100vw, clamp(22rem, 34vw, 34rem));
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  inline-size: var(--drawer);
  max-block-size: none;
  overflow-y: auto;
  padding: 1rem 1.25rem 3rem;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  box-shadow: -12px 0 32px rgba(35, 32, 28, 0.12);
}

.panel-close {
  float: right;
  display: inline-grid;
  place-items: center;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  margin: -0.25rem -0.5rem 0 0.5rem;
  border-radius: 8px;
  color: var(--ink-soft);
  text-decoration: none;
}

.panel-close:hover,
.panel-close:focus-visible {
  background: var(--paper);
  color: var(--ink);
}

@media (min-width: 1200px) {
  body:has(.plan.with-panel) main.wide {
    max-width: none;
    padding-right: calc(min(100vw, clamp(22rem, 34vw, 34rem)) + 1.5rem);
  }
}

.programme .c-source {
  display: flex;
  align-items: flex-start;
}

.programme .c-source .cell {
  flex: 1;
  min-width: 0;
}

.shop-link {
  display: inline-grid;
  flex: none;
  place-items: center;
  inline-size: 2rem;
  block-size: 2rem;
  border-radius: 6px;
  color: var(--accent);
  text-decoration: none;
}

.shop-link:hover,
.shop-link:focus-visible {
  background: var(--paper);
}

@media (pointer: coarse) {
  .shop-link {
    inline-size: 2.75rem;
    block-size: 2.75rem;
  }
}

/* A popover at its row: «Wer», a part's note, the target (fest.web.surface).
   Small, beside what it belongs to, never over the whole page; the script puts
   it at the button that opened it, the browser in the middle without one. */
.pop {
  inline-size: min(22rem, calc(100vw - 2rem));
  max-block-size: min(34rem, calc(100dvh - 2rem));
  overflow: auto;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 12px 32px rgb(0 0 0 / 18%);
}

.pop.is-placed {
  position: fixed;
  inset: auto;
  margin: 0;
}

.pop-form {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.pop .choices {
  margin: 0;
}

.pop textarea,
.pop input[type="text"] {
  inline-size: 100%;
}

.pop .cell-error {
  margin: 0;
  padding-inline: 0;
}

.pop-actions {
  display: flex;
  justify-content: flex-end;
  margin: 0;
}

/* Without the script a popover that came back unsaved stands open in the page,
   where its row is. */
html:not(.has-script) .pop.has-error {
  display: block;
  position: static;
  margin: 0.5rem 0;
  box-shadow: none;
}

/* What opens a popover reads as what it holds, not as a button. */
button.who,
button.note-line,
button.note-add,
button.target-link {
  appearance: none;
  margin: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.programme button.who {
  inline-size: 100%;
}

button.target-link {
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.note-line {
  display: block;
  max-inline-size: 100%;
  padding: 0 0.4rem 0.15rem;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.note-line:hover,
button.note-line:focus-visible {
  color: var(--ink);
}

button.note-add {
  display: inline-grid;
  flex: none;
  place-items: center;
  inline-size: 2rem;
  block-size: 2rem;
  border-radius: 6px;
  color: var(--ink-soft);
}

button.note-add:hover,
button.note-add:focus-visible {
  background: var(--paper);
  color: var(--accent);
}

@media (hover: hover) {
  button.note-add {
    opacity: 0;
  }

  .row:hover button.note-add,
  .row:focus-within button.note-add,
  button.note-add:focus-visible {
    opacity: 1;
  }
}

@media (pointer: coarse) {
  button.note-add {
    inline-size: 2.75rem;
    block-size: 2.75rem;
  }

  .pop .tick input {
    inline-size: 1.4rem;
    block-size: 1.4rem;
  }
}

/* A browser without popovers (static/plan.js says so): they stay closed. */
.no-popover .pop {
  display: none;
}

/* -- The guest list on the planning surface's design (fest.web.guest_list): the
   households as cards, a band each that says what goes on the envelope and
   where the card goes, the persons below as rows on one grid of columns, their
   values written in cells. Made for a desktop and an iPad held either way; a
   phone gets each person on two lines. -- */

.guests {
  container: guests / inline-size;
  display: grid;
  gap: 0.75rem;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.95rem;
  line-height: 1.4;
}

.guests .row {
  display: grid;
  grid-template-columns:
    minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, 0.8fr)
    minmax(0, 1.5fr) 2rem;
  column-gap: 0.5rem;
  align-items: start;
  padding: 0.3rem 0.6rem;
  border-top: 1px solid var(--line);
}

.guests .c {
  min-width: 0;
}

.guests .head {
  border-top: 0;
  padding-block: 0 0.1rem;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guests .head .c {
  padding-inline: 0.4rem;
}

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

.card-household > .row:first-child {
  border-top: 0;
}

.guests .band {
  padding-block: 0.55rem;
  border-radius: 11px 11px 0 0;
  background: var(--band);
}

.card-household:has(> .row:only-child) .band {
  border-radius: 11px;
}

.card-household.is-selected .band {
  box-shadow: inset 3px 0 0 var(--accent);
}

.guests .band > .c-envelope {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.1rem 0.75rem;
  grid-column: 1 / -1;
  padding-inline: 0.4rem;
}

.household-name {
  color: var(--ink);
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  line-height: 1.25;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.household-name:hover,
.household-name:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.guests .summary {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.guests .band .note-line {
  flex-basis: 100%;
  padding: 0;
}

.guests .row.is-selected,
.guests .row.is-highlight {
  background: var(--tint);
}

.guests .c-first {
  display: grid;
}

.account {
  padding: 0 0.4rem;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.guests .cell select[name="value"],
.tasks .cell select[name="value"] {
  inline-size: 100%;
  min-block-size: 2rem;
  padding: 0.2rem 0.3rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
}

.guests .cell select[name="value"]:hover,
.tasks .cell select[name="value"]:hover {
  border-color: var(--line);
}

.guests .cell select[name="value"]:focus,
.tasks .cell select[name="value"]:focus {
  border-color: var(--accent);
  outline: none;
  background: var(--surface);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent);
}

/* A choice saves when it is made; without the script its button saves it. */
.has-script .cell-go {
  display: none;
}

.tel {
  white-space: nowrap;
}

button.circles-of {
  appearance: none;
  inline-size: 100%;
  margin: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.circles-of {
  display: block;
  min-block-size: 2rem;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

button.circles-of:hover,
button.circles-of:focus-visible {
  background: var(--paper);
}

.guests .add .c-new {
  grid-column: 1 / 3;
}

.guests .add .cell {
  flex: 1;
}

@media (pointer: coarse) {
  .guests .row {
    grid-template-columns:
      minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, 0.8fr)
      minmax(0, 1.5fr) 2.75rem;
  }

  .guests .cell select[name="value"],
  .tasks .cell select[name="value"],
  .circles-of {
    min-block-size: 2.75rem;
  }
}

/* A phone: a person on two lines, the names above, the rest below. */
@container guests (max-width: 640px) {
  .guests .row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 2.75rem;
  }

  .guests .person > .c-mobile,
  .guests .person > .c-side {
    grid-row: 2;
  }

  .guests .person > .c-circles {
    grid-row: 3;
    grid-column: 1 / -1;
  }

  .guests .person > .c-more {
    grid-row: 1;
    grid-column: 3;
  }

  .guests .head {
    display: none;
  }

  .guests .add .c-new {
    grid-column: 1 / -1;
  }
}

/* -- The shopping list on the same design (fest.web.shopping_list): each shop
   a card with a band, the things to buy in it as rows on one grid of columns,
   what is bought in a card of its own below. Made for a phone in the shop as
   much as for a desktop: on a phone a thing takes two lines. -- */

.shopping {
  container: shopping / inline-size;
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.95rem;
  line-height: 1.4;
}

.shopping > .hint {
  margin: 0;
}

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

.shopping .band {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.1rem 0.75rem;
  padding: 0.55rem 1rem;
  border-radius: 11px 11px 0 0;
  background: var(--band);
}

.shopping .band h2 {
  margin: 0;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 1.15rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.shopping .summary {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.shopping .lines {
  margin: 0;
  padding: 0;
  list-style: none;
}

.shopping .lines > .row {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 3fr) minmax(0, 2fr) 2.75rem 11rem;
  column-gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0.6rem;
  border-top: 1px solid var(--line);
}

.shopping .c {
  min-width: 0;
}

.shopping .c-qty {
  padding-left: 0.4rem;
}

.qty {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.shopping .c-what,
.shopping .c-amount {
  display: grid;
}

.row-title {
  overflow-wrap: anywhere;
}

.row-detail {
  color: var(--ink-soft);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.shopping .c-what .note-line {
  padding: 0;
}

.shopping .money {
  font-variant-numeric: tabular-nums;
}

.shopping .c-tick {
  justify-self: end;
}

.shopping .c-tick form {
  margin: 0;
}

/* What is bought stays readable, struck through. */
.shopping .is-bought .row-title {
  color: var(--ink-soft);
  text-decoration: line-through;
}

@media (pointer: coarse) {
  .shopping .c-tick .button {
    min-block-size: 2.75rem;
  }
}

/* A phone: the number, the thing and the tick on one line, what it costs and
   the shop's page below. */
@container shopping (max-width: 640px) {
  .shopping .lines > .row {
    grid-template-columns: 2.75rem minmax(0, 1fr) auto;
    row-gap: 0.15rem;
  }

  .shopping .c-tick {
    grid-row: 1;
    grid-column: 3;
  }

  .shopping .c-amount {
    grid-column: 2;
  }

  .shopping .c-link {
    grid-row: 2;
    grid-column: 3;
    justify-self: end;
  }

  .shopping .c-link:empty {
    display: none;
  }
}

/* -- The tasks on the same design (fest.web.tasks): the board, a column for
   each step of progress and a card for each task, its steps below it to tick;
   or the list by date, a card for each group and the tasks as rows. Made for
   a desktop and an iPad held either way; on a phone the columns follow one
   another. -- */

.task-surface {
  container: tasks / inline-size;
}

.tasks {
  margin-top: 0.75rem;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.95rem;
  line-height: 1.4;
}

.tasks .c {
  min-width: 0;
}

.planbar-actions.views {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tasks-state {
  margin: 1rem 0;
}

/* The board: four columns side by side, each on a quiet tint. */
/* The columns as tall as the tallest: each is a place to drop a card on. */
.tasks.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: stretch;
}

.column {
  display: grid;
  gap: 0.6rem;
  align-content: start;
  min-block-size: 8rem;
  padding: 0.5rem;
  border: 2px solid transparent;
  border-radius: 14px;
  background: color-mix(in srgb, var(--band) 45%, transparent);
}

/* The column a card taken by its grip is over. */
.column.is-target {
  border-color: var(--accent);
  border-style: dashed;
  background: var(--tint);
}

.column-head {
  margin: 0;
  padding: 0.1rem 0.35rem;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.column-head .num {
  margin-left: 0.25rem;
  font-variant-numeric: tabular-nums;
}

.add-task .cell {
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.tasks.by-date .add-task {
  max-inline-size: 30rem;
}

/* A task: its title on the band, who does it, by when and how far it is
   below, then its steps. */
.card-task {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.card-task.is-selected {
  box-shadow: 0 0 0 2px var(--accent);
}

.card-task > .band {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  padding: 0.3rem 0.3rem 0.2rem;
  border-radius: 11px 11px 0 0;
  background: var(--band);
}

.card-task > .band .cell input[name="value"] {
  font-weight: 600;
}

/* The note below the title: one quiet line; the whole of it in its popover. */
.card-task > .band .note-line {
  grid-column: 2 / -1;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.card-task > .band button.note-line:hover,
.card-task > .band button.note-line:focus-visible {
  color: var(--ink);
}

/* The grip: six dots on the band's left, the one place to take a card by. A
   finger on it moves the card, not the page. Shown only with the script. */
.grip {
  display: none;
  place-items: center;
  inline-size: 1.25rem;
  block-size: 2rem;
  border-radius: 6px;
  color: var(--ink-soft);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.has-script .grip {
  display: inline-grid;
}

.grip::before {
  content: "";
  inline-size: 8px;
  block-size: 14px;
  background: radial-gradient(circle, currentColor 1.3px, transparent 1.6px) 0 0 / 4px 4.67px;
}

.grip:hover {
  background: var(--paper);
  color: var(--ink);
}

/* The card while it is moved: above the board, beside the pointer. */
.card-task.is-lifted {
  position: relative;
  z-index: 20;
  box-shadow: 0 12px 28px rgba(35, 32, 28, 0.18);
  pointer-events: none;
}

.is-dragging,
.is-dragging * {
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
}

.card-task .band-acts {
  display: inline-flex;
  align-items: center;
}

@media (hover: hover) {
  .card-task:hover button.note-add,
  .card-task:focus-within button.note-add {
    opacity: 1;
  }
}

.card-task .facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.25rem;
  padding: 0.15rem 0.3rem;
}

.card-task .facts > .c {
  flex: 1 1 7.5rem;
}

.card-task.is-done > .band .cell input[name="value"],
.card-task.is-done > .band .cell-text {
  color: var(--ink-soft);
  text-decoration: line-through;
}

/* The steps: the tick and the title, whoever does it and by when below. */
.steps {
  margin: 0;
  padding: 0.15rem 0.3rem 0.3rem;
  border-top: 1px solid var(--line);
  list-style: none;
}

.steps > .row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) minmax(0, 1fr) 2rem;
  column-gap: 0.15rem;
  align-items: center;
}

.steps > .row + .row {
  margin-top: 0.15rem;
}

.steps .c-tick {
  grid-row: 1;
  grid-column: 1;
}

.steps .c-title {
  grid-row: 1;
  grid-column: 2 / 4;
}

.steps .c-more {
  grid-row: 1;
  grid-column: 4;
}

.steps .c-who {
  grid-row: 2;
  grid-column: 2;
}

.steps .c-due {
  grid-row: 2;
  grid-column: 3;
}

.steps .c-who,
.steps .c-due {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.steps > .row.add {
  display: block;
  padding-left: 2.15rem;
}

.step.is-selected {
  border-radius: 8px;
  background: var(--tint);
}

.step.is-done .c-title .cell input[name="value"],
.step.is-done .c-title .cell-text {
  color: var(--ink-soft);
  text-decoration: line-through;
}

/* A tick: the box alone, large enough for a finger. */
.cell-tick {
  justify-content: center;
}

.cell-tick input[type="checkbox"] {
  inline-size: 1.1rem;
  block-size: 1.1rem;
  margin: 0.45rem;
  accent-color: var(--ink);
}

/* A day that has passed with the work still to do. */
.cell.is-late input[name="value"] {
  color: var(--alert);
  font-weight: 600;
}

/* The list by date: a card for each group, the tasks and steps as rows. */
.tasks.by-date {
  display: grid;
  gap: 0.75rem;
}

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

.card-group > .band {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.1rem 0.75rem;
  padding: 0.55rem 1rem;
  border-radius: 11px 11px 0 0;
  background: var(--band);
}

.card-group > .band h2 {
  margin: 0;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 1.15rem;
  line-height: 1.25;
}

.card-group.is-overdue > .band h2 {
  color: var(--alert);
}

.card-group .summary {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.card-group .lines {
  margin: 0;
  padding: 0;
  list-style: none;
}

.card-group .lines > .row {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 3fr) minmax(0, 1.4fr) minmax(0, 1fr) 2rem;
  column-gap: 0.5rem;
  align-items: center;
  padding: 0.3rem 0.6rem;
  border-top: 1px solid var(--line);
}

.card-group .lines > .row.is-selected {
  background: var(--tint);
}

.card-group .c-title {
  display: grid;
}

.of-task {
  padding: 0 0.4rem;
}

@media (pointer: coarse) {
  .grip {
    inline-size: 2.25rem;
    block-size: 2.75rem;
  }

  .cell-tick input[type="checkbox"] {
    inline-size: 1.4rem;
    block-size: 1.4rem;
    margin: 0.65rem;
  }

  .steps > .row {
    grid-template-columns: 2.75rem minmax(0, 1fr) minmax(0, 1fr) 2.75rem;
  }

  .steps > .row.add {
    padding-left: 2.9rem;
  }

  .card-group .lines > .row {
    grid-template-columns: 2.75rem minmax(0, 3fr) minmax(0, 1.4fr) minmax(0, 1fr) 2.75rem;
  }
}

/* An iPad held upright, or the panel open beside the board: two columns. */
@container tasks (max-width: 1000px) {
  .tasks.board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* A phone: the columns one after another, a row of the list on two lines. */
@container tasks (max-width: 560px) {
  .tasks.board {
    grid-template-columns: minmax(0, 1fr);
  }

  .card-group .lines > .row {
    grid-template-columns: 2.75rem minmax(0, 1fr) minmax(0, 1fr) 2.75rem;
  }

  .card-group .lines > .row > .c-title {
    grid-row: 1;
    grid-column: 2 / 4;
  }

  .card-group .lines > .row > .c-more {
    grid-row: 1;
    grid-column: 4;
  }

  .card-group .lines > .row > .c-who {
    grid-row: 2;
    grid-column: 2;
  }

  .card-group .lines > .row > .c-due {
    grid-row: 2;
    grid-column: 3;
  }
}
