/* Artluni — deep-navy gallery theme from the logo: navy, teal, warm orange.
   Mobile-first; critique pages go two-column on wide screens. */

:root {
  --bg: #0a1524;
  --bg-elevated: #0f1d31;
  --card: #13243b;
  --card-2: #172b45;
  --card-border: rgba(210, 230, 245, 0.10);
  --text: #eef4f9;
  --text-dim: #b5c6d6;
  --text-faint: #7f93a8;
  --gold: #eea64f;            /* brand orange (named gold for crop.css) */
  --gold-soft: rgba(238, 166, 79, 0.14);
  --gold-line: rgba(238, 166, 79, 0.40);
  --teal: #3aa6c8;
  --teal-bright: #6cc3de;
  --teal-soft: rgba(58, 166, 200, 0.14);
  --success: #4cc38a;
  --success-soft: rgba(76, 195, 138, 0.13);
  --danger: #ef6f62;
  --danger-soft: rgba(239, 111, 98, 0.13);
  --focus: #f5c27e;

  --font-sans: "Avenir Next", Montserrat, "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Georgia, serif;

  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 22px;
  --touch: 44px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --content: 720px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(1100px 500px at 15% -10%, rgba(58, 166, 200, 0.10), transparent 60%),
    radial-gradient(900px 420px at 110% 0%, rgba(238, 166, 79, 0.08), transparent 55%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
a { color: var(--teal-bright); text-underline-offset: 3px; }
a:hover { color: #9dd8ea; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.4em; letter-spacing: -0.01em; }
p { margin: 0 0 0.8em; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1:focus { outline: none; }

.visually-hidden, .sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--gold); color: #111; padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

/* ---- Top bar ---------------------------------------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 21, 36, 0.86);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.wordmark { font-weight: 700; font-size: 1.3rem; letter-spacing: -0.02em; }
.wordmark span { color: var(--teal-bright); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  color: var(--text-dim); text-decoration: none; padding: 8px 10px; border-radius: 10px;
  font-weight: 600; font-size: 0.95rem; min-height: var(--touch); display: inline-flex; align-items: center;
}
.nav-link:hover, .nav-link.is-active { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-cta { color: var(--gold); }
.nav-link, .nav .btn { white-space: nowrap; }
@media (max-width: 420px) {
  .wordmark { font-size: 1.15rem; }
  .brand img { width: 30px; height: 30px; }
  .nav-link { padding: 8px 7px; font-size: 0.9rem; }
  .nav a[href="#/examples"] { display: none; }
  .nav .btn-small { padding: 7px 12px; }
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center;
  background: linear-gradient(135deg, var(--teal), #155a82); color: #fff; font-weight: 700; font-size: 0.9rem;
}

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

.view { max-width: var(--content); margin: 0 auto; padding: 20px 16px 48px; min-height: 60vh; outline: none; }
.view-landing { max-width: 1080px; }
.view-critique { max-width: 1180px; }
.page-title { font-size: 1.7rem; font-weight: 700; margin-bottom: 0.5em; }
.section { margin: 56px 0 0; }
.section-title { font-size: 1.35rem; font-weight: 700; }
.section-sub { color: var(--text-dim); margin-bottom: 18px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem; font-weight: 700; color: var(--gold); margin-bottom: 6px; }
.center { text-align: center; }
.fine-print { color: var(--text-faint); font-size: 0.85rem; }
.loading { padding: 60px 0; text-align: center; color: var(--text-dim); }
.empty { text-align: center; padding: 48px 8px; display: grid; justify-items: center; gap: 8px; }

.footer {
  border-top: 1px solid var(--card-border); margin-top: 40px; padding: 28px 16px calc(28px + env(safe-area-inset-bottom));
  text-align: center; color: var(--text-faint); font-size: 0.85rem;
}
.footer-logo { margin: 0 auto 10px; width: 208px; height: auto; opacity: 0.9; }

/* ---- Buttons & controls -------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--touch); padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: 0.98rem; cursor: pointer; text-decoration: none;
  transition: transform 0.15s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease), opacity 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, #f3b862, #e28a3c); color: #1b1206; box-shadow: 0 6px 18px rgba(238, 166, 79, 0.25); }
.btn-primary:hover { color: #1b1206; filter: brightness(1.05); }
.btn-secondary { background: rgba(255, 255, 255, 0.06); color: var(--text); border-color: var(--card-border); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.btn-ghost { background: transparent; color: var(--teal-bright); border-color: rgba(108, 195, 222, 0.4); }
.btn-ghost:hover { background: var(--teal-soft); }
.btn-danger { background: var(--danger-soft); color: #ffb3aa; border-color: rgba(239, 111, 98, 0.4); }
.btn-small { min-height: 38px; padding: 7px 14px; font-size: 0.9rem; }
.btn-large { min-height: 52px; padding: 13px 24px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-google svg { display: inline-block; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.link-btn {
  background: none; border: none; color: var(--teal-bright); font: inherit; font-weight: 600; cursor: pointer;
  padding: 8px 4px; min-height: var(--touch); text-decoration: underline; text-underline-offset: 3px;
}
.link-danger { color: #ff9d92; }

.segmented {
  display: inline-flex; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--card-border);
  border-radius: 999px; padding: 4px; gap: 4px; max-width: 100%;
}
.segmented-wrap { flex-wrap: wrap; border-radius: 18px; }
.seg {
  border: none; background: none; color: var(--text-dim); font: inherit; font-weight: 600; font-size: 0.92rem;
  padding: 8px 14px; border-radius: 999px; cursor: pointer; min-height: 38px;
}
.seg.is-active { background: var(--card-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--gold-line); }
.mode-toggle { margin: 4px 0 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.chip {
  border: 1px solid var(--card-border); background: rgba(255, 255, 255, 0.04); color: var(--text-dim);
  padding: 6px 12px; border-radius: 999px; font: inherit; font-size: 0.86rem; cursor: pointer; min-height: 34px;
}
.chip:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.2); }
.chip.is-active { background: var(--gold-soft); border-color: var(--gold-line); color: var(--text); }
.chips-static .chip { cursor: default; }

.field { margin: 0 0 16px; }
.field > label, .field-label { display: block; font-weight: 700; font-size: 0.92rem; margin-bottom: 6px; }
.optional { color: var(--text-faint); font-weight: 500; }
input[type="text"], input[type="email"], input[type="password"], textarea {
  width: 100%; background: var(--bg-elevated); color: var(--text); border: 1px solid var(--card-border);
  border-radius: var(--radius-s); padding: 12px 14px; font: inherit; min-height: var(--touch);
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.field-count { display: block; text-align: right; font-size: 0.8rem; color: var(--text-faint); margin-top: 4px; }
.field-error { color: #ffb3aa; background: var(--danger-soft); padding: 10px 12px; border-radius: var(--radius-s); font-size: 0.92rem; }
.inline-notice { color: var(--text-dim); background: rgba(255, 255, 255, 0.05); padding: 10px 12px; border-radius: var(--radius-s); }

.switch { display: inline-flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 0.9rem; margin-top: 10px; }

/* ---- Landing ------------------------------------------------------------------ */

.hero { text-align: center; padding: 28px 0 8px; display: grid; justify-items: center; }
.hero-mark { width: 104px; height: 104px; filter: drop-shadow(0 10px 30px rgba(58, 166, 200, 0.25)); margin-bottom: 14px; }
.hero-title { font-size: clamp(2rem, 6vw, 3.1rem); font-weight: 800; max-width: 16ch; letter-spacing: -0.025em; }
.hero-sub { color: var(--text-dim); font-size: 1.1rem; max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 10px 0 12px; }
.reassure { color: var(--text-faint); font-size: 0.9rem; }

.example-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.example-card {
  display: block; text-decoration: none; color: var(--text); background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius-m); overflow: hidden; transition: transform 0.2s var(--ease), border-color 0.2s;
}
.example-card:hover { transform: translateY(-2px); border-color: var(--gold-line); color: var(--text); }
.example-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; height: auto; }
.example-meta { display: grid; padding: 10px 12px 12px; gap: 2px; font-size: 0.9rem; }
.example-meta span { color: var(--text-faint); font-size: 0.82rem; }

.step-list { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 12px; }
.step-list li { counter-increment: step; background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-m); padding: 14px 14px 14px 56px; position: relative; color: var(--text-dim); }
.step-list li::before {
  content: counter(step); position: absolute; left: 14px; top: 12px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); font-weight: 800;
}
.step-list strong { color: var(--text); }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.feature { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-m); padding: 16px; }
.feature h3 { font-size: 1.02rem; color: var(--teal-bright); }
.feature p { color: var(--text-dim); margin: 0; font-size: 0.95rem; }

