/* Marra AI beta — tool pages (light CRO shell) */

.hidden { display: none !important; }
.opacity-0 { opacity: 0; pointer-events: none; }

/* .nav-auth lives in site.css */

.nav-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 0.5rem;
  color: var(--ink-soft);
  cursor: pointer;
}

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

@media (min-width: 1024px) {
  .nav-icon-btn--notes { display: none; }
}

/* —— Tools index / account gate —— */
.tools-hero .page-title {
  max-width: 16ch;
}

.tools-hero .section-lead {
  max-width: 38rem;
}

.tools-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.25rem;
  margin: 1.35rem 0 0;
  padding: 0;
  list-style: none;
}

.tools-proof li {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.tools-proof li + li {
  padding-left: 1.25rem;
  border-left: 1px solid var(--line);
}

.tools-hero-aside {
  margin: 1.1rem 0 0;
  max-width: 36rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
}

.tools-hero-jump {
  margin: 1.25rem 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}

.tools-hero-jump a {
  color: var(--gold-deep);
  text-decoration: none;
}

.tools-hero-jump a:hover { text-decoration: underline; }

.tools-featured {
  padding-top: 0.5rem;
  padding-bottom: 2.5rem;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(184, 146, 42, 0.14), transparent 55%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.tools-featured-inner {
  max-width: 40rem;
}

.tools-featured-title {
  margin: 0.35rem 0 0.75rem;
  font-family: var(--display);
  font-size: clamp(1.85rem, 4.2vw, 2.75rem);
  letter-spacing: -0.03em;
  line-height: 1.08;
  max-width: 16ch;
}

.tools-featured-lead {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 38rem;
}

.tools-featured-meta {
  margin: 0.85rem 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}

.tools-usecases {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.tools-usecases li {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.tools-usecases li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--gold);
}

.tools-featured-cta {
  margin-top: 1.5rem;
  min-width: 12rem;
}

/* Compact build diary — sits under featured CTA, collapsed by default */
.tools-devlog {
  margin-top: 1.35rem;
  max-width: 36rem;
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}

.tools-devlog summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
}

.tools-devlog summary::-webkit-details-marker {
  display: none;
}

.tools-devlog summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0.2rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.tools-devlog[open] summary::before {
  content: "–";
}

.tools-devlog summary:hover {
  color: var(--ink-soft);
}

.tools-devlog-date {
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--muted);
}

.tools-devlog-body {
  margin-top: 0.85rem;
  padding: 0 0 0.15rem;
}

.tools-devlog-intro,
.tools-devlog-foot {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
}

.tools-devlog-foot {
  margin-top: 0.85rem;
}

.tools-devlog-heading {
  margin: 0.9rem 0 0.35rem;
  font-family: var(--sans, inherit);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.tools-devlog-body ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.4rem;
}

.tools-devlog-body li {
  position: relative;
  padding-left: 0.95rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.tools-devlog-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--line-strong, var(--line));
}

.tools-devlog-body li strong {
  font-weight: 600;
  color: var(--ink);
}

.tool-offer-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 800px) {
  .tool-offer-list {
    grid-template-columns: 1fr 1fr;
    gap: 1.15rem;
  }
}

.tool-offer {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.35rem 1.25rem 1.4rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  min-width: 0;
}

@media (min-width: 640px) {
  .tool-offer {
    padding: 1.5rem 1.45rem 1.55rem;
  }
}

.tool-offer-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
}

