@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --paper: #eef2ee;
  --bg: #eef2ee;
  --bg-raised: #f8f8f6;
  --ink: #111111;
  --text: #111111;
  --text-soft: #48564b;
  --muted: #5c5c5c;
  --green: #355f40;
  --accent-green: #355f40;
  --line: rgba(53, 73, 54, 0.12);
  --line-strong: rgba(53, 73, 54, 0.24);
  --body: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --mono: 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
  --radius-control: 10px;
  --radius-panel: 18px;
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button, a, input, select, summary {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
  background: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

p, h1, h2, h3 {
  margin: 0;
}

::selection {
  background: #d4e3c8;
  color: #111111;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 20px;
  z-index: 200;
  background: var(--ink);
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 8px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

/* ==========================================================================
   Unified Topbar (identical across Home, Workspace, and Gallery)
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 68px;
  width: 100%;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02), 0 4px 16px rgba(0, 0, 0, 0.02);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.topbar-inner {
  width: 100%;
  max-width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.topbar-brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--body);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #111827;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.topbar-brand-logo {
  width: 152px;
  height: 42px;
  object-fit: contain;
  object-position: center;
  display: block;
  flex-shrink: 0;
}

.footer-brand-logo {
  width: 144px;
  height: 40px;
  object-fit: contain;
  object-position: center;
  display: block;
}

.topbar-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 4px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 999px;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 500;
  color: #4b5563;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.topbar-link:hover {
  color: #111827;
  background: rgba(255, 255, 255, 0.7);
}

.topbar-link.active {
  color: #111827;
  font-weight: 600;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), 0 0 1px rgba(0, 0, 0, 0.08);
}

.nav-task-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #111827;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 600;
  font-family: var(--mono);
  line-height: 1;
}

.topbar-link.active .nav-task-count {
  background: #2563eb;
  color: #ffffff;
}

.topbar-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==========================================================================
   Locale Switcher (identical to React LanguageMenu.tsx & styles.css)
   ========================================================================== */
.topbar .locale-switcher {
  position: relative;
  color: #374151;
}

.topbar .locale-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  max-width: 144px;
  padding: 0 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #374151;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}

.topbar .locale-trigger:hover,
.topbar .locale-trigger[aria-expanded="true"] {
  border-color: rgba(0, 0, 0, 0.15);
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  color: #111827;
}

.topbar .locale-current {
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar .locale-globe {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  stroke: currentColor;
}

.topbar .locale-chevron {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: #6b7280;
  stroke: currentColor;
}

.topbar .locale-popover {
  position: absolute;
  z-index: 150;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  padding: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
}

[dir="rtl"] .topbar .locale-popover {
  right: auto;
  left: 0;
}

.topbar .locale-heading {
  padding: 7px 9px 8px;
  color: #6b7280;
  font-size: 11px;
}

.topbar .locale-list {
  display: grid;
  gap: 2px;
  max-height: min(330px, 60dvh);
  overflow-y: auto;
}

.topbar .locale-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #374151;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.topbar .locale-option:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #111827;
}

.topbar .locale-option.is-active,
.topbar .locale-option[aria-selected="true"] {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  font-weight: 600;
}

.topbar .locale-option svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: #2563eb;
  stroke-width: 2.2;
}

[dir="rtl"] {
  direction: rtl;
}

[dir="rtl"] .topbar-inner {
  direction: rtl;
}

.topbar-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  color: #ffffff !important;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.topbar-cta:hover {
  background: #263142;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.topbar-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.topbar-mobile-toggle .nav__toggle-box {
  position: relative;
  display: block;
  width: 22px;
  height: 14px;
}

.topbar-mobile-toggle .bar {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.8px;
  border-radius: 2px;
  background: #1f2937;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), width 0.3s ease;
}