.price-section { display: grid; justify-items: center; }
.price-card {
  width: 100%; max-width: 420px; background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--gold-line); border-radius: var(--radius-l); padding: 22px; box-shadow: var(--shadow); text-align: left;
}
.price { display: flex; align-items: baseline; gap: 4px; margin: 0 0 4px; }
.price-amount { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; }
.price-per { color: var(--text-dim); font-weight: 600; }
.check-list { list-style: none; padding: 0; margin: 14px 0 18px; display: grid; gap: 8px; }
.check-list li { padding-left: 28px; position: relative; color: var(--text-dim); }
.check-list li::before { content: "✓"; position: absolute; left: 4px; color: var(--success); font-weight: 800; }

/* ---- Auth & subscribe ------------------------------------------------------------ */

.auth, .subscribe { max-width: 420px; margin: 0 auto; text-align: center; }
.auth-mark { margin: 10px auto 12px; }
.auth-form { text-align: left; margin-top: 12px; display: grid; gap: 4px; }
.auth-links { margin-top: 16px; color: var(--text-dim); }
.auth-done { background: var(--success-soft); padding: 14px; border-radius: var(--radius-s); }
.divider { display: flex; align-items: center; gap: 10px; color: var(--text-faint); margin: 14px 0 4px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--card-border); }
.subscribe .price-card { margin: 8px auto 16px; }

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

