@font-face {
  font-family: Niiro;
  src: url("fonts/NiiroMaruGothic-M.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: KeinanMaruPop;
  src: url("fonts/%E3%81%91%E3%81%84%E3%81%AA%E3%82%93%E4%B8%B8%E3%83%9D%E3%83%83%E3%83%97%E4%BD%93JP.ttf") format("truetype"),
       url("fonts/けいなん丸ポップ体JP.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: TwitterColorEmoji;
  src: url("fonts/TwitterColorEmoji-SVGinOT.ttf") format("opentype") tech(color-SVG),
       url("fonts/TwitterColorEmoji-SVGinOT.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #faf8f3;
  --surface: #fffdf9;
  --text: #282421;
  --muted: #756c64;
  --line: #e5ddd2;
  --accent: #b8583d;
  --accent-2: #e6a44f;
  --shadow: 0 12px 32px #4b30200d;
  --space: clamp(1rem, 2vw, 1.5rem);
}

* {
  box-sizing: border-box;
}

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
}

html {
  scroll-behavior: smooth;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Niiro, KeinanMaruPop, sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

.container {
  width: min(100% - 2rem, 1050px);
  margin: auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(10px);
}

.nav-wrap {
  width: 90%;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 4.5rem;
}
.nav-wrap nav {
  margin: 0 auto;
}
.brand-wrap {
  display: flex;
  align-items: flex-end;
  align-self: stretch;
  gap: 0.45rem;
  flex-shrink: 0;
}
.site-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  line-height: 1;
  margin-bottom: 4px;
  color: var(--fg, currentColor);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}
.site-clock {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.brand img {
  display: block;
  width: auto;
  height: 3.6rem;
  max-width: 8rem;
  object-fit: contain;
}
.nav-toggle {
  flex-shrink: 0;
}

.brand {
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: bold;
}

.nav-toggle {
  display: none;
}

.nav-links {
  display: flex;
  gap: 0.85rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav-links a {
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--muted);
}

.nav-links a:hover,
.nav-links a[aria-current="page"],
.text-link {
  color: var(--accent);
}

main {
  padding: clamp(3rem, 8vw, 7rem) 0;
}

.hero {
  max-width: 720px;
  margin-bottom: clamp(4rem, 10vw, 8rem);
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  line-height: 1.05;
  margin: 0.4rem 0 1.5rem;
}

.lede {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  color: var(--muted);
  max-width: 600px;
}

.placeholder {
  background: #f5dcbf;
  padding: 0 0.12em;
}

.actions {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.button {
  background: var(--accent);
  color: white;
  padding: 0.75rem 1.1rem;
  border-radius: 99px;
  text-decoration: none;
}

.text-link {
  font-weight: bold;
  text-decoration: none;
}

.tour-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-bottom: clamp(4rem, 10vw, 8rem);
}

.tour-grid h2,
.section-heading {
  grid-column: 1/-1;
}

.card,
.post,
.feed-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.card {
  text-decoration: none;
}

.card:hover {
  transform: translateY(-2px);
}

.icon {
  color: var(--accent);
  font-size: 1.5rem;
}

.card h3 {
  margin: 0.75rem 0 0.25rem;
}

.card p,
.summary {
  color: var(--muted);
  margin: 0.2rem 0;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.post-list {
  display: grid;
  gap: 0.75rem;
}

.post {
  display: block;
}

.post h3 {
  margin: 0;
}

.meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.page-intro {
  max-width: 720px;
  margin-bottom: 3rem;
}

/* Editorial article archive and reading view */
.article-archive { display: grid; gap: 2.5rem; }
.article-archive-intro {
  border-top: 1px solid var(--line);
  padding-top: 2rem;
  margin-bottom: 0.5rem;
}
.article-archive-intro h2, .article-empty h2 {
  margin: 0.35rem 0;
  font-family: KeinanMaruPop, Niiro, sans-serif;
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  letter-spacing: -0.02em;
}
.article-archive-intro p:last-child, .article-empty p:last-child {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: clamp(1.4rem, 3.5vw, 2.35rem);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.article-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity 0.25s ease;
}
.article-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.09);
}
.article-card:hover::before {
  opacity: 1;
}

.article-card-meta, .article-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
.article-card-meta span:first-child, .article-detail-kicker {
  color: var(--accent);
  font-weight: 700;
}

.article-card-title {
  margin: 0.85rem 0 0.65rem;
  font-family: KeinanMaruPop, Niiro, sans-serif;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.article-card-title a {
  text-decoration: none;
  color: var(--text);
  transition: color 0.15s ease;
}
.article-card-title a:hover {
  color: var(--accent);
}

.article-card-excerpt {
  color: var(--muted);
  max-width: 65ch;
  margin: 0 0 1.35rem;
  line-height: 1.7;
  font-size: 0.98rem;
  flex: 1;
}

.article-card-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.92rem;
  transition: gap 0.2s ease, color 0.2s ease;
}
.article-card-link:hover {
  gap: 0.65rem;
  color: var(--accent-2);
}

.article-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}
.article-card--featured {
  padding: clamp(1.75rem, 5vw, 3.25rem);
  background: color-mix(in srgb, var(--surface) 92%, var(--bg));
  border: 1px solid var(--line);
}
.article-card--featured::before {
  opacity: 1;
}
.article-card--featured .article-card-title {
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  max-width: 20ch;
  line-height: 1.15;
}

/* Editorial Article Detail View (Public Reader) */
.article-detail {
  max-width: 1020px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1rem, 4vw, 2rem) 5.5rem;
}

.article-detail-header {
  max-width: 820px;
  margin: 0 auto clamp(2.5rem, 6vw, 4rem);
  text-align: center;
  position: relative;
}

.article-detail-kicker {
  display: inline-block;
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
}

.article-detail-header h1 {
  margin: 0.6rem 0 1.2rem;
  font-family: KeinanMaruPop, Niiro, sans-serif;
  font-size: clamp(2.3rem, 6.5vw, 4.4rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.article-detail-excerpt {
  color: var(--muted);
  font-family: Niiro, KeinanMaruPop, sans-serif;
  font-size: 1.22rem;
  line-height: 1.7;
  font-style: italic;
  margin: 1.25rem auto 1.75rem;
  max-width: 64ch;
}

.article-detail-meta {
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.82rem;
}

.article-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 740px) 170px;
  justify-content: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.article-body {
  font-size: 1.12rem;
  line-height: 1.95;
  color: var(--text);
}
.article-body p {
  margin: 0 0 1.65rem;
}
.article-body h2 {
  font-family: KeinanMaruPop, Niiro, sans-serif;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  line-height: 1.25;
  margin: 3.2rem 0 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.6rem;
  letter-spacing: -0.02em;
}
.article-body h3 {
  font-family: KeinanMaruPop, Niiro, sans-serif;
  font-size: 1.35rem;
  line-height: 1.3;
  margin: 2.4rem 0 0.85rem;
}
.article-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 2.2rem 0;
  padding: 1rem 1.6rem;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-radius: 0 0.75rem 0.75rem 0;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text);
}
.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 0.85rem;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  margin: 2.2rem auto;
  display: block;
}

.article-detail-aside {
  position: sticky;
  top: 6rem;
  display: grid;
  gap: 0.85rem;
  font-size: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 1.15rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}
.article-detail-aside .text-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: color 0.15s ease;
}
.article-detail-aside .text-link:hover {
  color: var(--accent);
}

.article-share-button {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--accent);
  padding: 0.55rem 0.85rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
}
.article-share-button:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 35%, transparent);
}

.article-comments {
  max-width: 740px;
  margin: 3.5rem auto 0;
  border-top: 1px solid var(--line);
  padding-top: 2rem;
}
.article-comments h2 {
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 760px) {
  .article-card-grid, .article-detail-layout { grid-template-columns: 1fr; }
  .article-detail-aside { position: static; display: flex; justify-content: space-between; align-items: center; order: -1; }
  .article-detail { padding-top: 2rem; }
}

.page-intro h1 {
  font-size: clamp(2.5rem, 7vw, 4rem);
  line-height: 1.1;
}

.content-grid {
  display: grid;
  gap: 1rem;
}

/* ==========================================================================
   NOW FEED — SOCIAL MEDIA PLATFORM STYLE
   ========================================================================== */

.now-feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.75rem;
}

.now-feed-header h2 {
  margin: 0;
  font-size: 1.65rem;
}

.social-post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  padding: 1.35rem 1.45rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: visible;
}

.feed-expand-wrap {
  position: relative;
  margin: -2.5rem 0 1.5rem;
  padding: 4rem 0 0;
  text-align: center;
  background: linear-gradient(to bottom, transparent, var(--bg) 45%);
  pointer-events: none;
}

.feed-expand-wrap.is-expanded {
  margin-top: 0;
  padding-top: 0;
  background: none;
}

.feed-expand-btn {
  pointer-events: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0.65rem 1.15rem;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.feed-expand-btn:hover {
  background: var(--accent-soft, var(--surface));
}

.post-body-text.is-truncated {
  max-height: 18rem;
  overflow: hidden;
  position: relative;
}

.post-body-text.is-truncated::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 4rem;
  background: linear-gradient(transparent, var(--surface));
  pointer-events: none;
}

.post-body-text.is-truncated.is-expanded {
  max-height: none;
}

.post-body-text.is-truncated.is-expanded::after {
  display: none;
}

.post-read-more-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.post-read-more,
.post-open-link {
  border: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0;
  text-decoration: none;
}