.topbar-mobile-toggle .bar--top { top: 0; }
.topbar-mobile-toggle .bar--bot { bottom: 0; width: 70%; }
.topbar-mobile-toggle:hover .bar--bot { width: 100%; }
.topbar-mobile-toggle.is-open .bar--top { transform: translateY(6.1px) rotate(45deg); }
.topbar-mobile-toggle.is-open .bar--bot { width: 100%; transform: translateY(-6.1px) rotate(-45deg); }

.topbar-mobile-drawer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  animation: mobile-drawer-slide 0.2s ease both;
}

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

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.mobile-nav-link:hover, .mobile-nav-link.active {
  background: rgba(0, 0, 0, 0.05);
  color: #111827;
  font-weight: 600;
}

.mobile-drawer-bottom {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.mobile-cta-btn {
  width: 100%;
  padding: 12px;
  font-size: 14.5px;
  justify-content: center;
}

.topbar-mobile-drawer .mobile-cta-btn {
  background: #111827;
  color: #ffffff !important;
}

.topbar-mobile-drawer .mobile-cta-btn:hover {
  background: #263142;
}

/* ==========================================================================
   Shared Badges & Buttons
   ========================================================================== */
.btn-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #141414;
  color: #ffffff !important;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 11px 20px;
  border: 0;
  border-radius: 9px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.btn-dark:hover {
  background: #000000;
  transform: translateY(-1px);
}

.outline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid rgba(53, 73, 54, 0.2);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  color: #2e3a31;
  transition: all 0.18s ease;
}

.outline-button:hover {
  background: rgba(53, 95, 64, 0.08);
  border-color: rgba(53, 73, 54, 0.35);
  color: #111111;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(53, 73, 54, 0.12);
  border-radius: 999px;
  padding: 6px 14px 6px 8px;
  font-size: 13px;
  color: #4a4a4a;
}