.studio { display: grid; gap: 6px; }
.tips-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-m); padding: 10px 14px; margin-bottom: 12px; }
.tips-card summary { cursor: pointer; font-weight: 700; min-height: 32px; display: flex; align-items: center; }
.tips { margin: 8px 0 4px; padding-left: 20px; color: var(--text-dim); display: grid; gap: 4px; }

.dropzone {
  display: grid; place-items: center; min-height: 240px; border: 2px dashed rgba(108, 195, 222, 0.35);
  background: rgba(58, 166, 200, 0.05); border-radius: var(--radius-l); cursor: pointer; overflow: hidden;
  transition: border-color 0.2s, background 0.2s; position: relative; margin-bottom: 10px;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--gold); background: var(--gold-soft); }
.dropzone.is-busy { opacity: 0.7; pointer-events: none; }
.dropzone:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
.drop-empty { display: grid; justify-items: center; gap: 6px; padding: 24px; text-align: center; color: var(--text-dim); }
.drop-icon { color: var(--teal-bright); }
.drop-title { font-weight: 700; color: var(--text); font-size: 1.1rem; }
.drop-hint { font-size: 0.9rem; max-width: 28ch; }
.drop-preview { display: block; width: 100%; position: relative; }
.drop-preview-img { width: 100%; max-height: 62vh; object-fit: contain; background: #050b14; }
.drop-change {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); background: rgba(5, 11, 20, 0.75);
  color: var(--text); padding: 6px 12px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
}
.meta-chip {
  position: absolute; top: 10px; left: 10px; background: rgba(5, 11, 20, 0.8); color: var(--gold);
  padding: 4px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
}
.image-tools { display: flex; gap: 8px; margin-bottom: 14px; }
.studio-options { margin-top: 4px; }
.usage-line { text-align: center; color: var(--text-faint); font-size: 0.88rem; margin-top: 8px; }

.revision-banner {
  display: flex; align-items: center; gap: 12px; background: var(--teal-soft); border: 1px solid rgba(108, 195, 222, 0.35);
  border-radius: var(--radius-m); padding: 10px 12px; margin-bottom: 12px;
}
.revision-banner img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; flex: none; }
.revision-banner p { margin: 2px 0 0; color: var(--text-dim); font-size: 0.9rem; }
.revision-banner > div { flex: 1; }

/* ---- Critique page -------------------------------------------------------------------- */