.post-read-more:hover,
.post-open-link:hover {
  text-decoration: underline;
}

.post-headline a {
  color: inherit;
  text-decoration: none;
}

.post-headline a:hover {
  text-decoration: underline;
}

.social-post-card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.09);
}

/* Post Header */
.post-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.post-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
}

.post-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line);
  background: var(--bg);
  display: block;
}

.online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  background-color: #10b981;
  border: 2px solid var(--surface);
  border-radius: 50%;
}

.post-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.post-name-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.post-author-name {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text);
}

.verified-badge {
  color: var(--accent);
  font-size: 0.88rem;
  display: inline-flex;
}

.post-author-handle {
  color: var(--muted);
  font-size: 0.85rem;
}

.post-meta-sub {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.post-meta-sub .meta-dot {
  font-weight: bold;
}

.post-privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  opacity: 0.85;
}

/* Post Headline & Body */
.post-headline {
  margin: 0.35rem 0 0.65rem;
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.post-body-text {
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--text);
}

.post-body-text p:last-child {
  margin-bottom: 0;
}

/* Post Stats Bar */
.social-stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0 0.5rem;
  margin-top: 0.85rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  font-size: 0.84rem;
  color: var(--muted);
}

.social-stats-bar .stat-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.social-stats-bar .likes-stat i {
  color: #ef4444;
}

.social-stats-bar .comments-stat-toggle {
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  transition: color 0.15s ease;
}

