/* ListeListe — one stylesheet, no framework. */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --sunken: #efece5;
  --ink: #1d1c1a;
  --muted: #5f5b52;
  --faint: #67635a; /* secondary text: >= 5:1 on every surface */
  --line: #e5e1d8;
  --line-strong: #cfc9bc;
  --accent: #0e7a62;
  --accent-text: #0b6a54; /* accent-coloured TEXT: >= 5.5:1 on bg, surface, sunken and accent-soft */
  --accent-hover: #0b6852;
  --accent-ink: #ffffff;
  --accent-soft: #e0f0ea;
  --doing: #8f5508;
  --doing-soft: #f8ecd6;
  --danger: #a8301f;
  --danger-soft: #f8e4e0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgb(40 30 10 / 5%), 0 8px 24px rgb(40 30 10 / 6%);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: max(16px, env(safe-area-inset-left));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141412;
    --surface: #1c1b19;
    --sunken: #222120;
    --ink: #edebe6;
    --muted: #b3afa5;
    --faint: #9a968c;
    --line: #2d2b28;
    --line-strong: #403d38;
    --accent: #45c39f;
    --accent-text: #45c39f;
    --accent-hover: #5fd1b0;
    --accent-ink: #072018;
    --accent-soft: #15302a;
    --doing: #e5ab55;
    --doing-soft: #35291a;
    --danger: #f07a68;
    --danger-soft: #3b201b;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.offscreen { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.muted { color: var(--faint); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- layout ---------- */
.page {
  max-width: 680px;
  margin: 0 auto;
  padding: env(safe-area-inset-top) var(--gutter) calc(48px + env(safe-area-inset-bottom));
}
.topbar {
  display: flex; align-items: center; gap: 12px;
  height: 64px;
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
}
.brand { text-decoration: none; display: inline-flex; }
.top-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.sync-status { font-size: 13px; color: var(--faint); min-width: 0; white-space: nowrap; }
.sync-status[data-state="error"], .sync-status[data-state="offline"] { color: var(--danger); }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 9px; font-size: 19px; letter-spacing: -0.02em; }
.logo-mark {
  width: 24px; height: 24px; border-radius: 7px; background: var(--accent); position: relative; flex: none;
}
.logo-mark::before, .logo-mark::after {
  content: ""; position: absolute; left: 6px; right: 6px; height: 2.5px; border-radius: 2px; background: var(--accent-ink);
}
.logo-mark::before { top: 8px; }
.logo-mark::after { top: 13.5px; right: 10px; opacity: .7; }
.logo-word { font-weight: 450; }
.logo-word b { font-weight: 750; color: var(--accent-text); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font-size: 15px; font-weight: 550; text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--faint); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.small .icon { width: 16px; height: 16px; }
.btn.big { min-height: 52px; padding: 0 28px; font-size: 17px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--sunken); color: var(--ink); }
.btn.danger { color: var(--danger); border-color: var(--danger-soft); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.danger.ghost { border-color: transparent; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; flex: none;
  border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
.link-btn { border: 0; background: none; padding: 4px 6px; color: var(--muted); cursor: pointer; border-radius: 6px; }
.link-btn:hover, .link-btn.active { color: var(--ink); }
.link-btn.active { font-weight: 650; }

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px 3px 8px; border-radius: 999px;
  background: var(--sunken); color: var(--muted);
  font-size: 13px; font-weight: 550; white-space: nowrap;
}
.chip .icon { width: 14px; height: 14px; }
.chip.role-edit { background: var(--accent-soft); color: var(--accent-text); }
.chip.claimed { background: var(--accent-soft); color: var(--accent-text); }

/* ---------- forms ---------- */
/* :where() keeps these defaults at zero specificity so component styles win. */
:where(input:not([type=checkbox]):not([type=radio]), textarea, select) {
  width: 100%;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 10px 12px; min-height: 44px;
  outline: none;
}

:where(input, textarea, select):focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: none; line-height: 1.45; }
.field { display: grid; gap: 6px; margin: 0 0 14px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.hint { color: var(--muted); font-size: 14px; margin: 4px 0 10px; display: flex; gap: 6px; align-items: flex-start; }
.hint .icon { width: 15px; height: 15px; margin-top: 3px; }
.toggle { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; cursor: pointer; }
.toggle input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.toggle strong { display: block; font-weight: 600; }
.toggle small { display: block; color: var(--muted); font-size: 14px; }

/* ---------- home ---------- */
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: clamp(32px, 7vw, 46px); line-height: 1.08; letter-spacing: -0.035em; margin: 0 0 12px; font-weight: 750; }
.lead { font-size: 18px; color: var(--muted); margin: 0; max-width: 34em; }
.create { margin: 28px 0 16px; display: grid; gap: 18px; }
.create > input { font-size: 18px; min-height: 54px; padding: 12px 16px; border-radius: var(--radius); }
.types { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.types legend { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; padding: 0; }
.type-card {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; position: relative;
  transition: border-color .15s, box-shadow .15s;
}
.type-card:hover { border-color: var(--line-strong); }
.type-card input { position: absolute; opacity: 0; pointer-events: none; }
.type-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.type-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.type-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--sunken); color: var(--muted); flex: none; }
.type-card:has(input:checked) .type-icon { background: var(--accent-soft); color: var(--accent-text); }
.type-icon.small { width: 28px; height: 28px; border-radius: 7px; }
.type-icon.small .icon { width: 15px; height: 15px; }
.type-text strong { display: block; font-weight: 650; font-size: 15px; }
.type-text small { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; }
.create .btn.big { justify-self: start; }
.promises { list-style: none; padding: 0; margin: 8px 0 40px; display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 14px; }
.promises li { display: inline-flex; gap: 6px; align-items: center; }
.promises .icon { width: 15px; height: 15px; color: var(--accent-text); }

