@charset "UTF-8";

:root {
  color-scheme: dark;
  --paper: #1c221e;
  --ink: #e7ebe0;
  --secondary: #b2beaa;
  --muted: #98a48f;
  --line: #374237;
  --sage: #3b5139;
  --green: #b5cea1;
  --soft: #29332a;
  --note: #322f26;
  --danger: #efa68f;
  --badge-ink: #e8f0df;
  --radius: 16px;
  --sans: "Inter", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 28px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.7 var(--sans); -webkit-font-smoothing: antialiased; }
body:has(dialog[open]) { overflow: hidden; }
button, input, textarea { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
button, input, textarea { border-radius: 0; }
a { color: inherit; text-decoration: none; }
button { border: 0; }
svg { display: block; flex-shrink: 0; }
button:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--green); outline-offset: 5px; }
input:focus-visible, textarea:focus-visible { outline: 2px solid #98ae8f; outline-offset: 3px; }
::selection { background: #d4e1c8; color: #263d28; }
input::placeholder, textarea::placeholder { color: #929789; opacity: 1; }
.svg-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
body:not(.is-author) [data-author] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 100; padding: 10px 20px; background: var(--ink); color: white; border-radius: 8px; }
.skip-link:focus { top: 16px; }
.site-shell { max-width: 1040px; padding: 0 40px; margin: 0 auto; }
.site-header { min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.wordmark { display: flex; align-items: center; gap: 13px; font-size: 25px; letter-spacing: .08em; font-weight: 600; line-height: 1.1; }
.brand-mark { width: 36px; height: 36px; color: var(--green); }
.wordmark-caption { display: block; margin-top: 8px; font: 9px/1.3 var(--mono); letter-spacing: .015em; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 24px; }
.primary-nav { display: flex; align-items: center; gap: 24px; }
.nav-link { position: relative; font-size: 14px; margin-right: 10px; }
.header-actions .nav-link { margin-right: 0; }
.nav-link.active::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--green); position: absolute; left: calc(50% - 2px); bottom: -10px; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 10px 18px; border-radius: 8px; font-size: 13px; font-weight: 500; letter-spacing: .015em; line-height: 1.5; transition: background .18s, transform .18s; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-primary { background: var(--sage); color: #304a32; }
.button-primary:hover { background: #ceddc3; }
.button-quiet { background: transparent; color: var(--secondary); }
.button-quiet:hover { background: var(--soft); }
.button-danger { background: #f2dfd6; color: #803e31; }
.button-danger:hover { background: #ead2c6; }
.icon-button { width: 36px; height: 36px; padding: 8px; display: inline-flex; justify-content: center; align-items: center; border-radius: 50%; background: transparent; color: var(--secondary); transition: background .18s; }
.icon-button:hover { background: #e9ede1; color: var(--ink); }
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown[open] > summary { background: #e9ede1; }
.dropdown-panel { z-index: 10; position: absolute; right: 0; top: calc(100% + 9px); width: 190px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fcfcf8; box-shadow: 0 12px 35px #29332c0c; animation: menu-in .14s ease-out; }
.dropdown-panel button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 10px 11px; border-radius: 6px; background: transparent; font-size: 13px; }
.dropdown-panel button:hover { background: var(--soft); }
.menu-link { display: flex; align-items: center; gap: 10px; padding: 10px 11px; font-size: 13px; border-radius: 6px; }
.menu-link:hover { background: var(--soft); }
.dropdown-panel .danger-action { color: var(--danger); }
.menu-label { display: block; padding: 6px 11px 8px; color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.menu-divider { height: 1px; background: var(--line); margin: 5px 10px; }
.introduction { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(0, 1fr); gap: 16px; margin: 12px 0 66px; }
.introduction.without-note { grid-template-columns: 1fr; }
.profile-panel { position: relative; padding: 29px 34px 31px; background: var(--soft); border-radius: var(--radius); }
.eyebrow { display: flex; align-items: center; gap: 8px; font: 10px/1.5 var(--mono); color: var(--secondary); letter-spacing: .1em; }
.profile-panel .eyebrow { font-family: var(--sans); font-size: 11px; letter-spacing: .06em; }
.eyebrow-en { font: 9px/1.5 var(--mono); color: #7d8977; margin-left: auto; letter-spacing: .12em; }
.small-dot { width: 5px; height: 5px; border-radius: 50%; background: #839775; display: inline-block; flex-shrink: 0; }
.profile-panel h1 { font-size: clamp(25px, 2.6vw, 32px); line-height: 1.5; font-weight: 500; letter-spacing: .035em; margin: 23px 0 7px; overflow-wrap: anywhere; }
.profile-panel > p { font-size: 14px; line-height: 1.85; color: var(--secondary); margin: 0; padding-right: 55px; overflow-wrap: anywhere; }
.text-link { display: inline-flex; align-items: center; gap: 7px; background: none; padding: 0; font-size: 11px; color: var(--secondary); white-space: nowrap; }
.text-link .icon { width: 15px; height: 15px; transition: transform .2s; }
.text-link:hover { color: var(--green); }
.text-link:hover .icon { transform: translateX(3px); }
.profile-edit { position: absolute; right: 28px; bottom: 27px; font-size: 10px; color: #78856e; }
.margin-note { position: relative; overflow: hidden; padding: 27px 28px; border-radius: var(--radius); background: var(--note); min-height: 192px; }
.note-label { display: block; font-size: 10px; letter-spacing: .08em; color: #8d8979; }
.margin-note > p { position: relative; z-index: 1; font-size: 15px; font-weight: 500; line-height: 1.8; max-width: 210px; margin: 15px 0 60px; color: #535a4a; overflow-wrap: anywhere; }
.note-drawing { position: absolute; width: 124px; height: 65px; right: 20px; bottom: 20px; color: #7c8963; transform: rotate(-5deg); }
.note-caption { position: absolute; bottom: 24px; left: 28px; font: 9px/1.5 var(--mono); letter-spacing: -.025em; color: #979581; }
.thoughts-section { padding-top: 20px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid #cbd2c4; }
.section-eyebrow { font-size: 9px; color: #7e8979; letter-spacing: .14em; }
.section-heading #thoughtsTitle { margin: 0; font-size: 1.625rem; font-weight: 500; letter-spacing: .04em; line-height: 1.4; }
.heading-period { color: #839475; margin-left: 2px; }
.sort-note { display: inline-flex; align-items: center; gap: 8px; padding-bottom: 6px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.sort-lines { width: 13px; height: 9px; background: linear-gradient(var(--muted),var(--muted)) 0 0/13px 1px no-repeat,linear-gradient(var(--muted),var(--muted)) 0 4px/9px 1px no-repeat,linear-gradient(var(--muted),var(--muted)) 0 8px/5px 1px no-repeat; opacity: .7; }
.example-notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0 0; }
.example-notice p { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 11px; color: #84907c; }
.example-notice .small-dot { width: 4px; height: 4px; background: #a2b197; }
.example-notice .text-link { font-size: 10px; }
.storage-notice { font-size: 13px; padding: 14px 18px; margin-top: 18px; background: #f4e9d7; border-radius: 8px; color: #825d30; }
.day-group { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 28px; padding: 34px 0 36px; border-bottom: 1px solid var(--line); animation: appear .38s ease both; }
.date-gutter { padding-top: 3px; align-self: start; }
.date-month { display: block; font: .75rem/1.5 var(--mono); color: var(--muted); letter-spacing: .035em; }
.date-day { display: block; font-size: 2rem; font-weight: 400; font-variant-numeric: tabular-nums; line-height: 1.2; letter-spacing: -.035em; margin: 6px 0; color: #6c7963; }
.date-weekday { display: block; font-size: .75rem; color: var(--muted); letter-spacing: .02em; }
.day-thoughts { min-width: 0; }
.thought { position: relative; padding: 0; }
.thought + .thought { padding-top: 28px; margin-top: 28px; border-top: 1px dashed var(--line); }
.thought-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 26px; margin: 0 0 14px; }
.thought-time { display: flex; align-items: center; gap: 10px; font: .75rem/1.5 var(--mono); color: var(--muted); letter-spacing: .02em; }
.thought-time time { font-variant-numeric: tabular-nums; }
.thought-label { font: 9px/1.5 var(--sans); letter-spacing: .03em; padding: 2px 7px; border: 1px solid #e0e5d9; border-radius: 4px; color: #8b9582; }
.thought-label.latest { border-color: transparent; color: #728264; background: #eaf0e3; }
.edited-note { font: .75rem/1.5 var(--sans); letter-spacing: 0; color: var(--muted); }
.thought-actions { margin-right: 0; }
.thought-actions > summary { width: 30px; height: 30px; opacity: .56; }
.thought:hover .thought-actions > summary, .thought-actions:focus-within > summary, .thought-actions[open] > summary { opacity: 1; }
.thought-actions .dropdown-panel { width: 153px; }
.thought-title { font-size: 1.375rem; font-weight: 500; line-height: 1.6; margin: 0 0 12px; letter-spacing: .015em; overflow-wrap: anywhere; }
.thought-text { font-size: 1.125rem; line-height: 1.9; letter-spacing: .015em; color: #303a32; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.thought-text.only-text { font-size: 1.125rem; color: #303a32; }
.thought-text.is-collapsed { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 8; overflow: hidden; }
.read-more { margin-top: 16px; font-size: .8125rem; }
.loading-state { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 76px 20px; color: #84907b; font-size: 12px; }
.loading-leaf { animation: breathe 1.7s ease-in-out infinite; }
.load-more-wrap { padding: 30px 0 0; text-align: center; }
.load-more-wrap .button { font-size: 11px; color: var(--secondary); }
.storage-notice .text-link { margin-left: 12px; text-decoration: underline; }
button:disabled { cursor: wait; opacity: .6; transform: none; }
.composer-submit-actions { display: flex; align-items: center; gap: 8px; }
.drafts-intro { color: var(--muted); font-size: 12px; margin: -7px 34px 19px; }
.draft-list { padding: 0 34px 28px; max-height: 55dvh; overflow-y: auto; }
.draft-row { display: flex; align-items: center; gap: 14px; padding: 18px 0; border-top: 1px solid var(--line); }
.draft-open { flex: 1; min-width: 0; text-align: left; padding: 0; background: transparent; }
.draft-open strong { display: block; font-size: 15px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-open > span { display: block; font-size: 11px; color: var(--muted); margin-top: 5px; }
.draft-open:hover strong { color: var(--green); }
.draft-note { padding: 26px 0; color: var(--muted); font-size: 13px; text-align: center; }
.attachment-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px; padding: 15px 0 10px; border-top: 1px solid var(--line); }
.add-image-button { gap: 7px; font-size: 14px; }
.attachment-toolbar > span { color: var(--muted); font-size: 12px; }
.attachment-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.attachment-tile { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--soft); }
.attachment-tile > img { display: block; width: 100%; height: 108px; object-fit: cover; }
.attachment-remove { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; padding: 5px; background: #fbfbf2e8; color: var(--ink); }
.attachment-caption { display: flex; align-items: center; justify-content: space-between; gap: 5px; min-height: 31px; padding: 5px 8px; font-size: 12px; color: var(--secondary); }
.attachment-caption .text-link { font-size: 12px; }
.attachment-caption .upload-error { color: var(--danger); }
.attachment-tile progress { display: block; height: 3px; width: 100%; border: 0; accent-color: #708862; }
.attachment-error-detail { color: var(--danger); font-size: 12px; margin: 0; padding: 0 8px 7px; line-height: 1.5; }
.thought-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 22px; }
.thought-gallery[data-count="1"] { grid-template-columns: 1fr; }
.thought-gallery[data-count="3"], .thought-gallery[data-count="5"], .thought-gallery[data-count="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.thought-image-button { position: relative; min-width: 0; overflow: hidden; padding: 0; background: #edf0e7; border-radius: 10px; line-height: 0; cursor: zoom-in; }
.thought-image-button > img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; transition: transform .25s; }
.thought-image-button:hover > img { transform: scale(1.015); }
.thought-gallery[data-count="1"] img { aspect-ratio: auto; max-height: 460px; object-fit: contain; }
.image-failure { display: none; color: var(--muted); font-size: 11px; line-height: 1.8; padding: 28px 14px; }
.thought-image-button.image-failed > img { display: none; }
.thought-image-button.image-failed .image-failure { display: block; }
.image-dialog { width: min(1000px, calc(100% - 32px)); background: #f7f8f1; max-height: calc(100dvh - 32px); overflow: hidden; }
.image-dialog::backdrop { background: #23301ed9; backdrop-filter: blur(8px); }
.image-viewer-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 8px 22px; color: var(--muted); font: 12px/1.5 var(--mono); }
.image-viewer-stage { display: flex; align-items: center; justify-content: center; min-height: 200px; max-height: calc(100dvh - 160px); }
.image-viewer-stage > img { display: block; width: 100%; max-height: calc(100dvh - 160px); object-fit: contain; }
.image-viewer-stage > p { padding: 42px 20px; font-size: 13px; color: var(--secondary); }
.image-viewer-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 18px; color: var(--muted); font-size: 12px; }
.previous-image .icon { transform: rotate(180deg); }
.transfer-content { padding: 0 34px 32px; }
.transfer-content > p:first-child { color: var(--secondary); font-size: 13px; }
.transfer-content > progress { width: 100%; height: 5px; margin: 10px 0 17px; accent-color: #708862; }
@keyframes breathe { 50% { opacity: .4; transform: rotate(-8deg); } }
.site-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 28px; padding: 18px 0 28px; border-top: 1px solid var(--line); color: #808a78; font-size: .75rem; }
.footer-brand > span { margin: 0 10px; color: #b0b6aa; }
.footer-data { display: flex; align-items: center; gap: 7px; }
.footer-data .small-dot { width: 4px; height: 4px; background: #93a680; }
.footer-data button { background: transparent; color: inherit; padding: 2px 0; font-size: inherit; }
.footer-data button:hover { color: var(--green); }
.footer-separator { margin: 0 2px; }
.empty-state { text-align: center; padding: 65px 20px 55px; }
.empty-drawing { width: 90px; height: 81px; margin: 0 auto 28px; color: #8d9c7d; }
.empty-state h3 { font-size: 23px; font-weight: 500; letter-spacing: .04em; }
.empty-state p { font-size: 13px; color: var(--muted); margin: 12px 0 25px; }
.dialog { width: min(640px, calc(100% - 40px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid #e1e5d9; border-radius: 18px; color: var(--ink); background: #fbfbf6; overflow-y: auto; box-shadow: 0 28px 110px #1925171a; }
.dialog[open] { animation: dialog-in .2s ease-out; }
.dialog::backdrop { background: #28352655; backdrop-filter: blur(5px); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 32px 34px 24px; }
.dialog-header .icon-button { margin: -6px -10px 0 0; }
.dialog-header h2 { margin: 10px 0 0; font-size: 24px; line-height: 1.5; font-weight: 500; letter-spacing: .025em; }
.dialog-header .eyebrow { font-size: 9px; color: #8d9782; }
.composer-fields { padding: 0 34px; }
.title-input, .body-input { display: block; width: 100%; background: transparent; border: 0; color: var(--ink); }
.title-input { padding: 18px 0 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 19px; line-height: 1.6; font-weight: 500; }
.body-input { resize: vertical; min-height: 238px; max-height: 48dvh; padding: 21px 0 12px; font-size: 15px; line-height: 1.95; }
.title-input:focus, .body-input:focus { outline: none; }
.title-input:focus-visible { border-bottom-color: #8ca07e; }
.body-input:focus-visible { background: #f6f8ef; box-shadow: 0 0 0 8px #f6f8ef; border-radius: 5px; }
.composer-bottomline { display: flex; gap: 16px; justify-content: space-between; font-size: 10px; color: #929b89; padding: 12px 34px 24px; }
#characterCount { font-family: var(--mono); white-space: nowrap; }
.dialog-footer { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 19px 34px; background: #f2f4ec; border-top: 1px solid #e5e9df; }
.composer-footer { justify-content: space-between; }
.keyboard-hint { font-size: 10px; color: var(--muted); line-height: 1.6; }
kbd { font: 10px/1.4 var(--mono); }
.local-hint { display: block; font-size: 9px; color: #969f8e; margin-top: 3px; }
.publish-button { padding-left: 22px; padding-right: 22px; }
.form-error { margin: 0 34px 12px; font-size: 12px; color: var(--danger); line-height: 1.8; }
.profile-dialog { max-width: 560px; }
.form-fields { padding: 0 34px 27px; }
.form-fields > label { display: block; color: var(--secondary); font-size: 12px; margin: 0 0 18px; }
.form-fields input, .form-fields textarea { display: block; width: 100%; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; background: #f7f8f0; padding: 10px 13px; color: var(--ink); font-size: 14px; }
.form-fields textarea { resize: vertical; min-height: 78px; }
.field-note { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.form-fields .form-error { margin: 12px 0 0; }
.confirm-dialog { max-width: 450px; }
.confirm-content { padding: 30px 30px 28px; }
.confirm-content .eyebrow { font-size: 9px; color: var(--muted); }
.confirm-content h2 { font-size: 21px; line-height: 1.5; font-weight: 500; margin: 12px 0; }
.confirm-content p { font-size: 13px; line-height: 1.85; color: var(--secondary); margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.confirm-dialog .dialog-footer { padding: 18px 26px; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 30px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px); width: max-content; padding: 13px 14px 13px 20px; border-radius: 11px; background: #344a36; color: #f2f6ed; box-shadow: 0 7px 32px #2b402922; font-size: 12px; animation: toast-in .2s ease-out; }
.toast > .icon { width: 16px; height: 16px; color: #c0d5ad; }
.toast.error { background: #795448; }
.toast.error > .icon { display: none; }
#toastAction { background: transparent; color: #d0e4b9; border-left: 1px solid #64775f; margin-left: 7px; padding: 0 3px 0 14px; font-size: 12px; white-space: nowrap; }
.toast-close { width: 26px; height: 26px; color: #c6d3bc; padding: 5px; }
.toast-close:hover { background: #ffffff18; color: white; }
.noscript-note { margin: 24px; background: #f2dfd6; padding: 16px; color: #803e31; border-radius: 8px; }

@keyframes appear { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-in { from { opacity: 0; bottom: 22px; } to { opacity: 1; bottom: 30px; } }

@media (min-width: 1000px) {
  .day-thoughts { padding-right: 44px; }
  .thought-actions { position: absolute; right: -44px; top: -2px; }
  .thought + .thought .thought-actions { top: 26px; }
  .thought-actions .dropdown-panel { right: 0; }
}
@media (max-width: 760px) {
  .site-shell { padding: 0 25px; }
  .site-header { min-height: 100px; }
  .thoughts-section { padding-top: 16px; }
  .header-actions { gap: 13px; }
  .primary-nav { gap: 8px; }
  .wordmark { font-size: 23px; gap: 9px; }
  .wordmark-caption { font-size: 8px; }
  .brand-mark { width: 31px; height: 31px; }
  .nav-link { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; white-space: nowrap; }
  .nav-link.active::after { bottom: 2px; }
  .introduction { gap: 12px; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); margin-top: 6px; margin-bottom: 49px; }
  .profile-panel { padding: 24px 24px 43px; }
  .profile-panel h1 { font-size: 25px; margin-top: 21px; }
  .profile-panel > p { font-size: 12px; padding: 0; }
  .profile-edit { right: 24px; bottom: 16px; }
  .eyebrow-en { display: none; }
  .margin-note { padding: 24px 20px; }
  .margin-note > p { font-size: 13px; }
  .note-drawing { right: 5px; bottom: 29px; width: 105px; }
  .note-caption { left: 20px; bottom: 17px; font-size: 8px; }
  .day-group { grid-template-columns: 72px minmax(0, 1fr); gap: 24px; padding: 30px 0 32px; }
  .date-day { font-size: 1.875rem; }
  .thought-title { font-size: 1.3125rem; }
  .thought-text, .thought-text.only-text { font-size: 1.0625rem; line-height: 1.9; }
  .site-footer { margin-top: 26px; }
}
@media (max-width: 640px) {
  .site-shell { padding: 0 21px; }
  .site-header { min-height: 92px; gap: 10px; }
  .thoughts-section { padding-top: 12px; }
  .wordmark { font-size: 22px; gap: 7px; }
  .wordmark-caption { display: none; }
  .brand-mark { width: 29px; height: 29px; }
  .header-actions { gap: 5px; }
  .header-compose { min-height: 38px; padding: 9px 12px; font-size: 12px; gap: 5px; }
  .header-compose .icon { width: 16px; height: 16px; }
  .site-menu > summary { width: 31px; height: 31px; }
  .introduction { grid-template-columns: 1fr; gap: 10px; margin: 0 0 43px; }
  .profile-panel { padding: 23px 24px 30px; }
  .profile-panel h1 { font-size: 26px; margin-top: 20px; }
  .profile-panel > p { padding-right: 12px; }
  .profile-edit { position: static; margin-top: 14px; }
  .eyebrow-en { display: inline; font-size: 8px; }
  .margin-note { min-height: 91px; padding: 18px 23px; display: flex; flex-direction: column; justify-content: center; }
  .note-label { font-size: 9px; }
  .margin-note > p { font-size: 12px; margin: 6px 77px 0 0; max-width: none; }
  .note-drawing { right: 14px; bottom: 14px; width: 81px; height: 50px; }
  .note-caption { display: none; }
  .section-heading { padding-bottom: 21px; }
  .section-eyebrow { font-size: 8px; letter-spacing: .08em; }
  .section-heading #thoughtsTitle { font-size: 1.5rem; margin: 0; }
  .sort-note { font-size: 10px; gap: 6px; padding-bottom: 4px; }
  .example-notice { align-items: flex-start; gap: 12px; padding-top: 14px; }
  .example-notice p { font-size: 10px; line-height: 1.8; max-width: 200px; align-items: baseline; }
  .example-notice .text-link { padding-top: 2px; font-size: 9px; gap: 3px; }
  .example-notice .text-link .icon { width: 12px; }
  .day-group { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 27px 0 30px; }
  .date-gutter { display: flex; align-items: baseline; gap: 8px; padding: 0; }
  .date-month { font-size: .75rem; letter-spacing: .02em; }
  .date-day { font: .75rem/1.5 var(--mono); margin: 0; letter-spacing: .02em; color: var(--secondary); }
  .date-day::before { content: "/"; margin-right: 8px; color: var(--muted); }
  .date-weekday { font-size: .75rem; letter-spacing: 0; margin-left: 6px; }
  .thought-meta { margin: 0 0 12px; }
  .thought-time { gap: 8px; font-size: .75rem; }
  .thought-title { font-size: 1.25rem; line-height: 1.6; margin-bottom: 12px; letter-spacing: .015em; }
  .thought-text, .thought-text.only-text { font-size: 1rem; letter-spacing: .01em; line-height: 1.95; }
  .thought-label { font-size: 8px; padding: 1px 5px; }
  .edited-note { font-size: .75rem; }
  .thought-actions > summary { width: 28px; height: 28px; }
  .site-footer { margin-top: 24px; padding-top: 18px; padding-bottom: 24px; justify-content: center; flex-direction: column; gap: 8px; font-size: .75rem; }
  .empty-state { padding: 37px 0; }
  .empty-state h3 { font-size: 21px; }
  .empty-state p { font-size: 12px; }
  .dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px); border-radius: 14px; }
  .dialog-header { padding: 26px 22px 23px; }
  .dialog-header h2 { font-size: 21px; }
  .dialog-header .eyebrow { font-size: 8px; }
  .composer-fields { padding: 0 22px; }
  .title-input { font-size: 17px; }
  .body-input { min-height: 226px; max-height: 43dvh; font-size: 14px; }
  .composer-bottomline { padding: 12px 22px 20px; font-size: 9px; gap: 8px; }
  .dialog-footer { padding: 17px 22px; }
  .keyboard-hint { font-size: 9px; }
  .publish-button { padding: 10px 15px; }
  .composer-submit-actions { gap: 2px; }
  .composer-submit-actions .button { padding: 10px 11px; font-size: 12px; }
  .composer-footer .keyboard-hint { font-size: 8px; }
  .composer-footer .local-hint { font-size: 8px; }
  .drafts-intro { margin-left: 22px; margin-right: 22px; font-size: 11px; }
  .draft-list { padding-left: 22px; padding-right: 22px; }
  .attachment-toolbar { align-items: flex-start; flex-direction: column; }
  .attachment-toolbar > span { font-size: 12px; }
  .attachment-list { gap: 7px; }
  .attachment-tile > img { height: 82px; }
  .attachment-caption { padding: 4px 6px; font-size: 12px; }
  .thought-gallery { gap: 6px; margin-top: 17px; }
  .thought-gallery[data-count="5"], .thought-gallery[data-count="6"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .thought-image-button { border-radius: 7px; }
  .thought-gallery[data-count="1"] img { max-height: 370px; }
  .image-dialog { width: calc(100% - 16px); }
  .transfer-content { padding: 0 22px 25px; }
  .form-fields { padding: 0 22px 24px; }
  .form-error { margin-left: 22px; margin-right: 22px; }
  .confirm-content { padding: 27px 25px; }
  .toast { font-size: 11px; padding-left: 15px; gap: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Individual thought links stay within the existing reading layout. */
.thought-reading-link { display: block; color: inherit; border-radius: 3px; }
.thought-reading-link:hover .thought-title { color: var(--green); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.thought-permalink-time { display: inline-flex; align-items: center; min-height: 28px; color: inherit; text-decoration: none; text-underline-offset: 4px; }
.thought-permalink-time:hover { color: var(--green); text-decoration: underline; }
.all-thoughts-link { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 0 4px 14px; font-size: 14px; color: var(--secondary); white-space: nowrap; text-underline-offset: 5px; }
.all-thoughts-link:hover { color: var(--green); text-decoration: underline; }
.is-single-thought #emptyState [data-compose] { display: none; }
.share-dialog { width: min(560px, calc(100% - 40px)); }
.share-dialog .dialog-header h2 { margin-top: 0; }
.share-content { padding: 0 34px 24px; }
.share-content input { width: 100%; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font: 14px/1.6 var(--mono); }
.share-content .field-note { margin: 12px 0 0; color: var(--secondary); font-size: 13px; }
@media (max-width: 640px) {
  .thought-permalink-time { min-height: 32px; }
  .all-thoughts-link { min-height: 36px; }
  .share-content { padding: 0 24px 24px; }
  .share-content input { font-size: 16px; }
  .site-header { gap: 12px; }
  .header-actions { gap: 12px; }
}
@media (max-width: 460px) {
  .site-header { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "brand compose menu" "nav nav nav"; gap: 8px; padding: 20px 0 14px; }
  .site-header > .wordmark { grid-area: brand; }
  .header-actions { display: contents; }
  .primary-nav { grid-area: nav; gap: 14px; }
  .header-compose { grid-area: compose; }
  .site-menu { grid-area: menu; }
  .header-compose > span { display: none; }
  .header-compose { width: 36px; min-width: 36px; padding: 9px; }
}

/* Shared, indeterminate feedback follows real pending work. */
.ui-spinner, .ui-busy::before { display: inline-block; flex: 0 0 auto; width: 14px; height: 14px; box-sizing: border-box; border: 1.5px solid var(--line); border-top-color: currentColor; border-radius: 50%; color: var(--green); vertical-align: -.15em; animation: ui-spin .85s linear infinite; }
.ui-busy::before { content: ""; margin-right: 7px; opacity: 0; animation: ui-spin .85s linear infinite, ui-appear .15s .16s forwards; }
.button.ui-busy::before, .text-link.ui-busy::before { margin-right: 0; }
.ui-busy > .icon { display: none; }
.ui-request-bar { position: fixed; z-index: 80; inset: 0 0 auto; height: 2px; overflow: hidden; pointer-events: none; background: transparent; }
.ui-request-bar::after { content: ""; display: block; width: 30%; height: 100%; background: var(--green); opacity: .7; transform: translateX(-110%); animation: ui-travel 1.5s ease-in-out infinite; }
.ui-operation-notice { position: fixed; z-index: 60; bottom: 27px; left: 50%; display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100% - 32px); transform: translateX(-50%); padding: 12px 17px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--secondary); box-shadow: 0 8px 25px #0000000c; font-size: 12px; line-height: 1.6; pointer-events: none; }
.content-loading { flex-direction: column; gap: 27px; max-width: 760px; margin: 0 auto; padding: 56px 0; color: var(--secondary); }
.loading-message { display: flex; align-items: center; justify-content: center; gap: 10px; }
.loading-skeleton { display: grid; gap: 13px; width: min(100%, 620px); }
.loading-skeleton > span { display: block; height: 10px; border-radius: 4px; background: linear-gradient(100deg, var(--soft) 15%, var(--line) 45%, var(--soft) 75%); background-size: 220% 100%; animation: ui-shimmer 1.8s ease-in-out infinite; opacity: .65; }
.loading-skeleton > span:first-child { width: 41%; height: 14px; margin-bottom: 5px; }
.loading-skeleton > span:last-child { width: 74%; }
.ui-media-frame { position: relative; }
.ui-image-frame { display: block; position: relative; }
.ui-image-frame.is-media-pending, .thought-gallery[data-count="1"] .is-media-pending { min-height: 180px; }
.ui-image-placeholder { position: absolute; z-index: 1; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; padding: 14px; border-radius: inherit; background: linear-gradient(100deg, var(--soft) 15%, var(--line) 45%, var(--soft) 75%); background-size: 220% 100%; color: var(--muted); font: 11px/1.6 var(--sans); pointer-events: none; }
.is-media-visible > .ui-image-placeholder { animation: ui-shimmer 2s ease-in-out infinite; }
.ui-image-placeholder .ui-spinner { animation-play-state: paused; }
.is-media-visible > .ui-image-placeholder .ui-spinner { animation-play-state: running; }
.is-media-pending > img { opacity: 0; }
.reader-body .ui-image-frame { margin: 1.2em 0; border-radius: 10px; }
.reader-body .ui-image-frame > img { margin: 0 auto; }
@keyframes ui-spin { to { transform: rotate(360deg); } }
@keyframes ui-appear { to { opacity: 1; } }
@keyframes ui-travel { to { transform: translateX(440%); } }
@keyframes ui-shimmer { from { background-position: 140% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) {
  .ui-busy::before { opacity: 1; }
  .ui-request-bar::after { width: 100%; transform: none; opacity: .4; }
}
