/* とある一行（一枚の本）
   ページは「青空」の色、一行は活版で刷った一枚の紙、日付印は図書館の紫。 */

:root {
  --sky: #d3e1e5;
  --sky-rule: #b3c8cf;
  --page-ink: #1e2632;
  --page-soft: #4d5b68;
  --paper: #fbfbf7;
  --paper-rule: #c9d4d9;
  --ink: #1e2632;
  --ink-soft: #55616d;
  --rule: #8fa6b4;
  --stamp: #6d4f8e;
  --focus: #2b5d8c;
  --mark: rgba(109, 79, 142, .16);
  --font-type: "Zen Antique", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "Noto Serif CJK JP", serif;
  --font-ui: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Noto Sans JP", sans-serif;
  --shadow-card: 0 1px 1px rgba(30, 38, 50, .08), 0 18px 36px -18px rgba(30, 38, 50, .45);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --sky: #121a21;
    --sky-rule: #2a3843;
    --page-ink: #d9e1e7;
    --page-soft: #9fb0bd;
    --paper: #eceee8;
    --paper-rule: #c3ccd0;
    --rule: #6f8796;
    --focus: #8bb8e0;
    --mark: rgba(155, 131, 196, .28);
    --shadow-card: 0 1px 1px rgba(0, 0, 0, .3), 0 24px 48px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--sky);
  color: var(--page-ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.75;
  font-feature-settings: "palt" 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); color: var(--ink); padding: 6px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---- 上の帯 ---- */
.bar {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  max-width: 760px; width: 100%; margin: 0 auto; padding: 14px 20px 10px;
  font-size: 13px; letter-spacing: .04em;
  border-bottom: 1px solid var(--sky-rule);
}
.bar-home { text-decoration: none; font-family: var(--font-type); font-size: 15px; letter-spacing: .12em; }
.bar-nav { display: flex; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.bar-nav a { text-decoration: none; color: var(--page-soft); }
.bar-nav a:hover, .bar-nav a[aria-current="page"] { color: var(--page-ink); text-decoration: underline; }
/* 「とある一行」は、はじめの画面へ戻る入口。題字の書体と家の印で、ほかの項目と見分けやすくする */
.bar-nav a.bar-app {
  font-family: var(--font-type); font-size: 14.5px; letter-spacing: .08em; color: var(--page-ink);
}
.bar-nav a.bar-app::before {
  content: ""; display: inline-block; width: 1em; height: 1em; margin-right: .3em; vertical-align: -0.14em; background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M3.5 11.2 12 4.2l8.5 7' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/><path d='M6 9.8v9.7h12V9.8' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M3.5 11.2 12 4.2l8.5 7' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/><path d='M6 9.8v9.7h12V9.8' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/></svg>") center / contain no-repeat;
}
/* 狭い画面で入りきらないときは、項目の途中で折り返さず、右側の項目をまとめて次の行へ */
.bar { flex-wrap: wrap; row-gap: 6px; }
.bar-home { flex: none; white-space: nowrap; }
.bar-nav { flex-wrap: nowrap; margin-left: auto; align-items: baseline; }
.bar-nav a { white-space: nowrap; }
@media (max-width: 380px) {
  .bar { padding-left: 14px; padding-right: 14px; column-gap: 8px; }
  .bar-nav { gap: 12px; }
}
.shiori-count { margin-left: 2px; font-variant-numeric: tabular-nums; }

main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px 48px; outline: none; }
.view { padding-top: 28px; }
.view-title {
  font-family: var(--font-type); font-weight: 400; font-size: 26px; letter-spacing: .14em;
  margin: 0 0 18px;
}

