:root {
  --bg: #121110;
  --surface: #1b1917;
  --surface-2: #232019;
  --line: #2f2a25;
  --line-strong: #3d362f;
  --text: #ece6de;
  --muted: #a39a90;
  --faint: #6f675f;
  --amber: #e8a13a;
  --amber-bright: #f5b94f;
  --amber-rgb: 232, 161, 58;
  --amber-wash: rgba(var(--amber-rgb), 0.1);
  --amber-line: rgba(var(--amber-rgb), 0.3);
  --surface-3: #2c2823;
  --amber-dim: #a9742a;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  --danger: #e0645a;
  --radius: 14px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: radial-gradient(1100px 520px at 50% -8%, #22160a 0%, rgba(18, 17, 16, 0) 70%), var(--bg);
  background-attachment: fixed;
  color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--amber); color: #1a1208; padding: 8px 12px; z-index: 50; }
.skip-link:focus { left: 8px; top: 8px; }

/* ---- ambiance layer (flame, glow, embers), behind every page ---- */
#ambiance { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; transition: opacity 0.8s ease; }
#ambiance.off { opacity: 0; visibility: hidden; transition: opacity 0.5s ease, visibility 0s 0.5s; }
.amb-glow {
  position: absolute; left: 50%; bottom: -22vh; width: 130vw; height: var(--glow-h, 90vh); transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(var(--glow-rgb, 232,150,40), calc(0.20 * var(--glow-k, 1))), rgba(var(--glow-rgb, 232,150,40), calc(0.07 * var(--glow-k, 1))) 55%, rgba(0, 0, 0, 0) 100%);
  animation: glowBreath var(--glow-breathe, 6s) ease-in-out infinite alternate;
}
@keyframes glowBreath { from { opacity: 0.75; } to { opacity: 1; } }
.amb-embers { position: absolute; inset: 0; width: 100%; height: 100%; transition: filter 0.6s; }
.amb-fire {
  position: absolute; left: 50%; transform: translateX(-50%) scale(var(--fire-s, 1)); transform-origin: 50% 100%;
  filter: brightness(var(--fire-b, 1)); transition: filter 0.6s, transform 0.6s, opacity 0.6s;
}
.amb-fire img, .amb-fire video { width: 100%; display: block; }
#ambiance.stoked .amb-embers { filter: brightness(1.5); }
#ambiance.stoked .amb-fire { filter: brightness(calc(var(--fire-b, 1) * 1.35)) saturate(1.2); }

/* ---- shell ---- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px;
  padding: max(10px, env(safe-area-inset-top)) 18px 10px;
  background: linear-gradient(var(--bg) 55%, rgba(18, 17, 16, 0));
}
.brand { display: inline-flex; align-items: center; }
.brand img { display: block; height: 32px; width: auto; }
.tabs { display: flex; gap: 4px; margin-left: auto; }
.tabs a { padding: 6px 12px; border-radius: 999px; color: var(--muted); font-size: 15px; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--amber-bright); background: var(--amber-wash); }
.icon-btn { background: none; border: 0; padding: 8px; border-radius: 999px; color: var(--faint); display: grid; place-items: center; }
.icon-btn.on { color: var(--amber); }
.icon-btn:hover { color: var(--text); }
main { position: relative; z-index: 5; max-width: 760px; margin: 0 auto; padding: 8px 20px 140px; }
main:focus { outline: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.25; margin: 0; }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* ---- buttons / chips ---- */
.btn {
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text);
  padding: 9px 16px; border-radius: 999px; font-size: 15px; display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { border-color: var(--amber-line); }
.btn.primary { background: var(--amber); color: #1a1208; border-color: var(--amber); font-weight: 600; }
.btn.primary:hover { background: var(--amber-bright); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); padding: 4px 12px; border-radius: 999px; font-size: 13px; }
.chip:hover { color: var(--text); }
.chip.active { color: var(--amber-bright); border-color: var(--amber-line); background: var(--amber-wash); }

