/* Accesso */
#gate {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  align-items: center;
  justify-items: center;
  padding:
    max(var(--space-4), var(--safe-t))
    var(--page-gutter)
    max(var(--space-4), var(--safe-b));
  overflow: auto;
  background: var(--color-canvas);
}

#gate .box {
  position: relative;
  z-index: 2;
  width: min(100%, 430px);
  max-width: 100%;
  color: var(--color-text-inverse);
}

#gate .box:not(.attesa) {
  padding: var(--space-6);
  border: var(--stroke-strong) solid var(--color-border-strong);
  border-radius: var(--radius-xl);
  background: var(--color-surface-inverse);
}

#gate .attesa {
  display: grid;
  min-height: 48dvh;
  place-items: center;
}

#gate .gate-art {
  position: relative;
  height: 132px;
  margin: calc(var(--space-2) * -1) 0 var(--space-5);
  overflow: hidden;
  border: var(--stroke-default) solid var(--color-border-inverse);
  border-radius: var(--radius-lg);
  background: var(--color-surface-yellow);
}

#gate .gate-art svg {
  width: 100%;
  height: 100%;
  display: block;
}

#gate h1 {
  margin: var(--space-2) 0 var(--space-2);
  color: var(--color-text-inverse);
  font-family: var(--font-display);
  font-size: var(--text-display-xl);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

#gate h1 em {
  color: var(--color-surface-coral);
}

#gate p {
  margin: 0 0 var(--space-6);
  color: var(--color-text-muted-inverse);
  font-size: var(--text-small);
  font-weight: 550;
}

#gate label {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--color-surface-yellow);
}

#gate input {
  width: 100%;
  min-height: 54px;
  padding: 0 var(--space-4);
  border: var(--stroke-default) solid var(--color-border-inverse);
  border-radius: var(--radius-md);
  outline: 0;
  background: var(--color-surface-primary);
  color: var(--color-text-primary);
  font-size: 16px;
  font-weight: 600;
}

#gate input:focus {
  border-color: var(--color-surface-cyan);
  box-shadow: 0 0 0 3px rgba(204, 231, 238, 0.24);
}

#gate input::placeholder {
  color: var(--ink-500);
  font-weight: 500;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 56px !important;
}

.password-toggle {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-primary);
  cursor: pointer;
}

.who {
  display: flex;
  gap: var(--space-2);
  margin: var(--space-3) 0 var(--space-2);
  padding-bottom: var(--space-1);
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
}

.who::-webkit-scrollbar {
  display: none;
}

.who button {
  min-width: max-content;
  min-height: 44px;
  padding: 0 var(--space-4);
  border: var(--stroke-default) solid var(--color-border-inverse);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text-inverse);
  font-size: var(--text-small);
  font-weight: 700;
}

.who button.on {
  border-color: var(--color-surface-cyan);
  background: var(--color-surface-cyan);
  color: var(--color-text-primary);
  box-shadow: none;
}

#gate .go {
  width: 100%;
  min-height: 56px;
  margin-top: var(--space-5);
  padding: 0 var(--space-5);
  border: var(--stroke-strong) solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface-coral);
  color: var(--color-text-primary);
  box-shadow: none;
  font-size: var(--text-body);
  font-weight: 800;
  text-transform: uppercase;
}

#gate .go:disabled {
  opacity: 0.45;
}

#gate .hint {
  margin-top: var(--space-3);
  color: var(--color-text-muted-inverse);
  font-size: var(--text-small);
  line-height: 1.45;
  text-align: center;
}

.benvenuto {
  margin-bottom: var(--space-5);
  padding: var(--space-4);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--color-surface-yellow);
  color: var(--color-text-primary);
  box-shadow: none;
}

/* Header */
.hero {
  position: relative;
  width: 100%;
  padding:
    max(var(--space-3), var(--safe-t))
    var(--page-gutter)
    var(--space-3);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-primary);
}

body[data-sez]:not([data-sez="giorni"]) .hero {
  padding-bottom: var(--space-3);
  border-radius: 0;
}

