/* UI components: 5-button system, cat-ear halo, stamps, cards, illustrations and reader. */

/* Brand & Identity Thread */
.brand-mark { display: inline-flex; align-items: center; gap: 4px; }
.brand-mark i { display: block; width: 12px; height: 27px; background: var(--flag-blue); transform: skewY(12deg); border-radius: 4px 2px 2px 4px; }
.brand-mark i + i { background: var(--flag-pink); transform: skewY(-12deg); border-radius: 2px 4px 4px 2px; }
.identity-thread { position: relative; display: flex; width: 104px; height: 5px; border-radius: var(--r-pill); overflow: hidden; }
/* taste-skill-ignore: Fine inset edge keeps the white signature stripe crisp on pastel surfaces. */ .identity-thread::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgb(92 118 137 / .22); pointer-events: none; }
.identity-thread i { flex: 1; background: var(--flag-blue); }
.identity-thread i:nth-child(2), .identity-thread i:nth-child(4) { background: var(--flag-pink); }
.identity-thread i:nth-child(3) { background: var(--flag-white); }

/* 5-Button System */
/* 1. Primary CTA: luminous pink-blue pill with dark ink */
.btn-primary, .primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: var(--r-pill);
  color: var(--btn-primary-ink);
  font-size: var(--text-sm);
  font-weight: 600;
  /* taste-skill-ignore: Requested Sakura pink-blue luminous button gradient. */ background: var(--primary-gradient);
  background-size: 200% 100%;
  background-position: 0 0;
  /* taste-skill-ignore: Requested luminous button highlight shadow. */ box-shadow: inset 0 1px 0 rgb(255 255 255 / .8), 0 4px 14px rgb(238 171 199 / .28);
}
/* 2. Soft secondary button */
.btn-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  background: var(--note-surface);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 500;
  /* taste-skill-ignore: Soft tactile rim matches Sakura card edges. */ border: 1px solid var(--line);
  /* taste-skill-ignore: Tinted pill shadow. */ box-shadow: var(--card-shadow);
}
.btn-soft .icon { color: var(--pink-ink); }
/* 3. Love / Favorite button */
.btn-love {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--note-surface);
  color: var(--pink-ink);
  font-size: var(--text-sm);
  font-weight: 550;
  /* taste-skill-ignore: Soft outline distinguishes love action from navigation pills. */ border: 1px solid var(--line);
}
.btn-love[aria-pressed=true] {
  background: var(--pink-soft);
  border-color: rgb(246 168 184 / .45);
}
.btn-love.is-large { min-height: 46px; padding: 8px 22px; font-size: var(--text-body); }
/* 4. Icon button */
.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--note-surface);
  color: var(--muted);
}
/* 5. Text link / button */
.text-button, .text-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: 550;
}

/* Profile Actions, Sticker Facts, Cat-Ear Avatar & Stamp */
.profile-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}
.profile-facts li {
  padding: 6px 14px;
  /* taste-skill-ignore: Pastel sticker border matches the Sakura theme. */ border: 1px solid var(--edge);
  background: var(--pink-soft);
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 550;
  color: var(--pink-ink);
  /* taste-skill-ignore: Pastel sticker shadow. */ box-shadow: inset 0 1px var(--rim), var(--card-shadow);
  transform: rotate(-1.5deg);
}
.profile-facts li:nth-child(2) { background: var(--blue-soft); color: var(--blue-ink); transform: rotate(1deg); }
.profile-facts li:nth-child(3) { background: var(--surface); color: var(--text); transform: rotate(-.6deg); }
.profile-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; }
html:not([data-page="profile"]) .profile-page-link { display: none; }
.profile-page-link { min-height: 44px; padding: 8px 4px; }

