:root {
  --ink: #111;
  --muted: #5a5a5a;
  --line: #dedad0;
  --paper: #fffdf8;
  --soft: #f5f1e8;
  --glow: #fbf3e2;
  --bad: #9b1c1c;
  --good: #1d6b3a;
  color-scheme: light dark;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #ececea; --muted: #a8a8a4; --line: #383836; --paper: #1d1c1a; --soft: #131211; --glow: #2a241b; --bad: #f19999; --good: #8fd3a5; }
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink);
  background: radial-gradient(1200px 640px at 22% 8%, var(--glow), transparent 70%), var(--soft) fixed; background-repeat: no-repeat; }
main { max-width: 1040px; margin: 0 auto; padding: 8px 24px 56px; }

/* the top bar */
.topbar { max-width: 1040px; margin: 0 auto; padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: Georgia, "Rakuten Serif", serif; font-size: 21px; text-decoration: none; }
.brand img { display: block; }
.topbar nav { display: flex; align-items: center; gap: 22px; font-size: 15px; }
.topbar nav a:not(.button) { text-decoration: none; color: var(--muted); }
.topbar nav a:not(.button):hover { color: var(--ink); }
@media (max-width: 640px) { .topbar nav a:not(.button) { display: none; } }
h1 { font-family: Georgia, "Rakuten Serif", serif; font-weight: 400; font-size: 56px; line-height: 1.04; margin: 0 0 18px; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-family: Georgia, "Rakuten Serif", serif; font-weight: 400; font-size: 26px; margin: 0 0 14px; }
a { color: inherit; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; background: var(--soft); padding: 1px 5px; border-radius: 4px; }
.small { font-size: 14px; color: var(--muted); }
.lead { font-size: 19px; color: var(--muted); margin: 0 0 24px; max-width: 30em; }
[hidden] { display: none !important; }

/* buttons */
button, a.button { font: inherit; display: inline-block; padding: 10px 22px; border-radius: 999px; border: 1px solid var(--ink);
  background: var(--paper); color: var(--ink); cursor: pointer; text-decoration: none; line-height: 1.3;
  transition: transform .15s ease, box-shadow .15s ease; }
button:not(:disabled):not(.linkish):hover, a.button:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .35); }
button.primary, a.button.primary { background: var(--ink); color: var(--paper); }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.buttons { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 18px; }
.small-button { padding: 6px 14px; font-size: 14px; }
.linkish { border: none; background: none; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; border-radius: 0; }