.critique-page { display: grid; gap: 18px; }
.crit-media { position: sticky; top: 60px; z-index: 5; background: var(--bg); padding-bottom: 6px; }
.crit-figure-wrap { display: flex; justify-content: center; }
.crit-figure {
  position: relative; display: inline-block; padding: 0; border: none; background: #050b14; cursor: zoom-in;
  border-radius: var(--radius-m); overflow: hidden; line-height: 0; box-shadow: var(--shadow);
}
.crit-img { max-height: 42vh; width: auto; max-width: 100%; }
.crit-media.is-collapsed .crit-figure-wrap { display: none; }
.crit-media-toggle {
  display: block; margin: 6px auto 0; background: none; border: none; color: var(--text-faint);
  font: inherit; font-size: 0.82rem; cursor: pointer; min-height: 30px;
}
.region-layer { position: absolute; inset: 0; pointer-events: none; }
.region-layer.is-hidden { display: none; }
.region-box {
  position: absolute; border: 2px solid rgba(238, 166, 79, 0.0); border-radius: 8px;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s;
}
.region-box.is-hover, .region-box.is-active {
  border-color: var(--gold); background: rgba(238, 166, 79, 0.12);
  box-shadow: 0 0 0 9999px rgba(5, 11, 20, 0.45);
}
.region-box.is-active { animation: region-pulse 1.2s var(--ease) 2; }
.region-label {
  position: absolute; left: -2px; top: -26px; background: var(--gold); color: #1b1206; font-size: 0.72rem; font-weight: 800;
  padding: 3px 8px; border-radius: 6px; white-space: nowrap; line-height: 1.3; opacity: 0; transition: opacity 0.2s;
}
.region-box.is-hover .region-label, .region-box.is-active .region-label { opacity: 1; }
@keyframes region-pulse { 50% { background: rgba(238, 166, 79, 0.28); } }

.crit-scan { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.crit-figure.is-scanning .crit-scan {
  opacity: 1;
  background: linear-gradient(180deg, transparent 0%, rgba(108, 195, 222, 0.0) 40%, rgba(108, 195, 222, 0.28) 50%, rgba(108, 195, 222, 0.0) 60%, transparent 100%);
  background-size: 100% 220%; animation: scan 2.2s linear infinite;
}
@keyframes scan { from { background-position: 0 120%; } to { background-position: 0 -120%; } }

.crit-main { min-width: 0; }
.crit-banner { margin-bottom: 6px; }
.crit-title { font-size: 1.5rem; margin-bottom: 4px; }
.crit-sub { color: var(--text-dim); font-size: 0.92rem; }
.crit-question { background: rgba(255, 255, 255, 0.04); border-radius: var(--radius-s); padding: 10px 12px; color: var(--text-dim); }

.stage { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-m); padding: 14px; }
.stage-steps { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.stage-steps li { display: flex; align-items: center; gap: 6px; color: var(--text-faint); font-weight: 600; font-size: 0.9rem; }
.stage-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.15); }
.stage-steps li.is-done { color: var(--text-dim); }
.stage-steps li.is-done .stage-dot { background: var(--success); }
.stage-steps li.is-current { color: var(--text); }
.stage-steps li.is-current .stage-dot { background: var(--gold); box-shadow: 0 0 0 0 rgba(238, 166, 79, 0.6); animation: pulse 1.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(238, 166, 79, 0); } 100% { box-shadow: 0 0 0 0 rgba(238, 166, 79, 0); } }
.stage-sub { margin: 0; color: var(--text-dim); font-size: 0.92rem; }

.crit-notices { display: grid; gap: 8px; }
.crit-notices:empty { display: none; }
.crit-notice { background: var(--teal-soft); border: 1px solid rgba(108, 195, 222, 0.35); border-radius: var(--radius-s); padding: 10px 12px; }
.crit-notice p { margin: 0 0 6px; }

.crit-cards { display: grid; gap: 12px; margin-top: 12px; }
.crit-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-m); padding: 16px 16px 12px; }
.crit-card-title { display: flex; align-items: center; gap: 10px; font-size: 1.08rem; font-weight: 700; margin-bottom: 8px; }
.crit-card-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 0.95rem; flex: none; background: rgba(255, 255, 255, 0.07); }
.crit-working .crit-card-icon, .crit-improved .crit-card-icon { background: var(--success-soft); color: var(--success); }
.crit-improve { border-color: rgba(238, 166, 79, 0.28); }
.crit-improve .crit-card-icon { background: var(--gold-soft); color: var(--gold); }
.crit-question .crit-card-icon, .crit-camera .crit-card-icon, .crit-raw .crit-card-icon { background: var(--teal-soft); color: var(--teal-bright); }
.crit-next { border-style: dashed; }
.crit-next.is-done { opacity: 0.75; }
.done-toggle { display: inline-flex; gap: 8px; align-items: center; color: var(--text-dim); font-size: 0.9rem; margin-top: 4px; }

