/* Components of the creator app (/novy/, /m/, /moje/) from design/app-prototype.html; the page frame lives in base.css. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 18px; height: 18px; }
.chev { margin-left: auto; color: var(--muted); }

/* buttons */
.btn { font-size: var(--fs-base); letter-spacing: 0.01em; }
.btn[aria-disabled="true"] { opacity: 0.6; cursor: progress; }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: var(--fs-lg); }
.btn-sm { min-height: var(--tap); }
.btn-outline { background: var(--surface); color: var(--fg); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--surface-sunken); border-color: var(--fg-2); }
.btn-ghost { background: transparent; color: var(--fg); }
.btn-ghost:hover { background: var(--surface-sunken); }
.btn-neutral { background: var(--fg); color: var(--bg); }
.btn-neutral:hover { background: var(--fg-2); }
.btn-danger { color: var(--accent); }
.icon-btn { width: var(--tap); height: var(--tap); display: inline-grid; place-items: center; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--fg-2); text-decoration: none; }
.icon-btn:hover { background: var(--surface-sunken); color: var(--fg); }

/* shared bits */
.thumb { position: relative; flex: none; width: 56px; height: 56px; border-radius: var(--radius-sm); display: grid; place-items: center; overflow: hidden; }
.tint-butter { background: var(--tint-butter); color: var(--tint-butter-ink); }
.tint-plum { background: var(--tint-plum); color: var(--tint-plum-ink); }
.tint-rose { background: var(--tint-rose); color: var(--tint-rose-ink); }
.tint-sage { background: var(--tint-sage); color: var(--tint-sage-ink); }
.field { margin: 0 0 var(--space-4); }
.field-label { display: block; font-weight: 700; font-size: var(--fs-sm); margin: 0 0 var(--space-2); }
.input { width: 100%; min-height: 52px; padding: 0 var(--space-4); border-radius: var(--radius-md); border: 1.5px solid var(--border-input); background: var(--surface); color: var(--fg); font-size: var(--fs-base); }
textarea.input { min-height: 96px; padding: var(--space-3) var(--space-4); resize: vertical; line-height: 1.4; }
.input::placeholder { color: var(--muted); opacity: 1; }
.input:hover { border-color: var(--fg-2); }
.input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--fg); }
.input[aria-invalid="true"] { border-color: var(--accent); }
.input:disabled { opacity: 0.6; cursor: not-allowed; }
.field-error { margin: var(--space-1) 0 0; font-size: var(--fs-sm); color: var(--accent); }
.affix { position: relative; }
.affix .input { padding-right: 56px; }
.affix-text { position: absolute; right: var(--space-4); top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; pointer-events: none; }
.notice { margin: 0 0 var(--space-4); padding: var(--space-4); border-radius: var(--radius-md); border: 1px dashed var(--border-strong); background: var(--surface-sunken); font-size: var(--fs-sm); color: var(--fg-2); }
.notice .btn { margin-top: var(--space-2); }

/* 1 - start */
.lh-app--new .lead { margin: var(--space-3) 0 0; }
.h-display { font: 700 var(--fs-3xl)/var(--lh-tight) var(--font-display); letter-spacing: -0.025em; margin: 0; overflow-wrap: anywhere; text-wrap: balance; }
.gift-lid { position: relative; height: 104px; margin: var(--space-2) 0 var(--space-6); border-radius: var(--radius-lg); background: var(--accent-soft); overflow: hidden; }
.gift-lid::before, .gift-lid::after { content: ""; position: absolute; background: var(--accent); }
.gift-lid::before { left: 50%; top: 0; bottom: 0; width: 18px; transform: translateX(-50%); }
.gift-lid::after { top: 50%; left: 0; right: 0; height: 18px; transform: translateY(-50%); }
.gift-lid .bow { position: absolute; z-index: 1; left: 50%; top: 50%; width: 92px; height: 56px; transform: translate(-50%, -62%); color: var(--accent); }
.start-cta { margin-top: var(--space-6); }
.start-status { min-height: 1.5em; margin: var(--space-3) 0 0; font-size: var(--fs-sm); color: var(--fg-2); }
.start-actions { display: grid; gap: var(--space-2); margin-top: var(--space-4); }
.start-foot { margin-top: var(--space-6); display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); }
.tagline { margin: 0; font-size: var(--fs-sm); color: var(--muted); max-width: 22ch; }

