:root {
  color-scheme: light;
  --bg: #f5f3ed;
  --paper: #fcfbf8;
  --paper-raised: #ffffff;
  --ink: #182635;
  --ink-soft: #53616d;
  --faint: #87919a;
  --line: #d4d6d0;
  --line-strong: #9ca9ae;
  --accent: #ab1f5a;
  --accent-soft: #f2dbe5;
  --accent-ink: #76133c;
  --navy: #0f354c;
  --shadow: 0 18px 42px rgba(30, 46, 52, .08);
  --shadow-strong: 0 24px 68px rgba(30, 46, 52, .16);
  --memo-font-size: 16px;
  --radius: 16px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #06121f;
  --paper: #0b1b2a;
  --paper-raised: #102438;
  --ink: #edf4f6;
  --ink-soft: #a9bbc6;
  --faint: #728895;
  --line: #294354;
  --line-strong: #547082;
  --accent: #db3e84;
  --accent-soft: rgba(219, 62, 132, .17);
  --accent-ink: #ff95c1;
  --navy: #a9d8ee;
  --shadow: 0 18px 42px rgba(0, 0, 0, .24);
  --shadow-strong: 0 24px 68px rgba(0, 0, 0, .42);
}

* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% -8%, rgba(87, 143, 168, .10), transparent 29rem),
    radial-gradient(circle at 95% 3%, rgba(172, 31, 90, .06), transparent 27rem),
    var(--bg);
  color: var(--ink);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", Georgia, serif;
  line-height: 1.72;
  transition: background .2s ease, color .2s ease;
}
button, input, textarea, select { min-width: 0; font: inherit; }
button { color: inherit; }
a { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: max(10px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: rgba(245, 243, 237, .88);
  backdrop-filter: blur(16px);
}
html[data-theme="dark"] .topbar { background: rgba(6, 18, 31, .88); }
.mobile-menu-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  padding: 9px;
  place-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  cursor: pointer;
}
.mobile-menu-button span { display: block; width: 17px; height: 1px; background: var(--ink); }
.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-width: 0;
  gap: 8px;
  color: var(--ink);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: clamp(18px, 2vw, 21px);
  font-weight: 700;
  letter-spacing: .09em;
  text-decoration: none;
  white-space: nowrap;
}
.infinity-mark { color: var(--accent); font-family: Arial, sans-serif; font-size: 1.55em; font-weight: 400; line-height: 1; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.top-action-btn, .theme-btn {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif;
  font-size: 12px;
  font-weight: 700;
}
.top-action-btn { padding: 6px 9px; }
.top-action-btn:hover, .theme-btn:hover { border-color: var(--line); background: var(--paper); color: var(--ink); }
.theme-btn { display: grid; width: 36px; padding: 0; place-items: center; border-color: var(--line); background: var(--paper); font-size: 16px; }

.app-shell { width: min(940px, calc(100% - 40px)); margin: 0 auto; padding: 38px 0 88px; }
.app-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 310px);
  align-items: end;
  gap: 42px;
  margin: 0 0 30px;
  padding: 0 5px;
}
.eyebrow, .composer-kicker, .stream-heading, .dialog-title-row p {
  margin: 0;
  color: var(--accent);
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
}
.app-intro h1 { margin: 4px 0 0; font-size: clamp(29px, 4.2vw, 48px); font-weight: 500; letter-spacing: .08em; line-height: 1.33; }
.app-intro > p { margin: 0 0 4px; color: var(--ink-soft); font-size: 13px; line-height: 2; }