.social-stats-bar .comments-stat-toggle:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Action Buttons Strip - Left aligned */
.social-actions {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0.4rem 0;
  margin-top: 0.25rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

@media (min-width: 641px) {
  .social-actions .comment-toggle-btn {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .social-actions .comment-toggle-btn:active {
    transform: translateX(-50%) scale(0.94);
  }

  .social-actions .share-btn {
    margin-left: auto;
  }
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  font-family: inherit;
}

@media (hover: hover) {
  .social-btn:hover {
    background: color-mix(in srgb, var(--text) 6%, transparent);
    color: var(--text);
  }

  .social-btn.like-btn:hover,
  .social-btn.like-btn:hover i {
    color: #ef4444;
    background: color-mix(in srgb, #ef4444 8%, transparent);
  }

  .social-btn.dislike-btn:hover {
    color: #f59e0b;
    background: color-mix(in srgb, #f59e0b 8%, transparent);
  }

  .social-btn.emoji-reaction-btn:hover {
    color: #ec4899;
    background: color-mix(in srgb, #ec4899 8%, transparent);
  }

  .social-btn.comment-toggle-btn:hover,
  .social-btn.comment-toggle-btn.active-toggle {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border-color: color-mix(in srgb, var(--accent) 25%, transparent);
  }

  .social-btn.share-btn:hover,
  .social-btn.share-btn:hover i {
    color: #3b82f6;
    background: color-mix(in srgb, #3b82f6 8%, transparent);
  }
}

.social-btn:active {
  transform: scale(0.94);
  background: color-mix(in srgb, var(--text) 10%, transparent);
}

.social-btn.comment-toggle-btn.active-toggle,
.social-btn.comment-toggle-btn[aria-expanded="true"] {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
}

.social-btn.emoji-reaction-btn[aria-expanded="true"] {
  color: #ec4899;
  background: color-mix(in srgb, #ec4899 10%, transparent);
  border-color: color-mix(in srgb, #ec4899 25%, transparent);
}

.social-btn .btn-count {
  font-weight: 600;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.social-btn .btn-count:empty {
  display: none;
}

.social-btn.share-btn.copied {
  color: #10b981;
  background: color-mix(in srgb, #10b981 12%, transparent);
  border-color: color-mix(in srgb, #10b981 25%, transparent);
}

.social-btn.share-btn.copied i::before {
  content: "\f00c";
}

.reaction-picker-wrap { position: relative; }
.reaction-picker { position: absolute; z-index: 100; bottom: calc(100% + .35rem); left: 0; width: min(30rem, 88vw); padding: .35rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface, #fff); box-shadow: 0 10px 25px rgb(0 0 0 / 15%); }
.reaction-picker emoji-picker { --emoji-size: 1.35rem; --num-columns: 10; --emoji-font-family: TwitterColorEmoji; width: 100%; height: min(34rem, 70vh); }
.reaction-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .2rem; }
.reaction-choice { border: 0; background: transparent; border-radius: .45rem; padding: .35rem; font-size: 1.35rem; cursor: pointer; font-family: TwitterColorEmoji; }
.reaction-choice:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.custom-reaction-form { display: flex; gap: .35rem; margin-top: .55rem; border-top: 1px solid var(--line); padding-top: .55rem; }
.custom-reaction-input { min-width: 0; flex: 1; padding: .35rem .45rem; border: 1px solid var(--line); border-radius: .4rem; background: transparent; color: inherit; }
.custom-reaction-submit { border: 0; border-radius: .4rem; padding: .35rem .5rem; background: var(--accent); color: white; cursor: pointer; }
.reaction-summary { display: inline-flex; gap: .25rem; margin-left: .45rem; }
.reaction-summary-item { white-space: nowrap; font-family: TwitterColorEmoji; }
.emoji-reaction-btn > span[aria-hidden="true"] { font-family: TwitterColorEmoji; }

/* Keep the complete category browser visible above the card and let users
   move through categories in sequence inside one continuous picker. */
.reaction-picker emoji-picker::part(picker) { max-height: none; }
.reaction-picker emoji-picker[hidden] + .continuous-emoji-grid { display: grid; }
.continuous-emoji-grid {
  overflow-y: auto;
  height: min(34rem, 70vh);
  padding: .15rem;
}
.continuous-emoji-categories {
  display: flex;
  gap: .25rem;
  overflow-x: auto;
  padding: .15rem .15rem .45rem;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}
.continuous-emoji-category-button {
  flex: 0 0 auto;
  border: 0;
  border-radius: .4rem;
  padding: .3rem .45rem;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: .72rem;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}
.continuous-emoji-category-button:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.continuous-emoji-category { scroll-margin-top: .25rem; padding: .45rem 0 .7rem; }
.continuous-emoji-category + .continuous-emoji-category { border-top: 1px solid var(--line); padding-top: .75rem; }
.continuous-emoji-category h3 { margin: 0 0 .35rem; color: var(--muted); font-size: .72rem; font-weight: 600; }
.continuous-emoji-section-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: .15rem; }
.continuous-emoji-button {
  border: 0;
  border-radius: .4rem;
  padding: .35rem .1rem;
  background: transparent;
  color: inherit;
  font: 1.35rem/1 TwitterColorEmoji;
  cursor: pointer;
}
.continuous-emoji-button:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* Mobile layouts for social post action buttons and reaction picker */
@media (max-width: 640px) {
  .social-post-card {
    padding: 1.15rem 0.95rem;
    border-radius: 1rem;
  }

  .social-stats-bar {
    padding: 0.6rem 0 0.45rem;
    font-size: 0.8rem;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .social-actions {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 0.25rem;
    padding: 0.35rem 0;
    margin-top: 0.35rem;
    width: 100%;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  }

  .social-actions .comment-toggle-btn {
    position: static;
    left: auto;
    transform: none;
    margin: 0;
  }

  .social-actions .share-btn {
    margin-left: 0;
  }

  .social-actions > .social-btn,
  .social-actions > .reaction-picker-wrap {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    display: flex;
  }

  .reaction-picker-wrap .emoji-reaction-btn {
    width: 100%;
    height: 100%;
  }

  /* Strip text labels on mobile layout */
  .social-actions .btn-label {
    display: none !important;
  }

  /* Show brief copied message when share is tapped */
  .social-actions .share-btn.copied .btn-label {
    display: inline !important;
    font-size: 0.78rem;
  }

  /* Like and dislike counts are exempt, showing numbers when greater than zero */
  .social-actions .btn-count {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1;
  }

  .social-actions .btn-count:empty {
    display: none !important;
  }

  .social-btn {
    width: 100%;
    padding: 0.48rem 0.2rem;
    font-size: 0.84rem;
    gap: 0.3rem;
    border-radius: 0.55rem;
    min-height: 2.45rem;
    white-space: nowrap;
    justify-content: center;
  }

  .social-btn i,
  .social-btn span[aria-hidden="true"] {
    font-size: 1.05rem;
    flex-shrink: 0;
    line-height: 1;
  }

  .reaction-picker {
    position: fixed;
    z-index: 9999;
    left: 50%;
    transform: translateX(-50%);
    bottom: max(1rem, env(safe-area-inset-bottom, 1rem));
    top: auto;
    width: min(22rem, calc(100vw - 1.5rem));
    max-width: calc(100vw - 1.5rem);
    max-height: 55vh;
    padding: 0.4rem;
    border-radius: 1rem;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28), 0 0 0 1px var(--line);
    background: var(--surface, #fff);
  }

  .reaction-picker emoji-picker {
    --emoji-size: 1.25rem;
    --num-columns: 8;
    width: 100%;
    height: min(22rem, 45vh);
  }
}

@media (max-width: 420px) {
  .social-post-card {
    padding: 1rem 0.75rem;
  }

  .social-actions {
    gap: 0.18rem;
  }

  .social-btn {
    padding: 0.45rem 0.15rem;
    min-height: 2.35rem;
    gap: 0.25rem;
  }

  .social-btn i,
  .social-btn span[aria-hidden="true"] {
    font-size: 1rem;
  }

  .social-actions .btn-count {
    font-size: 0.78rem;
  }
}

/* Comments Section - Collapsible */
.comments-section {
  margin-top: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-top: 0.25rem;
  animation: fadeInComments 0.2s ease-out;
}

.comments-preview {
  margin: 0.85rem 0 0;
  display: grid;
  gap: 0.55rem;
}

.comments-preview .social-comment-bubble {
  margin: 0;
}

.social-post-card.comments-open .comments-preview {
  display: none;
}

.comments-section[hidden] {
  display: none !important;
}

@keyframes fadeInComments {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.social-comment-bubble {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.comment-avatar-bubble {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 15%, var(--surface));
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.comment-avatar-bubble.user-temp-avatar {
  background: var(--bg);
  color: var(--muted);
  border-color: var(--line);
  font-size: 0.85rem;
}

.comment-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.comment-content-wrap {
  background: color-mix(in srgb, var(--bg) 75%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  border-radius: 0.95rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.88rem;
  flex: 1;
  word-break: break-word;
}

.comment-author-title {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.comment-text-body {
  color: var(--text);
  line-height: 1.45;
}

/* Comment Form Input Row */
.social-comment-input-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.social-input-wrapper {
  display: flex;
  flex: 1;
  gap: 0.4rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.5rem 0.25rem 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.social-input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}

.social-input-name {
  width: 110px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.84rem;
  font-family: inherit;
  padding: 0.35rem 0;
  border-right: 1px solid var(--line);
  padding-right: 0.45rem;
}

.social-input-name:focus {
  outline: none;
}

.social-input-name::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.social-input-text {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.86rem;
  font-family: inherit;
  padding: 0.35rem 0.4rem;
  min-width: 0;
}

.social-input-text:focus {
  outline: none;
}

.social-input-text::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.social-comment-submit-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.15s ease;
  font-size: 0.88rem;
}

.social-comment-submit-btn:hover {
  opacity: 0.9;
  transform: scale(1.05);
}

.social-comment-submit-btn:active {
  transform: scale(0.95);
}

.comment-pending {
  opacity: 0.55;
}

.comment-pending-status {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
}

.feed-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 1rem;
  color: var(--muted);
}

.feed-empty-state i {
  font-size: 2.2rem;
  margin-bottom: 0.6rem;
  display: block;
  opacity: 0.6;
}

@media (max-width: 580px) {
  .social-comment-input-row {
    flex-wrap: wrap;
  }
  .social-input-wrapper {
    flex-direction: column;
    border-radius: 0.85rem;
    padding: 0.5rem 0.75rem;
    width: 100%;
  }
  .social-input-name {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.35rem;
  }
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}

.gallery button {
  border: 0;
  padding: 0;
  background: none;
  cursor: zoom-in;
}

.gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0.75rem;
}

.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: #000c;
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 10;
}

.lightbox img {
  max-width: 95vw;
  max-height: 85vh;
}

.lightbox-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  font-size: 2rem;
  background: none;
  border: 0;
  color: white;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .nav-toggle {
    display: block;
    background: none;
    border: 0;
    font-size: 1.3rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 4.5rem;
    background: var(--bg);
    padding: 1rem;
    flex-direction: column;
    border-bottom: 1px solid var(--line);
  }

  .nav-links.open {
    display: flex;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #211d1a;
    --surface: #2a2521;
    --text: #f4eee6;
    --muted: #c4b8aa;
    --line: #473b32;
    --accent: #ee8967;
    --accent-2: #f0c477;
  }

  .placeholder {
    background: #61432d;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Catppuccin Mauve on a monochrome base */
:root {
  --bg: #f2f2f2;
  --surface: #ffffff;
  --text: #242424;
  --muted: #6f6f6f;
  --line: #d8d8d8;
  --accent: #8839ef;
  --accent-2: #b48cf2;
  --shadow: 0 12px 32px #24242412;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #111114;
    --text: #f1f1f1;
    --muted: #b5b5b5;
    --line: #2a2a2e;
    --accent: #cba6f7;
    --accent-2: #e0c5ff;
    --shadow: 0 12px 32px #00000060;
  }

  .placeholder {
    background: #493965;
  }
}

body {
  background: var(--bg);
  letter-spacing: 0.01em;
}

.site-header {
  position: relative;
  background: transparent;
  border: 0;
  backdrop-filter: none;
}

.nav-wrap {
  max-width: 920px;
  min-height: 3.25rem;
  border-bottom: 1px solid var(--line);
}

.brand,
.nav-links a {
  font-family: Niiro, KeinanMaruPop, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.67rem;
}

.nav-links {
  gap: 1.2rem;
}

.site-paper {
  width: 90%;
  margin: 0 auto 3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px #00000012;
}

.site-paper main {
  padding: 0 clamp(1.25rem, 5vw, 4.5rem) 4rem;
}

.masthead {
  position: relative;
  overflow: hidden;
  text-align: center;
  width: 90%;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: var(--surface);
  box-shadow: 0 18px 40px #00000012;
  min-height: clamp(280px, 42vh, 480px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(3rem, 8vw, 6rem) 1.5rem;
}

.masthead-video-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.masthead-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.masthead-overlay {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(1.5px);
}

.masthead-content {
  position: relative;
  z-index: 1;
}
/* Extend the Home editorial canvas to the remaining standalone pages. */
body > main.container,
.site-paper > main.container {
  width: 90%;
  margin: 0 auto 3rem;
  padding: 0 clamp(0.5rem, 1.5vw, 1.25rem) 2.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px #00000012;
}

/* Articles page: site-paper is the outer 90% box, main fills it fully */
.articles-page {
  padding: 0 clamp(0.5rem, 1.5vw, 1.25rem) 2.5rem;
}

body > main.container .page-intro,
.site-paper > main.container .page-intro,
.articles-page .page-intro {
  text-align: center;
  max-width: none;
  border-bottom: 1px solid var(--line);
  padding: clamp(2rem, 5vw, 3.5rem) 0 1.5rem;
  margin: 0 0 clamp(1.5rem, 4vw, 3rem);
}
body > main.container .page-intro h1,
.site-paper > main.container .page-intro h1,
.articles-page .page-intro h1 {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
}
body > main.container .page-intro .lede,
.site-paper > main.container .page-intro .lede,
.articles-page .page-intro .lede {
  margin-left: auto;
  margin-right: auto;
  max-width: 600px;
}
body > main.container .post {
  box-shadow: none;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}
body > main.container .post-list {
  gap: 0;
}
body > main.container .gallery {
  padding-top: 1rem;
}

.masthead h1 {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  margin: 0.3rem 0;
}

.masthead p:last-child {
  font-family: Niiro, KeinanMaruPop, sans-serif;
  font-style: italic;
  color: var(--muted);
  margin: 0;
}

.template-layout {
  display: grid;
  gap: 3rem;
}

.template-layout > section {
  min-width: 0;
}

.template-sidebar {
  border-top: 1px solid var(--line);
  padding-top: 2rem;
}

.template-sidebar h2 {
  font-family: KeinanMaruPop, Niiro, sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
}

.template-sidebar section {
  margin-bottom: 2rem;
}

.template-sidebar p {
  font-size: 0.9rem;
  color: var(--muted);
}

.sidebar-links {
  display: grid;
  gap: 0.4rem;
}

.sidebar-links a {
  background: var(--accent);
  color: #fff;
  text-align: center;
  padding: 0.35rem;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
}

.social-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  box-sizing: border-box;
}

.social-link:hover {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border-color: var(--accent);
  color: var(--accent);
}

.social-link i {
  width: 1.1rem;
  text-align: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.social-copy-btn {
  text-align: left;
}

.social-copy-btn .social-label {
  flex-grow: 1;
}

.social-copy-btn .copy-badge {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.4rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  transition: all 0.2s ease;
}

.social-copy-btn:hover .copy-badge {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.social-copy-btn.copied {
  border-color: #2e7d32;
  color: #2e7d32;
  background: color-mix(in srgb, #2e7d32 8%, var(--surface));
}

.social-copy-btn.copied .copy-badge {
  background: #2e7d32;
  color: #fff;
  border-color: #2e7d32;
}

.home-now {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding-top: 2rem;
}

.site-footer {
  background: transparent;
}

.site-footer .container {
  max-width: 920px;
  text-align: center;
}

.footer-links {
  margin: 0 auto 1.5rem;
  max-width: 42rem;
}

.footer-links h2 {
  margin: 0 0 0.75rem;
  color: var(--text);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.footer-links ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.footer-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.footer-links a i {
  font-size: 0.7rem;
}

.footer-credit {
  margin: 0;
}

@media (min-width: 760px) {
  .template-layout {
    grid-template-columns: minmax(0, 2.1fr) minmax(180px, 0.9fr);
    gap: 4rem;
  }

  .template-sidebar {
    border-top: 0;
    border-left: 1px solid var(--line);
    padding: 0 0 0 2rem;
  }

  .template-layout .page-intro h2 {
    font-family: KeinanMaruPop, Niiro, sans-serif;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.15;
  }

  .template-layout .page-intro {
    margin-bottom: 3rem;
  }
}

/* Use the supplied typeface exclusively and keep the home container compact. */
body,
.brand,
.nav-links a,
.masthead,
.masthead p:last-child,
.template-layout .page-intro h2,
.gallery-albums,
.gallery-album-tile,
.album-tile-content,
.album-tile-count {
  font-family: Niiro, KeinanMaruPop, sans-serif;
}

h1,
.album-tile-name {
  font-family: KeinanMaruPop, Niiro, sans-serif;
}

.site-paper main {
  padding: 0 clamp(0.5rem, 1.5vw, 1.25rem) 1.75rem;
}

.masthead {
  margin-bottom: 0;
}
@media (max-width: 760px) {
  .nav-wrap {
    grid-template-columns: 1fr auto;
  }
  .nav-wrap nav {
    grid-column: 1;
  }
  .site-clock {
    display: none;
  }
  .nav-toggle {
    grid-column: 2;
  }
  .nav-links.open {
    top: 3.25rem;
  }
}
.nav-wrap {
  max-width: none;
}
.nav-links a::before {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-right: 0.38rem;
  font-size: 0.72em;
}
small {
  font-size: 0.7em;
}
.nav-links a[href="index.html"]::before {
  content: "\f015";
}
.nav-links a[href="life.html"]::before {
  content: "\f1bb";
}
.nav-links a[href="projects.html"]::before {
  content: "\f1b2";
}
.nav-links a[href="gallery.html"]::before {
  content: "\f03e";
}
.template-sidebar h2::before {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-right: 0.45rem;
  color: var(--accent);
}
.template-sidebar section:nth-child(1) h2::before {
  content: "\f2bd";
}
.template-sidebar section:nth-child(2) h2::before {
  content: "\f03a";
}
.template-sidebar section:nth-child(3) h2::before {
  content: "\f1e0";
}

/* ==========================================================================
   ADMIN PAGE & LOGIN REDESIGN (Mobile-Friendly & Responsive)
   ========================================================================== */

.admin-container {
  max-width: 1050px;
  width: min(100% - 1.5rem, 1050px);
  margin: 0 auto;
  box-sizing: border-box;
  overflow-x: hidden;
}

@media (max-width: 768px) {
  .admin-container {
    width: calc(100% - 1.25rem);
    max-width: 100%;
    padding: 0.75rem 0 3.5rem;
    margin: 0 auto;
    box-sizing: border-box;
  }
}

/* --- Login / Auth Card --- */
.admin-auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  padding: 2rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 40px #00000015;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-badge {
  width: 3.5rem;
  height: 3.5rem;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

.auth-header h1 {
  font-size: 1.6rem;
  margin: 0 0 0.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.auth-subtitle {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0;
}

.auth-form {
  display: grid;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 0.95rem;
  color: var(--muted);
  font-size: 0.95rem;
  pointer-events: none;
}

.input-with-icon input {
  width: 100%;
  padding: 0.8rem 0.9rem 0.8rem 2.55rem;
  min-height: 48px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  color: var(--text);
  font-family: inherit;
  font-size: 16px; /* Prevents auto-zoom on iOS */
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-with-icon input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.password-toggle-btn {
  position: absolute;
  right: 0.4rem;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 0.5rem;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.4rem;
  font-size: 0.95rem;
  touch-action: manipulation;
}
.password-toggle-btn:hover {
  color: var(--accent);
}

.auth-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  min-height: 48px;
  font-size: 0.98rem;
  font-weight: 700;
  border-radius: 0.75rem;
  cursor: pointer;
  border: 0;
  margin-top: 0.5rem;
  transition: opacity 0.2s ease, transform 0.1s ease;
  touch-action: manipulation;
}

.auth-submit-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}
.auth-submit-btn:active {
  transform: scale(0.98);
}

.auth-footer-tip {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.auth-footer-tip kbd {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  padding: 0.15rem 0.4rem;
  font-family: monospace;
  font-size: 0.75rem;
}

@media (max-width: 600px) {
  .admin-auth-wrapper {
    min-height: calc(100vh - 12rem);
    padding: 1.25rem 0.5rem;
  }
  .auth-card {
    padding: 1.75rem 1.25rem;
    border-radius: 1.15rem;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
  }
  .auth-header {
    margin-bottom: 1.5rem;
  }
  .auth-badge {
    width: 3.25rem;
    height: 3.25rem;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
  }
  .auth-header h1 {
    font-size: 1.35rem;
  }
  .auth-subtitle {
    font-size: 0.82rem;
  }
  .auth-footer-tip {
    font-size: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
  }
}

/* Status Banner Alerts */
.status-banner {
  font-size: 0.85rem;
  border-radius: 0.5rem;
  padding: 0.75rem 0.9rem;
  line-height: 1.4;
}

.status-banner:empty {
  display: none;
}

.status-banner.info {
  background: color-mix(in srgb, var(--accent-2) 15%, transparent);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--accent-2) 40%, transparent);
}

.status-banner.error {
  background: #ff003315;
  color: #d32f2f;
  border: 1px solid #ff003330;
}

.status-banner.success {
  background: #2e7d3215;
  color: #2e7d32;
  border: 1px solid #2e7d3230;
}

/* --- Admin Post Editor Wrapper & Header --- */
.admin-editor-wrapper {
  display: grid;
  gap: 1.5rem;
  min-width: 0;
}

.editor-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.85rem 1.25rem;
  box-shadow: 0 4px 16px #00000008;
  flex-wrap: wrap;
  gap: 1rem;
}

.content-type-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.28rem;
  border: 1px solid #27272e;
  border-radius: 999px;
  background: #141418;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.15);
}

.content-type-switch .tab-btn {
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #9ca3af;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  touch-action: manipulation;
}

.content-type-switch .tab-btn:hover {
  color: #f4f4f5;
  background: rgba(255, 255, 255, 0.08);
}

.content-type-switch .tab-btn.active {
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 45%, transparent);
}

@media (prefers-color-scheme: dark) {
  .content-type-switch {
    background: #0d0d10;
    border-color: #26262d;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04);
  }
  .content-type-switch .tab-btn {
    color: #9898a6;
  }
  .content-type-switch .tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.09);
  }
  .content-type-switch .tab-btn.active {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 2px 12px color-mix(in srgb, var(--accent) 50%, transparent);
  }
}

.user-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.admin-profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  flex: 0 0 auto;
}

.status-dot.online {
  width: 0.65rem;
  height: 0.65rem;
  background: #2e7d32;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #2e7d3230;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.user-role-badge {
  background: var(--accent);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.18rem 0.55rem;
  border-radius: 99px;
  flex-shrink: 0;
}

.user-email {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.account-actions-group {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.account-actions-menu {
  position: relative;
}

@media (min-width: 769px) {
  .account-actions-menu > summary,
  .category-selector-menu > summary {
    display: none;
  }
}

.account-actions-toggle {
  list-style: none;
  cursor: pointer;
}

.account-actions-toggle::-webkit-details-marker {
  display: none;
}

.account-actions-chevron {
  font-size: 0.7rem;
  transition: transform 0.15s ease;
}

.account-actions-menu[open] .account-actions-chevron {
  transform: rotate(180deg);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  min-height: 36px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  touch-action: manipulation;
  user-select: none;
}

.action-btn:hover {
  background: var(--surface);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.action-btn:active {
  transform: scale(0.97);
}

.action-btn.danger-btn:hover {
  background: #ff003310;
  border-color: #ff003350;
  color: #d32f2f;
}

/* Mobile Header Optimizations */
@media (max-width: 768px) {
  .admin-editor-wrapper {
    gap: 0.7rem;
  }
  .editor-header-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.65rem 0.7rem;
    gap: 0.55rem;
    border-radius: 0.9rem;
  }
  .user-identity {
    width: 100%;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--line);
  }
  .user-info {
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
  }
  .header-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.45rem;
  }
  .header-actions .content-type-switch {
    width: 100%;
    display: flex;
    padding: 0.25rem;
    box-sizing: border-box;
  }
  .header-actions .content-type-switch .tab-btn {
    flex: 1;
    justify-content: center;
    padding: 0.4rem 0.55rem;
    font-size: 0.85rem;
    min-height: 38px;
  }
  .account-actions-group {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-direction: column;
    align-items: stretch;
    width: 12rem;
    padding: 0.45rem;
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    z-index: 20;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.7rem;
    box-shadow: 0 10px 24px #00000030;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .account-actions-group::-webkit-scrollbar {
    display: none;
  }
  .account-actions-group .action-btn {
    white-space: nowrap;
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    justify-content: flex-start;
  }

  .account-actions-toggle {
    justify-content: center;
    padding: 0.35rem 0.6rem;
  }

  .account-actions-menu {
    align-self: flex-end;
    width: max-content;
  }
}

/* --- View Mode Tabs --- */
.editor-view-tabs {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 0.28rem;
  gap: 0.28rem;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  min-height: 38px;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 0.55rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
  user-select: none;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent);
}

@media (max-width: 768px) {
  .editor-view-tabs {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    padding: 0.25rem;
    gap: 0.25rem;
    border-radius: 0.75rem;
  }
  .editor-view-tabs .tab-btn {
    flex: 1;
    justify-content: center;
    min-height: 38px;
    padding: 0.4rem 0.25rem;
    font-size: 0.85rem;
    border-radius: 0.55rem;
  }
}

/* --- Editor Grid Layouts --- */
.editor-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 1rem;
}

/* Write Mode: Editor 100%, Preview hidden */
.editor-grid.view-write .preview-pane {
  display: none;
}
.editor-grid.view-write .edit-pane {
  grid-column: 1 / -1;
}

/* Preview Mode: Editor hidden, Preview 100% */
.editor-grid.view-preview .edit-pane {
  display: none;
}
.editor-grid.view-preview .preview-pane {
  grid-column: 1 / -1;
}

/* Split Mode: Desktop 50% / 50% */
@media (min-width: 860px) {
  .editor-grid.view-split {
    grid-template-columns: 1fr 1fr;
  }
}

/* Split Mode on Mobile: stacked comfortably */
@media (max-width: 859px) {
  .editor-grid.view-split {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.editor-pane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 8px 24px #0000000a;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

/* Keep long editor controls from widening the page on narrow screens. */
.editor-workspace,
.editor-form,
.editor-grid,
.edit-pane,
.preview-pane {
  min-width: 0;
  max-width: 100%;
}

.editor-form {
  overflow: hidden;
}

@media (max-width: 768px) {
  .editor-pane {
    padding: 0.7rem;
    border-radius: 0.7rem;
    gap: 0.6rem;
  }
}

.editor-title-input {
  width: 100%;
  border: 0;
  border-bottom: 2px solid var(--line);
  background: transparent;
  padding: 0.6rem 0;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 44px;
}

.editor-title-input:focus {
  outline: none;
  border-color: var(--accent);
}

@media (max-width: 768px) {
  .editor-title-input {
    font-size: 1.15rem;
    padding: 0.35rem 0;
  }
}

/* Rich Toolbar */
.editor-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.4rem;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.toolbar-divider {
  width: 1px;
  height: 1.25rem;
  background: var(--line);
  margin: 0 0.2rem;
}

.tool-btn {
  background: transparent;
  border: 0;
  color: var(--text);
  padding: 0.4rem 0.55rem;
  min-width: 36px;
  min-height: 36px;
  border-radius: 0.45rem;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: background 0.15s ease, color 0.15s ease;
  touch-action: manipulation;
  user-select: none;
}

.tool-btn:hover {
  background: var(--surface);
  color: var(--accent);
}

.tool-btn.highlight-tool {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
}

.tool-btn.highlight-tool:hover {
  background: var(--accent);
  color: white;
}

.tool-text {
  font-weight: bold;
  font-size: 0.8rem;
}

/* Mobile Horizontal Scrollable Markdown Toolbar */
@media (max-width: 768px) {
  .editor-toolbar {
    flex-wrap: wrap;
    overflow: visible;
    max-height: none;
    gap: 0.3rem;
    padding: 0.3rem 0.4rem;
    border-radius: 0.75rem;
    position: sticky;
    top: 0.5rem;
    z-index: 5;
    background: color-mix(in srgb, var(--surface) 92%, var(--bg));
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  }
  .editor-toolbar::-webkit-scrollbar {
    display: none;
  }
  .toolbar-group {
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  .toolbar-divider {
    flex-shrink: 0;
    margin: 0 0.15rem;
  }
  .tool-btn {
    min-width: 40px;
    min-height: 38px;
    padding: 0.45rem;
    font-size: 0.92rem;
    border-radius: 0.5rem;
  }
  .tool-btn.highlight-tool {
    padding: 0.45rem 0.8rem;
    min-height: 40px;
    border-radius: 999px;
  }
}

/* Drag and Drop Textarea Container */
.textarea-dropzone-wrapper {
  position: relative;
  width: 100%;
}

.drop-overlay {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--accent) 92%, white);
  color: white;
  border: 2px dashed var(--accent);
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 5;
}

.textarea-dropzone-wrapper.drag-active .drop-overlay {
  opacity: 0.96;
  pointer-events: auto;
}

.drop-icon {
  font-size: 2.5rem;
}

.editor-textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1rem;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 16px; /* Prevents auto-zoom on iOS */
  line-height: 1.65;
  resize: vertical;
  min-height: 260px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.editor-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.editor-pane-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 0.4rem;
}

.stat-bullet {
  margin: 0 0.3rem;
}

@media (max-width: 600px) {
  .editor-textarea {
    min-height: 190px;
    padding: 0.7rem;
  }
  .editor-pane-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}

/* Media Drawer Session Thumbnails */
.media-drawer-container {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 1rem;
  margin-top: 1rem;
}

.media-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.drawer-title {
  font-weight: bold;
  font-size: 0.88rem;
  color: var(--text);
}

.drawer-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

.media-thumbnails-grid {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.5rem;
}

.media-thumb-card {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid var(--line);
}

.media-thumb-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-overlay {
  position: absolute;
  inset: 0;
  background: #00000080;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.media-thumb-card:hover .thumb-overlay,
.media-thumb-card:focus-within .thumb-overlay {
  opacity: 1;
}

.thumb-action {
  background: var(--surface);
  color: var(--text);
  border: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  touch-action: manipulation;
}

.thumb-action:hover {
  background: var(--accent);
  color: white;
}

@media (max-width: 600px) {
  .media-drawer-container {
    padding: 0.85rem;
  }
  .media-thumb-card {
    width: 72px;
    height: 72px;
  }
  .thumb-overlay {
    opacity: 0.85; /* Keep overlay slightly visible on touch devices */
  }
  .thumb-action {
    width: 2.1rem;
    height: 2.1rem;
  }
}

/* --- Form Submit Controls --- */
.editor-form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.publish-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.8rem 1.6rem;
  min-height: 48px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  border: 0;
  border-radius: 0.75rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  touch-action: manipulation;
}

.publish-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent);
}

.publish-btn:active {
  transform: scale(0.98);
}

@media (max-width: 768px) {
  .editor-form-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-top: 0.65rem;
  }
  .publish-btn {
    width: 100%;
    min-height: 50px;
    font-size: 1.05rem;
    border-radius: 0.85rem;
    box-shadow: 0 4px 18px color-mix(in srgb, var(--accent) 35%, transparent);
  }
  .editor-form-actions .status-banner {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }
}

/* --- Live Natural Preview Card Styling --- */
.preview-pane {
  background: var(--bg);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

.preview-badge {
  color: var(--accent);
  font-weight: bold;
}

.preview-card {
  box-shadow: 0 4px 16px #00000008;
}

.preview-empty-hint {
  color: var(--muted);
  font-style: italic;
}

/* ==========================================================================
   ARTICLE COMPOSER MODE & EDITORIAL DISPLAY
   ========================================================================== */

/* Article Writing Area (Edit Pane) */
.article-composer-mode .edit-pane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 1rem;
  padding: clamp(1.25rem, 3.5vw, 2.5rem);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.article-composer-mode .edit-pane::before {
  content: "LONG-FORM ESSAY / ARTICLE STUDIO";
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  width: fit-content;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

.article-composer-mode .composer-category-group {
  background: color-mix(in srgb, var(--surface) 60%, var(--bg));
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 0.85rem 1.1rem;
  margin-bottom: 0.25rem;
}

.article-composer-mode .editor-title-input {
  font-family: KeinanMaruPop, Niiro, sans-serif;
  font-size: clamp(1.8rem, 4.5vw, 3.2rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  border: 0;
  border-bottom: 2px solid var(--line);
  border-radius: 0;
  padding: 0.5rem 0 0.95rem;
  background: transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.article-composer-mode .editor-title-input::placeholder {
  font-family: Niiro, KeinanMaruPop, sans-serif;
  font-style: italic;
  font-weight: 400;
  color: color-mix(in srgb, var(--muted) 55%, transparent);
}

.article-composer-mode .editor-title-input:focus {
  outline: none;
  border-bottom-color: var(--accent);
  box-shadow: 0 2px 0 0 var(--accent);
}

/* Article Floating/Docked Markdown Toolbar */
.article-composer-mode .editor-toolbar {
  max-width: 100%;
  margin: 0.25rem 0;
  width: 100%;
  background: color-mix(in srgb, var(--surface) 85%, var(--bg));
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.45rem 0.65rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  gap: 0.35rem;
}

.article-composer-mode .tool-btn {
  color: var(--muted);
  border-radius: 0.45rem;
  padding: 0.42rem 0.6rem;
  transition: all 0.15s ease;
}

.article-composer-mode .tool-btn:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 15%, transparent);
}

/* Article Distraction-Free Manuscript Textarea */
.article-composer-mode .editor-textarea {
  min-height: 480px;
  max-width: 100%;
  margin: 0;
  background: color-mix(in srgb, var(--bg) 65%, var(--surface));
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: clamp(1.25rem, 3.5vw, 2.35rem);
  font-family: Niiro, KeinanMaruPop, sans-serif;
  font-size: 16px; /* Prevent iOS zoom */
  line-height: 1.95;
  color: var(--text);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.article-composer-mode .editor-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent), inset 0 2px 6px rgba(0, 0, 0, 0.04);
  outline: none;
}

.article-composer-mode .editor-pane-footer {
  max-width: 100%;
  width: 100%;
  margin: 0.35rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.article-composer-mode .editor-stats {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
}

/* Article Display / Live Preview Pane */
.article-composer-mode .preview-pane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent-2);
  border-radius: 1rem;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.article-composer-mode .preview-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.article-composer-mode .preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.article-composer-mode .preview-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  max-width: 740px;
  margin: 0 auto;
  padding: 0 0 2rem;
}

.article-composer-mode .preview-card .post-header,
.article-composer-mode .preview-card .social-stats-bar,
.article-composer-mode .preview-card .social-actions {
  display: none !important;
}

.article-composer-mode .preview-card .post-category-badge-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.article-composer-mode .preview-card .preview-title-output {
  font-family: KeinanMaruPop, Niiro, sans-serif;
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  margin: 0.85rem 0 1rem;
  word-break: break-word;
}

.preview-article-meta {
  display: none;
}

.article-composer-mode .preview-article-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.65rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin: 0 auto 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
}

.article-composer-mode .preview-article-meta span:first-child {
  color: var(--accent);
  font-weight: 700;
}

.article-composer-mode .preview-card .preview-body-output {
  max-width: 680px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.95;
  color: var(--text);
}

.article-composer-mode .preview-card .preview-body-output p {
  margin-bottom: 1.6rem;
}

.article-composer-mode .preview-card .preview-body-output h1,
.article-composer-mode .preview-card .preview-body-output h2 {
  font-family: KeinanMaruPop, Niiro, sans-serif;
  margin-top: 2.8rem;
  margin-bottom: 0.9rem;
  line-height: 1.25;
  font-size: clamp(1.4rem, 3vw, 1.95rem);
  color: var(--text);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.45rem;
  letter-spacing: -0.02em;
}

.article-composer-mode .preview-card .preview-body-output h3 {
  font-family: KeinanMaruPop, Niiro, sans-serif;
  margin-top: 2.2rem;
  margin-bottom: 0.65rem;
  font-size: 1.25rem;
  color: var(--text);
}

.article-composer-mode .preview-card .preview-body-output blockquote {
  border-left: 3px solid var(--accent);
  margin: 2rem 0;
  padding: 0.85rem 1.4rem;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-radius: 0 0.65rem 0.65rem 0;
  font-style: italic;
  font-size: 1.08rem;
  color: var(--text);
}

.article-composer-mode .preview-card .preview-body-output img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  margin: 1.8rem auto;
  display: block;
}

@media (max-width: 768px) {
  .article-composer-mode .edit-pane {
    padding: 1rem;
    border-radius: 0.85rem;
    gap: 0.85rem;
  }
  .article-composer-mode .editor-title-input {
    font-size: 1.6rem;
  }
  .article-composer-mode .editor-textarea {
    min-height: 320px;
    padding: 1rem;
    font-size: 16px;
  }
  .article-composer-mode .preview-pane {
    padding: 1rem;
    border-radius: 0.85rem;
  }
  .article-composer-mode .preview-card .preview-title-output {
    font-size: 1.65rem;
  }
}

/* ==========================================================================
   NATURAL FORMATTING & POST CONTENT TYPOGRAPHY
   ========================================================================== */

.post-content {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
}

.post-content h1,
.post-content h2,
.post-content h3 {
  font-family: inherit;
  color: var(--text);
  margin: 1.2rem 0 0.5rem;
  line-height: 1.25;
}

.post-content h1 { font-size: 1.6rem; }
.post-content h2 { font-size: 1.35rem; }
.post-content h3 { font-size: 1.15rem; }

.post-content p {
  margin: 0 0 1rem;
}

.post-blockquote {
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: italic;
  color: var(--muted);
}

.post-list-unordered,
.post-list-ordered {
  margin: 0.5rem 0 1rem 1.5rem;
  padding: 0;
}

.post-list-unordered li,
.post-list-ordered li {
  margin-bottom: 0.35rem;
}

.post-inline-code {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--accent);
  padding: 0.15rem 0.4rem;
  border-radius: 0.3rem;
  font-family: monospace;
  font-size: 0.88em;
}