.avatar-wrap { position: relative; display: grid; place-items: center; }
.avatar-halo {
  position: relative;
  isolation: isolate;
  padding: 8px;
  border-radius: 34px;
  background: var(--halo-inner);
  cursor: pointer;
}
/* Cat ears on avatar halo */
.avatar-ear {
  position: absolute;
  top: -11px;
  width: 24px;
  height: 20px;
  background: var(--pink);
  /* taste-skill-ignore: Subtle highlight rim on decorative avatar ears. */ border: 2px solid var(--rim);
  border-bottom: 0;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  pointer-events: none;
  z-index: 2;
}
.avatar-ear--left { left: 22px; transform: rotate(-12deg); transform-origin: 50% 100%; }
.avatar-ear--right { right: 22px; transform: rotate(12deg); transform-origin: 50% 100%; }
.avatar-halo::before {
  content: "";
  position: absolute;
  inset: -7px;
  z-index: -1;
  border-radius: 40px;
  background: var(--halo-outer);
  /* taste-skill-ignore: Requested soft outer glow border. */ border: 1px solid var(--edge);
  pointer-events: none;
}
.profile-avatar { width: 148px; height: 148px; object-fit: cover; border-radius: 26px; }
.meow-bubble {
  position: absolute;
  top: -18px;
  right: -12px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--pink-soft);
  color: var(--pink-ink);
  font-size: var(--text-xs);
  font-weight: 600;
  /* taste-skill-ignore: Speech bubble elevation. */ box-shadow: var(--card-shadow);
  pointer-events: none;
  opacity: 0;
  z-index: 3;
}
.portrait-note {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 12px 30px 12px 14px;
  border-radius: var(--r-sm);
  background: var(--note-surface);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.portrait-note .icon-paw {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 18px;
  height: 18px;
  color: var(--pink);
  opacity: .75;
  pointer-events: none;
}

.becoming {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 18px 20px;
  border-radius: var(--r-md);
  background: var(--date-surface);
  /* taste-skill-ignore: Speech bubble elevation. */ box-shadow: var(--card-shadow);
}
.becoming::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 99px;
  background: var(--thread-gradient);
  pointer-events: none;
}
.becoming-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 10px;
}
.becoming time {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--pink-soft);
  color: var(--pink-ink);
  font-size: var(--text-xs);
  font-weight: 600;
}
.stamp-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 11px;
  border-radius: var(--r-pill);
  border: 1.5px dashed var(--pink-ink);
  color: var(--pink-ink);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transform: rotate(-6deg);
  opacity: .92;
}
.becoming > p { font-size: var(--text-sm); line-height: 1.85; color: var(--text); }

.paw-button {
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
  width: 36px;
  height: 36px;
  margin: -4px 0;
  padding: 0;
  border-radius: var(--r-pill);
  color: var(--pink-ink);
  background: var(--pink-soft);
}
.paw-button .icon { width: 17px; height: 17px; }

/* Topbar Search Trigger */
.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--note-surface);
  color: var(--muted);
  font-size: 13px;
  /* taste-skill-ignore: Soft outline matches topbar pill control. */ border: 1px solid var(--line);
}
.search-trigger kbd, .search-kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--card-surface);
  color: var(--muted);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
}

/* Segmented Control (Categories + Saved) */
.folder-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--card-surface);
  max-width: 100%;
  /* taste-skill-ignore: Recessed track depth on segmented control. */ box-shadow: inset 0 1px 2px rgb(92 118 137 / .06);
}
.folder-tabs.is-searching { opacity: .58; }
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px 13px;
  border-radius: var(--r-pill);
  font-size: var(--text-sm);
  color: var(--muted);
  white-space: nowrap;
}
.tab.active { color: var(--accent); font-weight: 600; }
.tab.tab-saved.active { color: var(--pink-ink); }
.tab.is-empty { opacity: .62; }
.tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 19px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.tab.active .tab-count { background: var(--blue-soft); color: var(--blue-ink); }
.tab.tab-saved.active .tab-count { background: var(--pink-soft); color: var(--pink-ink); }
.tab-divider {
  width: 1px;
  height: 18px;
  margin-inline: 3px;
  background: var(--control);
  opacity: .55;
  flex-shrink: 0;
}
.search-scope-badge {
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--blue-soft);
  color: var(--blue-ink);
  font-size: var(--text-xs);
  font-weight: 550;
  white-space: nowrap;
}

/* Search Input */
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 224px;
  max-width: 100%;
  min-height: 44px;
  padding: 6px 12px;
  /* taste-skill-ignore: Form search field retains clean outline. */ border: 1px solid var(--control);
  border-radius: var(--r-pill);
  background: var(--note-surface);
  color: var(--muted);
}
.search input { width: 100%; min-width: 0; background: transparent; border: 0; outline: none; font-size: var(--text-sm); color: var(--text); }
.search input::placeholder { color: var(--muted); }
/* taste-skill-ignore: Pastel focus ring on search input. */ .search:focus-within { outline: none; border-color: var(--focus); box-shadow: var(--focus-shadow); }
.search-clear { width: 24px; height: 24px; display: grid; place-items: center; border-radius: var(--r-pill); color: var(--muted); flex-shrink: 0; }
.search-clear .icon { width: 14px; height: 14px; }
mark { background: var(--pink-soft); color: var(--pink-ink); padding: 0 3px; border-radius: 4px; }

