/*
 * SPDX-License-Identifier: EUPL-1.2
 * Copyright © 2026 Omar Venturi
 *
 * Ritmo: the first template of the portal. It gives the structure of the pages: the day of the
 * neighbourhood in one row per appointment, the next events, the space of the interests, the
 * agenda, the pages of contents and groups. The colours of the neighbourhood are not here: the
 * portal of each neighbourhood serves them as tokens of its own (/stile.css, linked before this
 * sheet), so that the same template takes the look of every neighbourhood. High contrast and the
 * simplified mode override the tokens, whatever the neighbourhood chose.
 * The phone first: base values are for the phone, wider screens only add room.
 */

/* ---------- Tokens of the structure; the colour of the neighbourhood comes from its sheet ---------- */

:root {
  --pt-paper: #f6f3ec;
  --pt-surface: #ffffff;
  --pt-ink: #1d1f22;
  --pt-muted: #545a62;
  --pt-rule: #ddd7cb;
  --pt-rule-strong: #8b8578;
  --pt-now: #0b6474;
  --pt-on-now: #ffffff;
  --pt-off: #9b2c2c;
  --pt-line: 2px;
  --pt-radius: 18px;
  --pt-size: 1.125rem;
  --pt-row: 44px;
}

:root[data-theme='dark'] {
  --pt-paper: #141619;
  --pt-surface: #1e2125;
  --pt-ink: #eef0f2;
  --pt-muted: #b9bec5;
  --pt-rule: #353a41;
  --pt-rule-strong: #8d949e;
  --pt-now: #6fd4e2;
  --pt-on-now: #141619;
  --pt-off: #ff8f8f;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --pt-paper: #141619;
    --pt-surface: #1e2125;
    --pt-ink: #eef0f2;
    --pt-muted: #b9bec5;
    --pt-rule: #353a41;
    --pt-rule-strong: #8d949e;
    --pt-now: #6fd4e2;
    --pt-on-now: #141619;
    --pt-off: #ff8f8f;
  }
}

/* High contrast: black on white or white on black, full borders; the colour of the neighbourhood
   gives way to a dark or light one that always reads. */
:root[data-contrast='high'] {
  --pt-paper: #ffffff;
  --pt-surface: #ffffff;
  --pt-ink: #000000;
  --pt-muted: #000000;
  --pt-rule: #000000;
  --pt-rule-strong: #000000;
  --pt-accent: #7a2408;
  --pt-on-accent: #ffffff;
  --pt-accent-soft: #ffffff;
  --pt-now: #00424d;
  --pt-off: #7a0000;
  --pt-line: 3px;
}

:root[data-contrast='high'][data-theme='dark'] {
  --pt-paper: #000000;
  --pt-surface: #000000;
  --pt-ink: #ffffff;
  --pt-muted: #ffffff;
  --pt-rule: #ffffff;
  --pt-rule-strong: #ffffff;
  --pt-accent: #ffc2ad;
  --pt-on-accent: #000000;
  --pt-accent-soft: #000000;
  --pt-now: #9ef0fb;
  --pt-on-now: #000000;
  --pt-off: #ffb3b3;
}

@media (prefers-color-scheme: dark) {
  :root[data-contrast='high']:not([data-theme='light']) {
    --pt-paper: #000000;
    --pt-surface: #000000;
    --pt-ink: #ffffff;
    --pt-muted: #ffffff;
    --pt-rule: #ffffff;
    --pt-rule-strong: #ffffff;
    --pt-accent: #ffc2ad;
    --pt-on-accent: #000000;
    --pt-accent-soft: #000000;
    --pt-now: #9ef0fb;
    --pt-on-now: #000000;
    --pt-off: #ffb3b3;
  }
}

/* The simplified mode: large type, tall rows, the essential. */
:root[data-mode='simple'] {
  --pt-size: 1.375rem;
  --pt-row: 52px;
}

