.borne-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}

.borne-preview {
  min-width: 0;
  padding: clamp(5px, 1.2vw, 16px) clamp(5px, 1.2vw, 16px) 0;
  scroll-margin-top: 72px;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: #ebe4ef;
}

.borne-preview > h2,
.borne-settings > h2 {
  margin: 0;
  font: 400 var(--text-xl)/1.15 var(--font-display);
  text-wrap: balance;
}

.borne-preview > h2 {
  margin: var(--space-3) var(--space-2) var(--space-4);
}

.borne-tablet {
  position: relative;
  z-index: 1;
  padding: clamp(6px, .8vw, 11px);
  border: 1px solid #302532;
  border-radius: clamp(17px, 2vw, 30px);
  background: #211a23;
  box-shadow: 0 0 0 2px #ac9daf, 0 12px 28px -14px #2b1d30;
}

.borne-tablet::before,
.borne-tablet::after {
  position: absolute;
  z-index: 1;
  border-radius: 100px;
  content: "";
  pointer-events: none;
}

.borne-tablet::before {
  top: 2px;
  left: 50%;
  width: 4px;
  height: 4px;
  background: #66556d;
  box-shadow: inset 0 0 0 1px #3d3142;
  transform: translateX(-50%);
}

.borne-tablet::after {
  top: 1px;
  right: 8%;
  width: 25%;
  height: 1px;
  background: #746678;
}

.borne-stand {
  width: 28%;
  height: clamp(13px, 2.4vw, 30px);
  margin-inline: auto;
  border-bottom: 4px solid #8b798f;
  border-radius: 0 0 10px 10px;
  background: #b7a7bd;
}

.borne-display {
  container-type: inline-size;
  aspect-ratio: 3 / 4;
  overflow: clip;
  border-radius: clamp(11px, 1.4vw, 21px);
  background: #faf7f2;
  color: var(--prune-950);
}

.borne-shell {
  --borne-gap: clamp(8px, 1.6cqi, 13px);
  --borne-pad: clamp(9px, 2.4cqi, 20px);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.borne-bar,
.borne-brand,
.borne-bar-end {
  display: flex;
  align-items: center;
  gap: var(--borne-gap);
  min-width: 0;
}

.borne-bar {
  flex: none;
  justify-content: space-between;
  min-height: clamp(44px, 8.5cqi, 64px);
  padding-inline: var(--borne-pad);
  background: #fffdf9;
  border-bottom: 1px solid #eae2db;
  font-size: clamp(.75rem, 2.15cqi, .95rem);
  line-height: 1.15;
}

.borne-bar-end {
  flex-shrink: 0;
  margin-inline-start: auto;
  font-variant-numeric: tabular-nums;
}

.borne-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: clamp(26px, 5.2cqi, 38px);
  aspect-ratio: 1;
  border-radius: 50% 50% 30% 30%;
  color: var(--amber);
  background: var(--prune-900);
  font: 400 clamp(1rem, 3.8cqi, 1.55rem)/1 var(--font-display);
}

.borne-content {
  flex: 1;
  min-height: 0;
  padding: var(--borne-pad);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-line) transparent;
  scroll-padding-block: var(--borne-pad);
}

.borne-content > :first-child {
  animation: borne-reveal 220ms ease-out both;
}

@keyframes borne-reveal {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.borne-display h2 {
  margin: 0;
  color: inherit;
  font: 400 clamp(1.5rem, 6.1cqi, 2.75rem)/1.05 var(--font-display);
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.borne-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  border-radius: clamp(11px, 2.6cqi, 19px);
  overflow: hidden;
  background: var(--prune-900);
  color: var(--on-primary);
}

.borne-hero > div {
  padding: clamp(11px, 3cqi, 24px);
}

.borne-hero p {
  margin: .65em 0 .25em;
  color: var(--on-dark-muted);
  font-size: clamp(.7rem, 2.3cqi, .95rem);
}

.borne-hero strong {
  display: block;
  color: var(--amber);
  font-size: clamp(.8rem, 2.85cqi, 1.2rem);
  line-height: 1.2;
}

.borne-hero strong span {
  display: block;
  color: var(--on-primary);
  font-size: .85em;
  font-weight: 400;
}

.borne-hero img {
  align-self: center;
  display: block;
  width: 100%;
  height: auto;
  border-radius: clamp(6px, 1.5cqi, 12px);
}

.borne-hero {
  align-items: center;
  padding-inline-end: clamp(8px, 2cqi, 16px);
}

.borne-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: var(--borne-gap);
  margin-top: var(--borne-gap);
}

