/* ------------------------------------------------------------------
   Caption Desk — 編集部の校正机
   紙(生成り) + 墨 + 朱。明朝の見出しにゴシックの本文。
   スマホを主、広い画面を従として組む。
------------------------------------------------------------------ */

:root {
  --paper:      #f3eee2;
  --paper-card: #fbf8f1;
  --paper-sunk: #e9e2d1;
  --ink:        #1d1a16;
  --ink-2:      #4e4740;
  --ink-3:      #857c70;
  --rule:       #d9cfba;
  --rule-soft:  #e6ddcb;
  --seal:       #c0442c;
  --seal-soft:  #e8d2c9;
  --indigo:     #2f4858;
  --moss:       #5d7052;
  --gold:       #a97f2e;

  --shadow-card: 0 1px 0 rgba(29, 26, 22, .04), 0 6px 18px -12px rgba(29, 26, 22, .35);
  --shadow-pop:  0 24px 60px -28px rgba(29, 26, 22, .55);

  --sans: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
  --mincho: "Zen Old Mincho", "Hiragino Mincho ProN", serif;
  --latin: "Instrument Serif", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --radius: 3px;
  --sidebar-w: 232px;
  --list-w: 372px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

:root[data-theme="dark"] {
  --paper:      #16150f;
  --paper-card: #1f1d16;
  --paper-sunk: #100f0a;
  --ink:        #ece5d5;
  --ink-2:      #b3aa97;
  --ink-3:      #7d7566;
  --rule:       #35322a;
  --rule-soft:  #2a2721;
  --seal:       #e0664a;
  --seal-soft:  #40251e;
  --indigo:     #7fa5bd;
  --moss:       #9bb389;
  --gold:       #d3ab5c;
  --shadow-card: 0 1px 0 rgba(0, 0, 0, .3), 0 6px 18px -12px rgba(0, 0, 0, .8);
  --shadow-pop:  0 24px 60px -28px rgba(0, 0, 0, .9);
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

/* 紙の粒子。うっすら乗せて質感を出す */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: .35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] body::before { mix-blend-mode: screen; opacity: .16; }

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--seal-soft); }

/* 表示の出し分け。既定は狭い画面 */
.only-wide { display: none; }

/* ---------------- 見出し・共通パーツ ---------------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.btn {
  border: 1px solid var(--rule);
  background: var(--paper-card);
  border-radius: var(--radius);
  padding: 8px 13px;
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--ink-2);
  white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s, transform .1s;
}
.btn:hover { border-color: var(--ink-3); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn--seal { background: var(--seal); border-color: var(--seal); color: #fdf7f3; }
.btn--seal:hover { background: color-mix(in srgb, var(--seal) 86%, #000); border-color: transparent; color: #fdf7f3; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-3); }
.btn--ghost:hover { background: var(--paper-sunk); color: var(--ink); }
.btn--danger:hover { border-color: var(--seal); color: var(--seal); }
.btn--icon {
  width: 40px; height: 40px;
  padding: 0;
  display: grid; place-items: center;
  font-size: 20px; line-height: 1;
  background: transparent; border-color: transparent;
  color: var(--ink-2);
}
.btn--wide { width: 100%; padding: 13px; font-size: 14.5px; }
.btn[disabled] { opacity: .4; pointer-events: none; }

/* ---------------- レイアウト（狭い画面が基準） ---------------- */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding-left: var(--safe-l);
  padding-right: var(--safe-r);
}

/* ---------------- ヘッダ ---------------- */

.head {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  row-gap: 9px;
  padding: 8px 10px 8px 14px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.brand { display: flex; align-items: baseline; gap: 12px; min-width: 0; margin-right: auto; }
.brand__mark {
  font-family: var(--latin);
  font-style: italic;
  font-size: 22px;
  letter-spacing: .01em;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}
.brand__mark em { color: var(--seal); font-style: italic; }
.brand__sub { display: none; }

.search { position: relative; order: 5; flex: 1 0 100%; }
.search input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: 16px;              /* iOS の自動ズームを防ぐため 16px 以上を保つ */
  transition: border-color .15s;
  -webkit-appearance: none;
}
.search input:focus { outline: none; border-color: var(--ink-3); }
.search input::placeholder { color: var(--ink-3); }
.search__icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
  display: flex;
}
.search__kbd { display: none; }

.head__tools { display: flex; align-items: center; gap: 4px; }

/* ---------------- 絞り込みの帯（狭い画面） ---------------- */

.mbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--paper) 94%, var(--paper-sunk));
  border-bottom: 1px solid var(--rule-soft);
}
.mbar__row {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.mbar__row::-webkit-scrollbar { display: none; }
.mbar__row--tags { padding-top: 0; }
.mbar__row--tags:empty { display: none; }

.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  border: 1px solid var(--rule);
  background: var(--paper-card);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 13px;
  color: var(--ink-2);
  transition: background .14s, color .14s, border-color .14s;
}
.tab[aria-current="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.tab[aria-current="true"] .dot { background: var(--paper); }
.tab__count { font-family: var(--mono); font-size: 11px; opacity: .65; }

/* ---------------- サイドバー（広い画面のみ） ---------------- */

.side { display: none; }

.navlist { list-style: none; margin: 0; padding: 0; }
.navlist li + li { margin-top: 1px; }
.nav {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  text-align: left;
  font-size: 13px;
  color: var(--ink-2);
  transition: background .14s, color .14s;
}
.nav:hover { background: var(--paper-sunk); color: var(--ink); }
.nav[aria-current="true"] {
  background: var(--paper-card);
  color: var(--ink);
  box-shadow: inset 2px 0 0 var(--seal);
  font-weight: 500;
}
.nav__count { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--ink-3); }
.dot--draft     { background: var(--ink-3); }
.dot--ready     { background: var(--moss); }
.dot--scheduled { background: var(--gold); }
.dot--posted    { background: var(--indigo); }
.dot--all       { background: var(--seal); }

.chips { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 4px; }
.chip {
  flex: none;
  border: 1px solid var(--rule);
  background: transparent;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  transition: border-color .14s, background .14s, color .14s;
}
.chip:hover { border-color: var(--ink-3); }
.chip[aria-pressed="true"] { background: var(--seal); border-color: var(--seal); color: #fdf7f3; }

.sets { list-style: none; margin: 0; padding: 0 2px; }
.sets li { display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: var(--radius); }
.sets li:hover { background: var(--paper-sunk); }
.sets__name {
  flex: 1;
  border: 0; background: none;
  text-align: left;
  font-size: 12.5px;
  color: var(--ink-2);
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sets li:hover .sets__name { color: var(--ink); }
.sets__act {
  border: 0; background: none; padding: 4px 6px;
  color: var(--ink-3); font-size: 11.5px;
  transition: color .14s;
}
.sets__act:hover { color: var(--seal); }

.side__foot { margin-top: 26px; padding: 0 6px; font-size: 11px; color: var(--ink-3); line-height: 1.6; }

/* ---------------- 一覧 ---------------- */

.list { display: flex; flex-direction: column; min-height: 0; flex: 1; }

.list__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 8px;
}
.list__head select {
  margin-left: auto;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius);
  font-size: 12.5px;
  color: var(--ink-3);
  padding: 4px;
}

.list__scroll { padding: 0 12px calc(28px + var(--safe-b)); flex: 1; }

.card {
  position: relative;
  width: 100%;
  display: block;
  text-align: left;
  padding: 14px 15px 13px 17px;
  margin-bottom: 9px;
  background: var(--paper-card);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: border-color .15s, transform .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.card--enter { animation: rise .32s cubic-bezier(.2, .7, .3, 1) backwards; }
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 2px;
  border-radius: 2px;
  background: var(--rule);
}
.card--draft::before     { background: var(--ink-3); }
.card--ready::before     { background: var(--moss); }
.card--scheduled::before { background: var(--gold); }
.card--posted::before    { background: var(--indigo); }
.card:active { transform: scale(.995); }
.card[aria-selected="true"] { border-color: var(--seal); box-shadow: var(--shadow-card), 0 0 0 1px var(--seal); }

.card__title {
  font-family: var(--mincho);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.45;
  margin: 0 0 3px;
  color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__title--untitled { color: var(--ink-3); font-weight: 400; }
.card__body {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  column-gap: 7px;
  row-gap: 2px;
  margin-top: 9px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
}
.card__meta > span { white-space: nowrap; }
.card__meta .sep { color: var(--rule); }
.card__when { color: var(--gold); }
.card__tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.card__tag {
  font-size: 10.5px;
  color: var(--ink-3);
  border: 1px solid var(--rule-soft);
  border-radius: 999px;
  padding: 1px 8px;
  line-height: 1.7;
}

.empty { padding: 54px 24px; text-align: center; color: var(--ink-3); }
.empty__mark {
  font-family: var(--mincho);
  font-size: 30px;
  color: var(--rule);
  display: block;
  margin-bottom: 10px;
}
.empty__lead { font-family: var(--mincho); font-size: 15px; color: var(--ink-2); margin-bottom: 6px; }
.empty__note { font-size: 12px; line-height: 1.7; max-width: 30em; margin: 0 auto; }
.empty .btn { margin-top: 16px; }

/* ---------------- エディタ ---------------- */

/* 狭い画面では一覧の上に全面で重ねる */
.edit {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .26s cubic-bezier(.3, .8, .3, 1), visibility .26s;
  padding-left: var(--safe-l);
  padding-right: var(--safe-r);
}
body.editing .edit { transform: none; visibility: visible; }
body.editing { overflow: hidden; }

.edit__head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  padding-top: calc(6px + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--rule-soft);
  background: var(--paper);
}
.edit__saved {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  color: var(--ink-3);
  opacity: 0;
  transition: opacity .3s;
}
.edit__saved.on { opacity: 1; }
.edit__spacer { flex: 1; }

