/* css/app.css */
:root {
  color-scheme: light;
  --bg: #f8f5ef;
  --surface: #ffffff;
  --surface-raised: #fffdf9;
  --text: #25262a;
  --text-muted: #686a70;
  --border: #dedbd4;
  --accent: #ed684f;
  --accent-strong: #c94732;
  --accent-soft: #ffe6df;
  --sun: #f3b821;
  --sun-soft: #fff3c9;
  --sky: #4d96b8;
  --sky-soft: #dff1f7;
  --mint: #317f6a;
  --mint-soft: #def1e9;
  --focus: #155bce;
  --shadow: 0 12px 32px rgb(62 48 34 / 8%);
  --radius-sm: 0.5rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #181b20;
  --surface: #22262c;
  --surface-raised: #292e35;
  --text: #f4f1eb;
  --text-muted: #b8bac0;
  --border: #3a4048;
  --accent: #ff8068;
  --accent-strong: #ff9a87;
  --accent-soft: #492d2a;
  --sun: #f8c84a;
  --sun-soft: #443b22;
  --sky: #7bc1de;
  --sky-soft: #213c49;
  --mint: #72c4a9;
  --mint-soft: #203d35;
  --focus: #8eb8ff;
  --shadow: 0 12px 32px rgb(0 0 0 / 22%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-rounded, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 0.1875rem solid var(--focus);
  outline-offset: 0.1875rem;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: var(--space-3);
  left: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--surface);
  font-weight: 700;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  width: min(100%, 48rem);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4rem;
  padding: max(var(--space-3), env(safe-area-inset-top)) var(--space-4) var(--space-2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 38% 62% 55% 45%;
  background: var(--accent);
  color: #fff;
  font-size: 0.9375rem;
  transform: rotate(-5deg);
}

.icon-button {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease;
}

.icon-button:active {
  transform: scale(0.94);
}

.theme-icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.theme-icon-moon,
/* L189 (D168): the moon button hides with «Automatico» and with a theme that is always light or
   always dark; the button's own «display» would show it. */
[data-theme-toggle][hidden] {
  display: none;
}

[data-theme="dark"] .theme-icon-sun {
  display: none;
}

[data-theme="dark"] .theme-icon-moon {
  display: block;
}

.logout-form {
  margin: 0;
}

.text-button {
  min-height: 2.75rem;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 800;
}

.text-button:hover {
  background: var(--surface);
  color: var(--text);
}

.access-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 15%, color-mix(in srgb, var(--sun) 18%, transparent), transparent 28%),
    radial-gradient(circle at 90% 75%, color-mix(in srgb, var(--sky) 16%, transparent), transparent 30%),
    var(--bg);
}

.access-topbar {
  display: flex;
  width: min(100%, 42rem);
  min-height: 5rem;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  padding: max(var(--space-4), env(safe-area-inset-top)) var(--space-4) var(--space-3);
}

.access-main {
  width: min(100%, 42rem);
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) max(var(--space-8), env(safe-area-inset-bottom));
}

.access-heading {
  max-width: 32rem;
  margin-bottom: var(--space-6);
}