.post-code-block {
  background: #1e1e24;
  color: #f8f8f2;
  padding: 1rem;
  border-radius: 0.65rem;
  overflow-x: auto;
  font-family: monospace;
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 1rem 0;
}

.post-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  word-break: break-word;
}

.post-link i {
  font-size: 0.75em;
  margin-right: 0.25rem;
}

.post-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.5rem 0;
}

/* --- Media Cards & Images --- */
.post-media-card {
  margin: 1.25rem 0;
  display: block;
}

.image-frame {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid var(--line);
  box-shadow: 0 6px 20px #00000010;
  background: var(--surface);
}

.post-media-img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform 0.25s ease;
}

.post-media-img:hover {
  transform: scale(1.015);
}

.image-caption {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.4rem;
  font-style: italic;
}

/* Custom Modal Dialog */
.custom-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.custom-modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: #00000070;
  backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  padding: 1.5rem;
  box-shadow: 0 20px 50px #00000030;
  z-index: 101;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.15rem;
}

.modal-close-btn {
  background: none;
  border: 0;
  font-size: 1.6rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0.4rem;
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}
.modal-close-btn:hover {
  color: var(--accent);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-body input {
  width: 100%;
  padding: 0.75rem 0.85rem;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 16px; /* Prevents auto-zoom on iOS */
  box-sizing: border-box;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

@media (max-width: 600px) {
  .modal-dialog {
    padding: 1.25rem;
    border-radius: 1rem;
  }
  .modal-footer {
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
  }
  .modal-footer button,
  .modal-footer .action-btn {
    width: 100%;
    min-height: 46px;
    justify-content: center;
    border-radius: 0.65rem;
  }
}

/* Standalone Post Page */
.post-page,
.post-single-page {
  width: 90%;
  max-width: none;
  margin: 0 auto;
  padding: 2.5rem clamp(1rem, 3vw, 2rem) 4rem;
}

.site-paper:has(.post-single-page) {
  width: 90%;
}

.post-page-nav {
  margin-bottom: 1.5rem;
}

.post-page-nav .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease, transform 0.15s ease;
}

.post-page-nav .back-link:hover {
  color: var(--accent);
  transform: translateX(-3px);
}

.post-full.social-post-card {
  margin-bottom: 0;
}


.post-page-headline {
  font-size: clamp(1.4rem, 2.8vw, 1.85rem);
  margin-bottom: 1rem;
}

/* ==========================================================================
   CARD GRID SYSTEM — Life, Projects, Gallery
   ========================================================================== */

.card-grid {
  display: grid;
  gap: 1.25rem;
}

/* Life: 2-col responsive */
.card-grid--life {
  grid-template-columns: repeat(2, 1fr);
}

/* Life: full-width single column */
.card-grid--life-full {
  grid-template-columns: 1fr;
}

/* Projects: 3-col responsive */
.card-grid--projects {
  grid-template-columns: repeat(3, 1fr);
}

.category-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.5rem;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

.category-title::before,
.category-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.themes-section,
.utilities-section {
  margin-bottom: 3rem;
}

/* Gallery uses justified rows; JavaScript calculates each row's shared height. */
.card-grid--gallery {
  display: block;
}

/* Gallery Album Strip (Image Tiles) */
.gallery-albums {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  margin: 1.25rem 0 1.75rem;
  padding: 0.35rem 0.25rem 0.75rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  font-family: Niiro, KeinanMaruPop, sans-serif;
}

.gallery-albums::-webkit-scrollbar {
  height: 6px;
}

.gallery-albums::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--line) 40%, transparent);
  border-radius: 999px;
}

