/* ==========================================================================
   MyBeauty — dark theme design tokens
   Deep aubergine-black base, marigold/rose/violet jewel accents that glow
   against dark instead of sitting on a pale background — same festive
   Bengali palette as before, inverted for a premium, animated dark UI.
   ========================================================================== */

:root {
  --bg: #150C16;
  --bg-alt: #1B1019;
  --surface: #221530;
  --surface-soft: #2C1B36;
  --surface-line: rgba(240, 187, 62, 0.14);
  --surface-line-strong: rgba(240, 187, 62, 0.28);

  --ink: #F5ECE0;
  --ink-72: rgba(245, 236, 224, 0.72);
  --ink-45: rgba(245, 236, 224, 0.45);

  --marigold: #F0BB3E;
  --marigold-deep: #C9932A;
  --rose: #E0785C;
  --violet-glow: #9D4F9A;
  --danger: #E8836A;

  --font-display: 'Tiro Bangla', 'Noto Serif Bengali', serif;
  --font-body: 'Hind Siliguri', 'Noto Sans Bengali', sans-serif;

  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --tabbar-h: 68px;
  --topbar-h: 58px;

  --ease: cubic-bezier(.22, .8, .32, 1);
}

/* ==========================================================================
   Reset & base
   ========================================================================== */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }
a { color: var(--marigold); }

:focus-visible {
  outline: 2.5px solid var(--marigold);
  outline-offset: 2px;
  border-radius: 6px;
}

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

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  overflow: hidden;
}

@media (min-width: 720px) {
  .app {
    max-width: 640px;
    min-height: 100dvh;
    border-inline: 1px solid var(--surface-line);
  }
}

/* ==========================================================================
   Ambient dark-theme glow — decorative, fixed behind all content
   ========================================================================== */

.bg-glow {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.bg-glow__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(58px);
  opacity: 0.28;
}
.bg-glow__orb--1 {
  width: 260px; height: 260px;
  background: var(--marigold);
  top: -70px; left: -70px;
  animation: drift1 24s ease-in-out infinite alternate;
}
.bg-glow__orb--2 {
  width: 300px; height: 300px;
  background: var(--violet-glow);
  bottom: 8%; right: -110px;
  animation: drift2 28s ease-in-out infinite alternate;
}
.bg-glow__orb--3 {
  width: 200px; height: 200px;
  background: var(--rose);
  top: 42%; left: 45%;
  animation: drift3 32s ease-in-out infinite alternate;
  opacity: 0.18;
}
@keyframes drift1 { from { transform: translate(0,0) scale(1); } to { transform: translate(50px, 70px) scale(1.2); } }
@keyframes drift2 { from { transform: translate(0,0) scale(1); } to { transform: translate(-60px, -40px) scale(1.12); } }
@keyframes drift3 { from { transform: translate(-50%,-50%) scale(1); } to { transform: translate(-42%,-56%) scale(1.25); } }

.topbar, .views, .tabbar { position: relative; z-index: 1; }

/* ==========================================================================
   Top bar
   ========================================================================== */

.topbar {
  height: var(--topbar-h);
  padding: 0 18px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(21, 12, 22, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--surface-line);
}

.topbar__brand { display: flex; align-items: center; gap: 8px; }
.topbar__mark { display: flex; align-items: center; }
.mark-dot { animation: mark-glow 3s ease-in-out infinite; transform-origin: center; }
@keyframes mark-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: .6; }
}
.topbar__word {
  font-family: var(--font-display);
  font-size: 20px;
  font-style: italic;
  color: var(--ink);
  letter-spacing: 0.2px;
}

/* ==========================================================================
   Views
   ========================================================================== */

.views { position: relative; }
.view { padding: 0 20px 56px; }
.view--flush { padding: 0; }

.section-eyebrow {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--rose);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.section-title {
  font-size: clamp(22px, 5.5vw, 27px);
  color: var(--ink);
  font-style: italic;
  line-height: 1.35;
}
.page-head { padding: 26px 0 18px; }
.page-head__sub { margin-top: 10px; color: var(--ink-45); font-size: 15px; }