/* Featured & List Cards */
.featured {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 28px;
  align-items: center;
  background: var(--blue-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  /* taste-skill-ignore: Speech bubble elevation. */ box-shadow: var(--card-shadow);
}
.feature-image { position: relative; display: block; height: 290px; overflow: hidden; border-radius: var(--r-lg) 0 0 var(--r-lg); background: var(--cover-surface); }
.feature-image img { width: 100%; height: 100%; object-fit: cover; }
.feature-copy { padding: 28px 32px 28px 0; }
.feature-copy h3 { font-size: clamp(22px, 2.2vw, 28px); line-height: 1.4; margin-bottom: 12px; padding-right: 38px; }
/* Give the whole feature card the title's native link, including its excerpt and whitespace. */
.feature-copy h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.meta { display: flex; gap: 10px 14px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; }
.category-label { color: var(--blue-ink); font-weight: 550; }
.feature-copy p { margin-top: 14px; font-size: 15px; line-height: 1.9; color: var(--text); }
.article-bottom { margin-top: 22px; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); }
.read-link { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-weight: 600; }

/* Quick-Like Button on Cards (placed cleanly above stretched link) */
.card-like {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--sheet-glass);
  color: var(--pink-ink);
  /* taste-skill-ignore: Speech bubble elevation. */ box-shadow: var(--card-shadow);
}
.card-like[aria-pressed=true] { background: var(--pink-soft); opacity: 1; }

/* Post Rows (Tech & Generic) */
.post-row {
  position: relative;
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr) 88px;
  gap: 22px;
  padding: 16px 48px 16px 16px;
  border-radius: var(--r-md);
  background: var(--card-surface);
  /* taste-skill-ignore: Speech bubble elevation. */ box-shadow: var(--card-shadow);
  align-items: center;
}
.post-row-title { display: inline-block; margin: 5px 0 6px; font-size: 19px; line-height: 1.45; }
.post-row-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.post-row .excerpt { font-size: var(--text-sm); line-height: 1.75; color: var(--muted); }
.row-date { font-size: 13px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.post-thumb {
  display: block;
  position: relative;
  overflow: hidden;
  width: 164px;
  height: 118px;
  border-radius: var(--r-sm);
  background: var(--cover-surface);
  isolation: isolate;
}
.post-thumb img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }

/* Cat Daily 2-column Masonry-style Cards */
.post-list--daily .post-row {
  grid-template-columns: 1fr;
  grid-template-rows: 170px auto;
  gap: 14px;
  padding: 14px;
}
.post-list--daily .post-thumb { width: 100%; height: 170px; }
.post-list--daily .row-date { text-align: left; }

/* Whisper / Note Cards for 碎碎念 */
.post-list--whispers .post-row {
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 20px 44px 18px 20px;
  background: var(--note-warm);
  transform: rotate(-.7deg);
}
.post-list--whispers .post-row:nth-child(even) { background: var(--pink-soft); transform: rotate(.7deg); }
.post-list--whispers .post-thumb { display: none; }
.post-list--whispers .post-row-title { font-family: var(--font-display); font-size: 19px; }
.post-list--whispers .excerpt { color: var(--text); line-height: 1.9; }
.post-list--whispers .row-date { text-align: left; }