.composer, .memo-card, .settings-section, .support-history article, .help-steps section, .trash-item {
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.composer { overflow: hidden; border-radius: var(--radius); }
.composer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px 8px;
}
.char-count { color: var(--faint); font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 11px; font-variant-numeric: tabular-nums; }
.toolbar {
  display: flex;
  gap: 2px;
  min-width: 0;
  padding: 7px 11px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 82%, var(--bg));
  scrollbar-width: thin;
}
.toolbar button {
  flex: 0 0 auto;
  min-width: 32px;
  height: 30px;
  padding: 0 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif;
  font-size: 12px;
}
.toolbar button:hover { background: var(--accent-soft); color: var(--accent-ink); }
.toolbar .paste-btn { margin-left: 3px; padding: 0 10px; border: 1px solid var(--line); }
#memoInput {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 172px;
  padding: 20px 20px 16px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  font-size: var(--memo-font-size);
  line-height: 1.95;
  overflow-wrap: anywhere;
}
#memoInput::placeholder, .search::placeholder { color: var(--faint); }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 16px 15px 20px; border-top: 1px solid var(--line); }
.save-hint { color: var(--faint); font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 11px; }
kbd { padding: 1px 4px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper-raised); color: var(--ink-soft); font-family: inherit; font-size: 10px; }
.primary-btn, .dialog-submit {
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}
.primary-btn { min-height: 39px; padding: 8px 17px; }
.primary-btn:hover, .dialog-submit:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary-btn:disabled { cursor: default; opacity: .42; transform: none; }