.edit__scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 14px 28px;
}
.edit__inner { max-width: 720px; margin: 0 auto; }

.edit__bar {
  padding: 10px 14px calc(10px + var(--safe-b));
  border-top: 1px solid var(--rule-soft);
  background: var(--paper);
}

.field { margin-bottom: 18px; }
.field__label {
  display: block;
  margin-bottom: 5px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.input, .textarea {
  width: 100%;
  background: var(--paper-card);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: 11px 12px;
  font-size: 16px;              /* iOS の自動ズーム対策 */
  transition: border-color .15s;
  -webkit-appearance: none;
}
select.input { padding-right: 30px; }
.input:focus, .textarea:focus { outline: none; border-color: var(--ink-3); }
.textarea { resize: vertical; line-height: 1.85; }

.title-input {
  font-family: var(--mincho);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.5;
  padding: 4px 0;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--rule-soft);
  background: transparent;
}
.title-input:focus { outline: none; border-bottom-color: var(--ink-3); }
.title-input::placeholder { color: var(--rule); }

.row { display: grid; grid-template-columns: 1fr; gap: 12px; }

.body-input { min-height: 220px; background: var(--paper-card); }
.hash-input { min-height: 92px; font-family: var(--mono); font-size: 15px; line-height: 1.8; }

/* 計器 */
.gauges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: flex-end;
  padding: 12px 0 2px;
  border-top: 1px solid var(--rule-soft);
  margin-top: -4px;
}
.gauge { flex: 1 1 132px; }
.gauge__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.gauge__num { color: var(--ink-2); font-size: 11.5px; }
.gauge__bar { height: 3px; background: var(--paper-sunk); border-radius: 2px; overflow: hidden; }
.gauge__fill {
  height: 100%;
  width: 0;
  background: var(--moss);
  transition: width .3s cubic-bezier(.2, .7, .3, 1), background .3s;
}
.gauge--warn .gauge__fill { background: var(--gold); }
.gauge--over .gauge__fill { background: var(--seal); }
.gauge--warn .gauge__num { color: var(--gold); }
.gauge--over .gauge__num { color: var(--seal); font-weight: 700; }

/* セット差し込み */
.insert { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.insert__btn {
  border: 1px dashed var(--rule);
  background: transparent;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  color: var(--ink-3);
  transition: all .14s;
}
.insert__btn:hover { border-style: solid; border-color: var(--seal); color: var(--seal); }

/* プレビュー */
.preview {
  margin-top: 24px;
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  background: var(--paper-card);
  overflow: hidden;
}
.preview__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--rule-soft);
  background: color-mix(in srgb, var(--paper-card) 80%, var(--paper-sunk));
}
.preview__body {
  padding: 14px 16px 18px;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}
.preview__fold {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
}
.preview__fold::before, .preview__fold::after {
  content: "";
  height: 1px;
  flex: 1;
  background: repeating-linear-gradient(90deg, var(--rule) 0 4px, transparent 4px 8px);
}
.preview__tail { color: var(--ink-3); }
.preview__hash { color: var(--indigo); }

/* 何も選んでいないとき（広い画面のみ意味を持つ） */
.blank {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--ink-3);
  text-align: center;
  padding: 40px;
}
.blank__seal {
  width: 74px; height: 74px;
  display: grid; place-items: center;
  border: 2px solid var(--seal-soft);
  border-radius: 6px;
  color: var(--seal);
  font-family: var(--mincho);
  font-size: 26px;
  font-weight: 900;
  line-height: 1.1;
  opacity: .85;
  transform: rotate(-4deg);
}
.blank__lead { font-family: var(--mincho); font-size: 15px; color: var(--ink-2); }

/* ---------------- トースト・モーダル ---------------- */