.borne-tiles > :last-child:nth-child(odd) { grid-column: 1 / -1; }

.borne-tile {
  --tile-ground: var(--primary-soft);
  --tile-ink: var(--prune-900);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  justify-items: start;
  gap: 5px;
  min-height: max(64px, 14cqi);
  padding: clamp(8px, 2cqi, 16px);
  border: 1px solid transparent;
  border-radius: clamp(10px, 2.2cqi, 16px);
  background: var(--tile-ground);
  color: var(--tile-ink);
  text-align: left;
  font: 600 clamp(.77rem, 2.75cqi, 1.15rem)/1.13 var(--font-sans);
  cursor: pointer;
  transition: background-color 180ms ease-out, transform 180ms ease-out, border-color 180ms ease-out;
}

.borne-tile-welcome { --tile-ground: #f7e6bf; }
.borne-tile-events { --tile-ground: #e6ddd6; }
.borne-tile-programme { --tile-ground: #e7eadb; }

.borne-tile strong {
  grid-row: 2;
  grid-column: 1 / -1;
  text-wrap: balance;
}

.borne-tile-icon {
  display: grid;
  place-items: center;
  width: clamp(23px, 6cqi, 42px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fffdf9;
}

.borne-tile :is(.borne-tile-icon, .borne-tile-next) svg {
  width: clamp(13px, 3cqi, 23px);
  height: auto;
}

.borne-tile-next {
  align-self: center;
  justify-self: end;
}

@media (hover: hover) {
  .borne-tile:hover {
    transform: translateY(-2px);
    border-color: var(--primary-line);
    background: color-mix(in oklab, var(--tile-ground), white 22%);
  }
}

.borne-tile:active { transform: translateY(1px); }

.borne-step {
  display: grid;
  gap: var(--borne-gap);
  margin-bottom: clamp(12px, 3cqi, 24px);
}

.borne-step > p,
.borne-progress {
  color: var(--text-secondary);
  font-size: .9em;
}

.borne-progress {
  display: flex;
  gap: var(--borne-gap);
  align-items: center;
  font-variant-numeric: tabular-nums;
}

.borne-progress progress {
  width: clamp(48px, 20cqi, 120px);
  height: 7px;
  appearance: none;
  border: 0;
  border-radius: 99px;
  overflow: hidden;
  background: var(--primary-soft);
}

.borne-progress progress::-webkit-progress-bar { background: var(--primary-soft); }
.borne-progress progress::-webkit-progress-value { background: var(--primary); }
.borne-progress progress::-moz-progress-bar { background: var(--primary); }

.borne-display :is(form, .borne-choices, .borne-settings) {
  display: grid;
  gap: var(--borne-gap);
}

.borne-display :is(.button, .row-button, .borne-choice, input:not([type="checkbox"])) {
  min-height: 64px;
  white-space: normal;
}

.borne-display .borne-bar .button {
  min-width: 44px;
  min-height: 44px;
  padding-inline: 8px;
}

.borne-display .button { text-wrap: balance; }
.borne-display .row-button,
.borne-display .borne-choice {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fffdf9;
  padding: 10px 12px;
}

.borne-display .row-button:hover,
.borne-display .borne-choice:hover,
.borne-display .borne-choice:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.borne-display .row-button strong,
.borne-display .row-button small,
.borne-choice small {
  display: block;
  overflow-wrap: anywhere;
}

.borne-event-list {
  display: grid;
  gap: var(--borne-gap);
}

.borne-display .field,
.borne-display .field input { min-width: 0; }

.borne-fieldset {
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.borne-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background-color 180ms ease-out, border-color 180ms ease-out;
}

.borne-choice input {
  flex: none;
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.borne-error { color: var(--color-error); }
.borne-error:empty { display: none; }
.borne-actions .button { width: 100%; }

.borne-quote {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 10px;
  background: var(--amber-soft);
}

.borne-keyboard summary {
  display: list-item;
  min-height: 44px;
  padding-block: 12px;
  color: var(--primary);
  cursor: pointer;
}

.borne-keyboard-rows {
  display: grid;
  gap: 4px;
}

.borne-keyboard-rows > div {
  display: flex;
  justify-content: center;
  gap: 3px;
}

.borne-keyboard-rows .button {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 2px;
  font-size: clamp(.75rem, 3cqi, 1rem);
}

.borne-receipt,
.borne-keypad {
  display: grid;
  justify-items: center;
  gap: var(--borne-gap);
  text-align: center;
}

.borne-receipt { padding-block: clamp(5px, 2.5cqi, 18px); }

.borne-receipt-icon {
  display: grid;
  place-items: center;
  width: clamp(48px, 12cqi, 75px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--color-success-soft);
  color: var(--color-success);
  animation: borne-confirm 240ms ease-out both;
}

@keyframes borne-confirm {
  from { opacity: 0; transform: scale(.85); }
  to { opacity: 1; transform: scale(1); }
}

.borne-total,
.borne-pickup {
  padding: .18em .32em;
  border-radius: 12px;
  color: var(--prune-900);
  background: var(--amber-soft);
  font: 400 clamp(2rem, 10cqi, 4.5rem)/1 var(--font-display);
}

.borne-pickup { letter-spacing: .12em; }
.borne-dots { letter-spacing: .25em; color: var(--primary); }

.borne-keys {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 270px);
  gap: var(--borne-gap);
}

.borne-keys .button { padding-inline: 4px; }

.borne-programme {
  display: grid;
  gap: var(--borne-gap);
}

.borne-programme > section {
  padding: clamp(12px, 2.6cqi, 20px);
  border-radius: 14px;
  background: #fffdf9;
}

.borne-programme .borne-service {
  background: var(--prune-900);
  color: var(--on-primary);
}

.borne-service strong {
  color: var(--amber);
  font: 400 clamp(2rem, 7cqi, 3rem)/1 var(--font-display);
}

.borne-programme ul { list-style: none; padding: 0; margin: 8px 0 0; }
.borne-upcoming li { display: flex; align-items: center; gap: var(--borne-gap); margin-top: 8px; }
.borne-upcoming small { display: block; }

.borne-settings {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.borne-settings .form-grid { grid-template-columns: minmax(0, 1fr); }
.borne-launch.button { white-space: normal; text-wrap: balance; text-align: center; }
.borne-settings .choice-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.borne-settings .choice-chip span {
  flex: 1;
  justify-content: center;
  min-height: 44px;
  padding: var(--space-2);
  border-radius: var(--radius-m);
  font-size: var(--text-s);
  line-height: 1.2;
  text-align: center;
  text-wrap: balance;
}
.borne-lock-settings { display: grid; gap: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.borne-settings .hint { margin: 0; }
.borne-quote:empty { display: none; }

.borne-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

:is(.borne-layout, .borne-fullscreen) :is(button, input, select, summary):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@container (min-width: 480px) {
  .borne-programme { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .borne-upcoming { grid-column: 1 / -1; }
  .borne-display .borne-welcome:has(> .field) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .borne-welcome :is(.borne-error, .borne-actions) { grid-column: 1 / -1; }
  .borne-display .borne-bar .button { min-width: 64px; min-height: 64px; }
}

@media (min-width: 700px) {
  .borne-display { aspect-ratio: 4 / 3; }
}

@media (min-width: 1100px) {
  .borne-layout { grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); }
}

@media (prefers-reduced-motion: reduce) {
  .borne-content > :first-child,
  .borne-receipt-icon { animation: none; }
  :is(.borne-layout, .borne-fullscreen) :is(.borne-tile, .borne-choice, .button) { transition: none; }
  .borne-settings .choice-chip span { transition: none; }
  .borne-tile:is(:hover, :active) { transform: none; }
}

.borne-landing {
  display: grid;
  grid-template-rows: auto minmax(min-content, 1fr);
}

.borne-landing .borne-tile {
  align-content: center;
  min-height: max(64px, 13cqi);
}

.borne-display .field select {
  min-height: 64px;
}

.borne-visitor-language {
  grid-column: 1 / -1;
}

@container (max-width: 450px) {
  .borne-keypad {
    gap: 5px;
  }

  .borne-keypad h2 {
    font-size: clamp(1.15rem, 7cqi, 1.5rem);
  }

  .borne-keypad p {
    margin: 0;
    font-size: .8rem;
  }

  .borne-keys {
    gap: 5px;
  }
}

@container (max-width: 450px) {
  .borne-keypad > p:not(.borne-error) {
    position: absolute;
    clip-path: inset(50%);
  }
}

.borne-display .borne-welcome .form-grid {
  grid-template-columns: minmax(0, 1fr);
}

.borne-display .choice-chip input {
  min-height: 0;
}

.borne-display .choice-chip span {
  min-height: 54px;
  padding-block: var(--space-2);
}

.borne-display .choice-chips {
  gap: var(--space-3);
}

@container (min-width: 480px) {
  .borne-display .borne-welcome .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .borne-display:has(.borne-welcome) {
    aspect-ratio: auto;
  }

  .borne-display:has(.borne-welcome) .borne-shell {
    height: auto;
  }
}

.borne-welcome .choice-field:has([name="language"]) .choice-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.borne-welcome .choice-field:has([name="language"]) .choice-chip span {
  flex: 1;
  justify-content: center;
  padding-inline: var(--space-2);
}

/* Sur place, la fenêtre entière devient l’écran de la tablette. */
.app-body.is-borne {
  padding: 0;
  overflow: hidden;
  background: #faf7f2;
}

.is-borne :is(.sidebar, .topbar, .tabbar) { display: none; }
.is-borne .shell { display: block; min-height: 0; }
.is-borne .screen { height: 100dvh; padding: 0; }

.is-borne .borne-fullscreen {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
}

.is-borne .borne-fullscreen .borne-shell { height: 100%; }

.borne-fullscreen .borne-shell {
  --borne-gap: clamp(12px, 2.1cqi, 24px);
  --borne-pad: clamp(16px, 3.8cqi, 44px);
}

.borne-fullscreen .borne-bar {
  min-height: clamp(60px, 8.6cqi, 84px);
  padding-top: env(safe-area-inset-top);
}

.borne-logo-control {
  display: grid;
  flex: none;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-s);
  background: transparent;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.borne-fullscreen .borne-content {
  min-width: 0;
  width: min(100%, 46rem);
  margin-inline: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.borne-fullscreen .borne-landing {
  width: min(100%, 70rem);
  grid-template-rows: auto auto;
  align-content: safe center;
  gap: var(--borne-gap);
}

.borne-fullscreen .borne-hero {
  grid-template-columns: minmax(0, 1fr) minmax(0, .88fr);
  min-height: min-content;
  padding: clamp(12px, 2cqi, 24px);
  border-radius: var(--radius-l);
}

.borne-fullscreen .borne-hero > div {
  padding: clamp(0px, 2cqi - 7px, 22px);
}

.borne-fullscreen .borne-hero h2 {
  font-size: clamp(1.55rem, 5.4cqi, 4rem);
}

.borne-fullscreen .borne-hero img { max-width: min(100%, max(10rem, 31cqi)); justify-self: end; }
.borne-fullscreen .borne-tiles { margin: 0; }
.borne-fullscreen .borne-tile { min-height: clamp(88px, 12cqi, 130px); }
.borne-fullscreen .borne-tile strong { font-size: clamp(.95rem, 2.45cqi, 1.5rem); }
.borne-fullscreen :is(.borne-step, .borne-keypad) { margin-block: var(--space-2); }
.borne-fullscreen .borne-keypad { max-width: 26rem; margin-inline: auto; }

.borne-demo {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-2) var(--borne-pad) calc(var(--space-2) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.borne-demo-exit {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font: 600 var(--text-s) var(--font-sans);
  cursor: pointer;
  transition: background-color 140ms ease-out, border-color 140ms ease-out;
}

.borne-demo-exit:hover { border-color: var(--primary-line); background-color: var(--primary-soft); }
.borne-demo-exit svg { width: 16px; height: 16px; }

@media (max-width: 560px) {
  .borne-fullscreen .borne-landing { align-content: start; }
}

@media (min-width: 620px) {
  .borne-demo > span { flex: 1 1 0; text-wrap: pretty; }
  .borne-demo-exit { flex: none; }
}

@media (prefers-reduced-motion: reduce) {
  .borne-demo-exit { transition: none; }
}

@media (min-width: 650px) and (orientation: portrait) {
  .borne-fullscreen .borne-hero {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: var(--space-3);
    text-align: center;
  }

  .borne-fullscreen .borne-hero img { width: min(100%, 23rem); max-width: 100%; justify-self: center; }
}
