:root {
  --page: #faf9f4;
  --page-2: #f3f1e9;
  --ink: #151515;
  --on-ink: #fbfaf5;
  --muted: #6e6980;
  --muted-2: #9a95aa;
  --line: rgba(21, 21, 21, 0.12);
  --line-strong: rgba(21, 21, 21, 0.32);
  --surface: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.58);
  --field-bg: #fffdfa;
  --accent: #e8ff5f;
  --marker: rgba(232, 255, 95, 0.72);
  --thumb-contrast: #ffffff;
  --card-shadow: 0 22px 44px -30px rgba(28, 22, 60, 0.35);
  --sheet-bg: #fefdfb;
  --header-bg: rgba(250, 249, 244, 0.82);
  --danger: #b4384f;
  --success: #2c7a45;
  --display: "Archivo", "Arial Black", sans-serif;
  --serif: "Lora", Georgia, serif;
  --sans: "Instrument Sans", "Jost", "Segoe UI", sans-serif;
  --grotesk: "Cabinet Grotesk", "Archivo", sans-serif;
  --mono: "Fira Code", "Consolas", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --page-pad: clamp(20px, 4vw, 48px);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page: #0e0b1c;
  --page-2: #0a0815;
  --ink: #ece8ff;
  --on-ink: #14111f;
  --muted: #a49dd0;
  --muted-2: #766f96;
  --line: rgba(236, 232, 255, 0.14);
  --line-strong: rgba(236, 232, 255, 0.34);
  --surface: #17142a;
  --surface-soft: rgba(23, 20, 42, 0.55);
  --field-bg: #141126;
  --marker: rgba(232, 255, 95, 0.34);
  --thumb-contrast: #151227;
  --card-shadow: 0 22px 44px -24px rgba(0, 0, 0, 0.75);
  --sheet-bg: #151228;
  --header-bg: rgba(14, 11, 28, 0.78);
  --danger: #ff7a90;
  --success: #79d49a;
}

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;

  background-color: #FAF8F3;
  background-image:
    radial-gradient(circle, rgba(0,0,0,0.14) 1px, transparent 1.3px),
    radial-gradient(55% 46% at 10% 4%, rgba(255, 210, 232, 0.42) 0%, rgba(255, 210, 232, 0) 62%),
    radial-gradient(50% 44% at 92% 6%, rgba(196, 216, 255, 0.4) 0%, rgba(196, 216, 255, 0) 64%),
    radial-gradient(52% 46% at 84% 92%, rgba(228, 208, 255, 0.36) 0%, rgba(228, 208, 255, 0) 62%),
    radial-gradient(46% 42% at 12% 90%, rgba(204, 238, 255, 0.36) 0%, rgba(204, 238, 255, 0) 64%);
  background-size:
    24px 24px,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%;
  background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat;
}

html[data-theme="dark"] body {
  background-color: #0b0918;
  background-image:
    radial-gradient(circle, rgba(236, 232, 255, 0.1) 1px, transparent 1.3px),
    radial-gradient(55% 46% at 10% 4%, rgba(150, 60, 120, 0.27) 0%, rgba(150, 60, 120, 0) 62%),
    radial-gradient(50% 44% at 92% 6%, rgba(70, 100, 190, 0.3) 0%, rgba(70, 100, 190, 0) 64%),
    radial-gradient(52% 46% at 84% 92%, rgba(110, 80, 180, 0.26) 0%, rgba(110, 80, 180, 0) 62%),
    radial-gradient(46% 42% at 12% 90%, rgba(60, 120, 160, 0.22) 0%, rgba(60, 120, 160, 0) 64%);
}

body.modal-open {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

button {
  cursor: pointer;
}

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

::selection {
  background: var(--accent);
  color: #151515;
}

[hidden] {
  display: none !important;
}

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

/* ---------- Header ---------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  padding: 14px var(--page-pad);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  transform: none !important;
}

.brand:hover {
  transform: none !important;
}

.brand-flower {
  height: 36px;
  width: auto;
  max-width: none;
  object-fit: contain;
  transform: none !important;
  transition: none !important;
}

.brand:hover .brand-flower {
  transform: none !important;
}

.brand-word {
  font-family: var(--display);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: 0.01em;
  line-height: 1;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: 8px;
}

.app-nav a {
  position: relative;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s ease;
}

.app-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.app-nav a:hover {
  color: var(--ink);
}

.app-nav a:hover::after,
.app-nav a.is-active::after {
  transform: scaleX(1);
}

.app-nav a.is-active {
  color: var(--ink);
}

.app-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* Theme pill */

.theme-toggle {
  position: relative;
  width: 56px;
  height: 30px;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-soft);
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.theme-toggle:hover {
  border-color: var(--ink);
}

.theme-toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 0.4s var(--ease);
}

.theme-toggle[aria-pressed="true"]::after {
  transform: translateX(26px);
}

.theme-toggle svg {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translateY(-50%);
  color: var(--ink);
  opacity: 0.5;
  transition: color 0.25s ease, opacity 0.25s ease;
  z-index: 1;
}

.icon-moon {
  left: 8px;
  fill: currentColor;
}

.icon-sun {
  right: 8px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.theme-toggle[aria-pressed="false"] .icon-moon,
.theme-toggle[aria-pressed="true"] .icon-sun {
  color: var(--thumb-contrast);
  opacity: 1;
}

/* Icon button */

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.35s var(--ease);
}

.icon-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  transform: rotate(30deg);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

/* Profile chip */

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 3px 10px 3px 3px;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.user-chip:hover {
  border-color: var(--line);
  background: var(--surface-soft);
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.2;
}

.user-name {
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 12px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Layout ---------- */

.app-main {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Buttons ---------- */

.btn-primary,
.btn-ghost,
.btn-quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  border: 1px solid var(--ink);
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  line-height: 1.2;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--on-ink);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -16px rgba(21, 21, 21, 0.55);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--surface-soft);
  border-color: var(--ink);
  transform: translateY(-2px);
}

.btn-quiet {
  position: relative;
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-quiet:focus-within {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.sr-only-file {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
}

.btn-quiet:hover {
  border-color: var(--ink);
}

.btn-primary svg,
.btn-ghost svg {
  width: 14px;
  height: 14px;
  transition: transform 0.3s var(--ease);
}

.btn-primary:hover svg,
.btn-ghost:hover svg {
  transform: translateX(3px);
}

.btn-quiet--small {
  padding: 8px 12px;
  font-size: 10.5px;
  border-color: var(--line-strong);
  cursor: pointer;
}

/* ---------- Workspace hero ---------- */

#workspace,
#studio,
#marketplace {
  scroll-margin-top: 88px;
}

.workspace {
  padding-top: clamp(48px, 8vh, 84px);
}

.workspace h1 {
  max-width: 18ch;
  margin-top: 14px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(34px, 5.4vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.workspace-hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(520px, 1.05fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.workspace-hero-copy {
  min-width: 0;
}

.trending-box {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background:
    radial-gradient(120% 150% at 8% 0%, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0) 55%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(244, 241, 255, 0.32));
  box-shadow:
    0 18px 40px -24px rgba(38, 32, 80, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  backdrop-filter: blur(18px) saturate(1.18);
}

.trending-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.trending-kicker {
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.trending-head h2 {
  margin-top: 4px;
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.trending-cta {
  flex-shrink: 0;
  padding: 7px 10px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--on-ink);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), background-color 0.2s ease;
}

.trending-cta:hover {
  transform: translateY(-1px);
  background: #292929;
}

.trending-items {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.trending-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 132px;
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(21, 21, 21, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.4);
  text-align: left;
  cursor: pointer;
  opacity: 1;
  transform: translateX(0);
  transition:
    opacity 0.24s var(--ease),
    transform 0.24s var(--ease),
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.trending-item:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.72);
  transform: translateY(-2px);
}

.trending-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--page);
  font-family: var(--display);
  font-weight: 800;
  font-size: 11px;
}

.trending-icon svg,
.trending-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.trending-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.trending-copy strong {
  overflow: hidden;
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trending-meta {
  overflow: hidden;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trending-items.is-leaving .trending-item {
  opacity: 0.35;
  transform: translateX(-14px);
}

.trending-item.is-entering {
  opacity: 0.35;
  transform: translateX(14px);
}

html[data-theme="dark"] .trending-box {
  border-color: rgba(236, 232, 255, 0.14);
  background:
    radial-gradient(120% 150% at 8% 0%, rgba(130, 116, 200, 0.24), rgba(130, 116, 200, 0) 55%),
    linear-gradient(145deg, rgba(38, 32, 62, 0.8), rgba(18, 15, 32, 0.58));
}

html[data-theme="dark"] .trending-item {
  border-color: rgba(236, 232, 255, 0.08);
  background: rgba(8, 6, 18, 0.32);
}

html[data-theme="dark"] .trending-item:hover {
  background: rgba(8, 6, 18, 0.5);
}

html.reduce-motion .trending-box {
  animation: none;
}

html.reduce-motion .trending-item {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .trending-box {
    animation: none;
  }

  .trending-item {
    transition: none;
  }
}

@media (max-width: 1100px) {
  .workspace-hero-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .trending-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .trending-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .trending-item {
    height: 106px;
  }
}

.name-mark {
  background: linear-gradient(180deg, transparent 64%, var(--marker) 64%);
  padding: 0 0.04em;
}

.role-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

.signed-as {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.signed-as span {
  color: var(--ink);
}

.workspace-sub {
  max-width: 54ch;
  margin-top: 20px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
}

.workspace-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

body[data-role="buyer"] .builder-only {
  display: none !important;
}

body[data-role="builder"] .buyer-only {
  display: none !important;
}

body:not([data-role]) .builder-only,
body:not([data-role]) .buyer-only {
  display: none !important;
}

/* ---------- Stats ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 46px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  transition: border-color 0.25s ease;
}

.stat:hover {
  border-color: var(--line-strong);
}

.stat-value {
  font-family: var(--display);
  font-weight: 800;
  font-size: 25px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Section head ---------- */

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.section-head h2 {
  margin-top: 10px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1;
  letter-spacing: -0.025em;
}

.section-note {
  max-width: 32ch;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  text-align: right;
}

/* ---------- Studio ---------- */

.studio {
  margin-top: clamp(64px, 10vh, 100px);
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.8fr);
  gap: 24px;
  align-items: start;
}

.studio-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field > span {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--field-bg);
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted-2);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--line);
}