.tool-offer-where,
.tool-offer-time {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tool-offer-where {
  color: var(--gold-deep);
}

.tool-offer-time {
  color: var(--muted);
}

.tool-offer-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.4vw, 1.6rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.tool-offer-pain {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}

.tool-offer-body {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  flex: 1;
}

.tool-offer-cta {
  align-self: flex-start;
  margin-top: 0.35rem;
  min-height: 2.5rem;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  text-align: left;
  white-space: normal;
  line-height: 1.25;
}

.tool-offer--quiet {
  border-left-color: var(--line);
  background: transparent;
  gap: 0.5rem;
  padding: 1.1rem 1.15rem;
}

@media (min-width: 800px) {
  .tool-offer--quiet {
    grid-column: 1 / -1;
  }
}

.tool-offer--quiet .tool-offer-title {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
}

.tool-offer--quiet .tool-offer-pain {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-top: 0.2rem;
}

.tool-offer-quiet-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .tool-offer-quiet-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
  }

  .tool-offer--quiet .tool-offer-cta {
    margin-top: 0;
    flex-shrink: 0;
  }
}

.tools-faq {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.tools-faq-list {
  margin: 1rem 0 0;
  display: grid;
  gap: 1.25rem;
}

.tools-faq-list dt {
  margin: 0 0 0.3rem;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tools-faq-list dd {
  margin: 0;
  max-width: 40rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.tools-bridge h2 {
  margin: 0.35rem 0 0.75rem;
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.tools-split {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

@media (min-width: 640px) {
  .tools-split {
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
  }
}

.tools-split-label {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.tools-split-copy {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 22rem;
}

.tools-account {
  margin: 0 0 1.5rem;
  padding: 1.5rem 1.5rem 1.35rem;
  border: 1px solid var(--line);
  background: var(--paper);
}

.tools-account--compact {
  padding: 1rem 1.15rem;
}

.tools-account-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.tools-account-copy {
  flex: 1 1 14rem;
  min-width: 0;
}

.tools-account-kicker {
  margin: 0 0 0.25rem;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.tools-account h2 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.tools-account p {
  margin: 0;
  color: var(--muted);
  max-width: 36rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.tools-account-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem;
  flex: 0 1 auto;
}

.tools-google-host {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.5rem;
}

.tools-account-note {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: #9a9a9a;
}

.tools-account.is-signed-in {
  border-color: rgba(184, 146, 42, 0.35);
  background: var(--gold-soft);
  padding: 0.85rem 1.15rem;
}

.tools-account.is-signed-in .tools-account-kicker {
  font-size: 1rem;
}

.tools-account.is-signed-in h2 { font-size: 1.2rem; }

.tools-locked .tool-link {
  opacity: 0.72;
}

.tools-locked .tool-link:hover h2 { color: var(--gold-deep); }

/* Full-page gate on individual tools when signed out */
.tool-auth-gate {
  position: fixed;
  inset: var(--nav-h) 0 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(244, 244, 242, 0.92);
  backdrop-filter: blur(6px);
}

.tool-auth-gate[hidden] { display: none !important; }

.tool-auth-gate-card {
  width: min(100%, 28rem);
  padding: 1.75rem 1.6rem;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.tool-auth-gate-card h2 {
  margin: 0 0 0.55rem;
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.tool-auth-gate-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.tool-auth-gate-actions {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

body.tool-gated {
  overflow: hidden;
}

body.tool-gated #qr-generator-app,
body.tool-gated #voice-feedback-app {
  pointer-events: none;
  user-select: none;
}

.tools-group {
  margin: 0 0 2.75rem;
}

.tools-group:last-child {
  margin-bottom: 0;
}

.tools-group-title {
  margin: 0.35rem 0 0.5rem;
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.tools-group-lead {
  margin: 0 0 1.25rem;
  color: var(--muted);
  max-width: 40rem;
  font-size: 0.98rem;
  line-height: 1.55;
}

.tool-list {
  display: grid;
  gap: 0;
}

.tool-link {
  display: grid;
  gap: 0.55rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.tool-link:last-child { border-bottom: 1px solid var(--line); }

.tool-link:hover h2 { color: var(--gold-deep); }

.tool-meta {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.tool-link h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.8vw, 1.7rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.tool-link p {
  margin: 0;
  color: var(--muted);
  max-width: 40rem;
}

.tool-more {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.tool-link:hover .tool-more { color: var(--gold-deep); }

/* —— Shared tool chrome —— */
.tool-back {
  display: inline-block;
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

.tool-back:hover { color: var(--gold-deep); }

.tool-page-head {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
  min-width: 0;
}

@media (min-width: 640px) {
  .tool-page-head { margin-bottom: 2rem; }
}

@media (min-width: 900px) {
  .tool-page-head {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.tool-page-head h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.tool-page-head .section-lead { margin-top: 0.75rem; }

.tool-page-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.tool-field {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}

.tool-field:focus {
  outline: none;
  border-color: var(--gold);
}

.tool-field::placeholder { color: #9a9a9a; }

textarea.tool-field { resize: vertical; min-height: 5rem; }

.tool-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.tool-hint {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.tool-req { color: var(--gold-deep); }
.tool-opt { color: #9a9a9a; font-weight: 500; }

.tool-panel {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 1rem 1.05rem;
  max-width: 100%;
  overflow: hidden;
}

@media (min-width: 640px) {
  .tool-panel { padding: 1.25rem 1.35rem; }
}

.tool-panel--soft { background: var(--paper-2); }

.tool-section-title {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.tool-section-lead {
  margin: 0 0 1.1rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.btn-sm {
  min-height: 2.4rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  padding: 0;
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
  background: transparent;
}

input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 0.25rem; }

input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
}

.tool-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
}

.tool-check input { accent-color: var(--gold); }

/* —— QR layout —— */
.qr-layout {
  display: grid;
  gap: 1.5rem;
  align-items: start;
  min-width: 0;
  width: 100%;
}

.qr-preview-col,
.qr-controls-col {
  min-width: 0;
  max-width: 100%;
}

/* Mobile: form first, preview + download after — natural configure → see → save flow */
.qr-controls-col { order: 1; }
.qr-preview-col { order: 2; }

@media (min-width: 1024px) {
  .qr-layout {
    grid-template-columns: 1fr minmax(300px, 380px);
    gap: 2.5rem;
  }
  .qr-preview-col { order: 2; position: sticky; top: calc(var(--nav-h) + 1rem); }
  .qr-controls-col { order: 1; }
}

.qr-preview-box {
  padding: 1rem;
  max-width: 100%;
  overflow: hidden;
}

@media (min-width: 640px) {
  .qr-preview-box { padding: 1.5rem; }
}

.qr-preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.qr-preview-top h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qr-preview-top span {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9a9a9a;
}

@media (max-width: 479px) {
  .qr-preview-top span { display: none; }
}

.qr-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-height: 11.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--paper-2);
  overflow: hidden;
}

@media (min-width: 640px) {
  .qr-stage {
    min-height: 220px;
    padding: 1.5rem;
  }
}

#qr-canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  transition: opacity 0.2s ease;
}

#qr-canvas canvas {
  display: block;
  border-radius: 0.35rem;
  max-width: 100%;
  width: auto !important;
  height: auto !important;
}

.qr-empty {
  text-align: center;
  color: var(--muted);
  padding: 0 0.5rem;
  max-width: 16rem;
}

.qr-empty-icon {
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--paper);
  color: #9a9a9a;
  font-size: 1.25rem;
}

.qr-empty p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.qr-notice {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(184, 146, 42, 0.35);
  background: var(--gold-soft);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.qr-controls { display: grid; gap: 0.9rem; margin-top: 1.15rem; }

.qr-controls input[type="range"] {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.qr-range-label {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.qr-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.15rem;
}

.qr-actions .btn {
  width: 100%;
  justify-content: center;
}

@media (min-width: 480px) {
  .qr-actions { flex-direction: row; }
  .qr-actions .btn-gold { flex: 1; }
  .qr-actions .btn-ghost { width: auto; }
}

.qr-foot-note {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: #9a9a9a;
}

/* Always a fitting grid — never a wide horizontal strip that blows out the page */
.content-type-scroll {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  width: 100%;
  max-width: 100%;
}

@media (min-width: 640px) {
  .content-type-scroll { gap: 0.5rem; }
}

.content-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 0;
  min-height: 4.25rem;
  padding: 0.7rem 0.25rem;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

@media (min-width: 640px) {
  .content-type-btn {
    min-height: 4.5rem;
    padding: 0.85rem 0.5rem;
    font-size: 0.75rem;
  }
}

.content-type-btn i { font-size: 1rem; }

.content-type-btn span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 0.15rem;
}

.content-type-btn.content-type-active {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--ink);
}

.content-fields { margin-top: 1.15rem; }

.field-stack { display: grid; gap: 1rem; }

.field-grid-2 {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .field-grid-2 { grid-template-columns: 1fr 1fr; }
}

.design-shell {
  border: 1px solid var(--line);
  background: var(--paper);
  overflow: hidden;
}

.design-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.design-tab {
  flex-shrink: 0;
  padding: 0.9rem 1.25rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.design-tab.design-tab-active {
  color: var(--ink);
  border-bottom-color: var(--gold);
}

.design-panel { padding: 1.25rem 1.35rem; }

.design-sublabel {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.shape-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .shape-grid--dots { grid-template-columns: repeat(6, 1fr); }
}

.shape-grid--corners { max-width: 16rem; }
.shape-grid--centre { max-width: 10rem; grid-template-columns: repeat(2, 1fr); }

.shape-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 0.5rem;
  border: 1px solid var(--line);
  background: var(--paper-2);
  border-radius: 0.35rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.shape-opt span:last-child {
  font-size: 0.65rem;
  color: var(--muted);
}

.shape-opt.shape-opt-active {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.corner-frame {
  width: 1.75rem;
  height: 1.75rem;
  border: 2px solid var(--ink-soft);
}

.corner-frame--square { border-radius: 0; }
.corner-frame--dot { border-radius: 50%; }
.corner-frame--rounded { border-radius: 0.45rem; }

.corner-eye {
  width: 1rem;
  height: 1rem;
  background: var(--ink-soft);
}

.corner-eye--square { border-radius: 0; }
.corner-eye--dot { border-radius: 50%; }

.shape-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  width: 28px;
  height: 28px;
}

.shape-preview span {
  background: var(--ink-soft);
  border-radius: 1px;
}

.shape-preview.shape-square span { border-radius: 0; }
.shape-preview.shape-dots span {
  border-radius: 50%;
  width: 6px;
  height: 6px;
  margin: auto;
}
.shape-preview.shape-rounded span { border-radius: 2px; }
.shape-preview.shape-extra-rounded span { border-radius: 4px; }
.shape-preview.shape-classy span:nth-child(odd) { border-radius: 0 3px 0 3px; }
.shape-preview.shape-classy-rounded span:nth-child(odd) { border-radius: 3px; }

.colour-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  min-width: 0;
}

.colour-row input[type="color"] {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
}

.colour-row .tool-field {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

.grad-panel {
  margin-left: 0.25rem;
  padding-left: 1rem;
  border-left: 2px solid var(--line);
  display: grid;
  gap: 0.75rem;
}

.grad-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.grad-swatch {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.grad-swatch input[type="color"] {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
}

.grad-swatch .tool-field {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.5rem;
  font-size: 0.75rem;
}

.grad-panel input[type="range"] {
  display: block;
  width: 100%;
  max-width: 100%;
}

.logo-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .logo-preset-grid { grid-template-columns: repeat(6, 1fr); }
}

.logo-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  background: var(--paper-2);
  border-radius: 0.35rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.logo-preset-btn:hover,
.logo-preset-btn.logo-preset-active {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.logo-preset-thumb {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.35rem;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  border: 1px solid var(--line);
}

.logo-preset-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-preset-btn span:last-child {
  font-size: 0.65rem;
  color: var(--muted);
}

.logo-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.btn-text:hover { color: #b42318; }

.qr-controls-col > section + section { margin-top: 2.25rem; }

/* —— Voice Feedback —— */
body.tool-voice {
  overflow: hidden;
  height: 100svh;
}

.vf-app {
  display: flex;
  height: calc(100svh - var(--nav-h));
  overflow: hidden;
  background: var(--paper-2);
}

.vf-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.vf-toolbar {
  flex-shrink: 0;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.vf-toolbar-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 1024px) {
  .vf-toolbar-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.vf-title-input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  padding: 0;
}

.vf-title-input:focus { outline: none; }
.vf-title-input::placeholder { color: #b0b0b0; }

.vf-toolbar-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.vf-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.vf-save {
  font-size: 0.75rem;
  font-weight: 600;
  color: #1f7a4d;
  opacity: 0;
  transition: opacity 0.2s;
  margin-right: 0.25rem;
}

.vf-save.is-visible { opacity: 1; }

.btn-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.35rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: var(--paper);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

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

.btn-tool:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-tool--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.btn-tool--ghost:hover { color: #b42318; }

.btn-tool--gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.btn-tool--gold:hover { background: #c9a33a; border-color: #c9a33a; }

.font-pair {
  display: none;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  overflow: hidden;
}

.font-pair button {
  border: none;
  background: var(--paper);
  padding: 0.5rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.font-pair button + button { border-left: 1px solid var(--line); }
.font-pair button:hover { color: var(--ink); background: var(--paper-2); }

@media (min-width: 640px) {
  .font-pair { display: inline-flex; }
  .btn-tool--desktop { display: inline-flex; }
}

.btn-tool--desktop { display: none; }

.vf-import {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--paper-2);
}

.vf-import-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.vf-doc-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.15rem 2rem;
}

#document-content {
  max-width: 48rem;
  margin: 0 auto;
  padding: 1.5rem 1.35rem;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: calc(1rem * var(--doc-scale, 1));
  box-shadow: var(--shadow);
}

@media (min-width: 640px) {
  #document-content {
    padding: 2.25rem 2.5rem;
    font-size: calc(1.0625rem * var(--doc-scale, 1));
  }
}

#document-content .doc-empty {
  margin: 0;
  color: var(--muted);
  font-style: italic;
}

#document-content .doc-title {
  font-family: var(--display);
  font-size: 1.75em;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 1.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(184, 146, 42, 0.35);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

#document-content .doc-heading {
  font-family: var(--display);
  font-size: 1.3em;
  font-weight: 700;
  color: var(--ink);
  margin: 2rem 0 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
  letter-spacing: -0.02em;
}

#document-content .doc-heading:first-child,
#document-content .doc-title + .doc-heading { margin-top: 0; }

#document-content .doc-paragraph {
  margin: 0 0 1rem;
  line-height: 1.75;
  color: var(--ink-soft);
}

#document-content .doc-callout {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin: 1.15rem 0;
  padding: 0.85rem 1rem;
  background: var(--gold-soft);
  border: 1px solid rgba(184, 146, 42, 0.3);
  border-radius: 0.35rem;
  color: var(--gold-deep);
  font-size: 0.92em;
  line-height: 1.55;
}

#document-content .doc-callout-icon {
  margin-top: 0.15rem;
  opacity: 0.75;
  flex-shrink: 0;
}

#document-content .doc-quote {
  margin: 1rem 0 1.15rem;
  padding: 0.75rem 1rem 0.75rem 1.1rem;
  border-left: 3px solid var(--gold);
  background: var(--paper-2);
  color: var(--ink-soft);
  line-height: 1.7;
}

#document-content .doc-label-line {
  margin: 0 0 0.6rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

#document-content .doc-label-tag {
  font-weight: 700;
  color: var(--muted);
  font-size: 0.88em;
  letter-spacing: 0.02em;
}

#document-content .doc-label-body { color: var(--ink); }

#document-content .doc-list-item {
  margin: 0 0 0.45rem;
  padding-left: 0.5rem;
  color: var(--ink-soft);
  line-height: 1.65;
}

#document-content mark {
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 0 0.15rem;
  border-radius: 0.15rem;
  cursor: pointer;
  color: var(--ink);
}

#document-content ::selection {
  background: rgba(184, 146, 42, 0.28);
  color: var(--ink);
}

.feedback-badge {
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.1rem 0.35rem;
  margin-left: 0.15rem;
  vertical-align: super;
}

.highlight-flash { animation: vf-flash 1.5s ease-out; }

@keyframes vf-flash {
  0% { box-shadow: 0 0 0 0 rgba(184, 146, 42, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(184, 146, 42, 0); }
  100% { box-shadow: 0 0 0 0 rgba(184, 146, 42, 0); }
}

.note-theme-0 mark, .mark-theme-0 { background: rgba(184, 146, 42, 0.28); }
.note-theme-1 mark, .mark-theme-1 { background: rgba(46, 125, 90, 0.22); }
.note-theme-2 mark, .mark-theme-2 { background: rgba(201, 163, 58, 0.3); }
.note-theme-3 mark, .mark-theme-3 { background: rgba(47, 111, 130, 0.2); }
.note-theme-4 mark, .mark-theme-4 { background: rgba(180, 140, 40, 0.22); }
.note-theme-5 mark, .mark-theme-5 { background: rgba(90, 130, 70, 0.22); }

.badge-theme-0 { background: var(--gold); color: var(--ink); }
.badge-theme-1 { background: #2e7d5a; color: #fff; }
.badge-theme-2 { background: #e4c76b; color: var(--ink); }
.badge-theme-3 { background: #2f6f82; color: #fff; }
.badge-theme-4 { background: #c9a33a; color: var(--ink); }
.badge-theme-5 { background: #5a8246; color: #fff; }

.border-theme-0 { border-left-color: var(--gold); }
.border-theme-1 { border-left-color: #2e7d5a; }
.border-theme-2 { border-left-color: #c9a33a; }
.border-theme-3 { border-left-color: #2f6f82; }
.border-theme-4 { border-left-color: #b8922a; }
.border-theme-5 { border-left-color: #5a8246; }

.vf-notes {
  width: min(100%, 22rem);
  background: var(--paper);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.vf-notes-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.vf-notes-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.vf-notes-head h2 i { color: var(--gold-deep); font-size: 0.95rem; }

#notes-counter {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.vf-notes-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.vf-notes-actions .btn-tool { min-height: 2.1rem; padding: 0.35rem 0.65rem; font-size: 0.75rem; }

.icon-btn {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: var(--paper);
  color: var(--muted);
  cursor: pointer;
}

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

#feedback-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.vf-empty {
  text-align: center;
  color: var(--muted);
  margin-top: 2rem;
  padding: 0 0.75rem;
}

.vf-empty i {
  display: block;
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  opacity: 0.4;
}

.vf-empty p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.vf-notes-foot {
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
  color: #9a9a9a;
  line-height: 1.45;
}

.feedback-card {
  position: relative;
  padding: 1rem;
  border: 1px solid var(--line);
  border-left-width: 4px;
  background: var(--paper-2);
  border-radius: 0.35rem;
  transition: background 0.15s, box-shadow 0.15s;
}

.feedback-card:hover { background: #efefec; }

.feedback-card.is-active {
  box-shadow: 0 0 0 2px rgba(184, 146, 42, 0.35);
}

.feedback-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.feedback-num {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.feedback-card-ops { display: flex; gap: 0.15rem; }

.feedback-card-ops button {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0.3rem;
  border-radius: 999px;
  cursor: pointer;
}

.feedback-card-ops button:hover { color: var(--ink); background: rgba(12, 12, 12, 0.05); }

.jump-to-highlight {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 2px solid;
  padding: 0 0 0 0.55rem;
  margin: 0 0 0.65rem;
  font: inherit;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--muted);
  cursor: pointer;
  line-height: 1.45;
}

.jump-to-highlight:hover { color: var(--ink-soft); }

.transcript-text {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.5;
}

.edited-badge {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.65rem;
  color: var(--gold-deep);
}

.edit-textarea {
  width: 100%;
  min-height: 5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: var(--paper);
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

.edit-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

#notes-backdrop { display: none; }

@media (max-width: 1023px) {
  .vf-notes {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(100%, 22rem);
    transform: translateX(100%);
    transition: transform 0.25s var(--ease);
    z-index: 60;
    box-shadow: var(--shadow);
  }

  .vf-notes.notes-open { transform: translateX(0); }

  #notes-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(12, 12, 12, 0.4);
    z-index: 55;
  }

  .vf-notes.notes-open + #notes-backdrop { display: block; }
}

#tooltip {
  position: fixed;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) translateX(-50%);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#tooltip.show {
  opacity: 1;
  transform: translateY(0) translateX(-50%);
  pointer-events: auto;
}

.vf-float-btn {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.vf-float-btn:hover { border-color: var(--gold); }

#mic-btn { border-color: rgba(184, 146, 42, 0.45); }

#mic-btn.recording {
  background: #ef4444 !important;
  border-color: #fca5a5 !important;
  color: #fff;
}

.vf-float-ask {
  width: auto;
  padding: 0 0.85rem;
  gap: 0.4rem;
  border-color: rgba(184, 146, 42, 0.45);
}

.vf-float-ask i { color: var(--gold-deep); font-size: 0.85rem; }
.vf-float-ask span { font-size: 0.75rem; font-weight: 700; color: var(--gold-deep); }

#pulse-ring {
  position: absolute;
  left: 0;
  inset: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  background: #ef4444;
  opacity: 0;
  pointer-events: none;
}

#pulse-ring.animate-ping {
  animation: vf-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes vf-ping {
  75%, 100% { transform: scale(1.6); opacity: 0; }
}

#tooltip-label {
  position: absolute;
  top: -2.1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  white-space: nowrap;
}

/* Ask Marra modal */
#ask-marra-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#ask-marra-modal.hidden { display: none; }

.ask-marra-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 12, 0.55);
  backdrop-filter: blur(4px);
}

.ask-marra-dialog {
  position: relative;
  width: min(100%, 40rem);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.ask-marra-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.ask-marra-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.ask-marra-head h2 i { color: var(--gold-deep); }
.ask-marra-head p { margin: 0.35rem 0 0; font-size: 0.75rem; color: var(--muted); }

.ask-marra-context {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}

.ask-marra-context-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

#ask-marra-context {
  margin: 0;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#ask-marra-chat {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  min-height: 12rem;
  max-height: 40vh;
}

.ask-marra-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 1.25rem;
  border-top: 1px solid var(--line);
}

#ask-marra-status {
  margin: 0;
  min-height: 1rem;
  font-size: 0.75rem;
  color: var(--muted);
}

#ask-marra-status.is-error { color: #b42318; }

#ask-marra-copy {
  border: none;
  background: none;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-deep);
  cursor: pointer;
}

#ask-marra-form {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  padding: 0 1.25rem 1.15rem;
}

.ask-marra-msg { margin-bottom: 1rem; }

.ask-marra-msg-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  color: var(--muted);
}

.ask-marra-msg-assistant .ask-marra-msg-label { color: var(--gold-deep); }

.ask-marra-msg-body {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--ink-soft);
  white-space: pre-wrap;
}

.ask-marra-msg-user .ask-marra-msg-body {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  padding: 0.75rem 0.9rem;
}

.ask-marra-msg-assistant .ask-marra-msg-body {
  border-left: 3px solid var(--gold);
  padding: 0.25rem 0 0.25rem 0.85rem;
}

body.overflow-hidden { overflow: hidden; }

/* —— Picture Studio share / hop page —— */
.studio-hop-main {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(184, 146, 42, 0.14), transparent 55%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
}

.studio-hop-inner { padding-bottom: 4rem; }

.studio-hop-inner .page-title {
  max-width: 16ch;
}

.studio-hop-status {
  margin: 1.25rem 0 0;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.studio-hop-inner .btn {
  margin-top: 1.5rem;
  min-width: 12rem;
}

.studio-hop-fallback {
  margin: 1.1rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.studio-hop-fallback a {
  color: var(--gold-deep);
  text-decoration: none;
}

.studio-hop-fallback a:hover { text-decoration: underline; }

/* —— Random number generator —— */
.rng-page {
  padding-top: clamp(2rem, 5vw, 3.25rem);
}

.rng-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  min-height: 18rem;
  padding: clamp(2rem, 6vw, 3.25rem) clamp(1.25rem, 4vw, 2.5rem) clamp(1.5rem, 4vw, 2.25rem);
  background:
    radial-gradient(ellipse 80% 70% at 50% -10%, rgba(184, 146, 42, 0.28), transparent 58%),
    var(--ink);
  color: #fff;
  text-align: center;
  overflow: hidden;
}

.rng-stage::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--gold);
}

.rng-kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.rng-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 5.5rem;
}

.rng-figure {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(4.25rem, 13vw, 7.5rem);
  letter-spacing: -0.045em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.rng-figure.is-mid { font-size: clamp(3rem, 8vw, 5rem); }
.rng-figure.is-long { font-size: clamp(2.1rem, 6vw, 3.4rem); }
.rng-figure.is-idle {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.28);
}

.rng-chip {
  min-width: 3.4rem;
  margin: 0;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(184, 146, 42, 0.7);
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.rng-stage.is-rolling .rng-figure,
.rng-stage.is-rolling .rng-chip {
  opacity: 0.55;
  filter: blur(1.5px);
}

.rng-stage.is-landed .rng-figure,
.rng-stage.is-landed .rng-chip {
  animation: rng-land 0.38s var(--ease);
}

@keyframes rng-land {
  from { transform: translateY(10px); opacity: 0; filter: blur(8px); }
  to { transform: none; opacity: 1; filter: none; }
}

.rng-caption,
.rng-total {
  margin: 0;
  max-width: 36rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.68);
}

.rng-total { color: var(--gold); }

.rng-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.rng-btn-quiet {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.38);
}

.rng-btn-quiet:hover:not(:disabled) {
  background: #fff;
  color: var(--ink);
  border-color: #fff;
}

.rng-actions .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.rng-layout {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 860px) {
  .rng-layout {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
    gap: 1.25rem;
  }
}

.rng-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1.15rem;
}

.rng-preset {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  padding: 0.45rem 0.75rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.rng-preset:hover { border-color: var(--ink); color: var(--ink); }

.rng-preset[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.rng-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 1rem;
}

.rng-span-2 { grid-column: 1 / -1; }

.rng-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.35rem;
}

.rng-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}

.rng-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--gold-deep);
}

.rng-error {
  margin: 0;
  padding: 0.7rem 0.85rem;
  background: var(--gold-soft);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.rng-history-list {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
}

.rng-history-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.rng-history-list time {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.rng-history-list span {
  font-weight: 700;
  text-align: right;
}

.rng-history-empty {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.rng-clear {
  margin-top: 0.85rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold-deep);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.rng-clear:hover { text-decoration: underline; }

.rng-note {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.rng-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .rng-stage.is-landed .rng-figure,
  .rng-stage.is-landed .rng-chip { animation: none; }
  .rng-stage.is-rolling .rng-figure,
  .rng-stage.is-rolling .rng-chip { filter: none; opacity: 1; }
}
