:root {
  --paper: #F3EFE6;
  --card: #FBF9F4;
  --ink: #1C1A17;
  --ink-2: #5E584E;
  --line: #DDD6C8;
  --accent: #5B2BE0;
  --accent-ink: #FFFFFF;
  --danger: #B3261E;
  --display: 'Frank Ruhl Libre', Georgia, serif;
  --text: 'Assistant', system-ui, sans-serif;
  --r-sm: 10px;
  --r-md: 16px;
  --r-icon: 22%;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: 140ms;
  --t-mid: 260ms;
  --page: min(720px, 100% - 2 * var(--s4));
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--text); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.top { width: var(--page); margin-inline: auto; padding-block: calc(var(--s7) + env(safe-area-inset-top)) var(--s5); }
.eyebrow { margin: 0 0 var(--s2); font-weight: 600; font-size: 14px; color: var(--ink-2); }
h1 { margin: 0; font: 900 clamp(40px, 11vw, 72px)/1 var(--display); letter-spacing: -.01em; }
.lede { margin: var(--s3) 0 0; color: var(--ink-2); max-width: 32ch; }

/* signature: the shelf — every app icon standing on one line */
.shelf { display: flex; gap: var(--s2); align-items: flex-end; margin-block-start: var(--s6); padding-block-end: var(--s2); border-block-end: 3px solid var(--ink); min-height: 52px; overflow: hidden; }
.shelf img, .shelf span { width: 44px; height: 44px; border-radius: var(--r-icon); flex: none; background: var(--card); box-shadow: 0 1px 0 var(--line); opacity: 0; transform: translateY(8px); animation: rise var(--t-mid) var(--ease) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

.searchbar { position: sticky; top: 0; z-index: 5; display: flex; gap: var(--s2); width: var(--page); margin-inline: auto; padding-block: var(--s3); background: var(--paper); }
.search { flex: 1; display: flex; align-items: center; gap: var(--s2); padding-inline: var(--s4); height: 52px; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-md); transition: border-color var(--t-fast); }
.search:focus-within { border-color: var(--ink); }
.search svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 17px; }
.add { display: inline-flex; align-items: center; gap: var(--s1); height: 52px; padding-inline: var(--s4); border: 0; border-radius: var(--r-md); background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer; white-space: nowrap; }
.add[hidden] { display: none; }
.add svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

main { width: var(--page); margin-inline: auto; }
.count { margin: var(--s2) 0; font-size: 14px; color: var(--ink-2); }
.list { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 64px 1fr auto; gap: var(--s4); align-items: center; padding-block: var(--s4); border-block-end: 1px solid var(--line); animation: rise var(--t-mid) var(--ease) both; opacity: 0; transform: translateY(8px); }
.row .ic { width: 64px; height: 64px; border-radius: var(--r-icon); background: var(--card); object-fit: cover; box-shadow: 0 1px 2px rgb(0 0 0 / .08); display: grid; place-items: center; font: 900 26px/1 var(--display); color: var(--ink-2); }
.row h2 { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.3; }
.row .desc { margin: 2px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.row .meta { margin: var(--s1) 0 0; font-size: 13px; color: var(--ink-2); }
.row .meta bdi { font-variant-numeric: tabular-nums; }
.row .acts { display: flex; flex-direction: column; gap: var(--s1); align-items: stretch; }
.dl { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding-inline: var(--s4); border-radius: 999px; background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 700; font-size: 15px; transition: transform var(--t-fast) var(--ease); }
.dl:active { transform: scale(.96); }
.dl svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.edit { min-height: 36px; border: 0; background: none; color: var(--ink-2); font-size: 14px; text-decoration: underline; cursor: pointer; }
.empty { padding: var(--s7) 0; text-align: center; color: var(--ink-2); }
.hint { margin: var(--s5) 0 0; font-size: 14px; color: var(--ink-2); }

.admin-row { width: var(--page); margin: var(--s6) auto 0; text-align: center; }
.link { min-height: 44px; border: 0; background: none; color: var(--ink-2); font-size: 14px; text-decoration: underline; cursor: pointer; }

.sheet { width: min(480px, 100% - 2 * var(--s4)); border: 0; border-radius: var(--r-md); padding: var(--s5); background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgb(0 0 0 / .25); }
.sheet::backdrop { background: rgb(28 26 23 / .45); }
.sheet[open] { animation: rise var(--t-mid) var(--ease); }
.sheet h2 { margin: 0 0 var(--s4); font: 700 26px/1.2 var(--display); }
.field { display: grid; gap: var(--s1); margin-block-end: var(--s3); font-weight: 600; font-size: 15px; }
.field small { font-weight: 400; color: var(--ink-2); }
.field input, .field textarea { width: 100%; padding: var(--s3); border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff; font-weight: 400; font-size: 17px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--ink); outline: none; }
.drop { display: grid; place-items: center; min-height: 96px; margin-block-end: var(--s4); padding: var(--s4); border: 2px dashed var(--line); border-radius: var(--r-md); text-align: center; font-weight: 600; cursor: pointer; position: relative; }
.drop:focus-within { border-color: var(--accent); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop.has { border-style: solid; border-color: var(--accent); }
.note { margin: 0 0 var(--s3); font-size: 14px; color: var(--ink-2); }
.progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-block-end: var(--s3); }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width var(--t-fast) linear; }
.err { min-height: 1.2em; margin: 0 0 var(--s2); color: var(--danger); font-size: 15px; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.btn { min-height: 46px; padding-inline: var(--s5); border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer; }
.btn:disabled { opacity: .5; cursor: progress; }
.btn.ghost { background: none; color: var(--ink); border: 1.5px solid var(--line); }
.btn.danger { background: none; color: var(--danger); border: 1.5px solid currentColor; }

.toast { position: fixed; inset-inline: 0; bottom: calc(var(--s5) + env(safe-area-inset-bottom)); margin-inline: auto; width: max-content; max-width: calc(100% - 2 * var(--s4)); padding: var(--s3) var(--s5); border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 600; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--ease); }
.toast.on { opacity: 1; transform: none; }

/* UY Studio credit (yakir-studio-credit) */
.uyc { display: flex; justify-content: center; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); font: 500 12px/1 Assistant, system-ui, sans-serif; }
.uyc-a { display: inline-flex; align-items: center; gap: 7px; word-spacing: .12em; color: inherit; opacity: .55; text-decoration: none; transition: opacity .2s; }
.uyc-a:hover, .uyc-a:focus-visible { opacity: .9; }
.uyc-l { height: 13px; width: auto; display: block; }
.uyc-sep { width: 1px; height: 11px; background: currentColor; opacity: .45; }

@media (max-width: 420px) {
  .add .lbl { display: none; }
  .row { grid-template-columns: 56px 1fr; }
  .row .ic { width: 56px; height: 56px; }
  .row .acts { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; padding-inline-start: calc(56px + var(--s4)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .row, .shelf img, .shelf span { opacity: 1; transform: none; }
}
