:root {
  --bg: #F5F5F7;
  --card: #FFFFFF;
  --ink: #1D1D1F;
  --ink-2: #424245;
  --muted: #6E6E73;
  --line: #E5E5EA;
  --accent: #0066CC;
  --danger: #D70015;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
  --hand: #1F2A55;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.view { flex: 1; display: flex; flex-direction: column; }
.scroll { flex: 1; padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 24px; }
.footer { position: sticky; bottom: 0; padding: 12px 24px calc(20px + env(safe-area-inset-bottom)); background: var(--bg); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.footer.bordered { border-top: 1px solid var(--line); }

.eyebrow { margin: 8px 0 0; text-align: center; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0; }
.row-between { display: flex; align-items: baseline; justify-content: space-between; }
.muted { color: var(--muted); font-size: 13px; margin: 0; }
.lead { margin: 0; font-size: 16px; line-height: 1.45; color: var(--ink-2); }
.stack { display: flex; flex-direction: column; gap: 10px; }

h1.title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 1.02; letter-spacing: -.01em; }
h1.title.sm { font-size: 34px; line-height: 1.05; }
h1.title em { font-style: italic; color: var(--accent); }
h1.title em.plain { color: inherit; }

.hero { position: relative; height: 300px; border-radius: 28px; background: #E3E1DC; overflow: hidden; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; color: #5F5C56; font-size: 13px; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; left: 16px; bottom: 16px; padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,.92); font-size: 13px; font-weight: 600; color: var(--ink); }

.list { background: var(--card); border-radius: 18px; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.list-item + .list-item { border-top: 1px solid #F0F0F2; }
.list-item strong { display: block; font-size: 15px; }
.list-item span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }

.btn { width: 100%; min-height: 54px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-size: 17px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-ghost { min-height: 44px; border: 0; background: transparent; color: var(--accent); font-size: 16px; cursor: pointer; padding: 0 8px; }
.btn-outline { min-height: 48px; border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; font-size: 15px; font-weight: 600; cursor: pointer; padding: 0 18px; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 6px; }
.topbar .t { font-size: 17px; font-weight: 600; }
.icon-btn { width: 44px; height: 44px; border: 0; background: transparent; color: var(--accent); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.spacer44 { width: 44px; height: 44px; }

.input, .textarea { width: 100%; border: 0; border-radius: 14px; background: var(--card); padding: 0 16px; font: inherit; font-size: 17px; color: var(--ink); outline: none; }
.input { height: 50px; }
.textarea { padding: 14px 16px; border-radius: 16px; line-height: 1.4; resize: none; min-height: 140px; }
.input:focus, .textarea:focus { box-shadow: 0 0 0 3px rgba(0,102,204,.25); }
.input::placeholder, .textarea::placeholder { color: #8E8E93; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid #D2D2D7; background: var(--card); font-size: 15px; font-weight: 500; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #fff; }

.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 14px; background: #E3E1DC; overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .remove { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border: 0; border-radius: 999px; background: rgba(29,29,31,.72); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.add-photo { aspect-ratio: 1; border-radius: 14px; border: 1.5px dashed #AEAEB2; background: transparent; color: var(--accent); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; font-size: 12px; font-weight: 600; }

.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; padding: 2px; border-radius: 10px; background: #E3E3E8; }
.segmented button { min-height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 600; cursor: pointer; }
.segmented button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.row-link { min-height: 60px; border: 0; border-radius: 16px; background: var(--card); padding: 10px 16px; display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer; width: 100%; color: var(--ink); }
.row-link .dot { width: 36px; height: 36px; border-radius: 999px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.row-link .txt { flex: 1; }
.row-link strong { display: block; font-size: 16px; font-weight: 500; }
.row-link span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }

.damier { background-color: #fff; background-image: repeating-conic-gradient(#EDEDF0 0% 25%, #FFFFFF 0% 50%); background-size: 16px 16px; border-radius: 16px; padding: 16px; display: flex; align-items: center; justify-content: center; min-height: 140px; }
.damier img { max-height: 260px; width: auto; }
.mot-thumb { position: relative; }
.mot-thumb .remove { position: absolute; top: 8px; right: 8px; }

.crop-wrap { position: relative; border-radius: 16px; overflow: hidden; background: #2C2C2E; touch-action: none; user-select: none; }
.crop-wrap canvas { display: block; width: 100%; height: auto; }
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0,0,0,.45); }
.handle { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 999px; background: #fff; border: 2px solid var(--accent); touch-action: none; }
.slider { width: 100%; accent-color: var(--accent); }

.error { color: var(--danger); font-size: 14px; margin: 0; text-align: center; }
.progress { width: 100%; height: 4px; background: #E3E3E8; border-radius: 4px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.center { flex: 1; padding: 0 32px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; }
.check { width: 88px; height: 88px; border-radius: 999px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; }
.recap { width: 100%; background: var(--card); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.recap .chips span { padding: 6px 12px; border-radius: 999px; background: var(--bg); font-size: 14px; font-weight: 500; }
.tiny-caps { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* Coulisses */
.admin { max-width: 980px; margin: 0 auto; padding: 24px 20px 120px; display: flex; flex-direction: column; gap: 20px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--card); border-radius: 14px; padding: 12px; }
.stat b { display: block; font-size: 24px; }
.stat span { font-size: 12px; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.card { background: var(--card); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.card-head { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 999px; background: #E3E1DC; display: flex; align-items: center; justify-content: center; font-weight: 600; flex: 0 0 auto; }
.card-head .who { flex: 1; min-width: 0; }
.card-head .who b { display: block; font-size: 15px; }
.card-head .who span { font-size: 13px; color: var(--muted); }
.thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.thumbs a { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #E3E1DC; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); text-decoration: none; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.quote { margin: 0; font-family: var(--serif); font-size: 18px; line-height: 1.35; white-space: pre-wrap; }
.danger { color: var(--danger); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.admin-footer { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(245,245,247,.94); border-top: 1px solid var(--line); padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); }
.admin-footer .inner { max-width: 980px; margin: 0 auto; display: flex; gap: 10px; }
.admin-footer .btn { flex: 1; }
.login { max-width: 360px; margin: 18vh auto 0; padding: 0 24px; display: flex; flex-direction: column; gap: 14px; }

@media (min-width: 700px) {
  .app { padding-top: 24px; }
}