/* ==========================================================================
   Reveal-on-scroll
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   Icon animation utilities — applied across every icon in the app
   ========================================================================== */

.icon-draw > * {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
}
.reveal.is-visible .icon-draw > *,
.is-visible .icon-draw > * {
  animation: icon-draw-in .8s var(--ease) forwards;
}
.icon-draw > *:nth-child(1) { animation-delay: 0s; }
.icon-draw > *:nth-child(2) { animation-delay: .07s; }
.icon-draw > *:nth-child(3) { animation-delay: .14s; }
.icon-draw > *:nth-child(4) { animation-delay: .21s; }
.icon-draw > *:nth-child(5) { animation-delay: .28s; }
@keyframes icon-draw-in { to { stroke-dashoffset: 0; } }

.icon-pulse {
  animation: icon-pulse-loop 2.2s ease-in-out infinite;
  transform-origin: center;
}
@keyframes icon-pulse-loop {
  0%, 100% { transform: scale(1); opacity: .85; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes nav-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.3) rotate(-4deg); }
  100% { transform: scale(1) rotate(0); }
}
.tabbar__item.just-activated .icon-nav { animation: nav-pop .45s var(--ease); }

@keyframes send-fly {
  0% { transform: translate(0,0) rotate(0); opacity: 1; }
  45% { transform: translate(14px,-12px) rotate(20deg); opacity: 0; }
  55% { transform: translate(-14px,12px) rotate(20deg); opacity: 0; }
  100% { transform: translate(0,0) rotate(0); opacity: 1; }
}
#sendIcon.flying { animation: send-fly .55s var(--ease); }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15.5px;
  padding: 13px 22px;
  border-radius: 999px;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.btn:active { transform: scale(0.97); }

.btn--gold {
  background: linear-gradient(135deg, var(--marigold), var(--marigold-deep));
  color: #241206;
  box-shadow: 0 0 0 1px rgba(240,187,62,.3), 0 14px 30px -12px rgba(240, 187, 62, 0.45);
}
.btn--gold:hover { box-shadow: 0 0 0 1px rgba(240,187,62,.5), 0 16px 32px -10px rgba(240, 187, 62, 0.6); }

.btn--ghost {
  background: rgba(245, 236, 224, 0.08);
  color: var(--ink);
  border: 1.5px solid rgba(245, 236, 224, 0.25);
}
.btn--ghost:hover { background: rgba(245, 236, 224, 0.14); }

.btn--outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--surface-line-strong);
}
.btn--outline:hover { background: rgba(240, 187, 62, 0.08); }

.btn--full { width: 100%; margin-top: 18px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  margin: 0 -20px 40px;
  padding: 38px 24px 40px;
  background: radial-gradient(120% 140% at 15% 0%, var(--surface-soft) 0%, var(--surface) 46%, var(--bg-alt) 100%);
  color: var(--ink);
  border-radius: 0 0 32px 32px;
  border-bottom: 1px solid var(--surface-line);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.hero__art {
  width: 100%;
  max-width: 320px;
  height: auto;
  color: var(--marigold);
  margin: 0 auto 6px;
  display: block;
}
.hero__art .art-path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 480;
  stroke-dashoffset: 480;
}
.hero__art.draw .art-path { animation: draw-line 1.6s var(--ease) forwards, art-shimmer 3.5s ease-in-out 2.2s infinite; }
.hero__art.draw .art-path:nth-of-type(2) { animation-delay: .18s, 2.4s; }
.hero__art.draw .art-path:nth-of-type(3) { animation-delay: .4s, 2.6s; }
.hero__art.draw .art-path:nth-of-type(4) { animation-delay: .55s, 2.8s; }
.hero__art.draw .art-path:nth-of-type(5) { animation-delay: .62s, 3s; }
.hero__art .art-dot { fill: var(--marigold); opacity: 0; }
.hero__art.draw .art-dot { animation: dot-in .5s var(--ease) forwards, icon-pulse-loop 2.4s ease-in-out 1.6s infinite; animation-delay: 1.35s, 1.6s; }
@keyframes draw-line { to { stroke-dashoffset: 0; } }
@keyframes dot-in { to { opacity: 1; } }
@keyframes art-shimmer {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

.hero__eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--marigold);
  font-size: 14px;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.hero__title {
  font-size: clamp(28px, 8vw, 38px);
  line-height: 1.28;
  margin-bottom: 14px;
}
.hero__sub {
  color: var(--ink-72);
  font-size: 15.5px;
  max-width: 40ch;
  margin: 0 auto 26px;
}
.hero__cta { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.hero__cta .btn { width: 100%; max-width: 320px; }

@media (min-width: 480px) {
  .hero__cta { flex-direction: row; justify-content: center; }
  .hero__cta .btn { width: auto; }
}

/* ==========================================================================
   Pillars
   ========================================================================== */

.pillars { padding: 6px 0 12px; text-align: center; }
.pillars__grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  text-align: left;
}

