/* GlowTone: dark navigation rail, light product canvas, indigo-to-cyan accent. */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-muted: #f7f8fc;
  --ink: #0b1220;
  --ink-soft: #1f2937;
  --muted: #5b6475;
  --faint: #646c7e;
  --line: #e4e7f0;
  --line-strong: #d3d8e5;
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --accent-soft: #eef0ff;
  --accent-ink: #3730a3;
  --cyan: #06b6d4;
  --gradient: linear-gradient(135deg, #4f46e5 0%, #6d5bf5 45%, #06b6d4 100%);
  /* Same hues, dark enough for white text along the whole gradient (WCAG 1.4.3). */
  --gradient-strong: linear-gradient(135deg, #4f46e5 0%, #4338ca 50%, #0e7490 100%);
  --rail: #0a0f1f;
  --rail-raised: rgba(255, 255, 255, 0.045);
  --rail-line: rgba(255, 255, 255, 0.08);
  --rail-ink: #e7eaf3;
  --rail-muted: #8d95ab;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 30px rgba(15, 23, 42, 0.06);
  --shadow-accent: 0 8px 24px rgba(79, 70, 229, 0.28);
  --success-bg: #ecfdf5;
  --success-ink: #047857;
  --warning-bg: #fffbeb;
  --warning-ink: #b45309;
  --error-bg: #fef2f2;
  --error-ink: #b91c1c;
  --info-bg: #eff6ff;
  --info-ink: #1d4ed8;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", "Inter", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 500px at 85% -10%, rgba(79, 70, 229, 0.08), transparent 60%),
    radial-gradient(900px 400px at 10% -20%, rgba(6, 182, 212, 0.07), transparent 60%);
  background-repeat: no-repeat;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

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

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

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ----- Navigation rail ----- */

.sidebar {
  flex: 0 0 320px;
  width: 320px;
  padding: 22px 20px 32px;
  background:
    radial-gradient(420px 260px at 0% 0%, rgba(79, 70, 229, 0.22), transparent 70%),
    radial-gradient(360px 240px at 100% 100%, rgba(6, 182, 212, 0.12), transparent 70%),
    var(--rail);
  border-right: 1px solid var(--rail-line);
  color: var(--rail-ink);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--rail-line);
}

.sidebar-brand-mark {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background-color: rgba(255, 255, 255, 0.06);
  background-size: 82%;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: inset 0 0 0 1px var(--rail-line);
  flex: 0 0 auto;
}

.sidebar-brand-copy {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
}

.sidebar-brand-subtitle {
  color: var(--rail-muted);
  font-size: 0.8rem;
}

.sidebar-caption {
  color: var(--rail-muted);
  font-size: 0.82rem;
  margin: 0 0 6px;
}

.sidebar-group-label {
  margin-top: 22px;
  margin-bottom: 4px;
  color: #a5b4fc;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}

.sidebar-control-copy {
  color: var(--rail-muted);
  font-size: 0.8rem;
  line-height: 1.45;
  margin: 0 0 10px;
}

.choice-grid {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.choice-grid.cols-1 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.choice-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.86rem;
  padding: 8px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  color: var(--rail-ink);
  background: var(--rail-raised);
  border: 1px solid var(--rail-line);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.choice-button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.choice-button[aria-pressed="true"] {
  background: var(--gradient-strong);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: var(--shadow-accent);
}

.swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  flex: 0 0 auto;
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--rail-line);
}

.segmented .choice-button {
  min-height: 34px;
  font-size: 0.82rem;
  border: none;
  background: transparent;
}

.segmented .choice-button[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.sidebar form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar label {
  font-size: 0.8rem;
  color: var(--rail-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--rail-line);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 9px 12px;
}

.sidebar input:focus {
  border-color: #818cf8;
  outline: 2px solid #a5b4fc;
  outline-offset: 1px;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.25);
}

.sidebar .btn {
  width: 100%;
}

.sidebar .alert {
  font-size: 0.82rem;
}

/* ----- Product canvas ----- */

.block-container {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 40px 56px;
}

.brand-shell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 36px;
  margin-bottom: 18px;
  border-radius: 22px;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(6, 182, 212, 0.35), transparent 60%),
    radial-gradient(500px 300px at 0% 100%, rgba(124, 58, 237, 0.35), transparent 60%),
    linear-gradient(135deg, #0b1024 0%, #151b3d 55%, #1b2350 100%);
  box-shadow: 0 20px 50px rgba(11, 16, 36, 0.25);
}