.toast {
  position: fixed;
  left: 50%; bottom: calc(24px + var(--safe-b));
  transform: translate(-50%, 12px);
  max-width: calc(100vw - 32px);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  letter-spacing: .04em;
  text-align: center;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 200;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.modal {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 34%, transparent);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 150;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes sheet { from { transform: translateY(16px) } to { transform: none } }
.modal__box {
  width: 100%;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: 12px 12px 0 0;
  box-shadow: var(--shadow-pop);
  padding: 20px 18px calc(18px + var(--safe-b));
  animation: sheet .22s cubic-bezier(.2, .7, .3, 1);
}
.modal__title { font-family: var(--mincho); font-size: 17px; font-weight: 700; margin: 0 0 14px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal__foot .btn { padding: 11px 18px; }
/* 触れば消えるので、確認シートの破壊的な選択肢は最初から朱で示す */
.modal__foot .btn--danger { color: var(--seal); border-color: var(--seal); }

.menu { list-style: none; margin: 0; padding: 0; }
.menu li + li { border-top: 1px solid var(--rule-soft); }
.menu button {
  width: 100%;
  border: 0; background: none;
  text-align: left;
  padding: 13px 4px;
  font-size: 14.5px;
  color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}
.menu .menu__note { margin-left: auto; font-size: 12px; color: var(--ink-3); }

/* ---------------- 広い画面 ---------------- */

@media (min-width: 861px) {
  .only-wide { display: initial; }
  .only-narrow { display: none !important; }

  body { font-size: 14px; }

  .app {
    display: grid;
    grid-template-columns: var(--sidebar-w) var(--list-w) 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "head head head"
      "side list edit";
    height: 100vh;
    min-height: 0;
  }

  .head { grid-area: head; height: 62px; padding: 0 20px 0 22px; gap: 20px; flex-wrap: nowrap; }
  .brand__mark { font-size: 26px; }
  .brand { margin-right: 0; }
  .brand__sub {
    display: inline;
    font-family: var(--mincho);
    font-size: 12px;
    letter-spacing: .22em;
    color: var(--ink-3);
    white-space: nowrap;
  }
  .search { order: 0; flex: 1; max-width: 420px; margin-left: auto; }
  .search input { font-size: 13px; padding: 8px 12px 8px 34px; }
  .search__kbd {
    display: block;
    position: absolute;
    right: 9px; top: 50%;
    transform: translateY(-50%);
    font-family: var(--mono);
    font-size: 10px;
    color: var(--ink-3);
    border: 1px solid var(--rule);
    border-radius: 2px;
    padding: 1px 5px;
    pointer-events: none;
  }
  .head__tools { gap: 8px; }
  .btn { padding: 6px 12px; font-size: 12.5px; }

  .side {
    grid-area: side;
    display: block;
    border-right: 1px solid var(--rule);
    padding: 18px 14px 24px;
    overflow-y: auto;
    background: linear-gradient(180deg, var(--paper) 0%, color-mix(in srgb, var(--paper) 92%, var(--paper-sunk)) 100%);
  }
  .side__group + .side__group { margin-top: 26px; }
  .side__title { display: flex; align-items: center; justify-content: space-between; margin: 0 6px 8px; }
  .sets__act { opacity: 0; }
  .sets li:hover .sets__act { opacity: 1; }
  .chip { padding: 2px 10px; font-size: 11.5px; }

  .list {
    grid-area: list;
    border-right: 1px solid var(--rule);
    background: color-mix(in srgb, var(--paper) 94%, var(--paper-sunk));
  }
  .list__head { padding: 12px 16px 10px; border-bottom: 1px solid var(--rule-soft); }
  .list__head select { font-size: 11.5px; }
  .list__head select:hover { border-color: var(--rule); color: var(--ink-2); }
  .list__scroll { overflow-y: auto; padding: 10px 12px 40px; }
  .card__title { font-size: 14.5px; }
  .card__body { font-size: 12.5px; }

  .edit {
    grid-area: edit;
    position: static;
    transform: none;
    visibility: visible;
    z-index: auto;
    min-height: 0;
  }
  body.editing { overflow: visible; }
  .edit__head { padding: 12px 22px; }
  .edit__scroll { padding: 22px 26px 80px; }
  .input, .textarea { font-size: 14px; padding: 9px 12px; }
  .hash-input { font-size: 12.5px; }
  .title-input { font-size: 22px; border-bottom-color: transparent; }
  .title-input:focus { border-bottom-color: var(--rule); }
  .row { grid-template-columns: repeat(3, 1fr); }
  .row--2 { grid-template-columns: 1fr 1fr; }
  .body-input {
    min-height: 260px;
    background:
      linear-gradient(var(--paper-card) 0 0) padding-box,
      repeating-linear-gradient(180deg, transparent 0 25px, var(--rule-soft) 25px 25.5px) padding-box;
    background-position: 0 12px;
  }
  :root[data-theme="dark"] .body-input { background: var(--paper-card); }
  .preview__body { font-size: 13.5px; }

  .modal { align-items: center; padding: 24px; }
  .modal__box { width: min(480px, 100%); border-radius: var(--radius); padding: 22px 24px 20px; }
}

/* 動きを減らす設定を尊重する */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