.access-heading h1,
.login-card h1 {
  margin: var(--space-1) 0;
  font-size: clamp(2rem, 9vw, 3rem);
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.access-heading > p:last-child,
.login-card > p:not(.eyebrow) {
  margin: var(--space-2) 0 0;
  color: var(--text-muted);
}

.profile-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.profile-choice {
  display: grid;
  min-height: 10.5rem;
  place-items: center;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
  text-align: center;
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.profile-choice:hover {
  border-color: var(--accent);
  box-shadow: 0 1rem 2rem color-mix(in srgb, var(--accent) 12%, transparent);
  transform: translateY(-0.125rem);
}

.profile-choice strong {
  font-size: 1.125rem;
}

.profile-choice > span:last-child {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.profile-choice-avatar,
.login-avatar {
  display: grid;
  width: 4.25rem;
  height: 4.25rem;
  place-items: center;
  border-radius: 42% 58% 55% 45%;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 900;
}

.profile-color-1,
.profile-color-5 {
  background: var(--accent);
}

.profile-color-2,
.profile-color-6 {
  background: var(--sky);
}

.profile-color-3,
.profile-color-7 {
  background: var(--mint);
}

.profile-color-4,
.profile-color-8 {
  background: color-mix(in srgb, var(--sun) 75%, #8a4c00);
}

.access-privacy-note,
.login-help {
  margin: var(--space-6) 0 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: center;
}

.access-privacy-note span {
  color: var(--mint);
}

.empty-access-state {
  padding: var(--space-8);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
}

.access-back {
  display: inline-flex;
  gap: var(--space-2);
  align-items: center;
  margin-bottom: var(--space-5);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 800;
  text-decoration: none;
}

.login-card {
  max-width: 28rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 7vw, 2.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-avatar {
  margin-bottom: var(--space-5);
  background: var(--accent);
  box-shadow: 0 0.5rem 1rem color-mix(in srgb, var(--accent) 25%, transparent);
}

.login-form {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

.login-form label {
  font-size: 0.8125rem;
  font-weight: 900;
}

.login-form input[type="password"] {
  width: 100%;
  min-height: 3.25rem;
  padding: 0 var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.primary-button {
  min-height: 3.25rem;
  margin-top: var(--space-2);
  padding: 0 var(--space-5);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--accent);
  box-shadow: 0 0.5rem 1rem color-mix(in srgb, var(--accent) 24%, transparent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.form-alert,
.field-error {
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 700;
}

.form-alert {
  margin-bottom: var(--space-2);
  padding: var(--space-3);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}

.main-content {
  padding: var(--space-4) var(--space-4) 7.5rem;
}

.page-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin: var(--space-2) 0 var(--space-6);
}

.eyebrow,
.section-kicker {
  margin: 0 0 var(--space-1);
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: var(--space-1);
  font-size: clamp(1.75rem, 8vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: var(--space-2);
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.page-subtitle {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.balance-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid color-mix(in srgb, var(--mint) 35%, transparent);
  border-radius: var(--radius-sm);
  background: var(--mint-soft);
  color: var(--mint);
  font-size: 0.75rem;
}

.balance-chip strong {
  font-size: 1rem;
  white-space: nowrap;
}

.timer-card {
  margin-bottom: var(--space-5);
  padding: var(--space-5);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.timer-topline,
.timer-value,
.button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--mint);
  font-size: 0.75rem;
  font-weight: 800;
}

.live-badge span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 0.25rem var(--mint-soft);
}

.timer-card h2 {
  margin-bottom: var(--space-1);
}

.task-meta,
.demo-note {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.timer-readout {
  margin: var(--space-4) 0;
  font-size: clamp(2.5rem, 14vw, 4rem);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1;
}

.timer-value {
  margin-bottom: var(--space-4);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.timer-value strong {
  color: var(--mint);
  font-size: 1.125rem;
}

.button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}

.button:active:not(:disabled) {
  transform: translateY(0.125rem);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.button-primary {
  background: var(--accent);
  color: #fff;
}

.button-secondary {
  border-color: var(--border);
  background: var(--surface-raised);
  color: var(--text);
}

.button-row .button {
  flex: 1;
}

.demo-note {
  margin: var(--space-2) 0 0;
  text-align: center;
}

.flow-message {
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-left: 0.25rem solid var(--mint);
  border-radius: var(--radius-sm);
  background: var(--mint-soft);
  color: var(--mint);
  font-size: 0.875rem;
  font-weight: 800;
}

.demo-reset {
  display: block;
  margin: var(--space-5) auto 0;
  padding: var(--space-2);
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.task-card.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.task-section {
  margin-top: var(--space-6);
}

.section-heading-compact {
  align-items: center;
  padding-bottom: var(--space-3);
}

.count-badge {
  display: grid;
  min-width: 1.75rem;
  height: 1.75rem;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 900;
}

.task-list {
  display: grid;
  gap: var(--space-3);
  padding-top: var(--space-3);
}

.task-card,
.reserved-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.task-tone {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-radius: var(--radius-sm);
  font-size: 1.25rem;
  font-weight: 900;
}

.task-tone-sun {
  background: var(--sun-soft);
  color: var(--sun);
}

.task-tone-sky {
  background: var(--sky-soft);
  color: var(--sky);
}

.task-card h3,
.reserved-card h3 {
  margin: 0 0 var(--space-1);
  font-size: 0.9375rem;
  line-height: 1.25;
}

.task-card p,
.reserved-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.task-card p strong {
  color: var(--mint);
}

.task-category {
  display: block;
  margin-bottom: var(--space-1);
  color: var(--accent-strong);
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.button-small {
  min-height: 2.5rem;
  padding: var(--space-2) var(--space-3);
  border-color: var(--accent);
  background: transparent;
  color: var(--accent-strong);
  font-size: 0.75rem;
}

.avatar {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-radius: 50%;
  background: var(--sky-soft);
  color: var(--sky);
  font-weight: 900;
}

.reserved-status {
  color: var(--mint);
  font-size: 0.6875rem;
  font-weight: 800;
}

.empty-state {
  margin-top: var(--space-8);
  padding: var(--space-8) var(--space-5);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
}

.empty-symbol {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto var(--space-4);
  place-items: center;
  border-radius: 50%;
  background: var(--mint-soft);
  color: var(--mint);
  font-size: 1.5rem;
  font-weight: 900;
}

.empty-state > p:not(.section-kicker) {
  color: var(--text-muted);
}

.empty-state .button {
  margin-top: var(--space-3);
}

.simple-heading {
  margin: var(--space-2) 0 var(--space-5);
}

.simple-heading > p:last-child,
.profile-header p,
.personal-note p,
.insight-card p:last-child {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(2.5rem, 1fr));
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-2);
}

.day-pill {
  display: flex;
  min-width: 2.5rem;
  min-height: 4rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.6875rem;
}

.day-pill strong {
  color: var(--text);
  font-size: 1rem;
}

.day-pill.is-today {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.day-pill.is-today strong {
  color: #fff;
}

.agenda {
  margin-top: var(--space-6);
}

.agenda-item {
  display: grid;
  grid-template-columns: 4.75rem 0.25rem 1fr;
  gap: var(--space-3);
  align-items: stretch;
  padding: var(--space-4) 0;
}

.agenda-item + .agenda-item {
  border-top: 1px solid var(--border);
}

.agenda-item time {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.agenda-line {
  border-radius: 999px;
  background: var(--accent);
}

.agenda-line-sky {
  background: var(--sky);
}

.agenda-line-sun {
  background: var(--sun);
}

.agenda-item h3 {
  margin: 0 0 var(--space-1);
  font-size: 0.9375rem;
}

.agenda-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.calendar-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  margin: var(--space-5) 0 var(--space-6);
}

.calendar-overview div {
  display: flex;
  min-height: 5rem;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.calendar-overview strong {
  font-size: 1.25rem;
}

.calendar-overview span {
  color: var(--text-muted);
  font-size: 0.6875rem;
}

.calendar-stack {
  display: grid;
  gap: var(--space-3);
}

.calendar-day {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.calendar-day summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-1) var(--space-3);
  min-height: 4.5rem;
  align-content: center;
  padding: var(--space-3) 2.75rem var(--space-3) var(--space-4);
  cursor: pointer;
  list-style: none;
}

.calendar-day summary::-webkit-details-marker {
  display: none;
}

.calendar-day summary time {
  font-weight: 800;
}

.calendar-day summary > span:not(.calendar-chevron) {
  grid-column: 1;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.calendar-chevron {
  position: absolute;
  top: 50%;
  right: var(--space-4);
  color: var(--accent-strong);
  font-size: 1.25rem;
  transform: translateY(-50%);
  transition: transform 160ms ease;
}

.calendar-day[open] .calendar-chevron {
  transform: translateY(-50%) rotate(180deg);
}

.calendar-day-tasks {
  padding: 0 var(--space-4) var(--space-2);
  border-top: 1px solid var(--border);
}

.calendar-task {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) 0;
}

.calendar-task + .calendar-task {
  border-top: 1px solid var(--border);
}

.calendar-task h3,
.calendar-task p {
  margin: 0;
}

.calendar-task h3 {
  font-size: 0.875rem;
}

.calendar-task p {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.calendar-task-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--accent);
}

.calendar-task-dot-sky {
  background: var(--sky);
}

.calendar-task-dot-sun {
  background: var(--sun);
}

.calendar-task-dot-mint {
  background: var(--mint);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.metric-grid article {
  display: flex;
  min-height: 6.5rem;
  flex-direction: column;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.metric-grid span,
.metric-grid small {
  color: var(--text-muted);
  font-size: 0.6875rem;
}

.metric-grid strong {
  margin: auto 0 var(--space-1);
  font-size: clamp(1rem, 4.5vw, 1.375rem);
  line-height: 1.1;
}

.chart-card {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.bar-chart {
  display: grid;
  gap: var(--space-3);
  padding-top: var(--space-4);
}

.bar-row {
  display: grid;
  grid-template-columns: 1.75rem 4rem minmax(3rem, 1fr) 3.75rem;
  gap: var(--space-2);
  align-items: center;
  font-size: 0.75rem;
}

.bar-row > strong {
  text-align: right;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.mini-avatar {
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  place-items: center;
  border-radius: 50%;
  background: var(--sky-soft);
  color: var(--sky);
  font-size: 0.6875rem;
  font-weight: 900;
}

.bar-row progress {
  width: 100%;
  height: 0.5rem;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--border);
}

.bar-row progress::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--border);
}

.bar-row progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--accent);
}

.bar-row progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--accent);
}

.stats-scope {
  display: inline-grid;
  grid-template-columns: repeat(2, auto);
  gap: var(--space-1);
  margin-bottom: var(--space-5);
  padding: var(--space-1);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.stats-scope span {
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
}

.stats-scope-active {
  background: var(--text);
  color: var(--surface);
}

.metric-grid-four {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-grid-four article {
  min-height: 6rem;
}

.stats-grid {
  display: grid;
  gap: var(--space-4);
}

.stats-grid .chart-card,
.family-chart-card {
  min-width: 0;
}

.chart-description {
  margin: var(--space-2) 0 var(--space-4);
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.trend-change,
.stats-badge {
  flex: 0 0 auto;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: var(--mint-soft);
  color: var(--mint);
  font-size: 0.6875rem;
  font-weight: 900;
}

.trend-chart {
  display: grid;
  height: 12rem;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: clamp(0.25rem, 2vw, 0.625rem);
  align-items: end;
  padding: var(--space-4) 0 var(--space-2);
  border-bottom: 1px solid var(--border);
}

.trend-column {
  display: grid;
  height: 100%;
  grid-template-rows: 1fr 1rem;
  gap: var(--space-1);
  align-items: end;
  text-align: center;
}

.trend-label {
  color: var(--text-muted);
  font-size: clamp(0.5rem, 2vw, 0.625rem);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.trend-value {
  display: none;
}

.trend-bar {
  width: 100%;
  height: var(--bar-height);
  min-height: 0.5rem;
  border-radius: 0.5rem 0.5rem 0.125rem 0.125rem;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
}

.trend-column:last-child .trend-bar {
  background: linear-gradient(180deg, var(--sun), var(--accent));
  box-shadow: 0 0.375rem 1rem color-mix(in srgb, var(--accent) 28%, transparent);
}

.category-visual {
  display: grid;
  grid-template-columns: 8.25rem 1fr;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-4) 0;
}

.category-donut {
  position: relative;
  display: grid;
  width: 8.25rem;
  height: 8.25rem;
  place-content: center;
  border-radius: 50%;
  background: conic-gradient(
    var(--accent) 0 38%,
    var(--sky) 38% 67%,
    var(--sun) 67% 87%,
    var(--mint) 87% 100%
  );
  text-align: center;
}

.category-donut::after {
  position: absolute;
  inset: 1.25rem;
  border-radius: 50%;
  background: var(--surface);
  content: "";
}

.category-donut strong,
.category-donut span {
  position: relative;
  z-index: 1;
}

.category-donut strong {
  font-size: 1.5rem;
  line-height: 1;
}

.category-donut span {
  color: var(--text-muted);
  font-size: 0.6875rem;
}

.category-legend {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-legend li {
  display: grid;
  grid-template-columns: 0.625rem 1fr auto;
  gap: var(--space-2);
  align-items: center;
  font-size: 0.75rem;
}

.legend-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
}

.legend-dot-accent {
  background: var(--accent);
}

.legend-dot-sky {
  background: var(--sky);
}

.legend-dot-sun {
  background: var(--sun);
}

.legend-dot-mint {
  background: var(--mint);
}

.consistency-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-2);
  padding-top: var(--space-5);
}

.consistency-cell {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
}

.consistency-cell.level-0 {
  background: var(--bg);
  color: var(--text-muted);
}

.consistency-cell.level-1 {
  border-color: color-mix(in srgb, var(--mint) 35%, var(--border));
  background: var(--mint-soft);
  color: var(--mint);
}

.consistency-cell.level-2 {
  border-color: var(--mint);
  background: color-mix(in srgb, var(--mint) 55%, var(--surface));
  color: var(--surface);
}

.consistency-cell.level-3 {
  border-color: var(--mint);
  background: var(--mint);
  color: var(--surface);
}

.consistency-axis {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2);
  color: var(--text-muted);
  font-size: 0.625rem;
}

.accuracy-summary {
  display: grid;
  grid-template-columns: 69fr 31fr;
  overflow: hidden;
  margin: var(--space-5) 0 var(--space-4);
  border-radius: 999px;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 900;
  text-align: center;
}

.accuracy-summary span {
  padding: 0.5rem 0.25rem;
}

.accuracy-on-time {
  background: var(--mint);
}

.accuracy-over {
  background: var(--accent-strong);
}

.accuracy-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.accuracy-metrics div {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
}

.accuracy-metrics span {
  color: var(--text-muted);
  font-size: 0.6875rem;
}

.accuracy-metrics strong {
  font-size: 0.875rem;
}

.mini-insight {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  gap: var(--space-2);
  align-items: start;
  margin-top: var(--space-4);
  padding: var(--space-3);
  border: 1px solid color-mix(in srgb, var(--sun) 45%, var(--border));
  border-radius: var(--radius-md);
  background: var(--sun-soft);
  font-size: 0.75rem;
}

.mini-insight > span {
  display: grid;
  width: 1.5rem;
  height: 1.5rem;
  place-items: center;
  border-radius: 50%;
  background: var(--sun);
  color: #332600;
  font-weight: 900;
}

.mini-insight p {
  margin: 0;
}

.data-table-toggle {
  margin-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.data-table-toggle summary {
  padding: var(--space-3) 0 0;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 900;
}

.stats-table-scroll {
  overflow-x: auto;
  margin-top: var(--space-3);
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  white-space: nowrap;
}

.stats-table caption {
  padding-bottom: var(--space-2);
  color: var(--text-muted);
  text-align: left;
}

.stats-table th,
.stats-table td {
  padding: var(--space-2);
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.stats-table thead th {
  color: var(--text-muted);
  font-size: 0.625rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.family-chart-card {
  margin-top: var(--space-4);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.insight-card,
.personal-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  margin-top: var(--space-5);
  padding: var(--space-4);
  border: 1px solid color-mix(in srgb, var(--sun) 45%, var(--border));
  border-radius: var(--radius-md);
  background: var(--sun-soft);
}

.insight-card > span,
.personal-note > span {
  color: var(--accent-strong);
  font-size: 1.5rem;
  font-weight: 900;
}

.insight-card h2,
.personal-note h2 {
  font-size: 1rem;
}

.profile-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  align-items: center;
  margin: var(--space-2) 0 var(--space-6);
}

.profile-avatar {
  display: grid;
  width: 4.5rem;
  height: 4.5rem;
  place-items: center;
  border: 0.25rem solid var(--accent-soft);
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.75rem;
  font-weight: 900;
}

.profile-header h1 {
  margin-bottom: var(--space-1);
}

.profile-header > div > p:not(.eyebrow) {
  margin: 0;
  color: var(--text-muted);
}

.profile-avatar-photo {
  object-fit: cover;
}

.profile-edit-link {
  display: inline-flex;
  gap: var(--space-1);
  align-items: center;
  margin-top: var(--space-2);
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 900;
  text-decoration: none;
}

.profile-edit-heading {
  margin-bottom: var(--space-5);
}

.profile-edit-form {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.profile-photo-editor {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  align-items: center;
}

.profile-photo-editor img {
  width: 4.5rem;
  height: 4.5rem;
  border: 0.25rem solid var(--accent-soft);
  border-radius: 50%;
  object-fit: cover;
}

.profile-photo-editor > div {
  min-width: 0;
}

.profile-photo-editor label,
.profile-bio-field label {
  display: block;
  margin-bottom: var(--space-1);
  font-size: 0.8125rem;
  font-weight: 900;
}

.profile-photo-editor input[type="file"] {
  width: 100%;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.profile-photo-editor input[type="file"]::file-selector-button {
  margin-right: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.profile-photo-editor small {
  display: block;
  margin-top: var(--space-2);
  color: var(--text-muted);
  font-size: 0.6875rem;
}

.remove-photo-row {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 800;
}

.profile-bio-field > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.profile-bio-field > div:first-child span {
  color: var(--text-muted);
  font-size: 0.6875rem;
}

.profile-bio-field textarea {
  width: 100%;
  min-height: 7rem;
  resize: vertical;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.profile-edit-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.profile-balance {
  display: grid;
  grid-template-columns: 1fr auto;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--mint-soft);
  color: var(--mint);
}

.profile-balance span {
  font-size: 0.8125rem;
  font-weight: 800;
}

.profile-balance strong {
  grid-row: span 2;
  font-size: 1.5rem;
}

.profile-balance small {
  color: var(--text-muted);
}

.profile-metrics {
  margin-top: var(--space-3);
}

.personal-note {
  border-color: color-mix(in srgb, var(--sky) 45%, var(--border));
  background: var(--sky-soft);
}

.profile-capabilities {
  margin-bottom: var(--space-5);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.profile-capabilities h2 {
  margin: 0 0 var(--space-2);
  font-size: 0.875rem;
}

.profile-capabilities ul {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

.profile-capabilities li span {
  color: var(--mint);
  font-weight: 900;
}

.profile-capabilities p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.reminder-settings {
  margin-top: var(--space-6);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.settings-icon {
  color: var(--accent);
  font-size: 1.5rem;
}

.toggle-row,
.field-row,
.notification-device {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
}

.toggle-row strong,
.toggle-row small,
.notification-device strong,
.notification-device small {
  display: block;
}

.toggle-row small,
.notification-device small {
  margin-top: var(--space-1);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.toggle-row input {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--accent);
}

.field-row {
  font-size: 0.875rem;
  font-weight: 700;
}

.field-row select,
.quiet-hours input {
  min-height: 2.75rem;
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text);
  font: inherit;
}

.quiet-hours {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: 0;
  padding: var(--space-4) 0;
  border: 0;
  border-bottom: 1px solid var(--border);
}

.quiet-hours legend {
  width: 100%;
  font-size: 0.875rem;
  font-weight: 800;
}

.quiet-hours label {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.quiet-hours input {
  min-width: 0;
  width: 100%;
}

.notification-device .button {
  flex: 0 0 auto;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding-top: var(--space-4);
}

.settings-actions span {
  color: var(--mint);
  font-size: 0.75rem;
  font-weight: 700;
}

.welcome-panel {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  overflow: hidden;
  margin-bottom: var(--space-5);
  padding: var(--space-5);
  border: 1px solid color-mix(in srgb, var(--sun) 38%, var(--border));
  border-radius: var(--radius-lg);
  background: var(--sun-soft);
}

.welcome-panel p:last-child {
  max-width: 36rem;
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.welcome-symbol {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--sun);
  transform: rotate(-3deg);
}

.welcome-symbol svg {
  width: 2rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.shell-preview {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.section-heading h2 {
  margin-bottom: 0;
}

.status-badge {
  flex: 0 0 auto;
  padding: var(--space-1) var(--space-2);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.6875rem;
  font-weight: 800;
}

.status-badge span {
  margin-right: var(--space-1);
}

.feature-list {
  display: grid;
}

.feature-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-4) 0;
}

.feature-row + .feature-row {
  border-top: 1px solid var(--border);
}

.feature-row strong,
.feature-row span {
  display: block;
}

.feature-row div > span {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.feature-icon {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: var(--radius-sm);
  font-weight: 900;
}

.feature-icon-sun {
  background: var(--sun-soft);
  color: var(--sun);
}

.feature-icon-sky {
  background: var(--sky-soft);
  color: var(--sky);
}

.feature-icon-coral {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.placeholder-page {
  max-width: 36rem;
  padding-top: var(--space-6);
}

.placeholder-page > p:not(.eyebrow) {
  color: var(--text-muted);
}

.placeholder-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  margin-top: var(--space-8);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-left: 0.25rem solid var(--sky);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.placeholder-note > span {
  color: var(--sky);
  font-size: 1.5rem;
}

.placeholder-note h2 {
  margin-bottom: var(--space-1);
}

.placeholder-note p {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(100%, 48rem);
  min-height: 4.75rem;
  margin: 0 auto;
  padding: var(--space-2) var(--space-2) max(var(--space-2), env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 -10px 24px rgb(40 32 24 / 6%);
  backdrop-filter: blur(1rem);
}

.nav-item {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 3.25rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1875rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: clamp(0.625rem, 3vw, 0.75rem);
  font-weight: 700;
  text-decoration: none;
  transition: color 160ms ease, transform 160ms ease;
}

.nav-item > svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.nav-item.is-active {
  color: var(--accent-strong);
}

.nav-item.is-active::before {
  position: absolute;
  top: -0.5rem;
  width: 1.5rem;
  height: 0.1875rem;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

.nav-item:active {
  transform: translateY(0.125rem);
}

.nav-item-primary {
  margin-top: -1.25rem;
}

.nav-primary-icon {
  display: grid;
  width: 3.25rem;
  height: 3.25rem;
  place-items: center;
  border: 0.25rem solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0.375rem 1rem rgb(201 71 50 / 25%);
  color: #fff;
}

.nav-primary-icon svg {
  width: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

@media (min-width: 48rem) {
  body {
    padding: var(--space-5);
  }

  .metric-grid-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell {
    overflow: hidden;
    min-height: calc(100vh - 2.5rem);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
  }

  .main-content {
    padding-right: var(--space-8);
    padding-left: var(--space-8);
  }

  .bottom-nav {
    bottom: var(--space-5);
    border-right: 1px solid var(--border);
    border-bottom-right-radius: var(--radius-lg);
    border-bottom-left-radius: var(--radius-lg);
    border-left: 1px solid var(--border);
  }
}

@media (max-width: 22rem) {
  .main-content {
    padding-right: var(--space-3);
    padding-left: var(--space-3);
  }

  .welcome-panel {
    grid-template-columns: 1fr;
  }

  .nav-item span:last-child {
    font-size: 0.625rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Personal backgrounds (R19): light CSS patterns on top of the theme background. */
body.bg-sfumatura {
  background:
    radial-gradient(60rem 40rem at 10% -10%, color-mix(in srgb, var(--accent-soft) 85%, transparent), transparent 70%),
    radial-gradient(50rem 40rem at 110% 20%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

body.bg-puntini {
  background:
    radial-gradient(color-mix(in srgb, var(--text) 13%, transparent) 1.2px, transparent 1.4px) 0 0 / 18px 18px,
    var(--bg);
}

body.bg-quadretti {
  background:
    linear-gradient(color-mix(in srgb, var(--text) 7%, transparent) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, color-mix(in srgb, var(--text) 7%, transparent) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--bg);
}

/* Access help: demo hint, recovery ways and the recovery code shown once. */
.demo-hint { margin: var(--space-2) 0 0; padding: var(--space-2) var(--space-3); border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 0.875rem; }
.recovery-ways { margin: var(--space-2) 0 var(--space-4); padding-left: var(--space-5); font-size: 0.875rem; line-height: 1.5; }
.recovery-code { margin: var(--space-4) 0; padding: var(--space-4); border: 2px dashed var(--accent); border-radius: var(--radius-md); background: var(--surface); font: 800 1.6rem/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.08em; text-align: center; }

/* css/components.css */
/* Shared components for real (non-demo) pages. Tokens come from app.css. */

/* Form controls ---------------------------------------------------------- */
.panel-form,
.login-form {
  display: grid;
  gap: var(--space-2);
}

.panel-form {
  margin-top: var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.panel-form label,
.panel-form legend {
  font-size: 0.8125rem;
  font-weight: 900;
}

.panel-form input:not([type="checkbox"], [type="radio"], [type="file"]),
.panel-form select,
.panel-form textarea,
.login-form input:not([type="checkbox"]) {
  width: 100%;
  min-height: 3rem;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.panel-form textarea {
  min-height: 6rem;
  resize: vertical;
}

.panel-form fieldset {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  border: 0;
}

.help-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: flex-end;
  margin-top: var(--space-3);
}

.form-actions .button {
  flex: 1 1 8rem;
}

.check-row,
.show-code {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  min-height: 2.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.check-row input,
.show-code input {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--accent);
}

.setup-hints {
  margin: var(--space-3) 0 0;
  padding-left: var(--space-5);
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-align: left;
}

/* Feedback ----------------------------------------------------------------- */
.flash-messages {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.flash {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-left: 0.25rem solid var(--mint);
  border-radius: var(--radius-sm);
  background: var(--mint-soft);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 700;
}

.flash-error,
.flash-warning {
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

.muted-note {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.status-pill {
  display: inline-flex;
  gap: var(--space-1);
  align-items: center;
  margin: var(--space-1) 0 0;
  padding: 0.125rem var(--space-2);
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 800;
}

.status-ok {
  background: var(--mint-soft);
  color: var(--mint);
}

.status-wait {
  background: var(--sun-soft);
  color: var(--text);
}

.status-off {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.first-access-badge {
  padding: 0.125rem var(--space-2);
  border-radius: 999px;
  background: var(--sun-soft);
  color: var(--text);
  font-size: 0.6875rem;
  font-weight: 800;
}

.danger-text {
  color: var(--accent-strong);
  font-weight: 800;
}

/* Management hub ------------------------------------------------------------ */
.hub-list,
.family-list,
.log-list,
.plain-list {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-5) 0 0;
  padding: 0;
  list-style: none;
}

.hub-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-1) var(--space-3);
  align-items: center;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.hub-card span:not(.hub-arrow, .ico-tondo) {
  grid-column: 1;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.hub-arrow {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: var(--accent-strong);
  font-weight: 900;
}

/* «Organizza» groups (V24): a big emoji, the title and a preview of the pages inside. */
.hub-group {
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: var(--space-4);
}

.hub-group > :is(strong, span:not(.hub-arrow, .ico-tondo)) {
  grid-column: 2;
}

.hub-group > .ico-tondo {
  grid-row: 1 / span 3;
  grid-column: 1;
}

.hub-group .hub-arrow {
  grid-row: 1 / span 3;
  grid-column: 3;
}

.hub-group span.hub-preview {
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 700;
}

.family-card {
  display: block;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.family-card-head {
  position: relative;
  display: flex;
  gap: var(--space-3);
  align-items: center;
  min-height: 3rem;
  padding-right: 2.5rem;
  cursor: pointer;
  list-style: none;
}

.family-card-head::-webkit-details-marker {
  display: none;
}

.family-card[open] .calendar-chevron {
  transform: translateY(-50%) rotate(180deg);
}

.family-card .calendar-chevron {
  right: 0;
}

.family-card[open] > .family-card-head {
  margin-bottom: var(--space-3);
}

.family-card h2 {
  margin: 0;
  font-size: 1rem;
}

.invite-box {
  margin: 0 0 var(--space-4);
  padding: var(--space-3);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.invite-box h3 {
  margin: 0 0 var(--space-1);
  font-size: 0.9375rem;
}

.invite-box .group-link {
  margin-bottom: var(--space-2);
}

.capability-form fieldset {
  margin: 0 0 var(--space-2);
  padding: 0;
  border: 0;
}

.capability-form legend {
  margin-bottom: var(--space-1);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.log-list li {
  display: grid;
  gap: 0.125rem;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.875rem;
}

.log-list time,
.log-list span {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
}

.profile-capabilities .button {
  margin-top: var(--space-3);
}

/* Contrast: white text needs the darker coral in light mode (4.7:1); dark mode uses ink
   text on the bright coral (6.9:1). */
.button-primary,
.primary-button {
  background: var(--button-bg, var(--accent-strong));
  color: var(--on-button, #fff);
}

[data-theme="dark"] .button-primary,
[data-theme="dark"] .primary-button {
  background: var(--button-bg, var(--accent));
  color: var(--on-button, #1b1d21);
}

[data-theme="dark"] .badge-dot {
  color: #1b1d21;
}

/* Logo (R20): the brand mark shows the family logo */
.brand-logo {
  overflow: hidden;
  padding: 0;
  background: none;
}

.brand-logo svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* «Altre opzioni» (V14): advanced fields folded away, the summary reads like a button. */
.more-options {
  margin-top: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}

.more-options > summary {
  display: block;
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 800;
  list-style: none;
}

.more-options > summary::-webkit-details-marker { display: none; }
.more-options > summary::before { content: "＋ "; }
.more-options[open] > summary::before { content: "－ "; }
.more-options > summary .help-text { display: block; margin-top: var(--space-1); color: var(--text-muted); font-weight: 500; }

.more-options-body {
  display: grid;
  gap: var(--space-2);
  padding: 0 var(--space-4) var(--space-4);
}

/* «Per quanto tempo» (V18): the date or the period right under its choice. */
.duration-field { display: grid; gap: var(--space-1); margin: var(--space-2) 0; padding: 0; border: 0; }
.duration-field legend { font-weight: 800; margin-bottom: var(--space-1); }
.duration-detail { padding-left: 2rem; }
.duration-period { display: flex; gap: var(--space-2); }
.duration-detail input, .duration-detail select { min-height: 2.75rem; padding: 0 var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
.duration-period input { width: 5rem; }

/* Faces (V02): a photo, a medieval avatar or the initial, in three sizes. */
.face {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  overflow: hidden;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 900;
}

.face img { width: 100%; height: 100%; object-fit: cover; }
.face svg { width: 88%; height: 88%; margin-top: 12%; }
.face-md { width: 4rem; height: 4rem; font-size: 1.4rem; }
.face-lg { width: 5rem; height: 5rem; border: 0.25rem solid var(--accent-soft); font-size: 1.9rem; }

/* La famiglia (V02). */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
}

.person-tile {
  display: grid;
  justify-items: center;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  text-align: center;
  text-decoration: none;
}

.person-tile span { font-size: 0.8125rem; }
.person-tile.is-me { border-width: 2px; border-color: var(--accent); }

/* Avatar picker in «Le mie preferenze». */
.avatar-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.25rem, 1fr)); gap: var(--space-2); }
.avatar-choice { position: relative; display: grid; justify-items: center; gap: 0.15rem; padding: var(--space-2) 0.2rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 0.6875rem; cursor: pointer; }
.avatar-choice input { position: absolute; opacity: 0; }
.avatar-choice .face { width: 2.6rem; height: 2.6rem; }
.avatar-choice:has(input:checked) { border: 2px solid var(--accent-strong); background: var(--accent-soft); }
.avatar-choice:has(input:focus-visible) { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

/* Groups and people (Clanz 3). */
.hub-button { width: 100%; font: inherit; text-align: left; cursor: pointer; }
.access-group-links { margin: var(--space-4) 0 0; text-align: center; font-weight: 700; }
.access-group-links a { color: var(--accent-strong); }
.group-link { display: flex; gap: var(--space-2); margin: var(--space-2) 0 0; }
.group-link input { flex: 1; min-width: 0; min-height: 2.75rem; padding: 0 var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font: inherit; font-size: 0.8125rem; }
.plain-fieldset { display: grid; gap: var(--space-1); margin: var(--space-2) 0; padding: 0; border: 0; }
.plain-fieldset legend { font-weight: 800; margin-bottom: var(--space-1); }

/* Access pages (sign-in, new group): radios, checkboxes and menus like the other fields. */
.login-form .check-row { display: flex; gap: var(--space-2); align-items: center; min-height: 2.5rem; font-weight: 600; }
.login-form .check-row input[type="radio"],
.login-form .check-row input[type="checkbox"] { flex: none; width: 1.25rem; height: 1.25rem; min-height: 0; margin: 0; padding: 0; box-shadow: none; accent-color: var(--accent-strong); }
.login-form select { width: 100%; min-height: 3rem; padding: 0 var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
.login-form .plain-fieldset legend { font-size: 0.875rem; }

/* W19: settings sections open in place, every page with one line that says what it is */
.hub-sections {
  display: grid;
  gap: var(--space-3);
}

.hub-section > summary {
  list-style: none;
  cursor: pointer;
}

.hub-section > summary::-webkit-details-marker {
  display: none;
}

.hub-section .hub-arrow {
  transition: transform 160ms ease;
}

.hub-section[open] .hub-arrow {
  transform: rotate(180deg);
}

.hub-entries {
  display: grid;
  gap: var(--space-1);
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
}

.hub-entries a {
  display: grid;
  gap: 0.125rem;
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-4);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.hub-entries a:hover,
.hub-entries a:focus-visible {
  background: var(--accent-soft);
}

.hub-entries span {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* W13: single values found by the settings search */
.hub-shortcuts:not(:has(li:not([hidden]))) {
  display: none;
}

.hub-shortcuts a {
  border-left-color: var(--sun);
}

.setting:has(:target) {
  border-radius: var(--radius-sm);
  outline: 3px solid var(--sun);
  outline-offset: 4px;
}

.setting :target {
  scroll-margin-top: 6rem;
}

/* D72: a field opened by a link (e.g. «paga oraria» in an activity) lands below the top bar. */
:target,
input:focus,
select:focus,
textarea:focus {
  scroll-margin-top: 6rem;
}

/* W25: ready packages */
.package-button {
  display: grid;
  gap: 0.125rem;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.package-button span {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* X01: a tapped button shows at once that its form is on the way */
.is-sending {
  opacity: 0.72;
  cursor: progress;
  pointer-events: none;
}

/* X11: rounded, modern choices (a card per option, pills for two or three) */
.choice-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.choice-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.2rem;
  padding: 0.9rem 0.9rem 0.8rem;
  border: 2px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.choice-card input,
.seg-pills input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-card:active {
  transform: scale(0.98);
}

.choice-card:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  box-shadow: 0 10px 26px -18px var(--accent);
}

.choice-card:has(input:checked)::after {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  content: "✓";
}

.choice-card:has(input:focus-visible),
.seg-pills label:has(input:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.choice-emoji {
  font-size: 1.8rem;
  line-height: 1.2;
}

.choice-card strong {
  font-size: 0.95rem;
}

.choice-card small {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.3;
}

.seg-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.seg-pills label {
  position: relative;
  cursor: pointer;
}

.seg-pills span {
  display: inline-block;
  padding: 0.55rem 1.2rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.seg-pills label:has(input:checked) span {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* X12: yes/no boxes become switches; the knob slides with a small bounce. The state shows by
   position too (left = no, right = yes), not only by colour. */
.check-row input[type="checkbox"],
.login-form .check-row input[type="checkbox"] {
  position: relative;
  flex: none;
  width: 2.6rem;
  height: 1.5rem;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 45%, var(--border));
  cursor: pointer;
  transition: background-color 220ms ease;
  appearance: none;
}

.check-row input[type="checkbox"]::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(1.5rem - 6px);
  height: calc(1.5rem - 6px);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 30%);
  content: "";
  transition: transform 260ms cubic-bezier(0.3, 1.5, 0.5, 1);
}

.check-row input[type="checkbox"]:checked {
  background: var(--accent);
}

.check-row input[type="checkbox"]:checked::after {
  transform: translateX(1.1rem);
}

.check-row input[type="checkbox"]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

html[data-motion="on"] .check-row input[type="checkbox"]:checked {
  animation: switch-pop 300ms ease;
}

@keyframes switch-pop {
  50% { transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .check-row input[type="checkbox"],
  .check-row input[type="checkbox"]::after {
    transition: none;
    animation: none;
  }
}

/* X14: every character makes its own small gesture now and then, inside its circle (no extra
   space): the knight draws his sword, the wizard casts a spell, the dragon breathes fire… Only
   transform and opacity, a short move in a long cycle; still with «riduci movimento». */
.face[data-av] { position: relative; container-type: size; }

.face[data-av]::after {
  position: absolute;
  right: 6%;
  bottom: 4%;
  font-size: 40cqw;
  line-height: 1;
  content: var(--prop, "");
  opacity: 0;
  pointer-events: none;
}

html:not([data-motion="off"]) .face[data-av] svg {
  animation: var(--gesture, none) var(--cycle, 8s) ease-in-out var(--delay, 1.5s) infinite;
}

html:not([data-motion="off"]) .face[data-av]::after {
  animation: var(--prop-move, none) var(--cycle, 8s) ease-out var(--delay, 1.5s) infinite;
}

/* Choosing an avatar shows its gesture at once and more often. */
.avatar-choice:has(input:checked) .face[data-av] { --cycle: 3.2s; --delay: 0.2s; }

.face[data-av="re"] { --prop: "⚜️"; --gesture: g-hop; --prop-move: p-raise; --cycle: 9s; --delay: 1.2s; }
.face[data-av="regina"] { --prop: "✨"; --gesture: g-tilt; --prop-move: p-burst; --cycle: 8.5s; --delay: 2.6s; }
.face[data-av="principe"] { --prop: "🗡️"; --gesture: g-lunge; --prop-move: p-draw; --cycle: 8s; --delay: 3.4s; }
.face[data-av="principessa"] { --prop: "💗"; --gesture: g-tilt; --prop-move: p-rise; --cycle: 9.5s; --delay: 1.8s; }
.face[data-av="cavaliere"] { --prop: "⚔️"; --gesture: g-lunge; --prop-move: p-draw; --cycle: 7.5s; --delay: 1s; }
.face[data-av="dama"] { --prop: "🌹"; --gesture: g-nod; --prop-move: p-rise; --cycle: 10s; --delay: 3s; }
.face[data-av="mago"] { --prop: "✨"; --gesture: g-cast; --prop-move: p-burst; --cycle: 7s; --delay: 2s; }
.face[data-av="strega"] { --prop: "💫"; --gesture: g-cast; --prop-move: p-burst; --cycle: 8.2s; --delay: 3.8s; }
.face[data-av="scudiero"] { --prop: "🛡️"; --gesture: g-lunge; --prop-move: p-raise; --cycle: 9s; --delay: 2.2s; }
.face[data-av="villico"] { --prop: "🌾"; --gesture: g-nod; --prop-move: p-swing; --cycle: 10.5s; --delay: 1.4s; }
.face[data-av="villica"] { --prop: "🌼"; --gesture: g-tilt; --prop-move: p-rise; --cycle: 9.8s; --delay: 4.2s; }
.face[data-av="giullare"] { --prop: "🎵"; --gesture: g-spin; --prop-move: p-rise; --cycle: 8.8s; --delay: 2.8s; }
.face[data-av="monaco"] { --prop: "🔔"; --gesture: g-nod; --prop-move: p-swing; --cycle: 11s; --delay: 3.2s; }
.face[data-av="drago"] { --prop: "🔥"; --gesture: g-puff; --prop-move: p-blow; --cycle: 7.8s; --delay: 1.6s; }
.face[data-av="gatto"] { --prop: "🐾"; --gesture: g-hop; --prop-move: p-raise; --cycle: 9.3s; --delay: 4s; }

/* Gestures of the face: all in the first ~14% of the cycle, still for the rest. */
@keyframes g-hop { 4% { transform: translateY(-9%); } 8% { transform: translateY(2%); } 11%, 100% { transform: none; } }
@keyframes g-tilt { 4% { transform: rotate(-10deg); } 9% { transform: rotate(7deg); } 13%, 100% { transform: none; } }
@keyframes g-lunge { 3% { transform: translateX(-6%) rotate(-5deg); } 7% { transform: translateX(5%) rotate(4deg); } 12%, 100% { transform: none; } }
@keyframes g-cast { 3% { transform: translateY(4%); } 7% { transform: translateY(-7%) scale(1.05); } 12%, 100% { transform: none; } }
@keyframes g-nod { 4% { transform: translateY(5%) rotate(3deg); } 8% { transform: none; } 11% { transform: translateY(4%); } 14%, 100% { transform: none; } }
@keyframes g-spin { 0% { transform: none; } 12%, 100% { transform: rotate(360deg); } }
@keyframes g-puff { 3% { transform: scale(1.07) translateX(-3%); } 7% { transform: scale(0.97) translateX(2%); } 11%, 100% { transform: none; } }

/* Moves of the prop. */
@keyframes p-draw {
  0% { opacity: 0; transform: translate(40%, 70%) rotate(-50deg); }
  5% { opacity: 1; transform: translate(0, 0) rotate(0); }
  8% { transform: scale(1.18); }
  13% { opacity: 1; transform: none; }
  17%, 100% { opacity: 0; transform: translate(10%, 30%) rotate(-20deg); }
}
@keyframes p-raise {
  0% { opacity: 0; transform: translateY(80%); }
  5% { opacity: 1; transform: translateY(-15%); }
  9% { transform: none; }
  14% { opacity: 1; }
  18%, 100% { opacity: 0; transform: translateY(40%); }
}
@keyframes p-burst {
  0% { opacity: 0; transform: scale(0.2) rotate(0); }
  6% { opacity: 1; transform: scale(1.25) rotate(90deg); }
  12% { opacity: 1; transform: scale(1) rotate(150deg); }
  16%, 100% { opacity: 0; transform: scale(0.4) rotate(200deg); }
}
@keyframes p-rise {
  0% { opacity: 0; transform: translateY(30%) scale(0.6); }
  5% { opacity: 1; transform: none; }
  15% { opacity: 0.9; transform: translate(-30%, -120%) scale(1.1); }
  18%, 100% { opacity: 0; transform: translate(-40%, -150%); }
}
@keyframes p-swing {
  0% { opacity: 0; transform: rotate(0); }
  3% { opacity: 1; transform: rotate(-25deg); }
  7% { transform: rotate(20deg); }
  11% { opacity: 1; transform: rotate(-10deg); }
  15%, 100% { opacity: 0; transform: rotate(0); }
}
@keyframes p-blow {
  0% { opacity: 0; transform: translateX(30%) scale(0.4); }
  5% { opacity: 1; transform: translateX(-60%) scale(1.1); }
  11% { opacity: 0.8; transform: translateX(-120%) scale(1.3); }
  15%, 100% { opacity: 0; transform: translateX(-150%) scale(0.8); }
}

@media (prefers-reduced-motion: reduce) {
  .face[data-av] svg,
  .face[data-av]::after { animation: none !important; }
}

/* X20: offline banner and the short note after a queued action */
.offline-banner {
  margin: 0 0 var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: var(--surface);
  font-size: 0.875rem;
  font-weight: 600;
}

.offline-banner[hidden] {
  display: none;
}

.offline-toast {
  position: fixed;
  right: var(--space-3);
  bottom: calc(5.5rem + env(safe-area-inset-bottom));
  left: var(--space-3);
  z-index: 60;
  margin: 0;
  padding: var(--space-3);
  border-radius: 14px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
}

/* K80 (D97): what waits for the network and what the server refused at its return */
.offline-list {
  display: grid;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-left: 4px solid var(--sun);
  border-radius: 14px;
  background: var(--surface);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.offline-list[hidden] {
  display: none;
}

.offline-list p,
.offline-list ul {
  margin: 0;
}

.offline-list ul {
  padding-left: 1.2rem;
}

.offline-list .button {
  justify-self: start;
}

/* css/v44-accesso.css */
/* Clanz 4.4 · filone «accesso»: solo questo filone scrive qui (tasks/v44-todo.md). */

/* C1 · «Chi sei?»: il gruppo in alto, le persone come schede grandi. */
.access-group {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-5);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.access-group-logo,
.group-card-logo {
  display: grid;
  flex: none;
  width: 3.25rem;
  height: 3.25rem;
  place-items: center;
  overflow: hidden;
  border-radius: 0.9rem;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 1.6rem;
  font-weight: 900;
}

.access-group-logo svg,
.group-card-logo svg {
  width: 100%;
  height: 100%;
}

.access-group-text,
.group-card-text {
  display: grid;
  min-width: 0;
  gap: 0.1rem;
  text-align: left;
}

.access-group-text strong {
  overflow: hidden;
  font-size: 1.125rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-group-text span,
.group-card-text > span {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.picker-heading {
  margin-bottom: var(--space-5);
}

.picker-heading h1 {
  margin-top: 0;
}

.profile-picker-grid {
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-picker-grid > li {
  display: grid;
}

.profile-picker-grid .profile-choice {
  position: relative;
  display: flex;
  min-height: 12.5rem;
  flex-direction: column;
  gap: 0.2rem;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  padding: var(--space-5) var(--space-3) var(--space-4);
  color: var(--text);
  --tone: var(--accent);
}

.profile-picker-grid .profile-choice::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3.6rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tone) 30%, transparent), color-mix(in srgb, var(--tone) 8%, transparent));
  content: "";
}

.profile-picker-grid > li:nth-child(4n + 2) .profile-choice { --tone: var(--sky); }
.profile-picker-grid > li:nth-child(4n + 3) .profile-choice { --tone: var(--mint); }
.profile-picker-grid > li:nth-child(4n + 4) .profile-choice { --tone: var(--sun); }

.profile-choice:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.picker-face {
  position: relative;
  margin-bottom: var(--space-2);
}

.picker-face .face-lg {
  border: 0.25rem solid var(--surface);
  background: var(--tone);
  box-shadow: 0 0.5rem 1.2rem color-mix(in srgb, var(--tone) 35%, transparent);
  color: #fff;
}

.picker-face .face[data-av] {
  background: color-mix(in srgb, var(--tone) 22%, var(--surface));
}

.picker-name {
  font-size: 1.125rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.picker-level,
.picker-seen {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.3;
}

.picker-level {
  font-weight: 700;
}

.profile-picker-grid .profile-choice .picker-state {
  display: inline-flex;
  max-width: 100%;
  gap: 0.3rem;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  text-align: center;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tone) 14%, var(--surface));
  color: var(--text);
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 1.2;
}

.profile-picker-grid .picker-state-wait {
  border: 1px dashed var(--border);
  background: var(--sun-soft);
}

.profile-picker-grid .picker-state-free {
  background: var(--mint-soft);
}

.profile-choice.is-invite .picker-face {
  opacity: 0.75;
}

.access-group-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  margin: var(--space-6) 0 0;
}

.access-pill {
  display: inline-flex;
  min-height: 2.75rem;
  gap: var(--space-2);
  align-items: center;
  padding: 0 var(--space-4);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 800;
  text-decoration: none;
}

.access-pill:hover {
  border-color: var(--accent);
}

/* «Gruppi»: una scheda per gruppo, quello in uso evidenziato, «Crea un gruppo» a parte. */
.group-cards {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.group-cards form {
  margin: 0;
}

.group-card {
  display: flex;
  width: 100%;
  min-height: 5rem;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}

.group-card:hover {
  border-color: var(--accent);
}

.group-card:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.group-card-text {
  flex: 1;
}

.group-card-text strong {
  font-size: 1.0625rem;
  overflow-wrap: anywhere;
}

.group-card-arrow {
  color: var(--accent-strong);
  font-weight: 900;
}

.group-card.is-current {
  border: 2px solid var(--accent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface) 70%);
}

.group-card-badge {
  justify-self: start;
  margin-top: 0.2rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff !important;
  font-size: 0.6875rem !important;
  font-weight: 800;
}

[data-theme="dark"] .group-card-badge {
  color: #1b1d22 !important;
}

.group-card-note {
  font-style: italic;
}

.group-card-new {
  border: 2px dashed var(--border);
  background: transparent;
  box-shadow: none;
}

.group-card-new .group-card-logo {
  background: var(--mint-soft);
  color: var(--mint);
}

/* Pagine del codice e dell'invito: il volto della persona in cima alla scheda. */
.login-face {
  display: inline-block;
  margin-bottom: var(--space-4);
}

.login-face .face-lg {
  background: var(--accent);
  box-shadow: 0 0.5rem 1rem color-mix(in srgb, var(--accent) 25%, transparent);
  color: #fff;
}

.login-face .face[data-av] {
  background: var(--accent-soft);
}

/* Entrata leggera: solo transform e opacity, ferma con «riduci movimento». */
@media (prefers-reduced-motion: no-preference) {
  .access-group,
  .profile-picker-grid > li,
  .group-cards > li,
  .login-card {
    animation: access-in 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  .profile-picker-grid > li:nth-child(2),
  .group-cards > li:nth-child(2) { animation-delay: 50ms; }
  .profile-picker-grid > li:nth-child(3),
  .group-cards > li:nth-child(3) { animation-delay: 100ms; }
  .profile-picker-grid > li:nth-child(4),
  .group-cards > li:nth-child(4) { animation-delay: 150ms; }
  .profile-picker-grid > li:nth-child(5),
  .group-cards > li:nth-child(5) { animation-delay: 200ms; }
  .profile-picker-grid > li:nth-child(6),
  .group-cards > li:nth-child(n + 6) { animation-delay: 250ms; }
  .profile-picker-grid > li:nth-child(7) { animation-delay: 300ms; }
  .profile-picker-grid > li:nth-child(n + 8) { animation-delay: 350ms; }

  .profile-choice:active,
  .group-card:active {
    transform: scale(0.98);
  }
}

@keyframes access-in {
  from {
    opacity: 0;
    transform: translateY(0.75rem) scale(0.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* C2 · codice (D40): la frase che spiega a cosa serve, chi entra senza codice. */
.code-purpose {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  margin: var(--space-3) 0 0;
  padding: var(--space-2) var(--space-3);
  border-left: 0.25rem solid var(--sky);
  border-radius: var(--radius-sm);
  background: var(--sky-soft);
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.4;
}

.login-card > .code-purpose {
  margin-top: var(--space-4);
}

.picker-form {
  display: grid;
  margin: 0;
}

.profile-picker-grid button.profile-choice {
  width: 100%;
  font: inherit;
  cursor: pointer;
}

.code-risk {
  margin-block: var(--space-4);
  border-color: color-mix(in srgb, var(--sun) 60%, var(--border));
  background: var(--sun-soft);
}

.code-risk h2 {
  margin-top: 0;
  font-size: 1.0625rem;
}

.code-remove {
  margin-top: var(--space-6);
}

.code-remove h2 {
  margin-top: 0;
  font-size: 1.0625rem;
}

.status-free {
  background: var(--mint-soft);
  color: var(--text);
}

.code-free-note {
  margin: var(--space-3) 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--mint-soft);
}

/* css/v44-gruppi.css */
/* Clanz 4.4 · filone «gruppi»: solo questo filone scrive qui (tasks/v44-todo.md). */

/* E1: «+ Un'altra persona» sparisce davvero quando non ci sono più righe (.button vince su [hidden]) */
[data-more-people][hidden] {
  display: none;
}

/* E2 (D41): la foto del gruppo (o la sua iniziale) al posto del logo disegnato */
.group-photo,
.group-initial {
  display: block;
  width: 100%;
  height: 100%;
}

.group-photo {
  object-fit: cover;
  border-radius: inherit;
}

.group-initial {
  display: grid;
  place-items: center;
  border-radius: inherit;
  background: var(--accent);
  color: var(--on-button, #fff);
  font-weight: 800;
  line-height: 1;
}

.group-initial[hidden] {
  display: none;
}

.logo-card-mark {
  display: block;
  flex: none;
  width: 3rem;
  height: 3rem;
  overflow: hidden;
  border-radius: 38% 62% 55% 45%;
  font-size: 1.4rem;
}

.group-photo-big {
  display: block;
  flex: none;
  width: 6rem;
  height: 6rem;
  overflow: hidden;
  border-radius: 38% 62% 55% 45%;
  font-size: 2.6rem;
}

.group-photo-panel,
.group-photo-pick-row {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.group-photo-panel {
  margin: var(--space-3) 0;
}

.group-photo-pick {
  display: grid;
  gap: var(--space-2);
}

.group-photo-pick-row input[type="file"] {
  min-width: 0;
  flex: 1;
}

/* E4: 🎵 nella barra in alto e pannello con il lettore, su ogni pagina */
button.icon-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 1.25rem;
  cursor: pointer;
}

button.icon-link[aria-expanded="true"] {
  background: var(--accent-soft);
}

.music-panel {
  display: grid;
  gap: var(--space-1);
  margin: var(--space-2) var(--space-4) 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.music-panel[hidden] {
  display: none;
}

.music-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.music-panel .music {
  margin: 0;
}

.topbar .icon-button,
.topbar .icon-link {
  flex: none;
}

/* Telefoni stretti: con il tasto 🎵 la barra non ha più posto per la scritta «Clanz». */
@media (max-width: 380px) {
  .topbar:has(.music-open) .brand:not(.group-switch-top) > span:last-child {
    display: none;
  }
}

/* css/v5-struttura.css */
/* Clanz 5.0 · filone struttura e aspetto (K10–K15, K20, K21).
   Un solo componente «blocco» riusato ovunque; bordi delle sezioni più spessi. */

:root {
  --block-line: 2px;
  --block-border: color-mix(in srgb, var(--text) 16%, var(--border));
  --block-gap: var(--space-4);
}

/* K20 · Il contorno di ogni riquadro di sezione si vede bene: due pixel, un po' più scuro. */
.panel,
.panel-form,
.section-group,
.hub-card,
.connection-card,
.group-card,
.chart-card,
.challenge-card,
.profile-capabilities,
.reminder-settings,
.blocco,
.blocco-tile {
  border-width: var(--block-line);
  border-style: solid;
  border-color: var(--block-border);
}

/* Le sottosezioni (le stanze dentro «Libere», i gruppi delle impostazioni) più staccate. */
.home-block .section-list,
.hub-sections {
  gap: var(--block-gap);
}

.home-block {
  margin: var(--space-5) 0;
}

/* K10 · Il blocco: un riquadro con titolo, il mattone di tutte le pagine. */
.blocco {
  margin-top: var(--space-5);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.blocco > :last-child {
  margin-bottom: 0;
}

.blocco-title {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin: 0 0 var(--space-3);
  font-size: 1.0625rem;
  font-weight: 800;
}

.blocco-title > [aria-hidden="true"] {
  font-size: 1.25rem;
}

.blocco > .help-text {
  margin-top: 0;
}

/* Blocchi affiancati: due per riga sul telefono. Una tendina aperta prende tutta la riga. */
.blocchi {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.blocchi > li {
  display: grid;
}

.blocchi > details[open],
.blocchi > .blocco-wide {
  grid-column: 1 / -1;
}

.blocco-tile {
  display: grid;
  align-content: start;
  gap: var(--space-1);
  min-height: 6.5rem;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.blocco-tile:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.blocco-tile strong {
  font-size: 0.9375rem;
  line-height: 1.25;
}

.blocco-tile > span:not(.ico-tondo) {
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.35;
}

/* K11 · L'ingranaggio in alto apre «Impostazioni». Con cinque icone a 390 px il nome «Clanz»
   accanto al logo lascia il posto (il link resta leggibile: ha la sua etichetta). */
@media (max-width: 26.5rem) {
  .topbar:has(.topbar-links > :nth-child(5)) .brand:not(.group-switch-top) > span:not(.brand-mark) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

.blocco .hub-card-big {
  margin: 0;
}

.hub-logout {
  display: grid;
  margin: var(--space-6) 0 var(--space-4);
}

/* K14 · «Cambia gruppo» e «Crea un nuovo gruppo»: grandi, affiancati, in cima alla pagina. */
.group-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.group-buttons .button {
  display: inline-flex;
  min-height: 3.5rem;
  gap: 0.375rem;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  font-size: 0.9375rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.access-group-links.group-buttons {
  margin: var(--space-4) 0 var(--space-2);
}

.group-card-top {
  margin: var(--space-4) 0 var(--space-5);
}

/* K15 · Collegamenti: una riga larga tra le impostazioni; sul timer senza musica, dove metterla. */
.blocco-tile-row {
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 0;
  column-gap: var(--space-3);
  align-items: center;
}

.blocco-tile-row > .ico-tondo {
  grid-row: 1 / span 2;
}

.settings-connections {
  margin-top: var(--space-4);
}

.music-add {
  display: block;
  margin: var(--space-3) 0;
  padding: var(--space-3);
  border: 2px dashed var(--block-border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.875rem;
  text-decoration: none;
}

.music-add strong {
  color: var(--accent-strong);
}

.music-panel-head .text-button {
  margin-left: auto;
}

/* K13 · Notifiche e livelli: dove si cambiano, detto chiaro. */
.hub-group-tiles {
  margin-top: var(--space-3);
}

.level-edit {
  margin: var(--space-3) 0 0;
  font-size: 0.875rem;
  font-weight: 700;
}

.level-edit a {
  color: var(--accent-strong);
}

#notifiche {
  scroll-margin-top: var(--space-4);
}

.help-text.level-edit {
  font-weight: 400;
}

/* K12 · «Regole della casa» a tendine: i gruppi sono blocchi che si aprono uno alla volta. */
.panel-form.settings-form {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

.settings-folds {
  display: grid;
  gap: var(--block-gap);
}

.panel-form details.settings-group {
  display: block;
  margin: 0;
  padding: 0;
  border-width: var(--block-line);
  border-color: var(--block-border);
  border-radius: var(--radius-lg);
}

.settings-group > .section-body {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4) var(--space-4);
}

.settings-group-help {
  margin: 0;
}

/* K21 · Profilo: «Le persone del gruppo» staccato da «Il mio livello», come un blocco a sé. */
.level-card + .people-card {
  margin-top: var(--space-6);
}

.people-card {
  margin-bottom: var(--space-6);
}

/* K10 · Blocchi ovunque, meno righe di elenco. */
.blocco .blocco-title {
  margin: 0 0 var(--space-3);
  font-size: 1.0625rem;
}

.blocco.profile-capabilities {
  margin-bottom: 0;
  border-radius: var(--radius-lg);
}

/* Oggi · «Prenotate»: chi fa cosa, due blocchi per riga invece di una lista. */
.home-booked .family-activity {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin: 0;
}

.home-booked .family-activity li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: start;
  align-items: start;
  gap: var(--space-2);
  padding: var(--space-3);
  border-width: var(--block-line);
  border-color: var(--block-border);
}

.home-booked .family-activity li > div {
  gap: 0.15rem;
  overflow-wrap: anywhere;
}

.home-booked .family-activity li > form {
  grid-column: 1 / -1;
}

.home-booked .family-activity li > form .button {
  width: 100%;
}

/* 25/10 · Impostazioni: tutte le voci uguali, una sotto l'altra (prima alcune erano lunghe e
   altre a metà). Icona, nome, cosa fa e la freccia per dire che si apre. */
.hub-list {
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2);
}

.hub-list .blocco-tile {
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  column-gap: var(--space-3);
  align-items: center;
  min-height: 4rem;
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
}

.hub-list .blocco-tile strong { grid-column: 2; }
.hub-list .blocco-tile > span:not(.ico-tondo) { grid-column: 2; }

.hub-list .blocco-tile::after {
  content: "›";
  grid-column: 3;
  grid-row: 1 / span 2;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
}

/* 25/10 · Profilo: «Impostazioni» è un tasto largo sotto l'intestazione, non un link piccolo. */
.profile-settings {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  width: 100%;
  min-height: 3.25rem;
  margin: var(--space-2) 0 var(--space-4);
  padding-inline: var(--space-4);
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
}

.profile-settings-arrow {
  margin-left: auto;
  font-size: 1.5rem;
  line-height: 1;
}

/* css/v5-ritocchi.css */
/* Clanz 5.0 · filone «ritocchi»: solo questo filone scrive qui (tasks/v5-todo.md). */

/* K22: l'icona del gruppo è sempre un cerchio perfetto, mai deformato né ruotato.
   Vale per la barra in alto, l'accesso, l'elenco e il cambio gruppo, le impostazioni. */
.brand-mark,
.access-group-logo,
.group-card-logo,
.logo-card-mark,
.group-photo-big {
  box-sizing: border-box;
  flex: none;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  transform: none;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
}

.access-group-logo,
.group-card-logo {
  width: 3.25rem;
  height: 3.25rem;
}

.logo-card-mark {
  width: 3rem;
  height: 3rem;
}

.group-photo-big {
  width: 6rem;
  height: 6rem;
}

.group-initial {
  /* the letter stays centred in the circle (v44-gruppi.css makes it a grid) */
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.group-photo,
.brand-mark svg,
.access-group-logo svg,
.group-card-logo svg,
.logo-card-mark svg {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.group-photo {
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center;
}

/* css/v5-vetro-fondo.css */
/* K25 + L156 (D158): the variables of the glass and its still background. In both bundles: the
   pages of the account use it also before entering a group. */
/* K25 · the glass. A still background in the colour's tones (a fixed layer: nothing repaints when
   scrolling), frosted bars like the Mac's Dock, see-through cards with a light metallic edge.
   Only the bars are blurred: blurring every card would slow cheap phones (K01). */
html[data-glass="on"] {
  --glass-fill: color-mix(in srgb, var(--surface) 62%, transparent);
  --glass-bar: color-mix(in srgb, var(--surface) 48%, transparent);
  --glass-chrome: color-mix(in srgb, var(--surface) 30%, transparent); /* 25/10: the two bars, see-through */
  --glass-edge: rgb(255 255 255 / 60%);
  --glass-sheen: linear-gradient(145deg, rgb(255 255 255 / 55%), rgb(255 255 255 / 8%) 45%, rgb(255 255 255 / 22%));
}

html[data-glass="on"][data-theme="dark"] {
  --glass-fill: color-mix(in srgb, var(--surface) 58%, transparent);
  --glass-bar: color-mix(in srgb, var(--surface) 50%, transparent);
  --glass-chrome: color-mix(in srgb, var(--surface) 36%, transparent);
  --glass-edge: rgb(255 255 255 / 14%);
  --glass-sheen: linear-gradient(145deg, rgb(255 255 255 / 12%), rgb(255 255 255 / 2%) 45%, rgb(255 255 255 / 6%));
}

html[data-glass="on"] body { background: transparent; } /* html paints --bg; a body background would cover the layer */
html[data-glass="on"] .app-shell { background: transparent; }

html[data-glass="on"] body::before {
  content: "";
  position: fixed;
  z-index: -1;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100lvh;
  /* 25/10 (Luca): still soft tints, but in patches here and there, each one distinct */
  background:
    radial-gradient(34% 24% at 8% 10%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 68%),
    radial-gradient(28% 20% at 90% 18%, color-mix(in srgb, var(--accent-strong) 42%, transparent), transparent 68%),
    radial-gradient(22% 16% at 42% 30%, color-mix(in srgb, #7aa8ff 24%, transparent), transparent 68%),
    radial-gradient(30% 22% at 74% 50%, color-mix(in srgb, #ff7ab6 26%, transparent), transparent 68%),
    radial-gradient(32% 22% at 12% 60%, color-mix(in srgb, var(--mint, var(--accent)) 40%, transparent), transparent 68%),
    radial-gradient(30% 20% at 52% 88%, color-mix(in srgb, var(--accent) 42%, transparent), transparent 68%),
    radial-gradient(24% 18% at 96% 82%, color-mix(in srgb, #ffc94d 32%, transparent), transparent 68%),
    var(--bg);
  pointer-events: none;
}

@media (prefers-reduced-transparency: reduce) {
  html[data-glass="on"] body::before { display: none; }
}

@media print {
  html[data-glass="on"] body::before { display: none; }
}

/* css/v5-foto.css */
/* Clanz 5.0 · filone «foto»: solo questo filone scrive qui (tasks/v5-todo.md). */

/* K60: la foto appena scelta compare nel cerchio, prima di «Salva». */
.photo-stage {
  position: relative;
  box-sizing: border-box;
  display: grid;
  flex: none;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
}

.photo-stage > .photo-new {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 50%;
  object-fit: cover;
}

.photo-stage.has-new > :not(.photo-new) {
  display: none;
}

.photo-stage.has-new {
  outline: 0.1875rem solid var(--accent, currentColor);
  outline-offset: 0.125rem;
}

.photo-caption {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.profile-photo-stage {
  width: 4.5rem;
}

/* K61: dentro il cerchio la foto si trascina e si ingrandisce; il cerchio diventa più grande. */
[data-photo-pick].is-cropping .photo-stage {
  width: min(16rem, 100%);
  height: auto;
  margin-inline: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.photo-stage.is-cropping > .photo-new {
  position: absolute;
  max-width: none;
  max-height: none;
  object-fit: fill;
  border-radius: 0;
  pointer-events: none;
}

.photo-stage.is-cropping:focus-visible {
  outline: 0.1875rem solid var(--accent, currentColor);
  outline-offset: 0.25rem;
}

.is-cropping .profile-photo-editor,
.is-cropping .group-photo-panel,
.is-cropping .group-photo-pick-row,
.is-cropping.group-photo-pick .group-photo-pick-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}

.photo-tools {
  display: grid;
  gap: var(--space-2);
  width: 100%;
  margin-block: var(--space-2);
}

.photo-tools[hidden] {
  display: none;
}

.photo-zoom {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-3);
  align-items: center;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 900;
}

.photo-zoom input[type="range"] {
  width: 100%;
  min-height: 2.75rem;
  accent-color: var(--accent, currentColor);
}

.photo-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* css/v51-elimina.css */
/* L69 (D105): «Elimina il gruppo», at the bottom of the settings and apart from the rest. */

.delete-group-zone {
  margin-top: var(--space-6, 2rem);
  padding: var(--space-4, 1rem);
  border: 2px dashed #b3261e;
  border-radius: var(--radius-md, 0.75rem);
  background: var(--surface);
}

.delete-group-zone h2 {
  margin: 0 0 var(--space-2, 0.5rem);
  font-size: 1.05rem;
}

.delete-group-zone p {
  margin: 0 0 var(--space-3, 0.75rem);
  color: var(--text-muted);
}

.delete-group-link,
.delete-group-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
}

.delete-group-link {
  border: 2px solid #b3261e;
  background: transparent;
  color: #b3261e;
  font-weight: 800;
  text-decoration: none;
}

[data-theme="dark"] .delete-group-link,
[data-theme="dark"] .delete-group-text {
  border-color: #ff8a78;
  color: #ff8a78;
}

.delete-group-list {
  display: grid;
  gap: var(--space-2, 0.5rem);
  margin: 0;
  padding-left: 1.25rem;
}

.delete-group-confirm {
  border: 2px solid #b3261e;
}

.delete-group-form {
  display: grid;
  gap: var(--space-2, 0.5rem);
}

.delete-group-form input[type="text"] {
  min-height: 2.75rem;
  padding: 0 var(--space-3, 0.75rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 0.5rem);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.delete-group-form input[aria-invalid="true"] {
  border: 2px solid #b3261e;
}

.delete-group-button {
  width: 100%;
  margin-top: var(--space-2, 0.5rem);
}

.group-delete-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3, 0.75rem);
  margin-top: var(--space-5, 1.5rem);
  padding-top: var(--space-4, 1rem);
  border-top: 1px solid var(--border);
}

.group-delete-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  font-weight: 800;
}

.delete-group-text {
  color: #b3261e;
}

.deleted-group-card {
  border-style: dashed;
  text-decoration: none;
}

/* css/v51-account.css */
/* L79 (D109): the Clanz account, at the sign-in, in «Cambia gruppo» and in «Il mio account». */

/* «Entra con il tuo account» across the two buttons of the sign-in page. */
.group-buttons .group-account {
  grid-column: 1 / -1;
}

.account-badge {
  display: inline-grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto var(--space-2, 0.5rem);
  border-radius: 50%;
  background: var(--accent-soft);
  font-size: 1.75rem;
}

.account-card {
  text-align: center;
}

.account-card .login-form {
  text-align: start;
}

.account-note {
  margin: var(--space-4, 1rem) 0 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  text-align: center;
}

/* «Scollega»: asked once more, never a single tap away. */
.account-unlink summary {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  cursor: pointer;
}

.account-unlink form {
  display: grid;
  gap: var(--space-2, 0.5rem);
  padding: var(--space-3, 0.75rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 0.5rem);
}

.account-unlink p {
  margin: 0;
}

.account-panel {
  margin-top: var(--space-4, 1rem);
}

.account-panel h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.account-recovery-form {
  display: grid;
  gap: var(--space-2, 0.5rem);
}

.account-recovery-form input {
  min-height: 2.75rem;
  padding: 0 var(--space-3, 0.75rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 0.5rem);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

/* The pages before a group use the sign-in style sheets, without `.panel`. */
.access-main .account-panel {
  padding: var(--space-4, 1rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 1rem);
  background: var(--surface);
}

.account-manage {
  margin: 0;
  text-align: center;
}

.account-manage a {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
  min-height: 2.75rem;
  color: var(--accent-strong);
  font-weight: 800;
}

.account-code {
  display: grid;
  gap: var(--space-3, 0.75rem);
  text-align: center;
}

.account-code .form-actions .button {
  width: 100%;
}

/* L170 (D166): «Crea il tuo account», on top of the Account of who has none. */
.account-create {
  margin-top: 0;
  margin-bottom: var(--space-5, 1.5rem);
}

.account-create-card {
  display: grid;
  justify-items: center;
  gap: var(--space-2, 0.5rem);
  padding: var(--space-5, 1.5rem) var(--space-4, 1rem) var(--space-4, 1rem);
  border: 2px solid var(--accent);
  border-radius: var(--pp-radius, 1.25rem);
  background: var(--surface);
  box-shadow: var(--pp-shadow, none);
  text-align: center;
}

.account-create-card h2 {
  margin: var(--space-1, 0.25rem) 0 0;
  font-size: 1.375rem;
}

.account-create-card p {
  margin: 0;
  color: var(--text-muted);
}

.account-create-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.375rem;
  margin: var(--space-1, 0.25rem) 0;
  padding: 0;
  list-style: none;
}

.account-create-steps li {
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 0.8125rem;
  font-weight: 700;
}

.account-create-card .button {
  width: 100%;
}

.create-title {
  font-size: 1.5rem;
  text-align: center;
}

/* One step of the new account: a card with its sign on top. */
.create-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2, 0.5rem);
  margin-bottom: var(--space-4, 1rem);
  padding: var(--space-4, 1rem);
  border: 1px solid var(--border);
  border-radius: var(--pp-radius, 1.25rem);
  background: var(--surface);
  text-align: start;
}

.create-step[hidden] {
  display: none;
}

.create-step > .ico-grande {
  justify-self: center;
}

.create-step .passo-domanda {
  margin: 0;
  text-align: center;
}

.create-step label {
  font-weight: 800;
}

.create-step input:not([type="checkbox"], [type="file"], [type="range"]) {
  box-sizing: border-box;
  width: 100%;
  min-height: 3rem;
  padding: 0 var(--space-3, 0.75rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 0.5rem);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.create-step .help-text {
  margin: 0;
}

.create-email summary {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--accent-strong);
  font-weight: 700;
  cursor: pointer;
}

/* Before a group there is no bar of the app under the one of the steps. */
.access-body .passi-attivo .passi-barra {
  bottom: calc(0.75rem + env(safe-area-inset-bottom));
}

.access-body .login-card .passi-attivo .create-step {
  padding: 0;
  border: 0;
  background: none;
}

/* L173 (D166): the account's photo, chosen and cut like the one of a group profile. */
.account-photo-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: var(--space-2, 0.5rem);
  text-align: center;
}

.account-photo-field .photo-stage {
  display: grid;
  place-items: center;
  width: 9rem;
  height: 9rem;
  overflow: hidden;
  border-radius: 50%;
  background: var(--accent-soft);
  font-size: 3.5rem;
}

.account-photo-field .photo-stage.is-cropping {
  width: min(100%, 16rem);
  height: auto;
  aspect-ratio: 1;
}

.account-photo-field .photo-stage > img:not(.photo-new) {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-photo-field input[type="file"] {
  max-width: 100%;
  min-height: 2.75rem;
}

.account-photo-field input[type="file"]::file-selector-button {
  min-height: 2.75rem;
  margin-right: var(--space-2, 0.5rem);
  padding: 0 var(--space-3, 0.75rem);
  border: 2px solid var(--accent);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-strong);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.account-photo-field small {
  color: var(--text-muted);
}

.account-photo-field .photo-tools {
  width: 100%;
}

.account-photo-remove {
  display: flex;
  align-items: center;
  gap: var(--space-2, 0.5rem);
  min-height: 2.75rem;
}

/* The code in its card: all of it on one line, to read and to copy. */
.account-code input.recovery-code {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: var(--space-4, 1rem) var(--space-2, 0.5rem);
  color: var(--text);
  font-size: clamp(1.25rem, 6.4vw, 1.75rem);
}

.account-code .button {
  width: 100%;
}

.account-code .form-actions {
  margin: 0;
}

/* css/v51-sfondo.css */
/* L108 + L111 (D130, D131): the characters of personaggi.svg moving behind the page
   (templates/core/_sfondo_personaggi.html). Only `transform` moves, nothing takes a tap, and the
   text above keeps its contrast: «accesso» is blurred, «app» is a faint tilted column. */
/* The page is one stacking context, so the layer (z-index -1) paints above the page's own
   background and still under everything written on it. */
body {
  isolation: isolate;
}

.sfondo {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}

/* Accesso: bigger, blurred, wandering slowly */
.sfondo-accesso .sf-fig {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: clamp(48px, 14vw, 84px);
  height: clamp(48px, 14vw, 84px);
  opacity: 0.35;
  filter: blur(3px);
  will-change: transform;
  animation: sf-vaga var(--durata, 24s) ease-in-out var(--ritardo, 0s) infinite alternate;
}

.sfondo-accesso .sf-fig:nth-child(1) { --x: 4%; --y: 6%; --durata: 27s; --ritardo: -6s; --sposta: -1; }
.sfondo-accesso .sf-fig:nth-child(2) { --x: 58%; --y: 4%; --durata: 22s; --ritardo: -11s; --sposta: 1; }
.sfondo-accesso .sf-fig:nth-child(3) { --x: 30%; --y: 22%; --durata: 29s; --ritardo: -16s; --sposta: -1; }
.sfondo-accesso .sf-fig:nth-child(4) { --x: 72%; --y: 30%; --durata: 24s; --ritardo: -4s; --sposta: 1; }
.sfondo-accesso .sf-fig:nth-child(5) { --x: 8%; --y: 40%; --durata: 31s; --ritardo: -9s; --sposta: -1; }
.sfondo-accesso .sf-fig:nth-child(6) { --x: 48%; --y: 46%; --durata: 26s; --ritardo: -14s; --sposta: 1; }
.sfondo-accesso .sf-fig:nth-child(7) { --x: 80%; --y: 58%; --durata: 21s; --ritardo: -2s; --sposta: -1; }
.sfondo-accesso .sf-fig:nth-child(8) { --x: 22%; --y: 64%; --durata: 28s; --ritardo: -7s; --sposta: 1; }
.sfondo-accesso .sf-fig:nth-child(9) { --x: 60%; --y: 72%; --durata: 23s; --ritardo: -12s; --sposta: -1; }
.sfondo-accesso .sf-fig:nth-child(10) { --x: 2%; --y: 82%; --durata: 30s; --ritardo: -17s; --sposta: 1; }
.sfondo-accesso .sf-fig:nth-child(11) { --x: 40%; --y: 86%; --durata: 25s; --ritardo: -5s; --sposta: -1; }
.sfondo-accesso .sf-fig:nth-child(12) { --x: 76%; --y: 88%; --durata: 20s; --ritardo: -10s; --sposta: 1; }
.sfondo-accesso .sf-fig:nth-child(13) { --x: 18%; --y: 12%; --durata: 27s; --ritardo: -15s; --sposta: -1; }
.sfondo-accesso .sf-fig:nth-child(14) { --x: 86%; --y: 14%; --durata: 22s; --ritardo: -3s; --sposta: 1; }
.sfondo-accesso .sf-fig:nth-child(15) { --x: 44%; --y: 6%; --durata: 29s; --ritardo: -8s; --sposta: -1; }
.sfondo-accesso .sf-fig:nth-child(16) { --x: 14%; --y: 52%; --durata: 24s; --ritardo: -13s; --sposta: 1; }
.sfondo-accesso .sf-fig:nth-child(17) { --x: 66%; --y: 46%; --durata: 31s; --ritardo: -1s; --sposta: -1; }
.sfondo-accesso .sf-fig:nth-child(18) { --x: 88%; --y: 74%; --durata: 26s; --ritardo: -6s; --sposta: 1; }

@keyframes sf-vaga {
  from {
    transform: translate3d(0, 0, 0) rotate(-4deg);
  }
  to {
    transform: translate3d(calc(var(--sposta, 1) * 9vw), 7vh, 0) rotate(5deg);
  }
}

/* App (L125, D140; L134): 20 tilted columns close together, figures a bit bigger, sliding forever
   in opposite ways, very faint. Every column is the same run of 22 characters written twice: the
   loop moves it by exactly one run (-50%), so what leaves at the top is what comes back at the
   bottom and nothing ever empties. The space is the margin of each figure (not a flex gap), so one
   run is exactly half of the column; a run is taller than the layer. The columns start at
   different moments (negative delays), so neighbours never line up. */
.sfondo-app {
  opacity: 0.09;
  --spazio: 22px;
}

.sf-colonne {
  position: absolute;
  inset: -25% -15%;
  display: flex;
  align-items: flex-start; /* each column as tall as its own run: -50% is then exactly one run */
  justify-content: center;
  gap: 24px;
  transform: rotate(-12deg);
}

.sf-colonna {
  display: flex;
  flex-direction: column;
  flex: none;
  will-change: transform;
}

.sf-colonna .sf-fig {
  width: 44px;
  height: 44px;
  flex: none;
  margin-bottom: var(--spazio);
}

.sf-su {
  animation: sf-su 110s linear infinite;
}

.sf-giu {
  animation: sf-giu 110s linear infinite;
}

.sf-colonna:nth-child(3n) {
  animation-duration: 130s;
  animation-delay: -40s;
}

.sf-colonna:nth-child(3n + 1) {
  animation-delay: -75s;
}

.sf-colonna:nth-child(4n) {
  animation-duration: 120s;
  animation-delay: -20s;
}

@keyframes sf-su {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(0, -50%, 0);
  }
}

@keyframes sf-giu {
  from {
    transform: translate3d(0, -50%, 0);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

@media (min-width: 900px) {
  .sfondo-app {
    --spazio: 30px;
  }

  .sf-colonne {
    gap: 34px;
  }

  .sf-colonna .sf-fig {
    width: 54px;
    height: 54px;
  }
}

/* Still: «riduci movimento», the tab hidden (js/sfondo.js), animations switched off */
@media (prefers-reduced-motion: reduce) {
  .sfondo .sf-fig,
  .sfondo .sf-colonna {
    animation: none;
  }
}

.sfondo-fermo .sfondo .sf-fig,
.sfondo-fermo .sfondo .sf-colonna,
html[data-motion="off"] .sfondo .sf-fig,
html[data-motion="off"] .sfondo .sf-colonna {
  animation-play-state: paused;
}

@media print {
  .sfondo {
    display: none;
  }
}

/* css/v51-benvenuto.css */
/* L177 (D164, was L108): the first screen, minimal: much room, the logo in the middle, one line,
   one full command, one light, one in small text; «Scarica» and «Condividi» at the bottom. */
.welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  max-width: 22rem;
  min-height: calc(100vh - 9rem);
  min-height: calc(100svh - 9rem);
  margin: 0 auto;
  text-align: center;
}

.welcome-hero {
  display: grid;
  flex: 1 0 auto;
  align-content: center;
  justify-items: center;
  gap: var(--space-3);
  padding-block: var(--space-4);
}

.welcome-logo {
  width: clamp(7rem, 40vw, 10rem);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgb(0 0 0 / 16%));
}

.welcome h1 {
  margin: 0;
  font-size: clamp(2.75rem, 14vw, 3.75rem);
  letter-spacing: -0.06em;
  line-height: 1;
}

.welcome-lead {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.0625rem;
}

.welcome-choices {
  display: grid;
  width: 100%;
  gap: var(--space-3);
}

.welcome-choice {
  display: flex;
  min-height: 3.5rem;
  align-items: center;
  justify-content: center;
  border: 1.5px solid transparent;
  border-radius: 999px;
  color: var(--text);
  font-size: 1.0625rem;
  font-weight: 800;
  text-decoration: none;
}

.welcome-choice[data-peso="pieno"] {
  background: var(--button-bg, var(--accent-strong));
  color: var(--on-button, #fff);
}

[data-theme="dark"] .welcome-choice[data-peso="pieno"] {
  background: var(--button-bg, var(--accent));
  color: var(--on-button, #1b1d21);
}

.welcome-choice[data-peso="leggero"] {
  border-color: var(--border);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
}

.welcome-choice[data-peso="testo"] {
  min-height: 2.75rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 700;
}

.welcome-choice:hover {
  filter: brightness(1.04);
}

.welcome-warning {
  width: 100%;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.welcome-warning > summary {
  min-height: 2.75rem;
  align-content: center;
  cursor: pointer;
}

.welcome-warning > p {
  margin: 0;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
}

.welcome-more {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 0 var(--space-5);
  font-size: 0.9375rem;
}

.welcome-scarica,
.condividi-clanz > summary {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.condividi-clanz > summary {
  list-style: none;
}

.condividi-clanz > summary::-webkit-details-marker {
  display: none;
}

/* open (no share sheet on this device): the ways to send it, on a line of their own */
.condividi-clanz[open] {
  flex-basis: 100%;
}

.condividi-clanz[open] > summary {
  justify-content: center;
  width: 100%;
}

.group-buttons .group-other {
  grid-column: 1 / -1;
}

.welcome-group-form {
  width: 100%;
  text-align: left;
}

/* L126 (D140) + L177 (D164): «Accedi»: the logo, two airy roads, few words. */
.accedi {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-4);
  max-width: 24rem;
  margin: 0 auto;
  padding-bottom: var(--space-5);
  text-align: center;
}

.accedi-testa {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
}

.accedi-logo {
  width: 5.5rem;
  height: 5.5rem;
  object-fit: contain;
}

.accedi h1 {
  margin: 0;
  font-size: 2.25rem;
  letter-spacing: -0.05em;
  line-height: 1;
}

.accedi-strada {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.accedi-strada h2 {
  margin: 0;
  font-size: 1.2rem;
}

.accedi-strada p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.accedi-strada .accedi-noto {
  color: var(--text);
}

.accedi-azione {
  display: inline-flex;
  width: 100%;
  min-height: 3.25rem;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.accedi-gruppi {
  display: grid;
  width: 100%;
  gap: var(--space-2);
  margin: 0;
}

.accedi-gruppo {
  display: flex;
  width: 100%;
  min-height: 3.25rem;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.accedi-strada .accedi-o {
  font-size: 0.8125rem;
}

.accedi-form {
  display: grid;
  width: 100%;
  gap: var(--space-2);
  text-align: left;
}

/* L127 (D140): l'invito di prova spiegato; il benvenuto sopra il modulo di chi è invitato. */
.invito-spiegato h2 {
  margin: var(--space-4) 0 var(--space-1);
  font-size: 1.15rem;
}

.invito-spiegato .setup-hints {
  display: grid;
  gap: var(--space-2);
}

.invito-benvenuto {
  margin: 0 0 var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  box-shadow: var(--shadow);
}

.invito-benvenuto h2 {
  margin: 0 0 var(--space-2);
  font-size: 1.35rem;
}

.invito-passi {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.accedi-form input {
  width: 100%;
  min-height: 3rem;
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
}

/* css/v51-passi.css */
/* Clanz 5.1 · «Aggiungi» a passi (L151, L152, L154, D156): le carte da toccare, il calendario, la
   barra «Indietro / Avanti» e «L'ho già fatta» in Oggi. La regola è in docs/stile.md, §5. */

.passi,
.passo {
  display: grid;
  align-content: start;
  gap: var(--space-3);
}

.passi [hidden],
.passi-pagina [hidden],
.add-resto[hidden] {
  display: none !important;
}

.passo-domanda {
  margin: 0;
  font-size: 1.375rem;
}

.passo-domanda:focus {
  outline: none;
}

.passo label,
.passo p {
  margin-block: 0;
}

/* I campi hanno l'aspetto di quelli di sempre (.panel-form). */
.passo input:not([type="checkbox"], [type="radio"], [type="search"]),
.passo select,
.passo textarea {
  width: 100%;
  min-height: 3.25rem;
  padding: var(--space-3) var(--space-4);
  border: var(--st-line, 2px solid var(--border));
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgb(15 20 40 / 8%);
  color: var(--text);
  font: inherit;
}

.passo > label:not(.scelta, .check-row) {
  font-weight: 800;
}

/* L'interruttore («La faccio io adesso») sta in una carta come le altre (L160). */
.passo > .check-row {
  gap: var(--space-3);
  min-height: 4.25rem;
  padding: var(--space-3) var(--space-4);
  border: var(--st-line, 2px solid var(--border));
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgb(15 20 40 / 8%);
  font-size: 1rem;
  font-weight: 800;
}

/* Quello che serve solo senza JavaScript sparisce quando il percorso parte, e viceversa. */
.passi-attivo .passi-senza-js,
.passi-attivo .passi-data {
  display: none;
}

.passi-indicatore {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 800;
}

.passi-indicatore::after {
  display: block;
  height: 0.375rem;
  margin-top: var(--space-1);
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent) calc(var(--passi-fatti, 0) * 100%), var(--border) 0);
  content: "";
}

/* Col percorso partito resta un titolo solo, quello del passo (L157): il nome della pagina rimane
   per chi usa il lettore di schermo. */
.passi-titolo {
  margin-bottom: var(--space-3);
}

html.ha-passi .passi-titolo {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 1 · La carta da scegliere (L157, D159): un widget di Oggi (D146) con dentro un radio vero, e la
   carta intera si tocca. Icona grande nel cerchio, nome in grassetto, al massimo una riga piccola.
   Scelta = bordo, fondo e ✓. */
.scelte {
  display: grid;
  gap: var(--space-3);
}

.scelte-griglia {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.scelta {
  --ico-size: 3rem;
  --ico-font: 1.6rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: flex-start;
  justify-content: flex-start;
  min-width: 0;
  min-height: 8rem;
  padding: 0.85rem;
  border: var(--st-line, 2px solid var(--border));
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgb(15 20 40 / 8%);
  color: var(--text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.scelta > input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.scelta > .ico-tondo {
  margin-bottom: 0.15rem;
}

.scelta-testo {
  display: grid;
  gap: 0.125rem;
  min-width: 0;
  margin-top: auto;
  overflow-wrap: anywhere;
}

.scelta-testo > strong {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
}

.scelta-testo > span {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
}

/* Una scelta da sola prende tutta la riga, con l'icona di fianco. */
.scelta-larga {
  grid-column: 1 / -1;
  flex-direction: row;
  gap: var(--space-3);
  align-items: center;
  min-height: 4.75rem;
  padding-right: 3rem;
}

.scelta-larga > .ico-tondo {
  margin-bottom: 0;
}

.scelta-larga .scelta-testo {
  margin-top: 0;
}

.scelta-altra {
  border-style: dashed;
}

.scelta:has(input:checked) {
  border-color: var(--accent-strong);
  border-style: solid;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  box-shadow: 0 0 0 2px var(--accent-strong);
}

.scelta:has(input:checked)::after {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--accent-strong);
  color: var(--surface);
  content: "✓";
  font-size: 0.875rem;
  font-weight: 900;
}

.scelta:has(input:focus-visible) {
  outline: 0.1875rem solid var(--focus);
  outline-offset: 0.25rem;
}

/* Il disegno di una sezione dentro il cerchio, dove non c'è un'emoji. */
.ico-disegno {
  width: 70%;
  height: 70%;
  color: var(--accent-strong);
}

/* Le sezioni di «L'ho già fatta»: carte anche loro, due per riga; aperta, prende tutta la riga. */
.passi .section-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0;
}

.passi .section-list > *,
.passi .section-list .section-group[open] {
  grid-column: 1 / -1;
}

.passi .section-list > .section-group {
  grid-column: auto;
  border: var(--st-line, 2px solid var(--border));
  border-radius: 20px;
  box-shadow: 0 6px 18px rgb(15 20 40 / 8%);
}

.passi .section-list > .section-group[open] {
  grid-column: 1 / -1;
}

.passi .section-group > .section-bar {
  --ico-size: 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  gap: 0.125rem;
  align-content: start;
  justify-items: start;
  height: 100%;
  min-height: 8rem;
  padding: 0.85rem;
  background: none;
  clip-path: none;
}

.passi .section-bar > .ico-tondo {
  grid-area: 1 / 1;
  margin-bottom: 0.3rem;
}

.passi .section-bar > .section-name {
  grid-area: 2 / 1;
  align-self: end;
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.passi .section-bar > .section-meta {
  grid-area: 3 / 1;
  font-size: 0.8rem;
}

.passi .section-bar > .section-chevron {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  margin: 0;
}

.passi .section-group[open] > .section-bar {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: var(--space-3);
  align-content: center;
  height: auto;
  min-height: 4.75rem;
}

.passi .section-group[open] > .section-bar > .ico-tondo {
  grid-area: 1 / 1 / 3 / 2;
  margin-bottom: 0;
}

.passi .section-group[open] > .section-bar > .section-name {
  grid-area: 1 / 2;
}

.passi .section-group[open] > .section-bar > .section-meta {
  grid-area: 2 / 2;
}

/* Le occasionali aperte, sotto il primo passo: la stessa carta, con il suo «Inizia ora». */
.carta-aperta {
  --ico-size: 3rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: flex-start;
  min-width: 0;
  padding: 0.85rem;
  border: var(--st-line, 2px solid var(--border));
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgb(15 20 40 / 8%);
}

.carta-aperta h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.carta-aperta h3 a {
  color: var(--text);
  text-decoration: none;
}

.carta-aperta p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.carta-aperta form {
  display: grid;
  align-self: stretch;
  margin: auto 0 0;
  padding-top: var(--space-1);
}

/* L'avviso che serve, in una riga piccola. */
.passi-nota {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* Nome e sezione scritti a mano: solo con «Un'altra, la scrivo io». */
.passi-altra {
  display: grid;
  gap: var(--space-2);
}

.passi-attivo:not(:has(input[name="chore"][value="altro"]:checked)) .passi-altra {
  display: none;
}

.passi .search-box input {
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* 2 · Il calendario a mese: 7 colonne per 6 righe, in una carta come le altre. */
.calendario {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-2);
  border: var(--st-line, 2px solid var(--border));
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgb(15 20 40 / 8%);
}

/* Il carosello del tempo, la stessa carta. */
.passo .wheel {
  border: var(--st-line, 2px solid var(--border));
  border-radius: 20px;
  box-shadow: 0 6px 18px rgb(15 20 40 / 8%);
}

.cal-testa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.cal-mese {
  font-weight: 800;
}

.cal-freccia {
  width: 2.75rem;
  height: 2.75rem;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.cal-freccia:disabled {
  opacity: 0.35;
  cursor: default;
}

.cal-settimana,
.cal-giorni {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.1875rem;
}

.cal-settimana {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.cal-giorno {
  position: relative;
  display: grid;
  place-content: center;
  justify-items: center;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
}

.cal-giorno.is-altro-mese {
  border-style: dashed;
  color: var(--text-muted);
}

/* Spento: niente bordo e numero barrato dal colore tenue. */
.cal-giorno:disabled {
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
  font-weight: 400;
  opacity: 0.4;
  cursor: default;
}

.cal-giorno.is-oggi .cal-numero {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.15em;
}

.cal-oggi {
  font-size: 0.625rem;
  font-weight: 800;
}

.cal-giorno[aria-pressed="true"] {
  border: 2px solid var(--text);
  background: color-mix(in srgb, var(--accent) 34%, var(--surface));
  box-shadow: 0 0 0 2px var(--accent-strong);
  color: var(--text);
}

.cal-giorno[aria-pressed="true"]::after {
  position: absolute;
  top: 0;
  right: 0.125rem;
  content: "✓";
  font-size: 0.6875rem;
  font-weight: 900;
}

.cal-chiusa {
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 700;
}

/* 3 · Il riepilogo. */
.passi-riepilogo {
  display: grid;
  margin: 0;
  padding: 0 var(--space-4);
  border: var(--st-line, 2px solid var(--border));
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgb(15 20 40 / 8%);
}

.passi-riepilogo > div {
  padding: var(--space-3) 0;
}

.passi-riepilogo > div + div {
  border-top: 1px solid var(--border);
}

.passi-riepilogo dt {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.passi-riepilogo dd {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* Il vetro di K25 sulle carte, come sui widget. La scelta resta piena e col suo bordo. */
html[data-glass="on"] :is(.scelta, .carta-aperta, .calendario, .passo .wheel, .passo > .check-row, .passi-riepilogo, .passi .section-group) {
  border-color: var(--block-border, var(--border));
  background-color: var(--glass-fill);
  background-image: var(--glass-sheen);
  box-shadow: inset 0 1px 0 var(--glass-edge), 0 10px 30px rgb(15 20 40 / 10%);
}

html[data-glass="on"] .scelta:has(input:checked) {
  border-color: var(--accent-strong);
  background-color: color-mix(in srgb, var(--accent) 16%, var(--surface));
  background-image: none;
  box-shadow: 0 0 0 2px var(--accent-strong);
}

@media (prefers-reduced-transparency: reduce) {
  html[data-glass="on"] :is(.scelta:not(:has(input:checked)), .carta-aperta, .calendario, .passo .wheel, .passo > .check-row, .passi-riepilogo, .passi .section-group) {
    background-color: var(--surface);
    background-image: none;
  }
}

/* 4 · La barra «Indietro / Avanti»: senza JavaScript è solo «Salva» in fondo al modulo; con il
   percorso resta ferma in basso, sopra la barra di navigazione. */
.passi-barra {
  display: grid;
  gap: var(--space-2);
}

.passi-tasti {
  display: flex;
  gap: var(--space-2);
}

.passi-tasti > .button {
  gap: 0.4rem;
  min-height: 3.25rem;
  border-radius: 999px;
}

.passi-avanti,
.passi-salva {
  flex: 1;
}

.passi-avanti:disabled {
  border: 2px dashed var(--border);
  background: var(--surface);
  box-shadow: none;
  color: var(--text-muted);
  cursor: default;
}

.passi-aiuto {
  margin: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.passi-aiuto.is-pronto {
  color: var(--text);
  font-weight: 800;
}

.passi-attivo .passi-barra {
  position: fixed;
  z-index: 19;
  right: var(--space-3);
  bottom: calc(5.5rem + env(safe-area-inset-bottom));
  left: var(--space-3);
  max-width: 36rem;
  margin-inline: auto;
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: 1.6rem; /* the same capsule as the bar of the app below (K25) */
  background: var(--surface);
  box-shadow: 0 0.5rem 1.5rem rgb(20 16 12 / 18%);
}

/* With the glass the bar is frosted like the dock, but fuller: its words stay easy to read. */
html[data-glass="on"] .passi-attivo .passi-barra {
  border-color: var(--glass-edge);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  background-image: var(--glass-sheen);
  backdrop-filter: blur(18px) saturate(180%);
}

/* The little line of «you are here» of «Aggiungi» would show on top of «Avanti» (L160): with the
   bar of the steps in view the page says by itself where one is. */
body:has(.passi-attivo) .nav-item-primary.is-active::before {
  display: none;
}

@media (prefers-reduced-transparency: reduce) {
  html[data-glass="on"] .passi-attivo .passi-barra {
    background: var(--surface);
    backdrop-filter: none;
  }
}

/* La barra non copre l'ultima riga del passo, né quello che si porta in vista. */
.passi-attivo {
  padding-bottom: 8rem;
}

.passi-attivo:has(~ .add-resto:not([hidden])) {
  padding-bottom: 0;
}

.add-resto {
  display: grid;
  gap: var(--space-4);
  padding-bottom: 7rem;
}

html:not(.ha-passi) .add-resto {
  padding-bottom: 0;
}

html.ha-passi {
  scroll-padding-bottom: 13rem;
}

@media (min-width: 48rem) {
  .passi-attivo .passi-barra {
    bottom: calc(6.75rem + env(safe-area-inset-bottom));
  }
}

/* 5 · «L'ho già fatta» in Oggi: il corpo di un widget di D146, a tutta larghezza. */
.gia-fatta-home {
  --ico-size: 3rem;
  --ico-font: 1.5rem;
  --tone: var(--mint);
  display: flex;
  gap: var(--space-3);
  align-items: center;
  min-height: 4.25rem;
  margin-block: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--accent-strong);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--text);
  text-decoration: none;
}

.gia-fatta-home > span:nth-child(2) {
  display: grid;
  flex: 1;
  min-width: 0;
}

.gia-fatta-home strong {
  font-size: 1.125rem;
}

.gia-fatta-home small {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.gia-fatta-home::after {
  content: "›";
  font-size: 1.5rem;
  font-weight: 800;
}

/* 6 · La risposta al tocco (D156): la carta si schiaccia, l'icona salta, «Avanti» si accende. */
@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion="off"]) :is(.scelta, .gia-fatta-home, .cal-giorno:not(:disabled), .cal-freccia:not(:disabled)) {
    transition: transform 120ms ease, background-color 160ms ease;
  }

  html:not([data-motion="off"]) :is(.scelta, .gia-fatta-home, .cal-giorno:not(:disabled), .cal-freccia:not(:disabled)):active {
    transform: scale(0.96);
  }

  html:not([data-motion="off"]) :is(.scelta:has(input:checked), a.scelta:active, .gia-fatta-home:active) > .ico-tondo,
  html:not([data-motion="off"]) .passi .section-bar:active > .ico-tondo {
    animation: passi-salto 0.4s ease-out;
  }

  html:not([data-motion="off"]) .passi-avanti.is-acceso {
    animation: passi-acceso 0.5s ease-out;
  }

  @keyframes passi-salto {
    40% { transform: translateY(-0.4rem) scale(1.1); }
    70% { transform: translateY(0.05rem); }
  }

  @keyframes passi-acceso {
    0% { transform: scale(0.94); }
    45% { transform: scale(1.04); box-shadow: 0 0 0 0.375rem color-mix(in srgb, var(--accent) 35%, transparent); }
    100% { transform: scale(1); box-shadow: 0 0 0 0.75rem transparent; }
  }
}

/* css/v51-profilo-premiato.css */
/* L162 (D162): Profilo e account come le app premiate. Tre pezzi, uguali nelle due parti:
   la testata (`pp-head`), i tre numeri (`pp-stats`) e le schede di righe (`pp-card`, `pp-row`).
   Colori solo dalle variabili del tema; vetro, scuro e medievale in fondo. */

:root {
  --pp-radius: 1.25rem;
  --pp-line: color-mix(in srgb, var(--text) 12%, transparent);
  --pp-edge: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  --pp-shadow: 0 1px 2px rgb(0 0 0 / 5%), 0 10px 28px -18px rgb(0 0 0 / 35%);
}

/* 1 · La testata: faccia grande in un anello del colore del livello, nome, una riga piccola. */
.pp-head {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  margin: var(--space-2) 0 var(--space-4);
  text-align: center;
}

.pp-ring {
  display: grid;
  place-items: center;
  padding: 0.25rem;
  border: 0.25rem solid var(--level-color, var(--accent));
  border-radius: 50%;
}

.pp-ring > .face {
  box-sizing: border-box;
  width: 7rem;
  height: 7rem;
  margin: 0;
  border: 0;
  font-size: 2.75rem;
}

.face-xl {
  width: 7rem;
  height: 7rem;
}

.pp-ring > .pp-sign {
  --ico-size: 7rem;
  --ico-font: 3rem;
  margin: 0;
}

.pp-head h1 {
  max-width: 100%;
  margin: var(--space-3) 0 0;
  font-size: 2rem;
  letter-spacing: -0.035em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.pp-head p {
  max-width: 100%;
  margin: 0.375rem 0 0;
  overflow-wrap: anywhere;
}

.pp-line {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.pp-bio {
  max-width: 22rem !important;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.pp-head-small .pp-ring {
  border-width: 0.1875rem;
  padding: 0.1875rem;
}

.pp-head-small .pp-ring > .face {
  width: 4rem;
  height: 4rem;
  font-size: 1.75rem;
}

.pp-head-small .pp-ring > .pp-sign {
  --ico-size: 4rem;
  --ico-font: 1.875rem;
}

.pp-head-small h1 {
  font-size: 1.5rem;
}

/* La rotella discreta, in alto a destra. */
.profile-gear {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: var(--pp-edge);
  border-radius: 50%;
  background: var(--surface);
  color: inherit;
  font-size: 1.25rem;
  text-decoration: none;
}

.profile-gear .news-dot {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  padding: 0 0.3rem;
  font-size: 0.6rem;
}

/* La barra verso il prossimo livello: sottile, sotto la testata. */
.pp-progress {
  width: min(100%, 18rem);
  margin-top: var(--space-4);
}

.pp-progress .level-bar {
  height: 0.375rem;
  margin: 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--pp-line);
}

.pp-progress .level-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--level-color, var(--accent));
}

.pp-progress p {
  margin: 0.375rem 0 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* 2 · Tre numeri in caselle uguali. */
.pp-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pp-stats > li {
  display: grid;
}

.pp-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 5.5rem;
  padding: 0.75rem 0.375rem;
  border: var(--pp-edge);
  border-radius: var(--pp-radius);
  background: var(--surface);
  box-shadow: var(--pp-shadow);
  color: var(--text);
  text-align: center;
  text-decoration: none;
}

.pp-stat strong {
  font-size: 1.75rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
}

.pp-stat strong small {
  margin-left: 0.125rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  letter-spacing: 0;
}

.pp-stat > span {
  max-width: 100%;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

/* 3 · Le schede raggruppate: un titolo piccolo maiuscolo, una carta, righe separate da un filo. */
.pp-section {
  margin-top: var(--space-5);
}

h2.pp-title {
  margin: 0 0 var(--space-2) var(--space-4);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  line-height: 1.3;
  text-transform: uppercase;
}

.pp-card {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: var(--pp-edge);
  border-radius: var(--pp-radius);
  background: var(--surface);
  box-shadow: var(--pp-shadow);
  list-style: none;
}

.pp-card > li {
  position: relative;
  min-width: 0;
}

.pp-card > li + li::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 4.25rem;
  height: 1px;
  background: var(--pp-line);
}

.pp-card form {
  margin: 0;
}

.pp-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-sizing: border-box;
  width: 100%;
  min-height: 3.5rem;
  margin: 0;
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  list-style: none;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.pp-row::-webkit-details-marker {
  display: none;
}

.pp-row:hover {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.pp-row:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.pp-stat:focus-visible,
.profile-gear:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.pp-row > .ico-tondo,
.pp-row > .group-card-logo {
  --ico-size: 2.5rem;
  --ico-font: 1.2rem;
}

.pp-row > .group-card-logo {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-size: 1.25rem;
}

.pp-text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.pp-text > strong {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.group-tile-system {
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.35;
}

.pp-value {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  white-space: nowrap;
}

.pp-value-quiet {
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.pp-arrow {
  flex: none;
  width: 0.75rem;
  color: var(--text-muted);
  font-size: 1.375rem;
  line-height: 1;
  text-align: center;
}

details[open] > .pp-row > .pp-arrow {
  transform: rotate(180deg);
}

/* Il gruppo in uso: fondo del tema, ✓ e la scritta «Sei qui» (mai solo il colore). */
.pp-row.is-current {
  background: var(--accent-soft);
}

.pp-here {
  flex: none;
  color: var(--accent-strong);
  font-size: 0.8125rem;
  font-weight: 800;
  white-space: nowrap;
}

.pp-add > .pp-text > strong {
  color: var(--accent-strong);
}

.pp-note {
  margin: 0;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* Quello che si apre dentro una riga. */
.pp-more {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-1) 1rem 1rem;
}

.pp-card form.pp-more {
  margin: 0;
}

.pp-more p {
  margin: 0;
}

.pp-more .account-recovery-form {
  padding: 0;
  border: 0;
  background: none;
}

.pp-more .button {
  width: 100%;
}

#serie {
  scroll-margin-block: 5rem;
}

.account-part {
  margin-bottom: 0;
}

.account-part > .pp-section:first-child {
  margin-top: 0;
}

.account-part .pp-title {
  margin-block: 0 var(--space-2);
}

.pp-sheet .button {
  width: 100%;
}

/* Il tocco: il saltello dell'icona, come nelle altre righe. */
@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion="off"]) .pp-row:active > .ico-tondo {
    animation: ico-hop 0.4s ease-out;
  }
}

/* Vetro: lo stesso riempimento delle altre carte. */
html[data-glass="on"] :is(.pp-card, .pp-stat, .profile-gear) {
  background-color: var(--glass-fill);
  background-image: var(--glass-sheen);
  box-shadow: inset 0 1px 0 var(--glass-edge), var(--pp-shadow);
}

@media (prefers-reduced-transparency: reduce) {
  html[data-glass="on"] :is(.pp-card, .pp-stat, .profile-gear) {
    background-color: var(--surface);
    background-image: none;
  }
}

/* Medievale (D161): gli stessi pezzi come fogli di pergamena, filo doppio e anello dorato. */
html[data-decor="medievale"] :is(.pp-card, .pp-stat) {
  border: 3px double color-mix(in srgb, var(--accent-strong) 30%, var(--border));
  border-radius: 8px;
}

html[data-decor="medievale"] .pp-ring {
  box-shadow: 0 0 0 3px color-mix(in srgb, #c9a227 75%, transparent);
}

html[data-decor="medievale"] .pp-ring > .face {
  box-shadow: none;
}

html[data-decor="medievale"] .profile-gear {
  border: 2px solid color-mix(in srgb, #c9a227 70%, transparent);
}

html[data-decor="medievale"] h2.pp-title {
  font-size: 0.9375rem;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  text-transform: none;
}

/* css/v51-inviti.css */
/* L165 + L176 (D163): inviting, sharing and downloading Clanz. In both bundles. Colours only from
   the theme's variables. */

/* The Clanz logo in the top bar of the pages before a group (L177, D164). */
.brand-clanz {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
}

/* A link with the ways to send it */
.condividi-box,
.condividi-menu {
  display: grid;
  width: 100%;
  gap: var(--space-2);
}

.condividi-vai {
  width: 100%;
  justify-content: center;
}

.condividi-box [hidden] {
  display: none;
}

.condividi-link {
  width: 100%;
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-muted);
  text-overflow: ellipsis;
}

.condividi-riga {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}

.condividi-riga > * {
  flex: 1 1 8rem;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

/* «Invita nel gruppo»: big on top of the people, small beside «Personalizza» in Oggi */
.invita-grande {
  margin: 0 0 var(--space-4);
}

.invita-grande > .button {
  display: flex;
  width: 100%;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
}

.mod-open-row {
  flex-wrap: wrap;
  gap: var(--space-2);
}

.invita-piccolo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.invita-carta {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  text-align: center;
}

.invita-carta h1 {
  margin: 0;
  font-size: 1.5rem;
  overflow-wrap: anywhere;
}

.invita-carta p {
  margin: 0;
}

.invita-nome {
  width: 100%;
  min-height: 3.25rem;
  padding: 0 var(--space-3);
  border: 2px solid var(--block-border, var(--border));
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
}

.invita-gia,
.invita-passo-fine,
.invita-altro {
  text-align: center;
}

.invita-altro > .button {
  text-decoration: none;
}

/* «Inviti di prova»: minimal */
.prova-crea {
  display: grid;
  gap: var(--space-2);
}

.prova-crea input {
  width: 100%;
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
}

.prova-righe {
  margin: var(--space-2) 0 0;
  padding-block: 0;
  list-style: none;
}

.prova-righe li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
}

.prova-righe li + li {
  border-top: 1px solid var(--border);
}

.prova-righe li > span:first-child {
  display: grid;
  min-width: 0;
  overflow-wrap: anywhere;
}

.prova-righe small {
  color: var(--text-muted);
}

.prova-stato {
  flex: none;
  font-size: 0.875rem;
  font-weight: 700;
}

/* «Scarica Clanz» */
.scarica-testa {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  text-align: center;
}

.scarica-testa h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.045em;
}

.scarica-testa p,
.scarica-passo p {
  margin: 0;
}

.scarica-testa p {
  color: var(--text-muted);
}

.scarica-fatto {
  text-align: center;
  font-weight: 700;
}

.scarica-telefono h2 {
  margin: 0 0 var(--space-3);
  font-size: 1.25rem;
  text-align: center;
}

.scarica-installa {
  gap: 0.4rem;
  width: 100%;
  justify-content: center;
  margin-bottom: var(--space-3);
}

.scarica-installa[hidden] {
  display: none;
}

.scarica-passi {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: passo;
}

.scarica-passo {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  counter-increment: passo;
}

.scarica-passo p::before {
  content: counter(passo);
  display: inline-grid;
  width: 1.6rem;
  height: 1.6rem;
  margin-right: 0.4rem;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.875rem;
  font-weight: 800;
}

.scarica-disegno {
  width: 4.5rem;
  height: 4.5rem;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sd-telefono {
  fill: var(--surface);
  stroke: var(--text-muted);
  stroke-width: 2.5;
}

.sd-riga {
  stroke: var(--border);
  stroke-width: 3;
}

.sd-pieno {
  fill: var(--text);
}

.sd-segno {
  stroke: var(--accent-strong);
  stroke-width: 2.5;
}

.sd-evidenza {
  fill: var(--accent-strong);
}

.sd-bianco {
  stroke: var(--surface);
  stroke-width: 2;
}

.sd-tocco {
  stroke: var(--accent-strong);
  stroke-width: 2;
  stroke-dasharray: 3 4;
}

/* The Clanz logo is black: on a dark page it turns light. */
[data-theme="dark"] :is(.brand-clanz, .welcome-logo, .accedi-logo, .scarica-testa img) {
  filter: invert(1);
}

.invita-altro {
  margin-top: var(--space-4);
}

/* css/v51-privacy.css */
/* L187 (D169): «Informativa sulla privacy», short titles and sections that open; the links to it.
   In both bundles. Colours only from the theme's variables. */
.privacy {
  max-width: 34rem;
  margin: 0 auto;
  padding-bottom: var(--space-5);
}

.privacy h1 {
  margin: var(--space-3) 0 var(--space-2);
  font-size: clamp(1.75rem, 8vw, 2.25rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.privacy-lead {
  margin: 0 0 var(--space-4);
  color: var(--text-muted);
}

.privacy-parte {
  margin-bottom: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.privacy-parte > summary {
  display: flex;
  min-height: 3.25rem;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  list-style: none;
}

.privacy-parte > summary::-webkit-details-marker {
  display: none;
}

.privacy-parte > summary::after {
  content: "▾";
  color: var(--text-muted);
}

.privacy-parte[open] > summary::after {
  content: "▴";
}

.privacy-parte h2 {
  margin: 0;
  font-size: 1.0625rem;
}

.privacy-testo {
  padding: 0 var(--space-4) var(--space-4);
  overflow-wrap: anywhere;
}

.privacy-testo > * {
  margin: 0 0 var(--space-2);
}

.privacy-testo ul {
  display: grid;
  gap: var(--space-2);
  padding-left: 1.2rem;
}

.privacy-versione {
  margin: var(--space-4) 0 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
}

/* the links to the page */
.welcome-privacy {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  color: var(--text-muted);
}

.create-privacy {
  margin: var(--space-3) 0 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-align: center;
}

/* css/v51-stile.css */
/* L112 + L113 (D132): un solo stile. Questo file va per ultimo in ogni pacchetto (apps/core/assets.py)
   e vince sugli altri. Le regole stanno in docs/stile.md. Colori e temi: solo variabili esistenti. */

:root {
  --st-col: 36rem;
  --st-line: 2px solid var(--block-border, var(--border));
  --st-shadow: 0 1px 3px rgb(0 0 0 / 7%);
}

/* 1 · La colonna: centrata, larghezza fissa, nelle pagine con l'app e in quelle dell'accesso. */
.main-content {
  width: 100%;
  max-width: var(--st-col);
  margin-inline: auto;
}

.access-main {
  width: min(100%, var(--st-col));
}

/* 2 · La carta: stesso bordo, raggio, ombra e spaziatura ovunque. */
.panel,
.blocco,
.connection-card,
.account-panel,
.access-main .account-panel {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border: var(--st-line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--st-shadow);
}

.login-card {
  border: var(--st-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--st-shadow);
}

.connection-card.is-soon {
  border-style: dashed;
}

/* 3 · Titolo di sezione (dentro una carta) e titolo di pagina. */
.panel > h2,
.panel-form > h2,
.blocco-title,
.connection-card h2,
.account-panel h2 {
  margin: 0 0 var(--space-2);
  font-size: 1.0625rem;
  font-weight: 800;
  line-height: 1.25;
}

.simple-heading,
.access-heading {
  max-width: none;
  margin: var(--space-2) 0 var(--space-5);
}

.simple-heading h1,
.access-heading h1,
.login-card h1,
.account-head h1 {
  margin: var(--space-1) 0;
  font-size: 2rem;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.simple-heading > p:not(.eyebrow),
.access-heading > p:not(.eyebrow),
.login-card > p:not(.eyebrow) {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* Le pagine dell'account: foto o segno al centro, titolo, una riga, poi le righe a tutta larghezza. */
.account-head {
  display: grid;
  justify-items: center;
  gap: var(--space-1);
  margin: var(--space-2) 0 var(--space-5);
  text-align: center;
}

.account-head .simple-heading,
.account-head .access-heading {
  margin: 0;
}

.account-head .face {
  width: 6rem;
  height: 6rem;
  font-size: 2.5rem;
}

.account-badge {
  width: 5rem;
  height: 5rem;
  margin: 0 auto var(--space-2);
  font-size: 2.25rem;
}

.account-center {
  text-align: center;
}

/* 4 · La riga-elenco: emoji, titolo, una riga di spiegazione, freccia; tutta cliccabile, 64 px. */
.hub-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.hub-list + .hub-list,
.hub-list + .panel,
.panel + .hub-list {
  margin-top: var(--space-4);
}

.hub-list > li {
  display: grid;
}

.hub-list > li > form {
  display: grid;
  margin: 0;
}

.hub-list .blocco-tile {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) auto;
  grid-template-rows: 1fr auto auto 1fr;
  column-gap: var(--space-3);
  row-gap: 0;
  align-items: center;
  align-content: center;
  width: 100%;
  min-height: 4rem;
  padding: var(--space-2) var(--space-3);
  border: var(--st-line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--st-shadow);
  color: var(--text);
  font: inherit;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.hub-list .blocco-tile:hover {
  border-color: var(--accent);
}

.hub-list .blocco-tile:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.hub-list .blocco-tile > .ico-tondo {
  grid-column: 1;
  grid-row: 1 / -1;
}

.hub-list .blocco-tile > strong {
  grid-column: 2;
  grid-row: 2;
  font-size: 0.9375rem;
  line-height: 1.25;
}

.hub-list .blocco-tile > span:not(.ico-tondo) {
  grid-column: 2;
  grid-row: 3;
  margin-top: 0.125rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.35;
}

.hub-list .blocco-tile::after {
  content: "›";
  grid-column: 3;
  grid-row: 1 / -1;
  align-self: center;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
}

.hub-list .blocco-tile.is-current {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Le intestazioni delle tendine e le carte-link hanno lo stesso corpo delle righe. */
.hub-card {
  min-height: 4rem;
  padding: var(--space-2) var(--space-3);
  border: var(--st-line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--st-shadow);
}

.hub-group {
  column-gap: var(--space-3);
}

.hub-group > strong {
  font-size: 0.9375rem;
}

/* 5 · Pulsanti: due misure. Normale (48 px) e piccolo (44 px, mai meno). */
.button,
.primary-button {
  min-height: 3rem;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  box-shadow: none;
}

.button-small {
  min-height: 2.75rem;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}

.button-small.button-primary {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.button-small.button-secondary {
  border-color: var(--border);
  background: var(--surface-raised);
  color: var(--text);
}

/* Nelle carte dell'account i pulsanti stanno a tutta larghezza. */
.account-panel .form-actions .button,
.account-panel > form > .button,
.account-panel > p > .button,
.account-recovery-form .button {
  width: 100%;
}

.hub-logout {
  margin-top: var(--space-4);
}

.hub-logout .button {
  width: 100%;
}

/* Se un testo di aiuto segue subito una riga o un pulsante, respira. */
.hub-list ~ .help-text {
  margin-top: var(--space-3);
}

/* Una persona nella riga: la sua faccia riempie lo spazio dell'emoji. */
.hub-list .blocco-tile > .ico-tondo .face {
  width: 100%;
  height: 100%;
}

.hub-list .blocco-tile.is-me {
  border-color: var(--accent);
}

/* «Cambia gruppo» e «I tuoi gruppi»: la scheda del gruppo è una riga uguale alle altre. */
.group-cards {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.group-card {
  min-height: 4rem;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: var(--st-line);
  border-radius: var(--radius-md);
  box-shadow: var(--st-shadow);
}

.group-card.is-current {
  border: var(--st-line);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.group-card-new {
  border-style: dashed;
}

.group-card-logo,
.access-group-logo {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  font-size: 1.35rem;
}

.group-card-text strong {
  font-size: 0.9375rem;
  line-height: 1.25;
}

.group-card-arrow {
  color: var(--text-muted);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
}

.account-unlink summary {
  min-height: 2.75rem;
  padding-inline: var(--space-3);
}

/* Vetro (impostazione dell'aspetto): lo stesso riempimento su ogni carta e riga, con lo stesso
   bordo marcato, così intestazioni, righe e carte non si distinguono per il materiale. */
html[data-glass="on"] :is(.panel, .blocco, .connection-card, .account-panel, .hub-card, .hub-list .blocco-tile, .group-card) {
  border-color: var(--block-border, var(--border));
  background-color: var(--glass-fill);
  background-image: var(--glass-sheen);
  box-shadow: inset 0 1px 0 var(--glass-edge), var(--st-shadow);
}

html[data-glass="on"] :is(.hub-list .blocco-tile.is-current, .hub-list .blocco-tile.is-me, .group-card.is-current) {
  border-color: var(--accent);
}

@media (prefers-reduced-transparency: reduce) {
  html[data-glass="on"] :is(.panel, .blocco, .connection-card, .account-panel, .hub-card, .hub-list .blocco-tile, .group-card) {
    background-color: var(--surface);
    background-image: none;
  }
}

/* Una tendina non è una carta dentro una carta: la carta è l'intestazione. */
.settings-fold.profile-capabilities,
.settings-fold.reminder-settings,
.panel-form.home-blocks-form {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

html[data-glass="on"] .settings-fold.profile-capabilities,
html[data-glass="on"] .settings-fold.reminder-settings,
html[data-glass="on"] .panel-form.home-blocks-form {
  background: none;
  border: 0;
  box-shadow: none;
}

.connection-card .button {
  width: 100%;
}

.group-title {
  margin: var(--space-5) 0 var(--space-2);
  color: var(--text);
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: none;
}

.bill-person,
.bill-total {
  border-radius: var(--radius-lg);
}

/* Le pagine prima del gruppo (accesso, gruppi, account): titolo centrato come la prima schermata. */
.access-main .access-heading,
.access-main .simple-heading,
.access-main .picker-heading {
  margin-inline: auto;
  text-align: center;
}

/* L116 (D134): l'account in due parti, Profilo e Gruppi, ognuna con il suo titolo. */
.account-part {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.account-part > .group-title {
  margin: var(--space-2) 0 0;
}

.account-name {
  margin: 0;
  font-size: 1.5rem;
  overflow-wrap: anywhere;
}

/* 7 · Niente testo sottolineato (D135, L117). Un link non è mai sottolineato: dentro una frase è in
   grassetto con il colore del tema e, se porta altrove, ha la freccia «→» scritta nel testo; da solo
   è una riga-elenco o un pulsante. Il focus resta visibile con il contorno di app.css. */
a,
a:hover,
a:focus-visible,
a:active,
.person-link,
.person-link:hover,
.person-link:focus-visible,
.task-card-content h3 a:hover,
.calendar-task h3 a:hover,
.pick-title a:hover,
.make-team > summary,
.conto-when-change,
.key-phrase,
.period-nums-due.is-due strong,
.text-button,
summary {
  text-decoration: none;
}

p a:not([class]),
li > a:not([class]),
.help-text a,
.profile-edit-link,
.level-edit a,
.account-switch-link a,
.home-choose a,
.group-delete-links a,
.person-link {
  color: var(--accent-strong);
  font-weight: 800;
}

a:focus-visible {
  outline: 0.1875rem solid var(--focus);
  outline-offset: 0.1875rem;
}

/* Dove prima c'era la sottolineatura a dire «qui c'è qualcosa»: grassetto, mai solo colore. */
.key-phrase,
.period-nums-due.is-due strong {
  font-weight: 900;
}

/* 8 · L'icona in un cerchio (D156, L150): un solo pezzo, lo stesso dei widget di Oggi (D146).
   `templates/core/_icona.html`: emoji in un cerchio tenue; il tono viene da `--tone` (la classe
   `tono-…`, o quello della carta che la contiene), la misura da `--ico-size` e `--ico-font`. */
.ico-tondo {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--ico-size, 2.75rem);
  height: var(--ico-size, 2.75rem);
  border-radius: 50%;
  background: color-mix(in srgb, var(--tone, var(--accent)) 28%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone, var(--accent)) 40%, transparent);
  font-size: var(--ico-font, 1.35rem);
  font-style: normal;
  line-height: 1;
}

.tono-tema { --tone: var(--accent); }
.tono-menta { --tone: var(--mint); }
.tono-azzurro { --tone: #7aa8ff; }
.tono-sole { --tone: #ffc94d; }
.tono-rosa { --tone: #ff7ab6; }

.ico-grande {
  --ico-size: 3.5rem;
  --ico-font: 1.75rem;
  margin-inline: auto;
}

/* una faccia o il segno di Spotify dentro il cerchio */
.ico-tondo .face {
  width: 100%;
  height: 100%;
}

.connection-head .ico-tondo .spotify-icon {
  width: 1.75rem;
  height: 1.75rem;
}

/* le carte con il numero prendono il corpo dei widget: angoli tondi, icona in alto */
.stat-tile {
  --ico-size: 2.5rem;
  --ico-font: 1.25rem;
  border-radius: 20px;
}

.stat-tile > .ico-tondo,
.yesterday-card > .ico-tondo {
  margin-bottom: var(--space-1);
}

/* il tocco: l'icona di una riga o di una carta che porta altrove fa il saltello dei widget
   (mai con «riduci movimento» o con le animazioni spente) */
@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion="off"]) :is(a.blocco-tile, button.blocco-tile, a.hub-card, summary.hub-card, a.stat-tile, a.yesterday-card, a.account-entry, a.group-card):active > .ico-tondo {
    animation: ico-hop 0.4s ease-out;
  }

  @keyframes ico-hop {
    0% { transform: translateY(0); }
    40% { transform: translateY(-0.45rem) scale(1.1); }
    70% { transform: translateY(0.05rem); }
    100% { transform: translateY(0); }
  }
}

/* 9 · Un solo font (D159, L158): campi, pulsanti, tendine e carosello scrivono come il resto del
   sito, mai con il carattere del browser. `:where` non pesa niente: ogni classe che chiede una sua
   misura o un suo peso continua a vincere. */
:where(input, select, textarea, button, summary, option, .wheel *) {
  font: inherit;
  letter-spacing: inherit;
}

/* In un campo il testo non scende sotto i 16 px: più piccolo, il telefono ingrandisce la pagina. */
:where(input, select, textarea) {
  font-size: max(1rem, 1em);
}