.gallery-albums::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 40%, transparent);
  border-radius: 999px;
}

.gallery-albums::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.gallery-album-tile {
  flex: 0 0 auto;
  width: 108px;
  height: 108px;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  padding: 0;
  background: var(--surface);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  text-align: left;
  outline: none;
  font-family: Niiro, KeinanMaruPop, sans-serif;
}

.gallery-album-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}

.gallery-album-tile:active {
  transform: translateY(-1px);
}

.gallery-album-tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.gallery-album-tile.is-active {
  border: 2px solid var(--accent);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent);
  transform: translateY(-2px);
}

.gallery-album-tile.is-active::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px #ffffff;
  z-index: 4;
}

/* Mosaic of small image tiles inside each album square */
.album-mosaic {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: color-mix(in srgb, var(--line) 40%, var(--surface));
  z-index: 1;
}

.album-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.gallery-album-tile:hover .album-mosaic img {
  transform: scale(1.08);
}

.album-mosaic.mosaic-1 {
  display: block;
}

.album-mosaic.mosaic-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5px;
}

.album-mosaic.mosaic-3 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5px;
}

.album-mosaic.mosaic-3 .mosaic-sub {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 1.5px;
  height: 100%;
}

.album-mosaic.mosaic-4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1.5px;
}

.album-tile-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.04) 0%, rgba(0, 0, 0, 0.22) 35%, rgba(0, 0, 0, 0.85) 100%);
  transition: background 0.2s ease;
  pointer-events: none;
  z-index: 2;
}