/* 2 - editor */
.lh-app--admin .app-main { padding-bottom: 0; display: flex; flex-direction: column; }
[data-editor-root] { flex: 1; display: flex; flex-direction: column; }
.lh-app--admin .app-foot { display: none; }
.editor-loading { min-height: 60vh; }
.save-slot { display: flex; align-items: center; min-height: 32px; margin-right: var(--space-3); }
.save-state { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px 0 8px; border: 0; border-radius: var(--radius-pill); background: var(--secondary-soft); color: var(--secondary); font-size: var(--fs-sm); font-weight: 700; }
.save-state[data-state="saving"] { background: var(--surface-sunken); color: var(--fg-2); }
.save-state[data-state="error"] { background: var(--accent-soft); color: var(--accent); }
button.save-state { position: relative; }
button.save-state::after { content: ""; position: absolute; inset: -8px; }
.title-edit { position: relative; margin: var(--space-1) 0 var(--space-5); }
.title-input { width: 100%; border: 0; border-bottom: 1.5px dashed var(--border-input); background: transparent; padding: 4px 32px 8px 0; font: 700 var(--fs-2xl)/1.15 var(--font-display); letter-spacing: -0.02em; color: var(--fg); border-radius: 0; text-overflow: ellipsis; }
.title-input:hover { border-bottom-color: var(--fg-2); }
.title-input:focus-visible { outline: none; border-bottom: 2px solid var(--fg); }
.title-edit .icon { position: absolute; right: 0; top: 10px; color: var(--muted); pointer-events: none; }
.add-row { display: flex; gap: var(--space-2); }
.add-row .input { flex: 1; min-width: 0; }
.add-row .btn { width: 52px; min-height: 52px; padding: 0; border-radius: var(--radius-md); flex: none; }
.add-hint { margin: var(--space-2) 0 0; font-size: var(--fs-sm); color: var(--muted); display: flex; gap: 6px; align-items: center; }
.list-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); margin: var(--space-6) 0 var(--space-3); }
.list-head .eyebrow { margin: 0; }
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.items.is-sorting { user-select: none; -webkit-user-select: none; }
.item { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-1) var(--space-2) 0; transition: transform var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease); }
.item.is-dragging { box-shadow: 0 10px 28px oklch(25% 0.03 40 / 0.18); transform: scale(1.02); position: relative; z-index: 2; }
.item-body { flex: 1; min-width: 0; }
/* Zoom 200 %: grip, thumbnail and delete button alone are wider than the row. */
@media (max-width: 240px) {
  .item { gap: var(--space-1); }
  .item > .thumb, .list-card > .thumb { display: none; }
  .btn { white-space: normal; max-width: 100%; text-align: center; }
}
@media (max-width: 200px) { .item > .grip, .item > .icon-btn { width: 36px; } }
.item-edit { display: flex; flex-direction: column; justify-content: center; align-items: stretch; min-height: var(--tap); margin: 0; padding: 2px 0; border: 0; border-radius: var(--radius-sm); background: transparent; text-align: left; }
.item-edit:hover .item-name { text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.item-name { display: block; font-weight: 700; font-size: var(--fs-base); line-height: 1.3; overflow-wrap: anywhere; }
.item .meta .shop { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.item .note { display: flex; gap: 6px; align-items: flex-start; margin: 4px 0 0; }
.item .note .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--muted); }
.reveal-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-3); margin: 0 0 var(--space-3); }
.reveal-row .btn { margin-left: -12px; padding: 0 12px; text-decoration: underline; text-underline-offset: 3px; }
.reveal-row .btn[aria-pressed="true"] { background: var(--secondary-soft); color: var(--secondary); }
.reveal-row .small { margin: 0; flex: 1 1 200px; }
.res-line { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.taken-pill-sm, .old-note-sm { display: inline-flex; align-items: flex-start; gap: 6px; padding: 2px 10px; border-radius: var(--radius-sm); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.taken-pill-sm { align-items: center; border-radius: var(--radius-pill); border: 1.5px solid var(--border); background: var(--surface-sunken); color: var(--fg-2); font-weight: 700; }
.old-note-sm { background: var(--tint-butter); color: var(--tint-butter-ink); }
.old-note-sm .icon { margin-top: 2px; }
.grip { width: var(--tap); height: var(--tap); flex: none; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; border-radius: var(--radius-sm); cursor: grab; touch-action: none; }
.grip:hover { color: var(--fg); background: var(--surface-sunken); }
.is-dragging .grip { cursor: grabbing; }
.empty-list { margin: var(--space-4) 0 0; padding: var(--space-5); border: 1.5px dashed var(--border-strong); border-radius: var(--radius-md); color: var(--fg-2); text-align: center; }
.danger-zone { margin: var(--space-8) 0 var(--space-6); text-align: center; }
html:has(.editor-foot) { scroll-padding-bottom: calc(var(--editor-foot-h, 0px) + var(--space-3)); }
.editor-foot { position: sticky; bottom: 0; z-index: 1; margin: auto calc(-1 * var(--space-5)) 0; padding: var(--space-3) var(--space-5) max(26px, env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--border); }
.toast { position: fixed; z-index: 5; left: var(--space-5); right: var(--space-5); bottom: calc(96px + env(safe-area-inset-bottom)); max-width: 520px; margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 6px 6px 6px var(--space-4); border-radius: var(--radius-md); background: var(--fg); color: var(--bg); font-weight: 600; }
.toast .btn { min-height: var(--tap); color: var(--bg); text-decoration: underline; text-underline-offset: 3px; }
.toast .btn:hover { background: oklch(35% 0.02 35); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast .btn:hover { background: oklch(88% 0.01 80); } }
:root[data-theme="dark"] .toast .btn:hover { background: oklch(88% 0.01 80); }

/* sheets */
body:has(dialog[open]) { overflow: hidden; }
dialog.sheet { margin: auto auto 0; width: 100%; max-width: 560px; max-height: calc(100dvh - 64px); padding: 0; border: 0; border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sheet); overflow-y: auto; overscroll-behavior: contain; }
dialog.sheet::backdrop { background: oklch(22% 0.02 35 / 0.5); }
@media (prefers-reduced-motion: no-preference) {
  dialog.sheet[open] { transform: none; opacity: 1; transition: transform var(--motion-base) var(--ease), opacity var(--motion-base) var(--ease); }
  @starting-style { dialog.sheet[open] { transform: translateY(32px); opacity: 0; } }
}
.sheet-body { padding: var(--space-2) var(--space-5) max(30px, env(safe-area-inset-bottom)); }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 0 auto var(--space-3); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); }
.sheet-head .icon-btn { margin: -6px -10px 0 0; }
.lead-sm { font-size: 16px; margin: var(--space-3) 0 0; }
.sheet-actions { display: grid; gap: var(--space-2); margin-top: var(--space-5); }
.move-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.link-field { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-5) 0 var(--space-3); padding: 0 var(--space-4); min-height: 52px; border-radius: var(--radius-md); background: var(--surface-sunken); border: 1px solid var(--border); font-weight: 700; color: var(--fg-2); }
.link-field .icon { color: var(--muted); }
.link-field input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0; min-height: 50px; text-overflow: ellipsis; font-weight: 700; color: inherit; }
.link-field input:focus-visible { outline-offset: 6px; border-radius: 4px; }
.share-grid { list-style: none; margin: var(--space-5) 0 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--space-2); }
/* Zoom: four tiles in one row do not fit, so they wrap into as many 88px columns as there is room for. */
@media (max-width: 340px) {
  .share-grid { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .share-tile { padding: var(--space-2) var(--space-1); overflow-wrap: anywhere; text-align: center; }
}
.share-tile { width: 100%; min-height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--fg); font-weight: 700; font-size: var(--fs-sm); text-decoration: none; }
.share-tile:hover { background: var(--surface-sunken); border-color: var(--border-strong); }
.share-tile .disc { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.qr-row { margin-top: var(--space-2); justify-content: flex-start; padding: 0 var(--space-4); border-radius: var(--radius-md); }
.qr-row .chev { margin-left: auto; transition: transform var(--motion-fast) var(--ease); }
.qr-row[aria-expanded="true"] .chev { transform: rotate(90deg); }
.qr-panel { display: flex; gap: var(--space-4); align-items: center; margin-top: var(--space-3); padding: var(--space-3); border: 1px dashed var(--border-strong); border-radius: var(--radius-md); }
.qr { width: 104px; height: 104px; flex: none; background: #fff; border-radius: 8px; padding: 6px; }
.qr path { fill: #2a1f1c; }
.qr-panel p { margin: 0 0 var(--space-2); font-size: var(--fs-sm); color: var(--fg-2); }
.share-msg { margin: var(--space-3) 0 0; font-size: var(--fs-sm); color: var(--fg-2); }

/* 6 - lists */
.mine-title { margin-top: var(--space-2); }
.lists { list-style: none; margin: var(--space-5) 0 0; padding: 0; display: grid; gap: var(--space-2); }
.list-card { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); text-align: left; text-decoration: none; color: var(--fg); transition: background-color var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease); }
.list-card:hover { background: var(--surface-sunken); border-color: var(--border-strong); }
.list-card b { display: block; font-size: var(--fs-base); line-height: 1.3; overflow-wrap: anywhere; }
.list-card > span:not(.thumb) { min-width: 0; }
.invited { margin-top: var(--space-8); }
.lists-title { margin: 0; font: 700 var(--fs-lg)/1.2 var(--font-display); }
.invited .lists { margin-top: var(--space-3); }
.invited-item { display: grid; justify-items: end; gap: var(--space-1); }
.invited-item > .card { justify-self: stretch; }
.device-note { display: flex; gap: var(--space-2); align-items: center; margin: var(--space-4) 0 0; font-size: var(--fs-sm); color: var(--muted); }
.mine-empty { margin: var(--space-5) 0 0; }
.keep { margin-top: var(--space-8); padding: var(--space-5); border-radius: var(--radius-lg); background: var(--secondary-soft); }
.keep h2 { margin: 0 0 var(--space-2); font: 700 var(--fs-lg)/1.2 var(--font-display); }
.keep p { margin: 0; font-size: var(--fs-base); line-height: 1.45; text-wrap: pretty; }
.keep .btn { margin-top: var(--space-4); }

/* 06 - install card (the prototype's .install) and the restore field */
.install { margin-top: var(--space-8); padding: var(--space-5); border-radius: var(--radius-lg); background: var(--secondary-soft); }
.install-top { display: flex; gap: var(--space-3); align-items: flex-start; }
.install-top .disc { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--secondary); }
.install p { margin: 0; font-size: var(--fs-base); line-height: 1.45; text-wrap: pretty; }
.install .btn { margin-top: var(--space-4); }
.install .btn + .btn { margin-top: var(--space-2); }
.restore { margin-top: var(--space-4); }
.restore-row { display: grid; gap: var(--space-2); margin-top: var(--space-4); }
.restore-row .btn { margin-top: 0; }
.keep .restore-status { margin-top: var(--space-3); font-size: var(--fs-sm); color: var(--fg-2); }
.keep .restore-status:empty { display: none; }