/* the top: picture and words */
.hero { display: grid; grid-template-columns: minmax(220px, 380px) minmax(0, 1fr); gap: 72px; align-items: center; min-height: 560px; margin: 12px 0 64px; }
.lead { font-size: 20px; }
.hero .buttons { margin-top: 8px; }
.hero .buttons button, .hero .buttons a.button { padding: 12px 28px; font-size: 17px; }
/* a Kobo Clara around the screenshot (1072 × 1448) */
/* the mockups are pictures: nothing to select or drag */
.kobo, .kobo * { -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
.kobo { position: relative; container-type: inline-size; box-sizing: border-box; aspect-ratio: 112 / 160;
  border: 1px solid #4a4b4f; border-radius: 4.5% 4.5% 12.5% 12.5% / 3.15% 3.15% 8.75% 8.75%;
  background: linear-gradient(#37383b, #2a2b2e); box-shadow: inset 0 1px #ffffff14, 0 24px 40px -12px rgba(0, 0, 0, .35); }
.kobo-screen { position: absolute; left: 6%; top: 4.4%; width: 88%; height: auto; aspect-ratio: 1072 / 1448; display: block;
  border-radius: .6cqw; box-shadow: 0 0 0 .5cqw #1f2022; }
/* its place depends on nothing beside it, so it stays still from step to step */
.shot { position: relative; align-self: start; display: flex; align-items: center; width: 100%; min-height: 560px; container-type: inline-size; perspective: 1600px; }
.kobo { width: 100%; transform: rotateY(-9deg) rotateX(3deg); transform-origin: 60% 50%;
  box-shadow: inset 0 1px #ffffff14, 18px 34px 50px -18px rgba(40, 28, 10, .45), 4px 8px 14px -6px rgba(0, 0, 0, .3); }
.kobo-logo { position: absolute; left: 0; right: 0; bottom: 4.6%; text-align: center; font: 600 4.2cqw/1 system-ui, sans-serif;
  letter-spacing: .08em; color: #8b8c90; }
.pitch { max-width: 500px; }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 36px; min-height: 0; margin-top: 4px; }
  .shot { max-width: 250px; min-height: 0; margin: 0 auto; }
  .hero:not([data-panel="intro"]) .shot { max-width: 170px; }
  .stepper { font-size: 12px; }
  h1 { font-size: 40px; }
  .lead { font-size: 18px; }
}

/* the Kobo's own screens, drawn over the screenshot while connecting (sizes in Kobo pixels × .0821cqw) */
.kobo-ui { position: absolute; left: 6%; top: 4.4%; width: 88%; aspect-ratio: 1072 / 1448; border-radius: .6cqw; overflow: hidden;
  color: #000; font: 2.4cqw/1.35 system-ui, -apple-system, "Segoe UI", sans-serif; }
.kobo-code { flex-direction: column; background: #fff; }
.ku-head { position: relative; display: flex; align-items: center; justify-content: center; height: 9cqw; border-bottom: .12cqw solid #000; flex: none; }
.ku-back { position: absolute; left: 3.6cqw; font-size: 3.6cqw; }
.ku-title { font-family: Georgia, "Rakuten Serif", serif; font-size: 3.4cqw; }
.ku-page { flex: 1; padding: 5.2cqw 4.6cqw 0; display: flex; flex-direction: column; gap: 2.3cqw; }
.ku-intro { margin: 0; text-align: center; }
.ku-code { border: .25cqw solid #000; padding: 2.4cqw 0; text-align: center; font-weight: 700; font-size: 8cqw; letter-spacing: .04em; line-height: 1.1; }
.ku-steps { margin: 2cqw 0 0; padding-left: 4cqw; font-size: 2.3cqw; display: flex; flex-direction: column; gap: 1.5cqw; }
.ku-steps li::marker { font-weight: 700; }
.ku-foot { border-top: .12cqw solid #000; padding: 2.3cqw 3cqw; flex: none; display: flex; }
.ku-btn { flex: 1; text-align: center; border: .16cqw solid #000; padding: 1.4cqw 2cqw; font-size: 2.6cqw; background: #fff; }
.ku-primary { background: #000; color: #fff; }
.kobo-allow { align-items: center; justify-content: center; background: rgba(255, 255, 255, .55); }
.ku-dialog { width: 80%; background: #fff; border: .25cqw solid #000; padding: 4cqw 4cqw 3.4cqw; display: flex; flex-direction: column; gap: 1.4cqw; }
.ku-dtitle { font-family: Georgia, "Rakuten Serif", serif; font-weight: 400; font-size: 3.6cqw; line-height: 1.2; margin-bottom: 1cqw; }
.ku-dialog p { margin: 0; }
.ku-dbtns { display: flex; gap: 2cqw; margin-top: 2.4cqw; }
.kobo-done { align-items: flex-end; justify-content: center; padding-bottom: 16%; }
.ku-toast { width: 80%; background: #000; color: #fff; padding: 2.6cqw 3.4cqw; display: flex; flex-direction: column; gap: .6cqw; font-size: 2.8cqw; }
.ku-toast b { font-size: 3.2cqw; }

/* the steps above the connect form */
.stepper { list-style: none; display: flex; gap: 6px; margin: 0 0 26px; padding: 0; counter-reset: s; font-size: 13px; color: var(--muted); }
.stepper li { flex: 1; padding-top: 8px; border-top: 3px solid var(--line); counter-increment: s; }
.stepper li::before { content: counter(s) " "; font-weight: 700; margin-right: 2px; }
.stepper li.done { border-color: var(--muted); }
.stepper li.done::before { content: "✓ "; }
.stepper li.current { border-color: var(--ink); color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------------ connecting */

/* ---- the words: they start at the same height on every step, and everything is one width */
.hero:not([data-panel="intro"]) .pitch p { text-wrap: balance; }
.hero:not([data-panel="intro"]) .pitch { align-self: start; width: 100%; max-width: 440px; padding-top: 44px; }
.hero:not([data-panel="intro"]) h2 { font-size: 30px; line-height: 1.15; }
.hero:not([data-panel="intro"]) .buttons { margin-top: 24px; }

#stepper { gap: 8px; margin-bottom: 34px; }
#stepper li, #stepper li.done, #stepper li.current { position: relative; padding-top: 12px; border-top: 0; transition: color .3s; }
#stepper li::after, #stepper li i { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 3px; border-radius: 2px; background: var(--line); }
#stepper li i { z-index: 1; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .45s cubic-bezier(.4, 0, .2, 1); }
#stepper li:is(.done, .current) i { transform: none; }
#stepper li.done i { background: var(--muted); }

.code-boxes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto repeat(4, minmax(0, 1fr)); gap: 8px; margin: 22px 0 24px; }
.code-boxes input { width: 100%; height: 58px; }
.code-boxes .dash { padding: 0; }

/* ---- motion: short, once, and nothing is hidden until it has played */
.hero:not([data-panel="intro"]) .pitch > div:not([hidden]), .hero:not([data-panel="intro"]) .pitch > form:not([hidden]) { animation: step-in .32s cubic-bezier(.2, .7, .2, 1); }
.hero.back .pitch > div:not([hidden]), .hero.back .pitch > form:not([hidden]) { animation-name: step-back; }
@keyframes step-in { from { transform: translateX(22px); } }
@keyframes step-back { from { transform: translateX(-22px); } }
.code-boxes input.filled { animation: box-pop .18s ease; }
@keyframes box-pop { 50% { transform: scale(1.07); } }
.code-boxes.bad { animation: wrong .34s ease; }
@keyframes wrong { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.done-tick { width: 34px; height: 34px; vertical-align: -5px; margin-left: 6px; fill: none; stroke: var(--good); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; animation: draw .5s .15s ease both; }
@keyframes draw { from { stroke-dashoffset: 24; } }

/* ---- the pictured Kobo: screens fade over each other, like ink settling */
.kobo-ui, .kobo-press { display: flex; visibility: hidden; opacity: 0; transition: opacity .35s ease, visibility 0s .35s; }
.hero[data-panel="connect-form"]:not(.coded) .kobo-press,
.hero:is([data-panel="connect-form"].coded, [data-panel="connect-wait"]) .kobo-code,
.hero[data-panel="connect-wait"] .kobo-allow,
.hero[data-panel="connect-done"] .kobo-done { visibility: visible; opacity: 1; transition: opacity .35s ease; }
/* where the code comes from: all but the button to tap pales (its place in kobo-screen.png); after a moment, or the
   first letter typed, the code page follows (.coded) */
.kobo-press { position: absolute; left: 6%; top: 4.4%; width: 88%; aspect-ratio: 1072 / 1448; overflow: hidden; border-radius: .6cqw; }
.kobo-press i { position: absolute; left: 3.36%; top: 90.2%; width: 93.28%; height: 5.2%; box-shadow: 0 0 0 100cqw rgba(255, 255, 255, .78); outline: .5cqw solid #000; outline-offset: .9cqw; }
.hero[data-panel="connect-form"] .kobo-press i { animation: tap-here .5s .5s ease 2; }
@keyframes tap-here { 50% { outline-offset: 2cqw; } }
/* the code starts as a pale sample; the letters you type turn up on it in black */
.ku-code span { color: #b5b5b5; transition: color .2s; }
.ku-code span.typed { color: #000; }
/* the question, and the end: the question and the notice rise a little */
.ku-dialog, .ku-toast { transform: translateY(3cqw); transition: transform .4s cubic-bezier(.2, .8, .2, 1); }
.hero[data-panel="connect-wait"] .ku-dialog, .hero[data-panel="connect-done"] .ku-toast { transform: none; }
.hero[data-panel="connect-wait"] .ku-primary { outline: .4cqw solid #000; outline-offset: .6cqw; animation: allow-here .5s .7s ease 2; }
@keyframes allow-here { 50% { outline-offset: 1.6cqw; } }

@media (max-width: 760px) {
  .hero:not([data-panel="intro"]) .pitch { max-width: 480px; margin: 0 auto; padding-top: 0; }
  #stepper { margin-bottom: 24px; }
}
@media (max-width: 420px) { .code-boxes { gap: 5px; } .code-boxes input { height: 50px; } }
@media (prefers-reduced-motion: reduce) {
  .hero *, .hero *::after { animation: none !important; transition: none !important; }
}

/* forms */
ol.plain { padding-left: 22px; margin: 0 0 18px; }
ol.plain li { margin-bottom: 6px; }
.field { display: block; margin: 0 0 18px; font-size: 14px; color: var(--muted); }
.field input, .field select { display: block; width: 100%; margin-top: 6px; font: inherit; color: var(--ink);
  background: var(--paper); padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; }
.field input:focus, .field select:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent); }
.code-boxes { align-items: center; }
.code-boxes input { padding: 0; text-align: center; font: 600 26px/1 ui-monospace, Consolas, monospace;
  text-transform: uppercase; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px;
  transition: border-color .12s, box-shadow .12s; }
.code-boxes input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent); }
.code-boxes input.filled { border-color: color-mix(in srgb, var(--ink) 45%, var(--line)); }
.code-boxes.bad input { border-color: var(--bad); }
.code-boxes .dash { color: var(--muted); font-size: 22px; }
@media (max-width: 420px) { .code-boxes input { font-size: 21px; } }
.pills { display: inline-flex; gap: 4px; padding: 4px; margin-top: 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.pill { position: relative; }
.pill input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.pill span { display: block; padding: 6px 16px; border-radius: 999px; cursor: pointer; color: var(--muted); }
.pill input:checked + span { background: var(--ink); color: var(--paper); }
.pill input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.relay-note { margin: 8px 0 0; }
.error { background: var(--paper); border: 1px solid var(--bad); color: var(--bad); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.notice { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; font-size: 14px; }
.notice button { margin-top: 8px; }
.update-notice { border: 2px solid var(--ink); margin: 0 0 14px; }
.update-notice b { font-size: 15px; }
.update-notice p { margin: 4px 0 10px; color: var(--muted); }

.tick { color: var(--good); }

/* the sender */
.sender { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 26px 30px 28px; margin: 12px auto 56px; max-width: 700px; }
.sender button:not(:disabled):hover, .sender a.button:hover { transform: none; box-shadow: none; }
.side-send, .side-sent, .sent-list { min-width: 0; }
.sender-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.kobo-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.kobo-id > div { min-width: 0; }
.sender h1 { font-size: 28px; margin: 0; }
.sender-head .small { margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kobo-title { display: flex; align-items: center; gap: 4px; min-width: 0; }
.kobo-title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rename-btn { flex: none; width: 32px; height: 32px; color: var(--muted); }
.rename-btn:hover { color: var(--ink); }
.rename-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rename-form input { flex: 1 1 200px; min-width: 0; font: inherit; font-family: Georgia, "Rakuten Serif", serif; font-size: 24px; color: var(--ink); background: var(--paper);
  padding: 4px 12px; border: 1px solid var(--ink); border-radius: 10px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent); }
.rename-form input:focus { outline: none; }
.rename-form button { padding: 7px 16px; font-size: 14px; }
/* several Kobos: the name opens the list of them. With one, it's only a name. */
.kobo-title { position: relative; }
.sender .kobo-switch, .sender .kobo-switch:hover { display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 0; border: 0; border-radius: 6px; background: none; color: inherit;
  font: inherit; letter-spacing: inherit; text-align: left; }
.kobo-switch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kobo-switch svg { flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.kobo-switch:hover svg { stroke: var(--ink); }
.kobo-switch[aria-expanded=true] svg { transform: rotate(180deg); }
.kobo-switch:focus-visible { outline-offset: -2px; } /* the h1 clips what is outside it */
.kobo-switch:disabled { opacity: 1; cursor: text; }
.kobo-switch:disabled svg { display: none; }
.kobo-title:has(.kobo-switch:not(:disabled)) .rename-btn { display: none; } /* it's in the … menu too */
.kobo-list { left: 0; right: auto; }
.kobo-list button { display: flex; justify-content: space-between; gap: 24px; }
.kobo-list button[aria-checked=true] { font-weight: 600; }
.kobo-list button[aria-checked=true]::after { content: "✓"; }
.head-right { display: flex; align-items: center; gap: 8px; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap;
  background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--muted); }
.chip.ok { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.chip.warn { background: color-mix(in srgb, #b7791f 16%, transparent); color: #a0661a; }
.chip.bad { background: color-mix(in srgb, var(--bad) 13%, transparent); color: var(--bad); }
@media (prefers-color-scheme: dark) { .chip.warn { color: #e8b866; } }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 1px solid transparent; background: none; color: var(--ink); }
.icon-btn svg { fill: currentColor; }
.icon-btn:hover { background: var(--soft); border-color: var(--line); }
button.icon-btn:not(:disabled):hover { transform: none; box-shadow: none; }
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; min-width: 240px; padding: 6px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; }
.menu-pop button { border: none; background: none; text-align: left; padding: 9px 12px; border-radius: 8px; font-size: 15px; }
.menu-pop button:hover, .menu-pop button:focus-visible { background: var(--soft); }
.menu-pop .danger { color: var(--bad); }
.menu-info { margin: 0 0 4px; padding: 7px 12px 9px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; cursor: pointer; padding: 30px 16px 26px; margin-bottom: 14px;
  border: 1.5px dashed color-mix(in srgb, var(--ink) 22%, var(--line)); border-radius: 16px; background: var(--soft);
  transition: border-color .15s, background .15s; }
.drop:hover { border-color: color-mix(in srgb, var(--ink) 45%, var(--line)); }
.drop-art { overflow: visible; margin-bottom: 8px; fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; opacity: .8; }
#drop-title { font-size: 18px; }
.drop u { text-underline-offset: 2px; }
.drop .small { margin-top: 6px; }
.drop.over { border-style: solid; border-color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, var(--soft)); }
/* a file is held over the page: the books make room, and an outline of the new one comes down into the gap */
.drop-art g, .book-new { transition: transform .3s cubic-bezier(.3, 1.3, .5, 1), opacity .2s; }
.book-new { fill: none; stroke-dasharray: 3 3; opacity: 0; transform: translateY(-14px); }
.drop.over .books-left { transform: translateX(-8px); }
.drop.over .book-right { transform: translateX(9px); }
.drop.over .book-new { opacity: 1; transform: none; transition-delay: .1s; }
@media (prefers-reduced-motion: reduce) { .drop-art g, .book-new { transition: none; } }
.link-bar { display: flex; align-items: center; gap: 8px; padding: 5px 5px 5px 16px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.link-bar:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent); }
.link-bar svg { flex: none; color: var(--muted); }
.link-bar input { flex: 1; min-width: 0; font: inherit; color: var(--ink); background: none; border: none; padding: 7px 0; outline: none; }
.link-bar button { padding: 8px 20px; }
.link-extra { margin: 0 0 30px; padding: 0 6px; }
.link-preview { display: flex; align-items: baseline; gap: 8px; margin: 0 0 10px; font-size: 14px; min-width: 0; }
.link-preview b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.link-preview span { flex: none; color: var(--muted); }
.link-preview.looking { color: var(--muted); }
.link-as { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.link-as .small { margin: 0; }
.pills-small { margin: 0; padding: 3px; }
.pills-small .pill span { padding: 3px 13px; font-size: 14px; }

.sent-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.sent-head h2 { font-size: 22px; margin: 0; }
.sent { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.card { position: relative; overflow: hidden; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto auto; align-items: center; gap: 4px 14px; padding: 12px 12px 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.badge { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 10px; font: 700 11px/1 system-ui, sans-serif; letter-spacing: .04em;
  --c: #6b6b6b; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.badge svg { width: 20px; height: 20px; }
.b-article { --c: #1f7a80; } .b-epub { --c: #2f7d4f; } .b-pdf { --c: #b4382f; } .b-mobi { --c: #b8691b; } .b-comic { --c: #7a4bb0; } .b-link { --c: #2f62b0; }
@media (prefers-color-scheme: dark) {
  .badge { --c: #b0b0b0; }
  .b-article { --c: #7fd0d4; } .b-epub { --c: #7fcf9c; } .b-pdf { --c: #f0928a; } .b-mobi { --c: #f0b070; } .b-comic { --c: #c2a1ec; } .b-link { --c: #8fb4f0; }
}
.card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.card .what { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .meta { font-size: 13px; color: var(--muted); }
.card .badge { grid-column: 1; grid-row: 1 / span 2; }
.card .card-main { grid-column: 2; grid-row: 1 / span 2; }
.card .chip { grid-column: 3; grid-row: 1 / span 2; }
.card .remove { grid-column: 4; grid-row: 1 / span 2; width: 30px; height: 30px; color: var(--muted); }
.card .remove svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.card .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.card .bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .25s; }
.empty { text-align: center; padding: 26px 16px; border: 1px dashed var(--line); border-radius: 12px; }
.empty p { margin: 0 0 4px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 20; padding: 11px 20px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-size: 15px; box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .45); transition: opacity .25s; }
.toast.leaving { opacity: 0; }
@media (max-width: 560px) {
  .sender { padding: 20px 16px 22px; border-radius: 14px; }
  .sender-head { align-items: flex-start; }
  .sender h1 { font-size: 23px; white-space: nowrap; }
    .kobo-id { gap: 10px; }
  .card { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 6px 12px; padding: 10px 8px 10px 12px; }
  .card .badge { width: 40px; height: 40px; }
  .card .card-main { grid-row: 1; }
  .card .chip { grid-column: 2; grid-row: 2; justify-self: start; font-size: 12px; }
  .card .remove { grid-column: 3; }
  .link-bar button { padding: 8px 14px; }
}

/* wide: two sides, with no container around them */
@media (min-width: 821px) {
  .sender { max-width: none; padding: 0; margin: 18px 0 56px; background: none; border: 0; border-radius: 0; }
  .sender-head { margin-bottom: 20px; }
  .sender h1 { font-size: 40px; line-height: 1.15; }
  .sender .icon-btn:hover { background: var(--paper); }
  .update-notice:not([hidden]) { display: flex; align-items: center; gap: 14px; border-width: 1px; margin-bottom: 20px; }
  .update-notice p { flex: 1; margin: 0; }

  .sides { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; height: clamp(500px, calc(100vh - 230px), 660px); }
  .side-send { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
  .drop, .link-panel, .side-sent { border-radius: 18px; }
  .drop { flex: 1; min-height: 0; justify-content: center; margin: 0; background: var(--paper); border-width: 2px; }
  .drop-art { width: 120px; height: 80px; margin-bottom: 14px; }
  #drop-title { font: 400 28px/1.2 Georgia, "Rakuten Serif", serif; }
  .drop .small { max-width: 24em; margin-top: 12px; }
  .link-panel { flex: none; padding: 18px; background: var(--paper); border: 1px solid var(--line); }
  .link-bar { background: var(--soft); }
  .sender .link-extra { margin-bottom: 0; }

  .side-sent { display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--paper); border: 1px solid var(--line); }
  .sent-head { align-items: center; height: 64px; flex: none; padding: 0 22px; margin: 0; border-bottom: 1px solid var(--line); }
  .sent-head h2, .sent-head .small { line-height: 1; }
  .sent-list { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; }
  /* rows, not boxes inside the box */
  .sent { gap: 0; }
  .card { grid-template-columns: 46px minmax(0, 1fr) auto; gap: 8px 14px; padding: 14px 22px; border: 0; border-radius: 0; background: none; align-items: start; }
  .card + .card { border-top: 1px solid var(--line); }
  .card .badge { grid-row: 1 / span 2; }
  .card .card-main { grid-row: 1; }
  .card .chip { grid-column: 2; grid-row: 2; justify-self: start; }
  .card .remove { grid-column: 3; grid-row: 1; margin: -4px -9px 0 0; }
  .empty { display: grid; align-content: center; height: 100%; border: 0; padding: 24px 40px; }
}

/* below */
.about { max-width: 680px; margin: 0 auto 40px; }
ol.how { padding-left: 22px; margin: 0; }
ol.how li { margin-bottom: 12px; }
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 8px 0 0; color: var(--muted); }
.faq details ul { margin: 8px 0 0; padding-left: 20px; color: var(--muted); }
.faq details li + li { margin-top: 4px; }
footer { max-width: 680px; margin: 0 auto; text-align: center; }

/* Run your own relay (relay.html) */
.guide { padding-top: 24px; }
.guide h1 { font-family: Georgia, "Rakuten Serif", serif; font-weight: 400; font-size: 36px; margin: 0 0 12px; }
.guide h2 { font-size: 22px; margin: 32px 0 10px; }
.guide ul { padding-left: 20px; }
.guide li + li { margin-top: 6px; }
.guide .deploy { display: table; margin: 10px 0; }

/* Connect: "My Kobo uses its own relay" */
.text-link { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.text-link:hover { color: var(--ink); }
.own-relay label { display: block; margin-top: 8px; }
