/* Chitram Playground — warm drawing-studio aesthetic for a creative tool.
   Paper tones, paint accents, soft shadows. No external fonts/CDNs; every
   color flows through the custom properties below. */

:root {
  --bg: #f6f0e4;
  --bg-raised: #fffdf7;
  --bg-inset: #f2ebdb;
  --border: #e0d3ba;
  --border-soft: #ebe1cc;
  --text: #363127;
  --text-dim: #6e6555;
  --text-faint: #9b907c;
  --accent: #d4552e;
  --accent-deep: #b23c1c;
  --accent-soft: rgba(212, 85, 46, 0.12);
  --teal: #1f6f6a;
  --teal-bright: #15776f;
  --red: #c4433a;
  --red-soft: rgba(196, 67, 58, 0.1);
  --green: #3f8a49;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-soft: 0 1px 3px rgba(80, 60, 30, 0.06), 0 10px 30px rgba(80, 60, 30, 0.09);
  --shadow-lift: 0 2px 6px rgba(80, 60, 30, 0.08), 0 16px 40px rgba(80, 60, 30, 0.14);
  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

/* ── vendored lucide icons (sprite in index.html) ─────────────────────── */

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  vertical-align: -2px;
}

::selection { background: rgba(212, 85, 46, 0.22); }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1200px 520px at 85% -10%, rgba(31, 111, 106, 0.08), transparent 60%),
    radial-gradient(900px 420px at -12% -4%, rgba(212, 85, 46, 0.07), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── hero callout (0xAlpha free-key promo — prominent, always visible) ── */

.hero {
  padding: 20px 28px 0;
  max-width: 1460px;
  margin: 0 auto;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(212, 85, 46, 0.22);
  border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(700px 220px at 10% -40%, rgba(31, 111, 106, 0.14), transparent 62%),
    radial-gradient(640px 260px at 90% -70%, rgba(232, 176, 75, 0.28), transparent 65%),
    linear-gradient(135deg, #fdf3df, #fbe9d6 55%, #f8efe0);
  box-shadow: var(--shadow-soft);
  padding: 18px 24px;
  position: relative;
  overflow: hidden;
}
/* painted underline flourish along the bottom edge */
.hero-inner::after {
  content: "";
  position: absolute;
  left: 24px; right: 24px; bottom: 9px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg,
    rgba(212, 85, 46, 0.65), rgba(232, 176, 75, 0.6) 38%,
    rgba(31, 111, 106, 0.5) 72%, rgba(212, 85, 46, 0.25));
  filter: blur(0.4px);
  opacity: 0.55;
  pointer-events: none;
}

.hero-title {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 750;
  letter-spacing: 0.2px;
  background: linear-gradient(90deg, var(--accent-deep), var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-eyebrow {
  margin: 0 0 3px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--teal-bright);
}

.hero-text { margin: 0; max-width: 72ch; font-size: 13.5px; color: var(--text-dim); }
.hero-text strong { color: var(--text); }

.hero-cta {
  margin: 8px 0 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent-deep);
}

.hero-tip {
  margin: 9px 0 0;
  padding: 8px 12px;
  border: 1px dashed rgba(212, 85, 46, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(255, 253, 247, 0.65);
  font-size: 12.5px;
  color: var(--text-dim);
}
.hero-tip-label {
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10.5px;
  color: var(--accent-deep);
}

.hero-text a,
.hero-tip a {
  color: var(--teal-bright);
  font-weight: 650;
  text-decoration: none;
  border-bottom: 1px dotted rgba(21, 119, 111, 0.55);
}
.hero-text a:hover { color: #0e5a54; border-bottom-style: solid; }

.hero-sep { color: var(--text-faint); margin: 0 7px; }

.hero-note { color: var(--text-faint); font-size: 12.5px; }
.hero-note code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: 5px;
  padding: 1px 6px;
}

/* ── settings panel (provider / model / key / custom / reasoning) ─────── */

.settings {
  position: relative;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--bg-raised);
  box-shadow: var(--shadow-soft);
  margin-bottom: 18px;
  overflow: hidden;
}

.settings > summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
  padding: 13px 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), transparent);
  transition: color 120ms ease;
}
.settings > summary::-webkit-details-marker { display: none; }
.settings > summary .icon-chevron {
  width: 14px;
  height: 14px;
  margin-right: 8px;
  color: var(--accent);
  transition: transform 140ms ease;
}
.settings[open] > summary .icon-chevron { transform: rotate(90deg); }
.settings > summary:hover { color: var(--text); }

