@charset "UTF-8";

:root {
  color-scheme: light;
  --page: #f5f1eb;
  --page-bottom: #eeebe5;
  --card: #fffcf8;
  --ink: #332e30;
  --muted: #746b6e;
  --faint: #a19698;
  --line: #dfd7d2;
  --soft: #ebe5df;
  --accent: #765b69;
  --accent-ink: #fffaf7;
  --accent-soft: #e8d8dd;
  --sage: #617569;
  --sage-soft: #e5ebe2;
  --danger: #a34e4e;
  --danger-soft: #f7e8e4;
  --empty-paper: #ebe2db;
  --shadow: 0 8px 32px #4c363d06;
  --dialog-shadow: 0 24px 120px #251d3440;
  --radius: 20px;
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 15px;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #201e20; --page-bottom: #252225; --card: #2c282b;
    --ink: #f1e9e4; --muted: #bfb1b8; --faint: #9c8e94; --line: #4a4047;
    --soft: #393137; --accent: #d9b9c7; --accent-ink: #342630;
    --accent-soft: #51404a; --sage: #bed0bb; --sage-soft: #303b33;
    --danger: #f1b1ac; --danger-soft: #4b3134; --empty-paper: #453a40;
    --shadow: 0 8px 32px #0000000a;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #201e20; --page-bottom: #252225; --card: #2c282b;
  --ink: #f1e9e4; --muted: #bfb1b8; --faint: #9c8e94; --line: #4a4047;
  --soft: #393137; --accent: #d9b9c7; --accent-ink: #342630;
  --accent-soft: #51404a; --sage: #bed0bb; --sage-soft: #303b33;
  --danger: #f1b1ac; --danger-soft: #4b3134; --empty-paper: #453a40;
  --shadow: 0 8px 32px #0000000a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--page); scroll-behavior: smooth; scrollbar-gutter: stable; }
body { margin: 0; background: linear-gradient(180deg, var(--page), var(--page-bottom)); color: var(--ink); min-height: 100svh; line-height: 1.7; }
body.has-modal { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
button, a, input, textarea, select { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
button { transition: background-color .15s, transform .15s; }
button:active:not(:disabled) { transform: translateY(1px); }
input, textarea, select { min-width: 0; }
input, textarea { caret-color: var(--accent); }
textarea { resize: vertical; }
button svg, a svg { flex: 0 0 auto; }
h1, h2, h3, p { margin: 0; }
button, h1, h2, h3, p, span { overflow-wrap: anywhere; }
h1, h2, h3 { font-weight: 600; }
.icon-definitions { position: absolute; width: 0; height: 0; pointer-events: none; }
.icon { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.solid { fill: currentColor; stroke: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: -100px; left: 16px; padding: 12px; background: var(--card); color: var(--ink); }
.skip-link:focus { top: 8px; }
.app-header { max-width: 1240px; margin: auto; padding: 28px 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 15px; color: var(--accent); background: var(--card); }
.brand-mark .icon { width: 27px; height: 27px; stroke-width: 1.3; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.brand-title { display: block; font-weight: 600; font-size: 18px; letter-spacing: .08em; }
.brand-subtitle { display: block; font-size: 11px; color: var(--muted); letter-spacing: .12em; margin-top: 1px; }
.header-actions, .sheet-header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; min-width: 44px; padding: 0; border: 1px solid transparent; border-radius: 14px; color: var(--muted); background: transparent; }
.icon-button:hover { background: var(--soft); color: var(--ink); }
.icon-button.small { border-radius: 10px; }
.icon-button.selected { color: var(--accent); background: var(--accent-soft); }
.icon-button.selected .icon { fill: currentColor; stroke-width: 1; }
.app-main { max-width: 1240px; padding: 0 48px 24px; margin: auto; }
.cover { min-height: 334px; display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; padding: 44px 8px 54px; border-bottom: 1px solid var(--line); gap: 24px; overflow: hidden; }
.cover-copy { min-width: 0; }
.eyebrow, .section-kicker { font-size: 10px; letter-spacing: .18em; font-weight: 500; color: var(--muted); }
.eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.tiny-line { width: 24px; height: 1px; background: var(--accent); }
.cover h1 { font-size: clamp(28px, 3.7vw, 42px); line-height: 1.55; letter-spacing: .1em; }
.cover p { font-size: 13px; color: var(--muted); margin-top: 20px; line-height: 1.95; }
.cover-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 28px; }
.connection-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--sage); font-size: 11px; border: 1px solid var(--line); border-radius: 30px; padding: 5px 11px; background: var(--sage-soft); }
.connection-badge .icon { width: 15px; height: 15px; }
.cover-note { color: var(--muted); font-size: 10px; letter-spacing: .04em; }
.cover-art { position: relative; height: 280px; max-width: 380px; width: 100%; justify-self: center; color: var(--accent); }
.paper-note { position: absolute; width: 202px; height: 208px; top: 20px; right: 4px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); transform: rotate(7deg); box-shadow: 0 14px 28px #5f49400a; padding: 32px 24px; }
.paper-note span { font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: 12px; letter-spacing: .09em; }
.paper-note i { display: block; width: 100%; height: 1px; background: var(--line); margin-top: 17px; }
.paper-note i:nth-last-of-type(1) { width: 60%; }
.paper-note b { display: block; font-family: Georgia, serif; font-size: 13px; font-style: italic; font-weight: normal; text-align: right; margin-top: 13px; color: var(--faint); }
.paper-photo { position: absolute; width: 183px; height: 237px; top: 20px; left: 25px; background: #fffaf3; padding: 12px 12px 30px; transform: rotate(-9deg); border: 1px solid #d9cfc9; box-shadow: 0 16px 28px #5f494012; }
.paper-photo svg { display: block; width: 100%; height: 176px; object-fit: cover; }
.paper-photo span { display: block; text-align: center; color: #7b696b; font-family: "Yu Mincho", serif; font-size: 8px; margin-top: 13px; letter-spacing: .1em; }
.art-spark { position: absolute; font-size: 27px; font-weight: 300; color: var(--faint); }
.spark-one { left: 5px; bottom: 0; }.spark-two { right: 2px; top: -3px; font-size: 18px; }
.collection { padding: 36px 0 24px; }
.collection-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section-kicker { display: block; font-size: 9px; margin-bottom: 5px; }
.collection-top h2 { display: flex; align-items: center; gap: 10px; font-size: 21px; letter-spacing: .06em; }
.count-badge { display: inline-flex; min-width: 26px; justify-content: center; border: 1px solid var(--line); font-size: 11px; line-height: 24px; padding: 0 7px; border-radius: 20px; font-variant-numeric: tabular-nums; letter-spacing: 0; color: var(--muted); }
.button { min-height: 46px; border-radius: 14px; border: 1px solid transparent; padding: 10px 20px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 500; line-height: 1.6; text-decoration: none; }
.button.primary { color: var(--accent-ink); background: var(--accent); box-shadow: 0 3px 8px #69495d08; }
.button.primary:hover { filter: brightness(1.06); }
.button.quiet { color: var(--ink); background: var(--card); border-color: var(--line); }
.button.quiet:hover { background: var(--soft); }
.button.danger { color: var(--danger); background: var(--danger-soft); }
.button.compact { padding: 8px 14px; min-height: 44px; }
.button .icon { width: 18px; height: 18px; }
.text-button { border: 0; background: transparent; color: var(--accent); min-height: 44px; padding: 8px 4px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 12px; }
.text-button:hover { text-decoration: underline; text-underline-offset: 5px; }
.collection-toolbar { display: flex; align-items: center; gap: 20px; justify-content: space-between; margin-bottom: 16px; }
.view-tabs { display: inline-flex; background: var(--soft); border-radius: 14px; padding: 3px; flex: 0 0 auto; }
.view-tab { min-height: 44px; padding: 9px 18px; border: 0; background: transparent; color: var(--muted); border-radius: 11px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; }
.view-tab .icon { width: 17px; height: 17px; }
.view-tab.active { background: var(--card); color: var(--ink); box-shadow: 0 2px 4px #3b2d3b06; }
.search-box { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; min-height: 48px; width: 340px; max-width: 100%; }
.search-box > .icon { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.search-box input { width: 100%; border: 0; background: transparent; font-size: 14px; padding: 12px 0; outline-offset: 0; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-box .icon-button { margin-right: -8px; }
.filter-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 24px; min-height: 68px; }
.tag-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; max-height: 112px; overflow: auto; }
.tag-button { min-height: 44px; max-width: 210px; padding: 6px 12px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 12px; font-size: 11px; text-align: left; }
.tag-button::before { content: "#"; margin-right: 4px; color: var(--faint); }
.tag-button:hover, .tag-button.active { color: var(--accent); background: var(--accent-soft); }
.select-filters { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.compact-select select { min-height: 44px; border: 0; padding: 8px 26px 8px 8px; background: transparent; color: var(--muted); font-size: 11px; max-width: 180px; }
.active-filter-note { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 0 16px; color: var(--muted); font-size: 12px; }
.entry-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 28px; }
.entry-card { min-width: 0; position: relative; }
.card-cover { display: block; width: 100%; aspect-ratio: 4 / 4.3; border: 1px solid var(--line); border-radius: 18px; background: var(--card); overflow: hidden; padding: 12px; box-shadow: var(--shadow); position: relative; }
.card-cover:hover { background: var(--soft); }
.card-cover img { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--soft); border-radius: 8px; }
.card-cover img.loading { opacity: 0; }
.card-cover .image-count { position: absolute; right: 20px; bottom: 20px; padding: 3px 8px; background: #302c30b8; color: #fff; border-radius: 8px; font-size: 10px; font-variant-numeric: tabular-nums; }
.card-paper { display: flex; width: 100%; height: 100%; padding: 24px 20px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 14px; text-align: left; background: var(--soft); border-radius: 8px; }
.card-paper .icon { width: 30px; height: 30px; color: var(--accent); stroke-width: 1; }
.card-paper p { font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: 14px; line-height: 2; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
.card-paper small { color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.card-label-row { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 0; gap: 8px; }
.card-date { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-favorite { margin: -4px -8px -6px 0; }
.card-title { border: 0; background: transparent; padding: 0; margin: 0; min-height: 44px; text-align: left; color: var(--ink); line-height: 1.8; font-size: 15px; font-weight: 500; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; width: 100%; }
.card-preview { margin-top: 3px; font-size: 11px; line-height: 1.8; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; min-height: 20px; }
.label-pill { display: inline-block; max-width: 100%; background: var(--soft); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; font-size: 10px; line-height: 1.6; }
.empty-state { text-align: center; max-width: 680px; margin: 20px auto; padding: 16px 24px 44px; }
.empty-drawing { width: 156px; margin: 0 auto 20px; color: var(--faint); }
.empty-drawing svg { display: block; width: 100%; }
.empty-state h3 { font-size: 18px; letter-spacing: .06em; }
.empty-state p { color: var(--muted); font-size: 12px; margin-top: 12px; }
.empty-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.load-more-wrap { text-align: center; margin-top: 32px; }
.app-footer { max-width: 1144px; margin: 0 auto; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0 max(20px, env(safe-area-inset-bottom)); }
.app-footer > span:first-child { display: flex; align-items: center; gap: 7px; }
.save-dot { width: 5px; height: 5px; background: var(--faint); border-radius: 100%; flex-shrink: 0; }
.save-dot.ready { background: var(--sage); }
.fatal-notice, .update-notice { margin: 0 auto 12px; max-width: 1144px; padding: 16px 20px; background: var(--danger-soft); color: var(--danger); border-radius: 16px; font-size: 13px; }
.preview-notice { max-width: 1144px; margin: 0 auto 12px; padding: 16px 20px; background: var(--sage-soft); color: var(--sage); border: 1px solid var(--line); border-radius: 16px; font-size: 12px; }
.update-notice { background: var(--sage-soft); color: var(--sage); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet { border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 0; border-radius: 24px; box-shadow: var(--dialog-shadow); max-width: calc(100vw - 48px); max-height: min(90svh, 920px); width: 1020px; overflow: auto; overscroll-behavior: contain; }
dialog::backdrop { background: #211c236b; backdrop-filter: blur(4px); }
.sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 4; }
.sheet-label { display: block; font-size: 10px; letter-spacing: .08em; color: var(--muted); }
.sheet-header h2 { font-size: 20px; margin-top: 3px; }
.detail-content { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; padding: 28px; }
.detail-visual, .detail-writing { min-width: 0; }
.detail-image-button { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 4 / 4.3; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--page); }
.detail-image-button img { display: block; max-height: 100%; max-width: 100%; object-fit: contain; }
.no-image { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--muted); font-size: 12px; width: 100%; height: 100%; }
.no-image .icon { width: 40px; height: 40px; stroke-width: 1; }
.detail-thumbnails { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.thumbnail-button { width: 62px; height: 62px; border: 1px solid var(--line); border-radius: 10px; padding: 4px; background: var(--card); }
.thumbnail-button.active { border: 2px solid var(--accent); }
.thumbnail-button img { display: block; width: 100%; height: 100%; border-radius: 5px; object-fit: cover; }
.image-download { width: 100%; margin-top: 16px; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 10px; color: var(--muted); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.detail-writing h2 { font-size: 24px; line-height: 1.7; letter-spacing: .03em; }
.detail-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.prompt-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.subsection-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.subsection-top h3, .notes-section h3, .settings-section h3 { font-size: 13px; }
.prompt-text { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; font-size: 13px; line-height: 2; padding: 16px; margin-top: 12px; background: var(--page); border-radius: 12px; max-height: 380px; overflow: auto; }
.notes-section { padding-top: 24px; }
.notes-section p { font-size: 12px; line-height: 1.9; margin-top: 12px; color: var(--muted); white-space: pre-wrap; }
.detail-bottom { padding-top: 24px; margin-top: 24px; border-top: 1px solid var(--line); }
.detail-bottom > span { display: block; font-size: 10px; margin-top: 8px; color: var(--faint); }
.editor-body { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 32px; padding: 28px; }
.editor-fields, .editor-images-column { min-width: 0; }
.field-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; font-size: 13px; }
.field-heading span { font-size: 10px; color: var(--muted); }
.image-drop-area { min-height: 212px; width: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; border: 1px dashed var(--faint); border-radius: 16px; background: var(--page); padding: 24px; color: var(--muted); }
.image-drop-area .icon { width: 32px; height: 32px; stroke-width: 1; color: var(--accent); }
.image-drop-area strong { font-size: 13px; font-weight: 500; color: var(--ink); }
.image-drop-area span { font-size: 10px; }
.image-drop-area.drag-over { outline: 2px solid var(--accent); background: var(--accent-soft); }
.editor-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.editor-images:not(:empty) { margin-bottom: 12px; }
.editor-image-card { position: relative; min-width: 0; }
.editor-image-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; border: 1px solid var(--line); border-radius: 12px; }
.editor-image-actions { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.editor-image-actions .text-button { font-size: 10px; }
.editor-image-actions .icon-button { color: var(--danger); }
.field { display: block; margin-bottom: 20px; }
.field > span { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 13px; margin-bottom: 8px; }
.field small { font-size: 10px; color: var(--muted); font-weight: normal; }
.field input, .field textarea, .copy-dialog textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--page); font-size: 13px; line-height: 1.9; }
.field input { min-height: 48px; }
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field-help { display: block; font-size: 10px; color: var(--muted); margin-top: 10px; line-height: 1.9; }
.field-error { color: var(--danger); font-size: 12px; margin: 10px 0; white-space: pre-line; }
.field-error:empty { display: none; }
.favorite-check { display: flex; align-items: center; gap: 8px; font-size: 12px; min-height: 44px; cursor: pointer; }
.favorite-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.favorite-check .icon { width: 17px; height: 17px; color: var(--accent); }
.editor-danger { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.editor-danger > span { font-size: 10px; color: var(--muted); }
.settings-sheet { width: 640px; }
.settings-body { padding: 28px; }
.privacy-note { padding: 20px; background: var(--sage-soft); border-radius: 16px; display: flex; align-items: flex-start; gap: 12px; }
.privacy-note > .icon { color: var(--sage); flex-shrink: 0; margin-top: 3px; }
.privacy-note h3 { font-size: 13px; }
.privacy-note p { font-size: 11px; margin-top: 8px; color: var(--muted); }
.settings-section { padding: 28px 0; border-bottom: 1px solid var(--line); }
.settings-section:last-child { border: 0; padding-bottom: 0; }
.settings-section > p { font-size: 12px; color: var(--muted); margin-top: 12px; }
.settings-button-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.settings-section .small-note { font-size: 10px; line-height: 1.9; }
.muted { color: var(--muted); font-size: 10px; }
.offline-detail { font-size: 12px; margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; white-space: pre-line; }
.operation-note { min-height: 0; }
.operation-note:empty { display: none; }
.import-preview { background: var(--page); border: 1px solid var(--line); padding: 20px; margin-top: 16px; border-radius: 16px; }
.import-preview strong { font-size: 14px; font-weight: 500; }
.import-preview p { font-size: 12px; margin-top: 8px; color: var(--muted); }
.brand-small { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-size: 12px; }
.about-section { text-align: center; }
.about-section .muted { display: block; margin-top: 16px; }
.image-viewer { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; border: 0; border-radius: 0; background: #1e1c20; color: #fff; padding: 64px 20px 24px; margin: 0; overflow: auto; }
.image-viewer img { display: block; width: 100%; height: 100%; object-fit: contain; }
.viewer-close { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; color: #fff; background: #ffffff18; }
.confirm-dialog { width: 420px; max-width: calc(100vw - 32px); border: 1px solid var(--line); border-radius: 20px; padding: 28px; background: var(--card); color: var(--ink); box-shadow: var(--dialog-shadow); }
.confirm-dialog h2 { font-size: 18px; line-height: 1.7; }
.confirm-dialog p { font-size: 12px; color: var(--muted); margin-top: 12px; }
.confirm-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.copy-dialog textarea { margin: 16px 0; }
.toast { position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 100; display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--page); border-radius: 16px; box-shadow: 0 8px 32px #0002; padding: 8px 12px 8px 20px; width: max-content; max-width: calc(100vw - 32px); font-size: 12px; }
.toast button { color: inherit; background: transparent; border: 0; min-height: 44px; padding: 8px; flex-shrink: 0; font-size: 12px; }
.toast #undoButton { text-decoration: underline; text-underline-offset: 4px; }
.toast .icon-button { padding: 0; }
dialog .toast { position: fixed; }

@media (min-width: 1400px) { .entry-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 24px; } }
@media (max-width: 1000px) {
  .app-header { padding: 24px 32px; }.app-main { padding-left: 32px; padding-right: 32px; }
  .app-footer, .fatal-notice, .update-notice, .preview-notice { margin-left: 32px; margin-right: 32px; }
  .cover { grid-template-columns: 1.25fr 1fr; }.cover-art { transform: scale(.85); transform-origin: center right; }
  .entry-grid { gap: 28px 20px; }.card-cover { padding: 10px; }.filter-row { flex-direction: column; gap: 4px; }.select-filters { align-self: flex-end; }
  .detail-content { gap: 24px; }.editor-body { gap: 24px; }
}
@media (max-width: 740px) {
  .app-header { padding: 20px 20px; }.app-main { padding-left: 20px; padding-right: 20px; }
  .brand-title { font-size: 16px; }.brand-subtitle { font-size: 10px; }.brand-mark { width: 42px; height: 42px; border-radius: 14px; }.brand { gap: 10px; }
  .header-actions { gap: 0; }.cover { padding: 24px 4px 32px; grid-template-columns: minmax(0, 1fr) clamp(92px, 25vw, 160px); gap: 16px; min-height: 264px; }
  .cover h1 { font-size: 26px; line-height: 1.65; letter-spacing: .04em; }.eyebrow { font-size: 8px; letter-spacing: .12em; margin-bottom: 12px; gap: 8px; }.tiny-line { width: 16px; }
  .cover p { font-size: 12px; margin-top: 16px; }.cover-copy { position: relative; z-index: 1; }.cover-footer { margin-top: 20px; gap: 10px; }
  .cover-note { display: none; }
  .cover-art {
    width: 100%;
    height: auto;
    aspect-ratio: 330 / 280;
    margin: 0;
    transform: none;
    pointer-events: none;
  }
  .paper-note { width: 61%; height: 74%; top: 7%; right: 2%; padding: 12% 9%; }
  .paper-note i { margin-top: 12%; }
  .paper-note span, .paper-note b, .paper-photo span { display: none; }
  .paper-photo { width: 55%; height: 84%; top: 7%; left: 8%; padding: 4% 4% 10%; }
  .paper-photo svg { height: 100%; }
  .art-spark { font-size: 14px; }.spark-two { font-size: 10px; }
  .desktop-break { display: none; }.collection { padding-top: 28px; }.collection-top { margin-bottom: 24px; }.collection-top h2 { font-size: 18px; gap: 8px; }
  .collection-toolbar { flex-direction: column; align-items: stretch; gap: 16px; }.view-tabs { align-self: flex-start; }.search-box { width: 100%; }.view-tab { font-size: 12px; }
  .select-filters { width: 100%; justify-content: flex-end; }.compact-select select { font-size: 12px; max-width: 175px; }
  .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }.card-cover { padding: 8px; border-radius: 14px; aspect-ratio: 4 / 4.8; }.card-cover img { border-radius: 6px; }
  .card-title { font-size: 14px; }.card-preview { font-size: 12px; }.card-paper { padding: 16px 12px; gap: 8px; }.card-paper p { font-size: 12px; -webkit-line-clamp: 4; }.card-paper .icon { width: 24px; height: 24px; }
  .card-label-row { margin-top: 8px; }.card-date { font-size: 10px; }.card-tags { gap: 4px; margin-top: 8px; }.label-pill { font-size: 11px; }.card-cover .image-count { right: 14px; bottom: 14px; }
  .app-footer { margin: 0 20px; gap: 8px; font-size: 9px; }.app-footer > span:nth-child(2) { display: none; }.fatal-notice, .update-notice, .preview-notice { margin-left: 20px; margin-right: 20px; }
  .sheet { max-width: 100vw; width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; margin: 0; }
  .sheet-header { padding: max(16px, env(safe-area-inset-top)) 16px 16px; gap: 8px; }.sheet-header-actions { gap: 4px; }.sheet-header h2 { font-size: 18px; }.sheet-label { font-size: 9px; }
  .detail-content { grid-template-columns: 1fr; padding: 20px; gap: 28px; }.detail-image-button { aspect-ratio: auto; min-height: 240px; max-height: 60svh; padding: 12px; }.detail-image-button img { max-height: 54svh; }
  .detail-writing h2 { font-size: 22px; }.detail-bottom { padding-bottom: max(12px, env(safe-area-inset-bottom)); }.detail-thumbnails { justify-content: center; }.image-download { margin-top: 12px; }
  .prompt-text { max-height: none; font-size: 13px; }.editor-body { grid-template-columns: 1fr; padding: 20px 20px max(24px, env(safe-area-inset-bottom)); gap: 28px; }.editor-images { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }.image-drop-area { min-height: 150px; }.editor-image-actions { flex-wrap: wrap; gap: 0; }.editor-image-actions .text-button { flex: 1; font-size: 9px; }
  .field input, .field textarea { font-size: 16px; }.field-pair { gap: 12px; }.field > span { font-size: 12px; }.field > span small { font-size: 9px; }
  .settings-body { padding: 20px 20px max(32px, env(safe-area-inset-bottom)); }.settings-section { padding: 24px 0; }.settings-button-row .button { flex: 1 1 auto; }.privacy-note { padding: 16px; gap: 8px; }.privacy-note h3 { font-size: 12px; }.settings-section > p { font-size: 12px; }.settings-section .small-note, .field-help { font-size: 11px; }
  .toast { font-size: 11px; gap: 6px; padding-left: 14px; bottom: max(16px, env(safe-area-inset-bottom)); }.toast button { font-size: 11px; }
}
@media (max-width: 400px) {
  .app-header { padding: 16px; }.app-main { padding-left: 16px; padding-right: 16px; }.app-footer { margin-left: 16px; margin-right: 16px; }
  .brand-title { font-size: 15px; letter-spacing: .04em; }.brand-subtitle { letter-spacing: .03em; }.brand { gap: 8px; }.brand-mark { width: 38px; height: 38px; }.brand-mark .icon { width: 24px; height: 24px; }
  .cover h1 { font-size: 24px; }.cover p { font-size: 12px; }.cover-footer .connection-badge { font-size: 10px; padding: 4px 8px; }
  .collection-top h2 { font-size: 17px; }.entry-grid { gap: 24px 12px; }.button { padding-left: 16px; padding-right: 16px; }.card-favorite { margin-right: -10px; }.card-date { font-size: 10px; }.card-cover { padding: 7px; }
  .field-pair { grid-template-columns: 1fr; gap: 0; }.sheet-header .button { padding: 8px 12px; }.editor-images { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  html { scroll-behavior: auto; }
}