.brand-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(90deg, transparent, #000 40%, #000 70%, transparent);
  pointer-events: none;
}

.brand-copy {
  position: relative;
  max-width: 680px;
}

.brand-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #c7d2fe;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22d3ee;
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.2);
}

.brand-title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0;
}

.brand-accent {
  background: linear-gradient(90deg, #a5b4fc, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-subtitle {
  margin: 12px 0 0;
  color: #c3c9da;
  font-size: 1rem;
  line-height: 1.6;
  max-width: 560px;
}

.brand-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
}

.brand-capabilities li {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  color: #e0e7ff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-logo {
  position: relative;
  width: 112px;
  height: auto;
  flex: 0 0 auto;
  padding: 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.profile-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.profile-pill {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.profile-pill-label {
  color: var(--faint);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 2px;
}

.profile-pill-value {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.welcome-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  margin: 0 0 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.welcome-copy {
  min-width: 0;
}

.welcome-kicker {
  color: var(--accent);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

.welcome-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 2px 0 0;
}

.welcome-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
}

.welcome-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--success-bg);
  color: var(--success-ink);
  font-size: 0.75rem;
  font-weight: 600;
}

.note-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.note-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  border-radius: 12px;
  padding: 6px 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.84rem;
  font-weight: 500;
  margin-bottom: 10px;
}

.note-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  flex: 0 0 auto;
  transform: translateY(-1px);
}

/* ----- Tabs ----- */

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  margin-bottom: 26px;
  width: fit-content;
  max-width: 100%;
  border-radius: 14px;
  background: #e9ecf4;
  border: 1px solid var(--line);
}

.tab-button {
  border: none;
  background: transparent;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
  min-height: 38px;
  padding: 0 16px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

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

.tab-button[aria-selected="true"] {
  background: var(--surface);
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

/* ----- Section and panel copy ----- */

.section-kicker,
.panel-eyebrow {
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 6px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 8px;
}

.section-copy {
  color: var(--muted);
  max-width: 720px;
  margin-bottom: 22px;
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.panel-copy {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  min-width: 0;
}

.columns {
  display: grid;
  gap: 20px;
  align-items: start;
}

.columns > * {
  min-width: 0;
}

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

.columns.builder {
  grid-template-columns: 1.06fr 0.94fr;
}

.columns.generator {
  grid-template-columns: 0.88fr 1.12fr;
}

.columns.saved {
  grid-template-columns: 1.1fr 0.9fr;
}

.columns.pair {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.detail-list {
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.detail-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.detail-list li + li {
  border-top: 1px solid var(--line);
}

.detail-list strong {
  color: var(--muted);
  font-weight: 500;
}

.reason-list {
  margin: 6px 0 14px;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.reason-list li {
  margin-bottom: 4px;
}

.reason-list li::marker {
  color: var(--accent);
}

.caption {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 8px 0 12px;
}

h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin: 18px 0 6px;
}

/* ----- Controls ----- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 11px 18px;
  min-height: 42px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  background: var(--accent-strong);
  box-shadow: var(--shadow-accent);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
  box-shadow: none;
}

.btn.block {
  width: 100%;
}

.select,
.textarea {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  min-height: 42px;
  padding: 9px 12px;
  color: var(--ink);
  margin-bottom: 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.select:focus,
.textarea:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.textarea {
  resize: vertical;
  line-height: 1.55;
}

.field-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.color-field-label,
.legend-title,
.score-label {
  color: var(--faint);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 8px;
}

.current-color-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  margin-bottom: 8px;
  font-size: 0.86rem;
  font-weight: 500;
}

.current-color-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.84rem;
  color: var(--ink-soft);
}

.legend-chip-muted {
  border-style: dashed;
  color: var(--muted);
  background: var(--surface-muted);
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--gradient);
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.score-shell {
  border-radius: 14px;
  padding: 16px 18px;
  margin: 6px 0 20px;
  background: linear-gradient(180deg, #f8f9ff, #f1f3fd);
  border: 1px solid #e2e5fb;
}

.score-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}

.score-value {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.score-value small {
  font-size: 1rem;
  font-weight: 500;
  color: var(--faint);
  margin-left: 2px;
}

.score-note {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
}

.score-rail {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e3e6f3;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--gradient);
}

.alert {
  border-radius: 12px;
  padding: 10px 14px;
  margin: 6px 0 12px;
  font-size: 0.9rem;
  background: var(--info-bg);
  color: var(--info-ink);
  border: 1px solid rgba(29, 78, 216, 0.12);
}

.alert.success {
  background: var(--success-bg);
  color: var(--success-ink);
  border-color: rgba(4, 120, 87, 0.15);
}

.alert.warning {
  background: var(--warning-bg);
  color: var(--warning-ink);
  border-color: rgba(180, 83, 9, 0.15);
}

.alert.error {
  background: var(--error-bg);
  color: var(--error-ink);
  border-color: rgba(185, 28, 28, 0.15);
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 14px;
  border: 1.5px dashed #7c83db;
  background: linear-gradient(180deg, #fafbff, #f3f5ff);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone::before {
  content: "";
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin-bottom: 6px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M7 9l5-5 5 5M4 20h16'/%3E%3C/svg%3E") center / 22px no-repeat,
    var(--gradient);
  box-shadow: var(--shadow-accent);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

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

.figure {
  margin: 0 0 16px;
}

.figure img {
  display: block;
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.figure figcaption {
  color: var(--faint);
  font-size: 0.8rem;
  margin-top: 6px;
}

.swatch-block {
  width: 240px;
  max-width: 100%;
  height: 110px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

/* Studio stage behind every avatar: soft key light and a floor shadow. */
.avatar-frame {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 18px 12px 8px;
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(60% 45% at 50% 30%, #ffffff 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, #eef1f8 0%, #e3e8f2 78%, #d9dfeb 100%);
  border: 1px solid var(--line);
}

.avatar-frame::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 14px;
  width: 46%;
  height: 16px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(15, 23, 42, 0.22), transparent);
  pointer-events: none;
}

.avatar-frame img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  height: auto;
}

.view-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: #e9ecf4;
  border: 1px solid var(--line);
}

.view-toggle button {
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
}

.view-toggle button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--accent-ink);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.avatar-3d {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 2 / 3;
}

.avatar-3d-host,
.avatar-3d-host canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.avatar-3d-host canvas:active {
  cursor: grabbing;
}

.avatar-3d-status {
  position: absolute;
  inset: auto 0 45% 0;
  z-index: 2;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
  pointer-events: none;
}

.avatar-caption {
  color: var(--faint);
  text-align: center;
  margin-top: 10px;
  font-size: 0.82rem;
}

details.expander {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease;
}

details.expander[open] {
  box-shadow: var(--shadow);
}

details.expander summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 600;
}