.list-toolbar { display: flex; align-items: center; gap: 10px; margin: 34px 0 12px; }
.search-wrap { display: flex; flex: 1 1 320px; align-items: center; gap: 8px; min-width: 0; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--faint); }
.search-wrap:focus-within { border-color: var(--line-strong); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-wrap > span { font-family: Arial, sans-serif; font-size: 23px; line-height: 1; }
.search { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 13px; }
.sort-wrap { display: flex; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink-soft); font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 11px; font-weight: 700; white-space: nowrap; }
.sort { min-width: 90px; height: 40px; border: 0; outline: 0; background: transparent; color: var(--ink); cursor: pointer; font: inherit; }
.stream-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 4px 9px; color: var(--ink-soft); }
.stream-heading span:first-child { letter-spacing: .15em; }
.stream-heading span:last-child { color: var(--faint); font-size: 10px; letter-spacing: .04em; }
.memo-list { display: grid; gap: 12px; min-width: 0; }
.memo-card { min-width: 0; max-width: 100%; padding: 16px 18px 11px; border-radius: 13px; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.memo-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-strong); transform: translateY(-1px); }
.memo-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; margin-bottom: 10px; color: var(--faint); font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 11px; font-variant-numeric: tabular-nums; }
.memo-meta span { min-width: 0; overflow-wrap: anywhere; }
.memo-content, .memo-content * { min-width: 0; max-width: 100%; }
.memo-content {
  width: 100%;
  color: var(--ink);
  font-size: var(--memo-font-size);
  line-height: 1.9;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.memo-content > :first-child { margin-top: 0; }
.memo-content > :last-child { margin-bottom: 0; }
.memo-content p, .memo-content li, .memo-content h1, .memo-content h2, .memo-content h3, .memo-content blockquote, .memo-content code, .task-line span {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.memo-content p { margin: .58em 0; }
.memo-content h1, .memo-content h2, .memo-content h3 { margin: .9em 0 .34em; color: var(--ink); line-height: 1.45; letter-spacing: .04em; }
.memo-content h1 { font-size: 1.34em; }
.memo-content h2 { font-size: 1.20em; }
.memo-content h3 { font-size: 1.08em; }
.memo-content blockquote { margin: .9em 0; padding: .1em 0 .1em 13px; border-left: 2px solid var(--accent); color: var(--ink-soft); }
.memo-content code { padding: 2px 5px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-ink); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; white-space: normal; }
.memo-content pre { width: 100%; margin: .9em 0; padding: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: color-mix(in srgb, var(--paper) 68%, var(--bg)); white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.memo-content pre code { padding: 0; background: transparent; color: var(--ink); white-space: pre-wrap; }
.memo-content ul, .memo-content ol { padding-left: 1.45em; }
.memo-content li { padding-left: .15em; }
.task-line { display: flex; align-items: flex-start; gap: 8px; width: 100%; min-width: 0; margin: 6px 0; }
.task-line input { flex: 0 0 auto; margin-top: .48em; accent-color: var(--accent); }
.task-line span { flex: 1 1 auto; width: 0; }
.task-line.done span { color: var(--faint); text-decoration: line-through; }
.memo-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; min-width: 0; margin-top: 13px; padding-top: 8px; border-top: 1px solid var(--line); }
.memo-actions button { flex: 0 1 auto; min-height: 31px; padding: 5px 9px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-soft); cursor: pointer; font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 11px; font-weight: 700; }
.memo-actions button:hover { background: var(--accent-soft); color: var(--accent-ink); }
.memo-actions .danger { color: #b53b50; }
html[data-theme="dark"] .memo-actions .danger { color: #ff8ca0; }
.empty-state { padding: 64px 16px; color: var(--faint); text-align: center; font-size: 14px; }

.pom-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 90;
  display: flex;
  width: min(326px, 88vw);
  min-width: 0;
  flex-direction: column;
  overflow-y: auto;
  padding: max(23px, env(safe-area-inset-top)) 17px max(18px, env(safe-area-inset-bottom));
  border-right: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 18px 0 56px rgba(0, 0, 0, .18);
  transform: translateX(-105%);
  transition: transform .22s ease;
}
body.mobile-nav-open .pom-sidebar { transform: translateX(0); }
body.mobile-nav-open { overflow: hidden; }
.menu-scrim { position: fixed; inset: 0; z-index: 80; opacity: 0; visibility: hidden; background: rgba(1, 9, 16, .43); transition: opacity .2s ease, visibility .2s ease; }
body.mobile-nav-open .menu-scrim { opacity: 1; visibility: visible; }
.pom-sidebar-heading { display: flex; align-items: flex-start; gap: 8px; }
.pom-sidebar-brand { display: inline-flex; align-items: center; min-width: 0; gap: 9px; color: var(--ink); text-decoration: none; }
.pom-sidebar-brand strong, .pom-sidebar-brand small { display: block; }
.pom-sidebar-brand strong { font-size: 17px; letter-spacing: .08em; }
.pom-sidebar-brand small { margin-top: 1px; color: var(--faint); font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 8px; letter-spacing: .16em; }
.sidebar-close, .tools-close { display: grid; flex: 0 0 auto; width: 34px; height: 34px; margin-left: auto; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--paper-raised); color: var(--ink); cursor: pointer; font-family: Arial, sans-serif; font-size: 19px; }
.sidebar-intro { margin: 24px 4px 18px; color: var(--ink-soft); font-size: 12px; line-height: 1.8; }
.pom-sidebar-list { display: grid; gap: 5px; }
.pom-sidebar-list > a, .pom-sidebar-list > div { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 55px; padding: 8px 9px; border: 1px solid transparent; border-radius: 11px; color: var(--ink); text-decoration: none; }
.pom-sidebar-list > a:hover { border-color: var(--line); background: var(--paper-raised); }
.pom-sidebar-list > .is-current { border-color: var(--accent); background: var(--accent-soft); }
.pom-sidebar-list > a > i, .pom-sidebar-list > div > i { display: block; width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: var(--tool-color); }
.pom-sidebar-list > a > span, .pom-sidebar-list > div > span { min-width: 0; flex: 1; }
.pom-sidebar-list b, .pom-sidebar-list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pom-sidebar-list b { font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 12px; }
.pom-sidebar-list small { margin-top: 2px; color: var(--faint); font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 9px; }
.pom-sidebar-list em { color: var(--accent-ink); font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 9px; font-style: normal; font-weight: 800; white-space: nowrap; }
.pom-sidebar-support { display: grid; gap: 6px; margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line); }
.pom-sidebar-support p { margin: 0 0 3px; color: var(--faint); font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.pom-sidebar-support button { min-height: 35px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink-soft); cursor: pointer; text-align: left; font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 11px; font-weight: 700; }
.pom-sidebar-support button:hover { background: var(--paper-raised); color: var(--ink); }