/* ---- はじめの画面 ---- */
.view-home { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "drawers hero" "today today"; column-gap: clamp(18px, 5vw, 48px); row-gap: 40px; padding-top: 36px; }
.hero { grid-area: hero; display: flex; flex-direction: row-reverse; align-items: flex-start; gap: 14px; }
.title {
  writing-mode: vertical-rl; text-orientation: mixed;
  font-family: var(--font-type); font-weight: 400;
  font-size: clamp(54px, 15vw, 92px); line-height: 1; letter-spacing: .06em;
  margin: 0;
}
.tagline {
  writing-mode: vertical-rl; margin: .4em 0 0; font-family: var(--font-type);
  font-size: clamp(14px, 3.6vw, 17px); letter-spacing: .32em; color: var(--page-soft);
}
.drawers { grid-area: drawers; display: flex; flex-direction: column; gap: 14px; align-self: start; }
.drawer {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 3px;
  padding: 14px 16px 15px;
  box-shadow: 0 1px 0 rgba(30, 38, 50, .06), inset 0 -3px 0 rgba(30, 38, 50, .05);
  transition: transform .18s ease, box-shadow .18s ease;
}
.drawer:hover { transform: translateY(-2px); box-shadow: 0 6px 14px -8px rgba(30, 38, 50, .45), inset 0 -3px 0 rgba(30, 38, 50, .05); }
.drawer:active { transform: translateY(0); }
.drawer-plate {
  position: relative; display: inline-block;
  padding: 3px 18px 4px; border: 1px solid var(--rule); border-radius: 2px;
  background: linear-gradient(var(--paper), var(--paper));
}
.drawer-plate::before, .drawer-plate::after {
  content: ""; position: absolute; top: 50%; width: 4px; height: 4px; margin-top: -2px;
  border-radius: 50%; background: var(--rule);
}
.drawer-plate::before { left: 6px; }
.drawer-plate::after { right: 6px; }
.drawer-name { font-family: var(--font-type); font-size: 19px; letter-spacing: .1em; line-height: 1.6; }
.drawer-desc { display: block; margin-top: 9px; font-size: 13.5px; line-height: 1.7; color: var(--ink-soft); }

.today { grid-area: today; border-top: 1px solid var(--sky-rule); padding-top: 20px; }
.today-head { font-family: var(--font-type); font-weight: 400; font-size: 15px; letter-spacing: .2em; margin: 0 0 10px; color: var(--page-soft); }
.today-card { display: block; text-decoration: none; }
.today-text { display: block; font-family: var(--font-type); font-size: 19px; line-height: 1.9; letter-spacing: .04em; }
.today-src { display: block; margin-top: 6px; font-size: 13px; color: var(--page-soft); }
.today-card:hover .today-text { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .3em; }

@media (max-width: 420px) {
  .view-home { column-gap: 14px; }
  .drawer { padding: 12px 12px 13px; }
  .drawer-name { font-size: 17px; }
  .drawer-plate { padding: 2px 14px 3px; }
  .drawer-desc { font-size: 13px; }
}

/* ---- 一行のカード ---- */
.line-context { margin: 0 0 12px; font-size: 13px; color: var(--page-soft); min-height: 1.75em; text-align: center; }
.card {
  position: relative; margin: 0 auto;
  /* 画面の高さにも合わせて、一行のカード全体がスクロールしなくても見える大きさにする
     （上の帯と「司書が選んだ一行」などの見出しの分を引いた高さ。svh はスマホの表示部分がいちばん狭いときの高さ） */
  width: min(100%, 420px);
  width: min(100%, 420px, max(260px, calc((100vh - 160px) * 100 / 148)));
  width: min(100%, 420px, max(260px, calc((100svh - 160px) * 100 / 148)));
  aspect-ratio: 100 / 148;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.12  0 0 0 0 0.15  0 0 0 0 0.2  0 0 0 .045 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  border-radius: 2px;
  box-shadow: var(--shadow-card);
  color: var(--ink);
  overflow: hidden;
}
.card-inner {
  position: absolute; inset: 9% 7% 9% 7%;
  display: flex; flex-direction: row-reverse; justify-content: center; align-items: flex-start;
  gap: 1.6em;
}
.line {
  writing-mode: vertical-rl; text-orientation: mixed;
  flex: none; margin: 0; height: 100%;
  font-family: var(--font-type); font-weight: 400; font-size: 30px; line-height: 1.85;
  letter-spacing: .03em;
  line-break: strict; word-break: normal; overflow-wrap: normal;
  hanging-punctuation: allow-end;
  color: var(--ink);
  text-shadow: 0 .6px 0 rgba(255, 255, 255, .8);
}
.line ruby { ruby-position: over; }
.line rt { font-size: .44em; letter-spacing: 0; color: var(--ink-soft); }
.source {
  writing-mode: vertical-rl; flex: none; margin: 0; height: 100%;
  /* 題名や作者名が長いときに、左上の日付印に重ならないよう、印より下で折り返す */
  padding-top: 22%;
  font-family: var(--font-type); font-size: 13px; line-height: 1.9; letter-spacing: .14em;
  text-align: end; color: var(--ink-soft);
}
.source .src-title { display: block; }
.source .src-author { display: block; }
.tcy { text-combine-upright: all; -webkit-text-combine: horizontal; }