.prose { color: var(--text-dim); }
.prose p, .prose li { color: var(--text-dim); }
.prose strong { color: var(--text); }
.prose h3 { font-size: 1rem; color: var(--text); margin-top: 10px; }
.prose ol, .prose ul { padding-left: 22px; margin: 0 0 10px; display: grid; gap: 6px; }
.prose ol li::marker { color: var(--gold); font-weight: 800; }
.prose code { background: rgba(255, 255, 255, 0.08); padding: 1px 5px; border-radius: 5px; }

.region-chip {
  display: inline-flex; align-items: center; gap: 5px; vertical-align: baseline; border: 1px solid var(--gold-line);
  background: var(--gold-soft); color: var(--text); font: inherit; font-size: 0.8rem; font-weight: 700;
  padding: 1px 8px; border-radius: 999px; cursor: pointer; line-height: 1.6;
}
.region-chip:hover { background: rgba(238, 166, 79, 0.25); }
.region-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }

.crit-quality { border-radius: var(--radius-m); padding: 12px 14px; }
.crit-quality.is-checked { background: var(--success-soft); border: 1px solid rgba(76, 195, 138, 0.3); }
.crit-quality.is-refunded { background: var(--gold-soft); border: 1px solid var(--gold-line); }
.crit-quality summary { cursor: pointer; min-height: 30px; display: flex; align-items: center; gap: 6px; }
.q-badge { font-weight: 800; color: var(--success); }
.q-hint { color: var(--text-dim); font-size: 0.88rem; text-decoration: underline; text-underline-offset: 3px; }
.q-intro { color: var(--text-dim); font-size: 0.9rem; margin: 8px 0; }
.q-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.q-list li { display: flex; justify-content: space-between; gap: 12px; font-size: 0.9rem; color: var(--text-dim); }

.crit-error { background: var(--danger-soft); border: 1px solid rgba(239, 111, 98, 0.35); border-radius: var(--radius-m); padding: 14px; }
.crit-error-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.crit-cancel { display: block; margin: 8px auto 0; }
.crit-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.crit-rating { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-m); padding: 12px 14px; margin-top: 14px; }
.rate-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--text-dim); }
.rate-btn { font-size: 1.2rem; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--card-border); border-radius: 999px; width: var(--touch); height: var(--touch); cursor: pointer; }
.rate-btn.is-active { background: var(--gold-soft); border-color: var(--gold-line); }

.crit-followups { margin-top: 24px; }
.fu-list { display: grid; gap: 12px; margin-bottom: 14px; }
.fu-question { justify-self: end; background: var(--teal-soft); border-radius: 16px 16px 4px 16px; padding: 8px 12px; margin: 0 0 6px auto; max-width: 85%; width: fit-content; color: var(--text); }
.fu-answer { background: var(--card); border: 1px solid var(--card-border); border-radius: 16px 16px 16px 4px; padding: 10px 14px; }
.fu-answer.is-streaming:empty::after { content: "Thinking…"; color: var(--text-faint); }
.fu-form { display: grid; gap: 6px; }
.fu-label { font-weight: 700; }
.fu-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.crit-cta { background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--gold-line); border-radius: var(--radius-l); padding: 20px; margin-top: 20px; text-align: center; }
.crit-cta p { color: var(--text-dim); }

.zoom { display: grid; gap: 8px; }
.zoom-figure { position: relative; line-height: 0; }
.zoom-figure img { width: 100%; height: auto; max-height: 78vh; object-fit: contain; }
.modal.modal-zoom { max-width: min(96vw, 1100px); padding: 12px; }

/* ---- History & account ------------------------------------------------------------------- */