.settings-dialog, .support-dialog, .help-dialog, .trash-dialog {
  width: min(560px, calc(100% - 28px));
  max-width: calc(100% - 28px);
  max-height: min(780px, calc(100dvh - 28px));
  padding: 22px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
  color: var(--ink);
  box-shadow: var(--shadow-strong);
}
.settings-dialog::backdrop, .support-dialog::backdrop, .help-dialog::backdrop, .trash-dialog::backdrop { background: rgba(2, 12, 19, .54); backdrop-filter: blur(3px); }
.dialog-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; min-width: 0; }
.dialog-title-row > div { min-width: 0; }
.dialog-title-row h2 { margin: 3px 0; color: var(--ink); font-size: 23px; font-weight: 500; letter-spacing: .06em; line-height: 1.35; }
.dialog-title-row span { display: block; color: var(--ink-soft); font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 12px; line-height: 1.7; }
.settings-section { display: grid; gap: 12px; margin-top: 18px; padding: 15px; border-radius: 12px; box-shadow: none; }
.setting-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; }
.setting-heading strong { min-width: 0; font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 13px; }
.setting-heading span { color: var(--faint); font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 10px; text-align: right; }
#fontSizeValue { min-width: 32px; padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); text-align: center; font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 11px; font-variant-numeric: tabular-nums; }
.font-size-options { display: flex; align-items: center; gap: 8px; min-width: 0; }
.font-size-options button { display: grid; width: 32px; height: 32px; flex: 0 0 auto; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--paper-raised); color: var(--ink); cursor: pointer; font-size: 17px; }
.font-size-options button:disabled { cursor: default; opacity: .38; }
#fontSizeRange { min-width: 0; width: 100%; accent-color: var(--accent); }
.data-tool-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.data-tool-actions button { flex: 1 1 120px; min-height: 36px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-raised); color: var(--ink); cursor: pointer; font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 12px; font-weight: 700; }
.data-tool-actions button:hover { border-color: var(--accent); color: var(--accent-ink); }
.support-history { display: grid; gap: 10px; margin-top: 20px; }
.support-history article { padding: 14px; border-radius: 12px; box-shadow: none; }
.support-history b { color: var(--accent); font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 10px; }
.support-history h3 { margin: 4px 0; font-size: 14px; }
.support-history p { margin: 0; color: var(--ink-soft); font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 12px; line-height: 1.75; }
.support-label { display: grid; gap: 6px; margin-top: 16px; color: var(--ink-soft); font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 12px; font-weight: 700; }
.support-label select, .support-label textarea { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: var(--paper); color: var(--ink); padding: 9px 10px; font: inherit; }
.support-label textarea { min-height: 130px; resize: vertical; overflow-wrap: anywhere; }
.support-state { min-height: 20px; margin: 10px 0 0; color: var(--ink-soft); font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 12px; }
.dialog-submit { width: 100%; min-height: 42px; margin-top: 12px; padding: 9px 14px; }
.help-steps { display: grid; gap: 10px; margin-top: 18px; }
.help-steps section { display: flex; gap: 12px; min-width: 0; padding: 13px; border-radius: 12px; box-shadow: none; }
.help-steps section > b { display: grid; width: 27px; height: 27px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 11px; }
.help-steps h3 { margin: 1px 0 3px; font-size: 14px; }
.help-steps p { margin: 0; color: var(--ink-soft); font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 11px; line-height: 1.75; }
.help-note { margin: 12px 0 0; padding: 11px 12px; border-left: 2px solid var(--accent); background: var(--accent-soft); color: var(--ink-soft); font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 11px; line-height: 1.7; }
.trash-list { display: grid; gap: 10px; margin-top: 18px; }
.trash-item { min-width: 0; padding: 13px; border-radius: 11px; box-shadow: none; }
.trash-preview { max-width: 100%; max-height: 7em; overflow: hidden; color: var(--ink); font-size: var(--memo-font-size); white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.trash-meta { margin-top: 6px; color: var(--faint); font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 11px; }
.trash-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; margin-top: 10px; }
.trash-actions button { min-height: 32px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper-raised); color: var(--ink-soft); cursor: pointer; font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 11px; }
.trash-actions .danger { color: #b53b50; }

@media (max-width: 680px) {
  .topbar { grid-template-columns: 38px minmax(0, 1fr) auto; min-height: 57px; gap: 8px; padding-right: 11px; padding-left: 11px; }
  .mobile-menu-button { width: 36px; height: 36px; }
  .brand { justify-self: center; font-size: 17px; }
  .top-actions { gap: 1px; }
  .top-action-btn { min-width: 34px; padding: 6px 5px; font-size: 0; }
  .top-action-btn::before { display: block; font-size: 16px; }
  #helpBtn::before { content: "?"; font-family: Arial, sans-serif; font-weight: 800; }
  #trashBtn::before { content: "⌫"; }
  .theme-btn { width: 34px; height: 34px; }
  .app-shell { width: min(100% - 20px, 940px); padding-top: 25px; }
  .app-intro { grid-template-columns: 1fr; gap: 8px; margin-bottom: 23px; padding: 0 2px; }
  .app-intro h1 { font-size: 29px; }
  .app-intro > p { font-size: 12px; line-height: 1.85; }
  .composer-heading { padding-right: 14px; padding-left: 14px; }
  #memoInput { min-height: 154px; padding: 16px 14px; }
  .composer-footer { padding: 9px 12px 12px 14px; }
  .save-hint { font-size: 10px; }
  .primary-btn { padding: 8px 13px; }
  .list-toolbar { flex-wrap: wrap; margin-top: 26px; }
  .search-wrap { flex-basis: 100%; }
  .sort-wrap { flex: 1 1 100%; justify-content: space-between; }
  .sort { flex: 0 1 150px; }
  .memo-card { padding: 14px 13px 10px; }
  .memo-meta { font-size: 10px; }
  .memo-actions { justify-content: flex-start; }
  .memo-actions button { flex: 1 1 23%; padding-right: 6px; padding-left: 6px; }
  .settings-dialog, .support-dialog, .help-dialog, .trash-dialog { width: min(100% - 18px, 560px); max-width: calc(100% - 18px); max-height: calc(100dvh - 18px); padding: 17px; border-radius: 14px; }
  .dialog-title-row h2 { font-size: 20px; }
  .setting-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .setting-heading span { text-align: left; }
}

@media (max-width: 360px) {
  .brand { font-size: 15px; letter-spacing: .05em; }
  .infinity-mark { font-size: 1.4em; }
  .toolbar { padding-right: 7px; padding-left: 7px; }
  .toolbar button { min-width: 30px; padding: 0 6px; }
  .composer-footer { gap: 8px; }
  .save-hint { display: none; }
  .primary-btn { width: 100%; }
  .memo-actions button { flex-basis: 45%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Reference board layout: PC / mobile / component showcase */
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; opacity: .24; background-image: linear-gradient(90deg, transparent 0 49%, rgba(124, 148, 160, .08) 50%, transparent 51%), linear-gradient(0deg, transparent 0 49%, rgba(124, 148, 160, .06) 50%, transparent 51%); background-size: 48px 48px; mask-image: linear-gradient(to bottom, black, transparent 70%); }
.topbar { min-height: 62px; }
.app-shell { width: min(1000px, calc(100% - 270px)); margin: 0 24px 0 220px; padding: 42px 0 88px; }
.app-intro { grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); align-items: start; margin-bottom: 30px; padding: 0 13px; }
.app-intro h1 { font-size: clamp(34px, 4.4vw, 58px); letter-spacing: .15em; }
.app-intro > p { max-width: 390px; padding-top: 12px; font-size: 13px; line-height: 2.25; }
.composer { border-radius: 11px; border-color: var(--line-strong); box-shadow: 0 12px 28px rgba(20, 44, 58, .08); }
.composer-heading { padding: 11px 18px 6px; }
.composer-kicker { color: var(--ink-soft); letter-spacing: .13em; }
.toolbar { justify-content: flex-end; border-bottom: 0; background: transparent; }
#memoInput { min-height: 146px; padding: 19px 20px 13px; border: 1px solid var(--line-strong); border-radius: 9px; margin: 0 12px; width: calc(100% - 24px); }
.composer-footer { border-top: 0; padding-top: 7px; }
.list-toolbar { margin-top: 19px; }
.search-wrap { height: 38px; border-radius: 7px; }
.sort-wrap { border: 0; background: transparent; }
.memo-stream { margin-top: 19px; }
.memo-card { padding: 14px 17px 10px; border-radius: 8px; box-shadow: none; background: color-mix(in srgb, var(--paper) 93%, var(--bg)); }
.memo-actions { border-top: 0; margin-top: 7px; padding-top: 0; }
.memo-content { line-height: 1.72; }
.pom-sidebar { width: 196px; padding: 25px 14px 18px; transform: translateX(0); border-right: 1px solid var(--line-strong); box-shadow: none; }
.pom-sidebar-heading { padding: 0 8px; }
.pom-sidebar-brand strong { font-size: 16px; }
.sidebar-close { display: none; }
.sidebar-intro { margin: 22px 8px 17px; font-size: 11px; }
.pom-sidebar-list > a, .pom-sidebar-list > div { min-height: 43px; padding: 6px 8px; border-radius: 8px; }
.pom-sidebar-list b { font-size: 11px; }
.pom-sidebar-list small { font-size: 8px; }
.pom-sidebar-support { padding: 18px 8px 0; }
.mobile-menu-button { display: none; }
.component-showcase { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, .75fr); gap: 20px; width: min(1000px, calc(100% - 270px)); margin: 0 24px 0 220px; padding: 0 0 90px; }
.showcase-panel { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 11px; background: color-mix(in srgb, var(--paper) 84%, var(--bg)); }
.showcase-title { margin: 0 0 15px; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: 22px; letter-spacing: .12em; }
.showcase-caption { margin: -8px 0 14px; color: var(--ink-soft); font-size: 11px; }
.showcase-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 18px; }
.showcase-label { width: 100%; color: var(--faint); font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 10px; letter-spacing: .1em; }
.showcase-btn, .showcase-chip, .showcase-tool { min-height: 32px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink-soft); font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; font-size: 11px; }
.showcase-btn.primary { border-color: #236083; background: #124466; color: #fff; }
.showcase-btn.danger { border-color: #9b234b; background: #84133e; color: #fff; }
.showcase-chip { border-color: var(--chip, var(--line)); color: var(--ink); }
.showcase-chip.blue { --chip: #28658d; background: color-mix(in srgb, #28658d 18%, var(--paper)); }
.showcase-chip.pink { --chip: #a82660; background: color-mix(in srgb, #a82660 18%, var(--paper)); }
.showcase-chip.gray { background: color-mix(in srgb, var(--line) 30%, var(--paper)); }
.showcase-toolbar { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; }
.showcase-toolbar span { min-width: 25px; padding: 3px 5px; color: var(--ink-soft); text-align: center; }
.experience-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.experience-list li { display: flex; gap: 8px; align-items: flex-start; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.experience-list li::before { content: '✓'; color: var(--accent); font-family: Arial, sans-serif; font-weight: 700; }
@media (max-width: 760px) {
  .topbar { margin-left: 0; }
  .app-shell, .component-showcase { width: calc(100% - 24px); margin-left: 12px; margin-right: 12px; }
  .app-shell { padding-top: 23px; }
  .app-intro { grid-template-columns: 1fr; gap: 9px; margin-bottom: 19px; padding: 0 5px; }
  .app-intro h1 { font-size: clamp(31px, 9vw, 45px); letter-spacing: .09em; }
  .app-intro > p { padding-top: 0; font-size: 12px; line-height: 1.8; }
  .component-showcase { grid-template-columns: 1fr; padding-bottom: 50px; }
  .pom-sidebar { transform: translateX(-105%); width: min(300px, 86vw); }
  body.mobile-nav-open .pom-sidebar { transform: translateX(0); }
  .mobile-menu-button { display: inline-grid; }
  .sidebar-close { display: grid; }
  #memoInput { min-height: 155px; margin: 0 9px; width: calc(100% - 18px); }
  .composer-footer { padding-left: 12px; padding-right: 12px; }
  .save-hint { display: none; }
  .list-toolbar { align-items: stretch; flex-direction: column; gap: 8px; }
  .sort-wrap { justify-content: space-between; padding: 0 4px; }
  .memo-card { padding: 13px 12px 9px; }
  .memo-meta { align-items: flex-start; }
  .memo-actions { justify-content: flex-start; }
  .memo-actions button { padding-left: 6px; padding-right: 6px; }
}