.my-lists h2 { font-size: 15px; font-weight: 650; margin: 0; }
.my-lists > .hint { margin-bottom: 12px; }
.my-list { list-style: none; padding: 0; margin: 0 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.my-list li { display: flex; align-items: center; border-top: 1px solid var(--line); }
.my-list li:first-child { border-top: 0; }
.my-list a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 6px 10px 12px; text-decoration: none; }
.my-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.my-list .forget { margin-right: 4px; }

.site-foot { margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); }
.site-foot nav { display: flex; gap: 4px 14px; align-items: center; flex-wrap: wrap; }
.langs { margin-left: -6px; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--ink); }

/* ---------- list page ---------- */
.loading { color: var(--faint); padding: 40px 0; }
.list-head { padding: 8px 0 14px; }
.title, .title-input {
  font-size: clamp(26px, 6vw, 34px); font-weight: 750; letter-spacing: -0.03em; line-height: 1.15;
  margin: 0;
}
.title-input, .desc-input {
  border: 0 !important; background: transparent !important; box-shadow: none !important;
  padding: 2px 0 !important; min-height: 0 !important; border-radius: 0 !important;
}
.title-input::placeholder, .desc-input::placeholder { color: var(--faint); }
.desc, .desc-input { color: var(--muted); font-size: 16px; margin: 6px 0 0; white-space: pre-line; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 14px; }
.meta-progress { font-size: 13px; color: var(--faint); margin-left: 4px; }

.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.filters[hidden] { display: none; }
.filter-chip { border: 1px solid transparent; cursor: pointer; font: inherit; font-size: 13px; font-weight: 550; min-height: 32px; }
.filter-chip:hover { border-color: var(--line-strong); }
.filter-chip.active { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent); }
.items > li[hidden] { display: none; }
.notices { display: grid; gap: 8px; margin-bottom: 8px; }
.notices:empty { display: none; }
.notice { margin: 0; }
.notice.subtle { color: var(--muted); font-size: 14px; display: flex; gap: 8px; align-items: center; }
.notice.subtle .icon { width: 16px; height: 16px; color: var(--accent-text); }
.notice.welcome {
  background: var(--accent-soft); border-radius: var(--radius); padding: 14px 16px; margin: 4px 0 6px;
  display: grid; gap: 10px;
}
.notice.welcome p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.notice-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.notice-actions .icon-btn { margin-left: auto; }

