:root {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  --app-height: 100dvh;
  --background-fit: cover;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --surface: #ffffff;
  --admin-bg: #f2f4f7;
  --primary: #111827;
  --accent: #12b76a;
  --danger: #d92d20;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
  color: var(--ink);
  overscroll-behavior: none;
}

body { height: 100dvh; background: #000; }

button,
input,
select { font: inherit; }

button,
label { -webkit-user-select: none; user-select: none; }

button { touch-action: manipulation; }

[hidden] { display: none !important; }

#device {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
}

/* Modèle d'affichage repris de Midas : viewport utile iOS, sans safe-area ajoutée. */
.runtime-screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  background: #000;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.runtime-screen.unlock-reveal { animation: unlockReveal 260ms ease-out; }

@keyframes unlockReveal {
  from { opacity: .35; transform: scale(1.035); }
  to { opacity: 1; transform: scale(1); }
}

.screen-track {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
  transform: none !important;
  transition: none !important;
}

.fake-page {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  will-change: transform;
  transform: translateX(100%);
}

.fake-page[data-runtime-page="0"] { transform: translateX(0); }

.runtime-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: var(--background-fit, cover);
  object-position: center;
  pointer-events: none;
  -webkit-user-drag: none;
}

.performance-pin {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: max(34px, calc(var(--safe-top) + 18px)) 18px max(22px, calc(var(--safe-bottom) + 12px));
  overflow: hidden;
  color: #fff;
  background: #172133;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.performance-pin-header {
  padding-top: clamp(18px, 6.5vh, 64px);
  text-align: center;
}

.performance-pin-header h1 {
  margin: 0;
  font-size: clamp(25px, 7vw, 32px);
  font-weight: 420;
  letter-spacing: -.025em;
}

.performance-code-dots {
  display: flex;
  justify-content: center;
  gap: clamp(21px, 6.2vw, 27px);
  margin-top: clamp(23px, 4vh, 36px);
}

.performance-code-dots i {
  width: clamp(14px, 4vw, 17px);
  aspect-ratio: 1;
  border: 2.5px solid #fff;
  border-radius: 50%;
  background: transparent;
  transition: background 90ms ease;
}

.performance-code-dots i.filled { background: #fff; }

.performance-keypad {
  align-self: center;
  display: grid;
  width: min(72vw, 330px);
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 2.1vh, 20px) clamp(23px, 7.5vw, 34px);
  margin: clamp(18px, 3.5vh, 34px) auto;
}

.performance-key {
  display: flex;
  width: clamp(68px, 19.5vw, 80px);
  aspect-ratio: 1;
  align-items: center;
  justify-content: center;
  justify-self: center;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  padding: 3px 0 0;
  color: #fff;
  background: rgba(255, 255, 255, .17);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .08);
}

.performance-key:active { background: rgba(255, 255, 255, .42); }
.performance-key.zero { grid-column: 2; }

.performance-key strong {
  font-size: clamp(35px, 10vw, 42px);
  font-weight: 350;
  line-height: .92;
}

.performance-key small {
  min-height: 13px;
  margin-top: 7px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .22em;
  line-height: 1;
}

.performance-pin-footer {
  display: grid;
  width: min(100%, 390px);
  grid-template-columns: 1fr 1fr;
  align-items: center;
  margin: 0 auto;
  font-size: 17px;
}

.performance-pin-footer span { justify-self: start; }

.performance-pin-footer button {
  justify-self: end;
  border: 0;
  padding: 9px 0 9px 20px;
  color: #fff;
  background: transparent;
}