/* ---- home ---- */
.home {
  min-height: calc(100dvh - 200px); display: grid; grid-template-rows: 0.8fr auto 1.2fr; justify-items: center; padding: 0 4px;
}
.stage { min-width: 0; grid-row: 2; text-align: center; max-width: 640px; width: 100%; }
.stage .eyebrow.is-original { color: var(--amber); }
.stage .eyebrow { color: var(--muted); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; min-height: 18px; margin-bottom: 14px; }
.stage .tap { cursor: pointer; border-radius: var(--radius); padding: 4px 8px; margin: 0 -8px; }
.stage .tap:focus-visible { outline: 2px solid var(--amber-line); outline-offset: 6px; }
.stage blockquote.modern { margin: 0; font-family: var(--serif); font-size: calc(clamp(25px, 5.2vw, 36px) * var(--ts, 1)); line-height: 1.36; color: #f4eee5; text-wrap: balance; transition: color 0.2s; }
.stage .tap:hover blockquote.modern { color: #fff; }
.stage .tap:hover blockquote.modern.is-original { color: #ffc766; }
.stage blockquote.modern.is-original { font-style: italic; color: var(--amber-bright); }
.stage blockquote.modern .q { color: var(--amber); }
.stage .attrib { margin: 16px auto 0; width: max-content; max-width: 100%; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 8px; color: var(--muted); font-size: 15px; transition: color .2s; }
.stage .attrib .sep { color: var(--line-strong); }
.stage .attrib svg { opacity: .85; transition: transform .2s; }
.stage .attrib:hover, .stage .attrib:focus-visible { color: var(--amber); }
.stage .attrib:hover svg { transform: translateY(-2px); }
.stage .chips { margin-top: 26px; justify-content: center; gap: 6px; }
.stage .chip { font-size: 12px; padding: 3px 10px; border-color: var(--line); color: var(--faint); }
.stage .chip:hover { color: var(--text); border-color: var(--line-strong); }
.stage .chip.active { color: var(--amber-bright); border-color: var(--amber-line); }
.stage .reflect-btn { margin-top: 22px; padding: 10px 26px; }
@media (max-width: 600px) {
  .stage .chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; padding: 2px 16px 4px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent 100%); }
  .stage .chips::-webkit-scrollbar { display: none; }
  .stage .chip { flex: none; }
}
.sr-next { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr-next:focus { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); width: auto; height: auto; clip: auto; z-index: 40; background: var(--surface-2); border: 1px solid var(--amber-line); border-radius: 999px; padding: 8px 16px; }
.card-in { animation: cardIn 0.6s ease both; }
.card-in.from-right { animation: slideFromRight 0.4s ease both; }
.card-in.from-left { animation: slideFromLeft 0.4s ease both; }
@keyframes slideFromRight { from { opacity: 0; transform: translateX(36px); } to { opacity: 1; transform: none; } }
@keyframes slideFromLeft { from { opacity: 0; transform: translateX(-36px); } to { opacity: 1; transform: none; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- library ---- */
.page-head { margin: 18px 0 22px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.author { margin: 0 0 30px; }
.author h2 { color: var(--amber-bright); }
.author .bio { color: var(--muted); margin: 4px 0 12px; font-size: 15px; }
.worklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.worklist a {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: rgba(27, 25, 23, 0.82); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px;
}
.worklist a:hover { border-color: var(--amber-line); }
.worklist .count { color: var(--faint); font-size: 13px; white-space: nowrap; }

/* ---- reader ---- */
.reader-tools { position: sticky; top: 48px; z-index: 10; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; background: rgba(18, 17, 16, 0.92); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 14px 0 18px; backdrop-filter: blur(6px); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; color: var(--muted); font-size: 15px; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 40px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background 0.2s; }
.switch .track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); transition: transform 0.2s; }
.switch input:checked + .track { background: var(--amber); }
.switch input:checked + .track::after { transform: translateX(18px); background: #1a1208; }
.switch input:focus-visible + .track { outline: 2px solid var(--amber); outline-offset: 2px; }
.section-head { margin: 34px 0 10px; color: var(--amber-bright); font-size: 20px; }
.passage { margin: 0 0 22px; padding: 16px 18px; background: rgba(27, 25, 23, 0.82); border: 1px solid var(--line); border-radius: var(--radius); scroll-margin-top: 130px; }
.passage.flash { animation: flash 2.4s ease; }
@keyframes flash { 0%, 40% { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-wash); } 100% { border-color: var(--line); box-shadow: none; } }
.passage .ref { color: var(--faint); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }
.passage p { margin: 0 0 12px; font-family: var(--serif); font-size: calc(18px * var(--ts, 1)); line-height: 1.65; }
.passage p:last-of-type { margin-bottom: 4px; }
mark.ex { background: var(--amber-wash); color: inherit; border-bottom: 1px solid var(--amber-line); border-radius: 3px; padding: 1px 2px; cursor: pointer; }
mark.ex.is-modern { font-family: var(--font); font-size: 0.94em; color: var(--amber-bright); background: rgba(var(--amber-rgb), 0.16); }
.passage .reflect { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.passage .reflect a { color: var(--amber); }
.note { color: var(--muted); font-size: 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 18px; background: rgba(18, 17, 16, 0.6); }

/* ---- journal ---- */
.entries { display: grid; gap: 10px; margin-top: 16px; }
.entry { display: block; background: rgba(27, 25, 23, 0.82); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.entry:hover { border-color: var(--amber-line); }
.entry .when { color: var(--faint); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.entry .about { color: var(--amber); font-family: var(--serif); font-style: italic; margin: 4px 0 4px; font-size: 15px; }
.entry .body { color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.spread { justify-content: space-between; }
.prompt-box { background: rgba(27, 25, 23, 0.82); border: 1px solid var(--amber-line); border-radius: var(--radius); padding: 14px 16px; margin: 14px 0; }
.prompt-box .q { font-family: var(--serif); color: var(--amber-bright); font-size: 20px; line-height: 1.4; margin: 0 0 8px; }
.prompt-box .ask { margin: 0; color: var(--muted); }
textarea.journal {
  width: 100%; min-height: 260px; resize: vertical; background: rgba(18, 17, 16, 0.9); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 14px 16px; font-family: var(--serif); font-size: 18px; line-height: 1.65;
}
textarea.journal:focus { border-color: var(--amber-line); outline: none; }
.status { color: var(--faint); font-size: 13px; min-height: 20px; }
footer.fine { margin-top: 32px; color: var(--faint); font-size: 13px; }
.prose { max-width: 620px; }
.prose h2 { margin: 26px 0 8px; font-size: 20px; color: var(--amber-bright); }
.prose p, .prose li { color: #d6cdc2; }
.prose a { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--surface-2); border: 1px solid var(--amber-line); padding: 8px 16px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
#toast.show { opacity: 1; }

@media (max-width: 520px) {
  .topbar { gap: 8px; padding-left: 12px; padding-right: 8px; }
  .brand img { height: 26px; }
  .tabs a { padding: 6px 9px; font-size: 14px; }
  main { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .doc-side { transition: none; }
  .card-in, .card-in.from-right, .card-in.from-left, .passage.flash, .amb-glow { animation: none; }
}
/* ---- sync panel ---- */
.sync-panel { margin-top: 28px; padding: 16px 18px; background: rgba(27, 25, 23, 0.82); border: 1px solid var(--line); border-radius: var(--radius); }
.sync-panel h2 { font-size: 18px; margin-bottom: 6px; color: var(--amber-bright); }
.sync-panel p { margin: 0 0 12px; }
.code-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 17px; letter-spacing: 0.05em; background: rgba(18, 17, 16, 0.9); border: 1px solid var(--amber-line); border-radius: 10px; padding: 12px 14px; margin: 10px 0; overflow-wrap: anywhere; user-select: all; color: var(--amber-bright); }
.code-input { flex: 1 1 220px; min-width: 0; background: rgba(18, 17, 16, 0.9); border: 1px solid var(--line-strong); border-radius: 999px; padding: 9px 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.code-input:focus { border-color: var(--amber-line); outline: none; }
.sync-panel summary { cursor: pointer; }


/* ───── the journal page: one calm document (ported from CreativeFlame) ───── */
main:has(.doc-page) { max-width: none; padding-bottom: 40px; }
.doc-page { --doc-fs: calc(18px * var(--ts, 1)); --doc-w: 680px; --doc-ff: var(--serif); }
.doc-page[data-width="s"] { --doc-w: 580px; } .doc-page[data-width="l"] { --doc-w: 820px; }
.doc-page[data-font="sans"] { --doc-ff: var(--font); }
.doc-head { max-width: var(--doc-w); margin: 14px auto 6px; display: flex; align-items: center; gap: 10px; transition: opacity 0.35s ease; }
.doc-head .spacer { flex: 1; }
.doc-page.typing .doc-head { opacity: 0.12; }
.doc-page.typing .doc-head:hover, .doc-head:focus-within { opacity: 1; }
.doc-status { font-size: 12px; color: var(--faint); min-width: 50px; text-align: right; }
.doc-words { font-size: 12px; color: var(--faint); white-space: nowrap; }
.doc-side-btn { padding: 6px; }
.doc-col { max-width: var(--doc-w); margin: 8px auto 0; font-family: var(--doc-ff); }
.doc-date { color: var(--faint); font-family: var(--font); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 10px; }
.doc-col .prompt-box { margin: 0 0 22px; }
.doc-col .ed { display: block; }
.ed-area { outline: none; overflow-wrap: anywhere; position: relative; }
.ed-area.is-empty::before { content: attr(data-placeholder); color: var(--faint); position: absolute; pointer-events: none; }
.doc-col .ed-area.doc-area { padding: 0 0 38vh; min-height: 46vh; font-family: var(--doc-ff); font-size: var(--doc-fs); line-height: 1.65; caret-color: var(--amber-bright); }
.doc-area p { margin: 0 0 0.7em; min-height: 1.7em; }
.doc-area p:has(> br:only-child) { min-height: 1em; margin-bottom: 0.25em; }
.doc-area h1 { font-size: 1.4em; margin: 1.1em 0 0.35em; font-weight: 600; line-height: 1.25; }
.doc-area h2 { font-size: 1.15em; margin: 1em 0 0.3em; font-weight: 600; line-height: 1.25; }
.doc-area h3 { font-size: 1.03em; margin: 0.9em 0 0.3em; font-weight: 600; }
.doc-area blockquote { margin: 0.9em 0; padding: 2px 0 2px 18px; border-left: 3px solid var(--amber-dim); font-style: italic; color: #cfc6ba; }
.doc-area blockquote p { margin: 0 0 0.4em; }
.doc-area hr { margin: 1.6em 0; width: 100%; border: 0; border-top: 1px solid rgba(236, 228, 216, 0.34); }
.doc-area a { color: var(--amber-bright); text-decoration: underline; text-underline-offset: 3px; }
.doc-area ul, .doc-area ol { margin: 0.2em 0 1em; padding-left: 1.6em; }
.doc-area li { line-height: 1.42; margin: 0 0 0.6em; }
.doc-area li:last-child { margin-bottom: 0; }
.doc-area li > p { margin: 0; min-height: 0; }
.doc-area li > ul, .doc-area li > ol { margin: 0.5em 0 0; }
.doc-area ::selection { background: rgba(var(--amber-rgb), 0.32); }
li.task { list-style: none; position: relative; margin-left: -1.5em; padding-left: 1.7em; }
li.task::before { content: ''; position: absolute; left: 0; top: .28em; width: 1em; height: 1em; box-sizing: border-box; border: 1.6px solid var(--muted); border-radius: 50%; cursor: pointer; }
li.task[data-done]::before { background: var(--amber) no-repeat center / 70% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23161412' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E"); border-color: var(--amber); }
li.task[data-done] { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }

/* the formatting bar */
.ed-toolbar { display: flex; align-items: center; gap: 2px; padding: 4px 6px; position: relative; }
.ed-btn { display: inline-flex; align-items: center; gap: 4px; min-width: 30px; height: 28px; padding: 0 7px; justify-content: center; background: transparent; border: 0; border-radius: 7px; color: var(--muted); cursor: pointer; font: inherit; font-size: 14px; }
.ed-btn svg { width: 16px; height: 16px; }
.ed-btn:hover { background: var(--surface-3); color: var(--text); }
.ed-btn.on { background: var(--amber-wash); color: var(--amber-bright); }
.ed-btn .aa { font-size: 13px; letter-spacing: .02em; }
.ed-btn.hd .aa { font-weight: 700; }
.ed-sep { width: 1px; height: 18px; background: var(--line-strong); margin: 0 4px; flex: none; }
.ed-spacer { flex: 1; }
.ed-check { display: inline-block; width: 15px; height: 15px; border: 1.8px solid currentColor; border-radius: 50%; position: relative; }
.ed-check::after { content: ''; position: absolute; left: 3px; top: 0; width: 4px; height: 8px; border: solid currentColor; border-width: 0 1.8px 1.8px 0; transform: rotate(40deg); }
.ed-mi { display: inline-flex; align-items: center; gap: 9px; }
.ed-mi svg { width: 15px; height: 15px; color: var(--muted); }
.ed-alignicon { display: inline-flex; }
.ed-menu { position: absolute; z-index: 30; min-width: 170px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.5); display: flex; flex-direction: column; font-family: var(--font); }
.ed-menu-fixed { position: fixed; z-index: 70; overflow-y: auto; }
.ed-menu-item { text-align: left; background: transparent; border: 0; color: inherit; font: inherit; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.ed-menu-item:hover { background: var(--surface-3); }
.ed-menu-item.h1 { font-size: 1.35em; font-weight: 600; } .ed-menu-item.h2 { font-size: 1.15em; font-weight: 600; } .ed-menu-item.h3 { font-weight: 600; }
.ed-menu-item.bq { font-style: italic; border-left: 2px solid var(--amber); border-radius: 0 7px 7px 0; }

/* the bar floats like a pill on desktop and rides the keyboard on touch screens */
.doc-dock { position: fixed; z-index: 15; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); max-width: calc(100vw - 20px); }
.doc-dock .ed-toolbar { border: 1px solid var(--line-strong); border-radius: 16px; background: rgba(30, 27, 22, 0.94); backdrop-filter: blur(12px); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55); padding: 5px 8px; gap: 1px; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.doc-dock .ed-toolbar::-webkit-scrollbar { display: none; }
.doc-dock .ed-btn { height: 32px; min-width: 32px; flex: none; }
.doc-dock .ed-btn svg { width: 17px; height: 17px; }
.doc-dock .ed-sep { margin: 0 5px; }
.doc-dock .doc-done { display: none; }
.doc-dock-touch { position: fixed; left: 0; top: 0; bottom: auto; margin: 0; z-index: 40; display: flex; align-items: stretch; justify-content: center; gap: 6px; padding: 6px 8px; background: rgba(24, 22, 19, 0.97); border-top: 1px solid var(--line-strong); backdrop-filter: blur(12px); transition: opacity 0.15s; max-width: none; }
.doc-dock-touch .ed-toolbar { flex: 0 1 720px; min-width: 0; border: 0; background: transparent; box-shadow: none; padding: 0; border-radius: 0; }
.doc-dock-touch .doc-done { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 38px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); }
.doc-dock-touch .doc-done svg { width: 18px; height: 18px; }

/* the Format side panel: a column on wide screens, a sheet from the bottom on small ones */
.doc-side { position: fixed; z-index: 14; top: 56px; right: 0; bottom: 0; width: 340px; background: var(--surface); border-left: 1px solid var(--line); transform: translateX(105%); transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); display: flex; flex-direction: column; font-size: 14px; }
body.doc-side-open .doc-side { transform: none; }
.fp-tabs { display: flex; align-items: center; gap: 4px; padding: 10px 12px 6px; border-bottom: 1px solid var(--line); }
.fp-tab { padding: 6px 12px; border-radius: 9px; color: var(--amber-bright); background: var(--amber-wash); }
.fp-body { overflow-y: auto; flex: 1; padding: 6px 14px 20px; }
.fp-h { font-size: 11px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--faint); margin: 18px 0 8px; }
.fp-row { display: flex; gap: 6px; flex-wrap: wrap; }
.fp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.fp-btn { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font-size: 13px; cursor: pointer; }
.fp-btn svg { width: 16px; height: 16px; }
.fp-btn:hover { background: var(--surface-3); }
.fp-btn.on { color: var(--amber-bright); border-color: var(--amber-line); background: var(--amber-wash); }
.fp-row .fp-btn { flex: 1 1 auto; }
.fp-read { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.fp-label { font-size: 12.5px; color: var(--muted); }
.fp-seg { display: flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; }
.fp-seg-btn { flex: 1; padding: 8px 4px; background: var(--surface-2); border: 0; border-right: 1px solid var(--line-strong); color: var(--muted); font-size: 13px; cursor: pointer; }
.fp-seg-btn:last-child { border-right: 0; }
.fp-seg-btn.on { background: var(--amber-wash); color: var(--amber-bright); }
.fp-actions { display: flex; gap: 8px; padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.fp-actions .btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.fp-actions .btn svg { width: 16px; height: 16px; }
@media (min-width: 901px) {
  body.doc-side-open main { padding-right: 358px; }
  body.doc-side-open .doc-dock { left: calc(50% - 170px); }
}
@media (max-width: 900px) {
  .doc-side { top: auto; left: 0; right: 0; width: auto; height: min(64vh, 560px); border-left: 0; border-top: 1px solid var(--line-strong); border-radius: 18px 18px 0 0; transform: translateY(105%); box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.5); z-index: 45; }
  body.doc-side-open .doc-side { transform: none; }
  body.doc-side-open .doc-dock { display: none; }
}
html:has(.doc-page) { scroll-padding-bottom: 140px; }

/* link card and dialog */
.cf-linkcard { position: fixed; z-index: 100; max-width: min(340px, calc(100vw - 16px)); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; font-family: var(--font); }
.lc-url { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-row { display: flex; gap: 6px; }
.lc-btn { flex: 1; text-align: center; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font-size: 14px; cursor: pointer; text-decoration: none; }
.lc-btn:hover, .lc-btn:focus-visible { border-color: var(--amber-line); color: var(--amber-bright); outline: none; }
.lc-danger:hover, .lc-danger:focus-visible { color: var(--danger); border-color: var(--danger); }
.ed-modal-back { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.55); display: grid; place-items: center; padding: 16px; }
.ed-modal { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; padding: 18px 18px 16px; box-shadow: var(--shadow); font-family: var(--font); }
.ed-modal h2 { margin: 0 0 4px; font-size: 18px; }
.ed-modal p { margin: 0 0 10px; }
.field { width: 100%; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; }
.field:focus { outline: none; border-color: var(--amber-line); }
@media (max-width: 560px) { .doc-head .muted.small.back { font-size: 14px; } }

.doc-head .icon-btn, .fp-tabs .icon-btn { color: var(--muted); }
.doc-head .icon-btn:hover, .fp-tabs .icon-btn:hover, .doc-head .icon-btn.on { color: var(--amber-bright); }
.icon-btn svg { width: 20px; height: 20px; display: block; }

/* settings: the gear in the lower right opens one panel for sync and backups */
.corner-btn { position: fixed; right: 14px; bottom: 14px; z-index: 40; width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(20, 18, 16, 0.55); color: var(--muted); cursor: pointer; backdrop-filter: blur(6px); opacity: 0.7; transition: opacity 0.15s, color 0.15s, border-color 0.15s; }
.corner-btn:hover, .corner-btn:focus-visible, .corner-btn.on { opacity: 1; color: var(--amber-bright); border-color: var(--amber-line); }
.corner-btn svg { width: 17px; height: 17px; }
body.doc-mode .corner-btn { display: none; }
.set-back { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, 0.55); display: flex; align-items: flex-end; justify-content: flex-end; padding: 16px; }
.set-back[hidden] { display: none; }
.settings { width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: var(--shadow); padding: 16px 18px 18px; }
.set-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.set-head h2 { margin: 0; font-size: 20px; color: var(--amber-bright); font-family: var(--serif); }
.settings .sync-panel { margin: 10px 0 0; padding: 14px 0 6px; background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.set-block { padding: 14px 0 6px; border-top: 1px solid var(--line); }
.set-block h2 { font-size: 18px; margin: 0 0 6px; color: var(--amber-bright); }
.set-block p { margin: 0 0 12px; }
.set-about { margin: 8px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.set-about a { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 600px) { .set-back { padding: 0; align-items: flex-end; } .settings { width: 100%; border-radius: 18px 18px 0 0; max-height: 86dvh; } }

/* Journal entry: the prompting quote reads as a headline */
.doc-col .prompt-box { background: none; border: 0; border-bottom: 1px solid var(--amber-line); border-radius: 0; padding: 6px 0 20px; margin: 10px 0 22px; }
.doc-col .prompt-box .q { font-size: clamp(26px, 4.4vw, 36px); line-height: 1.22; letter-spacing: -0.01em; margin: 0 0 14px; }
.doc-col .prompt-box .ask { font-size: 16px; }

/* Journal index: quote is the title, excerpt is secondary */
.entry .about { font-style: normal; color: var(--amber-bright); font-size: clamp(19px, 3.2vw, 24px); line-height: 1.28; margin: 6px 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.entry .body { color: var(--muted); font-size: 15px; line-height: 1.5; -webkit-line-clamp: 2; }

/* Info / about popup */
.corner-left { right: auto; left: 14px; }
.info-back { align-items: center; justify-content: center; padding: 18px; }
.info-card { position: relative; width: min(480px, 100%); max-height: calc(100dvh - 36px); overflow-y: auto; background: linear-gradient(180deg, #2b1f19, #1d1714); border: 1px solid var(--amber-line); border-radius: 22px; box-shadow: var(--shadow); padding: 30px 30px 24px; color: var(--text); }
.info-x { position: absolute; top: 12px; right: 14px; font-size: 26px; line-height: 1; color: var(--muted); background: none; border: 0; cursor: pointer; width: 34px; height: 34px; }
.info-x:hover { color: var(--text); }
.info-word { font-family: var(--font); font-weight: 500; font-size: clamp(34px, 8vw, 44px); letter-spacing: -0.01em; margin: 0; line-height: 1.05; }
.info-ipa { margin: 4px 0 18px; font-size: 20px; color: var(--amber-bright); letter-spacing: 0.02em; }
.info-def { font-size: 19px; line-height: 1.45; margin: 0; }
.info-def em { font-style: normal; }
.info-rule { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.28); margin: 22px 0; }
.info-card p { margin: 0 0 12px; color: var(--muted); line-height: 1.55; font-size: 16px; }
.info-card .info-lede { color: var(--text); font-family: var(--serif); font-size: 21px; line-height: 1.3; margin-bottom: 10px; }
.info-points { list-style: none; margin: 16px 0 6px; padding: 0; display: grid; gap: 10px; }
.info-points li { color: var(--muted); font-size: 15.5px; line-height: 1.5; padding-left: 14px; border-left: 2px solid var(--amber-line); }
.info-points b { color: var(--amber-bright); font-weight: 600; }
.info-more { margin: 16px 0 0 !important; }
.info-more a { color: var(--amber); }
body.doc-mode .corner-left { display: none; }
@media (max-width: 600px) { .info-card { padding: 26px 22px 20px; } }
.info-card .info-def { color: var(--text); font-size: 19px; line-height: 1.45; margin: 0; }
.info-card .info-ipa { color: var(--amber-bright); font-size: 20px; margin: 4px 0 18px; line-height: 1.2; }

/* Fire and sound settings */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.set-row.set-col { flex-direction: column; align-items: stretch; gap: 8px; cursor: default; }
.set-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-label { color: var(--text); font-size: 15px; }
.set-hint { color: var(--faint); font-size: 12.5px; line-height: 1.4; }
.set-check { width: 42px; height: 24px; flex: none; appearance: none; -webkit-appearance: none; border-radius: 999px; background: var(--surface-3, #3a3632); position: relative; cursor: pointer; transition: background 0.15s; border: 1px solid var(--line-strong); }
.set-check::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #d8d2c8; transition: transform 0.15s; }
.set-check:checked { background: var(--amber); border-color: var(--amber); }
.set-check:checked::after { transform: translateX(18px); background: #1a1612; }
.set-check:disabled, .set-range:disabled { opacity: 0.4; cursor: default; }
.set-range { width: 100%; accent-color: var(--amber); }

/* Installed app (home-screen) on iPad/iPhone: the status bar blurs whatever sits under it, so start the header lower */
@media (display-mode: standalone) {
  .topbar { padding-top: calc(env(safe-area-inset-top, 0px) + 22px); }
  .reader-tools { top: calc(48px + 22px); }
  .doc-side { top: calc(56px + 22px); }
}
@media (display-mode: standalone) and (max-width: 900px) { .doc-side { top: auto; } }

/* Library intro and philosopher cards */
.lib-intro { margin: 6px 0 26px; }
.lib-intro h1 { margin: 0 0 6px; }
.lib-intro .lede { font-family: var(--serif); font-size: clamp(22px, 4vw, 28px); line-height: 1.25; color: var(--amber-bright); margin: 0 0 12px; }
.lib-text { color: var(--muted); line-height: 1.6; margin: 0 0 14px; }
.lib-how { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lib-how li { color: var(--muted); font-size: 15px; line-height: 1.5; padding-left: 14px; border-left: 2px solid var(--amber-line); }
.lib-how b { color: var(--text); font-weight: 600; }
.lib-sub { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); font-family: var(--font); font-weight: 500; margin: 0 0 12px; }
.author-card { background: rgba(27, 25, 23, 0.82); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 12px; }
.author-card[open] { border-color: var(--amber-line); }
.author-card summary { list-style: none; cursor: pointer; display: grid; gap: 4px; padding: 16px 44px 16px 18px; position: relative; }
.author-card summary::-webkit-details-marker { display: none; }
.author-card summary::after { content: ''; position: absolute; right: 18px; top: 24px; width: 9px; height: 9px; border-right: 2px solid var(--amber); border-bottom: 2px solid var(--amber); transform: rotate(45deg); transition: transform 0.2s; }
.author-card[open] summary::after { transform: rotate(-135deg); top: 28px; }
.author-card summary:hover .ac-name { color: var(--amber-bright); }
.ac-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.ac-name { font-family: var(--serif); font-size: 24px; color: var(--text); }
.ac-dates { color: var(--faint); font-size: 13px; }
.ac-tag { color: var(--amber); font-family: var(--serif); font-style: italic; font-size: 16px; }
.ac-meta { color: var(--faint); font-size: 13px; }
.ac-body { padding: 0 18px 18px; border-top: 1px solid var(--line); }
.ac-body p { color: var(--muted); line-height: 1.6; margin: 14px 0 0; }
.ac-body h3 { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); font-family: var(--font); font-weight: 500; margin: 18px 0 6px; }
.ac-taught { margin: 0; padding-left: 18px; color: var(--text); line-height: 1.5; }
.ac-taught li { margin: 4px 0; }
.ac-body .worklist { margin-top: 10px; }

/* ---- journal title, tags, search ---- */
.doc-title { display: block; width: 100%; background: none; border: 0; outline: 0; padding: 0; margin: 2px 0 14px; color: #f4eee5; font-family: var(--serif); font-size: clamp(30px, 5.4vw, 46px); line-height: 1.15; letter-spacing: -0.01em; }
.doc-title::placeholder { color: var(--faint); opacity: 0.7; }
.tag-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 20px; }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 14px; color: var(--amber); background: rgba(255, 200, 0, 0.08); border: 1px solid var(--amber-line); border-radius: 999px; padding: 4px 6px 4px 12px; }
.tag-chip button { background: none; border: 0; color: inherit; font-size: 16px; line-height: 1; padding: 2px 6px; cursor: pointer; opacity: 0.7; }
.tag-chip button:hover { opacity: 1; }
.tag-input { flex: 1; min-width: 120px; background: none; border: 0; outline: 0; color: var(--muted); font-family: var(--serif); font-size: 16px; padding: 4px 2px; }
.tag-input::placeholder { color: var(--faint); }
.tag-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.tag-chip.filter { cursor: pointer; padding: 4px 12px; }
.tag-chip.filter .n { color: var(--faint); font-size: 12px; }
.tag-chip.filter.on { background: var(--amber); color: #1a1208; border-color: var(--amber); }
.tag-chip.filter.on .n { color: #1a1208; opacity: 0.7; }
.journal-search { display: block; width: 100%; box-sizing: border-box; margin-top: 16px; padding: 11px 14px; font: inherit; font-size: 16px; color: var(--text); background: rgba(27, 25, 23, 0.82); border: 1px solid var(--line); border-radius: var(--radius); outline: 0; }
.journal-search:focus { border-color: var(--amber-line); }
.entry .quote-line { color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 14px; margin: -2px 0 8px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.tag-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag-pill { font-size: 12px; color: var(--amber); border: 1px solid var(--amber-line); border-radius: 999px; padding: 2px 9px; }
.doc-page.typing .tag-row { opacity: 0.35; }

/* ---- library tiles and author page ---- */
.lib-grid { width: min(1040px, calc(100vw - 32px)); position: relative; left: 50%; transform: translateX(-50%); display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 0 0 8px; }
.tile { display: flex; flex-direction: column; background: rgba(27, 25, 23, 0.82); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color 0.2s, transform 0.2s; }
.tile:hover, .tile:focus-visible { border-color: var(--amber-line); transform: translateY(-2px); }
.tile-img { display: block; aspect-ratio: 1 / 1; overflow: hidden; background: #1b1917; position: relative; }
.tile-img img, .ah-img { display: block; width: 100%; height: 100%; object-fit: cover; filter: sepia(0.28) brightness(0.86) contrast(1.05) saturate(0.9); transition: filter 0.3s, transform 0.4s; }
.tile-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 55%, rgba(27, 25, 23, 0.85)); }
.tile:hover .tile-img img { filter: sepia(0.15) brightness(0.95) contrast(1.05) saturate(0.95); transform: scale(1.03); }
.tile-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 18px 18px; flex: 1; }
.tile-name { font-family: var(--serif); font-size: 26px; line-height: 1.15; color: var(--text); }
.tile-dates { color: var(--faint); font-size: 13px; }
.tile-tag { color: var(--amber); font-family: var(--serif); font-style: italic; font-size: 16px; line-height: 1.35; }
.tile-bio { color: var(--muted); font-size: 15px; line-height: 1.55; margin-top: 4px; }
.tile-meta { color: var(--faint); font-size: 13px; margin-top: auto; padding-top: 10px; }
.tile-link { color: var(--amber-bright); font-weight: 600; font-size: 15px; }
.tile:hover .tile-link { text-decoration: underline; }
@media (max-width: 899px) {
  .lib-grid { grid-template-columns: 1fr; width: 100%; left: 0; transform: none; }
  .tile { flex-direction: row; }
  .tile-img { aspect-ratio: auto; width: 38%; min-width: 150px; flex: none; }
  .tile-img::after { background: linear-gradient(to right, transparent 60%, rgba(27, 25, 23, 0.85)); }
}
@media (max-width: 519px) {
  .tile { flex-direction: column; }
  .tile-img { width: 100%; aspect-ratio: 1 / 1; max-height: 340px; }
  .tile-img img { object-position: center 20%; }
  .tile-img::after { background: linear-gradient(to bottom, transparent 55%, rgba(27, 25, 23, 0.85)); }
}
.author-hero { display: flex; align-items: center; gap: 22px; margin: 14px 0 6px; }
.author-hero h1 { margin: 0 0 2px; }
.author-hero p { margin: 2px 0; }
.ah-img { width: 148px; height: 148px; flex: none; border-radius: var(--radius); border: 1px solid var(--amber-line); }
.ac-body.flat { border-top: 0; padding: 0; }
@media (max-width: 519px) { .author-hero { flex-direction: column; align-items: flex-start; } .ah-img { width: 120px; height: 120px; } }

/* ---- text size (Settings and the format panel share one per-device setting) ---- */
:root { --ts: 1; }
:root[data-ts="s"] { --ts: 0.9; } :root[data-ts="l"] { --ts: 1.14; } :root[data-ts="xl"] { --ts: 1.3; }
.set-block.lead { border-top: 0; padding-top: 0; }
.set-row.first { border-top: 0; }
.size-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.size-btn { font-family: var(--serif); color: var(--muted); background: rgba(27, 25, 23, 0.82); border: 1px solid var(--line); border-radius: 12px; height: 54px; cursor: pointer; }
.size-btn:nth-child(1) { font-size: 15px; } .size-btn:nth-child(2) { font-size: 19px; } .size-btn:nth-child(3) { font-size: 23px; } .size-btn:nth-child(4) { font-size: 28px; }
.size-btn.on { color: var(--amber-bright); background: rgba(255, 200, 0, 0.1); border-color: var(--amber-line); }

/* ---- book navigator in the reader ---- */
.sec-nav { flex: 1 1 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; position: relative; padding-bottom: 10px; margin-bottom: 2px; border-bottom: 1px solid var(--line); }
.sec-side { background: none; border: 0; color: var(--faint); font: inherit; font-size: 15px; padding: 8px 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 40px; }
.sec-side.left { text-align: left; } .sec-side.right { text-align: right; }
.sec-side:hover { color: var(--amber-bright); }
.sec-cur { display: inline-flex; align-items: center; gap: 10px; font: inherit; font-family: var(--serif); font-size: 19px; color: var(--amber-bright); background: rgba(255, 200, 0, 0.1); border: 1px solid var(--amber-line); border-radius: 999px; padding: 8px 16px; min-height: 40px; cursor: pointer; white-space: nowrap; max-width: 62vw; }
.sec-cur .chev { width: 8px; height: 8px; border-right: 2px solid var(--amber); border-bottom: 2px solid var(--amber); transform: translateY(-2px) rotate(45deg); transition: transform 0.2s; flex: none; }
.sec-cur[aria-expanded="true"] .chev { transform: translateY(2px) rotate(-135deg); }
.sec-menu { position: absolute; z-index: 30; top: calc(100% - 2px); left: 50%; transform: translateX(-50%); width: min(360px, calc(100vw - 48px)); max-height: min(60vh, 440px); overflow-y: auto; background: #1b1917; border: 1px solid var(--amber-line); border-radius: var(--radius); padding: 6px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55); }
.sec-menu[hidden] { display: none; }
.sec-opt { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; text-align: left; font: inherit; font-size: 16px; color: var(--text); background: none; border: 0; border-radius: 8px; padding: 11px 12px; cursor: pointer; }
.sec-opt:hover, .sec-opt:focus-visible { background: rgba(255, 255, 255, 0.06); }
.sec-opt.on { color: var(--amber-bright); background: rgba(255, 200, 0, 0.1); }
.sec-opt .n { color: var(--faint); font-size: 12px; white-space: nowrap; }
.sec-foot { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0 24px; }
.sec-foot .btn { max-width: 48%; }
.work-body .section-head { margin-top: 6px; }
@media (max-width: 519px) { .sec-side { font-size: 13px; } .sec-cur { font-size: 17px; padding: 8px 14px; } }

/* ---- highlighted-line arrows, swipe animation ---- */
.hl-nav { flex: 1 1 220px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; text-align: right; }
.hl-btns { display: inline-flex; gap: 6px; flex: none; }
.hl-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; color: var(--amber); background: rgba(255, 200, 0, 0.08); border: 1px solid var(--amber-line); border-radius: 50%; cursor: pointer; }
.hl-btn:hover:not(:disabled) { background: rgba(255, 200, 0, 0.18); color: var(--amber-bright); }
.hl-btn:disabled { opacity: 0.35; cursor: default; }
mark.ex.ping { animation: mping 1.6s ease; }
@keyframes mping { 0%, 35% { box-shadow: 0 0 0 4px var(--amber-wash); outline: 2px solid var(--amber); } 100% { box-shadow: none; outline: 2px solid transparent; } }
.work-body.slide-r { animation: slide-r 0.28s ease; } .work-body.slide-l { animation: slide-l 0.28s ease; }
@keyframes slide-r { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes slide-l { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .work-body.slide-r, .work-body.slide-l { animation: none; } mark.ex.ping { animation: none; } }