.badge__tag {
  background: #141414;
  color: #ffffff;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Gallery Main & Hero
   ========================================================================== */
main, .site-footer {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px);
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  min-height: 400px;
  padding: 48px 0 44px;
  gap: 40px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.hero h1 {
  font-size: clamp(32px, 4.6vw, 58px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 4px 0 2px;
}

.hero-description {
  font-size: clamp(14px, 1.2vw, 16px);
  line-height: 1.7;
  color: var(--muted);
  max-width: 58ch;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.hero-cta {
  font-size: 14px;
  padding: 12px 24px;
}

.hero-sub-cta {
  font-size: 14px;
  padding: 12px 20px;
}

.hero-art {
  height: 320px;
  position: relative;
  max-width: 500px;
  width: 100%;
  justify-self: end;
}

.hero-art:before {
  content: '';
  position: absolute;
  inset: 12px 0 4px 10px;
  border: 1px dashed rgba(53, 73, 54, 0.16);
  border-radius: 50%;
  transform: rotate(-12deg);
}

.hero-tile {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38%;
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid rgba(53, 73, 54, 0.12);
  box-shadow: 0 16px 36px rgba(35, 55, 40, 0.08);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
  overflow: hidden;
  background: #ffffff;
}

.hero-tile img {
  width: 85%;
  height: 85%;
  object-fit: contain;
}

.hero-tile:nth-of-type(1) { left: 4%; top: 10%; transform: rotate(-10deg); background: #eaf0e6; }
.hero-tile:nth-of-type(2) { left: 35%; top: 0; transform: rotate(7deg); background: #f4f2ec; z-index: 1; }
.hero-tile:nth-of-type(3) { right: 2%; top: 26%; transform: rotate(12deg); background: #e8ecef; z-index: 2; }
.hero-tile:nth-of-type(4) { left: 24%; top: 44%; transform: rotate(-5deg); background: #f0ede6; z-index: 3; }

.hero-tile:hover {
  transform: rotate(0) translateY(-6px) scale(1.03);
  box-shadow: 0 20px 44px rgba(35, 55, 40, 0.14);
}

.hero-art-note {
  position: absolute;
  bottom: -16px;
  right: 12px;
  font: 10px var(--mono);
  letter-spacing: 1.5px;
  color: var(--muted);
  z-index: 5;
}

/* ==========================================================================
   Collection Layout
   ========================================================================== */
.collection-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 36px;
  border-top: 1px solid var(--line);
  padding-top: 30px;
}

.sidebar {
  align-self: start;
  position: sticky;
  top: 96px;
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(53, 73, 54, 0.2) transparent;
}

.sidebar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 10px 14px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.small-mono {
  font: 10px var(--mono);
  color: var(--muted);
}

.category-list {
  display: grid;
  gap: 3px;
  padding-right: 6px;
}

.category-button {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  min-height: 36px;
  color: #4a564c;
  transition: all 0.15s ease;
}

.category-button:hover {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

.category-button[aria-pressed="true"] {
  background: #e5ebdd;
  color: #233f2b;
  font-weight: 600;
}

.category-button .category-symbol {
  width: 18px;
  text-align: center;
  font-size: 14px;
  opacity: 0.8;
}

.category-button .category-count {
  margin-left: auto;
  font: 10px var(--mono);
  opacity: 0.65;
}

.sidebar-note {
  border-top: 1px solid var(--line);
  padding: 20px 10px 10px;
  margin: 20px 6px 20px 0;
}

.note-star {
  font-size: 20px;
  color: var(--green);
}

.sidebar-note p {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  margin: 8px 0 6px;
  color: var(--text);
}

.sidebar-note span {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  display: block;
}

/* ==========================================================================
   Collection Toolbar & Search
   ========================================================================== */
.collection-content {
  min-width: 0;
}

.collection-toolbar {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.view-tabs {
  display: flex;
  gap: 8px;
}

.view-tabs button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: #5c685e;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.view-tabs button:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
}

.view-tabs button span {
  font: 10px var(--mono);
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(53, 73, 54, 0.1);
  color: var(--ink);
}

.collection-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.collection-filter-label {
  font-size: 12px;
  font-weight: 500;
  color: #6a776c;
  white-space: nowrap;
}

.collection-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.collection-pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: #4b584d;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(53, 73, 54, 0.12);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.collection-pill:hover {
  background: #ffffff;
  color: var(--ink);
  border-color: rgba(53, 73, 54, 0.28);
}

.collection-pill.active {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: #354936;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.view-tabs button[aria-selected="true"] {
  background: #ffffff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(53, 73, 54, 0.16);
  border-radius: 9px;
  max-width: 260px;
  padding: 8px 12px;
  color: var(--muted);
  background: #ffffff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-field:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(53, 95, 64, 0.12);
}

.search-field svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.search-field input {
  width: 100%;
  min-width: 80px;
  outline: none;
  border: 0;
  background: none;
  font-size: 12.5px;
  color: var(--ink);
}

.search-field input::placeholder {
  color: #8f998e;
}

.search-field kbd {
  font: 10px var(--mono);
  border: 1px solid rgba(53, 73, 54, 0.18);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--muted);
  background: #f4f6f2;
}

.results-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  color: var(--muted);
  font-size: 12px;
  gap: 12px;
  padding: 6px 0;
}

.results-line strong {
  font-weight: 600;
  color: var(--ink);
}

.results-line label {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}

.results-line select {
  border: 1px solid rgba(53, 73, 54, 0.16);
  background: #ffffff;
  border-radius: 6px;
  font-size: 12px;
  color: #38453a;
  padding: 4px 8px;
  cursor: pointer;
}

/* ==========================================================================
   Logo Cards Grid
   ========================================================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px 20px;
  margin-top: 8px;
}

.logo-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 14px;
  border: 1px solid rgba(53, 73, 54, 0.12);
  border-radius: 14px;
  background: var(--bg-raised);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  animation: appear 0.45s ease both;
}

.logo-card:hover {
  transform: translateY(-4px);
  border-color: rgba(53, 73, 54, 0.25);
  box-shadow: 0 16px 36px rgba(35, 55, 40, 0.08);
}

.logo-visual {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--card-bg, #eceee5);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.open-art {
  width: 100%;
  height: 100%;
  padding: 0;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.open-art img {
  width: 85%;
  height: 85%;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.logo-card:hover .open-art img {
  transform: scale(1.05);
}

.card-index {
  position: absolute;
  left: 10px;
  top: 10px;
  pointer-events: none;
  font: 10px var(--mono);
  color: rgba(53, 73, 54, 0.55);
}

.art-corner {
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-size: 16px;
  color: #3b503f;
  opacity: 0;
  transform: translate(-3px, 3px);
  transition: all 0.2s ease;
  pointer-events: none;
}

.logo-card:hover .art-corner {
  opacity: 1;
  transform: none;
}

.prompt-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  color: #556254;
  line-height: 1.6;
  margin-top: 12px;
  height: 38px;
  overflow-wrap: anywhere;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  border-top: 1px solid rgba(53, 73, 54, 0.08);
  padding-top: 8px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  padding: 4px 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--green);
  border-radius: 6px;
  transition: all 0.15s ease;
}

.text-button:hover {
  color: #111111;
  background: rgba(53, 95, 64, 0.08);
}

.text-button svg {
  width: 14px;
  height: 14px;
}

.copy-card {
  color: var(--muted);
}

.copy-card:hover {
  color: var(--ink);
}

.card-action-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.create-card {
  color: var(--gold-deep);
  font-weight: 600;
}

.create-card:hover {
  color: #8c571c;
  background: rgba(184, 115, 51, 0.12);
}

.pending-art {
  font-size: 12px;
  color: var(--muted);
}

/* ==========================================================================
   Template Cards
   ========================================================================== */
.template-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.template-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.template-number {
  font: 10px var(--mono);
  color: var(--green);
  font-weight: 600;
}

.template-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 12px 0 2px;
  color: var(--ink);
}

.template-english {
  font: 11px var(--mono);
  color: var(--muted);
}

.template-card .template-prompt {
  font-size: 13px;
  line-height: 1.75;
  color: #4b584a;
  overflow-wrap: anywhere;
  margin: 18px 0;
  flex: 1;
}

.template-blank {
  background: #e7eddc;
  color: #274823;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 500;
}

.instruction-card {
  grid-column: 1 / -1;
  background: #f1f5ec;
  border-color: rgba(53, 95, 64, 0.2);
}

/* ==========================================================================
   Empty State & End Note
   ========================================================================== */
.empty-state {
  padding: 80px 20px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 14px;
  margin: 20px 0;
}

.empty-state > span {
  font-size: 40px;
  color: var(--green);
}

.empty-state h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 14px 0 6px;
  color: var(--ink);
}

.empty-state p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 22px;
}

.collection-end {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 48px 0 64px;
  color: var(--muted);
  font-size: 12px;
}

.collection-end > span {
  width: 60px;
  height: 1px;
  background: var(--line);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 32px;
  padding-bottom: 36px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.footer-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.footer-wordmark:hover {
  color: var(--green);
}

.back-to-top {
  font-size: 13px;
  color: var(--muted);
  transition: color 0.15s ease;
}

.back-to-top:hover {
  color: var(--ink);
}

/* ==========================================================================
   Detail Dialog
   ========================================================================== */
dialog {
  border: 0;
  padding: 0;
  max-width: min(1040px, calc(100vw - 48px));
  width: 100%;
  max-height: calc(100dvh - 56px);
  border-radius: 18px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(17, 26, 20, 0.25);
  overflow: hidden;
}

dialog::backdrop {
  background: rgba(17, 26, 20, 0.55);
  backdrop-filter: blur(10px);
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 560px;
}

.detail-image-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eaece3;
  min-height: 400px;
  padding: 40px 24px 64px;
}

.detail-image-panel > img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: contain;
  aspect-ratio: 1;
}

