/* Covers carry the colour; everything around them stays quiet. */
:root {
  --ground: #f7f6f2; --sheet: #ffffff; --well: #eeede7; --ink: #14201d; --soft: #57655f; --line: #e4e2da; --edge: #85908b;
  --accent: #0d6656; --accent-strong: #0a5347; --on-accent: #ffffff; --accent-soft: #dcf0ea;
  --gold: #855000; --gold-soft: #fdeecb; --red: #a8301f; --red-soft: #fde6e1; --focus: #c07a00; --marigold: #f5a524;
  --glass: rgb(247 246 242 / .82);
  --shadow: 0 1px 2px rgb(20 32 29 / .05), 0 10px 30px -14px rgb(20 32 29 / .2);
  --lift: 0 2px 4px rgb(20 32 29 / .08), 0 18px 40px -16px rgb(20 32 29 / .35);
  --round: 1.15rem; --round-s: .8rem;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Sinhala Sangam MN', 'Noto Sans Sinhala', 'Nirmala UI', sans-serif;
  --bottom: calc(4.6rem + env(safe-area-inset-bottom));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0c1211; --sheet: #161e1c; --well: #202a28; --ink: #ecf2ef; --soft: #a0b0aa; --line: #27322f; --edge: #66746f;
    --accent: #70d4bf; --accent-strong: #8fe3d0; --on-accent: #04231d; --accent-soft: #17382f;
    --gold: #f5c469; --gold-soft: #3a2d10; --red: #f5a394; --red-soft: #45201b; --focus: #f5c469;
    --glass: rgb(12 18 17 / .8);
    --shadow: 0 0 0 1px rgb(255 255 255 / .045), 0 10px 30px -14px rgb(0 0 0 / .7);
    --lift: 0 0 0 1px rgb(255 255 255 / .08), 0 18px 40px -16px rgb(0 0 0 / .9);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding: 5rem 0 10rem; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 1rem/1.5 var(--sans); -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
main { max-width: 62rem; margin: 0 auto; padding: .75rem 1.1rem calc(var(--bottom) + 1.75rem); }
main:focus, main:focus-visible { outline: none; }
h1, h2, h3 { font-weight: 700; line-height: 1.2; letter-spacing: -.018em; margin: 0; text-wrap: balance; overflow-wrap: anywhere; }
h1 { font-size: 1.85rem; letter-spacing: -.028em; margin-bottom: .8rem; }
h2 { font-size: 1.22rem; }
h3 { font-size: 1.05rem; font-weight: 650; }
section { margin-top: 2rem; }
p { margin: .4rem 0; }
/* Sinhala letters join; spacing them apart breaks them. */
[lang=si] { line-height: 1.55; letter-spacing: 0; }
a { color: var(--accent); }
h3 a, .gallery a, .menu a, .brand, .who { color: inherit; text-decoration: none; }
h3 a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--soft); }
.lead { font-size: 1.08rem; color: var(--soft); }
.fine { font-size: .85rem; }
.hint { margin: .6rem 0 0 .4rem; font-size: .9rem; }
.due { color: var(--red); font-weight: 600; }
.note { white-space: pre-line; overflow-wrap: anywhere; }
.place { display: flex; gap: .35rem; overflow-wrap: anywhere; min-width: 0; }
.place > span { min-width: 0; }
.place .icon { width: 1rem; height: 1rem; margin-top: .25em; color: var(--soft); }
.grow { flex: 1; min-width: 0; }
.empty { padding: 2rem 1.25rem; border-radius: var(--round); background: var(--well); color: var(--soft); text-align: center; }
.icon { flex: none; width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Controls */
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.9rem; padding: .5rem 1.1rem; border: 0; border-radius: 3rem; background: var(--well); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; text-align: center; transition: background-color .15s, box-shadow .15s, transform .1s; }
button:hover, .button:hover { background: var(--line); }
button:active, .button:active { transform: scale(.97); }
button:disabled { opacity: .55; cursor: default; }
.button:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.primary { background: var(--accent); color: var(--on-accent); }
.primary:hover { background: var(--accent-strong); }
.danger { color: var(--red); }
.danger:hover { background: var(--red-soft); }
.plain { background: none; color: var(--accent); padding-inline: .5rem; }
.plain:hover { background: var(--accent-soft); }
.small { min-height: 2.5rem; padding: .3rem .9rem; font-size: .92rem; }
.button.large { min-height: 3.4rem; padding-inline: 1.75rem; font-size: 1.05rem; }
.wide { width: 100%; margin-top: .75rem; min-height: 3.2rem; }
input, select, textarea { width: 100%; min-height: 3rem; padding: .6rem .95rem; border: 1px solid var(--edge); border-radius: var(--round-s); background: var(--sheet); color: var(--ink); font: inherit; transition: background-color .15s, border-color .15s; }
@media (prefers-contrast: more) { button, .button, .panel, .result, .copy { border: 1.5px solid var(--soft); } }
input:hover, select:hover, textarea:hover { border-color: var(--soft); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
::file-selector-button { margin-right: .8rem; padding: .35rem .9rem; border: 0; border-radius: 2rem; background: var(--well); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
select { appearance: none; padding-right: 2.4rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d8a85' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6l6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8rem center; background-size: 1.1rem; text-overflow: ellipsis; }
::placeholder { color: var(--soft); opacity: 1; }
input[type=checkbox], input[type=radio] { width: 1.35rem; height: 1.35rem; min-height: 0; accent-color: var(--accent); flex: none; }
input[type=file].visually-hidden { min-height: 0; padding: 0; }
.field { display: block; margin: .9rem 0; }
.field > span { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 .3rem .2rem; }
.field small { display: block; margin: .3rem 0 0 .2rem; }
.check { display: flex; gap: .7rem; align-items: center; min-height: 2.9rem; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .7rem; align-items: center; }
.pair { display: flex; gap: .5rem; align-items: end; flex-wrap: wrap; }
.pair .field { flex: 1 1 7rem; margin-bottom: 0; min-width: 0; }
.inline { display: flex; gap: .6rem; align-items: center; margin-top: .7rem; color: var(--soft); font-size: .95rem; }
.inline select { width: auto; flex: 0 1 auto; min-width: 0; min-height: 2.5rem; padding-block: .3rem; color: var(--ink); }
.setting + .setting { margin-top: .6rem; }
.panel h2:not(:first-child) { margin-top: 1.4rem; }
.panel > .primary:last-child, .panel > a.button:last-child { margin-top: .8rem; }
.setting { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; justify-content: space-between; }
.setting select { width: auto; }
@media (max-width: 40rem) { #add .pair .field { flex-basis: 100%; } #add .pair button { flex: 1; } #add .pair [data-act=read-printed] { flex-basis: 100%; } }
.panel { background: var(--sheet); border-radius: var(--round); box-shadow: var(--shadow); padding: 1.15rem; margin: 1rem 0; }
.panel.warn { box-shadow: var(--shadow), inset 0 0 0 2px var(--marigold); }
.panel.chosen { background: var(--accent-soft); box-shadow: none; display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
details summary { cursor: pointer; padding: .75rem .2rem; font-weight: 600; color: var(--accent); }
.section-head { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; justify-content: space-between; margin-bottom: .9rem; }
.section-head h1 { margin: 0; }
.savebar { position: sticky; z-index: 3; bottom: var(--bottom); margin: 1rem -1.1rem 0; padding: .6rem 1.1rem .75rem; background: linear-gradient(transparent, var(--ground) 35%); }
.savebar .wide { margin: 0; box-shadow: var(--lift); }

/* Frame */
.mark { width: 2rem; height: 2rem; display: block; }
.mark.big { width: 5.5rem; height: 5.5rem; filter: drop-shadow(0 18px 24px rgb(10 74 67 / .3)); }
.avatar { display: grid; place-items: center; flex: none; width: 2rem; height: 2rem; border-radius: 50%; color: #fff; font-weight: 700; font-size: .95rem; }
#bar { position: sticky; top: 0; z-index: 6; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: calc(.6rem + env(safe-area-inset-top)) 1.1rem .6rem; background: var(--glass); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); }
.brand { display: flex; gap: .6rem; align-items: center; font-weight: 750; font-size: 1.2rem; letter-spacing: -.03em; white-space: nowrap; }
.who { display: flex; gap: .55rem; align-items: center; min-width: 0; min-height: 2.75rem; padding: .25rem .9rem .25rem .3rem; border-radius: 3rem; font-weight: 600; transition: background-color .15s; }
.who:hover { background: var(--well); }
.who-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { background: var(--red); color: var(--sheet); border-radius: 1rem; padding: 0 .5rem; font-size: .8rem; font-weight: 700; }
#nav { position: fixed; inset: auto 0 0; z-index: 5; display: flex; padding: .35rem .4rem calc(.35rem + env(safe-area-inset-bottom)); background: var(--glass); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); border-top: 1px solid var(--line); }
#nav a { flex: 1; display: grid; justify-items: center; align-content: center; gap: .2rem; min-height: 3.75rem; border-radius: 1rem; text-decoration: none; color: var(--soft); font-size: .76rem; font-weight: 600; white-space: nowrap; }
#nav .icon { width: 1.5rem; height: 1.5rem; }
#nav a[aria-current] { color: var(--accent); }
#nav a[aria-current] .icon { stroke-width: 2.3; }
#nav .to-add .icon { width: 2.1rem; height: 2.1rem; padding: .35rem; margin: -.3rem 0; border-radius: .75rem; background: var(--accent); color: var(--on-accent); stroke-width: 2.6; }
#toast { position: fixed; left: 50%; top: calc(4.2rem + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 20; max-width: min(32rem, calc(100vw - 2rem)); width: max-content; padding: .8rem 1.25rem; border-radius: 1.5rem; background: var(--ink); color: var(--ground); font-weight: 550; box-shadow: var(--lift); visibility: hidden; }
#toast.show { visibility: visible; }
#toast.error { background: var(--red); color: var(--sheet); }

/* Wide screens: a side rail */
@media (min-width: 60rem) {
  :root { --bottom: 0rem; }
  main { padding: 2.25rem 2.5rem 4rem; }
  body:has(#nav:not([hidden])) { padding-left: 15rem; }
  #bar { position: fixed; inset: 0 auto 0 0; width: 15rem; flex-direction: column; align-items: stretch; padding: 1.75rem 1.1rem 1.25rem; background: var(--sheet); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: var(--shadow); }
  .brand { padding-left: .5rem; font-size: 1.35rem; }
  .brand .mark { width: 2.35rem; height: 2.35rem; }
  #nav { inset: 6rem auto auto 0; width: 15rem; flex-direction: column; gap: .25rem; padding: 0 1.1rem; background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; z-index: 7; }
  #nav a, #nav .to-add { flex: none; display: flex; justify-content: flex-start; align-items: center; gap: .85rem; min-height: 3rem; padding: 0 .9rem; font-size: 1rem; }
  #nav a:hover { background: var(--well); }
  #nav a[aria-current] { background: var(--accent-soft); color: var(--accent); }
  #nav .to-add .icon { width: 1.5rem; height: 1.5rem; padding: .2rem; margin: 0; border-radius: .5rem; }
  .savebar { position: static; margin-inline: 0; padding-inline: 0; background: none; }
  #toast { top: 1.5rem; }
}

/* Dialogs: a sheet from the bottom on phones */
dialog { width: min(35rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; padding: 1.25rem; border: 0; border-radius: 1.5rem; background: var(--sheet); color: var(--ink); box-shadow: var(--lift); }
dialog::backdrop { background: rgb(8 16 14 / .5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .5rem; }
.dialog-head button { width: 2.5rem; min-height: 2.5rem; padding: 0; background: var(--well); color: var(--soft); }
@media (max-width: 40rem) {
  dialog { width: 100%; max-width: 100%; max-height: calc(100dvh - 1.5rem - env(safe-area-inset-top)); margin: auto 0 0; border-radius: 1.5rem 1.5rem 0 0; padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: sheet .25s cubic-bezier(.2, .8, .2, 1); }
  dialog[open]::backdrop { animation: fade .25s; }
  #toast.show { animation: drop .25s cubic-bezier(.2, .8, .2, 1); }
  .arriving > * { animation: arrive .28s cubic-bezier(.2, .8, .2, 1) backwards; }
  .gallery .cover, .suggestion .cover { transition: transform .2s, box-shadow .2s; }
  .gallery a:hover .cover, .suggestion:hover .cover { transform: translateY(-4px); box-shadow: var(--lift); }
}
@keyframes sheet { from { transform: translateY(1.5rem); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes drop { from { transform: translate(-50%, -.75rem); opacity: 0; } }
@keyframes arrive { from { opacity: 0; translate: 0 .5rem; } }

.scanner { position: relative; overflow: hidden; border-radius: var(--round); }
.scanner video { display: block; width: 100%; max-height: 60dvh; background: #000; object-fit: cover; }
.scanner .target { position: absolute; inset: 0; margin: auto; width: 70%; height: 38%; border: 3px solid #fff; border-radius: 1rem; box-shadow: 0 0 0 100vmax rgb(0 0 0 / .35); pointer-events: none; }
.printed { margin: .5rem 0; }
.printed canvas { display: block; max-width: 100%; max-height: 42dvh; margin: 0 auto; border-radius: .5rem; }
.stack { display: grid; gap: .5rem; }
.opening { width: min(100%, 18rem); aspect-ratio: 3 / 4; max-height: 44dvh; margin: .75rem auto; border-radius: .5rem; background: var(--accent-soft); animation: opening 1s ease-in-out infinite alternate; }
@keyframes opening { from { opacity: 1; } to { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .opening { animation: none; } }
.crop { position: relative; width: fit-content; margin: .75rem auto; touch-action: none; }
.crop canvas { display: block; max-width: 100%; max-height: 44dvh; border-radius: .5rem; }
.crop svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.crop polygon { fill: rgb(245 165 36 / .12); stroke: #f5a524; stroke-width: 3; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.crop .corner { position: absolute; width: 2.75rem; height: 2.75rem; min-height: 0; padding: 0; transform: translate(-50%, -50%); border-radius: 50%; background: none; cursor: grab; touch-action: none; }
.crop .corner::after { content: ''; position: absolute; inset: .8rem; border: 3px solid #fff; border-radius: 50%; background: #0d6656; box-shadow: 0 0 0 1px rgb(0 0 0 / .5); }
.crop-result { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: .75rem 0; }
.crop-result canvas { max-width: 45%; max-height: 18dvh; border-radius: .5rem; }
.crop-result .row { flex-direction: column; align-items: stretch; }
.answers fieldset { border: 0; padding: 0; margin: .75rem 0 0; min-width: 0; }
.answers legend { font-weight: 600; padding: 0; }
.answers .check { align-items: start; }
.answers .check span { min-width: 0; overflow-wrap: anywhere; }
.full-photo { max-width: 100%; max-height: 75dvh; display: block; margin: .5rem auto; border-radius: var(--round-s); }

/* Covers. Books awaiting a photo get a plain jacket with the title set on it. */
.cover { display: block; flex: none; align-self: flex-start; width: 4.75rem; aspect-ratio: 2 / 3; object-fit: cover; border-radius: .25rem .55rem .55rem .25rem; box-shadow: 0 1px 2px rgb(0 0 0 / .18), 0 8px 18px -8px rgb(0 0 0 / .4); }
.cover.large { width: 100%; }
.cloth { position: relative; overflow: hidden; padding: 13% 9% 8% 13%; color: #fff; font-size: .64rem; font-weight: 650; line-height: 1.28; overflow-wrap: anywhere; text-align: left; }
.cloth [lang=si] { line-height: 1.4; }
.cloth::before { content: ''; position: absolute; inset: 58% -30% -45%; border-radius: 50% 50% 0 0; background: rgb(255 255 255 / .1); }
.cloth::after { content: ''; position: absolute; inset: 0 auto 0 4.5%; width: 1px; background: rgb(255 255 255 / .28); box-shadow: -1px 0 rgb(0 0 0 / .12); }
.cloth span { position: relative; }
.cloth > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; overflow: hidden; }
.cloth.large { font-size: .84rem; }
@media (min-width: 48rem) { .cloth.large { font-size: .95rem; } }
.cloth-0, .tone-0 { background: #0f6b5c; } .cloth-1, .tone-1 { background: #a3402f; } .cloth-2, .tone-2 { background: #31549b; } .cloth-3, .tone-3 { background: #7a550e; }
.cloth-4, .tone-4 { background: #71459a; } .cloth-5, .tone-5 { background: #3a6629; } .cloth-6, .tone-6 { background: #9c4a2f; } .cloth-7, .tone-7 { background: #46586a; }

.searchbar { position: relative; display: flex; gap: .5rem; padding: .4rem; border-radius: 3rem; background: var(--sheet); box-shadow: var(--shadow); align-items: center; }
.searchbar > .icon { position: absolute; left: 1.2rem; color: var(--soft); pointer-events: none; }
.searchbar input { min-height: 3rem; border-color: transparent; border-radius: 3rem; background: none; padding: .5rem .25rem .5rem 2.75rem; min-width: 0; }
.searchbar input:focus { background: none; border-color: transparent; outline: none; }
.searchbar:focus-within { box-shadow: var(--shadow), 0 0 0 3px var(--focus); }
.searchbar:has(button:focus-visible) { box-shadow: var(--shadow); }
.searchbar:not(:has(.icon)) input { padding-left: 1.1rem; }
.result, .member { display: flex; gap: 1rem; background: var(--sheet); border-radius: var(--round); box-shadow: var(--shadow); padding: 1rem; margin: .8rem 0; }
.member { flex-wrap: wrap; align-items: center; }
.result p { margin: 0; }
.copies { list-style: none; margin: .5rem 0 0; padding: 0; }
.copies li { padding: .5rem 0; }
.copies li + li { border-top: 1px solid var(--line); }
.copies li:last-child { padding-bottom: 0; }
/* A shelf to slide along on phones */
.suggestions { display: flex; gap: 1.1rem; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding: 1.1rem; margin: 0 -1.1rem; padding: .5rem 1.1rem 1.25rem; scrollbar-width: none; }
.suggestions::-webkit-scrollbar { display: none; }
.suggestion { flex: none; width: 9.5rem; display: flex; flex-direction: column; gap: .75rem; scroll-snap-align: start; }
.suggestion .grow { display: flex; flex-direction: column; gap: .3rem; }
.suggestion .place { font-size: .88rem; color: var(--soft); margin: 0; }
.suggestion button { margin-top: auto; align-self: stretch; }
@media (min-width: 60rem) {
  .suggestions { margin: 0; padding: .5rem 0 1rem; gap: 1.75rem; }
  .suggestion { width: 12rem; }
}
.tag { display: inline-block; padding: .1rem .65rem; border-radius: 1rem; font-size: .84rem; font-weight: 650; }
.lent, .caution { background: var(--gold-soft); color: var(--gold); }
.missing { background: var(--red-soft); color: var(--red); }
.verdict { padding: .9rem 1.1rem; border-radius: var(--round-s); font-weight: 600; }
.verdict.have { background: var(--accent-soft); color: var(--accent); }
.verdict.maybe { background: var(--gold-soft); color: var(--gold); }
.verdict.none { background: var(--well); }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(6.4rem, 1fr)); gap: 0 .6rem; }
.filters .field { margin: .25rem 0; min-width: 0; }
.filters .field > span { font-size: .8rem; color: var(--soft); }
.filters select { padding-left: .8rem; padding-right: 1.9rem; background-position: right .55rem center; }
.gallery { list-style: none; margin: 1.1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(6.6rem, 1fr)); gap: 1.4rem 1rem; }
@media (min-width: 48rem) { .gallery { grid-template-columns: repeat(auto-fill, minmax(8.75rem, 1fr)); gap: 2rem 1.5rem; } }
.gallery a { position: relative; display: block; }
.gallery-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin-top: .55rem; font-size: .92rem; font-weight: 550; line-height: 1.35; overflow-wrap: anywhere; }
.gallery .tag { position: absolute; top: .5rem; left: .5rem; box-shadow: 0 2px 8px rgb(0 0 0 / .25); }
.gallery.selecting .cover { opacity: .55; }
.gallery .selected .cover { opacity: 1; outline: 4px solid var(--accent); outline-offset: 3px; }
.selection { position: sticky; z-index: 4; bottom: calc(var(--bottom) + .75rem); display: flex; gap: .6rem; align-items: center; padding: .7rem .8rem .7rem 1.25rem; margin-top: 1rem; background: var(--sheet); border-radius: 3rem; box-shadow: var(--lift); }
.selection span { flex: 1; font-weight: 600; }

.work-head { position: relative; display: flex; gap: 1.25rem; align-items: center; margin: -.75rem -1.1rem 0; padding: 1.75rem 1.1rem 1.5rem; overflow: hidden; isolation: isolate; }
.work-head .backdrop { position: absolute; z-index: -1; inset: -15%; width: 130%; height: 130%; object-fit: cover; filter: blur(38px) saturate(1.3); opacity: .3; -webkit-mask: linear-gradient(#000 30%, transparent 82%); mask: linear-gradient(#000 30%, transparent 82%); }
@media (min-width: 60rem) { .work-head .backdrop { inset: -15% 0; width: 100%; -webkit-mask: radial-gradient(closest-side, #000, transparent); mask: radial-gradient(closest-side, #000, transparent); opacity: .42; } }
.work-head .cover { width: 8.25rem; align-self: center; box-shadow: var(--lift); }
.work-head h1 { margin-bottom: .3rem; }
.work-head .small { margin-top: .6rem; background: color-mix(in srgb, var(--sheet) 75%, transparent); }
@media (min-width: 60rem) {
  .work-head { margin: -2.25rem -2.5rem 0; padding: 3rem 2.5rem 2rem; gap: 2.25rem; }
  .work-head .cover { width: 12rem; }
  .work-head h1 { font-size: 2.4rem; }
}
.reading fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.reading legend { padding: 0; margin-bottom: .7rem; color: var(--soft); }
.reading legend strong { color: var(--ink); }
.segments { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.25rem, 1fr)); gap: .3rem; padding: .3rem; border-radius: var(--round); background: var(--well); }
.segments label { position: relative; }
.segments input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.segments span { display: flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: .3rem .5rem; border-radius: calc(var(--round) - .3rem); text-align: center; font-size: .95rem; font-weight: 550; transition: background-color .15s, color .15s; }
.segments input:checked + span { background: var(--accent); color: var(--on-accent); font-weight: 650; }
.segments input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.copy { background: var(--sheet); border-radius: var(--round); box-shadow: var(--shadow); padding: 1.1rem; margin: .8rem 0; scroll-margin: 5rem; }
.copy.highlight { box-shadow: var(--shadow), 0 0 0 2px var(--accent); }
.copy-head { display: flex; gap: 1rem; }
.drafts-link { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.drafts-link h2 { margin: 0; }
.drafts-link p { margin: .3rem 0 0; }
.drafts { list-style: none; padding: 0; margin: .6rem 0 1.2rem; display: grid; gap: .6rem; }
.drafts a.draft { display: flex; gap: .9rem; align-items: flex-start; padding: .75rem; border-radius: var(--round-s); color: inherit; text-decoration: none; }
.drafts .draft-item { position: relative; background: var(--sheet); border-radius: var(--round-s); box-shadow: var(--shadow); }
.drafts .draft-add { position: absolute; top: .6rem; right: .6rem; z-index: 1; }
.drafts a.draft .grow { padding-right: 7.5rem; }
.drafts .photos { margin: -.25rem .75rem .75rem; }
.drafts .photos li { width: 5.5rem; }
.drafts .photos img { width: 100%; height: 5.5rem; aspect-ratio: auto; }
.drafts img, .drafts .none { flex: none; width: 3.6rem; aspect-ratio: 2 / 3; object-fit: cover; border-radius: .2rem .45rem .45rem .2rem; background: var(--accent-soft); }
#capture .primary.wide { margin-top: 1rem; }
.photos { list-style: none; display: flex; flex-wrap: wrap; gap: .85rem; padding: 0; margin: .9rem 0 0; }
.photos li { width: 8rem; display: grid; gap: .4rem; justify-items: start; }
.photos img { width: 100%; height: 8rem; object-fit: cover; border-radius: var(--round-s); display: block; }
.photos button.plain { flex-direction: column; gap: .3rem; padding: 0; width: 100%; border-radius: var(--round-s); }
.photos button.plain:hover { background: none; }
.photos:empty { display: none; }
.photos li.unsent img { opacity: .75; }
.photos li.unsent.failed img { opacity: .45; outline: 2px solid var(--red); outline-offset: -2px; }
.photos li.unsent.failed > .fine { color: var(--red); }
.photos li.unsent .row { gap: .4rem; }
.saving { animation: saving 1.2s ease-in-out infinite alternate; }
@keyframes saving { from { opacity: 1; } to { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .saving { animation: none; } }

.tabs { display: flex; gap: .45rem; overflow-x: auto; padding: .25rem 1.1rem; margin: 0 -1.1rem .75rem; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: .55rem 1.05rem; border-radius: 2rem; background: var(--well); font-weight: 600; text-decoration: none; color: var(--ink); }
.tabs a[aria-current] { background: var(--accent); color: var(--on-accent); }
.tabs a[aria-current] .muted { color: inherit; }
.profile { display: flex; gap: 1rem; align-items: center; }
.profile h1 { margin: 0; }
.profile p { margin: 0; overflow-wrap: anywhere; }
.profile .avatar { width: 4rem; height: 4rem; font-size: 1.7rem; }
.menu { list-style: none; padding: .35rem; margin: 1.5rem 0; border-radius: var(--round); background: var(--sheet); box-shadow: var(--shadow); }
.menu a, .menu button { display: flex; align-items: center; gap: .95rem; width: 100%; justify-content: flex-start; min-height: 3.4rem; padding: .5rem .9rem; border-radius: calc(var(--round) - .35rem); background: none; font-weight: 600; }
.menu a:hover, .menu button:hover { background: var(--well); }
.menu .icon { color: var(--accent); }
.plain-list, .notes { list-style: none; padding: 0; }
.found button { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; width: 100%; margin: .4rem 0; border-radius: var(--round-s); text-align: left; font-weight: 400; }
.hint { margin: .3rem 0 .9rem .2rem; }
.plain-list li { padding: .4rem 0; }
.notes li { padding: .9rem 1.1rem; background: var(--sheet); border-radius: var(--round-s); box-shadow: var(--shadow); margin-bottom: .6rem; }
.notes li.new { box-shadow: var(--shadow), inset 4px 0 var(--marigold); }
.tree { list-style: none; padding: 0; margin: 0; }
section > .tree:not(:empty) { padding: .5rem 1.1rem; background: var(--sheet); border-radius: var(--round); box-shadow: var(--shadow); }
.tree .tree { margin-left: .4rem; padding-left: .9rem; border-left: 2px solid var(--line); }
.place-row { display: flex; gap: .5rem; align-items: center; padding: .4rem 0; }
.welcome { min-height: 88dvh; display: grid; justify-items: center; align-content: center; text-align: center; max-width: 26rem; margin: 0 auto; }
.welcome h1 { font-size: 2.9rem; margin: 1.4rem 0 0; letter-spacing: -.045em; }
.welcome .si { margin: 0; font-size: 1.35rem; color: var(--accent); }
.welcome .lead { margin: .8rem 0 1.4rem; }
.welcome .panel { width: 100%; }
.welcome .panel p { margin: .5rem 0; }
.welcome .panel button { width: 100%; overflow-wrap: anywhere; }
.welcome .menu { width: 100%; box-sizing: border-box; text-align: left; overflow-wrap: anywhere; }
.menu a[aria-current] { background: var(--accent-soft); }
.consent { max-width: 34rem; margin: 2rem auto; }
.consent li { margin: .4rem 0; }
form[inert] { opacity: .55; }