/* What gets the focus never ends under the menu at the bottom of the phone. */
:root {
  scroll-padding-bottom: 104px;
}

body.portal {
  min-height: 100vh;
  margin: 0;
  padding-bottom: 104px;
  background: var(--pt-paper);
  color: var(--pt-ink);
  font: 400 var(--pt-size) / 1.55 var(--fm-font-text);
}

.portal a {
  color: inherit;
}

/* The sections of the portal draw their own heads: no rule of the shared sheet between them. */
.portal section + section {
  margin-top: 0;
  border-top: 0;
}

/* Read aloud, not shown. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* The pages of the menu of the neighbourhood, under the head. */
.pt-pages {
  max-width: 76rem;
  margin: 0 auto;
  padding: 4px 16px 0;
}

.pt-pages ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pt-pages a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  font: 600 1rem var(--fm-font-headings);
  text-underline-offset: 4px;
}

.portal :focus-visible,
/* A field of the date keeps its outline also on the button of its calendar, inside it, where the
   field itself is not :focus but holds the focus within. */
.portal input.pt-input:focus-within {
  outline: 3px solid var(--pt-ink);
  outline-offset: 3px;
  box-shadow: 0 0 0 7px var(--fm-signal);
}

.portal h1,
.portal h2,
.portal h3 {
  margin: 0;
  font-family: var(--fm-font-headings);
  font-weight: 600;
  color: var(--pt-ink);
  text-wrap: balance;
}

.portal h1 {
  font-size: 2rem;
  line-height: 1.15;
}

.portal h2 {
  font-size: 1.5rem;
  line-height: 1.2;
}

.portal p {
  margin: 0;
}

.pt-muted {
  color: var(--pt-muted);
}

.pt-icon {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Head: the neighbourhood, the menu, Entra ---------- */

.pt-head {
  border-bottom: var(--pt-line) solid var(--pt-rule);
  background: var(--pt-surface);
}

.pt-head__inner {
  display: flex;
  align-items: center;
  gap: 12px 18px;
  max-width: 76rem;
  margin: 0 auto;
  padding: 12px 16px;
}

.pt-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin-right: auto;
  text-decoration: none;
}

.pt-logo {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--pt-accent);
  color: var(--pt-on-accent);
  font: 700 1.125rem/1 var(--fm-font-headings);
}

.pt-brand__name {
  display: block;
  font: 700 1.375rem/1.1 var(--fm-font-headings);
}

.pt-brand__subtitle {
  display: block;
  color: var(--pt-muted);
  font-size: 0.9375rem;
  line-height: 1.3;
}

.pt-nav {
  display: none;
}

/* «Entra» and «Esci», on the phone too: the menu at the bottom has no room for them. */
.pt-account {
  flex: none;
  margin: 0;
}

.pt-account__button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border: var(--pt-line) solid var(--pt-rule-strong);
  border-radius: 999px;
  background: var(--pt-surface);
  color: var(--pt-ink);
  font: 600 0.9375rem/1.1 var(--fm-font-headings);
  text-decoration: none;
  cursor: pointer;
}

.pt-account__button:hover {
  border-color: var(--pt-accent);
}

.pt-nav ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pt-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  font: 600 1.0625rem var(--fm-font-headings);
  text-decoration: none;
}

.pt-nav a[aria-current='page'] {
  box-shadow: inset 0 -4px 0 var(--pt-accent);
}

.pt-enter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: var(--pt-line) solid var(--pt-ink);
  border-radius: 999px;
  background: transparent;
  color: var(--pt-ink);
  font: 600 1rem var(--fm-font-headings);
  text-decoration: none;
  white-space: nowrap;
}

.pt-person {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 1rem var(--fm-font-headings);
}

.pt-person__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--pt-accent-soft);
  border: var(--pt-line) solid var(--pt-accent);
  font: 700 0.875rem var(--fm-font-headings);
}

