:root {
  --base: #1c1612;      /* fond : base de pellicule développée */
  --strip: #2a201a;     /* bande, surfaces */
  --strip-2: #3a2d24;
  --edge: #f0b43c;      /* marquages de bord */
  --paper: #f3e9dc;     /* texte */
  --muted: #b3a493;
  --under: #6fa3d6; --good: #8fbf6a; --over: #f07a5a;
  --r: 14px;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", sans-serif;
  --edgefont: "Barlow Condensed", "DIN Condensed", "Arial Narrow", var(--sans);
  --display: "Bricolage Grotesque", var(--sans);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--base); color: var(--paper); font: 17px/1.45 var(--sans); -webkit-text-size-adjust: 100%; }
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--edge); outline-offset: 2px; }
a { color: var(--edge); }

.wrap { max-width: 560px; margin: 0 auto; padding: 12px 16px 32px; }
.wide { max-width: 1200px; }
.top { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.top h1 { font-size: 20px; margin: 0; flex: 1; font-weight: 650; line-height: 1.25; }
.wide .top { flex-wrap: wrap; }
.back { background: none; border: 0; font-size: 26px; padding: 4px 10px 4px 0; color: var(--muted); }
.sync { font-size: 13px; color: var(--muted); white-space: nowrap; }
.sync.warn { color: var(--edge); }

/* bande de pellicule : perforations */
.sprockets { height: 14px; background:
  repeating-linear-gradient(90deg, transparent 0 9px, var(--base) 9px 19px) center/100% 8px no-repeat, var(--strip); border-radius: 3px; }
.edge { font-family: var(--edgefont); color: var(--edge); letter-spacing: .02em; font-variant-numeric: tabular-nums; }

.field { display: grid; gap: 6px; margin: 14px 0; }
.field > span { color: var(--muted); font-size: 15px; }
input, select, textarea { background: var(--strip); border: 1px solid var(--strip-2); border-radius: 10px; padding: 12px; width: 100%; }
textarea { min-height: 72px; resize: vertical; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.btn { border: 0; border-radius: var(--r); padding: 14px 18px; background: var(--strip-2); font-weight: 600; }
.btn.primary { background: var(--edge); color: #24180c; }
.btn.ghost { background: none; border: 1px solid var(--strip-2); }
.btn.block { width: 100%; }
.err { color: var(--over); }
.hint { color: var(--muted); font-size: 15px; }

/* liste de pellicules */
.roll { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; background: var(--strip); border: 0; border-radius: var(--r); padding: 14px; margin: 10px 0; }
.roll .count { font-size: 34px; line-height: 1; min-width: 64px; }
.roll .meta { flex: 1; }
.roll .film { font-weight: 650; }
.roll .sub { color: var(--muted); font-size: 14px; }
.section { color: var(--muted); font-size: 15px; margin: 26px 0 4px; }

/* carnet */
.log { display: flex; flex-direction: column; min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
.frameno { text-align: center; margin: 10px 0 2px; }
.frameno .n { font-size: 132px; line-height: .9; display: block; }
.frameno .of { color: var(--muted); font-size: 15px; }
.frameno .jump { background: none; border: 0; padding: 4px 10px; color: var(--muted); font-size: 15px; }
.dial { display: grid; grid-template-columns: 76px 1fr 76px; gap: 10px; align-items: stretch; margin: 10px 0; }
.dial .step { border: 0; border-radius: var(--r); background: var(--strip); font-size: 34px; min-height: 76px; }
.dial .step:active { background: var(--strip-2); }
.dial .val { border: 0; border-radius: var(--r); background: var(--strip); font-size: 40px; font-variant-numeric: tabular-nums; font-weight: 600; }
.dial .val small { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 14px; }
.picker button { border: 0; border-radius: 10px; background: var(--strip); padding: 12px 0; font-variant-numeric: tabular-nums; }
.picker button.on { background: var(--edge); color: #24180c; font-weight: 700; }
.next { margin-top: auto; padding-top: 12px; }
.next .btn { font-size: 22px; padding: 22px; }
.saved { text-align: center; color: var(--good); min-height: 22px; font-size: 15px; }
.filmstrip { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; scrollbar-width: none; }
.filmstrip button { flex: 0 0 auto; border: 0; border-radius: 8px; background: var(--strip); padding: 6px 10px; text-align: left; font-size: 13px; color: var(--muted); }
.filmstrip button .edge { font-size: 18px; display: block; }
.filmstrip button.cur { outline: 2px solid var(--edge); }

/* revue : planche contact */
.sheet { background: var(--strip); border-radius: 6px; padding: 14px 14px 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px 12px; margin-top: 12px; }
.cell { display: grid; gap: 6px; align-content: start; }
.cell .img { aspect-ratio: 3 / 2; background: var(--base); border-radius: 2px; overflow: hidden; display: grid; place-items: center; border: 0; padding: 0; }
.cell .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cell .img .none { color: var(--strip-2); font-size: 13px; }
.cell .line { display: flex; gap: 8px; align-items: baseline; font-size: 14px; }
.cell .line .edge { font-size: 22px; }
.cell .line .set { font-weight: 600; font-variant-numeric: tabular-nums; }
.cell .line .t { color: var(--muted); margin-left: auto; }
.rate { display: flex; gap: 4px; }
.rate button { flex: 1; border: 1px solid var(--strip-2); background: none; border-radius: 8px; padding: 4px 0; font-size: 13px; color: var(--muted); }
.rate button.on.sous { background: var(--under); color: #0e1c2a; border-color: var(--under); }
.rate button.on.bonne { background: var(--good); color: #15230b; border-color: var(--good); }
.rate button.on.sur { background: var(--over); color: #2a0f08; border-color: var(--over); }
.cell textarea { min-height: 44px; font-size: 14px; padding: 8px; }
.drop { display: block; margin-top: 12px; cursor: pointer; border: 2px dashed var(--strip-2); border-radius: var(--r); padding: 22px; text-align: center; color: var(--muted); }
.drop.over { border-color: var(--edge); color: var(--paper); }
.assign { display: grid; grid-template-columns: 1fr 110px; gap: 6px 12px; align-items: center; margin: 12px 0; font-size: 14px; }
.bar { height: 6px; background: var(--strip-2); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--edge); }
.lightbox { position: fixed; inset: 0; background: rgba(10, 7, 5, .94); display: grid; place-items: center; z-index: 10; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 88vh; }
.lightbox p { color: var(--muted); text-align: center; }
.tabs { display: flex; gap: 8px; margin: 8px 0; flex-wrap: wrap; }

/* sélecteur à faire défiler */
.wheel { position: relative; margin: 12px -16px; }
.wheel-label { display: block; padding: 0 16px 4px; color: var(--muted); font-size: 14px; }
.wheel-track { list-style: none; margin: 0; padding: 0 calc(50% - 50px); display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; height: 84px; align-items: center;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent); mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent); }
.wheel-track::-webkit-scrollbar { display: none; }
.wheel-track li { flex: 0 0 100px; width: 100px; scroll-snap-align: center; text-align: center; font-size: 22px; color: var(--muted);
  font-variant-numeric: tabular-nums; transition: transform .12s, color .12s; user-select: none; cursor: pointer; }
.wheel-track li.near { color: var(--paper); opacity: .75; }
.wheel-track li.on { color: var(--paper); font-size: 32px; font-weight: 650; }
.wheel::after { content: ""; position: absolute; left: 50%; bottom: -2px; width: 44px; height: 3px; margin-left: -22px; background: var(--edge); border-radius: 2px; }
.wheel-track:focus-visible { outline: none; }
.wheel:focus-within::after { height: 5px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