.hero .saluto {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0;
}

.header-person {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.header-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  flex: none;
  place-items: center;
  border: var(--stroke-default) solid var(--color-border-strong);
  border-radius: 50%;
  background: var(--color-surface-yellow);
  color: var(--color-text-primary);
  font-size: var(--text-small);
  font-weight: 800;
}

.hero .saluto b {
  display: block;
  overflow: hidden;
  color: var(--color-text-primary);
  font-size: var(--text-body);
  font-weight: 800;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.hero .saluto small {
  display: block;
  margin-top: var(--space-1);
  color: var(--color-text-secondary);
  font-size: var(--text-small);
  font-weight: 550;
  opacity: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

#chipMeteo {
  width: auto;
  min-width: 56px;
  padding-inline: var(--space-2);
  gap: var(--space-1);
  border-radius: var(--radius-pill);
  font-size: var(--text-small);
  font-weight: 750;
}

.icon-button,
.circular-action {
  width: 44px;
  height: 44px;
  display: inline-grid;
  flex: none;
  place-items: center;
  border: var(--stroke-default) solid var(--color-border-strong);
  border-radius: 50%;
  background: var(--color-surface-primary);
  color: var(--color-text-primary);
  cursor: pointer;
}

.circular-action {
  background: var(--color-surface-inverse);
  color: var(--color-text-inverse);
}

.circular-action .arrow {
  font-family: var(--font-body);
  font-size: 1.3rem;
  font-weight: 650;
  line-height: 1;
}

.trip-selector {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: 0 var(--space-3);
  border: var(--stroke-default) solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface-primary);
  color: var(--color-text-primary);
  font-size: var(--text-small);
  font-weight: 700;
  text-align: left;
}

.trip-selector span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-sez]:not([data-sez="giorni"]) .trip-selector,
body[data-detail="true"] .trip-selector {
  display: none;
}

.hero > .eyebrow,
.hero > h1,
.hero > .cd,
.hero > .strip {
  display: none !important;
}

/* Primitive */
.pressable,
.btn,
.chip,
.icon-button,
.circular-action,
.bottom-dock a,
.bottom-dock button,
.tab,
.day-selector-item,
.more-action,
.lamchip,
.vbtn {
  transform: translateZ(0) scale(1);
  transition:
    transform var(--motion-fast) var(--ease-standard),
    filter var(--motion-fast) var(--ease-standard),
    background-color var(--motion-standard) var(--ease-standard),
    color var(--motion-standard) var(--ease-standard);
}

.pressable:active,
.btn:active,
.chip:active,
.icon-button:active,
.circular-action:active,
.bottom-dock a:active,
.bottom-dock button:active,
.tab:active,
.day-selector-item:active,
.more-action:active,
.lamchip:active,
.vbtn:active {
  transform: translateZ(0) scale(0.97);
  filter: brightness(0.97);
}

.btn {
  width: 100%;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-5);
  border: var(--stroke-default) solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface-primary);
  color: var(--color-text-primary);
  box-shadow: none;
  font-size: var(--text-small);
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: none;
  cursor: pointer;
}

.btn.pri {
  background: var(--color-surface-coral);
}

.btn.gho {
  background: var(--color-surface-primary);
}

.btn.dan {
  background: var(--color-danger);
  color: var(--color-text-inverse);
}

.btn.sm {
  width: auto;
  min-height: 44px;
  padding-inline: var(--space-4);
  font-size: var(--text-small);
}

.btn.dash {
  border-style: dashed;
  background: transparent;
}

.chip,
.pill,
.chips button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  border: var(--stroke-thin) solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface-primary);
  color: var(--color-text-primary);
  box-shadow: none;
  font-size: var(--text-small);
  font-weight: 700;
}

button.chip,
.chips button {
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
}

.chips button.on {
  background: var(--color-surface-inverse);
  color: var(--color-text-inverse);
}

.card,
.editorial-card,
.skcard {
  border: var(--stroke-default) solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface-primary);
  box-shadow: none;
}