/* Category-Specific Illustrated Covers */
.post-art {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 20px;
  background: var(--cover-surface);
  color: var(--cover-ink);
}
.post-art[data-cover-kind="tech"] {
  background: var(--blue-soft);
  /* taste-skill-ignore: Subtle engineering grid background for tech articles without images. */ background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 22px 22px;
}
.post-art[data-cover-kind="daily"] { background: var(--pink-soft); color: var(--pink-ink); }
.post-art[data-cover-kind="whisper"] { background: var(--note-warm); color: var(--text); }
.cover-tech-bracket {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  background: var(--surface);
  /* taste-skill-ignore: Speech bubble elevation. */ box-shadow: var(--card-shadow);
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--blue-ink);
}
.cover-daily-scene { position: relative; display: grid; place-items: center; width: 100%; height: 100%; }
.cover-daily-paw { width: 64px; height: 64px; color: var(--pink); opacity: .7; transform: rotate(-10deg); }
.cover-daily-heart { position: absolute; width: 18px; height: 18px; color: var(--pink-ink); opacity: .45; }
.cover-daily-heart.h1 { top: 18%; left: 22%; transform: rotate(-14deg); }
.cover-daily-heart.h2 { bottom: 20%; right: 20%; transform: rotate(16deg); }
.cover-whisper-quote {
  position: relative;
  max-width: 86%;
  padding: 16px 20px;
  border-radius: var(--r-md) var(--r-md) var(--r-md) 4px;
  background: var(--surface);
  /* taste-skill-ignore: Speech bubble elevation. */ box-shadow: var(--card-shadow);
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
  text-align: center;
}
.post-thumb .cover-whisper-quote { padding: 8px 10px; font-size: 13px; line-height: 1.45; }
.post-thumb .cover-tech-bracket { padding: 5px 10px; font-size: 15px; }
.post-thumb .cover-daily-paw { width: 38px; height: 38px; }

.saved-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: var(--pink-soft);
  color: var(--pink-ink);
  font-size: var(--text-xs);
  white-space: nowrap;
}
.saved-badge .icon { width: 12px; height: 12px; }

/* Sleepy Cat Empty State */
#empty {
  padding: 40px 24px;
  text-align: center;
  border-radius: var(--r-md);
  background: var(--card-surface);
  /* taste-skill-ignore: Speech bubble elevation. */ box-shadow: var(--card-shadow);
}
.empty-art { display: block; width: 120px; height: 84px; margin: 0 auto 14px; }
.empty-state h3 { font-family: var(--font-display); font-size: 20px; color: var(--text); }
.empty-state p { max-width: 30em; margin: 8px auto 0; color: var(--muted); font-size: var(--text-sm); }
.empty-action { margin-top: 18px; }

/* Reader Dialog (Desktop Modal & Mobile Bottom Sheet) */
dialog#reader {
  border: 0;
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  padding: 0;
  width: min(820px, calc(100% - 32px));
  max-height: 90svh;
  /* taste-skill-ignore: Modal dialog elevation. */ box-shadow: 0 24px 80px rgb(16 20 38 / .24);
  overscroll-behavior: contain;
}
/* taste-skill-ignore: Modal backdrop blur. */ dialog#reader::backdrop { background: rgb(18 24 43 / .42); backdrop-filter: blur(4px); }
.reader-handle { display: none; }
.reader-controls {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  background: var(--sheet-glass);
  /* taste-skill-ignore: Requested glass reader toolbar. */ backdrop-filter: blur(12px);
  /* taste-skill-ignore: Requested glass reader toolbar. */ -webkit-backdrop-filter: blur(12px);
  /* taste-skill-ignore: Subtle sticky bar bottom hairline. */ border-bottom: 1px solid var(--line);
}
.reader-controls-right { display: flex; align-items: center; gap: 8px; }
.reader-sticky-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
}
.reader-sticky-title.is-visible { opacity: 1; }
#reader-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; overflow: visible; pointer-events: none; }
#reader-progress .progress-track {
  display: block;
  width: 100%;
  height: 100%;
  /* taste-skill-ignore: Requested pink-blue reading progress ribbon. */ background: linear-gradient(90deg, var(--pink), var(--sky));
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
}
.reader-cat {
  position: absolute;
  bottom: 2px;
  left: clamp(14px, calc(var(--progress, 0) * 100%), calc(100% - 26px));
  width: 18px;
  height: 15px;
  color: var(--pink-ink);
  transform: translateX(-50%);
  pointer-events: none;
}
.reader-cat .icon {
  width: 18px;
  height: 15px;
  display: block;
}
.reader-cat .cat-done-heart {
  position: absolute;
  top: -8px;
  right: -5px;
  width: 9px;
  height: 9px;
  color: var(--pink-ink);
  opacity: 0;
}
.reader-content:focus { outline: none; }
.reader-cat.is-finished .cat-done-heart { opacity: 1; }