.notes-launcher {
  position: absolute;
  z-index: 2;
  display: flex;
  width: 96px;
  height: 119px;
  transform: translate(-50%, -50%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 14px;
  color: #fff;
  background: #000;
  font-size: 16px;
  line-height: 1;
  pointer-events: none;
}

.notes-app-icon {
  position: relative;
  display: flex;
  width: 73px;
  height: 73px;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 31px;
  overflow: hidden;
  border-radius: 17px;
  background: linear-gradient(#ffd53b 0 25%, #fff 25%);
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .12);
}

.notes-app-icon::after {
  content: "";
  position: absolute;
  inset: 18px 0 auto;
  height: 7px;
  background: repeating-linear-gradient(90deg, transparent 0 7px, rgba(158, 117, 0, .55) 7px 8px);
}

.notes-app-icon i {
  width: 48px;
  height: 3px;
  border-radius: 2px;
  background: #c8c8cc;
}

.training-badge {
  position: absolute;
  z-index: 8;
  top: max(calc(var(--safe-top) + 7px), 12px);
  right: 9px;
  min-width: 35px;
  padding: 5px 8px;
  border-radius: 999px;
  color: rgba(255, 255, 255, .9);
  background: rgba(0, 0, 0, .46);
  text-align: center;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  pointer-events: none;
}

.notes-home-view {
  position: absolute;
  inset: 0;
  z-index: 20;
  width: 100%;
  height: 100%;
  overflow: hidden;
  color: #000;
  background: #f2f2f7;
  animation: openApp 220ms cubic-bezier(.2, .75, .2, 1);
}

.notes-overview-toolbar {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  height: calc(max(var(--safe-top), 18px) + 72px);
  padding: max(var(--safe-top), 18px) 17px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.notes-circle-button {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #111;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 8px 28px rgba(57, 57, 63, .08);
  pointer-events: auto;
}

.notes-back-button {
  padding: 0 3px 5px 0;
  font-size: 52px;
  font-weight: 280;
  line-height: 1;
}

.notes-more-button {
  padding-bottom: 8px;
  font-size: 25px;
  letter-spacing: 2px;
}

.notes-home-scroller {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: calc(max(var(--safe-top), 18px) + 102px) 18px max(calc(var(--safe-bottom) + 118px), 138px);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.notes-home-scroller h1 {
  margin: 0;
  font-size: clamp(43px, 12vw, 53px);
  font-weight: 750;
  letter-spacing: -.045em;
  line-height: 1;
}

.notes-count {
  margin: 8px 0 27px;
  color: #8e8e93;
  font-size: 20px;
}

.notes-home-scroller h2 {
  margin: 0 0 12px;
  font-size: clamp(25px, 7vw, 30px);
  font-weight: 730;
  letter-spacing: -.025em;
}

.notes-summary-card {
  overflow: hidden;
  border-radius: 27px;
  background: #fff;
}

.note-summary-row {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 82px;
  flex-direction: column;
  justify-content: center;
  border: 0;
  padding: 14px 20px;
  color: #000;
  background: #fff;
  text-align: left;
}

.note-summary-row + .note-summary-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: #dedee2;
}

.note-summary-row:active { background: #e9e9ee; }

.note-summary-row strong {
  overflow: hidden;
  font-size: 20px;
  font-weight: 680;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-summary-row span {
  overflow: hidden;
  margin-top: 3px;
  color: #8e8e93;
  font-size: 16px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-bottom-bar {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 12px;
  padding: 11px 18px max(calc(var(--safe-bottom) + 9px), 18px);
  background: linear-gradient(transparent, rgba(242, 242, 247, .94) 24%);
}

.notes-search-pill,
.compose-button {
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, .78);
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 10px 34px rgba(39, 39, 44, .12);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.notes-search-pill {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  border-radius: 29px;
  padding: 0 18px;
  color: #6d6d72;
}

.notes-search-pill strong {
  min-width: 0;
  overflow: hidden;
  font-size: 17px;
  font-weight: 520;
  text-overflow: ellipsis;
}

.search-symbol {
  position: relative;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border: 3px solid #111;
  border-radius: 50%;
}

.search-symbol::after {
  content: "";
  position: absolute;
  right: -7px;
  bottom: -5px;
  width: 8px;
  height: 3px;
  border-radius: 2px;
  background: #111;
  transform: rotate(48deg);
}

.microphone-symbol {
  position: relative;
  width: 17px;
  height: 17px;
  margin: 3px 1px 0 auto;
  border: 2.5px solid #111;
  border-top: 0;
  border-radius: 0 0 10px 10px;
}

.microphone-symbol::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 7px;
  height: 17px;
  transform: translateX(-50%);
  border: 2.5px solid #111;
  border-radius: 7px;
  background: #fff;
}

.microphone-symbol::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 10px;
  height: 2.5px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: #111;
}

.compose-button {
  display: grid;
  width: 58px;
  place-items: center;
  border-radius: 50%;
  color: #111;
  font-size: 30px;
  font-weight: 600;
}

.notes-view {
  position: absolute;
  inset: 0;
  z-index: 20;
  color: #111;
  background: #fff;
  animation: openApp 220ms cubic-bezier(.2, .75, .2, 1);
}

@keyframes openApp {
  from { opacity: 0; transform: scale(.93); }
  to { opacity: 1; transform: scale(1); }
}

.note-toolbar {
  height: calc(max(var(--safe-top), 18px) + 48px);
  padding: max(var(--safe-top), 18px) 17px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.note-toolbar button {
  min-height: 42px;
  border: 0;
  padding: 0;
  color: #b87900;
  background: transparent;
  font-size: 18px;
}

.note-toolbar button span { margin-left: 2px; }

.note-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  color: #b87900;
  font-size: 21px;
}

.note-scroller {
  height: calc(100% - max(var(--safe-top), 18px) - 48px);
  overflow-y: auto;
  padding: 20px 25px max(calc(var(--safe-bottom) + 30px), 44px);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.note-date {
  margin: 0 0 4px;
  color: #8e8e93;
  text-align: center;
  font-size: 13px;
}

.note-scroller h1 {
  margin: 3px 0 27px;
  font-size: 32px;
  line-height: 1.15;
}

.note-lines {
  font-size: 19px;
  line-height: 1.46;
}

.note-line {
  margin: 0 0 4px;
  font-variant-numeric: tabular-nums;
}

/* Proportions et navigation calées sur l’application Notes iOS actuelle. */
.notes-home-view {
  background: #f3f2f8;
  transform: translate3d(0, 0, 0);
  transition: transform 320ms cubic-bezier(.32, .72, 0, 1);
  will-change: transform;
}

.notes-home-view::after {
  content: "";
  position: absolute;
  z-index: 8;
  inset: 0;
  background: rgba(0, 0, 0, .055);
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms cubic-bezier(.32, .72, 0, 1);
}

.notes-home-view.detail-behind { transform: translate3d(-16%, 0, 0); }
.notes-home-view.detail-behind::after { opacity: 1; }
.notes-home-view.is-dragging,
.notes-home-view.is-dragging::after { transition: none; }

.notes-overview-toolbar {
  height: calc(max(var(--safe-top), 18px) + 62px);
  padding: max(var(--safe-top), 18px) 17px 0;
}

.notes-circle-button {
  width: 44px;
  height: 44px;
  padding: 0;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 8px 26px rgba(45, 45, 52, .085);
}

.ios-chevron {
  display: block;
  width: 14px;
  height: 14px;
  margin-left: 5px !important;
  border: solid #111;
  border-width: 0 0 3px 3px;
  transform: rotate(45deg);
}

.ellipsis-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.ellipsis-icon i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #111;
}

.notes-home-scroller {
  padding: calc(max(var(--safe-top), 18px) + 83px) 17px max(calc(var(--safe-bottom) + 92px), 112px);
}

.notes-home-scroller h1 {
  font-size: 36px;
  font-weight: 760;
  letter-spacing: -.04em;
  line-height: 1.05;
}

.notes-count {
  margin: 2px 0 25px;
  font-size: 15px;
  line-height: 1.25;
}

.notes-home-scroller h2 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 720;
  letter-spacing: -.018em;
}

.notes-summary-card { border-radius: 22px; }

.note-summary-row {
  min-height: 59px;
  padding: 9px 20px 10px;
}

.note-summary-row + .note-summary-row::before {
  left: 20px;
  right: 20px;
  background: #dfdfe3;
}

.note-summary-row strong {
  font-size: 16px;
  font-weight: 680;
  line-height: 1.22;
}

.note-summary-row span {
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.18;
}

.notes-bottom-bar,
.note-bottom-bar {
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 10px;
  padding: 9px 17px max(calc(var(--safe-bottom) + 7px), 15px);
}

.notes-search-pill,
.compose-button,
.note-tools-pill,
.note-compose-button {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, .8);
  background: rgba(255, 255, 255, .84);
  box-shadow: 0 9px 30px rgba(39, 39, 44, .11);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.notes-search-pill {
  gap: 9px;
  border-radius: 24px;
  padding: 0 16px;
}

.notes-search-pill strong { font-size: 16px; }

.search-symbol {
  width: 15px;
  height: 15px;
  border-width: 2.5px;
}

.search-symbol::after {
  right: -6px;
  bottom: -4px;
  width: 7px;
  height: 2.5px;
}

.microphone-symbol {
  width: 15px;
  height: 15px;
  border-width: 2px;
}

.microphone-symbol::before {
  width: 6px;
  height: 15px;
  border-width: 2px;
}

.microphone-symbol::after {
  bottom: -5px;
  width: 9px;
  height: 2px;
}

.compose-button,
.note-compose-button {
  display: grid;
  width: 48px;
  min-height: 48px;
  place-items: center;
  border-radius: 50%;
}

.compose-button svg,
.note-compose-button svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: #111;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notes-view {
  z-index: 21;
  overflow: hidden;
  animation: none;
  transform: translate3d(100%, 0, 0);
  transition: transform 320ms cubic-bezier(.32, .72, 0, 1);
  box-shadow: -9px 0 26px rgba(0, 0, 0, .1);
  touch-action: pan-y;
  will-change: transform;
}

.notes-view.is-active { transform: translate3d(0, 0, 0); }
.notes-view.is-dragging { transition: none; }

.note-toolbar {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  right: 0;
  height: calc(max(var(--safe-top), 18px) + 62px);
  padding: max(var(--safe-top), 18px) 17px 0;
  border-bottom: 0;
  background: linear-gradient(rgba(255, 255, 255, .98) 76%, rgba(255, 255, 255, 0));
  pointer-events: none;
}

.note-toolbar .notes-circle-button { pointer-events: auto; }
.note-toolbar button span { margin-left: 5px; }

.note-action-pill {
  display: flex;
  width: 102px;
  height: 44px;
  align-items: center;
  justify-content: space-around;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 23px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 8px 26px rgba(45, 45, 52, .085);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.note-action-pill svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: #111;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.note-scroller {
  width: 100%;
  height: 100%;
  padding: calc(max(var(--safe-top), 18px) + 82px) 25px max(calc(var(--safe-bottom) + 92px), 112px);
}

.note-date {
  margin: -3px 0 9px;
  font-size: 13px;
}

.note-scroller h1 {
  margin: 0 0 34px;
  font-size: 29px;
  font-weight: 730;
  letter-spacing: -.025em;
  line-height: 1.12;
}

.note-lines {
  font-size: 17px;
  line-height: 1.48;
}

.note-line { margin: 0 0 2px; }

.note-bottom-bar {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  background: linear-gradient(transparent, rgba(255, 255, 255, .96) 26%);
  pointer-events: none;
}

.note-tools-pill {
  display: flex;
  width: 154px;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-radius: 25px;
}

.note-tools-pill svg {
  fill: none;
  stroke: #111;
  stroke-width: 2.05;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.note-tools-pill .checklist-icon {
  width: 44px;
  height: 24px;
}

.note-tools-pill .paperclip-icon,
.note-tools-pill .markup-icon {
  width: 26px;
  height: 26px;
}

.pin-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.pin-card {
  width: min(100%, 390px);
  border-radius: 22px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.pin-card h1,
.admin-header h1,
.card h2 {
  margin: 0;
  color: var(--ink);
}

.pin-card h1 { margin-bottom: 18px; font-size: 26px; }

.pin-card input,
.card select,
.card .text-input,
.card .list-textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #d0d5dd;
  border-radius: 11px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
  outline: none;
}

.pin-card input:focus,
.card select:focus,
.card .text-input:focus,
.card .list-textarea:focus { border-color: #667085; box-shadow: 0 0 0 3px rgba(102, 112, 133, .14); }

.form-error { margin: 9px 0 0; color: var(--danger); font-size: 14px; }

.button-row {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 11px;
  padding: 10px 15px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.button.primary { color: #fff; background: var(--primary); }
.button.secondary { color: #344054; background: #eaecf0; }
.button.ghost { color: var(--danger); background: #fff3f2; }
.button.home-launch { color: #fff; background: var(--accent); }
.button.small { min-height: 36px; padding: 8px 10px; font-size: 13px; }
.button.full { width: 100%; margin-top: 16px; }

.admin-view {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  background: var(--admin-bg);
  -webkit-overflow-scrolling: touch;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: calc(max(var(--safe-top), 12px) + 66px);
  padding: max(var(--safe-top), 12px) 13px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(242, 244, 247, .96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.admin-header h1 { font-size: 22px; }
.admin-header .button { flex: 0 0 auto; font-size: 13px; }

.tabs {
  position: sticky;
  top: calc(max(var(--safe-top), 12px) + 66px);
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px 12px;
  background: rgba(242, 244, 247, .96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.tab {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  color: #475467;
  background: #fff;
  font-weight: 750;
}

.tab.active { color: #fff; background: var(--ink); }

.admin-content {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 7px 12px max(calc(var(--safe-bottom) + 26px), 38px);
}

.tab-panel { display: none; }
.tab-panel.active { display: grid; gap: 12px; }

.card {
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 18px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(16, 24, 40, .04);
}

.card h2 { margin-bottom: 17px; font-size: 21px; }
.field-label { display: block; margin: 0 0 8px; color: #475467; font-size: 14px; font-weight: 650; }
.field-label.spaced { margin-top: 16px; }

.force-list-field.spaced { margin-top: 16px; }

.card .list-textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.4;
}

.existing-lists-editor { display: grid; gap: 12px; }

.list-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.list-editor-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.item-count {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.item-count.over-limit { color: var(--danger); font-weight: 750; }

.plain-note-line {
  margin-bottom: 10px;
  font-variant-numeric: normal;
}

.pin-pair-settings {
  margin-top: 17px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.pin-pair-settings .hint { margin-bottom: 0; }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 19px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.switch-row.compact { margin-top: 20px; }
.switch-row strong { display: block; font-size: 16px; }
.switch-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.35; }

.switch {
  position: relative;
  width: 51px;
  height: 31px;
  flex: 0 0 auto;
}

.switch input { position: absolute; opacity: 0; pointer-events: none; }

.switch i {
  display: block;
  width: 51px;
  height: 31px;
  border-radius: 17px;
  background: #d0d5dd;
  transition: background .18s;
}

.switch i::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .28);
  transition: transform .18s;
}

.switch input:checked + i { background: #34c759; }
.switch input:checked + i::after { transform: translateX(20px); }

.instructions-card ol {
  margin: 16px 0 0;
  padding-left: 22px;
  color: #344054;
  font-size: 15px;
  line-height: 1.5;
}

.instructions-card li + li { margin-top: 9px; }
.hint { margin: 13px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.top-hint { margin: -7px 0 16px; }

.screen-cards { display: grid; gap: 11px; }

.screen-card {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f9fafb;
}

.screen-card img {
  width: 52px;
  height: 92px;
  grid-row: span 2;
  border-radius: 9px;
  background: #000;
  object-fit: cover;
  object-position: center center;
}

.screen-card div { align-self: end; }
.screen-card strong,
.screen-card small { display: block; }
.screen-card small { margin-top: 2px; color: var(--muted); font-size: 13px; }
.screen-card label { align-self: end; }
.screen-card > button { grid-column: 2 / 4; justify-self: start; align-self: start; }

.fit-grid { display: grid; gap: 12px; }
.fit-grid label { color: #475467; font-size: 14px; font-weight: 650; }
.fit-grid select { margin-top: 6px; }

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.page-selector {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: #eaecf0;
}

.page-selector button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  color: #475467;
  background: transparent;
  font-weight: 800;
}

.page-selector button.active { color: #fff; background: var(--ink); }

.phone-preview {
  position: relative;
  box-sizing: content-box;
  width: min(calc(100% - 14px), 346px);
  aspect-ratio: 9 / 19.5;
  margin: 0 auto;
  overflow: hidden;
  border: 7px solid var(--ink);
  border-radius: 28px;
  background: #000;
  touch-action: none;
}

.phone-preview > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
  -webkit-user-drag: none;
}

.zone-markers { position: absolute; inset: 0; }

.zone-marker {
  position: absolute;
  display: grid;
  width: 58px;
  height: 58px;
  transform: translate(-50%, -50%);
  place-items: center;
  border: 2px dashed #fff;
  border-radius: 13px;
  color: #fff;
  background: rgba(16, 24, 40, .42);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
  text-shadow: 0 1px 2px #000;
  font-size: 14px;
  font-weight: 850;
  touch-action: none;
  cursor: grab;
}

.zone-marker.dragging { cursor: grabbing; outline: 3px solid rgba(255, 255, 255, .45); }

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: max(calc(var(--safe-bottom) + 20px), 24px);
  max-width: calc(100% - 34px);
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 11px 15px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

@media (min-width: 700px) {
  #tab-force.active { grid-template-columns: 1fr 1fr; align-items: start; }
  .screen-cards { grid-template-columns: repeat(3, 1fr); }
  .screen-card { grid-template-columns: 1fr; text-align: center; }
  .screen-card img { width: 88px; height: 155px; grid-row: auto; justify-self: center; }
  .screen-card > button { grid-column: auto; justify-self: stretch; }
  .screen-card label { width: 100%; }
  .fit-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .screen-track,
  .runtime-screen,
  .notes-home-view,
  .notes-view,
  .switch i,
  .switch i::after { transition: none; animation: none; }
}