details.expander summary::marker {
  color: var(--accent);
}

details.expander > div {
  padding: 0 18px 18px;
}

.code {
  display: block;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.84rem;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--accent-ink);
  overflow-wrap: anywhere;
}

.answer {
  white-space: pre-wrap;
  font-family: inherit;
  background: var(--surface-muted);
}

@media (max-width: 1100px) {
  .block-container {
    padding: 24px 24px 48px;
  }

  .brand-logo {
    display: none;
  }
}

@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    position: static;
    width: 100%;
    flex: none;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--rail-line);
    padding: 18px 16px 24px;
  }

  .block-container {
    padding: 18px 16px 40px;
  }

  .columns.even,
  .columns.builder,
  .columns.generator,
  .columns.saved {
    grid-template-columns: 1fr;
  }

  .brand-shell {
    padding: 24px 20px;
    border-radius: 18px;
  }

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

  .tab-list {
    width: 100%;
  }

  .tab-button {
    flex: 1 1 auto;
    padding: 0 10px;
  }

  .card {
    padding: 18px 16px;
  }
}

/* ----- Accessibility (WCAG 2.1 AA / IS 5568) ----- */

.sr-only {
  position: absolute;
  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;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* The dark sidebar and hero need a lighter focus ring to reach 3:1. */
.sidebar :focus-visible,
.brand-shell :focus-visible {
  outline-color: #a5b4fc;
}

.dropzone:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}

.tab-panel:focus-visible,
.block-container:focus-visible {
  outline-offset: 4px;
}

.block-container:focus:not(:focus-visible) {
  outline: none;
}

.legend-row {
  list-style: none;
  margin: 0;
  padding: 0;
}