.reader-content { max-width: 720px; margin: auto; padding: 36px 48px; overflow-wrap: anywhere; min-width: 0; }
#reader-meta { gap: 8px 14px; margin-bottom: 14px; font-size: 13px; }
#reader-meta .category-label { padding: 3px 11px; border-radius: var(--r-pill); background: var(--blue-soft); }
.reader-content h2 { font-size: clamp(24px, 2.8vw, 30px); margin: 8px 0 26px; letter-spacing: .02em; }
.reader-content h3 { margin-top: 28px; }
.reader-content p { margin: 18px 0; line-height: 2; }
.reader-content blockquote {
  margin: 22px 0;
  padding: 14px 20px;
  background: var(--note-surface);
  border-left: 3px solid var(--pink);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.reader-content blockquote p { margin: 0; }
.reader-content blockquote p + p { margin-top: 12px; }
.reader-content :not(pre) > code { padding: 2px 6px; border-radius: 6px; background: var(--pink-soft); color: var(--pink-ink); font-family: var(--mono); font-size: .9em; }
.reader-content pre { max-width: 100%; font-size: var(--text-sm); line-height: 1.7; white-space: pre; overflow-x: auto; tab-size: 2; background: var(--card-surface); padding: 18px; border-radius: var(--r-sm); }
.reader-content pre code { font-family: var(--mono); font-size: inherit; }
.reader-content ul, .reader-content ol { margin: 16px 0; padding-left: 26px; line-height: 1.95; }
.reader-content li + li { margin-top: 6px; }
/* taste-skill-ignore: Semantic Markdown thematic break in reader body. */ .reader-content hr { border: 0; height: 1px; margin: 32px auto; width: 120px; background: var(--control); }
.reader-content img { max-width: 100%; height: auto; border-radius: var(--r-md); margin: 22px auto; }
.reader-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.reader-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 22px 0; font-size: var(--text-sm); }
.reader-content th, .reader-content td { min-width: 120px; padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--control); }
.reader-content th { background: var(--blue-soft); }
.reader-content tr:nth-child(even) { background: var(--note-surface); }

.reader-end {
  background: var(--pink-soft);
  padding: 24px 48px 28px;
  display: grid;
  gap: 18px;
}
.reader-end-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.reader-end-note {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text);
}
.reader-end-note .icon-paw { width: 22px; height: 22px; color: var(--pink-ink); }
.reader-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.reader-nav-card {
  display: grid;
  gap: 4px;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  background: var(--surface);
  text-align: left;
  /* taste-skill-ignore: Speech bubble elevation. */ box-shadow: var(--card-shadow);
}
.reader-nav-card[data-dir="next"] { text-align: right; }
.reader-nav-label { display: inline-flex; align-items: center; gap: 5px; font-size: var(--text-xs); color: var(--muted); }
.reader-nav-card[data-dir="next"] .reader-nav-label { justify-content: flex-end; }
.reader-nav-title { font-family: var(--font-display); font-size: 15px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Toast Popover (lives in top layer above modal dialog) */
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  background: var(--text);
  color: var(--surface);
  padding: 10px 20px;
  border-radius: var(--r-pill);
  z-index: 30;
  font-size: var(--text-sm);
  max-width: calc(100vw - 32px);
  width: max-content;
  text-align: center;
  /* taste-skill-ignore: Top-layer toast notification elevation. */ box-shadow: var(--pill-shadow);
}
#toast[popover] {
  inset: auto auto 28px 50%;
  margin: 0;
  border: 0;
  overflow: visible;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Paw & Stamp Particle Layer */
.paw-burst-layer { position: fixed; inset: 0; z-index: 2147483647; overflow: hidden; pointer-events: none; }
.paw-particle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--pink-ink);
  background: var(--pink-soft);
  padding: 4px 10px;
  /* taste-skill-ignore: Pastel pill rim matches requested Sakura particles. */ border: 1px solid var(--edge);
  border-radius: var(--r-pill);
  white-space: nowrap;
  pointer-events: none;
  /* taste-skill-ignore: Speech bubble elevation. */ box-shadow: var(--card-shadow);
}
.paw-particle:nth-child(even) { background: var(--blue-soft); color: var(--blue-ink); }
/* taste-skill-ignore: Transparent paw stamp resets card shadow. */ .paw-particle--stamp { background: transparent; border: 0; box-shadow: none; padding: 0; color: var(--pink-ink); }
.paw-particle--stamp svg { width: 28px; height: 28px; }