.items { list-style: none; margin: 6px 0 0; padding: 0; border-top: 1px solid var(--line); }
.item { border-bottom: 1px solid var(--line); background: var(--bg); }
.item.dragging { background: var(--surface); box-shadow: var(--shadow); border-radius: var(--radius-sm); position: relative; z-index: 2; }
.item-main { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 0; }
.item-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.item-text { display: block; font-size: 16px; overflow-wrap: anywhere; }
input.item-text { border: 0; background: transparent; padding: 6px 0; min-height: 0; border-radius: 0; box-shadow: none !important; }
.item-text a { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.item-text a:hover { text-decoration-color: currentColor; }
.item.done .item-text, .item.done input.item-text { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--faint); }
.item-sub { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 13px; color: var(--muted); }
.item-sub .icon { width: 13px; height: 13px; }
.host { display: inline-flex; gap: 4px; align-items: center; text-decoration: none; color: var(--muted); }
.host:hover { color: var(--accent-text); }
.note { white-space: pre-line; flex-basis: 100%; }
.claim-info { display: inline-flex; gap: 5px; align-items: center; color: var(--accent-text); flex-basis: 100%; }
.item-right { display: flex; align-items: center; gap: 6px; flex: none; }
.handle { display: grid; place-items: center; width: 20px; color: var(--faint); cursor: grab; touch-action: none; margin-left: -4px; }
.handle .icon { stroke-width: 3; }
.item.dragging .handle { cursor: grabbing; }
.more-btn { margin-right: -6px; }
.item.open .more-btn { color: var(--ink); background: var(--sunken); }