.field input[readonly] {
  color: var(--muted);
  background: var(--page);
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238f8aa6' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.55;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 14px;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.form-section legend {
  display: block;
  width: 100%;
  padding: 0 0 2px;
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

/* Uploads */

.upload-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.upload {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.upload-tile {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  background: var(--field-bg);
  cursor: pointer;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.upload-tile:hover {
  border-color: var(--ink);
  background: var(--surface);
}

.upload-tile:focus-within {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.upload-hint {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px;
  text-align: center;
  color: var(--muted);
}

.upload-hint svg {
  width: 17px;
  height: 17px;
  margin-bottom: 2px;
}

.upload-hint strong {
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 10.5px;
  color: var(--ink);
}

.upload-hint em {
  font-family: var(--mono);
  font-style: normal;
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.upload-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-tile.has-image .upload-hint {
  display: none;
}

.pricing-upload {
  width: 100%;
  max-width: 180px;
}

.pricing-upload .upload-preview {
  object-fit: contain;
  background: var(--page);
}

.upload-clear {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.upload-clear:hover {
  color: var(--ink);
}

.studio-message {
  min-height: 12px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.studio-message.is-error {
  color: var(--danger);
}

.studio-message.is-success {
  color: var(--success);
}

.studio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Preview panel */

.studio-preview {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.preview-label {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.studio-preview > .preview-label {
  margin-bottom: -8px;
}

.preview-card {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.preview-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-logo {
  transform: none;
  rotate: 0deg;
  transition: none;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-head h3 {
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-meta {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.preview-tagline {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink);
}

.preview-desc {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.preview-price {
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.preview-shots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.preview-shot {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--page);
}

.preview-shot em {
  font-family: var(--mono);
  font-style: normal;
  font-size: 7.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.preview-shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-shot.has-image em {
  display: none;
}

/* My listings */

.my-listings {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 16px 18px;
}

.my-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
}

.my-count {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
}

.my-list {
  list-style: none;
  padding: 0;
}

.my-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.my-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* Builder analytics */

.builder-analytics {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  background:
    radial-gradient(120% 150% at 8% 0%, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0) 54%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(244, 241, 255, 0.3));
  box-shadow:
    0 16px 34px -24px rgba(38, 32, 80, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  backdrop-filter: blur(18px) saturate(1.18);
}

.analytics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.analytics-kicker {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.analytics-window {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  font-family: var(--mono);
  font-size: 6.5px;
  font-style: normal;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.analytics-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--line);
}

.analytics-metric {
  min-width: 0;
}

.analytics-metric strong {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.analytics-metric span {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-overflow: ellipsis;
  color: var(--muted);
  white-space: nowrap;
}

.analytics-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.analytics-chart {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(21, 21, 21, 0.08);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.3);
}

.analytics-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.analytics-chart-head span {
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.analytics-chart-head em {
  font-family: var(--mono);
  font-size: 6px;
  font-style: normal;
  letter-spacing: 0.05em;
  color: var(--muted-2);
  white-space: nowrap;
}

.analytics-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 46px;
  margin-top: 8px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line);
}

.analytics-bar-col {
  display: flex;
  flex: 1;
  align-items: flex-end;
  height: 100%;
  min-width: 0;
}

.analytics-bar {
  width: 100%;
  min-height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--ink);
  opacity: 0.82;
}

.analytics-chart--clicks .analytics-bar {
  background: linear-gradient(180deg, var(--muted), var(--line-strong));
}

.analytics-bar.is-zero {
  opacity: 0.16;
}

.analytics-day-labels {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--muted-2);
}

html[data-theme="dark"] .builder-analytics {
  border-color: rgba(236, 232, 255, 0.14);
  background:
    radial-gradient(120% 150% at 8% 0%, rgba(130, 116, 200, 0.24), rgba(130, 116, 200, 0) 55%),
    linear-gradient(145deg, rgba(38, 32, 62, 0.8), rgba(18, 15, 32, 0.58));
  box-shadow:
    0 18px 38px -22px rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .analytics-window {
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .analytics-chart {
  border-color: rgba(236, 232, 255, 0.08);
  background: rgba(8, 6, 18, 0.32);
}

.analytics-page {
  margin-top: clamp(52px, 8vh, 84px);
}

.analytics-overview .builder-analytics {
  padding: 20px;
}

.analytics-overview .analytics-metrics {
  padding: 14px 0 16px;
}

.analytics-overview .analytics-metric strong {
  font-size: clamp(28px, 4vw, 42px);
}

.analytics-overview .analytics-bars {
  height: 70px;
}

.analytics-overview .analytics-chart {
  padding: 12px;
}

.analytics-overview .analytics-day-labels {
  font-size: 7px;
}

.analytics-section-head {
  margin-top: 52px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.analytics-listing {
  min-width: 0;
}

.analytics-listing-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 2px 8px;
}

.analytics-listing-head strong {
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-listing-head span {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.builder-analytics.is-empty .analytics-metric strong {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
  color: var(--muted);
}

.analytics-bars.is-empty {
  align-items: center;
  justify-content: center;
}

.analytics-no-data {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.analytics-empty {
  padding: 26px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  text-align: center;
}

.analytics-empty strong {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.analytics-empty p {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

html[data-theme="dark"] .analytics-empty {
  background: rgba(23, 20, 42, 0.55);
}

@media (max-width: 980px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .analytics-overview .analytics-charts {
    grid-template-columns: 1fr;
  }

  .analytics-overview .analytics-metric strong {
    font-size: clamp(24px, 8vw, 34px);
  }
}

.my-thumb {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--page);
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
}

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

.my-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.my-info strong {
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-info span {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.my-delete {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-left: auto;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.my-delete:hover {
  color: var(--danger);
  border-color: var(--line);
  background: var(--surface);
}

.my-delete svg {
  width: 13px;
  height: 13px;
}

.my-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

.my-edit {
  margin-left: 0;
}

.my-edit:hover {
  color: var(--accent);
}

.my-empty {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- Marketplace ---------- */

.marketplace {
  margin-top: clamp(64px, 10vh, 100px);
}

.market-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 240px;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
  color: var(--muted);
  transition: border-color 0.2s ease;
}

.search-field:focus-within {
  border-color: var(--ink);
}

.search-field svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 12.5px;
  outline: none;
}

.search-field input::placeholder {
  color: var(--muted-2);
}

.filter-row {
  order: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.chip {
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: transparent;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.chip:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}

.sort-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sort-field span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.sort-field select {
  appearance: none;
  -webkit-appearance: none;
  padding: 8px 26px 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background-color: var(--surface-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238f8aa6' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  font-family: var(--sans);
  font-size: 11.5px;
  cursor: pointer;
}

.results-line {
  margin: 8px 0 14px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  list-style: none;
  padding: 0;
}

.view-toggle {
  display: flex;
  flex-shrink: 0;
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
}

.view-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.view-btn + .view-btn {
  border-left: 1px solid var(--line);
}

.view-btn:hover {
  color: var(--ink);
}

.view-btn.is-active {
  background: var(--ink);
  color: var(--on-ink);
}

.view-btn svg {
  width: 14px;
  height: 14px;
}

.app-grid.is-list {
  grid-template-columns: 1fr;
  gap: 10px;
}

.app-grid.is-list .app-card {
  display: grid;
  grid-template-columns: minmax(190px, 0.85fr) minmax(0, 1.7fr) auto;
  grid-template-areas:
    "top desc foot"
    "top tags foot";
  align-items: center;
  column-gap: 20px;
  row-gap: 6px;
  padding: 14px 18px;
}

.app-grid.is-list .card-top {
  grid-area: top;
}

.app-grid.is-list .app-desc {
  grid-area: desc;
}

.app-grid.is-list .app-price {
  grid-area: price;
}

.app-grid.is-list .app-card.has-price {
  grid-template-areas:
    "top desc foot"
    "top price foot"
    "top tags foot";
}

.app-grid.is-list .card-tags {
  grid-area: tags;
}

.app-grid.is-list .card-foot {
  grid-area: foot;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding-top: 0;
  border-top: 0;
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  cursor: pointer;
  transition: transform 0.35s var(--ease), border-color 0.3s ease, box-shadow 0.35s var(--ease);
}

.app-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--card-shadow);
}

.card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-logo {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--page);
  color: var(--ink);
}

.app-logo svg {
  width: 19px;
  height: 19px;
}

.app-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-logo .logo-letter {
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
}

.app-head {
  min-width: 0;
}

.app-head h3 {
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-meta {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.save-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.save-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.save-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
}

.save-btn[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}

.save-btn[aria-pressed="true"] svg {
  fill: currentColor;
}

.card-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.card-top-actions .save-btn {
  margin-left: 0;
}

.upvote-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 28px;
  flex-shrink: 0;
  padding: 0 5px 0 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.34));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  transition:
    transform 0.2s var(--ease),
    color 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.upvote-btn:hover {
  transform: translateY(-1px);
  color: var(--ink);
  border-color: var(--line-strong);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.5));
  box-shadow:
    0 10px 20px -14px rgba(38, 32, 80, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.upvote-btn svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s var(--ease), fill 0.2s ease;
}

.upvote-btn:hover svg {
  transform: translateY(-1px);
}

.upvote-label {
  display: none;
  font-size: 7.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.upvote-divider {
  display: none;
  width: 1px;
  height: 12px;
  background: var(--line);
}

.upvote-count {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  font-size: 8px;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.upvote-btn[aria-pressed="true"] {
  color: var(--ink);
  border-color: rgba(21, 21, 21, 0.34);
  background: linear-gradient(145deg, rgba(232, 255, 95, 0.46), rgba(232, 255, 95, 0.16));
  box-shadow:
    0 0 0 2px rgba(232, 255, 95, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.upvote-btn[aria-pressed="true"] svg {
  fill: currentColor;
  stroke: none;
  transform: translateY(-1px);
}

.upvote-btn[aria-pressed="true"] .upvote-count {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--on-ink);
}

.detail-action-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.detail-actions .upvote-btn {
  height: 34px;
  gap: 8px;
  padding: 0 8px 0 10px;
}

.detail-actions .upvote-label {
  display: inline;
}

.detail-actions .upvote-divider {
  display: block;
}

.detail-actions .upvote-count {
  min-width: 20px;
  height: 20px;
}

@keyframes upvoteBump {
  0% { transform: scale(1); }
  45% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes upvoteCountPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.upvote-btn.is-bumped {
  animation: upvoteBump 0.32s var(--ease);
}

.upvote-btn.is-bumped .upvote-count {
  animation: upvoteCountPop 0.32s var(--ease);
}

html[data-theme="dark"] .upvote-btn {
  border-color: rgba(236, 232, 255, 0.14);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .upvote-btn:hover {
  border-color: rgba(236, 232, 255, 0.34);
  background: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .upvote-count {
  border-color: rgba(236, 232, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .upvote-btn[aria-pressed="true"] {
  border-color: rgba(232, 255, 95, 0.4);
  background: linear-gradient(145deg, rgba(232, 255, 95, 0.24), rgba(232, 255, 95, 0.08));
}

.app-desc {
  flex: 1;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}

.app-price {
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  padding: 3px 6px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.app-rating {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.details-link {
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s ease;
}

.details-link:hover {
  color: var(--ink);
}

.visit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  transition: gap 0.25s var(--ease);
}

.visit:hover {
  gap: 8px;
}

.visit svg {
  width: 11px;
  height: 11px;
}

.visit.is-muted {
  color: var(--muted-2);
  pointer-events: none;
}

.empty-state {
  padding: 36px 20px;
  border: 1px dashed var(--line-strong);
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

/* ---------- About ---------- */

.about-orca {
  margin-top: clamp(64px, 10vh, 104px);
  padding-top: 38px;
  border-top: 1px solid var(--line);
}

.about-orca h2 {
  margin-top: 12px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(28px, 3.8vw, 46px);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.about-lede {
  max-width: 58ch;
  margin-top: 14px;
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--muted);
}

.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 32px;
}

.pillar {
  padding-top: 14px;
  border-top: 1px solid var(--line-strong);
}

.pillar-num {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.pillar h3 {
  margin: 6px 0 6px;
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 15px;
}

.pillar p {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
  padding: 0;
  list-style: none;
}

.steps li {
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.step-kicker {
  display: block;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.steps strong {
  display: block;
  margin: 7px 0 4px;
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 12.5px;
  line-height: 1.35;
}

.steps p {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
}

/* ---------- Footer ---------- */

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1160px, 100%);
  margin: 0 auto;
  margin-top: clamp(64px, 9vh, 96px);
  padding: 24px var(--page-pad);
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.app-footer a {
  position: relative;
  color: var(--ink);
}

.app-footer a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.app-footer a:hover::after {
  transform: scaleX(1);
}

.footer-contact {
  color: var(--muted);
}

.footer-legal {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-legal a {
  color: inherit;
  text-decoration: none;
}

.footer-legal a:hover {
  text-decoration: underline;
}

.footer-contact a {
  margin-left: 4px;
}

/* ---------- Sheets / dialogs ---------- */

.sheet {
  position: fixed;
  inset: 0;
  width: min(460px, calc(100vw - 32px));
  height: fit-content;
  max-height: calc(100vh - 40px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}

.sheet--wide {
  width: min(620px, calc(100vw - 32px));
}

.sheet--profile {
  width: min(580px, calc(100vw - 32px));
}

.sheet--settings {
  width: min(520px, calc(100vw - 32px));
}

.sheet--full {
  inset: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  overflow: hidden;
}

.sheet--full::backdrop {
  background: rgba(12, 9, 26, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.sheet--full .sheet-card {
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: 100dvh;
  padding: 0 0 56px;
  overflow-y: auto;
  border: 0;
  box-shadow: none;
}

.sheet--full .sheet-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 12;
  border-color: var(--line);
  background: var(--sheet-bg);
}

.sheet::backdrop {
  background: rgba(12, 9, 26, 0.45);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.sheet[open] .sheet-card {
  animation: sheet-in 0.35s var(--ease) both;
}

.sheet[open]::backdrop {
  animation: backdrop-in 0.3s ease both;
}

.sheet-card {
  position: relative;
  max-height: calc(100vh - 40px);
  padding: 26px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  background: var(--sheet-bg);
  box-shadow: 0 40px 100px -36px rgba(14, 9, 40, 0.55);
}

.sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
  z-index: 2;
}

.sheet-close:hover {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface-soft);
}

.sheet-close svg {
  width: 14px;
  height: 14px;
}

.sheet-eyebrow {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.sheet-title {
  margin: 7px 0 20px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.025em;
}

.sheet-note {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.6;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.sheet-block {
  margin-top: 22px;
}

.sheet-label {
  margin-bottom: 9px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Listing detail */

.detail-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 36px;
  margin-bottom: 18px;
}

.detail-head-copy {
  min-width: 0;
}

.detail-logo {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--page);
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
}

.detail-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-logo svg {
  width: 26px;
  height: 26px;
}

.sheet-title.detail-title {
  margin: 0 0 4px;
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.05;
}

.detail-meta {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-desc {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--muted);
}

.detail-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.detail-gallery img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--page);
}

.detail-pricing {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.detail-pricing h3 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.detail-pricing p {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  white-space: pre-line;
}

.detail-pricing img {
  display: block;
  width: 100%;
  max-height: 420px;
  margin-top: 14px;
  border: 1px solid var(--line);
  background: var(--page);
  object-fit: contain;
}

.detail-tags {
  margin-top: 16px;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.detail-actions .save-btn {
  width: 32px;
  height: 32px;
  margin-left: 0;
}

.detail-nolink {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* Full-page listing detail */

.detail-shell {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 0 var(--page-pad) 48px;
}

.detail-bar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(26px, 4vw, 44px);
  padding: 14px 40px 14px 0;
  border-bottom: 1px solid var(--line);
  background: var(--sheet-bg);
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  background: transparent;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.detail-back:hover {
  border-color: var(--ink);
  background: var(--surface-soft);
}

.detail-back svg {
  width: 12px;
  height: 12px;
}

.detail-bar-label {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-hero {
  display: flex;
  align-items: flex-start;
  gap: clamp(16px, 2.6vw, 26px);
}

.detail-hero .detail-logo {
  width: clamp(64px, 8vw, 86px);
  height: clamp(64px, 8vw, 86px);
  font-size: 24px;
}

.detail-hero .detail-logo svg {
  width: 38px;
  height: 38px;
}

.detail-hero-copy {
  min-width: 0;
}

.detail-hero .detail-title {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.detail-tagline {
  max-width: 60ch;
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--muted);
}

.detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(240px, 0.75fr);
  gap: clamp(24px, 4vw, 48px);
  margin-top: clamp(28px, 4vw, 44px);
  align-items: start;
}

.detail-main {
  min-width: 0;
}

.detail-main .detail-desc {
  font-size: 14px;
  line-height: 1.7;
}

.detail-side {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-facts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.detail-facts div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.detail-facts dt {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-facts dd {
  margin: 0;
  font-size: 12px;
  text-align: right;
  color: var(--ink);
}

.detail-side .detail-actions {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.detail-side .detail-actions .btn-primary {
  width: 100%;
}

.detail-side .detail-actions .save-btn {
  width: 100%;
  height: 36px;
  margin-left: 0;
}

.detail-side .detail-action-tools {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  margin-left: 0;
}

.detail-side .detail-actions .upvote-btn {
  width: auto;
  height: 36px;
}

/* Comments */

.detail-comments {
  margin-top: clamp(30px, 4vw, 44px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.comments-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.comments-head h3 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.comments-head h3 span {
  margin-left: 6px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.comments-head p {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.comment-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  margin-top: 14px;
}

.comment-form textarea {
  width: 100%;
  min-height: 82px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--field-bg);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comment-form textarea::placeholder {
  color: var(--muted-2);
}

.comment-form textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--line);
}

.comment-list {
  display: flex;
  flex-direction: column;
  margin-top: 18px;
  padding: 0;
  list-style: none;
}

.comment-item {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.comment-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comment-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--page);
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.comment-meta strong {
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 12px;
}

.comment-meta span {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.comment-delete {
  margin-left: auto;
  padding: 4px 8px;
  border: 1px solid transparent;
  background: transparent;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.comment-delete:hover {
  color: var(--danger);
  border-color: var(--line);
}

.comment-text {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.comment-empty {
  margin-top: 16px;
  padding: 16px;
  border: 1px dashed var(--line);
  font-size: 12px;
  color: var(--muted);
}

/* Profile */

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--page);
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 22px;
  text-transform: uppercase;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-strength {
  width: 150px;
  margin-left: auto;
}

.profile-strength-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.profile-strength-label strong {
  color: var(--ink);
  font-weight: 500;
}

.profile-strength-bar {
  display: block;
  height: 5px;
  margin-top: 6px;
  background: var(--line);
  overflow: hidden;
}

.profile-strength-bar i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ink);
  transition: width 0.4s var(--ease);
}

.profile-photo-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}

.link-quiet {
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.link-quiet:hover {
  color: var(--ink);
}

.sheet-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sheet-form .btn-primary {
  margin-top: 4px;
  width: 100%;
}

.sheet-message {
  min-height: 12px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--success);
}

.sheet-message.is-error {
  color: var(--danger);
}

/* Segmented control */

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line-strong);
  background: var(--page);
}

.segmented button {
  padding: 9px 6px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  transition: background-color 0.25s ease, color 0.25s ease;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button[aria-checked="true"] {
  background: var(--ink);
  color: var(--on-ink);
}

.segmented--2 {
  grid-template-columns: repeat(2, 1fr);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.setting-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.setting-copy strong {
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 12px;
}

.setting-copy em {
  font-style: normal;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}

.setting-row .segmented {
  width: 132px;
  flex-shrink: 0;
}

.setting-selects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.contact-card:hover {
  border-color: var(--ink);
  background: var(--surface);
}

.contact-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 14px;
}

.contact-card strong {
  display: block;
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 12px;
}

.contact-card em {
  display: block;
  margin-top: 1px;
  font-style: normal;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* Switches */

.switch-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.switch-row:last-of-type {
  border-bottom: 0;
  padding-bottom: 2px;
}

.switch-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.switch-copy strong {
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 12px;
}

.switch-copy em {
  font-style: normal;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}

.switch-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch {
  position: relative;
  display: block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--page);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.3s var(--ease), background-color 0.25s ease;
}

.switch-row input:checked + .switch {
  background: var(--ink);
  border-color: var(--ink);
}

.switch-row input:checked + .switch::after {
  transform: translateX(16px);
  background: var(--on-ink);
}

.switch-row input:focus-visible + .switch {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Settings actions */

.sheet-actions {
  border-top: 1px solid var(--line);
}

.sheet-action {
  display: block;
  width: 100%;
  padding: 11px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-size: 12px;
  text-align: left;
  color: var(--ink);
  transition: color 0.2s ease, padding-left 0.25s var(--ease);
}

.sheet-action:last-child {
  border-bottom: 0;
}

.sheet-action:hover {
  padding-left: 4px;
  color: var(--muted);
}

.sheet-action--danger {
  color: var(--danger);
}

.sheet-action--danger:hover {
  color: var(--danger);
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 100;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--on-ink);
  font-size: 11.5px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.3s ease, transform 0.35s var(--ease);
}

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

/* ---------- Keyframes ---------- */

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  #workspace,
  #studio,
  #marketplace {
    scroll-margin-top: 116px;
  }

  .app-header {
    flex-wrap: wrap;
    row-gap: 2px;
    padding-bottom: 8px;
  }

  .app-nav {
    order: 3;
    flex-basis: 100%;
    gap: 20px;
    margin: 0;
  }

  .app-nav a {
    padding-bottom: 4px;
  }

  .studio-grid {
    grid-template-columns: 1fr;
  }

  .studio-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .studio-preview > .preview-label {
    grid-column: 1 / -1;
    margin-bottom: -10px;
  }
}

@media (max-width: 880px) {
  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-grid.is-list .app-card {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "top foot"
      "desc desc"
      "tags tags";
    row-gap: 8px;
  }

  .app-grid.is-list .app-card.has-price {
    grid-template-areas:
      "top foot"
      "desc desc"
      "price price"
      "tags tags";
  }

  .app-grid.is-list .card-foot {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .detail-body {
    grid-template-columns: 1fr;
  }

  .detail-side {
    position: static;
  }

  .detail-side .detail-actions {
    flex-direction: row;
    align-items: center;
  }

  .detail-side .detail-actions .btn-primary {
    width: auto;
    flex: 1;
  }

  .detail-side .detail-actions .save-btn {
    width: 36px;
    flex-shrink: 0;
  }

  .detail-side .detail-action-tools {
    display: flex;
    width: auto;
  }

  .detail-side .detail-actions .upvote-btn {
    flex: 0 0 auto;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pillars,
  .steps {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .section-note {
    text-align: left;
  }
}

@media (max-width: 760px) {
  .studio-preview {
    grid-template-columns: 1fr;
  }

  .user-meta {
    display: none;
  }

  .user-chip {
    padding: 3px;
  }

  .app-user {
    gap: 8px;
  }

  .workspace h1 {
    max-width: 14ch;
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: 11px 16px;
    gap: 12px;
  }

  .brand-word {
    font-size: 19px;
  }

  .brand-flower {
    width: 28px;
  }

  .app-main {
    padding: 0 16px;
  }

  .workspace {
    padding-top: 40px;
  }

  .workspace-sub {
    font-size: 15.5px;
  }

  .workspace-actions {
    width: 100%;
  }

  .workspace-actions .btn-primary,
  .workspace-actions .btn-ghost {
    flex: 1;
  }

  .app-grid {
    grid-template-columns: 1fr;
  }

  .app-grid.is-list .app-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "top"
      "desc"
      "tags"
      "foot";
  }

  .app-grid.is-list .app-card.has-price {
    grid-template-areas:
      "top"
      "desc"
      "price"
      "tags"
      "foot";
  }

  .app-grid.is-list .card-foot {
    justify-content: space-between;
  }

  .detail-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .detail-hero {
    flex-direction: column;
    gap: 14px;
  }

  .detail-bar {
    padding-right: 40px;
  }

  .detail-bar-label {
    display: none;
  }

  .comments-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .setting-row {
    flex-wrap: wrap;
  }

  .setting-row .segmented {
    width: 100%;
  }

  .setting-selects {
    grid-template-columns: 1fr;
  }

  .profile-head {
    flex-wrap: wrap;
  }

  .profile-strength {
    width: 100%;
    margin-left: 0;
  }

  .studio-form {
    padding: 18px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .filter-row::-webkit-scrollbar {
    display: none;
  }

  .chip {
    flex-shrink: 0;
  }

  .app-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 22px 16px;
  }

  .sheet {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .sheet-card {
    padding: 22px 18px;
    max-height: calc(100vh - 20px);
  }

  .toast {
    bottom: 16px;
  }
}

@media (max-width: 420px) {
  .theme-toggle {
    width: 48px;
  }

  .theme-toggle[aria-pressed="true"]::after {
    transform: translateX(18px);
  }

  .icon-btn {
    width: 32px;
    height: 32px;
  }

  .upload-row {
    grid-template-columns: 1fr 1fr;
  }

  .upload--logo {
    grid-column: 1 / -1;
    max-width: none;
    align-items: center;
  }

  .upload--logo .upload-tile {
    width: 120px;
  }
}

/* ---------- Compact mode ---------- */

html.compact .app-card {
  padding: 12px 14px;
  gap: 8px;
}

html.compact .app-grid {
  gap: 10px;
}

html.compact .app-grid.is-list .app-card {
  padding: 10px 14px;
}

html.compact .stats {
  gap: 8px;
}

html.compact .stat {
  padding: 12px 14px;
}

html.compact .stat-value {
  font-size: 21px;
}

html.compact .marketplace,
html.compact .studio {
  margin-top: clamp(44px, 7vh, 70px);
}

html.compact .detail-gallery {
  gap: 6px;
}

html.compact .comment-item {
  padding: 10px 0;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}

html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after {
  animation: none !important;
  transition: none !important;
}

html.reduce-motion .app-card:hover,
html.reduce-motion .btn-primary:hover,
html.reduce-motion .btn-ghost:hover {
  transform: none;
}

/* ---------- Left workspace sidebar ---------- */

body[data-page="workspace"],
body[data-page="studio"],
body[data-page="analytics"] {
  padding-left: 248px;
}

body[data-page="workspace"] .app-header,
body[data-page="studio"] .app-header,
body[data-page="analytics"] .app-header {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 60;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 248px;
  height: 100vh;
  padding: 22px 16px 18px;
  border-right: 1px solid var(--line);
  border-bottom: 0;
  background: var(--header-bg);
}

body[data-page="workspace"] .brand,
body[data-page="studio"] .brand,
body[data-page="analytics"] .brand {
  padding: 0 8px 20px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

body[data-page="workspace"] .app-nav,
body[data-page="studio"] .app-nav,
body[data-page="analytics"] .app-nav {
  position: relative;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin: 0;
}

body[data-page="workspace"] .app-nav::before,
body[data-page="studio"] .app-nav::before,
body[data-page="analytics"] .app-nav::before {
  content: "Workspace";
  padding: 0 12px 8px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}

body[data-page="workspace"] .app-nav a,
body[data-page="studio"] .app-nav a,
body[data-page="analytics"] .app-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12px;
}

body[data-page="workspace"] .app-nav a::after,
body[data-page="studio"] .app-nav a::after,
body[data-page="analytics"] .app-nav a::after {
  display: none;
}

body[data-page="workspace"] .app-nav a:hover,
body[data-page="studio"] .app-nav a:hover,
body[data-page="analytics"] .app-nav a:hover {
  border-color: var(--line);
  background: var(--surface-soft);
}

body[data-page="workspace"] .app-nav a.is-active,
body[data-page="studio"] .app-nav a.is-active,
body[data-page="analytics"] .app-nav a.is-active {
  border-color: #0c0c0e;
  border-radius: 999px;
  background: #0c0c0e;
  box-shadow: none;
  color: #fff;
  font-weight: 600;
}

body[data-page="workspace"] .app-nav a.is-active::before,
body[data-page="studio"] .app-nav a.is-active::before,
body[data-page="analytics"] .app-nav a.is-active::before {
  display: none;
}

.nav-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body[data-page="workspace"] .app-user,
body[data-page="studio"] .app-user,
body[data-page="analytics"] .app-user {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  margin-left: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

body[data-page="workspace"] .icon-btn,
body[data-page="studio"] .icon-btn,
body[data-page="analytics"] .icon-btn {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}

body[data-page="workspace"] .user-meta,
body[data-page="studio"] .user-meta,
body[data-page="analytics"] .user-meta {
  display: flex;
}

body[data-page="workspace"] .user-chip,
body[data-page="studio"] .user-chip,
body[data-page="analytics"] .user-chip {
  display: flex;
  grid-column: 1;
  grid-row: 1;
  justify-self: stretch;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

#workspace,
#studio,
#marketplace {
  scroll-margin-top: 24px;
}

@media (max-width: 1080px) {
  body[data-page="workspace"],
  body[data-page="studio"],
  body[data-page="analytics"] {
    padding-left: 78px;
  }

  body[data-page="workspace"] .app-header,
  body[data-page="studio"] .app-header,
  body[data-page="analytics"] .app-header {
    width: 78px;
    padding: 18px 10px 14px;
    align-items: center;
  }

  body[data-page="workspace"] .brand,
  body[data-page="studio"] .brand,
  body[data-page="analytics"] .brand {
    justify-content: center;
    width: 46px;
    padding: 0 0 16px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--line);
  }

  body[data-page="workspace"] .brand-word,
  body[data-page="studio"] .brand-word,
  body[data-page="analytics"] .brand-word,
  body[data-page="workspace"] .app-nav span,
  body[data-page="studio"] .app-nav span,
  body[data-page="analytics"] .app-nav span,
  body[data-page="workspace"] .app-nav::before,
  body[data-page="studio"] .app-nav::before,
  body[data-page="analytics"] .app-nav::before,
  body[data-page="workspace"] .user-meta,
  body[data-page="studio"] .user-meta,
  body[data-page="analytics"] .user-meta {
    display: none;
  }

  body[data-page="workspace"] .app-nav a,
  body[data-page="studio"] .app-nav a,
  body[data-page="analytics"] .app-nav a {
    justify-content: center;
    width: 52px;
    min-height: 46px;
    padding: 0;
  }

  body[data-page="workspace"] .app-nav a.is-active::before,
  body[data-page="studio"] .app-nav a.is-active::before,
  body[data-page="analytics"] .app-nav a.is-active::before {
    left: -1px;
  }

  .nav-icon {
    width: 19px;
    height: 19px;
  }

  body[data-page="workspace"] .app-user,
  body[data-page="studio"] .app-user,
  body[data-page="analytics"] .app-user {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 12px;
  }

  body[data-page="workspace"] .icon-btn,
  body[data-page="studio"] .icon-btn,
  body[data-page="analytics"] .icon-btn,
  body[data-page="workspace"] .user-chip,
  body[data-page="studio"] .user-chip,
  body[data-page="analytics"] .user-chip {
    grid-column: auto;
    grid-row: auto;
    justify-self: center;
    align-self: center;
  }

  body[data-page="workspace"] .user-chip,
  body[data-page="studio"] .user-chip,
  body[data-page="analytics"] .user-chip {
    width: 46px;
    justify-content: center;
    padding: 4px;
  }
}

@media (max-width: 760px) {
  body[data-page="workspace"],
  body[data-page="studio"],
  body[data-page="analytics"] {
    padding-left: 0;
  }

  body[data-page="workspace"] .app-header,
  body[data-page="studio"] .app-header,
  body[data-page="analytics"] .app-header {
    position: sticky;
    top: 0;
    bottom: auto;
    left: auto;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    width: 100%;
    height: auto;
    padding: 11px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  body[data-page="workspace"] .brand,
  body[data-page="studio"] .brand,
  body[data-page="analytics"] .brand {
    justify-content: flex-start;
    width: auto;
    padding: 0;
    margin-bottom: 0;
    border-bottom: 0;
  }

  body[data-page="workspace"] .brand-word,
  body[data-page="studio"] .brand-word,
  body[data-page="analytics"] .brand-word,
  body[data-page="workspace"] .app-nav span,
  body[data-page="studio"] .app-nav span,
  body[data-page="analytics"] .app-nav span {
    display: inline;
  }

  .nav-icon {
    display: none;
  }

  body[data-page="workspace"] .app-nav,
  body[data-page="studio"] .app-nav,
  body[data-page="analytics"] .app-nav {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    overflow-x: auto;
  }

  body[data-page="workspace"] .app-nav a,
  body[data-page="studio"] .app-nav a,
  body[data-page="analytics"] .app-nav a {
    width: auto;
    min-height: 32px;
    padding: 0 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 11.5px;
    white-space: nowrap;
  }

  body[data-page="workspace"] .app-nav a.is-active,
  body[data-page="studio"] .app-nav a.is-active,
  body[data-page="analytics"] .app-nav a.is-active {
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: #0c0c0e;
    box-shadow: none;
    color: #fff;
    font-weight: 600;
  }

  body[data-page="workspace"] .app-nav a.is-active::before,
  body[data-page="studio"] .app-nav a.is-active::before,
  body[data-page="analytics"] .app-nav a.is-active::before {
    display: none;
  }

  body[data-page="workspace"] .app-nav a::after,
  body[data-page="studio"] .app-nav a::after,
  body[data-page="analytics"] .app-nav a::after {
    display: block;
  }

  body[data-page="workspace"] .app-user,
  body[data-page="studio"] .app-user,
  body[data-page="analytics"] .app-user {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 8px;
    margin-top: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  body[data-page="workspace"] .user-meta,
  body[data-page="studio"] .user-meta,
  body[data-page="analytics"] .user-meta {
    display: none;
  }

  body[data-page="workspace"] .user-chip,
  body[data-page="studio"] .user-chip,
  body[data-page="analytics"] .user-chip {
    width: auto;
    padding: 3px;
    border: 0;
    background: transparent;
  }

  #workspace,
  #studio,
  #marketplace {
    scroll-margin-top: 78px;
  }
}

/* ---------- Premium sidebar finish ---------- */

.sheet-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.sheet-theme-row .theme-toggle {
  flex-shrink: 0;
}

body[data-page="workspace"] .app-header,
body[data-page="studio"] .app-header,
body[data-page="analytics"] .app-header {
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(232, 255, 95, 0.13), transparent 58%),
    var(--header-bg);
  box-shadow: 1px 0 0 var(--line), 14px 0 40px -36px rgba(38, 32, 80, 0.5);
}

body[data-page="workspace"] .app-header::after,
body[data-page="studio"] .app-header::after,
body[data-page="analytics"] .app-header::after {
  content: "";
  position: absolute;
  top: 0;
  right: -1px;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, rgba(232, 255, 95, 0.55), transparent);
  pointer-events: none;
}

body[data-page="workspace"] .brand,
body[data-page="studio"] .brand,
body[data-page="analytics"] .brand {
  position: relative;
  border-bottom: 0;
}

body[data-page="workspace"] .brand::after,
body[data-page="studio"] .brand::after,
body[data-page="analytics"] .brand::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}

body[data-page="workspace"] .app-nav::before,
body[data-page="studio"] .app-nav::before,
body[data-page="analytics"] .app-nav::before {
  letter-spacing: 0.2em;
}

body[data-page="workspace"] .app-nav a,
body[data-page="studio"] .app-nav a,
body[data-page="analytics"] .app-nav a {
  transition:
    transform 0.22s var(--ease),
    color 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

body[data-page="workspace"] .app-nav a:hover,
body[data-page="studio"] .app-nav a:hover,
body[data-page="analytics"] .app-nav a:hover {
  transform: translateX(3px);
}

body[data-page="workspace"] .app-nav a.is-active,
body[data-page="studio"] .app-nav a.is-active,
body[data-page="analytics"] .app-nav a.is-active {
  background: #0c0c0e;
  box-shadow: none;
  color: #fff;
}

body[data-page="workspace"] .app-user,
body[data-page="studio"] .app-user,
body[data-page="analytics"] .app-user {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 12px 30px -24px rgba(38, 32, 80, 0.5);
}

body[data-page="workspace"] .icon-btn,
body[data-page="studio"] .icon-btn,
body[data-page="analytics"] .icon-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  transition: transform 0.2s var(--ease), border-color 0.2s ease, background-color 0.2s ease;
}

body[data-page="workspace"] .icon-btn:hover,
body[data-page="studio"] .icon-btn:hover,
body[data-page="analytics"] .icon-btn:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(232, 255, 95, 0.18);
}

body[data-page="workspace"] .user-chip,
body[data-page="studio"] .user-chip,
body[data-page="analytics"] .user-chip {
  border-radius: 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: transform 0.2s var(--ease), border-color 0.2s ease;
}

body[data-page="workspace"] .user-chip:hover,
body[data-page="studio"] .user-chip:hover,
body[data-page="analytics"] .user-chip:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

html[data-theme="dark"] body[data-page="workspace"] .app-nav a.is-active,
html[data-theme="dark"] body[data-page="studio"] .app-nav a.is-active,
html[data-theme="dark"] body[data-page="analytics"] .app-nav a.is-active {
  background: #0c0c0e;
  box-shadow: none;
  color: #fff;
}

@media (max-width: 1080px) {
  body[data-page="workspace"] .app-user,
  body[data-page="studio"] .app-user,
  body[data-page="analytics"] .app-user {
    width: 100%;
    padding: 8px 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body[data-page="workspace"] .app-nav a:hover,
  body[data-page="studio"] .app-nav a:hover,
  body[data-page="analytics"] .app-nav a:hover {
    transform: none;
  }
}

@media (max-width: 760px) {
  body[data-page="workspace"] .app-header,
  body[data-page="studio"] .app-header,
  body[data-page="analytics"] .app-header {
    background: var(--header-bg);
    box-shadow: none;
  }

  body[data-page="workspace"] .app-header::after,
  body[data-page="studio"] .app-header::after,
  body[data-page="analytics"] .app-header::after,
  body[data-page="workspace"] .brand::after,
  body[data-page="studio"] .brand::after,
  body[data-page="analytics"] .brand::after {
    display: none;
  }

  body[data-page="workspace"] .app-user,
  body[data-page="studio"] .app-user,
  body[data-page="analytics"] .app-user {
    padding: 0;
    box-shadow: none;
  }

  body[data-page="workspace"] .icon-btn,
  body[data-page="studio"] .icon-btn,
  body[data-page="analytics"] .icon-btn {
    border-color: transparent;
    background: transparent;
  }

  body[data-page="workspace"] .icon-btn:hover,
  body[data-page="studio"] .icon-btn:hover,
  body[data-page="analytics"] .icon-btn:hover,
  body[data-page="workspace"] .user-chip:hover,
  body[data-page="studio"] .user-chip:hover,
  body[data-page="analytics"] .user-chip:hover {
    transform: none;
  }
}

/* ---------- Detail tab surface match ---------- */

.sheet--full .sheet-card {
  background-color: #faf8f3;
  background-image:
    radial-gradient(circle, rgba(0, 0, 0, 0.14) 1px, transparent 1.3px),
    radial-gradient(55% 46% at 10% 4%, rgba(255, 210, 232, 0.42) 0%, rgba(255, 210, 232, 0) 62%),
    radial-gradient(50% 44% at 92% 6%, rgba(196, 216, 255, 0.4) 0%, rgba(196, 216, 255, 0) 64%),
    radial-gradient(52% 46% at 84% 92%, rgba(228, 208, 255, 0.36) 0%, rgba(228, 208, 255, 0) 62%),
    radial-gradient(46% 42% at 12% 90%, rgba(204, 238, 255, 0.36) 0%, rgba(204, 238, 255, 0) 64%);
  background-size:
    24px 24px,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%;
  background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  background-attachment: fixed, fixed, fixed, fixed, fixed;
}

html[data-theme="dark"] .sheet--full .sheet-card {
  background-color: #0b0918;
  background-image:
    radial-gradient(circle, rgba(236, 232, 255, 0.1) 1px, transparent 1.3px),
    radial-gradient(55% 46% at 10% 4%, rgba(150, 60, 120, 0.27) 0%, rgba(150, 60, 120, 0) 62%),
    radial-gradient(50% 44% at 92% 6%, rgba(70, 100, 190, 0.3) 0%, rgba(70, 100, 190, 0) 64%),
    radial-gradient(52% 46% at 84% 92%, rgba(110, 80, 180, 0.26) 0%, rgba(110, 80, 180, 0) 62%),
    radial-gradient(46% 42% at 12% 90%, rgba(60, 120, 160, 0.22) 0%, rgba(60, 120, 160, 0) 64%);
}

.sheet--full .detail-bar {
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px) saturate(1.16);
  backdrop-filter: blur(18px) saturate(1.16);
}

.sheet--full .sheet-close {
  border-color: var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: transform 0.2s var(--ease), border-color 0.2s ease, background-color 0.2s ease;
}

.sheet--full .sheet-close:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(232, 255, 95, 0.22);
}

.sheet--full .detail-facts,
.sheet--full .detail-pricing {
  border-radius: 14px;
  box-shadow:
    0 18px 38px -30px rgba(38, 32, 80, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: blur(16px) saturate(1.14);
  backdrop-filter: blur(16px) saturate(1.14);
}

html[data-theme="dark"] .sheet--full .detail-facts,
html[data-theme="dark"] .sheet--full .detail-pricing {
  box-shadow:
    0 18px 38px -28px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.sheet--full .detail-gallery img,
.sheet--full .detail-pricing img {
  border-radius: 12px;
}

/* ---------- Detail tab layout ---------- */

.sheet--full .detail-shell {
  padding-top: 26px;
}

.sheet--full .detail-bar {
  margin-bottom: 22px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.sheet--full .detail-bar-label {
  padding-right: 42px;
}

.sheet--full .detail-hero {
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.22));
  box-shadow:
    0 22px 52px -36px rgba(38, 32, 80, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(18px) saturate(1.14);
  backdrop-filter: blur(18px) saturate(1.14);
}

.sheet--full .detail-hero .detail-logo {
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.sheet--full .detail-body {
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.7fr);
  gap: 20px;
  margin-top: 22px;
}

.sheet--full .detail-main,
.sheet--full .detail-side {
  padding: clamp(18px, 2.4vw, 26px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
  box-shadow:
    0 22px 50px -38px rgba(38, 32, 80, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
  backdrop-filter: blur(18px) saturate(1.12);
}

.sheet--full .detail-side {
  position: sticky;
  top: 90px;
}

.sheet--full .detail-main .detail-desc {
  max-width: 72ch;
  font-size: 14px;
  line-height: 1.75;
}

.sheet--full .detail-gallery {
  gap: 10px;
  margin-top: 20px;
}

.sheet--full .detail-gallery img:first-child:nth-last-child(1) {
  grid-column: 1 / -1;
}

.sheet--full .detail-pricing {
  margin-top: 22px;
  padding: 18px;
}

.sheet--full .detail-tags {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.sheet--full .detail-comments {
  margin-top: 30px;
  padding-top: 24px;
}

.sheet--full .comment-form {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.28);
}

.sheet--full .comment-list {
  gap: 10px;
  margin-top: 18px;
}

.sheet--full .comment-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.24);
}

.sheet--full .comment-empty {
  margin-top: 14px;
  border-radius: 12px;
}

.sheet--full .detail-facts {
  gap: 12px;
  padding: 18px;
}

.sheet--full .detail-side .detail-actions {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.sheet--full .detail-side .btn-primary,
.sheet--full .detail-side .save-btn,
.sheet--full .detail-side .upvote-btn {
  border-radius: 10px;
}

.sheet--full .detail-side .btn-primary {
  min-height: 42px;
}

html[data-theme="dark"] .sheet--full .detail-hero,
html[data-theme="dark"] .sheet--full .detail-main,
html[data-theme="dark"] .sheet--full .detail-side {
  box-shadow:
    0 24px 54px -36px rgba(0, 0, 0, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .sheet--full .detail-hero {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
}

html[data-theme="dark"] .sheet--full .comment-form,
html[data-theme="dark"] .sheet--full .comment-item {
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 980px) {
  .sheet--full .detail-body {
    grid-template-columns: 1fr;
  }

  .sheet--full .detail-side {
    position: static;
  }
}

@media (max-width: 640px) {
  .sheet--full .detail-shell {
    padding: 14px 14px 48px;
  }

  .sheet--full .detail-bar {
    padding: 12px 14px;
  }

  .sheet--full .detail-bar-label {
    display: none;
  }

  .sheet--full .detail-hero {
    padding: 18px;
  }

  .sheet--full .detail-hero .detail-logo {
    width: 56px;
    height: 56px;
    font-size: 18px;
  }

  .sheet--full .detail-gallery {
    grid-template-columns: 1fr;
  }

  .sheet--full .detail-main,
  .sheet--full .detail-side {
    padding: 16px;
    border-radius: 14px;
  }
}

/* ---------- Detail tab density pass ---------- */

.sheet--full .detail-shell {
  width: min(1240px, 100%);
  padding-top: 20px;
}

.sheet--full .detail-bar {
  margin-bottom: 16px;
}

.sheet--full .detail-hero {
  padding: 22px 26px;
}

.sheet--full .detail-body {
  min-height: calc(100dvh - 230px);
  margin-top: 16px;
  align-items: stretch;
}

.sheet--full .detail-main,
.sheet--full .detail-side {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.sheet--full .detail-main .detail-desc {
  max-width: none;
}

.sheet--full .detail-gallery img {
  aspect-ratio: 16 / 9;
}

.sheet--full .detail-comments {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.sheet--full .comment-list {
  flex: 1;
}

.sheet--full .comment-empty {
  display: grid;
  flex: 1;
  place-items: center;
  min-height: 150px;
}

.sheet--full .detail-facts {
  margin-bottom: 16px;
}

.sheet--full .detail-side .detail-actions {
  margin-top: auto;
}

@media (max-width: 980px) {
  .sheet--full .detail-body {
    min-height: 0;
  }

  .sheet--full .detail-main,
  .sheet--full .detail-side {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .sheet--full .detail-hero {
    padding: 18px;
  }

  .sheet--full .comment-empty {
    min-height: 110px;
  }
}

/* ---------- Detail tab compact grid ---------- */

.sheet--full .detail-shell {
  width: min(1180px, 100%);
}

.sheet--full .detail-body.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.72fr);
  grid-template-areas:
    "hero side"
    "main side";
  gap: 18px;
  min-height: 0;
  margin-top: 18px;
  align-items: stretch;
}

.sheet--full .detail-hero {
  grid-area: hero;
}

.sheet--full .detail-main {
  grid-area: main;
}

.sheet--full .detail-side {
  grid-area: side;
  align-self: stretch;
  min-height: 0;
}

.sheet--full .detail-main,
.sheet--full .detail-side {
  min-height: 0;
}

.sheet--full .comment-empty {
  min-height: 0;
  padding: 18px;
}

.sheet--full .detail-side .detail-actions {
  margin-top: auto;
}

@media (max-width: 980px) {
  .sheet--full .detail-body.detail-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hero"
      "main"
      "side";
  }

  .sheet--full .detail-side {
    position: static;
  }
}

/* ---------- Detail sheet sizing ---------- */

.sheet--full {
  width: min(1180px, calc(100vw - 48px));
  max-width: min(1180px, calc(100vw - 48px));
  height: fit-content;
  max-height: calc(100vh - 48px);
  margin: auto;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  background: transparent;
  box-shadow: none;
}

.sheet--full::backdrop {
  background: rgba(12, 9, 26, 0.54);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.sheet--full .sheet-card {
  width: 100%;
  height: auto;
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: 0 40px 100px -36px rgba(14, 9, 40, 0.6);
}

html[data-theme="dark"] .sheet--full .sheet-card {
  box-shadow: 0 40px 100px -36px rgba(0, 0, 0, 0.8);
}

@media (max-width: 640px) {
  .sheet--full {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    border-radius: 14px;
  }

  .sheet--full .sheet-card {
    max-height: calc(100vh - 20px);
    border-radius: 14px;
  }
}

/* ---------- Saved SaaS workspace ---------- */

.saved-workspace {
  padding-top: clamp(40px, 7vh, 72px);
}

.saved-head h1 {
  margin-top: 10px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.saved-note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.saved-apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.saved-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 18px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  backdrop-filter: blur(16px) saturate(1.12);
  text-align: center;
  cursor: pointer;
  transition: transform 0.25s var(--ease), border-color 0.2s ease, box-shadow 0.25s ease;
}

.saved-app:hover {
  transform: translateY(-4px);
  border-color: rgba(232, 255, 95, 0.72);
  box-shadow:
    0 16px 34px -22px rgba(38, 32, 80, 0.5),
    0 0 0 2px rgba(232, 255, 95, 0.14);
}

.saved-app-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.32));
  font-family: var(--display);
  font-weight: 800;
  font-size: 21px;
}

.saved-app-icon svg,
.saved-app-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.saved-app-copy {
  display: block;
  min-width: 0;
  width: 100%;
}

.saved-app-copy strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-app-copy span {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-empty {
  margin-top: 28px;
  padding: 36px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: var(--surface-soft);
  text-align: center;
}

.saved-empty strong {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.saved-empty p {
  margin: 8px 0 16px;
  font-size: 12px;
  color: var(--muted);
}

html[data-theme="dark"] .saved-app-icon {
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 640px) {
  .saved-apps-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .saved-app {
    padding: 14px 8px;
  }

  .saved-app-icon {
    width: 48px;
    height: 48px;
  }
}

/* ---------- In-platform SaaS viewer ---------- */

.viewer-sheet {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.viewer-sheet::backdrop {
  background: rgba(12, 9, 26, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.viewer-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background-color: #faf8f3;
  background-image:
    radial-gradient(circle, rgba(0, 0, 0, 0.14) 1px, transparent 1.3px),
    radial-gradient(55% 46% at 10% 4%, rgba(255, 210, 232, 0.42) 0%, rgba(255, 210, 232, 0) 62%),
    radial-gradient(50% 44% at 92% 6%, rgba(196, 216, 255, 0.4) 0%, rgba(196, 216, 255, 0) 64%),
    radial-gradient(52% 46% at 84% 92%, rgba(228, 208, 255, 0.36) 0%, rgba(228, 208, 255, 0) 62%);
  background-size: 24px 24px, 100% 100%, 100% 100%, 100% 100%;
  background-repeat: repeat, no-repeat, no-repeat, no-repeat;
}

html[data-theme="dark"] .viewer-shell {
  background-color: #0b0918;
  background-image:
    radial-gradient(circle, rgba(236, 232, 255, 0.1) 1px, transparent 1.3px),
    radial-gradient(55% 46% at 10% 4%, rgba(150, 60, 120, 0.27) 0%, rgba(150, 60, 120, 0) 62%),
    radial-gradient(50% 44% at 92% 6%, rgba(70, 100, 190, 0.3) 0%, rgba(70, 100, 190, 0) 64%),
    radial-gradient(52% 46% at 84% 92%, rgba(110, 80, 180, 0.26) 0%, rgba(110, 80, 180, 0) 62%);
}

.viewer-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  flex-shrink: 0;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.viewer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.02em;
}

.viewer-brand img {
  height: 36px;
  width: auto;
  max-width: none;
  object-fit: contain;
}

.viewer-brand em {
  padding: 3px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  font-family: var(--mono);
  font-size: 6.5px;
  font-style: normal;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.viewer-info {
  min-width: 0;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.viewer-info h2 {
  overflow: hidden;
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-info p {
  margin-top: 2px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.viewer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 0.2s var(--ease), border-color 0.2s ease, background-color 0.2s ease;
}

.viewer-btn:hover {
  transform: translateY(-1px);
  border-color: var(--ink);
  background: rgba(232, 255, 95, 0.22);
}

.viewer-btn--icon {
  width: 36px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.viewer-content {
  position: relative;
  flex: 1;
  min-height: 0;
}

.viewer-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--page);
}

.viewer-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: var(--page);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: opacity 0.25s ease;
}

.viewer-loading[hidden] {
  display: none;
}

.viewer-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: viewerSpin 0.8s linear infinite;
}

@keyframes viewerSpin {
  to { transform: rotate(360deg); }
}

.viewer-fallback {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: 58%;
  overflow-y: auto;
  padding: clamp(18px, 3vw, 34px);
  border-top: 1px solid var(--line-strong);
  background: var(--sheet-bg);
  box-shadow: 0 -24px 50px -32px rgba(38, 32, 80, 0.55);
  transform: translateY(100%);
  transition: transform 0.38s var(--ease);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.viewer-fallback.is-visible {
  transform: none;
}

.viewer-fallback-note {
  max-width: 74ch;
  margin: 0 auto 22px;
  padding: 14px 16px;
  border: 1px solid rgba(232, 255, 95, 0.55);
  border-radius: 12px;
  background: rgba(232, 255, 95, 0.16);
  box-shadow: 0 0 0 2px rgba(232, 255, 95, 0.1);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
  color: var(--ink);
}

.viewer-preview {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
  max-width: 1080px;
  margin: 0 auto;
}

.viewer-preview-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.viewer-preview-card h3 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.viewer-preview-card p {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.viewer-preview-price {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--page);
  font-family: var(--mono);
  font-size: 10px;
  white-space: pre-line;
}

.viewer-preview-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.viewer-preview-images img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--page);
}

.viewer-preview-images img.is-price {
  grid-column: 1 / -1;
  aspect-ratio: auto;
  max-height: 320px;
  object-fit: contain;
}

#viewer-demo {
  display: flex;
  margin: 18px auto 0;
}

@media (max-width: 880px) {
  .viewer-preview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .viewer-topbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }

  .viewer-brand span,
  .viewer-brand em {
    display: none;
  }

  .viewer-info {
    padding-left: 10px;
  }

  .viewer-actions {
    width: 100%;
    margin-left: 0;
  }

  #viewer-original {
    flex: 1;
  }

  .viewer-preview-images {
    grid-template-columns: 1fr;
  }
}

.sheet--full .detail-shell { width: 100%; max-width: none; padding: 0 28px 56px; }
.sheet--full .detail-body { max-width: none; }

dialog.sheet--full { position: fixed !important; inset: 0 !important; width: 100vw !important; max-width: 100vw !important; height: 100dvh !important; max-height: 100dvh !important; margin: 0 !important; padding: 0 !important; border-radius: 0 !important; }
.sheet--full .detail-shell { width: 100% !important; max-width: none !important; padding: 18px 24px 56px !important; }

.saved-app { position: relative; }
.saved-app-actions { display: flex; gap: 6px; margin-top: 8px; }
.saved-app-details, .saved-app-unsave { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 999px; padding: 5px 10px; font-size: 11px; cursor: pointer; }
.saved-app-unsave:hover { border-color: #d14343; color: #d14343; }
.saved-app-details:hover { border-color: var(--ink); }

.workspace-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.workspace-stats span { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 12px; color: var(--muted); background: rgba(255,255,255,.5); }
.workspace-stats b { color: var(--ink); font-size: 14px; margin-right: 3px; }
.workspace-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }

.card-builder { display: flex; align-items: center; gap: 7px; margin: 10px 0 0; font-size: 11px; color: var(--muted); }
.card-builder-pfp { width: 22px; height: 22px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: var(--line); color: var(--ink); font-weight: 700; }
.card-builder-pfp img { width: 100%; height: 100%; object-fit: cover; }

.detail-builder { display: grid; gap: 3px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.detail-builder-head { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.detail-builder-pfp { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: var(--line); font-weight: 700; }
.detail-builder-pfp img { width: 100%; height: 100%; object-fit: cover; }
.detail-builder-code { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; color: var(--muted); }

.workspace-subline { font-size: 12px; color: var(--muted); margin: 8px 0 16px; }
.workspace-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.workspace-toolbar input, .workspace-toolbar select { border: 1px solid var(--line); background: var(--sheet-bg); color: var(--ink); border-radius: 10px; padding: 9px 12px; font: inherit; }
.workspace-toolbar input { flex: 1 1 220px; }
.workspace-recommend { margin-top: 28px; }
.recommend-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.recommend-chip { border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; background: transparent; color: var(--ink); cursor: pointer; }
.recommend-chip:hover { border-color: var(--ink); }

.rating-widget { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rating-stars { display: inline-flex; gap: 1px; }
.rating-star { border: 0; background: transparent; padding: 0 1px; cursor: pointer; font-size: 16px; line-height: 1; color: var(--line); transition: color .15s ease, transform .15s ease; }
.rating-star:hover, .rating-star.is-on { color: #f7d117; }
.rating-star:hover { transform: scale(1.15); }
.rating-widget--compact .rating-star { font-size: 14px; }
.rating-avg { font-size: 11px; color: var(--muted); }
.detail-rating { display: flex; align-items: center; gap: 10px; margin: 16px 0; flex-wrap: wrap; }
.workspace-recent { margin-top: 24px; }
.recommend-empty { font-size: 12px; color: var(--muted); }

.analytics-trend { display: flex; align-items: flex-end; gap: 10px; height: 130px; padding: 12px 0 0; }
.analytics-trend-day { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.analytics-trend-bar { display: block; width: 100%; max-width: 34px; min-height: 4px; border-radius: 6px 6px 0 0; background: var(--ink); opacity: .82; }
.analytics-trend-day small { font-size: 9px; color: var(--muted); }

dialog.sheet--full {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: hidden !important;
}

dialog.sheet--full .sheet-card {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 0 56px !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: var(--sheet-bg) !important;
  overflow-y: auto !important;
}

@media (max-width: 640px) {
  dialog.sheet--full .sheet-card {
    padding: 0 0 40px !important;
  }
}

.my-metrics {
  margin: 0;
  padding: 0 0 10px;
  border-bottom: 0;
}

.my-metrics .analytics-metric strong {
  font-size: 20px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer-brand img {
  height: 24px;
  width: auto;
  max-width: none;
  object-fit: contain;
}

.viewer-loading-logo {
  height: 48px;
  width: auto;
  max-width: none;
  object-fit: contain;
}

.app-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.app-card {
  min-height: 244px;
  padding: 24px;
  border-radius: 0;
  gap: 14px;
}

.app-logo {
  width: 52px;
  height: 52px;
  border-radius: 0;
}

.app-logo svg {
  width: 28px;
  height: 28px;
}

.app-logo .logo-letter {
  font-size: 18px;
}

.app-head h3 {
  font-size: 18px;
}

.app-meta {
  font-size: 9px;
}

.app-desc {
  font-size: 14px;
  line-height: 1.6;
}

@media (max-width: 880px) {
  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-grid {
    grid-template-columns: 1fr;
  }

  .app-card {
    min-height: 0;
    padding: 20px;
  }
}

.analytics-page {
  --analytics-blue: #2f6df6;
  --analytics-teal: #12a594;
  --analytics-amber: #d98a13;
  --analytics-rose: #df5464;
  --analytics-surface: rgba(255, 255, 255, 0.74);
  --analytics-border: rgba(255, 255, 255, 0.86);
  --analytics-shadow: 0 20px 50px -32px rgba(38, 32, 80, 0.42);
  margin-top: clamp(38px, 6vh, 64px);
}

html[data-theme="dark"] .analytics-page {
  --analytics-blue: #7aa2ff;
  --analytics-teal: #4fd1c5;
  --analytics-amber: #f0b45e;
  --analytics-rose: #f28795;
  --analytics-surface: rgba(28, 24, 46, 0.72);
  --analytics-border: rgba(236, 232, 255, 0.14);
  --analytics-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.7);
}

.analytics-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.analytics-actions label {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.analytics-actions select {
  min-height: 38px;
  padding: 0 32px 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  cursor: pointer;
}

.analytics-empty-wrap {
  display: grid;
  place-items: center;
  min-height: 340px;
}

.analytics-summary,
.analytics-panel,
.analytics-listing-card {
  border: 1px solid var(--analytics-border);
  background: var(--analytics-surface);
  box-shadow: var(--analytics-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}

.analytics-summary {
  padding: 26px;
  border-radius: 24px;
}

.analytics-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.analytics-summary-head h3 {
  margin: 6px 0 0;
  font-family: var(--display);
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.analytics-summary-head .analytics-window {
  padding: 6px 10px;
  border-color: rgba(47, 109, 246, 0.28);
  background: rgba(47, 109, 246, 0.1);
  color: var(--analytics-blue);
  font-size: 7px;
  white-space: nowrap;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.analytics-kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 148px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--analytics-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.4);
}

html[data-theme="dark"] .analytics-kpi {
  background: rgba(255, 255, 255, 0.04);
}

.analytics-kpi::after {
  content: "";
  position: absolute;
  inset: auto -24px -44px auto;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.08;
}

.analytics-kpi svg {
  width: 22px;
  height: 22px;
  padding: 8px;
  border-radius: 12px;
  background: currentColor;
  color: var(--analytics-blue);
}

.analytics-kpi svg path,
.analytics-kpi svg circle {
  stroke: #fff;
}

.analytics-kpi strong {
  margin-top: auto;
  font-family: var(--display);
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.analytics-kpi span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.analytics-kpi--views { color: var(--analytics-blue); }
.analytics-kpi--clicks { color: var(--analytics-teal); }
.analytics-kpi--ctr { color: var(--analytics-amber); }
.analytics-kpi--upvotes { color: var(--analytics-rose); }

.analytics-kpi--clicks svg { background: var(--analytics-teal); }
.analytics-kpi--ctr svg { background: var(--analytics-amber); }
.analytics-kpi--upvotes svg { background: var(--analytics-rose); }

.analytics-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.9fr);
  gap: 14px;
  margin-top: 14px;
}

.analytics-panel {
  min-width: 0;
  padding: 20px;
  border-radius: 20px;
}

.analytics-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
}

.analytics-trend-chart {
  width: 100%;
}

.analytics-trend-chart svg {
  display: block;
  width: 100%;
  height: 230px;
}

.analytics-grid-line {
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.analytics-area {
  fill: rgba(47, 109, 246, 0.14);
}

.analytics-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.analytics-line--views { stroke: var(--analytics-blue); }
.analytics-line--clicks { stroke: var(--analytics-teal); stroke-dasharray: 7 6; }

.analytics-dot { stroke: var(--analytics-surface); stroke-width: 2; }
.analytics-dot--views { fill: var(--analytics-blue); }
.analytics-dot--clicks { fill: var(--analytics-teal); }

.analytics-axis-label {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.analytics-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 8px;
}

.analytics-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.analytics-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.analytics-legend-dot--views { background: var(--analytics-blue); }
.analytics-legend-dot--clicks { background: var(--analytics-teal); }

.analytics-data {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.analytics-data summary {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}

.analytics-data table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 10px;
}

.analytics-data th,
.analytics-data td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.analytics-data th {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.analytics-engagement-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.analytics-engagement-row {
  --row-color: var(--analytics-blue);
}

.analytics-engagement-row--upvotes { --row-color: var(--analytics-rose); }
.analytics-engagement-row--comments { --row-color: var(--analytics-blue); }
.analytics-engagement-row--saves { --row-color: var(--analytics-amber); }
.analytics-engagement-row--ratings { --row-color: var(--analytics-teal); }

.analytics-engagement-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.analytics-engagement-top strong {
  font-family: var(--display);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.analytics-engagement-track {
  display: block;
  height: 6px;
  margin-top: 7px;
  border-radius: 99px;
  background: rgba(120, 130, 150, 0.16);
  overflow: hidden;
}

.analytics-engagement-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--row-color);
}

.analytics-secondary-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.analytics-secondary-stat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.32);
}

html[data-theme="dark"] .analytics-secondary-stat {
  background: rgba(255, 255, 255, 0.04);
}

.analytics-secondary-stat strong {
  display: block;
  font-family: var(--display);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.analytics-secondary-stat span {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.analytics-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 46px;
}

.analytics-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

.analytics-listing-card {
  padding: 20px 22px;
  border-radius: 18px;
}

.analytics-listing-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.analytics-listing-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.analytics-listing-logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 15px;
}

.analytics-listing-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.analytics-listing-copy {
  min-width: 0;
}

.analytics-listing-copy strong {
  display: block;
  overflow: hidden;
  font-family: var(--grotesk);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-listing-copy span {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.analytics-status {
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.analytics-status[data-status="approved"] {
  border-color: rgba(18, 165, 148, 0.35);
  background: rgba(18, 165, 148, 0.1);
  color: var(--analytics-teal);
}

.analytics-listing-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.analytics-action {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.analytics-action:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}

.analytics-action--danger:hover {
  background: var(--analytics-rose);
  border-color: var(--analytics-rose);
  color: #fff;
}

.analytics-listing-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.analytics-listing-metric strong {
  display: block;
  font-family: var(--display);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.analytics-listing-metric span {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.analytics-ctr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.analytics-ctr strong {
  font-family: var(--display);
  font-size: 12px;
  color: var(--ink);
}

.analytics-ctr-track {
  display: block;
  height: 6px;
  margin-top: 7px;
  border-radius: 99px;
  background: rgba(120, 130, 150, 0.16);
  overflow: hidden;
}

.analytics-ctr-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--analytics-blue), var(--analytics-teal));
}

.analytics-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(100%, 540px);
  padding: 46px 28px;
  border: 1px solid var(--analytics-border);
  border-radius: 24px;
  background: var(--analytics-surface);
  box-shadow: var(--analytics-shadow);
  text-align: center;
}

.analytics-empty-state svg {
  width: 34px;
  height: 34px;
  color: var(--analytics-blue);
}

.analytics-empty-state strong {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: -0.03em;
}

.analytics-empty-state p {
  max-width: 420px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.analytics-empty-state .btn-primary {
  margin-top: 4px;
  text-decoration: none;
}

@media (max-width: 980px) {
  .analytics-detail-grid {
    grid-template-columns: 1fr;
  }

  .analytics-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-secondary-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .analytics-summary {
    padding: 18px;
    border-radius: 18px;
  }

  .analytics-kpi {
    min-height: 126px;
    padding: 14px;
  }

  .analytics-trend-chart svg {
    height: 190px;
  }

  .analytics-secondary-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-listing-head {
    flex-wrap: wrap;
  }

  .analytics-listing-actions {
    width: 100%;
  }

  .analytics-listing-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

body[data-page="workspace"],
body[data-page="studio"],
body[data-page="analytics"] {
  background:
    radial-gradient(900px 480px at 10% -10%, rgba(109, 94, 252, 0.18), transparent 62%),
    radial-gradient(760px 420px at 96% 4%, rgba(18, 165, 148, 0.14), transparent 60%),
    radial-gradient(900px 520px at 58% 110%, rgba(223, 84, 100, 0.09), transparent 60%),
    var(--page);
  background-attachment: fixed;
}

html[data-theme="dark"] body[data-page="workspace"],
html[data-theme="dark"] body[data-page="studio"],
html[data-theme="dark"] body[data-page="analytics"] {
  background:
    radial-gradient(900px 480px at 10% -10%, rgba(109, 94, 252, 0.24), transparent 62%),
    radial-gradient(760px 420px at 96% 4%, rgba(18, 165, 148, 0.16), transparent 60%),
    radial-gradient(900px 520px at 58% 110%, rgba(223, 84, 100, 0.12), transparent 60%),
    var(--page);
}

body[data-page="workspace"] .app-header,
body[data-page="studio"] .app-header,
body[data-page="analytics"] .app-header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 244, 255, 0.84));
  box-shadow: 16px 0 42px -34px rgba(79, 70, 200, 0.55);
}

html[data-theme="dark"] body[data-page="workspace"] .app-header,
html[data-theme="dark"] body[data-page="studio"] .app-header,
html[data-theme="dark"] body[data-page="analytics"] .app-header {
  background: linear-gradient(180deg, rgba(24, 21, 44, 0.96), rgba(16, 13, 32, 0.88));
}

body[data-page="workspace"] .app-nav a.is-active,
body[data-page="studio"] .app-nav a.is-active,
body[data-page="analytics"] .app-nav a.is-active {
  background: linear-gradient(135deg, #11131b, #242752) !important;
  box-shadow:
    0 10px 24px -12px rgba(47, 109, 246, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
  color: #fff !important;
}

.app-card {
  border-color: rgba(109, 94, 252, 0.18);
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(109, 94, 252, 0.11), transparent 56%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.92), rgba(240, 243, 255, 0.72));
  box-shadow: 0 16px 38px -30px rgba(79, 70, 200, 0.45);
}

.app-card:hover {
  border-color: rgba(109, 94, 252, 0.44);
  box-shadow: 0 24px 50px -30px rgba(79, 70, 200, 0.7);
}

html[data-theme="dark"] .app-card {
  border-color: rgba(160, 148, 255, 0.2);
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(109, 94, 252, 0.2), transparent 56%),
    linear-gradient(150deg, rgba(31, 27, 56, 0.9), rgba(20, 17, 38, 0.78));
}

.analytics-summary {
  border-color: rgba(109, 94, 252, 0.24);
  background:
    radial-gradient(70% 90% at 0% 0%, rgba(47, 109, 246, 0.16), transparent 58%),
    radial-gradient(60% 80% at 100% 0%, rgba(223, 84, 100, 0.1), transparent 60%),
    var(--analytics-surface);
}

.analytics-panel {
  border-color: rgba(109, 94, 252, 0.2);
  background:
    radial-gradient(80% 100% at 0% 0%, rgba(47, 109, 246, 0.12), transparent 58%),
    var(--analytics-surface);
}

.analytics-engagement-panel {
  background:
    radial-gradient(80% 100% at 100% 0%, rgba(223, 84, 100, 0.12), transparent 60%),
    radial-gradient(80% 100% at 0% 100%, rgba(18, 165, 148, 0.12), transparent 60%),
    var(--analytics-surface);
}

.analytics-kpi--views {
  border-color: rgba(47, 109, 246, 0.26);
  background: linear-gradient(145deg, rgba(47, 109, 246, 0.16), rgba(255, 255, 255, 0.42));
}

.analytics-kpi--clicks {
  border-color: rgba(18, 165, 148, 0.26);
  background: linear-gradient(145deg, rgba(18, 165, 148, 0.16), rgba(255, 255, 255, 0.42));
}

.analytics-kpi--ctr {
  border-color: rgba(217, 138, 19, 0.26);
  background: linear-gradient(145deg, rgba(217, 138, 19, 0.16), rgba(255, 255, 255, 0.42));
}

.analytics-kpi--upvotes {
  border-color: rgba(223, 84, 100, 0.26);
  background: linear-gradient(145deg, rgba(223, 84, 100, 0.16), rgba(255, 255, 255, 0.42));
}

html[data-theme="dark"] .analytics-kpi--views,
html[data-theme="dark"] .analytics-kpi--clicks,
html[data-theme="dark"] .analytics-kpi--ctr,
html[data-theme="dark"] .analytics-kpi--upvotes {
  background: rgba(255, 255, 255, 0.05);
}

.analytics-listing-card {
  border-color: rgba(109, 94, 252, 0.2);
  background:
    radial-gradient(90% 120% at 0% 0%, rgba(109, 94, 252, 0.12), transparent 58%),
    var(--analytics-surface);
}

.analytics-secondary-stat {
  border-color: rgba(109, 94, 252, 0.16);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.52), rgba(240, 243, 255, 0.38));
}

html[data-theme="dark"] .analytics-secondary-stat {
  background: rgba(255, 255, 255, 0.05);
}

.analytics-empty-state {
  background:
    radial-gradient(90% 120% at 20% 0%, rgba(47, 109, 246, 0.14), transparent 58%),
    radial-gradient(90% 120% at 90% 100%, rgba(223, 84, 100, 0.1), transparent 60%),
    var(--analytics-surface);
}

.analytics-empty-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(270px, 0.85fr);
  gap: 16px;
}

.analytics-onboarding {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.75fr);
  gap: 24px;
  padding: 34px;
  border: 1px solid rgba(109, 94, 252, 0.28);
  border-radius: 24px;
  box-shadow: var(--analytics-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}

.analytics-onboarding-copy h3 {
  margin: 8px 0 12px;
  max-width: 520px;
  font-family: var(--display);
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.analytics-onboarding-copy > p:not(.analytics-kicker) {
  max-width: 540px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}

.analytics-onboarding-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.analytics-onboarding-actions .btn-primary {
  text-decoration: none;
}

.analytics-onboarding-art {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 18px;
  background:
    radial-gradient(90% 80% at 100% 0%, rgba(47, 109, 246, 0.18), transparent 60%),
    rgba(255, 255, 255, 0.42);
}

html[data-theme="dark"] .analytics-onboarding-art {
  border-color: rgba(236, 232, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.analytics-signal {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

html[data-theme="dark"] .analytics-signal {
  border-color: rgba(236, 232, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.analytics-signal svg {
  width: 16px;
  height: 16px;
  padding: 4px;
  border-radius: 8px;
  color: #fff;
}

.analytics-signal svg path,
.analytics-signal svg circle {
  stroke: #fff;
}

.analytics-signal--signal-views svg { background: var(--analytics-blue); }
.analytics-signal--signal-clicks svg { background: var(--analytics-teal); }
.analytics-signal--signal-upvotes svg { background: var(--analytics-rose); }

.analytics-onboarding-steps {
  padding: 28px;
  border: 1px solid var(--analytics-border);
  border-radius: 24px;
  background: var(--analytics-surface);
  box-shadow: var(--analytics-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}

.analytics-onboarding-steps > .analytics-kicker {
  margin-bottom: 18px;
}

.analytics-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.analytics-step:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.analytics-step-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(47, 109, 246, 0.16), rgba(109, 94, 252, 0.12));
  color: var(--analytics-blue);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}

.analytics-step strong {
  display: block;
  font-family: var(--display);
  font-size: 13px;
}

.analytics-step div span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.analytics-guide {
  grid-column: 1 / -1;
  margin-top: 18px;
  padding: 28px;
  border: 1px solid var(--analytics-border);
  border-radius: 24px;
  background:
    radial-gradient(80% 100% at 0% 0%, rgba(47, 109, 246, 0.12), transparent 58%),
    var(--analytics-surface);
  box-shadow: var(--analytics-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}

.analytics-guide-head h3 {
  margin: 8px 0 6px;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: -0.03em;
}

.analytics-guide-head > p:last-child {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.analytics-guide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.analytics-guide-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.42);
}

html[data-theme="dark"] .analytics-guide-card {
  background: rgba(255, 255, 255, 0.04);
}

.analytics-guide-card svg {
  width: 18px;
  height: 18px;
  padding: 5px;
  border-radius: 9px;
  background: rgba(47, 109, 246, 0.12);
  color: var(--analytics-blue);
}

.analytics-guide-card svg path,
.analytics-guide-card svg circle {
  stroke: currentColor;
}

.analytics-guide-card strong {
  display: block;
  margin-top: 12px;
  font-family: var(--display);
  font-size: 14px;
}

.analytics-guide-card p {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}

@media (max-width: 980px) {
  .analytics-empty-layout,
  .analytics-onboarding {
    grid-template-columns: 1fr;
  }

  .analytics-guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .analytics-onboarding,
  .analytics-onboarding-steps,
  .analytics-guide {
    padding: 20px;
    border-radius: 18px;
  }

  .analytics-guide-grid {
    grid-template-columns: 1fr;
  }
}

.trending-item {
  position: relative;
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
}

.trending-icon {
  width: 36px;
  height: 36px;
}

.trending-category {
  display: block;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--analytics-blue);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trending-signals {
  display: block;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 7px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trending-item > svg {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 15px;
  height: 15px;
  color: var(--analytics-blue);
  opacity: 0.75;
}

.trending-item:hover > svg {
  opacity: 1;
}

@media (max-width: 520px) {
  .trending-item {
    height: 124px;
  }
}

.app-signals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.app-signal {
  min-width: 0;
  text-align: center;
}

.app-signal strong {
  display: block;
  font-family: var(--display);
  font-size: 16px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.app-signal em {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-grid.is-list .app-card {
  grid-template-areas:
    "top desc foot"
    "top signals foot"
    "top tags foot";
}

.app-grid.is-list .app-card.has-price {
  grid-template-areas:
    "top desc foot"
    "top signals foot"
    "top price foot"
    "top tags foot";
}

.app-grid.is-list .app-signals {
  grid-area: signals;
  margin-top: 0;
  border-bottom: 0;
}

@media (max-width: 880px) {
  .app-grid.is-list .app-card {
    grid-template-areas:
      "top foot"
      "signals signals"
      "desc desc"
      "tags tags";
  }

  .app-grid.is-list .app-card.has-price {
    grid-template-areas:
      "top foot"
      "signals signals"
      "desc desc"
      "price price"
      "tags tags";
  }
}

@media (max-width: 640px) {
  .app-grid.is-list .app-card,
  .app-grid.is-list .app-card.has-price {
    grid-template-areas:
      "top"
      "signals"
      "desc"
      "tags"
      "foot";
  }

  .app-grid.is-list .app-card.has-price {
    grid-template-areas:
      "top"
      "signals"
      "desc"
      "price"
      "tags"
      "foot";
  }
}