.gallery-album-tile.is-active .album-tile-overlay {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 25%, transparent) 0%, rgba(0, 0, 0, 0.25) 35%, rgba(0, 0, 0, 0.9) 100%);
}

.album-tile-content {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.5rem 0.55rem;
  color: #ffffff;
  pointer-events: none;
  font-family: Niiro, KeinanMaruPop, sans-serif;
}

.album-tile-name {
  font-family: KeinanMaruPop, Niiro, sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.15;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.album-tile-count {
  font-family: Niiro, KeinanMaruPop, sans-serif;
  font-size: 0.64rem;
  font-weight: 500;
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.01em;
  margin-top: 1px;
}

.album-tile-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1.4rem;
  font-family: Niiro, KeinanMaruPop, sans-serif;
}

@media (max-width: 600px) {
  .gallery-albums {
    gap: 0.6rem;
    margin: 1rem 0 1.25rem;
    padding-bottom: 0.5rem;
  }
  .gallery-album-tile {
    width: 92px;
    height: 92px;
    border-radius: 0.75rem;
  }
  .album-tile-name {
    font-size: 0.7rem;
  }
  .album-tile-count {
    font-size: 0.6rem;
  }
}

.gallery-row { display: flex; gap: 1rem; margin-bottom: 1rem; min-width: 0; }
.gallery-row .card--gallery-item { min-width: 0; flex-grow: 0; flex-shrink: 0; }