.card {
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.card h3 {
  margin-bottom: var(--space-4);
}

.sec-h,
.section-header {
  min-height: 48px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin: 0 0 var(--space-4);
  padding: 0;
  border: 0;
}

.sec-h .eyebrow,
.section-header .eyebrow {
  margin-bottom: var(--space-2);
  color: var(--color-text-secondary);
}

.sec-h .sub {
  color: var(--color-text-secondary);
  font-size: var(--text-small);
}

.empty {
  min-height: 160px;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  border: var(--stroke-default) dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface-cyan);
  color: var(--color-text-secondary);
  text-align: center;
}

/* Dock */
.bnav,
.bottom-dock {
  position: fixed;
  z-index: 1200;
  right: max(12px, calc((100vw - var(--frame-max)) / 2 + 12px));
  bottom: max(10px, var(--safe-b));
  left: max(12px, calc((100vw - var(--frame-max)) / 2 + 12px));
  width: auto;
  height: var(--dock-height);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: center;
  padding: 6px 8px;
  overflow: visible;
  border: var(--stroke-strong) solid var(--color-border-strong);
  border-radius: 26px;
  background: var(--color-surface-inverse);
  box-shadow: 0 6px 0 rgba(5, 4, 4, 0.16);
  color: var(--color-text-inverse);
  transform: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.bnav a,
.bnav > button,
.dock-item {
  position: relative;
  min-width: 0;
  min-height: 58px;
  display: grid;
  place-items: center;
  grid-template-rows: 34px 14px;
  gap: 2px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: rgba(255, 253, 248, 0.78);
  text-decoration: none;
  cursor: pointer;
}

.bnav a .icon,
.bnav > button .icon {
  width: 21px;
  height: 21px;
}

.bnav a span,
.bnav > button span {
  max-width: 100%;
  overflow: hidden;
  font-size: var(--text-label);
  font-weight: 650;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-icon-box {
  width: 36px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  transition:
    width var(--motion-standard) var(--ease-emphasis),
    background-color var(--motion-standard) var(--ease-standard),
    color var(--motion-standard) var(--ease-standard);
}

.bnav [aria-current="page"] {
  background: transparent;
  color: var(--color-text-inverse);
}

.bnav [aria-current="page"] .dock-icon-box {
  width: 40px;
  background: var(--color-surface-yellow);
  color: var(--color-text-primary);
}

.bnav [aria-current="page"]::after {
  position: absolute;
  bottom: -1px;
  width: 22px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-yellow);
  content: "";
}

.bnav > .dock-photo {
  overflow: visible;
}

.bnav > .dock-photo .dock-icon-box {
  position: absolute;
  top: -15px;
  left: 50%;
  width: 54px;
  height: 54px;
  border: var(--stroke-strong) solid var(--color-border-strong);
  border-radius: 50%;
  background: var(--color-surface-yellow);
  box-shadow:
    0 0 0 4px var(--color-canvas),
    3px 3px 0 var(--color-border-strong);
  color: var(--color-text-primary);
  transform: translateX(-50%);
}

.bnav > .dock-photo > span:last-child {
  position: absolute;
  bottom: 1px;
}

.bnav .badge,
.header-actions .badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 17px;
  height: 17px;
  padding: 0 var(--space-1);
  overflow: visible;
  border-radius: var(--radius-pill);
  background: var(--color-surface-coral);
  color: var(--color-text-primary);
  font-size: var(--text-label);
  line-height: 17px;
  text-align: center;
}

.header-actions .header-more {
  position: relative;
}

/* Sheet */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 1300;
}

.sheet .scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  opacity: 0;
  transition: opacity var(--motion-standard) var(--ease-standard);
}

.sheet .panel {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: min(100%, var(--frame-max));
  max-height: min(92dvh, 820px);
  display: flex;
  flex-direction: column;
  margin-inline: auto;
  overflow: hidden;
  border: var(--stroke-strong) solid var(--color-border-strong);
  border-bottom: 0;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--color-surface-primary);
  box-shadow: var(--sh5);
  transform: translateY(102%);
  transition: transform var(--motion-emphasis) var(--ease-emphasis);
}