/* Theme Toggle Moon-Cat & Sun */
.theme-moon, .theme-sun { transform-origin: 12px 12px; }
.theme-sun { opacity: 0; transform: rotate(-45deg) scale(.7); }
[data-theme=dark] .theme-moon { opacity: 0; transform: rotate(45deg) scale(.7); }
[data-theme=dark] .theme-sun { opacity: 1; transform: rotate(0) scale(1); }

/* 404 Card */
.not-found-wrap { min-height: 100svh; display: grid; place-items: center; padding: 24px; }
.not-found-card {
  max-width: 440px;
  width: 100%;
  text-align: center;
  padding: 40px 28px;
  border-radius: var(--r-lg);
  background: var(--sheet-surface);
  /* taste-skill-ignore: Sakura panel edge on 404 card. */ border: 1px solid var(--edge);
  /* taste-skill-ignore: Requested 404 panel elevation. */ box-shadow: var(--panel-shadow);
}
.not-found-art { width: 140px; height: 100px; margin: 0 auto 18px; }
.not-found-card h1 { font-size: 28px; margin-bottom: 10px; }
.not-found-card p { color: var(--muted); font-size: var(--text-sm); margin-bottom: 24px; }

@media (max-width: 1150px) {
  .featured { gap: 22px; }
  .feature-copy { padding: 24px 24px 24px 0; }
  .post-row { grid-template-columns: 128px minmax(0, 1fr) 76px; gap: 18px; }
  .post-thumb { width: 128px; height: 96px; }
}

@media (max-width: 1023px) {
  #toast[popover] { inset: auto auto calc(84px + env(safe-area-inset-bottom)) 50%; }
}

@media (max-width: 767px) {
  .profile-avatar { width: 112px; height: 112px; border-radius: 24px; }
  .avatar-ear { top: -9px; width: 20px; height: 16px; }
  .avatar-ear--left { left: 16px; }
  .avatar-ear--right { right: 16px; }
  .profile-facts { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 6px; margin-inline: -2px; }
  .profile-facts::-webkit-scrollbar { display: none; }
  .profile-facts li { flex-shrink: 0; }
  .profile-actions { flex-direction: column; align-items: stretch; }
  .profile-actions .btn-primary, .profile-actions .btn-soft { width: 100%; }
  .folder-tabs { width: 100%; justify-content: space-between; }
  .tab { flex: 1; padding: 6px 6px; font-size: 13px; gap: 4px; }
  .tab-divider { margin-inline: 1px; }
  .search { width: 100%; }
  .featured { display: block; }
  .feature-image { height: 204px; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .feature-copy { padding: 20px; }
  .feature-copy h3 { padding-right: 0; }
  .post-row { grid-template-columns: 76px minmax(0, 1fr); gap: 4px 14px; padding: 14px 44px 14px 14px; }
  .post-thumb { grid-row: 1 / 3; width: 76px; height: 84px; }
  .post-row .excerpt { display: none; }
  .post-row .row-date { grid-column: 2; text-align: left; font-size: var(--text-xs); }
  .post-row-title { font-size: 17px; }
  /* Mobile Bottom Sheet Reader */
  dialog#reader {
    margin: auto 0 0;
    width: 100%;
    max-width: 100%;
    max-height: 92svh;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }
  .reader-handle { grid-column: 1 / -1; display: grid; place-items: center; padding: 2px 0 6px; touch-action: none; }
  .reader-handle span { width: 36px; height: 4px; border-radius: 99px; background: var(--control); }
  .reader-controls { padding: 8px 16px 10px; row-gap: 4px; }
  .reader-content { padding: 24px 20px; }
  .reader-end { padding: 20px; }
  .reader-nav { grid-template-columns: 1fr; }
  .reader-nav-card[data-dir="next"] { text-align: left; }
  .reader-nav-card[data-dir="next"] .reader-nav-label { justify-content: flex-start; }
}

@media (max-width: 399px) {
  .tab.is-empty .tab-count { display: none; }
  .tab-saved .icon { width: 14px; height: 14px; }
}

@media (max-width: 359px) {
  .tab { font-size: 12px; padding: 6px 3px; gap: 3px; }
  .tab-count { min-width: 15px; padding: 0 3px; font-size: 10px; }
  .post-row { grid-template-columns: 64px minmax(0, 1fr); gap: 4px 10px; padding: 12px 38px 12px 10px; }
  .post-thumb { width: 64px; height: 76px; }
  .reader-content { padding: 20px 16px; }
}