/* Whoever is in sees their name and «Esci»; the others «Entra». */
:root:not([data-signed='in']) [data-when='in'],
:root[data-signed='in'] [data-when='out'] {
  display: none;
}

/* ---------- The menu at the foot, on the phone ---------- */

.pt-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  border-top: var(--pt-line) solid var(--pt-rule);
  background: var(--pt-surface);
}

/* Each entry as wide as its word, sharing what is left: «Personalizza» does not fit a quarter. */
.pt-bar ul {
  display: flex;
  margin: 0 auto;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  max-width: 34rem;
  list-style: none;
}

.pt-bar li {
  flex: 1 1 auto;
}

/* Only on a very narrow screen, or zoomed, a word goes to the next line, with the hyphen. */
.pt-bar a {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 56px;
  padding: 6px 4px;
  border-radius: 14px;
  font: 600 0.875rem/1.1 var(--fm-font-headings);
  text-align: center;
  text-decoration: none;
  overflow-wrap: normal;
  hyphens: auto;
}

.pt-bar a[aria-current='page'] {
  background: var(--pt-accent-soft);
  box-shadow: inset 0 -4px 0 var(--pt-accent);
}

:root[data-mode='simple'] .pt-bar a {
  min-height: 68px;
  font-size: 1rem;
}

@media (min-width: 960px) {
  .pt-nav {
    display: block;
  }

  .pt-bar {
    display: none;
  }

  body.portal {
    padding-bottom: 32px;
  }

  :root {
    scroll-padding-bottom: 0;
  }
}

/* ---------- Pages ---------- */

.pt-main {
  display: grid;
  gap: 28px;
  max-width: 76rem;
  margin: 0 auto;
  padding: 20px 16px 32px;
}

.pt-narrow {
  max-width: 46rem;
}

.pt-eyebrow {
  color: var(--pt-muted);
  font: 600 1rem/1.3 var(--fm-font-headings);
}

.pt-eyebrow a {
  text-underline-offset: 3px;
}

.pt-block {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.pt-block__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 14px;
  padding-bottom: 10px;
  border-bottom: 4px solid var(--pt-accent);
}

.pt-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font: 600 1rem var(--fm-font-headings);
  text-underline-offset: 3px;
}

.pt-card {
  padding: 16px;
  border: var(--pt-line) solid var(--pt-rule);
  border-radius: var(--pt-radius);
  background: var(--pt-surface);
}

.pt-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border: var(--pt-line) solid var(--pt-accent);
  border-radius: 14px;
  background: var(--pt-accent);
  color: var(--pt-on-accent);
  font: 600 1.0625rem var(--fm-font-headings);
  text-decoration: none;
  cursor: pointer;
}

.portal a.pt-button {
  color: var(--pt-on-accent);
}

.pt-button--quiet {
  background: transparent;
  border-color: var(--pt-ink);
  color: var(--pt-ink);
}

.portal a.pt-button--quiet {
  color: var(--pt-ink);
}

.pt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pt-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: var(--pt-line) solid var(--pt-ink);
  border-radius: 8px;
  font: 700 0.875rem/1.4 var(--fm-font-headings);
}

.pt-tag--off {
  border-color: var(--pt-off);
  color: var(--pt-off);
}

.pt-tag--reserved {
  border-color: var(--pt-now);
  color: var(--pt-now);
}

.pt-message {
  display: grid;
  gap: 4px;
  padding: 12px 16px;
  border-left: 6px solid var(--pt-off);
  border-radius: 12px;
  background: var(--pt-surface);
}