.settings-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(230px, 1.4fr);
  gap: 12px 14px;
  padding: 6px 16px 14px;
}
.field-key { grid-column: 1 / -1; }
.field-reasoning { grid-column: 1 / -1; }

@media (max-width: 620px) {
  .settings-grid { grid-template-columns: 1fr; }
  .field-key, .field-reasoning { grid-column: 1; }
}

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

.field-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  font-weight: 700;
}
.field-label em {
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--text-faint);
}

.field select,
.field input,
.field textarea {
  width: 100%;
  background: #fffef9;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.field select:focus,
.field input:focus,
.field textarea:focus {
  border-color: var(--teal-bright);
  box-shadow: 0 0 0 3px rgba(21, 119, 111, 0.15);
  background: #fff;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-faint); }
.field textarea { resize: vertical; font-size: 12.5px; }

/* custom chevron on the native provider select (keeps Playwright selectOption) */
.select-wrap { position: relative; display: block; }
.select-wrap::after {
  content: "";
  position: absolute;
  right: 13px; top: 50%;
  width: 8px; height: 8px;
  transform: translateY(-70%) rotate(45deg);
  border-right: 2px solid var(--text-faint);
  border-bottom: 2px solid var(--text-faint);
  pointer-events: none;
  transition: border-color 140ms ease;
}
.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  cursor: pointer;
}
.select-wrap:hover::after { border-color: var(--accent); }

.model-row { display: flex; gap: 8px; align-items: stretch; }
.model-row input { flex: 1; }

.btn-small {
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: var(--radius-sm);
}

/* API key row with show/hide toggle */
.key-row { display: flex; gap: 8px; align-items: stretch; }
.key-row input { flex: 1; }
.btn-key-toggle {
  width: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  flex: none;
}
.btn-ghost {
  background: rgba(80, 60, 30, 0.04);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.btn-ghost:hover { color: var(--teal-bright); border-color: var(--teal-bright); background: rgba(21, 119, 111, 0.08); }

/* reasoning knob — segmented pill control */
.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.seg-btn {
  flex: 1;
  min-width: 0;
  padding: 7px 6px;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-dim);
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
  color: #fff8f2;
  background: linear-gradient(135deg, var(--accent), #e2703f);
  box-shadow: 0 2px 10px rgba(212, 85, 46, 0.32);
}

.field-hint {
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.45;
}

/* "API key required" hint under the key field (visible until a key is typed) */
.field-hint-required { color: var(--accent-deep); font-weight: 600; }
.field-hint-required[hidden] { display: none; }

/* reasoning hint with lucide bulb — slides/fades in on every change */
.hint-bulb {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.hint-bulb .icon-bulb {
  margin-top: 1px;
  color: var(--accent);
}
.hint-bulb .hint-text { min-width: 0; }
.hint-bulb.hint-animate {
  animation: hint-in 320ms cubic-bezier(0.2, 0.7, 0.3, 1);
}
@keyframes hint-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

.custom-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px dashed var(--border);
  margin: 0 16px;
  padding: 12px 0 14px;
}
.custom-fields[hidden] { display: none; }

.models-status {
  margin: 0;
  padding: 0 16px 14px;
  font-size: 12.5px;
  color: var(--text-faint);
  min-height: 1.4em;
}
.models-status:not(:empty) { padding-top: 2px; }

.models-status-busy::before {
  content: "";
  display: inline-block;
  width: 10px; height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  vertical-align: -1.5px;
}
.models-status-ok { color: var(--green); }
.models-status-error { color: var(--red); }

/* ── top bar ─────────────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(255, 251, 241, 0.82);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: 0.3px;
  margin: 0;
  background: linear-gradient(100deg, var(--accent-deep), var(--accent) 55%, var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* brand mark — a brush dipping into a dab of paint */
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #3a3226, #211c14);
  border: 1px solid rgba(58, 48, 34, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 2px 6px rgba(80, 60, 30, 0.18);
  position: relative;
  overflow: hidden;
}
.brand-mark::before {
  content: "";
  position: absolute;
  left: 14px; top: -3px;
  width: 5px; height: 19px;
  border-radius: 3px;
  background: linear-gradient(180deg, #eec27a, #dfa94f);
  transform: rotate(36deg);
}
.brand-mark::after {
  content: "";
  position: absolute;
  right: 5px; bottom: 4px;
  width: 11px; height: 11px;
  border-radius: 62% 38% 56% 44%;
  background: radial-gradient(circle at 32% 30%, #ff9a68, #d4552e 70%);
  transform: rotate(-12deg);
}

.topbar-right { display: flex; align-items: center; gap: 14px; }

.topbar-nav { display: flex; align-items: center; gap: 12px; }
.topbar-link {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}
.topbar-link:hover {
  color: var(--accent-deep);
  border-color: rgba(212, 85, 46, 0.35);
  background: var(--accent-soft);
}
.topbar-link:focus-visible {
  outline: 2px solid var(--teal-bright);
  outline-offset: 2px;
}

.sdk-badge {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 11px;
  background: var(--bg-raised);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* ── layout ──────────────────────────────────────────────────────────── */

.layout {
  display: grid;
  grid-template-columns: minmax(380px, 46%) 1fr;
  gap: 20px;
  padding: 24px 28px 8px;
  max-width: 1460px;
  margin: 0 auto;
}

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

.panel {
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
}

.panel-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

/* ── prompt panel ────────────────────────────────────────────────────── */

#prompt {
  width: 100%;
  resize: vertical;
  min-height: 96px;
  background: #fffef9;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.55;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
#prompt:focus {
  border-color: var(--teal-bright);
  box-shadow: 0 0 0 3px rgba(21, 119, 111, 0.13);
}
#prompt::placeholder { color: var(--text-faint); }

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

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(80, 60, 30, 0.07);
  transition: border-color 110ms ease, background 110ms ease, transform 60ms ease,
    opacity 110ms ease, box-shadow 110ms ease;
}
.btn:hover:not(:disabled) {
  border-color: #cdbb97;
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(80, 60, 30, 0.12);
}
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.btn:disabled { opacity: 0.42; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(180deg, #de6033, #c94e26);
  border-color: #bf4a24;
  color: #fff8f2;
  min-width: 128px;
  box-shadow: 0 4px 14px rgba(212, 85, 46, 0.3);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #e86c3e, #d4552e);
  border-color: #b23c1c;
  box-shadow: 0 6px 18px rgba(212, 85, 46, 0.38);
}
.btn-primary.busy {
  background: linear-gradient(180deg, #b64c28, #9e3f20);
  cursor: progress;
  box-shadow: none;
}

.status {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  flex: 1 1 auto;
  min-width: 200px;
}
.status-generating { color: var(--accent-deep); }
.status-ok { color: var(--green); }
.status-error { color: var(--red); }

.status-generating::before {
  content: "";
  display: inline-block;
  width: 11px; height: 11px;
  margin-right: 8px;
  border-radius: 50%;
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  vertical-align: -1.5px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-banner {
  margin-top: 12px;
  padding: 11px 14px;
  border: 1px solid rgba(196, 67, 58, 0.4);
  background: var(--red-soft);
  color: #8c2a22;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  white-space: pre-wrap;
  word-break: break-word;
}

.actions {
  display: flex;
  gap: 9px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* ── preview panel ───────────────────────────────────────────────────── */

.preview-panel { display: flex; flex-direction: column; }

.preview-frame {
  flex: 1;
  min-height: 420px;
  background:
    repeating-conic-gradient(#efe7d4 0% 25%, #f7f1e3 0% 50%) 0 0 / 22px 22px,
    var(--bg-inset);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  position: relative;
  box-shadow: inset 0 1px 5px rgba(80, 60, 30, 0.08);
}

#preview-img {
  max-width: 100%;
  max-height: 560px;
  height: auto;
  filter: drop-shadow(0 12px 26px rgba(80, 60, 30, 0.28));
  animation: appear 260ms ease;
}
@keyframes appear {
  from { opacity: 0; transform: translateY(6px) scale(0.99); }
  to   { opacity: 1; transform: none; }
}

.preview-empty { text-align: center; color: var(--text-faint); }
.preview-empty p { font-size: 13.5px; line-height: 1.6; }

.preview-empty-art {
  width: 84px; height: 84px;
  margin: 0 auto 14px;
  border-radius: 18px 46% 18px 46%;
  border: 2px dashed #cdbb97;
  position: relative;
  background: rgba(255, 255, 255, 0.5);
}
.preview-empty-art::before {
  content: "";
  position: absolute; inset: 20px 24px;
  border-left: 3px solid #c9a86a;
  border-bottom: 3px solid #b3924f;
  transform: rotate(-8deg);
  border-radius: 4px;
}
.preview-empty-art::after {
  content: "";
  position: absolute; right: 10px; bottom: 10px;
  width: 13px; height: 13px;
  border-radius: 62% 38% 56% 44%;
  border: 2.4px solid #d4713f;
}

.preview-meta {
  margin: 10px 2px 0;
  font-size: 12.5px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  min-height: 1.2em;
}

/* ── gallery ─────────────────────────────────────────────────────────── */

.gallery-section {
  max-width: 1460px;
  margin: 0 auto;
  padding: 18px 28px 30px;
}

.gallery-head h2 {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  font-weight: 700;
}
.gallery-head p { margin: 6px 0 14px; color: var(--text-faint); font-size: 13px; }

.gallery-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}
.gallery-loading { color: var(--text-faint); font-size: 13px; }

.gallery-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 110ms ease, transform 110ms ease, box-shadow 110ms ease;
  display: flex;
  flex-direction: column;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  box-shadow: var(--shadow-soft);
}
.gallery-card:hover {
  border-color: rgba(212, 85, 46, 0.45);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}
.gallery-card:focus-visible { outline: 2px solid var(--teal-bright); outline-offset: 2px; }

.gallery-thumb {
  aspect-ratio: 16 / 10;
  background: #fff;
  display: block;
  width: 100%;
  object-fit: contain;
  border-bottom: 1px solid var(--border-soft);
}

.gallery-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.gallery-title { font-size: 14px; font-weight: 700; margin: 0; }
.gallery-desc { font-size: 12.5px; color: var(--text-dim); margin: 0; flex: 1; }

.gallery-run {
  align-self: flex-start;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 650;
  padding: 5px 12px;
  border-radius: 999px;
}
.gallery-run .icon-play { width: 11px; height: 11px; fill: currentColor; stroke: none; }
.gallery-card:hover .gallery-run { border-color: rgba(212, 85, 46, 0.5); background: var(--accent-soft); }

.gallery-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-soft);
}

/* ── footer & sandbox ───────────────────────────────────────────────── */

.foot {
  padding: 14px 28px 22px;
  color: var(--text-faint);
  font-size: 12px;
  text-align: center;
}

.sandbox-frame {
  position: fixed;
  width: 0; height: 0;
  border: 0;
  visibility: hidden;
  left: -10px; bottom: -10px;
}

/* ═══════════════════════════════════════════════════════════════════════
   Chithram AI additions — auth, home cards, gallery/analytics pages,
   my-drawings, badges. Layered on the playground's drawing-studio base. */

/* ── auth CTAs ───────────────────────────────────────────────────────── */

.hero-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

.login-cta {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none;
}
.app-cta { text-decoration: none; display: inline-flex; align-items: center; }

.user-badge {
  font-size: 12.5px; font-weight: 650; color: var(--text-dim);
  border: 1px dashed var(--border); border-radius: 999px;
  padding: 4px 12px; background: var(--bg-raised);
  white-space: nowrap;
}

.btn-danger {
  color: var(--red); border-color: rgba(196, 67, 58, 0.35);
  align-self: flex-start;
}
.btn-danger:hover:not(:disabled) {
  background: var(--red-soft); border-color: var(--red);
}

.share-note {
  margin: 10px 0 0;
  padding: 10px 13px;
  border: 1px solid rgba(63, 138, 73, 0.4);
  background: rgba(63, 138, 73, 0.08);
  color: #2d6636;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.share-note[hidden] { display: none; }

/* ── home page ───────────────────────────────────────────────────────── */

.home-main { max-width: 1460px; margin: 0 auto; padding: 26px 28px 10px; }

.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.home-card {
  display: block;
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  color: inherit;
  transition: transform 110ms ease, box-shadow 110ms ease, border-color 110ms ease;
}
.home-card:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 85, 46, 0.4);
  box-shadow: var(--shadow-lift);
}
.home-card h3 { margin: 0 0 6px; font-size: 15px; color: var(--accent-deep); }
.home-card p { margin: 0; font-size: 13px; color: var(--text-dim); line-height: 1.6; }

.login-note {
  margin: 18px 4px 0;
  padding: 11px 14px;
  border: 1px solid rgba(212, 85, 46, 0.4);
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
}
.login-note[hidden] { display: none; }

/* ── generic page scaffolding (gallery / analytics) ──────────────────── */

.page-main { max-width: 1460px; margin: 0 auto; padding: 26px 28px 20px; }

.page-head h2 {
  margin: 0; font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--text-dim); font-weight: 700;
}
.page-head p { margin: 6px 0 18px; color: var(--text-faint); font-size: 13px; }

.load-more-row { text-align: center; margin: 18px 0 0; }

/* ── my drawings ─────────────────────────────────────────────────────── */

.my-drawings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.drawing-sub {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 2px;
}
.drawing-date { font-size: 11.5px; color: var(--text-faint); font-family: var(--font-mono); }

.badge {
  display: inline-block;
  font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em;
  border-radius: 999px; padding: 2px 9px;
}
.badge-private { color: #7a6a2f; background: rgba(224, 168, 60, 0.18); border: 1px solid rgba(224, 168, 60, 0.4); }
.badge-public { color: #2d6636; background: rgba(63, 138, 73, 0.12); border: 1px solid rgba(63, 138, 73, 0.35); }
.badge-example { color: var(--teal); background: rgba(31, 111, 106, 0.09); border: 1px solid rgba(31, 111, 106, 0.3); }
.badge-contributor { color: var(--accent-deep); background: var(--accent-soft); border: 1px solid rgba(212, 85, 46, 0.3); }

/* ── analytics ───────────────────────────────────────────────────────── */

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}
.stat-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 4px;
}
.stat-value {
  font-size: 30px; font-weight: 800; line-height: 1.1;
  background: linear-gradient(100deg, var(--accent-deep), var(--teal));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-faint); font-weight: 700;
}

.geo-section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); }

.geo-table {
  width: 100%; max-width: 720px;
  border-collapse: collapse;
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.geo-table th, .geo-table td {
  text-align: left; padding: 9px 14px;
  border-bottom: 1px dashed var(--border-soft);
  font-size: 13.5px;
}
.geo-table th {
  color: var(--text-faint); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.08em;
}
.geo-table td:last-child { width: 45%; }
.geo-table tr:last-child td { border-bottom: none; }

.geo-bar {
  display: block; height: 12px; border-radius: 999px;
  background: linear-gradient(90deg, rgba(212, 85, 46, 0.75), rgba(224, 168, 60, 0.75));
  min-width: 4px;
}