.history-list { display: grid; gap: 10px; margin-bottom: 16px; }
.history-item {
  display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius-m); padding: 10px; text-decoration: none; color: var(--text);
}
.history-item:hover { border-color: var(--gold-line); color: var(--text); }
.history-item img, .history-noimg { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; flex: none; background: var(--bg-elevated); }
.history-text { display: grid; gap: 3px; min-width: 0; }
.history-date { font-size: 0.8rem; color: var(--text-faint); }
.history-excerpt { color: var(--text-dim); font-size: 0.92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.history-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-bright); }
.badge-muted { background: rgba(255, 255, 255, 0.06); color: var(--text-faint); }

.card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-m); padding: 16px; margin-bottom: 14px; }
.card-title { font-size: 1.05rem; }
.usage-bar { height: 8px; background: rgba(255, 255, 255, 0.08); border-radius: 999px; overflow: hidden; margin: 8px 0 6px; }
.usage-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--gold)); }
.owner summary { cursor: pointer; font-weight: 700; }
.inline-form { display: flex; gap: 8px; margin-top: 10px; }
.danger-zone { border-color: rgba(239, 111, 98, 0.3); }

/* ---- Modal & toast ----------------------------------------------------------------------- */

.modal-overlay {
  position: fixed; inset: 0; z-index: 120; background: rgba(3, 8, 15, 0.72); display: grid; place-items: center;
  padding: 16px; animation: fade 0.18s var(--ease);
}
.modal {
  position: relative; width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow: auto;
  background: var(--bg-elevated); border: 1px solid var(--card-border); border-radius: var(--radius-l); padding: 22px; box-shadow: var(--shadow);
}
.modal-close {
  position: absolute; top: 8px; right: 8px; width: var(--touch); height: var(--touch); border-radius: 50%;
  background: rgba(255, 255, 255, 0.06); border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; z-index: 2;
}
.modal-heading { font-size: 1.25rem; padding-right: 44px; }
.modal-text { color: var(--text-dim); }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; justify-content: flex-end; }
.modal-share .segmented { margin: 4px 0 12px; }
.share-preview { display: grid; place-items: center; min-height: 200px; background: #050b14; border-radius: var(--radius-m); padding: 10px; }
.share-preview.is-loading { opacity: 0.5; }
.share-canvas { width: 100%; height: auto; max-height: 52vh; object-fit: contain; border-radius: 10px; }
.share-hint { color: var(--text-dim); font-size: 0.9rem; margin-top: 10px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.toast-region {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 300; display: grid; gap: 8px; width: min(92vw, 440px);
}
.toast {
  background: var(--card-2); border: 1px solid var(--card-border); color: var(--text); padding: 12px 14px; border-radius: var(--radius-m);
  box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between; gap: 10px;
  opacity: 0; transform: translateY(8px); transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.toast.is-visible { opacity: 1; transform: none; }
.toast-success { border-color: rgba(76, 195, 138, 0.45); }
.toast-error { border-color: rgba(239, 111, 98, 0.5); }
.toast-action { background: var(--gold); color: #1b1206; border: none; border-radius: 999px; padding: 6px 12px; font-weight: 800; cursor: pointer; }

/* ---- Wide screens ------------------------------------------------------------------------- */

@media (min-width: 960px) {
  .critique-page { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 32px; }
  .crit-media { top: 84px; }
  .crit-img { max-height: calc(100vh - 150px); }
  .crit-media-toggle { display: none; }
  .view { padding-top: 32px; }
}

/* ---- Motion & print ------------------------------------------------------------------------ */

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

@media print {
  body { background: #fff; color: #111; }
  .topbar, .footer, .crit-actions, .crit-rating, .fu-form, .crit-media-toggle, .crit-cta, .toast-region, .crit-cancel, .stage { display: none !important; }
  .view { max-width: none; padding: 0; }
  .critique-page { display: block; }
  .crit-media { position: static; }
  .crit-figure { box-shadow: none; }
  .crit-img { max-height: 90mm; }
  .crit-card, .fu-answer, .crit-quality { background: #fff; border: 1px solid #ccc; break-inside: avoid; }
  .prose, .prose p, .prose li, .crit-sub, .q-list li { color: #222; }
  .region-chip { border-color: #999; background: #f3f3f3; color: #111; }
  .region-layer { display: none; }
}