.pt-message strong {
  font-family: var(--fm-font-headings);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- The first page ---------- */

.pt-home {
  display: grid;
  gap: 28px;
}

.pt-lead {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: var(--pt-line) solid var(--pt-rule);
  border-radius: var(--pt-radius);
  background: var(--pt-surface);
  text-decoration: none;
}

.pt-lead > span {
  display: grid;
  gap: 4px;
}

.pt-lead__kicker {
  color: var(--pt-accent);
  font: 700 0.875rem/1.2 var(--fm-font-headings);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pt-lead__title {
  font: 600 1.375rem/1.2 var(--fm-font-headings);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.pt-visit {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 16px;
  border: var(--pt-line) solid var(--pt-rule);
  border-radius: 14px;
  background: var(--pt-surface);
  text-decoration: none;
}

.pt-visit strong {
  font-family: var(--fm-font-headings);
}

.pt-visit .pt-icon:last-child {
  margin-left: auto;
  color: var(--pt-accent);
}

/* The day from 8 to 24, one row per appointment; «Adesso» crosses it. */
.pt-day {
  position: relative;
  display: grid;
  gap: 6px;
}

.pt-day__axis {
  display: flex;
  justify-content: space-between;
  color: var(--pt-muted);
  font: 600 0.8125rem/1 var(--fm-font-headings);
}

.pt-day__rows {
  position: relative;
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pt-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--pt-row);
  padding: 4px 12px;
  overflow: hidden;
  border: var(--pt-line) solid var(--pt-rule);
  border-radius: 12px;
  background: var(--pt-surface);
  text-decoration: none;
}

/* The stretch known, washed behind the name with its edge below; a start without an end is a
   line; «Adesso» crosses every row. The places are attributes of the drawing, in shares of the
   day. */
.pt-row__band {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.pt-row__span {
  fill: var(--pt-accent-soft);
}

.pt-row__edge,
.pt-row__start {
  fill: var(--pt-accent);
}

.pt-row--off .pt-row__span {
  fill: transparent;
}

.pt-row--off .pt-row__edge,
.pt-row--off .pt-row__start {
  fill: var(--pt-off);
}

.pt-row__now {
  stroke: var(--pt-now);
  stroke-width: 3;
}

.pt-day__now {
  display: block;
  width: 100%;
  height: 24px;
  overflow: visible;
  fill: var(--pt-now);
  font: 700 0.875rem var(--fm-font-headings);
}

.pt-row__name,
.pt-row__time,
.pt-row .pt-tag {
  position: relative;
}

.pt-row__name {
  min-width: 0;
  font: 600 1.0625rem/1.25 var(--fm-font-headings);
  overflow-wrap: anywhere;
}

.pt-row__time {
  margin-left: auto;
  flex: none;
  color: var(--pt-muted);
  font-size: 0.9375rem;
}

.pt-row--off .pt-row__name {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.pt-row__note {
  margin: -2px 0 0;
  padding-left: 12px;
  color: var(--pt-muted);
  font-size: 0.9375rem;
}

.pt-events {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pt-event {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 4px 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: var(--pt-line) solid var(--pt-rule);
  text-decoration: none;
}

.pt-event > :not(.pt-event__date) {
  grid-column: 2;
}

.pt-event__date {
  grid-row: span 4;
  align-self: center;
  display: grid;
  justify-items: center;
  padding-right: 12px;
  border-right: var(--pt-line) solid var(--pt-rule);
  color: var(--pt-accent);
  font: 700 1.75rem/1 var(--fm-font-headings);
}

.pt-event__date small {
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pt-event__when {
  color: var(--pt-accent);
  font: 700 0.9375rem/1.3 var(--fm-font-headings);
}

.pt-event__title {
  font: 600 1.25rem/1.25 var(--fm-font-headings);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.pt-space {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: var(--pt-line) solid var(--pt-rule);
  border-radius: var(--pt-radius);
  background: var(--pt-surface);
}

.pt-space ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pt-space__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  padding-top: 12px;
  border-top: var(--pt-line) solid var(--pt-rule);
}

.pt-memory {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 12px;
  border-top: var(--pt-line) solid var(--pt-rule);
  text-decoration: none;
}

.pt-memory__mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--pt-accent-soft);
  color: var(--pt-accent);
  font: 700 1rem var(--fm-font-headings);
}

.pt-entries {
  display: grid;
  gap: 12px;
}

.pt-entry {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: var(--pt-line) solid var(--pt-rule);
  border-radius: var(--pt-radius);
  background: var(--pt-surface);
  text-decoration: none;
}

.pt-entry strong {
  font: 600 1.25rem/1.25 var(--fm-font-headings);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.pt-contact {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 18px;
  border: var(--pt-line) solid var(--pt-accent);
  border-radius: var(--pt-radius);
  background: var(--pt-accent-soft);
}

.pt-foot {
  max-width: 76rem;
  margin: 0 auto;
  padding: 20px 16px;
  border-top: var(--pt-line) solid var(--pt-rule);
  color: var(--pt-muted);
  font-size: 1rem;
}

.pt-foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.pt-foot a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}

@media (min-width: 960px) {
  .portal h1 {
    font-size: 2.5rem;
  }

  .pt-home {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px 40px;
  }

  .pt-home > .pt-wide {
    grid-column: 1 / -1;
  }

  .pt-entries {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pt-lead {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
}

/* The simplified first page: five large tiles, the rest one link away. */
.pt-simple {
  display: none;
}

:root[data-mode='simple'] .pt-simple {
  display: grid;
  gap: 16px;
}

:root[data-mode='simple'] .pt-full {
  display: none;
}

.pt-tile {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 3px solid var(--pt-ink);
  border-radius: var(--pt-radius);
  background: var(--pt-surface);
  text-decoration: none;
}

.pt-tile__label {
  color: var(--pt-accent);
  font: 700 1rem/1.2 var(--fm-font-headings);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pt-tile strong {
  font: 600 1.625rem/1.2 var(--fm-font-headings);
}

@media (min-width: 960px) {
  :root[data-mode='simple'] .pt-simple {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pt-suspended {
  padding: 10px 14px;
  border-left: 6px solid var(--pt-off);
  border-radius: 12px;
  background: var(--pt-surface);
}

/* ---------- Content, event, group ---------- */

.pt-article {
  display: grid;
  gap: 18px;
  max-width: 46rem;
}

.pt-article__meta {
  color: var(--pt-muted);
}

.pt-figure {
  margin: 0;
  overflow: hidden;
  border-radius: var(--pt-radius);
  background: var(--pt-accent-soft);
}

.pt-figure svg {
  display: block;
  width: 100%;
  height: auto;
}

.pt-article__body {
  display: grid;
  gap: 14px;
}

.pt-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  border: var(--pt-line) solid var(--pt-rule);
  border-radius: var(--pt-radius);
  background: var(--pt-surface);
}

.pt-list li {
  display: grid;
  gap: 2px;
  padding: 12px 16px;
}

.pt-list li + li {
  border-top: var(--pt-line) solid var(--pt-rule);
}

.pt-list a {
  font-weight: 700;
  text-underline-offset: 3px;
}

.pt-when {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--pt-surface);
  border: var(--pt-line) solid var(--pt-rule);
}

.pt-when strong {
  display: block;
  font: 600 1.25rem/1.3 var(--fm-font-headings);
}

/* The words of when start with a capital, whatever the day they start with. */
.pt-when strong::first-letter {
  text-transform: uppercase;
}

.pt-group {
  display: grid;
  gap: 24px;
}

@media (min-width: 960px) {
  .pt-group {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: start;
  }
}

/* ---------- Agenda ---------- */

.pt-filters {
  display: grid;
  gap: 12px;
}

.pt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pt-chips a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: var(--pt-line) solid var(--pt-rule-strong);
  border-radius: 999px;
  background: var(--pt-surface);
  font: 600 1rem var(--fm-font-headings);
  text-decoration: none;
}

.pt-chips a[aria-current='page'] {
  border-color: var(--pt-accent);
  background: var(--pt-accent);
  color: var(--pt-on-accent);
}

.pt-field {
  display: grid;
  gap: 6px;
}

.pt-field label,
.pt-field legend {
  font: 700 1rem var(--fm-font-headings);
}

.pt-input {
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border: var(--pt-line) solid var(--pt-rule-strong);
  border-radius: 14px;
  background: var(--pt-surface);
  color: var(--pt-ink);
  font: inherit;
}

.pt-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.pt-inline .pt-field {
  flex: 1 1 14rem;
}

.pt-agenda-day {
  display: grid;
  gap: 8px;
}

.pt-agenda-day h2 {
  font-size: 1.25rem;
}

.pt-items {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  border: var(--pt-line) solid var(--pt-rule);
  border-radius: var(--pt-radius);
  background: var(--pt-surface);
}

.pt-items li {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 2px 12px;
  padding: 12px 16px;
}

.pt-items li + li {
  border-top: var(--pt-line) solid var(--pt-rule);
}

.pt-items__time {
  grid-row: span 3;
  font: 700 1rem/1.4 var(--fm-font-headings);
}

.pt-items__day {
  display: block;
  color: var(--pt-accent);
  font-size: 0.875rem;
}

.pt-items a {
  font-weight: 700;
  text-underline-offset: 3px;
}

.pt-items del {
  text-decoration-thickness: 2px;
}

.pt-items__meta {
  color: var(--pt-muted);
  font-size: 1rem;
}

/* ---------- Search ---------- */

.pt-search {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pt-search .pt-input {
  flex: 1 1 14rem;
}

.pt-results {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pt-results li {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: var(--pt-line) solid var(--pt-rule);
  border-radius: var(--pt-radius);
  background: var(--pt-surface);
}

.pt-results a {
  font: 600 1.1875rem/1.3 var(--fm-font-headings);
  text-underline-offset: 3px;
}

.pt-results mark {
  padding: 0 2px;
  border-radius: 4px;
  background: var(--fm-signal);
  color: #1a1d22;
}

/* ---------- Personalizza and forms ---------- */

.pt-choices {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.pt-choice {
  display: flex;
  align-items: start;
  gap: 12px;
  min-height: 56px;
  padding: 12px 16px;
  border: var(--pt-line) solid var(--pt-rule-strong);
  border-radius: 16px;
  background: var(--pt-surface);
  cursor: pointer;
}

.pt-choice input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 3px 0 0;
  accent-color: var(--pt-accent);
}

.pt-choice span {
  display: grid;
  gap: 2px;
}

.pt-choice strong {
  font-family: var(--fm-font-headings);
}

.pt-choice:has(input:checked) {
  border-color: var(--pt-accent);
  box-shadow: inset 5px 0 0 var(--pt-accent);
}

.pt-choices--grid {
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}

.pt-form {
  display: grid;
  gap: 18px;
  max-width: 40rem;
}

.pt-saved {
  padding: 12px 16px;
  border-left: 6px solid var(--pt-accent);
  border-radius: 12px;
  background: var(--pt-surface);
}

/* What is missing in a form: said above it, in words, not by the colour alone. */
.pt-problem {
  padding: 12px 16px;
  border-left: 6px solid var(--pt-ink);
  border-radius: 12px;
  background: var(--pt-surface);
  font-weight: 700;
}

.pt-input[aria-invalid='true'] {
  border-width: 4px;
  border-color: var(--pt-ink);
}

.pt-textarea {
  min-height: 11rem;
  resize: vertical;
}

/* The field for the robots: out of sight and out of reach of the people. */
.pt-bait {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Printing: the content, readable, without the menus ---------- */

@media print {
  body.portal {
    padding: 0;
    background: #ffffff;
    color: #000000;
    font-size: 12pt;
  }

  .pt-nav,
  .pt-bar,
  .pt-pages,
  .pt-foot ul {
    display: none;
  }

  .pt-head,
  .pt-card,
  .pt-list,
  .pt-items {
    border-color: #000000;
    background: #ffffff;
    box-shadow: none;
  }

  .portal a {
    color: #000000;
  }
}