/* Update prompt: at the top, the bottom is taken by the editor's own bars. */
.toast-update { top: calc(64px + env(safe-area-inset-top)); bottom: auto; }

/* Editor opened from the stored copy: readable, not editable. */
.is-readonly .grip, .is-readonly [data-del], .is-readonly .title-edit .icon { display: none; }
.is-readonly .title-input { border-bottom-color: transparent; }
.is-readonly .item-edit:hover .item-name { text-decoration: none; }
.is-readonly .item-edit:disabled { cursor: default; color: inherit; }

/* print: only the QR sheet */
.print-sheet { display: none; }
@media print {
  @page { margin: 15mm; }
  body > *:not(.print-sheet) { display: none !important; }
  body { display: block; background: #fff; color: #000; }
  .print-sheet { display: block; text-align: center; }
  .print-sheet h1 { font: 700 28pt/1.15 var(--font-display); margin: 0 0 10mm; }
  .print-sheet .qr { width: 70mm; height: 70mm; padding: 0; margin: 0 auto; }
  .print-sheet .print-url { margin: 8mm 0 4mm; font-size: 14pt; word-break: break-all; }
  .print-sheet .print-line { font-size: 16pt; margin: 0; }
}

.item .note-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; min-width: 0; }
.toast-message { bottom: calc(168px + env(safe-area-inset-bottom)); }
.event-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: calc(-1 * var(--space-2)) 0 var(--space-5); }
.event-input { width: auto; min-width: min(11.5rem, 100%); }
.event-hint, .event-row .field-error { flex-basis: 100%; margin: 0; }

/* appearance switch at the bottom of /moje/ */
.theme-row { margin-top: var(--space-6); }