.pillar-card {
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease);
}
.pillar-card:hover {
  transform: translateY(-3px);
  border-color: var(--surface-line-strong);
  box-shadow: 0 14px 30px -18px rgba(240, 187, 62, 0.35);
}
.pillar-card:active { transform: translateY(-1px) scale(0.99); }

.pillar-card__icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--surface-soft);
  color: var(--rose);
}
.pillar-card__title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16.5px;
  color: var(--ink);
}
.pillar-card__blurb { font-size: 13px; color: var(--ink-45); line-height: 1.5; }

/* ==========================================================================
   Manifesto
   ========================================================================== */

.manifesto {
  margin-top: 44px;
  padding: 30px 22px;
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-lg);
  text-align: center;
}
.manifesto__text {
  color: var(--ink-72);
  font-size: 15.5px;
  max-width: 46ch;
  margin: 0 auto 14px;
}
.manifesto__cta { margin-top: 18px; }

.foot {
  text-align: center;
  padding: 34px 0 8px;
  color: var(--ink-45);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
}

/* ==========================================================================
   Guide accordions
   ========================================================================== */

.accordions { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }

.acc {
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.acc__head {
  padding: 16px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  color: var(--ink);
  list-style: none;
}
.acc__head::-webkit-details-marker { display: none; }
.acc__chev { transition: transform .25s var(--ease); color: var(--marigold); font-family: var(--font-body); }
.acc[open] .acc__chev { transform: rotate(180deg); }

.acc__list { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 11px; }
.acc__list li {
  position: relative;
  padding-left: 20px;
  font-size: 14.5px;
  color: var(--ink-72);
  line-height: 1.6;
}
.acc__list li::before {
  content: "";
  position: absolute;
  left: 0; top: 8px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--marigold);
}

.acc--about { margin-top: 14px; }
.about-body { padding: 0 18px 18px; }
.about-body p { color: var(--ink-72); font-size: 13.5px; margin-bottom: 10px; line-height: 1.65; }
.about-body strong { color: var(--ink); }

.guide-cta {
  margin-top: 30px;
  padding: 26px 20px;
  text-align: center;
  background: radial-gradient(120% 140% at 85% 0%, var(--surface-soft), var(--surface));
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-lg);
  color: var(--ink);
}
.guide-cta p { margin-bottom: 14px; font-family: var(--font-display); font-style: italic; font-size: 17px; }

/* ==========================================================================
   Mentor chat
   ========================================================================== */

.chat {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--topbar-h) - var(--tabbar-h) - env(safe-area-inset-bottom));
}

.chat__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--surface-line);
}
.chat__avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--surface-soft), var(--surface));
  border: 1px solid var(--surface-line-strong);
  color: var(--marigold);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  flex-shrink: 0;
}
.chat__name { font-family: var(--font-display); font-style: italic; color: var(--ink); font-size: 16.5px; }
.chat__badge {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--rose);
  background: rgba(224, 120, 92, 0.14);
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}
.chat__status { font-size: 12.5px; color: var(--ink-45); margin-top: 2px; }
.chat__status.is-ready { color: var(--marigold); }