.sheet.on .scrim {
  opacity: 1;
}

.sheet.on .panel {
  transform: translateY(0);
}

.sheet .grab {
  width: 44px;
  height: 4px;
  flex: none;
  margin: var(--space-2) auto var(--space-1);
  border-radius: var(--radius-pill);
  background: var(--color-border-subtle);
}

.sheet .head {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  border-bottom: var(--stroke-thin) solid var(--color-border-subtle);
}

.sheet .head h2 {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.sheet .x {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: var(--stroke-thin) solid var(--color-border-strong);
  border-radius: 50%;
  background: var(--color-surface-cyan);
  color: var(--color-text-primary);
}

.sheet .body {
  min-height: 0;
  padding: var(--space-4);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sheet .foot2 {
  flex: none;
  padding: var(--space-3) var(--space-4) calc(var(--space-4) + var(--safe-b));
  border-top: var(--stroke-thin) solid var(--color-border-subtle);
  background: var(--color-surface-primary);
}

.more-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.more-action {
  min-height: 116px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4);
  border: var(--stroke-default) solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface-cyan);
  color: var(--color-text-primary);
  text-align: left;
}

.more-action:nth-child(2n) {
  background: var(--color-surface-yellow);
}

.more-action:nth-child(3n) {
  background: var(--color-surface-violet);
}

.more-action strong {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  line-height: 1;
  text-transform: uppercase;
}

.profile-strip {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding: var(--space-4);
  border: var(--stroke-default) solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface-inverse);
  color: var(--color-text-inverse);
}

.profile-strip .header-avatar {
  border-color: var(--color-border-inverse);
}

.profile-strip .profile-copy {
  min-width: 0;
  flex: 1;
}

.profile-strip small {
  display: block;
  color: var(--color-text-muted-inverse);
  font-size: var(--text-small);
}

/* Feedback */
.full-feedback {
  position: fixed;
  inset: 0;
  z-index: 1450;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  background: var(--feedback-surface, var(--color-surface-yellow));
  color: var(--color-text-primary);
  text-align: center;
}

.full-feedback[data-tone="success"] {
  --feedback-surface: var(--color-surface-green);
}

.full-feedback[data-tone="warning"] {
  --feedback-surface: var(--color-surface-coral);
}

.full-feedback[data-tone="fun"] {
  --feedback-surface: var(--color-surface-yellow);
}

.full-feedback__inner {
  width: min(100%, 360px);
  display: grid;
  justify-items: center;
  gap: var(--space-4);
}

.full-feedback__art {
  width: min(68vw, 260px);
  aspect-ratio: 1;
}

.full-feedback__art svg {
  width: 100%;
  height: 100%;
  display: block;
}

.full-feedback h2 {
  font-family: var(--font-display);
  font-size: var(--text-display-lg);
  font-weight: 800;
  line-height: 0.9;
  text-transform: uppercase;
}

.full-feedback p {
  max-width: 30ch;
  margin: 0;
  font-size: var(--text-body);
}

.toast {
  position: fixed;
  z-index: 1400;
  right: max(var(--page-gutter), calc((100vw - var(--frame-max)) / 2 + var(--page-gutter)));
  bottom: calc(var(--dock-space) + var(--safe-b) + var(--space-3));
  left: max(var(--page-gutter), calc((100vw - var(--frame-max)) / 2 + var(--page-gutter)));
  width: auto;
  max-width: none;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-4);
  border: var(--stroke-thin) solid var(--color-border-inverse);
  border-radius: var(--radius-pill);
  background: var(--color-surface-inverse);
  color: var(--color-text-inverse);
  font-size: var(--text-small);
  font-weight: 700;
  text-align: center;
}

#netbar {
  margin: var(--space-1) var(--page-gutter) 0;
  padding: var(--space-2) var(--space-3);
  border: var(--stroke-thin) solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface-yellow);
  color: var(--color-text-primary);
  font-size: var(--text-small);
  font-weight: 650;
  text-align: center;
}