.bullet { width: 24px; display: grid; place-items: center; flex: none; }
.bullet::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.check {
  width: 26px; height: 26px; flex: none; display: grid; place-items: center;
  border: 2px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: transparent; cursor: pointer; padding: 0;
  transition: background .15s, border-color .15s;
}
.check .icon { width: 16px; height: 16px; stroke-width: 3; }
.check[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.check:disabled { cursor: default; }
.state-pill {
  flex: none; min-width: 88px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .02em; text-transform: uppercase; cursor: pointer;
}
.state-pill.state-doing { background: var(--doing-soft); border-color: transparent; color: var(--doing); }
.state-pill.state-done { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.state-pill:disabled { cursor: default; }
.counter { display: flex; align-items: center; gap: 2px; background: var(--sunken); border-radius: 999px; padding: 2px; }
.counter .icon-btn { width: 32px; height: 32px; }
.counter .icon-btn:hover { background: var(--surface); }
.count { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.count-badge { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

.item-details { padding: 4px 0 14px 30px; }
.item-details .field { margin-bottom: 10px; }
.detail-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.spacer { flex: 1; }

.empty { color: var(--faint); padding: 22px 0; text-align: center; }
.add-form { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.add-icon { width: 24px; display: grid; place-items: center; color: var(--faint); flex: none; }
.add-form .add-input { border: 0; background: transparent; padding: 10px 0; box-shadow: none !important; }
.add-form .btn { flex: none; }

.list-foot { margin-top: 28px; }
.foot-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-left: -12px; }
.affiliate-note { color: var(--faint); font-size: 12px; margin: 14px 0 0; }

.empty-state { padding: 60px 0; }
.empty-state h1 { font-size: 28px; letter-spacing: -0.02em; margin: 0 0 8px; }
.empty-state p { color: var(--muted); margin: 0 0 24px; }

/* ---------- about ---------- */
.about h1 { font-size: 34px; letter-spacing: -0.03em; margin: 16px 0 8px; }
.about h2 { font-size: 17px; margin: 28px 0 6px; }
.about p { color: var(--muted); margin: 0 0 8px; max-width: 38em; }

/* ---------- dialogs ---------- */
.dialog {
  width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  padding: 0; border: 0; border-radius: 18px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
.dialog.wide { width: min(560px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgb(20 18 14 / 45%); backdrop-filter: blur(2px); }
.dialog-head { display: flex; align-items: center; gap: 8px; padding: 14px 10px 4px 20px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.dialog-head h2 { flex: 1; font-size: 18px; margin: 0; letter-spacing: -0.01em; }
.dialog-body { padding: 8px 20px 18px; }
.dialog-body h3 { font-size: 15px; margin: 4px 0 0; }
.dialog-body hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.dialog-lead { font-weight: 600; margin: 0 0 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; }
@media (max-width: 520px) {
  .dialog, .dialog.wide { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
}

.link-row { padding: 10px 0; }
.link-row + .link-row { border-top: 1px solid var(--line); }
.link-head { display: flex; gap: 8px; align-items: center; }
.link-head .icon { color: var(--accent-text); }
.link-row.danger .link-head .icon { color: var(--danger); }
.link-row .hint { margin: 2px 0 8px 26px; }
.link-box { display: flex; gap: 4px; align-items: center; margin-left: 26px; }
.link-url { font-size: 14px !important; min-height: 38px !important; padding: 6px 10px !important; background: var(--sunken) !important; border-color: transparent !important; color: var(--muted); }
.slug-box { display: flex; align-items: center; margin-left: 26px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.slug-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.slug-prefix { padding-left: 10px; color: var(--faint); font-size: 14px; white-space: nowrap; }
.slug-input { border: 0 !important; box-shadow: none !important; padding-left: 2px !important; }
.slug-actions { display: flex; gap: 8px; align-items: center; margin: 8px 0 0 26px; flex-wrap: wrap; }
.slug-actions select { width: auto; min-height: 34px; padding: 4px 8px; font-size: 14px; }
.slug-status { font-size: 13px; color: var(--muted); }
.slug-status.ok { color: var(--accent-text); }
.slug-status.bad { color: var(--danger); }
.preview-link { margin-top: 8px; margin-left: 14px; }

/* ---------- toast & banners ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 550;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); color: #fff; }
.update-banner { background: var(--doing-soft); color: var(--doing); padding: 10px var(--gutter); text-align: center; font-size: 14px; font-weight: 600; }

/* ---------- admin ---------- */
.admin table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin th, .admin td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.admin .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 16px 0; }
.admin .card h2 { font-size: 16px; margin: 0 0 12px; }
.admin .grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.admin .stat { background: var(--sunken); border-radius: var(--radius-sm); padding: 10px 12px; }
.admin .stat b { display: block; font-size: 22px; }
.admin .stat span { font-size: 12px; color: var(--muted); }
.admin .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin .row > input { flex: 1 1 140px; width: auto; }
.admin code, .admin pre { font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; }

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

/* Borderless inline inputs show focus through the caret/container, not an outline box. */
.title-input:focus-visible, .desc-input:focus-visible, input.item-text:focus-visible, .add-input:focus-visible, .slug-input:focus-visible { outline: none; }
.admin .card form + h2 { margin-top: 24px; }

/* ---------- invite / share sheet ---------- */
.invite { display: grid; gap: 10px; }
.segmented { display: inline-flex; background: var(--sunken); border-radius: 999px; padding: 3px; justify-self: start; }
.segmented button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 12%); }
.audience-hint { margin: 0; }
.invite-text { font-size: 15px; }
.invite .link-box { margin-left: 0; }
.invite-actions .btn { flex: 1 1 auto; }
.qr-box { display: grid; justify-items: center; gap: 4px; padding: 8px 0; }
.qr { width: min(240px, 70vw); height: auto; border-radius: 8px; }
.center { text-align: center; justify-content: center; }
.channels { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.channels-label { font-size: 13px; color: var(--muted); margin-right: 2px; }
.chip-link { font-size: 13px; font-weight: 600; text-decoration: none; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink); }
.chip-link:hover { border-color: var(--accent); color: var(--accent-text); }
.more-links { border-top: 1px solid var(--line); padding: 4px 0; margin-top: 12px; }
.more-links summary { display: flex; align-items: center; gap: 8px; padding: 10px 0; cursor: pointer; font-weight: 600; list-style: none; }
.more-links summary::-webkit-details-marker { display: none; }
.more-links summary::after { content: "›"; margin-left: auto; color: var(--faint); font-size: 20px; transition: transform .15s; }
.more-links[open] summary::after { transform: rotate(90deg); }
.more-links summary .icon { color: var(--accent-text); }
.more-links .slug-box, .more-links .slug-actions, .more-links .hint { margin-left: 0; }
.more-links .link-row { padding-top: 0; }
.more-links .link-row .link-head { display: none; }
.more-links .link-row .hint, .more-links .link-row .link-box { margin-left: 0; }

/* ---------- share target ---------- */
.share-page .title { margin: 8px 0 16px; }
.share-preview { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 22px; }
.share-preview .host { display: flex; gap: 6px; align-items: center; margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.share-targets h2 { font-size: 15px; margin: 0 0 10px; }
.target-btn { flex: 1; display: flex; align-items: center; gap: 12px; padding: 12px; border: 0; background: none; text-align: left; cursor: pointer; }
.target-btn:hover { background: var(--sunken); }
.target-btn > .icon:last-child { color: var(--accent-text); }

/* ---------- install nudge ---------- */
.nudge {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 50;
  max-width: 520px; margin: 0 auto; display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: var(--shadow);
  transform: translateY(140%); transition: transform .3s ease;
}
.nudge.show { transform: none; }
.nudge-icon .logo-mark { width: 40px; height: 40px; border-radius: 11px; display: block; }
.nudge-icon .logo-mark::before { top: 14px; left: 10px; right: 10px; height: 4px; }
.nudge-icon .logo-mark::after { top: 23px; left: 10px; right: 17px; height: 4px; }
.nudge-text { flex: 1; min-width: 0; }
.nudge-text strong { display: block; }
.nudge-text p { margin: 2px 0 10px; font-size: 14px; color: var(--muted); }
.nudge-actions { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.nudge-alt { font-size: 14px; color: var(--muted); }

/* ---------- app update banner ---------- */
.update-banner { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding-top: max(10px, env(safe-area-inset-top)); }
.update-banner.hard { background: var(--danger-soft); color: var(--danger); }
.report { color: var(--faint); }

/* ---------- open a link ---------- */
.open-link { margin: 22px 0 0; }
.open-link-label { display: flex; gap: 8px; align-items: center; font-size: 15px; font-weight: 650; margin-bottom: 8px; }
.open-link-label .icon { color: var(--accent-text); }
.open-link-row { display: flex; gap: 8px; }
.open-link-row input { flex: 1; min-width: 0; }
.own-link { margin-bottom: 18px; }

/* ---------- device-only lists, templates, storage choice ---------- */
.chip.role-local { background: var(--sunken); color: var(--ink); }
.notice.local { background: var(--sunken); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 8px; margin: 4px 0; }
.notice.local.welcome { background: var(--accent-soft); }
.notice.local p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.online-toggle { padding: 0; }
.online-toggle small { margin-top: 2px; }
.templates { margin: 8px 0 28px; }
.templates h2 { font-size: 14px; font-weight: 650; color: var(--muted); margin: 0 0 8px; }
.tpl-row { display: flex; flex-wrap: wrap; gap: 8px; }
button.chip-link { background: var(--surface); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.bullets { padding-left: 20px; color: var(--muted); font-size: 15px; }
.bullets li + li { margin-top: 4px; }

/* ---------- item extras ---------- */
.favicon { width: 14px; height: 14px; border-radius: 3px; flex: none; object-fit: contain; }
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; background: var(--sunken); }
.due, .assignee { display: inline-flex; gap: 4px; align-items: center; }
.due.overdue { color: var(--danger); font-weight: 600; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .field-row { grid-template-columns: 1fr; } }
.paste-preview { margin: 0 0 8px; padding-left: 20px; font-size: 15px; }
.paste-preview li { overflow-wrap: anywhere; }
.trash-list li { padding: 4px 4px 4px 12px; }
.radio-list { display: grid; gap: 4px; margin: 4px 0 14px; }
.radio { display: flex; gap: 10px; align-items: center; padding: 6px 0; cursor: pointer; }
.radio input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- toast with action ---------- */
.toast.has-action { display: flex; gap: 14px; align-items: center; pointer-events: auto; padding-right: 8px; }
.toast-action { border: 0; background: rgb(255 255 255 / 18%); color: inherit; font-weight: 700; padding: 6px 12px; border-radius: 999px; cursor: pointer; }

/* ---------- print: just the list ---------- */
@media print {
  :root { color-scheme: light; --bg: #fff; --ink: #000; --muted: #444; --line: #bbb; }
  body { background: #fff; font-size: 12pt; }
  .topbar, .filters, .add-slot, .list-foot, .notices, .handle, .more-btn, .item-details, .nudge, .update-banner, .toast, .item-right, .site-foot, dialog { display: none !important; }
  .page { max-width: none; padding: 0; }
  .item { break-inside: avoid; }
  .check { border-color: #000; background: #fff !important; color: transparent !important; }
  .check[aria-checked="true"] { color: #000 !important; }
  .item.done .item-text { color: #555; }
  input.item-text, .title-input { color: #000; }
  .state-pill { border: 1px solid #000; background: #fff; color: #000; }
}

/* ---------- accessibility ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.host { min-height: 24px; padding: 2px 0; }
.item-sub a { min-height: 24px; }

/* very narrow phones (320px) with long translations: tighten the top bar instead of hiding labels */
@media (max-width: 360px) {
  .topbar { gap: 6px; }
  .logo { gap: 6px; font-size: 17px; }
  .top-actions { gap: 2px; }
  .top-actions .btn.small { padding: 0 10px; }
  .sync-status { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}