.chat__log {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}

.bubble {
  max-width: 82%;
  padding: 12px 15px;
  border-radius: 18px;
  font-size: 14.8px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble--assistant {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--surface-line);
  color: var(--ink);
  border-bottom-left-radius: 6px;
}
.bubble--user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--marigold), var(--marigold-deep));
  color: #241206;
  font-weight: 500;
  border-bottom-right-radius: 6px;
}
.bubble--typing { display: flex; gap: 5px; align-items: center; padding: 14px 16px; }
.bubble--typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--rose);
  opacity: .5;
  animation: typing-bounce 1.1s ease infinite;
}
.bubble--typing span:nth-child(2) { animation-delay: .15s; }
.bubble--typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat__chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 20px 12px;
  -webkit-overflow-scrolling: touch;
}
.chat__chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  border: 1px solid var(--surface-line-strong);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s ease, transform .15s ease;
}
.chip:hover { background: var(--surface-soft); transform: translateY(-1px); }

.chat__form {
  display: flex;
  gap: 10px;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--surface-line);
  background: var(--bg);
}
.chat__input {
  flex: 1;
  border: 1.5px solid var(--surface-line-strong);
  background: var(--bg-alt);
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 15px;
  font-family: var(--font-body);
  color: var(--ink);
}
.chat__input:focus-visible { border-color: var(--marigold); }
.chat__input::placeholder { color: var(--ink-45); }
.chat__send {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--marigold), var(--marigold-deep));
  color: #241206;
  display: grid; place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .15s var(--ease);
}
.chat__send:active { transform: scale(0.92); }
.chat__send:disabled { opacity: .5; cursor: not-allowed; }

/* ==========================================================================
   Camera
   ========================================================================== */

.camera-frame {
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-lg);
  padding: 22px;
  text-align: center;
}

.camera-visor {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  max-width: 320px;
  margin: 0 auto 20px;
  border-radius: 22px;
  overflow: hidden;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--surface-soft);
  box-shadow: 0 0 0 2px rgba(240, 187, 62, 0.3);
}
.camera-visor video,
.camera-visor img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  display: none;
}
.camera-orb {
  color: var(--marigold);
  display: none;
}
.camera-spinner-overlay {
  position: absolute; inset: 0;
  background: rgba(21, 12, 22, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
}
.spinner {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(245, 236, 224, 0.2);
  border-top-color: var(--marigold);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.camera-frame[data-stage="idle"] .camera-orb { display: flex; }
.camera-frame[data-stage="live"] .camera-visor video { display: block; }
.camera-frame[data-stage="captured"] .camera-visor img,
.camera-frame[data-stage="analyzing"] .camera-visor img,
.camera-frame[data-stage="result"] .camera-visor img { display: block; }
.camera-frame[data-stage="analyzing"] .camera-spinner-overlay { display: flex; }

.camera-controls { display: none; }
.camera-frame[data-stage="idle"] .camera-controls--idle,
.camera-frame[data-stage="live"] .camera-controls--live,
.camera-frame[data-stage="captured"] .camera-controls--captured,
.camera-frame[data-stage="analyzing"] .camera-controls--analyzing,
.camera-frame[data-stage="result"] .camera-controls--result { display: block; }

.camera-note { margin-top: 14px; font-size: 12.5px; color: var(--ink-45); max-width: 32ch; margin-inline: auto; }
.camera-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.camera-controls--analyzing p { color: var(--ink-72); font-size: 14.5px; }

.result-card {
  background: var(--surface-soft);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: left;
  margin-bottom: 16px;
}
.result-card__title {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--marigold);
  font-size: 15.5px;
  margin-bottom: 8px;
}
#cameraResult { font-size: 14.5px; color: var(--ink); line-height: 1.65; white-space: pre-wrap; }

.camera-status {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-72);
  min-height: 1em;
}
.camera-status.is-error { color: var(--danger); font-weight: 600; }