.detail-image-panel[data-background="dark"] {
  background: #1c221e;
}

.detail-image-panel[data-background="checker"] {
  background-color: #ffffff;
  background-image: linear-gradient(45deg, #e3e6dc 25%, transparent 25%),
                    linear-gradient(-45deg, #e3e6dc 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #e3e6dc 75%),
                    linear-gradient(-45deg, transparent 75%, #e3e6dc 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.detail-index {
  position: absolute;
  top: 20px;
  left: 20px;
  font: 11px var(--mono);
  color: var(--muted);
}

.background-options {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(53, 73, 54, 0.16);
  border-radius: 30px;
  white-space: nowrap;
  font-size: 11px;
  color: var(--text-soft);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.background-options button {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(53, 73, 54, 0.25);
  border-radius: 50%;
  background: #eeefe6;
}

.background-options button[data-background="dark"] {
  background: #28322c;
}

.background-options button[data-background="checker"] {
  background: conic-gradient(#c5ccb9 25%, white 0 50%, #c5ccb9 0 75%, white 0);
  background-size: 8px 8px;
}

.background-options button[aria-pressed="true"] {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.detail-copy {
  position: relative;
  padding: 40px 32px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.close-dialog {
  position: absolute !important;
  right: 14px;
  top: 14px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-soft);
  transition: all 0.15s ease;
}

.icon-button:hover {
  background: rgba(53, 95, 64, 0.1);
  color: var(--green);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 11px var(--mono);
  letter-spacing: 1px;
  color: var(--green);
  text-transform: uppercase;
}

.detail-copy h2 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 10px 0 6px;
  color: var(--ink);
}

.detail-subtitle {
  font: 11px var(--mono);
  color: var(--muted);
}

.prompt-label {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
}

.full-prompt {
  font-size: 13.5px;
  line-height: 1.8;
  color: #3d4a3e;
  margin: 12px 0 18px;
  overflow-wrap: anywhere;
}

.detail-cta-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.detail-cta-row .btn-dark {
  flex: 1;
}

.detail-use-btn {
  font-size: 13px;
  white-space: nowrap;
}

.detail-copy details {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  font-size: 12px;
  color: var(--text-soft);
}

.detail-copy summary {
  cursor: pointer;
  padding: 4px 0;
  font-weight: 500;
}

.detail-copy details p {
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  padding-top: 10px;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.detail-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.detail-footer .outline-button {
  font-size: 12px;
}

.detail-footer .small-mono {
  margin-left: auto;
  white-space: nowrap;
}

.detail-favorite[aria-pressed="true"] svg {
  fill: #c84436;
  stroke: #c84436;
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast {
  position: fixed;
  z-index: 1000;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 15px);
  background: #141414;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 13.5px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: calc(100vw - 32px);
  text-align: center;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes appear {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1100px) {
  .collection-layout {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 24px;
  }
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 16px;
  }
  .hero {
    gap: 24px;
  }
  .hero h1 {
    font-size: 42px;
  }
}

@media (max-width: 900px) {
  .topbar {
    height: 62px;
  }
  .topbar-brand-logo {
    width: 126px;
    height: 38px;
  }
  .topbar-inner {
    grid-template-columns: 1fr auto;
    padding: 0 18px;
  }
  .topbar-nav {
    display: none;
  }
  .topbar-cta {
    display: none;
  }
  .topbar-mobile-toggle {
    display: inline-flex;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 36px 0 30px;
  }
  .hero-art {
    display: none;
  }

  .collection-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .sidebar-top, .sidebar-note {
    display: none;
  }
  .category-list {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 10px;
    scrollbar-width: none;
  }
  .category-list::-webkit-scrollbar {
    display: none;
  }
  .category-button {
    width: auto;
    flex: 0 0 auto;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
  }
  .category-button .category-symbol {
    display: none;
  }

  .detail-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .detail-image-panel {
    min-height: 280px;
    padding: 30px 20px 50px;
  }
  .detail-copy {
    padding: 24px 20px;
  }
  .template-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .topbar-brand-logo {
    width: 114px;
    height: 34px;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .collection-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-field {
    max-width: none;
  }
  .site-footer {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
}