.em-s { -webkit-text-emphasis: filled sesame; text-emphasis: filled sesame; }
.em-os { -webkit-text-emphasis: open sesame; text-emphasis: open sesame; }
.em-c { -webkit-text-emphasis: filled circle; text-emphasis: filled circle; }
.em-oc { -webkit-text-emphasis: open circle; text-emphasis: open circle; }
.em-dc { -webkit-text-emphasis: filled double-circle; text-emphasis: filled double-circle; }
.em-t { -webkit-text-emphasis: filled triangle; text-emphasis: filled triangle; }
.em-ot { -webkit-text-emphasis: open triangle; text-emphasis: open triangle; }
.em-x { -webkit-text-emphasis: "×"; text-emphasis: "×"; }
.em-s, .em-os, .em-c, .em-oc, .em-dc, .em-t, .em-ot, .em-x { -webkit-text-emphasis-position: over right; text-emphasis-position: over right; }
.em-u, .em-uu, .em-ud, .em-uw { text-decoration-line: underline; text-underline-position: right; text-decoration-thickness: 1px; }
.em-uu { text-decoration-style: double; }
.em-ud { text-decoration-style: dashed; }
.em-uw { text-decoration-style: wavy; }

.stamp {
  position: absolute; left: 5%; top: 3.5%; width: 25%; aspect-ratio: 1;
  color: var(--stamp); opacity: .92; transform: rotate(-12deg);
  pointer-events: none; mix-blend-mode: multiply;
}
.stamp svg { display: block; width: 100%; height: 100%; }

.card.is-new .line, .card.is-new .source { animation: ig-ink .7s ease-out both; }
.card.is-new .source { animation-delay: .15s; }
.card.is-new .stamp { animation: ig-press .24s .62s cubic-bezier(.2, .9, .25, 1) both; }
@keyframes ig-ink { from { opacity: 0; filter: blur(1.5px); } to { opacity: 1; filter: none; } }
@keyframes ig-press {
  from { opacity: 0; transform: rotate(-17deg) scale(1.4); }
  60% { opacity: .95; }
  to { opacity: .92; transform: rotate(-12deg) scale(1); }
}

.tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; margin: 16px 0 0; }
.tag {
  font-family: var(--font-type); font-size: 13.5px; letter-spacing: .08em; color: var(--stamp);
  border: 1px solid currentColor; border-radius: 2px; padding: 0 8px; opacity: .9;
}
@media (prefers-color-scheme: dark) { .tag { color: #b9a3dc; } }
.tag-pool { flex-basis: 100%; text-align: center; font-size: 12.5px; letter-spacing: .04em; color: var(--page-soft); }
.conf-error { color: #9b2c2c; font-weight: 500; }

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 22px 0 0; }
.actions-quiet { gap: 6px 18px; margin-top: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 8px 18px; border-radius: 3px;
  border: 1px solid var(--page-ink); background: transparent; color: var(--page-ink);
  font-size: 14.5px; letter-spacing: .06em; text-decoration: none; cursor: pointer;
}
.btn:hover { background: rgba(30, 38, 50, .06); }
.btn-ink { background: var(--page-ink); color: var(--sky); }
.btn-ink:hover { background: var(--page-ink); opacity: .9; }
.btn-text {
  border: 0; background: none; padding: 6px 2px; min-height: 40px; cursor: pointer;
  font-size: 14px; color: var(--page-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .3em;
}
.btn-text:hover { color: var(--focus); }
.btn-text[aria-pressed="true"] { color: var(--stamp); }
@media (prefers-color-scheme: dark) { .btn-text[aria-pressed="true"] { color: #b9a3dc; } .btn:hover { background: rgba(255, 255, 255, .06); } }

.toast { min-height: 1.6em; margin: 8px 0 0; text-align: center; font-size: 13px; color: var(--page-soft); }

.credit { margin: 22px auto 0; max-width: 34em; font-size: 13px; color: var(--page-soft); border-top: 1px solid var(--sky-rule); padding-top: 12px; }
.credit summary { cursor: pointer; color: var(--page-ink); }
.credit dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 12px 0 0; }
.credit dt { white-space: nowrap; }
.credit dd { margin: 0; overflow-wrap: anywhere; }
.credit-note { margin: 12px 0 0; }
.shop { text-align: center; margin: 26px 0 0; font-size: 13.5px; }

/* ---- 画像にして共有（インスタなど） ---- */
.share {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  margin: auto; padding: 0; border: 0; border-radius: 4px;
  background: var(--sky); color: var(--page-ink);
  box-shadow: 0 24px 60px -20px rgba(18, 26, 33, .6);
  overflow: auto;
}
.share::backdrop { background: rgba(18, 26, 33, .55); }
.share.share-fallback {
  position: fixed; inset: 0; z-index: 40; height: fit-content;
  box-shadow: 0 0 0 100vmax rgba(18, 26, 33, .55);
}
.share[open] { display: block; }
.share:not([open]) { display: none; }
.share-inner { padding: 16px 18px 20px; }
.share-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.share-title { font-family: var(--font-type); font-weight: 400; font-size: 20px; letter-spacing: .12em; margin: 0; }
.share-close { min-height: 36px; font-size: 13.5px; }
.share-formats { display: flex; gap: 8px; margin: 12px 0 0; }
.seg {
  flex: 1; min-height: 44px; padding: 6px 10px; cursor: pointer;
  background: transparent; color: var(--page-ink);
  border: 1px solid var(--sky-rule); border-radius: 3px; font-size: 14px; letter-spacing: .04em;
}
.seg span { margin-left: .5em; font-size: 12px; color: var(--page-soft); font-variant-numeric: tabular-nums; }
.seg[aria-pressed="true"] { border-color: var(--page-ink); background: rgba(30, 38, 50, .06); }
@media (prefers-color-scheme: dark) { .seg[aria-pressed="true"] { background: rgba(255, 255, 255, .08); } }
.share-preview { display: flex; align-items: center; justify-content: center; margin: 14px 0 0; min-height: 220px; }
.share-preview img {
  display: block; max-width: 100%; max-height: min(52vh, 520px); height: auto;
  border-radius: 2px; box-shadow: 0 8px 24px -12px rgba(18, 26, 33, .55);
  -webkit-touch-callout: default;
}
.share-wait { margin: 0; font-size: 13.5px; color: var(--page-soft); }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.share-actions .btn { flex: 1 1 auto; }
.share-status { min-height: 1.6em; margin: 10px 0 0; font-size: 13px; color: var(--page-ink); }
.share-note { margin: 4px 0 0; font-size: 12.5px; line-height: 1.8; color: var(--page-soft); }

/* ---- 言葉で探す ---- */
.search { display: flex; gap: 8px; }
.search input {
  flex: 1; min-width: 0; min-height: 48px; padding: 8px 14px;
  font-family: var(--font-type); font-size: 20px; letter-spacing: .06em;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule); border-radius: 3px;
}
.search input::placeholder { color: #8b97a2; }
.hint { font-size: 13px; color: var(--page-soft); margin: 10px 0 0; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.chip {
  border: 1px solid var(--sky-rule); background: transparent; border-radius: 999px;
  padding: 3px 13px; min-height: 34px; cursor: pointer; font-family: var(--font-type); font-size: 15px; letter-spacing: .06em;
}
.chip:hover { border-color: var(--page-ink); }
.results { margin-top: 26px; }
.results h3 { font-family: var(--font-type); font-weight: 400; font-size: 16px; letter-spacing: .14em; margin: 26px 0 8px; color: var(--page-soft); }
.results h3:first-child { margin-top: 0; }
.hits { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--sky-rule); }
.hits li { border-bottom: 1px solid var(--sky-rule); }
.hit {
  display: block; width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 13px 4px 12px;
}
.hit:hover { background: rgba(251, 251, 247, .45); }
@media (prefers-color-scheme: dark) { .hit:hover { background: rgba(255, 255, 255, .04); } }
.hit-text { display: block; font-family: var(--font-type); font-size: 17.5px; line-height: 1.85; letter-spacing: .03em; }
.hit-text mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }
.hit-src { display: block; margin-top: 3px; font-size: 12.5px; color: var(--page-soft); }
.works-hits .hit-text { font-size: 16px; }
.more { margin-top: 16px; text-align: center; }
.empty { font-size: 14.5px; line-height: 1.9; }

/* ---- 五つの問い（貸出カード） ---- */
.loancard {
  background: var(--paper); color: var(--ink); border-radius: 2px; box-shadow: var(--shadow-card);
  padding: 12px 16px 14px; max-width: 520px;
}
.loan-row { display: grid; grid-template-columns: 2.2em 1fr; align-items: center; min-height: 40px; border-bottom: 1px solid var(--paper-rule); }
.loan-row:last-child { border-bottom: 0; }
.loan-no { font-family: var(--font-type); color: var(--ink-soft); font-size: 15px; border-right: 1px solid var(--paper-rule); height: 100%; display: flex; align-items: center; }
.loan-ans { padding-left: 14px; font-family: var(--font-type); font-size: 16px; letter-spacing: .08em; }
.loan-row.is-current .loan-no { color: var(--ink); }
.loan-row.is-current .loan-ans::before { content: ""; display: inline-block; width: 1.4em; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.loan-stamp { display: inline-block; color: var(--stamp); border: 1.5px solid currentColor; border-radius: 3px; padding: 0 8px; transform: rotate(-3deg); opacity: .9; }
.loan-skip { color: var(--ink-soft); font-size: 14px; }
.loan-row.is-new .loan-stamp { animation: ig-press-s .22s cubic-bezier(.2, .9, .25, 1) both; }
@keyframes ig-press-s { from { opacity: 0; transform: rotate(-7deg) scale(1.35); } to { opacity: .9; transform: rotate(-3deg) scale(1); } }
.ask { margin-top: 26px; max-width: 520px; }
.ask-q { font-family: var(--font-type); font-size: clamp(19px, 5.4vw, 23px); line-height: 1.6; letter-spacing: .06em; margin: 0 0 16px; text-wrap: balance; }
.ask-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.opt {
  min-height: 52px; padding: 10px 14px; text-align: center; cursor: pointer;
  background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-radius: 3px;
  font-family: var(--font-type); font-size: clamp(15px, 4.3vw, 18px); letter-spacing: .03em; line-height: 1.4;
  word-break: keep-all; overflow-wrap: anywhere;
}
.opt:hover { border-color: var(--ink); }
.ask-skip { margin: 10px 0 0; }
/* 次の問いを待つ間（答えたあと）は、前の選択肢を薄くして押せないようにする */
.ask[aria-busy="true"] .opt, .ask[aria-busy="true"] .ask-skip { opacity: .45; pointer-events: none; transition: opacity .2s; }
.ask-remain { margin: 6px 0 0; font-size: 13px; color: var(--page-soft); font-variant-numeric: tabular-nums; }

/* ---- しおり ----
   一枚ずつ縦書きの栞にして、横に並べた棚。縦書きの本と同じく右から左へ、新しいものが右。
   棚は横にずらして見る（パソコンではマウスのホイールでも動く） */
.shiori-shelf {
  list-style: none; margin: 4px -20px 0; padding: 50px 20px 8px;
  display: flex; align-items: flex-start; gap: 22px;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  direction: rtl;
  scrollbar-width: thin; scrollbar-color: var(--rule) transparent;
}
/* まだ先に栞があるときは、その側の端を薄くして知らせる */
.shiori-shelf.more-left { -webkit-mask-image: linear-gradient(to right, transparent, #000 44px); mask-image: linear-gradient(to right, transparent, #000 44px); }
.shiori-shelf.more-right { -webkit-mask-image: linear-gradient(to left, transparent, #000 44px); mask-image: linear-gradient(to left, transparent, #000 44px); }
.shiori-shelf.more-left.more-right {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent);
}
.shiori-item { direction: ltr; flex: none; display: flex; flex-direction: column; align-items: center; }
.shiori {
  position: relative; display: block; flex: none; width: 128px; height: 368px; margin: 0; padding: 0;
  border: 0; border-radius: 3px; cursor: pointer; text-align: start; color: var(--ink);
  background-color: var(--paper);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.12  0 0 0 0 0.15  0 0 0 0 0.2  0 0 0 .045 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  box-shadow: 0 1px 1px rgba(30, 38, 50, .08), 0 14px 26px -14px rgba(30, 38, 50, .5);
  transition: transform .2s ease, box-shadow .2s ease;
}
.shiori:hover { transform: translateY(-5px); box-shadow: 0 1px 1px rgba(30, 38, 50, .08), 0 24px 30px -18px rgba(30, 38, 50, .55); }
.shiori:active { transform: translateY(-2px); }
/* 刷りの枠 */
.shiori::before {
  content: ""; position: absolute; inset: 7px; pointer-events: none;
  border: 1px solid var(--paper-rule); border-radius: 2px;
}
/* 紐を通す穴（紐の先が穴に入って見えるよう、紐より上に重ねる） */
.shiori::after {
  content: ""; position: absolute; z-index: 2; top: 17px; left: 50%; width: 11px; height: 11px; margin-left: -5.5px;
  border-radius: 50%; background: var(--sky);
  box-shadow: inset 0 1px 2px rgba(30, 38, 50, .5), 0 0 0 1px rgba(30, 38, 50, .05);
}
/* 紐と房（色は一枚ずつ違う） */
.shiori-cord {
  position: absolute; left: 50%; top: -41.5px; width: 40px; height: 70px; margin-left: -20px;
  color: var(--cord, var(--stamp)); overflow: visible; pointer-events: none; z-index: 1;
}
.shiori-body {
  position: absolute; inset: 42px 14px 18px;
  display: flex; flex-direction: row-reverse; justify-content: center; gap: 9px;
}
.shiori-text {
  flex: none; height: 100%; max-width: 76px; overflow: hidden;
  writing-mode: vertical-rl; text-orientation: mixed;
  font-family: var(--font-type); font-size: 15px; line-height: 1.75; letter-spacing: .04em;
  line-break: strict; word-break: normal;
}
/* 栞に入りきらない長い一行は、終わりを薄くぼかす（開くと全部読める） */
.shiori-text.is-long {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 34px);
  mask-image: linear-gradient(to right, transparent, #000 34px);
}
.shiori-src {
  flex: none; align-self: flex-end; max-height: 64%;
  writing-mode: vertical-rl; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: var(--font-type); font-size: 11px; line-height: 1.5; letter-spacing: .1em; color: var(--ink-soft);
}
.shiori:focus-visible { outline-offset: 4px; }
.shiori-del { margin-top: 8px; min-height: 36px; padding: 4px 8px; font-size: 12.5px; color: var(--page-soft); }
/* まだ一枚もないとき */
.shiori-empty { direction: ltr; display: flex; flex-direction: row-reverse; align-items: center; gap: 20px; flex: 1 1 auto; min-width: 0; }
.shiori-blank {
  cursor: default; background: transparent; box-shadow: none;
  border: 1.5px dashed var(--rule);
}
.shiori-blank:hover, .shiori-blank:active { transform: none; box-shadow: none; }
.shiori-blank::before { display: none; }
.shiori-blank::after { background: transparent; box-shadow: none; border: 1.5px dashed var(--rule); }
.shiori-blank .shiori-text { color: var(--page-soft); font-size: 15px; letter-spacing: .12em; }
.shiori-empty .empty { flex: 0 1 15em; min-width: 0; margin: 0; word-break: auto-phrase; }
.shiori-status { min-height: 1.6em; margin: 6px 0 0; font-size: 13px; color: var(--page-soft); text-align: center; }
.shiori-status .btn-text { min-height: 32px; margin-left: .6em; font-size: 13px; }

/* ---- 文章 ---- */
.prose { max-width: 34em; }
.prose h3 { font-family: var(--font-type); font-weight: 400; font-size: 18px; letter-spacing: .12em; margin: 28px 0 6px; }
.prose p { margin: 0 0 12px; line-height: 1.95; }
.prose strong { font-weight: 500; }

/* ---- 読み込み中 ---- */
.loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(211, 225, 229, .72); z-index: 20; }
@media (prefers-color-scheme: dark) { .loading { background: rgba(18, 26, 33, .76); } }
.loading-text { writing-mode: vertical-rl; font-family: var(--font-type); font-size: 18px; letter-spacing: .3em; margin: 0; }
.loading-text::after { content: "……"; display: inline-block; animation: ig-dots 1.4s steps(3, end) infinite; overflow: hidden; block-size: auto; }
@keyframes ig-dots { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }

/* ---- 広告と下の帯 ---- */
.ad { width: 100%; max-width: 760px; margin: 160px auto 0; padding: 0 20px; }
.ad-label { margin: 0 0 4px; font-size: 11px; color: var(--page-soft); }
.foot { width: 100%; max-width: 760px; margin: 40px auto 0; padding: 18px 20px 28px; border-top: 1px solid var(--sky-rule); font-size: 12.5px; color: var(--page-soft); }
.foot p { margin: 0 0 4px; }

@media (min-width: 720px) {
  .view-home { padding-top: 56px; }
  .drawers { max-width: none; }
}
/* 上の帯が一段に収まる広さでは、その分だけカードを大きくできる */
@media (min-width: 600px) {
  .card {
    width: min(100%, 420px, max(260px, calc((100vh - 136px) * 100 / 148)));
    width: min(100%, 420px, max(260px, calc((100svh - 136px) * 100 / 148)));
  }
}

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