/* ==========================================================================
   Settings
   ========================================================================== */

.provider-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.provider-pills::-webkit-scrollbar { display: none; }
.provider-pill {
  flex-shrink: 0;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--surface-line-strong);
  background: var(--surface);
  color: var(--ink-72);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .2s var(--ease);
}
.provider-pill.is-active {
  background: linear-gradient(135deg, var(--marigold), var(--marigold-deep));
  color: #241206;
  border-color: transparent;
  transform: translateY(-1px);
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 16px;
}

.provider-panel { display: none; animation: panel-in .35s var(--ease); }
.settings-card[data-provider="openrouter"] .provider-panel[data-panel="openrouter"],
.settings-card[data-provider="claude"] .provider-panel[data-panel="claude"],
.settings-card[data-provider="gemini"] .provider-panel[data-panel="gemini"],
.settings-card[data-provider="openai"] .provider-panel[data-panel="openai"] { display: block; }
@keyframes panel-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-72);
  margin: 16px 0 6px;
}
.field-label:first-child { margin-top: 0; }
.field-input {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--surface-line-strong);
  color: var(--ink);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 14.5px;
  font-family: var(--font-body);
}
.field-input::placeholder { color: var(--ink-45); }
.field-input:focus-visible { border-color: var(--marigold); }

.key-row { display: flex; gap: 8px; align-items: center; }
.key-row .field-input { flex: 1; }
.key-toggle {
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid var(--surface-line-strong);
  background: var(--bg-alt);
  color: var(--ink-45);
  display: grid; place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color .2s ease, border-color .2s ease;
}
.key-toggle:hover, .key-toggle.is-shown { color: var(--marigold); border-color: var(--surface-line-strong); }

.field-help { font-size: 12px; color: var(--ink-45); margin-top: 6px; line-height: 1.6; }
.field-help code { background: rgba(240, 187, 62, 0.12); padding: 1px 5px; border-radius: 5px; color: var(--marigold); }

.field-warn {
  display: flex; gap: 7px; align-items: flex-start;
  font-size: 12px; color: var(--rose);
  background: rgba(224, 120, 92, 0.1);
  border: 1px solid rgba(224, 120, 92, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 12px;
  line-height: 1.6;
}
.field-warn svg { flex-shrink: 0; margin-top: 2px; }
.field-warn code { background: rgba(224, 120, 92, 0.16); padding: 1px 5px; border-radius: 5px; }

.settings-divider { height: 1px; background: var(--surface-line); margin: 22px 0; }

.field-range {
  width: 100%;
  margin-top: 10px;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 999px;
  background: var(--surface-line-strong);
  outline: none;
}
.field-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--marigold);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--marigold);
  cursor: pointer;
}
.field-range::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--marigold);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--marigold);
  cursor: pointer;
}

.save-flash {
  font-size: 12.5px;
  color: var(--marigold);
  opacity: 0;
  transition: opacity .3s ease;
  margin-top: 16px;
  text-align: center;
}
.save-flash.show { opacity: 1; }

/* ==========================================================================
   Bottom tab bar
   ========================================================================== */

.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 560px;
  margin: 0 auto;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(27, 16, 25, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--surface-line);
  display: flex;
  z-index: 30;
}
@media (min-width: 720px) { .tabbar { max-width: 640px; } }

.tabbar__item {
  flex: 1;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--ink-45);
  font-size: 10.5px;
  cursor: pointer;
  transition: color .18s var(--ease);
}
.tabbar__item.is-active { color: var(--ink); }
.tabbar__item.is-active .icon-nav { stroke: var(--marigold); filter: drop-shadow(0 2px 5px rgba(240,187,62,.45)); }

/* ==========================================================================
   Wider screens
   ========================================================================== */

@media (min-width: 560px) {
  .pillars__grid { grid-template-columns: repeat(3, 1fr); }
}