/* --- Life / Project card shared --- */
.card--life,
.card--project {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card--life:hover,
.card--project:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 48px #4b302018;
}

.card--life .card-title {
  color: var(--accent);
  font-size: 1.76rem;
}

.card-date {
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  font-weight: 600;
  text-transform: uppercase;
}

.card-title {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.3;
}

.card-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  flex: 1;
}

.card-cta {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  align-self: flex-start;
}

/* --- Project card image (full-bleed banner) --- */
.card--project {
  padding: 0;
  overflow: hidden;
}

.card--project .card-img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.35s ease;
}

.card--project:hover .card-img {
  transform: scale(1.04);
}

.card--project .card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.1rem 1.25rem 1.35rem;
  flex: 1;
}

/* --- Me! Card Media --- */
.card-me-body {
  position: relative;
}

.card-me-body::after {
  content: "";
  display: table;
  clear: both;
}

.me-figure {
  float: right;
  margin: 0 0 1rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 200px;
}

.me-image {
  height: 200px;
  max-height: 200px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
  transition: transform 0.25s ease;
}

.me-figure:hover .me-image {
  transform: scale(1.03);
}

.me-caption {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.35;
  text-align: center;
}

@media (max-width: 600px) {
  .me-figure {
    float: none;
    margin: 0 auto 1.25rem;
    max-width: 100%;
  }
}

/* --- Gallery card --- */
.card--gallery-item {
  padding: 0;
  overflow: hidden;
  border-radius: 1rem;
  position: relative;
}

.card--gallery-item button {
  border: 0;
  padding: 0;
  background: none;
  cursor: zoom-in;
  width: 100%;
  display: block;
  position: relative;
  height: 100%;
}

.card--gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.card--gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-card-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.6rem 0.9rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  color: #fff;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.25s ease;
  text-align: left;
}

.card--gallery-item:hover .gallery-card-caption {
  opacity: 1;
}

.empty-state {
  grid-column: 1 / -1;
  color: var(--muted);
  font-style: italic;
}

/* ==========================================================================
   GALLERY IMAGE UPLOAD PANEL (ADMIN DROPDOWN)
   ========================================================================== */
.gallery-admin-section {
  max-width: 680px;
  margin: 0 auto 1.75rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

.gallery-admin-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.gallery-upload-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 1.05rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  user-select: none;
}

.gallery-upload-trigger:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 15%, transparent);
}

.gallery-upload-trigger:active {
  transform: translateY(0);
}

.gallery-upload-trigger.is-active {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
}

.gallery-upload-trigger .toggle-arrow {
  font-size: 0.72rem;
  transition: transform 0.25s ease;
}

.gallery-upload-trigger.is-active .toggle-arrow {
  transform: rotate(180deg);
}

.gallery-upload {
  width: 100%;
  margin-top: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: galleryDropdownOpen 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-upload[hidden] {
  display: none !important;
}

@keyframes galleryDropdownOpen {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.gallery-upload-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gallery-upload-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.gallery-upload-header-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.gallery-upload-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}

.gallery-upload-close:hover {
  background: color-mix(in srgb, var(--text) 10%, transparent);
  color: var(--text);
  border-color: var(--text);
}

.gallery-upload-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}

.gallery-upload-subtitle {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}

.gallery-admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

/* Interactive Dropzone */
.gallery-dropzone {
  position: relative;
  border: 2px dashed var(--line);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--bg) 65%, var(--surface));
  padding: 2.25rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  outline: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 165px;
  user-select: none;
}

.gallery-dropzone:hover,
.gallery-dropzone.is-dragover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.gallery-dropzone.is-dragover {
  transform: scale(1.01);
  border-style: solid;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 15%, transparent);
}

.gallery-dropzone:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Empty dropzone state */
.dropzone-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  pointer-events: none;
}

.dropzone-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 0.4rem;
  transition: transform 0.25s ease, background-color 0.25s ease;
}

.gallery-dropzone:hover .dropzone-icon-circle {
  transform: translateY(-2px) scale(1.06);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.dropzone-title {
  margin: 0;
  font-size: 0.96rem;
  color: var(--text);
  font-weight: 500;
}

.dropzone-title strong {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dropzone-info {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Preview dropzone state */
.dropzone-preview {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  width: 100%;
  text-align: left;
  padding: 0.25rem;
}

.dropzone-thumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.dropzone-thumb-wrap {
  width: 64px;
  height: 64px;
  border-radius: 0.75rem;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--bg);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.dropzone-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dropzone-thumb-more {
  width: 64px;
  height: 64px;
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--accent) 15%, var(--surface));
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.dropzone-file-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dropzone-filename {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropzone-filesize {
  font-size: 0.78rem;
  color: var(--muted);
}

.dropzone-change-tip {
  font-size: 0.74rem;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.1rem;
}

.dropzone-remove-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  flex-shrink: 0;
}

.dropzone-remove-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
  transform: scale(1.1);
}

/* Caption Input */
.gallery-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gallery-input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.gallery-input-icon {
  color: var(--muted);
  font-size: 1.05rem;
  flex-shrink: 0;
}

.gallery-input-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  min-width: 0;
}

.gallery-input-wrapper input::placeholder {
  color: var(--muted);
  opacity: 0.75;
}

.gallery-counter {
  font-size: 0.76rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  user-select: none;
}

/* Footer Actions & Status */
.gallery-upload-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.gallery-upload-status {
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2rem;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.gallery-upload-status.status-loading {
  color: var(--accent);
  font-weight: 500;
}

.gallery-upload-status.status-success {
  color: #10b981;
  font-weight: 500;
}

.gallery-upload-status.status-error {
  color: #ef4444;
  font-weight: 500;
}

.gallery-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.45rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  margin-left: auto;
  text-decoration: none;
}

.gallery-upload-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 45%, transparent);
}

.gallery-upload-btn:active:not(:disabled) {
  transform: translateY(0);
}

.gallery-upload-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

@keyframes galleryUploadFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  .gallery-upload {
    padding: 1.25rem 1rem;
    margin-bottom: 2rem;
    border-radius: 1rem;
  }
  .gallery-dropzone {
    padding: 1.5rem 1rem;
  }
  .gallery-upload-actions {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 0.75rem;
  }
  .gallery-upload-btn {
    width: 100%;
    justify-content: center;
  }
  .gallery-upload-status {
    text-align: center;
    justify-content: center;
  }
}

/* Responsive collapse */
@media (max-width: 700px) {
  .card-grid--life,
  .card-grid--projects,
  .card-grid--gallery {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 701px) and (max-width: 900px) {
  .card-grid--projects {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========================================================================
   MOBILE RWD
   Keep the desktop composition unchanged; only tighten and stack content
   below the tablet breakpoint.
   ======================================================================== */
@media (max-width: 760px) {
  .container {
    width: min(100% - 1.5rem, 1050px);
  }

  main {
    padding: 2.25rem 0 3.5rem;
  }

  .nav-wrap {
    width: calc(100% - 1.5rem);
    min-height: 3.25rem;
    grid-template-columns: 1fr auto;
  }

  .nav-wrap .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .nav-wrap nav {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .nav-toggle {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    color: #fff;
    cursor: pointer;
  }

  .nav-toggle i {
    color: #fff;
  }

  .brand img {
    height: 2.7rem;
    max-width: 6.5rem;
  }

  .nav-links {
    top: 3.25rem;
    z-index: 2;
    gap: 0.15rem;
    padding: 0.65rem 0.75rem 0.8rem;
    box-shadow: var(--shadow);
  }

  .nav-links a {
    display: block;
    padding: 0.55rem 0.35rem;
    font-size: 0.95rem;
  }

  .masthead {
    min-height: min(52vh, 25rem);
    padding: 3.5rem 1rem;
  }

  .masthead-content {
    width: min(100%, 32rem);
  }

  .masthead h1 {
    font-size: clamp(1.45rem, 9vw, 2.2rem);
    letter-spacing: 0.14em;
  }

  .site-paper main {
    padding: 0 0 1.25rem;
  }

  .template-layout {
    gap: 2.25rem;
  }

  .page-intro {
    margin-bottom: 2.25rem;
  }

  .page-intro h1,
  .template-layout .page-intro h2 {
    font-size: clamp(1.8rem, 8vw, 2.6rem);
    line-height: 1.15;
  }

  .lede {
    font-size: 1.05rem;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }

  .card,
  .post,
  .feed-card {
    padding: 1rem;
    border-radius: 0.8rem;
  }

  .card-grid {
    gap: 0.85rem;
  }

  .card--life {
    padding: 1.1rem;
  }

  .card--project .card-body {
    padding: 0.9rem 1rem 1.1rem;
  }

  .post-headline,
  .post-page-headline {
    font-size: 1.45rem;
    line-height: 1.2;
  }

  .post-header {
    gap: 0.65rem;
  }

  .post-body-text,
  .post-content {
    overflow-wrap: anywhere;
  }

  .template-sidebar {
    padding-top: 1.5rem;
  }

  .social-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .social-link {
    min-height: 2.65rem;
  }

  .actions {
    align-items: stretch;
    flex-direction: column;
    gap: 0.7rem;
  }

  .actions .button,
  .actions .text-link {
    text-align: center;
  }

  .site-footer {
    padding: 1.5rem 0;
  }

  .site-footer .container {
    min-width: 0;
  }

  .footer-links {
    width: 100%;
  }

  .footer-links ul {
    align-items: stretch;
  }

  .footer-links li,
  .footer-links a {
    min-width: 0;
  }

  .footer-links a {
    justify-content: center;
    text-align: center;
  }

  .modal,
  .dialog {
    width: calc(100% - 1.5rem);
    max-width: none;
  }
}

@media (max-width: 420px) {
  .social-links {
    grid-template-columns: 1fr;
  }

  .masthead {
    min-height: 20rem;
  }
}

/* ==========================================================================
   POST CATEGORIES SYSTEM — BADGES, COMPOSER & FEED FILTERS
   ========================================================================== */

.post-category-badge-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0 0.65rem;
  flex-wrap: wrap;
}

.post-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-family: KeinanMaruPop, Niiro, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  line-height: 1.2;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.post-category-badge i {
  font-size: 0.85em;
}

.post-category-badge span,
.category-pill-btn span {
  font-family: KeinanMaruPop, Niiro, sans-serif;
}

.post-category-link {
  text-decoration: none;
  display: inline-flex;
}

/* Category Color Variants (Light Mode) */
.category-tag--rhythm-games {
  background: rgba(236, 72, 153, 0.1);
  border-color: rgba(236, 72, 153, 0.35);
  color: #be185d;
}
.category-tag--extraction-games {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.35);
  color: #b45309;
}
.category-tag--other-games {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.35);
  color: #7e22ce;
}
.category-tag--development {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.35);
  color: #047857;
}
.category-tag--life {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.35);
  color: #be123c;
}
.category-tag--balloonposting {
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(14, 165, 233, 0.35);
  color: #0284c7;
}
.category-tag--others {
  background: rgba(100, 116, 139, 0.1);
  border-color: rgba(100, 116, 139, 0.35);
  color: #475569;
}

