:root {
    color-scheme: dark;
    --bg: #17191c;
    --surface: #1f2226;
    --surface-raised: #25292e;
    --surface-hover: #2b3036;
    --ink: #f2f4f7;
    --muted: #b4bbc4;
    --line: #3a4047;
    --accent: #a9ddd7;
    --accent-ink: #102d2b;
    --accent-strong: #c8f3ed;
    --selected: #3b321f;
    --selected-ink: #ffe2a0;
    --danger: #f1a4a4;
    --danger-bg: #4a292b;
    --focus: #ffd166;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5; }
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: var(--accent-strong); }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
::selection { color: #151719; background: #a9ddd7; }

.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; transform: translateY(-160%); padding: 10px 14px; border-radius: 8px; background: var(--focus); color: #161719; font-weight: 750; }
.skip-link:focus { transform: translateY(0); }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.app-header { position: sticky; z-index: 30; top: 0; display: flex; min-height: 72px; align-items: center; gap: clamp(14px, 3vw, 44px); padding: 10px clamp(14px, 2vw, 32px); background: #1d2023; border-bottom: 1px solid var(--line); }
.header-brand-group, .header-actions { display: flex; align-items: center; gap: 12px; }
.header-brand-group { flex: 0 0 260px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 1.3rem; font-weight: 760; letter-spacing: -.035em; }
.brand:hover { color: #fff; }
.brand-icon { display: inline-grid; width: 37px; height: 37px; place-items: center; border-radius: 12px; background: #e9bf56; color: #302713; font-size: 1.08rem; }
.icon-button { display: inline-grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 50%; background: transparent; color: var(--muted); font-size: 1.05rem; text-decoration: none; }
.icon-button:hover { border-color: var(--line); background: var(--surface-hover); color: var(--ink); }
.global-search { display: flex; width: min(100%, 720px); min-width: 120px; height: 48px; align-items: center; gap: 12px; padding: 0 16px; border: 1px solid transparent; border-radius: 15px; background: #2a2d30; color: var(--muted); }
.global-search:focus-within { border-color: #647d7a; background: #303438; }
.global-search > i { flex: 0 0 auto; font-size: 1.1rem; }
.global-search input { width: 100%; min-width: 0; height: 100%; padding: 0; border: 0 !important; outline: 0; background: transparent !important; color: var(--ink) !important; }
.global-search input::placeholder { color: var(--muted); opacity: 1; }
.global-search kbd { padding: 1px 6px; border: 1px solid #555b62; border-radius: 5px; color: var(--muted); font-family: inherit; font-size: .75rem; }
.header-actions { margin-left: auto; }
.header-create { min-height: 42px; white-space: nowrap; }
.logout-form { margin: 0; }

.app-frame { display: grid; min-height: calc(100vh - 72px); grid-template-columns: 260px minmax(0, 1fr); }
.sidebar { position: sticky; top: 72px; display: flex; height: calc(100vh - 72px); min-height: 360px; flex-direction: column; justify-content: space-between; padding: 20px 12px 16px 16px; overflow-y: auto; border-right: 1px solid rgba(255,255,255,.055); background: var(--bg); }
.sidebar-nav { display: grid; gap: 5px; }
.nav-section-label { margin: 2px 0 8px 14px; color: #929aa3; font-size: .72rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.nav-section-spaced { margin-top: 27px; }
.nav-link { display: flex; min-height: 48px; align-items: center; gap: 15px; padding: 10px 14px; border-radius: 0 24px 24px 0; color: #d7dbe0; text-decoration: none; font-weight: 610; }
.nav-link > i { width: 21px; flex: 0 0 21px; color: #abb2ba; text-align: center; font-size: 1.05rem; }
.nav-link:hover { background: var(--surface-hover); color: var(--ink); }
.nav-link.is-active { background: var(--selected); color: var(--selected-ink); }
.nav-link.is-active > i { color: var(--selected-ink); }
.sidebar-account { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.sidebar-account .nav-link { border-radius: 12px; }
.account-avatar { display: inline-grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 50%; background: #315c61; color: white; font-weight: 750; }
.account-label { display: grid; min-width: 0; gap: 1px; }
.account-label strong, .account-label small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-label small { color: var(--muted); font-size: .78rem; font-weight: 450; }
.sidebar-backdrop { display: none; }
.sidebar-collapsed .app-frame { grid-template-columns: minmax(0, 1fr); }
.sidebar-collapsed .sidebar { display: none; }

.main { width: min(100% - 48px, 1280px); min-width: 0; margin: 32px auto 72px; }
.page-heading { margin-bottom: 26px; }
h1 { margin: 0; font-size: clamp(1.75rem, 3vw, 2.35rem); font-weight: 680; line-height: 1.2; letter-spacing: -.035em; }
h2 { margin: 0; font-size: 1.22rem; font-weight: 680; line-height: 1.3; letter-spacing: -.015em; }
h3 { margin: 18px 0 8px; font-size: 1.04rem; }
p { margin-top: 0; }
.section-block { margin-top: 34px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.section-heading h2 { display: flex; align-items: center; gap: 9px; }
.section-heading h2 > i { color: var(--accent); font-size: 1rem; }
.section-heading > a, .text-action { font-weight: 650; text-decoration: none; }
.text-action { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: .76rem; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.count { margin-left: 3px; color: var(--muted); font-size: .88em; font-weight: 500; }
.welcome-panel { display: flex; min-height: 142px; align-items: center; justify-content: space-between; gap: 24px; padding: clamp(20px, 4vw, 36px); border: 1px solid #394549; border-radius: 20px; background: radial-gradient(circle at 85% 10%, #2b4a47 0, transparent 38%), linear-gradient(125deg, #242c2d, #222629 65%); }
.welcome-panel h2 { font-size: clamp(1.35rem, 2.4vw, 1.8rem); }
.welcome-copy { margin: 8px 0 0; color: var(--muted); }
.welcome-action { flex: 0 0 auto; }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; width: min(100%, 840px); margin: 24px auto 0; }
.quick-card { min-width: 0; border: 1px solid #4a4f54; border-radius: 14px; background: var(--surface); box-shadow: 0 8px 24px #00000017; }
.quick-card > summary { display: flex; min-height: 82px; align-items: center; gap: 13px; padding: 14px 16px; list-style: none; }
.quick-card > summary::-webkit-details-marker { display: none; }
.quick-card > summary > span:nth-child(2) { display: grid; gap: 4px; }
.quick-card > summary strong { font-size: .98rem; }
.quick-card > summary small { color: var(--muted); font-size: .84rem; }
.quick-icon { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; border-radius: 13px; background: #314443; color: var(--accent); font-size: 1.1rem; }
.quick-icon-article { background: #3f3525; color: #f4cb79; }
.quick-expand-icon { margin-left: auto; color: var(--muted); }
.quick-card[open] { border-color: #718986; }
.quick-card[open] .quick-expand-icon { transform: rotate(45deg); }
.action-form { padding: 0 17px 18px; }

.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 9px; padding: 9px 15px; border: 1px solid transparent; border-radius: 9px; background: #33383e; color: var(--ink); text-decoration: none; font-weight: 660; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.button:hover { background: #41474e; color: #fff; }
.button:active { transform: translateY(1px); }
.button-primary { background: #a9ddd7; color: #102d2b; }
.button-primary:hover { background: #c8f3ed; color: #102d2b; }
.button-secondary { border-color: #475058; background: #2c3238; color: #e2e9ee; }
.button-quiet { border-color: var(--line); background: transparent; }
.button-danger { background: var(--danger-bg); color: #ffd7d7; }
.button-small { min-height: 38px; padding: 6px 11px; font-size: .9rem; }
.button-selected { border-color: #8bbeb8; background: #2e4c49; color: #d5f7f2; }
.button:disabled { border-color: transparent; background: transparent; color: #737b84; }

label { display: grid; gap: 6px; color: #e2e5e9; font-weight: 610; }
input:not([type=checkbox]):not([type=hidden]), select, textarea { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #515961; border-radius: 8px; background: #191c1f; color: var(--ink); }
input::placeholder, textarea::placeholder { color: #a3aab2; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: #91c9c2; outline: 2px solid #91c9c255; outline-offset: 1px; }
textarea { min-height: 84px; resize: vertical; }
input[type=checkbox] { width: 22px; height: 22px; accent-color: #9ed8d0; }
input[type=date] { color-scheme: dark; }
kbd { font-family: inherit; }
.stack-form { display: grid; gap: 14px; }
.field-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.field-group legend { margin-bottom: 7px; color: #e2e5e9; font-weight: 650; }
.date-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field-hint, .record-meta, .empty-state, .result-count { color: var(--muted); font-size: .9rem; }
.field-hint { margin: 5px 0 0; }
.record-meta { display: block; }
.record-meta i { margin-right: 2px; font-size: .82em; }
.result-count { margin: 0 0 12px; }
.narrow-panel { width: min(100%, 440px); padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.public-main { width: min(100% - 32px, 480px); margin: clamp(48px, 10vh, 110px) auto 72px; }
.public-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 25px; font-size: 1.28rem; font-weight: 760; letter-spacing: -.035em; }
.public-main h1 { margin-bottom: 23px; }
.public-main .section-block { margin-top: 0; }

.list-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.list-card-grid > li { min-width: 0; }
.list-card { display: flex; min-height: 205px; flex-direction: column; gap: 14px; padding: 20px; border: 1px solid #3b4249; border-radius: 15px; background: linear-gradient(155deg, #24292e, #202428 70%); color: var(--ink); text-decoration: none; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.list-card:hover { transform: translateY(-2px); border-color: #6b8885; background: #282f33; color: #fff; }
.list-card:focus-visible { outline-offset: 4px; }
.list-card-kicker { display: inline-flex; align-items: center; gap: 8px; color: #b7d4d0; font-size: .8rem; font-weight: 700; }
.list-card-kicker i { font-size: .9rem; }
.list-card-title { overflow: hidden; font-size: 1.2rem; line-height: 1.25; text-overflow: ellipsis; }
.list-card-description { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: .9rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.list-card-progress { display: flex; justify-content: space-between; gap: 12px; margin-top: auto; color: #c2c8ce; font-size: .84rem; }
.list-card progress, .progress-block progress { display: block; width: 100%; height: 9px; overflow: hidden; border: 0; border-radius: 99px; background: #41474d; accent-color: #a9ddd7; }
.list-card progress::-webkit-progress-bar, .progress-block progress::-webkit-progress-bar { border-radius: 99px; background: #41474d; }
.list-card progress::-webkit-progress-value, .progress-block progress::-webkit-progress-value { border-radius: 99px; background: #a9ddd7; }
.list-card progress::-moz-progress-bar, .progress-block progress::-moz-progress-bar { border-radius: 99px; background: #a9ddd7; }
.empty-state { display: grid; gap: 8px; padding: 24px; border: 1px dashed #51575e; border-radius: 13px; background: #1d2023; text-align: center; }
.empty-state strong { color: var(--ink); font-size: 1.05rem; }
.empty-state-icon { justify-items: center; padding: 36px 20px; }
.empty-icon { display: grid; width: 52px; height: 52px; place-items: center; margin-bottom: 3px; border-radius: 16px; background: #303a3a; color: var(--accent); font-size: 1.3rem; }

.list-drawer { position: fixed; z-index: 60; inset: 0 0 0 auto; display: none; width: min(760px, 72vw); height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; overflow: auto; border: 0; background: #f5d9cf; color: #292523; color-scheme: light; --ink: #292523; --muted: #5d514c; --line: #d4b6ac; --accent: #175b54; --accent-strong: #104841; --surface: #f8e8e2; --surface-raised: #fff8f4; --surface-hover: #f0d2c7; --focus: #735100; box-shadow: -18px 0 48px #0005; }
.list-drawer[open] { display: block; }
.no-js .list-drawer:not([open]) { display: block; }
.list-drawer::backdrop { background: #080a0dbb; backdrop-filter: blur(2px); }
.list-drawer-header { position: sticky; z-index: 4; top: 0; display: flex; min-height: 82px; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: #f1d1c6f5; backdrop-filter: blur(14px); }
.list-drawer-back { flex: 0 0 auto; min-height: 44px; padding: 8px 10px; }
.list-drawer-heading { min-width: 0; flex: 1 1 auto; }
.list-drawer-heading .eyebrow { margin-bottom: 2px; }
.list-title-form { min-width: 0; }
.list-title-heading { display: flex; align-items: center; gap: 8px; margin: 0; }
.list-title-input { width: 100%; min-width: 0; min-height: 1.4em !important; padding: 2px 5px !important; border: 1px solid transparent !important; border-radius: 6px !important; background: transparent !important; color: var(--ink) !important; cursor: text; font: inherit !important; font-size: 1.45rem !important; font-weight: 730 !important; line-height: 1.2 !important; }
.list-title-input:hover { border-color: #c5a79d !important; background: #f9e8e1 !important; }
.list-title-input:focus { border-color: #82645c !important; background: #fff9f6 !important; outline: 2px solid #82645c66 !important; }
.title-edit-icon { flex: 0 0 auto; color: #75625c; font-size: .78rem; }
.title-status { display: block; min-height: 1em; margin: 2px 5px 0; color: #4a6159; font-size: .75rem; }
.list-drawer-content { padding: 18px 24px 110px; scroll-padding-bottom: 110px; }
.list-drawer-content .list-type-line { margin-top: 0; }
.list-drawer-footer { position: sticky; z-index: 3; bottom: 0; display: flex; justify-content: flex-end; padding: 12px 24px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #f1d1c6f5; backdrop-filter: blur(12px); }
.list-drawer-footer .button { min-height: 48px; }
.list-drawer .record-meta, .list-drawer .field-hint { color: #564a45; }
.list-drawer .item-list { border: 0; }
.list-drawer .item-row { margin: 8px 0; padding: 12px 14px; border: 1px solid #d3b0a5; border-radius: 11px; background: #fae8e0; box-shadow: 0 2px 5px #5d35240d; }
.list-drawer .progress-block { border-color: #d1a99d; background: #efcabe; color: #2f2926; }
.list-drawer .progress-block progress { background: #d7b5aa; accent-color: #326c62; }
.list-drawer .progress-block progress::-webkit-progress-bar { background: #d7b5aa; }
.list-drawer .progress-block progress::-webkit-progress-value, .list-drawer .progress-block progress::-moz-progress-bar { background: #326c62; }
.list-drawer input:not([type=checkbox]):not([type=hidden]), .list-drawer select, .list-drawer textarea { background: #fffaf7; color: #292523; border-color: #aa938b; }
.list-drawer input::placeholder, .list-drawer textarea::placeholder { color: #655b56; }
.list-drawer .tag-pill, .list-drawer .tag-chip { border-color: #d0b1a7; background: #f8e8e2; color: #39312e; }
.list-drawer .compact-details[open], .list-drawer .list-filters[open] { border-color: #d4b6ac; background: #f2d5ca; }
.list-drawer .compact-details > summary, .list-drawer .association-details > summary, .list-drawer .list-description > summary { color: #175b54; }
.list-drawer .button-quiet { border-color: #c4a9a0; color: #38312e; }
.list-drawer .button-secondary { border-color: #3d454b; background: #394047; color: #fff; }
.list-drawer .empty-state { border-color: #bd9d92; background: #fae8e0; color: #514641; }
.list-drawer .empty-state strong { color: #292523; }
.js .article-check-form .state-save { display: none; }
.list-filters { margin: 8px 0 14px; }
.list-filters > summary { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; color: var(--muted); font-weight: 620; }
.list-filters[open] { padding: 10px 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.article-check-form { display: grid; grid-template-columns: minmax(0,1fr) minmax(148px, 190px); align-items: center; gap: 8px 14px; grid-column: 1 / -1; }
.article-check { display: flex; min-width: 0; min-height: 48px; align-items: center; gap: 12px; cursor: pointer; }
.article-check > input[type=checkbox] { width: 24px; height: 24px; flex: 0 0 24px; margin: 0; cursor: pointer; }
.article-check-copy { display: grid; min-width: 0; gap: 2px; }
.article-check-copy strong { overflow-wrap: anywhere; font-size: 1rem; }
.article-check input:checked + .article-check-copy strong { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.article-check-copy .record-meta { overflow-wrap: anywhere; font-size: .82rem; }
.state-select-label { min-width: 0; gap: 3px; }
.state-select-label select { min-height: 44px; }
.state-save { min-height: 44px; justify-self: end; }
.association-details > summary, .list-description > summary { display: inline-flex; min-height: 44px; align-items: center; color: var(--accent); cursor: pointer; }
.list-description { margin: 8px 0; padding: 0 12px; border-left: 2px solid var(--line); }
.list-description > p { margin: 6px 0; }
.item-row { grid-template-columns: minmax(0,1fr) auto; }
.association-details { grid-column: 2; justify-self: end; }
.association-details > summary { width: 44px; justify-content: center; border-radius: 50%; color: #175b54; }
.association-details > summary:hover { background: #edcfc4; }
.association-details[open] > summary { background: #edcfc4; }
.association-details .remove-article-form .icon-button { min-height: 44px; border-color: #c4a9a0; color: #783a36; }
.list-drawer .search-result .button { min-width: 44px; min-height: 44px; padding: 8px; }
.item-row > .inline-form { grid-column: 2; }
.item-row > .article-feedback { grid-column: 1 / -1; min-height: 0; }
#add-article { scroll-margin-top: 105px; }

.notice { margin: 0 0 18px; padding: 12px 15px; border: 1px solid transparent; border-radius: 10px; }
.notice-success { border-color: #3d604b; background: #233b2d; color: #c8f1d4; }
.notice-error { border-color: #724447; background: #40282b; color: #ffd6d8; }
.notice-info { border-color: #405a69; background: #263943; color: #d5ebf6; }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.tag-pill, .tag-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid #434b52; border-radius: 999px; background: #2b3035; color: #d9dfe5; font-size: .86rem; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip button { min-width: 28px; min-height: 28px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 1.1rem; }
.tag-chip button:hover { background: #41474d; }
.tag-picker { position: relative; }
.tag-suggestions { position: absolute; z-index: 5; top: calc(100% - 6px); left: 0; right: 0; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: #25292d; box-shadow: 0 8px 20px #0008; }
.tag-suggestions button { display: block; width: 100%; min-height: 42px; padding: 9px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); text-align: left; }
.tag-suggestions button:hover { background: #383e43; }

.compact-details { margin-top: 13px; }
.compact-details > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 5px 2px; color: #b9e5df; font-weight: 650; }
.compact-details[open] { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #202428; }
.compact-details[open] > summary { margin-bottom: 10px; }
.list-type-line { margin: -12px 0 0; }
.item-list { margin: 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px 14px; padding: 15px 4px; border-bottom: 1px solid var(--line); }
.item-main { min-width: 0; }
.item-main strong { display: block; margin-bottom: 3px; }
.item-main .record-meta { overflow-wrap: anywhere; }
.progress-block { max-width: 620px; margin: 18px 0; padding: 15px 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.progress-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.list-search { align-items: end; margin-bottom: 12px; }
.list-search label { flex: 1; }
.group-heading { margin: 18px 0 6px; padding: 9px 11px; border-radius: 8px; background: #2b3035; }
.association-details { grid-column: 1 / -1; }
.association-details > summary { color: #b9e5df; cursor: pointer; font-size: .9rem; }
.association-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 10px 0; }
.association-form label { font-size: .88rem; }
.association-wide { grid-column: 1 / -1; }
.order-actions, .list-actions, .copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.list-actions { margin-bottom: 14px; }
.copy-row input { flex: 1; }
.invite-url-label { margin-top: 16px; }
.state-form, .inline-form { display: flex; align-items: center; gap: 6px; }
.state-form select { width: auto; min-width: 130px; }
.article-feedback { color: var(--muted); font-size: .84rem; }
.search-form { display: flex; align-items: end; gap: 10px; }
.search-form label { flex: 1; }
.list-browser-search label { position: relative; display: flex; align-items: center; }
.list-browser-search label > i { position: absolute; left: 14px; color: var(--muted); }
.list-browser-search input { padding-left: 42px !important; }
.search-results { display: grid; gap: 7px; margin-top: 8px; }
.search-result { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.search-result > span { min-width: 0; overflow-wrap: anywhere; }
.search-article-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.search-article-row > div { min-width: 0; }
.suggestion-list { display: grid; gap: 5px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; background: #292e33; }
.check-row .record-meta { margin-left: auto; }
.record-list, .state-list { margin: 0; padding: 0; list-style: none; }
.record-list { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.record-list > li { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.record-list > li:last-child { border-bottom: 0; }
.record-link { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--ink); text-decoration: none; }
.record-link > span:first-child { font-weight: 660; }
.record-link .record-meta { text-align: right; }
.catalog-record { padding-bottom: 8px; }
.delete-article-form { margin: 0; }
.catalog-rows { margin: 12px 0 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); list-style: none; }
.catalog-row { display: grid; grid-template-columns: minmax(0,1fr) auto 42px; align-items: center; gap: 8px; min-height: 48px; padding: 3px 8px 3px 12px !important; border-bottom: 1px solid var(--line); }
.catalog-row:last-child { border-bottom: 0; }
.catalog-article-name-form, .catalog-row .delete-article-form { min-width: 0; margin: 0; }
.catalog-name-edit-input { width: 100%; min-width: 0; min-height: 40px !important; padding: 5px 7px !important; border: 1px solid transparent !important; border-radius: 6px !important; background: transparent !important; color: var(--ink) !important; font: inherit; font-weight: 650; }
.catalog-name-edit-input:hover { border-color: var(--line) !important; background: var(--surface-hover) !important; }
.catalog-name-edit-input:focus { border-color: var(--focus) !important; background: var(--surface-raised) !important; outline: 2px solid color-mix(in srgb, var(--focus), transparent 65%) !important; }
.catalog-row-count { color: var(--muted); font-size: .88rem; white-space: nowrap; }
.catalog-row .delete-article-form { display: grid; place-items: center; }
.catalog-row .delete-article-form .icon-button { width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 0; border-color: transparent; background: transparent; color: var(--danger); }
.catalog-row .delete-article-form .icon-button:hover { border-color: var(--danger); background: var(--danger-bg); }
.type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.type-rows { display: grid; grid-template-columns: minmax(0, 1fr); }
.type-row { grid-template-columns: minmax(0, 1fr) auto auto auto; }
.type-name-form { min-width: 0; margin: 0; }
.type-row .type-save, .type-row .type-delete .icon-button { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
.type-delete { display: grid; place-items: center; margin: 0; }
.type-delete .icon-button { margin: 0; }
.state-list { display: grid; gap: 9px; }
.state-list > li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; border: 1px solid #343a40; border-radius: 9px; background: #22262a; }
.state-edit { flex: 1 1 160px; }
.add-state-form { margin-top: 12px; }
.type-delete { margin-top: 12px; }
.destructive-block { padding-top: 8px; border-top: 1px solid var(--line); }

@media (max-width: 1100px) {
    .header-brand-group { flex-basis: 220px; }
    .list-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .main { width: min(100% - 40px, 1100px); }
}

@media (max-width: 760px) {
    .app-header { min-height: 66px; flex-wrap: wrap; gap: 8px 12px; padding: 8px 12px; }
    .header-brand-group { flex: 1 1 auto; }
    .brand { font-size: 1.18rem; }
    .brand-icon { width: 34px; height: 34px; }
    .header-actions { margin-left: 0; }
    .header-create { min-width: 44px; width: 44px; padding: 0; border-radius: 50%; }
    .header-create span { display: none; }
    .global-search { order: 3; width: 100%; height: 44px; flex: 1 0 100%; }
    .global-search kbd { display: none; }
    .app-frame { display: block; min-height: calc(100vh - 122px); }
    .account-shortcut { display: none; }
    .sidebar { position: fixed; z-index: 41; top: 112px; bottom: 0; left: 0; width: min(84vw, 320px); height: auto; min-height: 0; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 14px 0 34px #0008; }
    .sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-open { overflow: hidden; }
    .sidebar-collapsed .sidebar { display: flex; }
    .sidebar-backdrop:not([hidden]) { position: fixed; z-index: 40; inset: 112px 0 0; display: block; width: 100%; height: calc(100dvh - 112px); border: 0; background: #0009; }
    .main { width: min(100% - 30px, 720px); margin: 24px auto 56px; }
    .page-heading { margin-bottom: 20px; }
    .welcome-panel { align-items: flex-start; flex-direction: column; gap: 17px; }
    .quick-actions { grid-template-columns: 1fr; margin-top: 16px; }
    .quick-card > summary { min-height: 72px; }
    .section-block { margin-top: 28px; }
    .item-row { grid-template-columns: minmax(0, 1fr) auto; }
    .item-main { grid-column: 1 / -1; }
    .state-form { grid-column: 1; }
    .item-row > .inline-form { grid-column: 2; }
    .record-link { align-items: flex-start; flex-direction: column; gap: 3px; }
    .record-link .record-meta { text-align: left; }
    .search-form { align-items: stretch; flex-direction: column; }
    .search-article-row { align-items: flex-start; flex-direction: column; gap: 4px; }
    .check-row { flex-wrap: wrap; }
    .check-row .record-meta { width: 100%; margin-left: 32px; }
    .type-grid { grid-template-columns: 1fr; }
    .list-drawer { width: 100%; border-radius: 0; }
    .list-drawer-header { min-height: 70px; padding: 10px 14px; }
    .list-drawer-back { padding: 7px 8px; font-size: .88rem; }
    .list-drawer-content { padding: 14px 16px 100px; }
    .list-drawer-footer { padding-right: 16px; padding-left: 16px; }
}

@media (max-width: 520px) {
    .list-card-grid { grid-template-columns: 1fr; gap: 11px; }
    .list-card { min-height: 185px; padding: 18px; }
    .date-grid, .association-form { grid-template-columns: 1fr; }
    .association-wide { grid-column: auto; }
    .main { width: min(100% - 24px, 480px); margin-top: 18px; }
    .section-heading { align-items: flex-start; }
    .section-heading > a, .text-action { font-size: .9rem; }
    .quick-card[open] { padding-bottom: 3px; }
    .list-actions { flex-direction: column; align-items: stretch; }
    .list-actions > form, .list-actions .button { width: 100%; }
    .state-list > li { align-items: stretch; }
    .state-edit { flex-basis: 100%; }
    .article-check-form { grid-template-columns: minmax(0,1fr) auto; gap: 5px 8px; }
    .article-check { grid-column: 1 / -1; grid-row: auto; }
    .state-select-label { grid-column: 1; grid-row: auto; }
    .state-save { grid-column: 2; grid-row: auto; align-self: end; }
    .association-details { grid-column: 2; grid-row: auto; align-self: end; }
    .list-drawer-content { padding-right: 12px; padding-left: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Checklist panel: compact controls, clear list identity and inline editing. */
.list-drawer-header { gap: 10px; }
.list-drawer-back { width: 44px; min-width: 44px; padding: 0; border: 0; background: transparent; color: #342d2a; font-size: 1.15rem; }
.list-drawer-back:hover { background: transparent; }
.list-drawer-back:focus-visible { outline: none; box-shadow: inset 0 -3px var(--accent); }
.list-drawer-heading { flex: 1 1 0; }
.list-title-heading { display: block; }
.list-title-input { padding: 3px 6px !important; font-size: clamp(1.2rem, 2.4vw, 1.55rem) !important; }
.title-edit-icon { display: none; }
.list-drawer-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 3px; }
.list-drawer-actions form { margin: 0; }
.list-drawer-actions .icon-button { width: 40px; height: 40px; min-width: 40px; min-height: 40px; flex: 0 0 40px; padding: 0; border-color: transparent; border-radius: 50%; background: transparent; color: #51423c; font-size: 1rem; }
.list-drawer-actions .icon-button:hover { border-color: #c9a89d; background: #efd0c5; }
.list-drawer-actions .danger-icon { color: #893c38; }
.list-drawer-content { padding-bottom: max(28px, env(safe-area-inset-bottom)); scroll-padding-bottom: 28px; }
.list-drawer .progress-block { margin: 10px 0 15px; padding: 8px 12px; border-radius: 9px; }
.list-drawer .progress-label { margin-bottom: 4px; align-items: center; font-size: .84rem; }
.list-drawer .progress-label strong { font-size: .85rem; }
.list-drawer .progress-label [data-progress-percent] { font-size: .78rem; }
.list-drawer progress { display: block; width: 100%; height: 4px; }
.list-drawer .checklist-section { margin-top: 17px; }
.list-drawer .checklist-section .section-heading { margin-bottom: 6px; }
.list-drawer-actions .danger-icon { color: var(--danger); }
.checklist-list { border-top: 1px solid #d4b6ac; }
.list-drawer .checklist-row { display: grid; grid-template-columns: 38px minmax(0,1fr) 38px; gap: 4px; align-items: center; min-height: 54px; margin: 0; padding: 4px 4px; border: 0; border-bottom: 1px solid #dfc5bd; border-radius: 0; background: transparent; box-shadow: none; }
.checklist-check-form { display: grid; place-items: center; margin: 0; }
.article-check { display: grid; width: 44px; min-height: 44px; place-items: center; cursor: pointer; }
.article-check > input[type=checkbox] { width: 22px; height: 22px; margin: 0; accent-color: #175b54; }
.article-name-form { min-width: 0; margin: 0; }
.list-drawer .article-name-input { display: block; width: 100%; min-height: 42px !important; padding: 6px 7px !important; border: 1px solid transparent !important; border-radius: 6px !important; background: transparent !important; color: #292523 !important; font: inherit; overflow-wrap: anywhere; }
.list-drawer .article-name-input:hover { border-color: #d4b6ac !important; background: #fae8e0 !important; }
.list-drawer .article-name-input:focus { border-color: #82645c !important; background: #fff9f6 !important; outline: 2px solid #82645c66 !important; }
.list-drawer .article-name-input.is-done { color: #665a55 !important; text-decoration: line-through; text-decoration-thickness: 1px; }
.checklist-row .remove-article-form { display: grid; place-items: center; margin: 0; }
.checklist-remove, .quick-add-submit { width: 40px; height: 40px; min-width: 40px; min-height: 40px; flex: 0 0 40px; padding: 0; border-color: transparent; border-radius: 50%; background: transparent; color: #765f58; }
.checklist-remove:hover { border-color: #d6aaa3; background: #f0d2c7; color: #853b37; }
.article-feedback { grid-column: 2 / -1; min-height: 0; font-size: .75rem; }
.checklist-add-row { position: relative; display: block !important; }
.article-check-placeholder { display: grid; width: 44px; min-height: 44px; place-items: center; color: #8a7972; font-size: 1.15rem; }
.quick-add-form { position: relative; display: flex; width: 100%; min-width: 0; align-items: center; gap: 3px; margin: 0; }
.quick-add-form .article-check-placeholder { flex: 0 0 44px; }
.list-drawer .quick-add-form > input[type=text] { flex: 1 1 0; width: 0 !important; min-width: 0 !important; min-height: 44px !important; padding: 7px !important; border: 1px solid transparent !important; border-radius: 6px !important; background: transparent !important; color: #292523 !important; font: inherit; }
.list-drawer .quick-add-form > input[type=text]:focus { border-color: #82645c !important; background: #fff9f6 !important; outline: 2px solid #82645c66 !important; }
.quick-add-submit { flex: 0 0 40px; color: #175b54; }
.quick-add-submit:hover { background: #e7c5ba; }
.quick-add-suggestions { position: absolute; z-index: 6; top: calc(100% + 2px); right: 0; left: 0; max-height: 240px; overflow: auto; margin: 0; padding: 5px; border: 1px solid #b99b91; border-radius: 8px; background: #fffaf7; box-shadow: 0 8px 20px #38231f33; list-style: none; }
.quick-add-suggestions[hidden] { display: none; }
.quick-add-option { width: 100%; min-height: 42px; padding: 8px 10px; border: 0; border-radius: 5px; background: transparent; color: #292523; text-align: left; cursor: pointer; }
.quick-add-option:hover, .quick-add-option:focus { background: #f0d2c7; }
.list-drawer .list-description { margin-block: 6px; }

/* Responsive suggestions and compact search surfaces. */
.global-search, .list-browser-search, .catalog-search { position: relative; }
.global-search { z-index: 10; }
.list-browser-search, .catalog-search { width: min(100%, 720px); }
.list-browser-search { display: flex; min-height: 46px; align-items: center; gap: 10px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--muted); }
.list-browser-search > input { min-width: 0; flex: 1; border: 0 !important; background: transparent !important; color: var(--ink) !important; outline: 0; }
.catalog-search > input { padding-right: 42px; }
.autocomplete-suggestions { position: absolute; z-index: 50; top: calc(100% + 5px); right: 0; left: 0; max-height: min(55vh, 360px); overflow-y: auto; margin: 0; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-raised); box-shadow: 0 10px 28px #0005; list-style: none; }
.autocomplete-suggestions[hidden] { display: none; }
.autocomplete-suggestions li { margin: 0; }
.autocomplete-option { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 11px; border-radius: 7px; color: var(--ink); text-decoration: none; }
.autocomplete-option:hover, .autocomplete-option:focus-visible { background: var(--surface-hover); color: var(--ink); }
.autocomplete-option span { overflow: hidden; color: var(--muted); font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.global-suggestions { top: calc(100% + 8px); }
.catalog-quick-add { display: grid; grid-template-columns: minmax(0,1fr) 46px; align-items: center; gap: 8px; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.catalog-name-wrap { position: relative; min-width: 0; }
.catalog-name-wrap > input { width: 100%; }
.catalog-suggestions { position: absolute; z-index: 50; top: calc(100% + 5px); right: 0; left: 0; max-height: min(55vh, 320px); overflow-y: auto; margin: 0; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-raised); box-shadow: 0 10px 28px #0005; list-style: none; }
.catalog-suggestions[hidden] { display: none; }
.catalog-suggestions li { margin: 0; }
.catalog-suggestions .quick-add-option { color: var(--ink); }
.catalog-suggestions .quick-add-option:hover, .catalog-suggestions .quick-add-option:focus { background: var(--surface-hover); }
.catalog-submit { width: 42px; min-width: 42px; min-height: 42px; }
.catalog-submit { border-color: var(--line); background: var(--accent); color: var(--accent-ink); }
.catalog-submit:hover { background: var(--accent-strong); color: var(--accent-ink); }
.list-card-grid .list-card { min-height: 154px; gap: 9px; padding: 15px; }
.list-card-grid .list-card-title { font-size: 1.08rem; }
.list-card-grid .list-card progress { height: 5px; }
.quick-card { transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.quick-card:hover { transform: translateY(-2px); border-color: #6b8885; background: var(--surface-hover); }
.quick-card:focus-within { border-color: var(--accent); }
.theme-toggle { flex: 0 0 44px; }
.list-drawer-actions .is-shared { color: var(--accent); }
.list-share-menu { position: relative; margin: 0; }
.list-share-menu > summary { list-style: none; }
.list-share-menu > summary::-webkit-details-marker { display: none; }
.list-share-menu[open] > summary { border-color: var(--line); background: var(--surface-hover); }
.list-share-panel { position: absolute; z-index: 8; top: calc(100% + 7px); right: 0; width: min(320px, calc(100vw - 32px)); padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); color: var(--ink); box-shadow: 0 12px 32px #0006; }
.confirm-dialog { width: min(420px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 22px; overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-raised); color: var(--ink); box-shadow: 0 18px 54px #0008; }
.confirm-dialog::backdrop { background: #080a0dbb; backdrop-filter: blur(2px); }
.confirm-dialog h2 { margin: 0 0 8px; font-size: 1.15rem; }
.confirm-dialog p { margin: 0; color: var(--muted); }
.confirm-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin: 20px 0 0; }
.list-share-panel h2 { margin: 0 0 10px; font-size: 1rem; }
.list-share-form { display: grid; gap: 6px; margin: 0; }
.list-share-form > div { display: flex; align-items: center; gap: 5px; }
.list-share-form select { min-width: 0; flex: 1 1 auto; }
.list-share-members { display: grid; gap: 3px; margin: 10px 0 0; padding: 0; list-style: none; }
.list-share-members li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 0 3px 8px; border-top: 1px solid var(--line); }
.list-share-members form { margin: 0; }
.list-color-picker { margin: 0; padding: 0; border: 0; }
.list-color-picker legend { margin-bottom: 6px; font-weight: 650; }
.list-color-options { display: flex; flex-wrap: wrap; gap: 9px; }
.list-color-choice { position: relative; display: inline-grid; width: 40px; height: 40px; place-items: center; cursor: pointer; }
.list-color-choice > input { position: absolute; width: 1px !important; height: 1px; min-height: 1px !important; padding: 0 !important; opacity: 0; }
.list-color-swatch { display: grid; width: 30px; height: 30px; place-items: center; border: 2px solid transparent; border-radius: 50%; background: var(--list-tone); color: #fff; }
.list-color-swatch i { display: none; font-size: .8rem; }
.list-color-choice > input:checked + .list-color-swatch { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface-raised), 0 0 0 4px var(--list-tone); }
.list-color-choice > input:checked + .list-color-swatch i { display: block; }
.list-color-choice > input:focus-visible + .list-color-swatch { outline: 3px solid var(--focus); outline-offset: 3px; }
.list-card[data-list-color="moss"], .list-drawer[data-list-color="moss"], .list-color-swatch[data-list-color="moss"] { --list-tone: #687e4a; }
.list-card[data-list-color="clay"], .list-drawer[data-list-color="clay"], .list-color-swatch[data-list-color="clay"] { --list-tone: #a36e54; }
.list-card[data-list-color="ocean"], .list-drawer[data-list-color="ocean"], .list-color-swatch[data-list-color="ocean"] { --list-tone: #387a86; }
.list-card[data-list-color="berry"], .list-drawer[data-list-color="berry"], .list-color-swatch[data-list-color="berry"] { --list-tone: #83537b; }
.list-card[data-list-color="sun"], .list-drawer[data-list-color="sun"], .list-color-swatch[data-list-color="sun"] { --list-tone: #a89238; }
.list-card[data-list-color] { border-color: color-mix(in srgb, var(--list-tone) 55%, var(--line)); background: linear-gradient(150deg, color-mix(in srgb, var(--list-tone) 32%, var(--surface-raised)), color-mix(in srgb, var(--list-tone) 18%, var(--surface))); }
.list-card[data-list-color]:hover { border-color: var(--list-tone); background: color-mix(in srgb, var(--list-tone) 34%, var(--surface)); }
.list-drawer[data-list-color] { background-color: color-mix(in srgb, var(--list-tone) 28%, var(--drawer-bg)) !important; }

/* Theme palettes also drive the list panel so it follows the active site theme. */
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #f3f5f6; --surface: #fff; --surface-raised: #fff; --surface-hover: #e8eef0;
    --ink: #20282c; --muted: #58656b; --line: #d1dadd; --accent: #17665d;
    --accent-ink: #fff; --accent-strong: #0e5048; --selected: #d9eee8; --selected-ink: #164d45;
    --danger: #9d3737; --danger-bg: #f7dddd; --focus: #805500;
}
:root[data-theme="vacances"] {
    color-scheme: dark;
    --bg: #3B3F4A; --surface: #0F6F77; --surface-raised: #0F6F77; --surface-hover: #4FB6B0;
    --ink: #BFE9E3; --muted: #BFE9E3; --line: #4FB6B0; --accent: #4FB6B0;
    --accent-ink: #0F6F77; --accent-strong: #BFE9E3; --selected: #0F6F77; --selected-ink: #BFE9E3;
    --danger: #F7D2C9; --danger-bg: #593D42; --focus: #F7D2C9;
}
:root[data-theme="vacances"] body {
    background-color: var(--bg);
    background-image: none;
}
:root[data-theme="vacances"] .list-drawer {
    background-color: var(--drawer-bg) !important;
    background-image: none !important;
}
:root { --site-ink: var(--ink); --site-muted: var(--muted); --site-line: var(--line); --site-accent: var(--accent); --site-accent-strong: var(--accent-strong); --site-surface: var(--surface); --site-raised: var(--surface-raised); --site-hover: var(--surface-hover); --site-focus: var(--focus); --drawer-bg: var(--bg); --drawer-text: var(--ink); --drawer-line: var(--line); --drawer-header: var(--surface-raised); --drawer-card: var(--surface); --drawer-hover: var(--surface-hover); --drawer-input: var(--surface-raised); }
.app-header { background: var(--surface-raised); }
.brand, .nav-link, .nav-link > i { color: var(--ink); }
.global-search { background: var(--surface-hover); color: var(--muted); }
.global-search:focus-within { border-color: var(--accent); background: var(--surface); }
.global-search input { color: var(--ink) !important; }
.list-drawer { background: var(--drawer-bg); color: var(--drawer-text); color-scheme: inherit; --ink: var(--site-ink); --muted: var(--site-muted); --line: var(--site-line); --accent: var(--site-accent); --accent-strong: var(--site-accent-strong); --surface: var(--site-surface); --surface-raised: var(--site-raised); --surface-hover: var(--site-hover); --focus: var(--site-focus); }
.list-drawer-header, .list-drawer-footer { background: var(--drawer-header) !important; }
.list-drawer-back { color: var(--drawer-text) !important; }
.list-drawer-back:hover, .list-drawer-actions .icon-button:hover { background: var(--drawer-hover) !important; }
.list-title-input:hover, .list-title-input:focus, .list-drawer .article-name-input:hover, .list-drawer .article-name-input:focus, .list-drawer .quick-add-form > input[type=text]:focus { background: var(--drawer-input) !important; color: var(--drawer-text) !important; }
.list-drawer .item-row { border-color: var(--drawer-line) !important; background: var(--drawer-card) !important; color: var(--drawer-text); }
.list-drawer .checklist-row { background: transparent !important; }
.list-drawer .checklist-row.is-done { background: rgba(128, 128, 128, .14) !important; }
.list-drawer .checklist-row.is-done .article-name-input { color: var(--muted) !important; text-decoration: line-through; text-decoration-thickness: 1px; }
.list-drawer .progress-block { border-color: var(--drawer-line) !important; background: var(--surface) !important; color: var(--drawer-text) !important; }
.list-drawer .progress-block progress, .list-drawer progress::-webkit-progress-bar { background: var(--line) !important; accent-color: var(--accent); }
.list-drawer progress::-webkit-progress-value, .list-drawer progress::-moz-progress-bar { background: var(--accent) !important; }
.list-drawer input:not([type=checkbox]):not([type=hidden]), .list-drawer select, .list-drawer textarea { background: var(--drawer-input) !important; color: var(--drawer-text) !important; border-color: var(--drawer-line) !important; }
.list-drawer .list-title-input, .list-drawer .article-name-input, .list-drawer .quick-add-form > input[type=text] { background: transparent !important; color: var(--drawer-text) !important; }
.list-drawer .tag-pill, .list-drawer .tag-chip { border-color: var(--drawer-line); background: var(--surface); color: var(--drawer-text); }
.list-drawer .compact-details[open] { border-color: var(--drawer-line); background: var(--surface); }
.list-drawer .compact-details > summary, .list-drawer .list-description > summary { color: var(--accent); }
.list-drawer .button-secondary { border-color: var(--drawer-line); background: var(--surface-hover); color: var(--drawer-text); }
.list-drawer .empty-state { border-color: var(--drawer-line); background: var(--surface); color: var(--muted); }
.list-drawer .empty-state strong { color: var(--drawer-text); }
:root[data-theme="light"] body, :root[data-theme="light"] .sidebar { background: var(--bg); color: var(--ink); }
:root[data-theme="light"] .sidebar { border-color: var(--line); }
:root[data-theme="light"] .nav-link { color: var(--ink); }
:root[data-theme="light"] .nav-link > i { color: var(--muted); }
:root[data-theme="light"] .nav-link:hover { background: var(--surface-hover); color: var(--ink); }
:root[data-theme="light"] label, :root[data-theme="light"] .field-group legend { color: var(--ink); }
:root[data-theme="light"] input:not([type=checkbox]):not([type=hidden]), :root[data-theme="light"] select, :root[data-theme="light"] textarea { background: #fff; color: var(--ink); border-color: var(--line); }
:root[data-theme="light"] input[type=date] { color-scheme: light; }
:root[data-theme="light"] .button-secondary { border-color: var(--line); background: var(--surface-hover); color: var(--ink); }
:root[data-theme="light"] .list-card { border-color: var(--line); background: linear-gradient(155deg, #fff, #eaf0f1 85%); color: var(--ink); }
:root[data-theme="light"] .list-card:hover { border-color: var(--accent); background: #e5f1ef; color: var(--ink); }
:root[data-theme="light"] .list-card[data-list-color] { border-color: color-mix(in srgb, var(--list-tone) 55%, var(--line)); background: linear-gradient(150deg, color-mix(in srgb, var(--list-tone) 32%, var(--surface-raised)), color-mix(in srgb, var(--list-tone) 18%, var(--surface))); }
:root[data-theme="light"] .list-card[data-list-color]:hover { border-color: var(--list-tone); background: color-mix(in srgb, var(--list-tone) 34%, var(--surface)); }
:root[data-theme="light"] .list-card-kicker { color: var(--accent); }
:root[data-theme="light"] .list-card-progress { color: var(--muted); }
:root[data-theme="light"] .list-card progress { background: #d4e0df; accent-color: var(--accent); }
:root[data-theme="light"] .list-card progress::-webkit-progress-bar { background: #d4e0df; }
:root[data-theme="light"] .list-card progress::-webkit-progress-value, :root[data-theme="light"] .list-card progress::-moz-progress-bar { background: var(--accent); }
:root[data-theme="light"] .record-list, :root[data-theme="light"] .type-card, :root[data-theme="light"] .quick-card { border-color: var(--line); background: var(--surface); }
:root[data-theme="light"] .tag-pill, :root[data-theme="light"] .tag-chip { border-color: var(--line); background: var(--surface-hover); color: var(--ink); }
:root[data-theme="light"] .tag-suggestions { background: #fff; }
:root[data-theme="light"] .tag-suggestions button:hover { background: var(--surface-hover); }
:root[data-theme="light"] .state-list > li { border-color: var(--line); background: var(--surface); }
:root[data-theme="light"] .compact-details[open] { background: var(--surface); }
:root[data-theme="vacances"] .list-card { border-color: var(--line); background: linear-gradient(155deg, #0F6F77, #3B3F4A 85%); }
:root[data-theme="vacances"] .list-card:hover { background: #0F6F77; border-color: var(--accent); }
:root[data-theme="vacances"] .list-card[data-list-color]:hover { background: color-mix(in srgb, var(--list-tone) 34%, var(--surface)); border-color: var(--list-tone); }
:root[data-theme="vacances"] .list-card-kicker { color: var(--accent); }
:root[data-theme="vacances"] .tag-suggestions { background: var(--surface-raised); }
:root[data-theme="vacances"] .tag-suggestions button:hover { background: var(--surface-hover); }
:root[data-theme="vacances"] .button-primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
:root[data-theme="vacances"] .button-primary:hover { border-color: var(--accent-strong); background: var(--accent-strong); color: var(--bg); }
:root[data-theme="vacances"] .list-drawer .checklist-list,
:root[data-theme="vacances"] .list-drawer .checklist-row { border-color: var(--line); }
:root[data-theme="vacances"] .list-drawer .article-check > input[type=checkbox] { accent-color: var(--accent); }
:root[data-theme="vacances"] .list-drawer .article-name-input.is-done { color: var(--muted) !important; }
:root[data-theme="vacances"] .list-drawer .article-name-input:hover { border-color: var(--line) !important; background: var(--surface-hover) !important; }
:root[data-theme="vacances"] .list-drawer .article-name-input:focus,
:root[data-theme="vacances"] .list-drawer .quick-add-form > input[type=text]:focus { border-color: var(--focus) !important; background: var(--surface) !important; outline-color: var(--focus) !important; }
:root[data-theme="vacances"] .list-drawer .quick-add-suggestions { border-color: var(--line); background: var(--surface-raised); }
:root[data-theme="vacances"] .list-drawer .quick-add-option { color: var(--ink); }
:root[data-theme="vacances"] .list-drawer .quick-add-option:hover,
:root[data-theme="vacances"] .list-drawer .quick-add-option:focus { background: var(--surface-hover); }
:root[data-theme="vacances"] .list-drawer .quick-add-submit { color: var(--ink); }
:root[data-theme="vacances"] .list-drawer .quick-add-submit:hover,
:root[data-theme="vacances"] .list-drawer .checklist-remove:hover { border-color: var(--line); background: var(--surface-hover); color: var(--bg); }

/* Clear, consistent focus and action contrast across all themes. */
.icon-button:focus-visible, .button:focus-visible, .nav-link:focus-visible, .list-card:focus-visible { outline-color: var(--accent); }
.button-danger { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.button-danger:hover { border-color: var(--danger); background: var(--danger); color: var(--bg); }
.list-browser-item { position: relative; }
.list-browser-item > .list-card { padding-top: 54px; }
.list-browser-card-actions { position: absolute; z-index: 1; top: 5px; right: 7px; display: flex; align-items: center; gap: 2px; }
.list-browser-card-actions .home-list-pin .icon-button { width: 36px; height: 36px; min-width: 36px; color: var(--muted); }
.list-browser-card-actions .home-list-pin .icon-button.is-pinned { color: var(--accent); }
.list-browser-card-actions .home-list-pin .icon-button:focus-visible { outline-color: var(--accent); }
:root[data-theme="vacances"] .button-primary:hover { border-color: var(--accent-strong); background: var(--accent-strong); color: var(--bg); }
:root[data-theme="vacances"] .nav-link.is-active { background: var(--selected); color: var(--selected-ink); }
:root[data-theme="vacances"] .nav-link.is-active > i { color: var(--selected-ink); }
:root[data-theme="vacances"] .nav-section-label { color: #BFE9E3; }
:root[data-theme="vacances"] .list-card-kicker { color: #BFE9E3; }
:root[data-theme="vacances"] .list-card-progress { color: #BFE9E3; }
:root[data-theme="vacances"] .list-card-title, :root[data-theme="vacances"] .list-card-description { color: #BFE9E3; }
:root[data-theme="vacances"] .list-card[data-list-color] .list-card-kicker,
:root[data-theme="vacances"] .list-card[data-list-color] .list-card-progress,
:root[data-theme="vacances"] .list-card[data-list-color] .list-card-title,
:root[data-theme="vacances"] .list-card[data-list-color] .list-card-description { color: var(--ink); }
:root[data-theme="vacances"] label, :root[data-theme="vacances"] .field-group legend { color: var(--ink); }
:root[data-theme="vacances"] .button-secondary { border-color: var(--line); background: #0F6F77; color: var(--ink); }
:root[data-theme="vacances"] .button-secondary:hover { background: var(--surface-hover); color: var(--bg); }
:root[data-theme="vacances"] input:not([type=checkbox]):not([type=hidden]),
:root[data-theme="vacances"] select, :root[data-theme="vacances"] textarea { background: #0F6F77; color: var(--ink); border-color: var(--line); }
:root[data-theme="vacances"] input::placeholder, :root[data-theme="vacances"] textarea::placeholder { color: #BFE9E3; }
:root[data-theme="vacances"] .tag-pill, :root[data-theme="vacances"] .tag-chip { border-color: var(--line); background: #0F6F77; color: var(--ink); }
:root[data-theme="vacances"] .record-list, :root[data-theme="vacances"] .type-row, :root[data-theme="vacances"] .quick-card { border-color: var(--line); background: #0F6F77; color: var(--ink); }
:root[data-theme="vacances"] .record-meta, :root[data-theme="vacances"] .field-hint, :root[data-theme="vacances"] .result-count { color: var(--muted); }
:root[data-theme="light"] .list-card-kicker { color: #174D46; }
:root[data-theme="light"] .list-card-progress { color: #34444A; }
.home-list-pin .icon-button:focus-visible { outline-color: var(--accent); }
@media (max-width: 520px) {
    .list-card-grid .list-card { min-height: 138px; gap: 8px; padding: 13px; }
    .catalog-quick-add { grid-template-columns: minmax(0,1fr) 42px; gap: 7px; padding: 8px; }
    .catalog-row { grid-template-columns: minmax(0,1fr) auto 40px; gap: 4px; padding-left: 7px !important; }
    .quick-add-form { gap: 2px; }
    .quick-add-form .article-check-placeholder { flex-basis: 40px; }
    .list-drawer .quick-add-form > input[type=text] { min-width: 0 !important; width: 0 !important; }
}

.quick-actions--single { grid-template-columns: minmax(0,1fr); max-width: 520px; margin-left: 0; }
.home-list-card { position: relative; }
.home-list-link { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 9px; color: var(--ink); text-decoration: none; }
.home-list-card .home-list-link { padding-top: 34px; }
.home-list-link:hover { color: var(--ink); }
.home-list-actions { position: absolute; top: 7px; right: 7px; display: flex; align-items: center; gap: 2px; }
.home-list-pin { margin: 0; }
.home-list-pin .icon-button { width: 36px; min-width: 36px; height: 36px; color: var(--muted); }
.home-list-pin .icon-button.is-pinned { color: var(--accent); transform: rotate(-35deg); }
.home-list-pin .icon-button:focus-visible { outline-color: var(--accent); }
.shared-list-indicator { display: inline-grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: var(--accent); }
.home-list-actions .shared-list-indicator { width: 36px; height: 36px; }
.shared-list-indicator i { font-size: .95rem; }
.list-card .shared-list-indicator { position: absolute; top: 10px; right: 12px; }
.home-list-card .shared-list-indicator { position: static; }
.home-list-complete { display: inline-grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.home-list-delete { margin: 0; }
.home-list-delete .icon-button { width: 36px; height: 36px; min-width: 36px; color: var(--danger); }
.home-empty-state { margin-top: 12px; }
@media (hover: hover) and (pointer: fine) {
    .home-list-delete .icon-button { opacity: 0; transition: opacity .14s ease, background .14s ease; }
    .home-list-card:hover .home-list-delete .icon-button,
    .home-list-card:focus-within .home-list-delete .icon-button { opacity: 1; }
}
@media (max-width: 760px) {
    .quick-actions--single { width: 100%; max-width: 520px; margin-right: auto; }
    .home-list-card { padding-right: 54px !important; }
    .home-list-actions { top: 5px; right: 5px; }
    .home-list-delete .icon-button { opacity: 1; }
}
@media (max-width: 760px) {
    .list-drawer-header { min-height: 62px; gap: 4px; padding: 7px 8px; }
    .list-drawer-actions { gap: 0; }
    .list-drawer-actions .icon-button { width: 36px; height: 36px; min-width: 36px; min-height: 36px; flex: 0 0 36px; }
    .list-drawer-content { padding: 12px 12px max(24px, env(safe-area-inset-bottom)); }
    .list-drawer .checklist-row { grid-template-columns: 38px minmax(0,1fr) 34px; }
    .checklist-remove { width: 34px; height: 34px; min-width: 34px; min-height: 34px; flex: 0 0 34px; }
}
@media (max-width: 760px) {
    .list-share-panel {
        position: fixed;
        z-index: 80;
        inset: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
        width: auto;
        max-height: none;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        box-sizing: border-box;
        transform: none;
    }
}

/* The main region is the skip-link destination; avoid a viewport-sized focus frame. */
.main:focus-visible { outline: none; }
.list-drawer .checklist-row { grid-template-columns: 70px minmax(0,1fr) 38px; }
.checklist-status-controls { display: flex; min-width: 0; align-items: center; justify-content: center; gap: 0; }
.checklist-check-form, .checklist-pending-form { display: grid; place-items: center; margin: 0; }
.checklist-status-controls .article-check { width: 34px; min-height: 44px; }
.checklist-status-controls .article-check > input[type=checkbox] { width: 20px; height: 20px; accent-color: #21a67a; }
.checklist-status-controls .article-pending > input[type=checkbox] { accent-color: #d34d52; }
.list-drawer .checklist-row.is-pending { background: color-mix(in srgb, var(--danger) 10%, transparent) !important; }
.list-drawer .checklist-row.is-pending .article-name-input { color: var(--danger) !important; }
.list-drawer .checklist-row.is-pending .article-name-input.is-pending { text-decoration: none; }
@media (max-width: 760px) {
    .list-drawer .checklist-row { grid-template-columns: 70px minmax(0,1fr) 34px; }
}
.home-list-pin .icon-button.is-pinned, .list-browser-card-actions .home-list-pin .icon-button.is-pinned { color: #ffd54a !important; }
.list-drawer .article-pending { position: relative; color: var(--muted); }
.list-drawer .article-pending > input[type=checkbox] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%); white-space: nowrap; }
.list-drawer .article-pending > i { color: var(--muted); font-size: 1.15rem; }
.list-drawer .article-pending > input:checked + i { color: var(--danger); }
.list-drawer .article-pending > input:focus-visible + i { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
.pending-alert { display: inline-flex; width: fit-content; align-items: center; gap: 6px; margin-top: 2px; padding: 4px 8px; border: 1px solid color-mix(in srgb, var(--danger) 55%, transparent); border-radius: 999px; background: var(--danger-bg); color: var(--danger); font-size: .8rem; font-weight: 700; }
.pending-alert i { font-size: .9rem; }
.list-browser-card-actions .home-list-pin .icon-button.is-pinned { color: #ffd54a !important; }
.fixed-list-type { display: flex; align-items: center; gap: 12px; }
.fixed-list-type > i { width: 24px; color: var(--accent); text-align: center; }
.anonymous-share-section { display: flex; flex-direction: column; gap: 7px; margin: 12px 0; padding: 10px; border: 1px solid var(--line); border-radius: 9px; }
.anonymous-share-section h3, .anonymous-share-section p, .anonymous-share-section label, .anonymous-share-section .public-share-active { margin: 0; }
.anonymous-share-section h3 { font-size: .9rem; }
.anonymous-share-create, .anonymous-share-revoke { align-self: flex-end; margin: 0; }
.public-share-active { color: var(--accent); font-size: .85rem; }
.public-share-active i { margin-right: 4px; }
.public-shared-list { width: min(100%, 700px); margin: 0 auto; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.public-share-type { display: flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 700; }
.public-shared-list h2 { margin: 8px 0 16px; font-size: clamp(1.6rem, 5vw, 2.2rem); }
.public-share-progress { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; color: var(--muted); }
.public-shared-list > progress { width: 100%; height: 6px; accent-color: var(--accent); }
.public-share-articles { display: grid; gap: 0; margin: 18px 0 0; padding: 0; list-style: none; }
.public-share-article { display: flex; min-height: 48px; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.public-share-article > i { width: 20px; color: var(--muted); text-align: center; }
.public-share-article.is-done { color: var(--muted); text-decoration: line-through; }
.public-share-article.is-pending { color: var(--danger); }
.public-share-article.is-pending > i { color: var(--danger); }
.public-share-readonly { margin: 18px 0 0; color: var(--muted); font-size: .85rem; text-align: right; }
.list-drawer-back:hover { background: transparent !important; }
.list-drawer-back:focus-visible { border-radius: 4px; outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: none; }
@media (max-width: 760px) {
    html, body, .main, .sidebar, .list-drawer { scrollbar-width: none; }
    html::-webkit-scrollbar, body::-webkit-scrollbar, .main::-webkit-scrollbar, .sidebar::-webkit-scrollbar, .list-drawer::-webkit-scrollbar { display: none; width: 0; height: 0; }
}
@media (max-width: 520px) {
    .public-shared-list { padding: 14px; }
    .anonymous-share-section .copy-row { min-width: 0; }
}

/* The list picker stays a compact, scannable list instead of card panels. */
.home-list-grid, .list-browser > .list-card-grid, .page-search .section-block > .list-card-grid { grid-template-columns: minmax(0, 1fr); gap: 0; border-top: 1px solid var(--line); }
.home-list-grid > li, .list-browser-item { border-bottom: 1px solid var(--line); }
.home-list-grid .home-list-card, .list-browser-item > .list-card, .page-search .section-block .list-card {
    min-height: 0 !important;
    border: 0 !important;
    border-left: 4px solid var(--list-tone) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transition: background-color .14s ease;
}
.home-list-grid .home-list-card:hover, .list-browser-item > .list-card:hover, .page-search .section-block .list-card:hover { transform: none; background: var(--surface-hover) !important; }
.home-list-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 4px !important; }
.home-list-card .home-list-link { display: grid; grid-template-columns: minmax(120px, .8fr) minmax(0, 1.5fr) minmax(150px, 1fr); align-items: center; gap: 3px 14px; padding: 0 4px !important; }
.home-list-card .list-card-kicker { grid-column: 1; grid-row: 1; }
.home-list-card .list-card-title { grid-column: 2; grid-row: 1; font-size: 1rem; }
.home-list-card .list-card-description { display: none; }
.home-list-card .list-card-progress { grid-column: 3; grid-row: 1; margin: 0; }
.home-list-card progress { grid-column: 3; grid-row: 2; height: 4px; }
.home-list-card .pending-alert { grid-column: 1 / 3; grid-row: 2; margin: 0; padding: 1px 7px; }
.home-list-actions { position: static; align-self: center; }
.list-browser-item { position: relative; }
.list-browser-item > .list-card { display: grid; grid-template-columns: minmax(120px, .8fr) minmax(0, 1.5fr) minmax(150px, 1fr); align-items: center; gap: 3px 14px; padding: 8px 92px 8px 10px !important; }
.list-browser-item .list-card-kicker { grid-column: 1; grid-row: 1; }
.list-browser-item .list-card-title { grid-column: 2; grid-row: 1; font-size: 1rem; }
.list-browser-item .list-card-description, .list-browser-item .record-meta { display: none; }
.list-browser-item .list-card-progress { grid-column: 3; grid-row: 1; margin: 0; }
.list-browser-item .list-card progress { grid-column: 3; grid-row: 2; height: 4px; }
.list-browser-item .pending-alert { grid-column: 1 / 3; grid-row: 2; margin: 0; padding: 1px 7px; }
.list-browser-card-actions { top: 50%; right: 5px; transform: translateY(-50%); }
.page-search .section-block .list-card { display: grid; grid-template-columns: minmax(120px, .8fr) minmax(0, 1.5fr) minmax(150px, 1fr); align-items: center; gap: 3px 14px; padding: 8px 42px 8px 10px !important; }
.page-search .section-block .list-card-kicker { grid-column: 1; grid-row: 1; }
.page-search .section-block .list-card-title { grid-column: 2; grid-row: 1; font-size: 1rem; }
.page-search .section-block .list-card-progress { grid-column: 3; grid-row: 1; margin: 0; }
.page-search .section-block .list-card progress { grid-column: 3; grid-row: 2; height: 4px; }
.page-search .section-block .pending-alert { grid-column: 1 / 3; grid-row: 2; margin: 0; padding: 1px 7px; }
.matching-lists { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.matching-lists[hidden], .matching-list-selected[hidden] { display: none; }
.matching-lists h3 { margin: 0; color: var(--accent); font-size: .95rem; }
.matching-lists ul { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.matching-lists li { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.matching-lists li:last-child { border-bottom: 0; }
.matching-list-info { display: grid; min-width: 0; }
.matching-list-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matching-list-info small { color: var(--muted); }
.matching-list-selected li { color: var(--accent); }
@media (max-width: 600px) {
    .home-list-card { grid-template-columns: minmax(0, 1fr) auto; }
    .home-list-card .home-list-link, .list-browser-item > .list-card, .page-search .section-block .list-card { grid-template-columns: minmax(0, 1fr) minmax(92px, .7fr); gap: 2px 10px; }
    .home-list-card .list-card-kicker, .list-browser-item .list-card-kicker, .page-search .section-block .list-card-kicker { grid-column: 1; grid-row: 1; }
    .home-list-card .list-card-title, .list-browser-item .list-card-title, .page-search .section-block .list-card-title { grid-column: 1; grid-row: 2; }
    .home-list-card .list-card-progress, .list-browser-item .list-card-progress, .page-search .section-block .list-card-progress { grid-column: 2; grid-row: 1 / 3; align-self: center; flex-direction: column; gap: 0; text-align: right; }
    .home-list-card progress, .list-browser-item .list-card progress, .page-search .section-block .list-card progress { grid-column: 2; grid-row: 3; }
    .home-list-card .pending-alert, .list-browser-item .pending-alert, .page-search .section-block .pending-alert { grid-column: 1; grid-row: 3; }
    .list-browser-item > .list-card { padding-right: 88px !important; }
}