.link-button {
  border: none;
  background: none;
  padding: 0;
  margin-left: 6px;
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.temp-note {
  font-size: 0.8rem;
  border-left: 2px solid #a5b4fc;
  padding-left: 10px;
}

.subscribe-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.subscribe-button {
  background: #fff;
  color: var(--accent-ink);
}

.subscribe-button:hover {
  background: #e0e7ff;
}

.subscribe-hint {
  color: #c3c9da;
  font-size: 0.85rem;
}

.subscribe-feedback:not(:empty) {
  margin-top: 12px;
  max-width: 34rem;
}

.site-footer {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 32px 0 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--accent-ink);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ----- Cookie consent banner ----- */

.consent-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  max-width: 44rem;
  margin: 0 auto;
  padding: 18px 20px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
}

.consent-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 6px;
}

.consent-copy {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.55;
}

.consent-copy a {
  color: var(--accent-ink);
}

/* Accept and decline look the same, so declining is as easy as accepting. */
.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.consent-actions .btn {
  flex: 1 1 10rem;
}

.footer-link {
  margin-left: 0;
  font-size: inherit;
}

/* ----- Promo video and credit ----- */

.promo {
  margin-top: 48px;
}

.promo-title {
  margin: 0;
}

.promo-frame {
  margin-top: 18px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--rail);
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

.promo-frame video {
  display: block;
  width: 100%;
  height: 100%;
}

.transcript {
  margin-top: 14px;
}

.transcript ol {
  margin: 0;
  padding: 4px 18px 14px 36px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.site-footer {
  flex-wrap: wrap;
  align-items: center;
}

.site-footer .credit {
  flex-basis: 100%;
  margin: 6px 0 0;
  text-align: center;
}

.site-footer .credit a {
  font-weight: 600;
}

/* ----- Premium: pricing dialog, waitlist, locked features ----- */

.pricing-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  border: none;
  border-radius: 20px;
  padding: 32px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(10, 15, 31, 0.35);
}

.pricing-dialog::backdrop {
  background: rgba(10, 15, 31, 0.6);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.dialog-close:hover {
  background: var(--line);
}

.pricing-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  margin: 4px 0 8px;
  outline: none;
}

.pricing-reason {
  color: var(--ink-soft);
  margin: 0 0 16px;
}

.pricing-features {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.pricing-features li {
  position: relative;
  padding-left: 28px;
  color: var(--ink-soft);
}

.pricing-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.75rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  padding: 22px 20px 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.plan:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.plan-best {
  border: 2px solid var(--accent);
  background: linear-gradient(180deg, #f6f5ff, #ffffff);
  box-shadow: var(--shadow-accent);
}

.plan-badge {
  position: absolute;
  top: -12px;
  left: 18px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--gradient-strong);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.plan-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.plan-price {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.1;
}

.plan-price s {
  color: var(--faint);
  font-size: 1.3rem;
  font-weight: 500;
  margin-right: 4px;
}

.plan-price small {
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
}

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

.plan-cta {
  margin-top: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 0.9rem;
  align-self: stretch;
  text-align: center;
}

.plan-best .plan-cta {
  background: var(--accent);
  color: #fff;
}

.text-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  margin-bottom: 14px;
}

.text-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.consent-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-bottom: 14px;
  cursor: pointer;
}

.consent-check input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  flex: none;
  accent-color: var(--accent);
}