/* Hover effects on interactive badges */
a.post-category-badge:hover,
button.post-category-badge:hover {
  transform: translateY(-1px);
}
a.category-tag--rhythm-games:hover {
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.28);
  border-color: #ec4899;
}
a.category-tag--extraction-games:hover {
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.28);
  border-color: #f59e0b;
}
a.category-tag--other-games:hover {
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.28);
  border-color: #a855f7;
}
a.category-tag--development:hover {
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28);
  border-color: #10b981;
}
a.category-tag--life:hover {
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.28);
  border-color: #f43f5e;
}
a.category-tag--balloonposting:hover {
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.28);
  border-color: #0ea5e9;
}
a.category-tag--others:hover {
  box-shadow: 0 4px 14px rgba(100, 116, 139, 0.28);
  border-color: #64748b;
}

/* Category Color Variants (Dark Mode) */
@media (prefers-color-scheme: dark) {
  .category-tag--rhythm-games {
    background: rgba(244, 114, 182, 0.16);
    border-color: rgba(244, 114, 182, 0.4);
    color: #f472b6;
  }
  .category-tag--extraction-games {
    background: rgba(251, 191, 36, 0.16);
    border-color: rgba(251, 191, 36, 0.4);
    color: #fbbf24;
  }
  .category-tag--other-games {
    background: rgba(192, 132, 252, 0.16);
    border-color: rgba(192, 132, 252, 0.4);
    color: #c084fc;
  }
  .category-tag--development {
    background: rgba(52, 211, 153, 0.16);
    border-color: rgba(52, 211, 153, 0.4);
    color: #34d399;
  }
  .category-tag--life {
    background: rgba(251, 113, 133, 0.16);
    border-color: rgba(251, 113, 133, 0.4);
    color: #fb7185;
  }
  .category-tag--balloonposting {
    background: rgba(56, 189, 248, 0.16);
    border-color: rgba(56, 189, 248, 0.4);
    color: #38bdf8;
  }
  .category-tag--others {
    background: rgba(148, 163, 184, 0.16);
    border-color: rgba(148, 163, 184, 0.4);
    color: #cbd5e1;
  }

  a.category-tag--rhythm-games:hover {
    box-shadow: 0 4px 16px rgba(244, 114, 182, 0.35);
  }
  a.category-tag--extraction-games:hover {
    box-shadow: 0 4px 16px rgba(251, 191, 36, 0.35);
  }
  a.category-tag--other-games:hover {
    box-shadow: 0 4px 16px rgba(192, 132, 252, 0.35);
  }
  a.category-tag--development:hover {
    box-shadow: 0 4px 16px rgba(52, 211, 153, 0.35);
  }
  a.category-tag--life:hover {
    box-shadow: 0 4px 16px rgba(251, 113, 133, 0.35);
  }
  a.category-tag--balloonposting:hover {
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.35);
  }
  a.category-tag--others:hover {
    box-shadow: 0 4px 16px rgba(148, 163, 184, 0.35);
  }
}

/* ==========================================================================
   POST COMPOSER CATEGORY SELECTOR (admin.html)
   ========================================================================== */
.composer-category-group {
  background: color-mix(in srgb, var(--surface) 60%, var(--bg));
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  padding: 0.95rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.category-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-label {
  font-family: KeinanMaruPop, Niiro, sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  letter-spacing: 0.02em;
}

.category-label i {
  color: var(--accent);
}

.category-selected-hint {
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
}

.category-pill-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-selector-menu { position: relative; }
.category-selector-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  list-style: none;
  font-size: 0.8rem;
  font-weight: 600;
}
.category-selector-toggle::-webkit-details-marker { display: none; }
.category-selector-toggle i { transition: transform 0.15s ease; }
.category-selector-menu[open] .category-selector-toggle i { transform: rotate(180deg); }

@media (max-width: 768px) {
  .composer-category-group {
    padding: 0.65rem 0.75rem;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
    border-radius: 0.7rem;
  }
  .category-pill-selector {
    flex-wrap: wrap;
    overflow: visible;
    gap: 0.45rem;
    padding: 0.45rem 0.05rem 0.1rem;
  }
}

.category-pill-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 0.45rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: KeinanMaruPop, Niiro, sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  touch-action: manipulation;
}

@media (max-width: 768px) {
  .category-pill-btn {
    flex-shrink: 0;
    white-space: nowrap;
    min-height: 34px;
    padding: 0.3rem 0.7rem;
  }
}

.category-pill-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

/* Selected states for category buttons in composer */
.category-pill-btn.is-selected {
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.category-pill-btn.category-tag--rhythm-games.is-selected {
  background: rgba(236, 72, 153, 0.18);
  border-color: #ec4899;
  color: #be185d;
  box-shadow: 0 0 14px rgba(236, 72, 153, 0.3);
}
.category-pill-btn.category-tag--extraction-games.is-selected {
  background: rgba(245, 158, 11, 0.18);
  border-color: #f59e0b;
  color: #b45309;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.3);
}
.category-pill-btn.category-tag--other-games.is-selected {
  background: rgba(168, 85, 247, 0.18);
  border-color: #a855f7;
  color: #7e22ce;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.3);
}
.category-pill-btn.category-tag--development.is-selected {
  background: rgba(16, 185, 129, 0.18);
  border-color: #10b981;
  color: #047857;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.3);
}
.category-pill-btn.category-tag--life.is-selected {
  background: rgba(244, 63, 94, 0.18);
  border-color: #f43f5e;
  color: #be123c;
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.3);
}
.category-pill-btn.category-tag--balloonposting.is-selected {
  background: rgba(14, 165, 233, 0.18);
  border-color: #0ea5e9;
  color: #0284c7;
  box-shadow: 0 0 14px rgba(14, 165, 233, 0.3);
}
.category-pill-btn.category-tag--others.is-selected {
  background: rgba(100, 116, 139, 0.18);
  border-color: #64748b;
  color: #475569;
  box-shadow: 0 0 14px rgba(100, 116, 139, 0.3);
}

@media (prefers-color-scheme: dark) {
  .category-pill-btn.category-tag--rhythm-games.is-selected {
    background: rgba(244, 114, 182, 0.22);
    border-color: #f472b6;
    color: #f472b6;
    box-shadow: 0 0 16px rgba(244, 114, 182, 0.4);
  }
  .category-pill-btn.category-tag--extraction-games.is-selected {
    background: rgba(251, 191, 36, 0.22);
    border-color: #fbbf24;
    color: #fbbf24;
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.4);
  }
  .category-pill-btn.category-tag--other-games.is-selected {
    background: rgba(192, 132, 252, 0.22);
    border-color: #c084fc;
    color: #c084fc;
    box-shadow: 0 0 16px rgba(192, 132, 252, 0.4);
  }
  .category-pill-btn.category-tag--development.is-selected {
    background: rgba(52, 211, 153, 0.22);
    border-color: #34d399;
    color: #34d399;
    box-shadow: 0 0 16px rgba(52, 211, 153, 0.4);
  }
  .category-pill-btn.category-tag--life.is-selected {
    background: rgba(251, 113, 133, 0.22);
    border-color: #fb7185;
    color: #fb7185;
    box-shadow: 0 0 16px rgba(251, 113, 133, 0.4);
  }
  .category-pill-btn.category-tag--balloonposting.is-selected {
    background: rgba(56, 189, 248, 0.22);
    border-color: #38bdf8;
    color: #38bdf8;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
  }
  .category-pill-btn.category-tag--others.is-selected {
    background: rgba(148, 163, 184, 0.22);
    border-color: #cbd5e1;
    color: #cbd5e1;
    box-shadow: 0 0 16px rgba(148, 163, 184, 0.4);
  }
}
