/* 125naroom たんなるメモ（2026-11-12）。デザイン：reference/design_handoff_125naroom_memo_kaimono */
:root {
  --bg: #faf8f3; --ink: #2b2a27; --sub: #77736a; --line: #e8e3d8; --soft: #f3efe6; --y: #e8dc6a; --bubble: #e8e3d8; --face: #ffffff;
  --fs: 16px; --lh: 36px; --pt: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #2b2a27; --ink: #f3efe6; --sub: #a9a397; --line: #45433e; --soft: #34322f; --bubble: #45433e; --face: #f3efe6; color-scheme: dark; }
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: "Zen Kaku Gothic New", sans-serif; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
p, h1 { margin: 0; }
[hidden] { display: none !important; }
svg { display: block; }
:focus { outline: none; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

/* 高さは JS が入れる（キーボードが出たら見えている高さに合わせる） */
.app { height: var(--vh, 100svh); max-width: 760px; margin: 0 auto; display: flex; flex-direction: column;
  padding: max(44px, calc(env(safe-area-inset-top, 0px) + 12px)) 24px max(22px, env(safe-area-inset-bottom, 0px)); }
.app.is-kb { padding-bottom: 6px; }
.app.is-big { --fs: 19px; --lh: 40px; }
.head { height: 44px; display: flex; align-items: center; justify-content: space-between; flex: none; }
.head h1 { font-size: 20px; font-weight: 500; letter-spacing: .08em; }
.sheets { display: flex; align-items: center; gap: 2px; margin-right: -10px; }
.sheets button { width: 32px; height: 44px; display: flex; align-items: center; justify-content: center; }
.sheets i { width: 12px; height: 12px; border-radius: 50%; border: 1.25px solid var(--line); display: block; transition: background 160ms, border-color 160ms; }
.sheets .has i { border-color: var(--ink); }
.sheets [aria-selected="true"] i { background: var(--ink); border-color: var(--ink); }

/* 便せん：行の高さごとに 1px の罫線、文字といっしょに動く */
.paper { margin-top: 16px; flex: 1; min-height: 0; position: relative; border-top: 1px solid var(--line); }
.paper textarea { display: block; width: 100%; height: 100%; margin: 0; resize: none; border: 0; outline: none; background-color: transparent; color: var(--ink); caret-color: var(--ink);
  font-family: "Zen Kaku Gothic New", sans-serif; font-size: var(--fs); line-height: var(--lh); letter-spacing: .04em; padding: var(--pt) 2px 0;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--lh) - 1px), var(--line) calc(var(--lh) - 1px), var(--line) var(--lh));
  background-position: 0 var(--pt); background-attachment: local; -webkit-overflow-scrolling: touch; }
.empty { position: absolute; inset: 0; pointer-events: none; }
.empty .first { position: absolute; left: 2px; top: var(--pt); font-size: var(--fs); line-height: var(--lh); letter-spacing: .04em; color: var(--sub); }
.say { position: absolute; left: 0; right: 0; bottom: 24px; display: flex; flex-direction: row-reverse; align-items: flex-start; gap: 10px; }
.say img { width: 34px; height: 34px; border-radius: 50%; flex: none; background: var(--face); }
.say p { padding: 9px 14px; background: var(--bubble); border-radius: 18px 4px 18px 18px; font-size: 13px; line-height: 1.8; letter-spacing: .05em; max-width: 78%; text-wrap: pretty; }
.is-kb .say { display: none; }

/* 字数と保存 */
.status { flex: none; height: 40px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); }
.count { font-family: "Jost", sans-serif; font-size: 12px; letter-spacing: .06em; color: var(--sub); font-variant-numeric: tabular-nums; }
.count small { font-family: "Zen Kaku Gothic New", sans-serif; font-size: 11px; margin-left: 3px; }
.saved { display: flex; align-items: center; gap: 7px; font-size: 11px; letter-spacing: .06em; color: var(--sub); }
.saved i { width: 8px; height: 8px; border-radius: 50%; border: 1.25px solid var(--line); background: var(--line); display: block; transition: background 300ms ease, border-color 300ms ease; }
.saved.dirty i { background: transparent; border-color: var(--sub); }
.saved.flash i { background: var(--y); border-color: var(--y); }

/* ボタン */
.actions { flex: none; margin-top: 6px; min-height: 44px; }
.is-kb .actions, .is-kb .foot { display: none; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; }
.left { display: flex; gap: 8px; }
.pill { height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; letter-spacing: .08em; display: flex; align-items: center; gap: 6px; transition: background 160ms, color 160ms; }
#copy { border-color: var(--ink); }
#copy svg { display: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
#copy.is-done { background: var(--ink); color: var(--bg); }
#copy.is-done svg { display: block; }
.pill:disabled { border-color: var(--line) !important; color: var(--sub); cursor: default; }
.pill.ink { background: var(--ink); color: var(--bg); border-color: var(--ink); padding: 0 18px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { height: 32px; min-width: 40px; padding: 0 10px; border-radius: 999px; font-size: 12px; }
.seg button + button { font-size: 16px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.pill { white-space: nowrap; flex: none; }
.confirm .q { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 1.5; letter-spacing: .04em; }
.confirm .q svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.25; }
.confirm .q svg .c { fill: currentColor; stroke: none; }
@media (hover: hover) and (pointer: fine) { .pill:not(:disabled):not(.ink):not(.is-done):hover, .seg button:not([aria-pressed="true"]):hover { background: var(--soft); } }

.foot { padding-top: 16px; display: flex; justify-content: space-between; align-items: center; flex: none; }
.foot .note { font-size: 10px; letter-spacing: .06em; color: var(--sub); }
.logo img { display: block; height: 13px; width: auto; }
.logo-dark { display: none !important; }
@media (prefers-color-scheme: dark) { .logo-light { display: none !important; } .logo-dark { display: block !important; } }

/* PC */
@media (min-width: 1024px) {
  :root { --fs: 17px; --lh: 40px; --pt: 10px; }
  .app.is-big { --fs: 22px; --lh: 46px; }
  .app { padding: 40px 56px 28px; }
  .paper { margin-top: 24px; }
}