.waitlist-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.premium-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--gradient-strong);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.premium-note {
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.premium-lock {
  text-align: center;
  padding: 36px 24px;
}

.premium-lock .panel-copy {
  max-width: 32rem;
  margin: 8px auto 18px;
}

@media (max-width: 600px) {
  .pricing-dialog {
    padding: 24px 18px;
  }

  .plans {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}

/* ----- Hebrew text, Hebrew explanation and video ----- */

[lang="he"] {
  font-family: "Heebo", "Inter", "Segoe UI", Arial, sans-serif;
  line-height: 1.75;
}

.he-note {
  margin-top: 16px;
  max-width: 560px;
  color: #c3c9da;
  font-size: 0.9rem;
}

.he-note summary {
  cursor: pointer;
  width: fit-content;
  color: #e0e7ff;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.he-note summary:focus-visible {
  outline: 3px solid #a5b4fc;
  outline-offset: 3px;
  border-radius: 4px;
}

.he-note p {
  margin: 10px 0 12px;
}

.he-video-button {
  font-family: inherit;
}

.he-video-dialog .dialog-close {
  right: auto;
  left: 12px;
}

.he-video-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ----- Terms of use: the agreement dialog and the terms page ----- */

.terms-dialog {
  width: min(600px, calc(100vw - 32px));
}

.terms-he {
  font-size: 0.95rem;
}

.terms-leave {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.doc {
  max-width: 46rem;
  margin: 0 auto;
  padding: 40px 20px 64px;
  color: var(--ink);
  line-height: 1.65;
}

.doc h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0 0 8px;
}

.doc h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 32px 0 8px;
}

.doc h3 {
  font-size: 1.1rem;
  margin: 24px 0 6px;
}

.doc p,
.doc li {
  color: var(--ink-soft);
}

.doc a {
  color: var(--accent-ink);
}

.doc .meta {
  color: var(--muted);
}

.doc section[lang="he"] {
  direction: rtl;
  text-align: start;
  line-height: 1.8;
}

.doc-callout {
  margin: 20px 0;
  padding: 14px 18px;
  border-radius: 12px;
  border-inline-start: 4px solid var(--accent);
  background: var(--surface-muted);
  color: var(--ink);
}

.doc-he {
  margin-top: 48px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.site-footer .footer-help {
  flex-basis: 100%;
  margin: 4px 0 0;
  text-align: center;
  font-size: 0.85rem;
}

/* ----- Mobile and tablet: foldable profile panel ----- */

.sidebar-toggle {
  display: none;
}

@media (max-width: 900px) {
  .sidebar-brand {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
  }

  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
  }

  .sidebar-toggle:focus-visible {
    outline: 3px solid #a5b4fc;
    outline-offset: 2px;
  }

  .sidebar:not(.sidebar-open) .sidebar-body {
    display: none;
  }

  .sidebar.sidebar-open .sidebar-body {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--rail-line);
  }
}

/* ----- Footer links: touch targets of at least 24px ----- */

.site-footer > a,
.site-footer > .footer-link,
.site-footer .credit a,
.site-footer .footer-help a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

/* ----- Installable web app ----- */

.install-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.install-button[hidden] {
  display: none;
}

.install-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.install-button:focus-visible {
  outline: 3px solid #a5b4fc;
  outline-offset: 2px;
}

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

.install-steps {
  margin: 0 0 16px;
  padding-left: 1.3rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

.install-he {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* ----- Announcement bar: a slow, pure-CSS marquee above everything ----- */

.announce-bar {
  position: relative;
  display: flex;
  align-items: center;
  height: 34px;
  background: var(--rail);
  border-bottom: 1px solid var(--rail-line);
  color: var(--rail-muted);
  font-family: var(--font);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  overflow: hidden;
}

.announce-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

/* Two identical groups; moving the track by exactly half loops with no visible jump. */
.announce-track {
  display: flex;
  width: max-content;
  animation: announce-scroll 80s linear infinite;
  will-change: transform;
}

.announce-group {
  display: flex;
  flex: none;
  align-items: center;
}

.announce-item {
  padding: 0 1.6em;
  white-space: nowrap;
  transition: color 0.6s ease;
}

.announce-brand {
  background: linear-gradient(90deg, #a5b4fc, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 600;
}

.announce-sep {
  color: #a5b4fc;
  font-size: 0.85em;
  letter-spacing: 0;
  opacity: 0.55;
}

@keyframes announce-scroll {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

/* Stops on hover, and with the pause button (touch, keyboard and screen-reader users). */
.announce-bar:hover .announce-track,
.announce-bar:has(.announce-pause-input:checked) .announce-track {
  animation-play-state: paused;
}

.announce-bar:hover .announce-item {
  color: var(--rail-ink);
}

.announce-pause-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  opacity: 0;
  pointer-events: none;
}

.announce-pause {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-left: 1px solid var(--rail-line);
  color: var(--rail-muted);
  cursor: pointer;
  letter-spacing: 0;
}

.announce-pause::before {
  content: "❚❚";
  font-size: 0.6rem;
}

.announce-pause-input:checked + .announce-pause::before {
  content: "▶";
  font-size: 0.65rem;
}

.announce-pause:hover {
  color: var(--rail-ink);
}

.announce-pause-input:focus-visible + .announce-pause {
  outline: 2px solid #a5b4fc;
  outline-offset: -4px;
  border-radius: 6px;
}

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

  .announce-pause-input,
  .announce-pause {
    display: none;
  }
}

/* ----- Server waking up (free hosting sleeps when idle) ----- */

.wake-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--info-bg);
  color: var(--info-ink);
  font-size: 0.92rem;
}

.wake-note[hidden] {
  display: none;
}

.wake-dot {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
  animation: wake-pulse 1.2s ease-in-out infinite;
}

@keyframes wake-pulse {
  50% {
    opacity: 0.3;
  }
}
