/* ══════════════════════════════════════════════════════════════════════
   Core Design Tokens — Light theme (default)

   Palette primitives (~25 semantic tokens) that every component uses.
   Components reference these tokens directly via the --c-* namespace.
   ══════════════════════════════════════════════════════════════════════ */

:root {
  /* ── Primitive palette ─────────────────────────────────────────────── */

  /* Backgrounds */
  --c-bg: #ffffff;
  --c-bg-alt: #f2fbf6;
  --c-bg-inset: #eaf7f0;
  --c-bg-deep: #d0e8da;

  /* Accent (green) */
  --c-accent: #1abf6a;
  --c-accent-hover: #17ab61;
  --c-accent-dark: #0d8a4a;
  --c-accent-light: #52c98e;
  --c-accent-soft: #7ddaaa;
  --c-accent-wash: #b5ebd0;

  /* Text */
  --c-text: #0d1a12;
  --c-text-secondary: #4a7a5a;
  --c-text-tertiary: #5a8872;
  --c-text-muted: #8aada0;
  --c-text-dim: #6a9a7a;
  --c-text-inverse: #ffffff;
  --c-text-on-accent: #0d1a12;

  /* Borders / Decorative neutrals */
  --c-border: #b5ccc0;
  --c-border-accent: rgba(26, 191, 106, 0.2);

  /* Semantic status */
  --c-error: #e53535;
  --c-error-strong: #b04443;
  --c-error-bg: #ffe8e8;
  --c-error-text: #f87171;
  --c-error-text-alt: #d64045;
  --c-success: #1abf6a;
  --c-success-bg: #e8f8ef;
  --c-warning: #d97706;
  --c-warning-bg: #fef3cd;
  --c-info: #3cc5ee;
  --c-info-bg: #125761;

  /* Special-purpose */
  --c-twitter: #3a90e9;
  --c-twitter-hover: #5cacff;
  --c-subscape: #e4eeee;
  --c-subscape-bg: #315a5a;

  /* ── Shadows ───────────────────────────────────────────────────────── */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md:
    0 2px 12px rgba(26, 191, 106, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-lg:
    0px 16px 16px rgba(0, 33, 30, 0.14), 0px 6px 8px rgba(0, 33, 30, 0.24),
    0px 2px 4px rgba(0, 33, 30, 0.34);
  --shadow-glow: 0 2px 8px rgba(26, 191, 106, 0.35);
  --shadow-glow-sm: 0 2px 8px rgba(26, 191, 106, 0.12);

  /* ── Opacity helpers (accent at different alphas) ──────────────────── */
  --c-accent-a5: rgba(26, 191, 106, 0.05);
  --c-accent-a8: rgba(26, 191, 106, 0.08);
  --c-accent-a10: rgba(26, 191, 106, 0.1);
  --c-accent-a12: rgba(26, 191, 106, 0.12);
  --c-accent-a15: rgba(26, 191, 106, 0.15);
  --c-accent-a18: rgba(26, 191, 106, 0.18);
  --c-accent-a25: rgba(26, 191, 106, 0.25);
  --c-accent-a30: rgba(26, 191, 106, 0.3);
  --c-accent-a35: rgba(26, 191, 106, 0.35);
  --c-accent-a40: rgba(26, 191, 106, 0.4);
  --c-accent-a50: rgba(26, 191, 106, 0.5);
  --c-accent-a60: rgba(26, 191, 106, 0.6);

  --c-white-a12: rgba(255, 255, 255, 0.12);
  --c-white-a18: rgba(255, 255, 255, 0.18);
  --c-white-a25: rgba(255, 255, 255, 0.25);
  --c-white-a28: rgba(255, 255, 255, 0.28);
  --c-white-a35: rgba(255, 255, 255, 0.35);
  --c-white-a40: rgba(255, 255, 255, 0.4);
  --c-white-a50: rgba(255, 255, 255, 0.5);
  --c-white-a75: rgba(255, 255, 255, 0.75);
  --c-white-a85: rgba(255, 255, 255, 0.85);

  --c-black-a45: rgba(0, 0, 0, 0.45);
  --c-black-a50: rgba(0, 0, 0, 0.5);
}

/* ══════════════════════════════════════════════════════════════════════
   Dark theme — override only the primitives; aliases auto-resolve.
   ══════════════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
  /* ── Primitive overrides ───────────────────────────────────────────── */

  /* Backgrounds */
  --c-bg: #161412;
  --c-bg-alt: #161412;
  --c-bg-inset: #211e1b;
  --c-bg-deep: #2e2a26;

  /* Accent (green) */
  --c-accent: #1abf6a;
  --c-accent-hover: #17ab61;
  --c-accent-dark: #17ab5e;
  --c-accent-light: #52c98e;
  --c-accent-soft: #7ddaaa;
  --c-accent-wash: #a8e6c8;

  /* Text */
  --c-text: #f0ede8;
  --c-text-secondary: #9a9690;
  --c-text-tertiary: #5a5650;
  --c-text-muted: #5a5650;
  --c-text-dim: #9a9690;
  --c-text-inverse: #0d1a12;

  /* Borders */
  --c-border: #2e2a26;
  --c-border-accent: rgba(255, 255, 255, 0.07);

  /* Semantic status */
  --c-error: #ff5555;
  --c-error-strong: #ff5555;
  --c-error-bg: rgba(255, 85, 85, 0.15);
  --c-error-text: #ff6b6b;
  --c-error-text-alt: #ff5555;
  --c-success: #1abf6a;
  --c-success-bg: rgba(26, 191, 106, 0.15);
  --c-warning: #1abf6a;
  --c-warning-bg: rgba(26, 191, 106, 0.15);

  /* Shadows (flatten in dark) */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 2px 12px rgba(0, 0, 0, 0.6), 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-lg: var(--shadow-md);
  --shadow-glow: none;
  --shadow-glow-sm: none;

  /* Opacity helpers */
  --c-black-a45: rgba(0, 0, 0, 0.65);
  --c-black-a50: rgba(0, 0, 0, 0.6);
}

/* ══════════════════════════════════════════════════════════════════════
   Base reset & layout
   ══════════════════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
  width: 0px;
  background: transparent;
}

body {
  margin: 0;
  font-family:
    "Geist",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    sans-serif;
  position: relative;
  color: var(--c-text);
  font-size: 16px;
  background-color: var(--c-bg-alt);
}

html,
body,
#qwal-root {
  height: 100%;
  width: 100%;
}

body.popup {
  width: 384px;
  min-height: 594px;
  scrollbar-width: none;
  overflow: hidden; /* all scrolling is done internally */
}

a {
  text-decoration: none;
}

button {
  all: unset;
  cursor: pointer;
}

input,
textarea {
  all: unset;
  cursor: text;
}

ul,
li {
  all: unset;
  list-style-type: none;
}

form {
  all: inherit;
  padding: 0;
}

* {
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  -font-smoothing: antialiased;
}

.standard_width {
  width: 352px;
}

.standard_width_padded {
  width: 352px;
  padding: 0px 8px;
  box-sizing: border-box;
}

.center_horizontal {
  margin: 0 auto;
}

.center_text {
  text-align: center;
}

label {
  display: flex;
  flex-direction: column;
  line-height: 27px;
  margin-top: -5.5px;
}

.label {
  color: var(--c-text);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.42px;
  display: flex;
  justify-content: space-between;
}

.hide {
  opacity: 0;
  pointer-events: none;
}

.no_click {
  pointer-events: none;
}

.divider {
  width: 80%;
  height: 2px;
  opacity: 60%;
  background-color: var(--c-bg-alt);
}

.simple_text {
  color: var(--c-text-tertiary);
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
}

.ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ellipsis_multiline {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
@supports (-webkit-line-clamp: 2) {
  .ellipsis_multiline {
    white-space: initial;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

.fade_in {
  animation: fade-in ease-in var(--fade-in-duration, 250ms);
}

@keyframes fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.fade_out {
  animation: fade-out ease-out var(--fade-out-duration, 250ms);
  opacity: 0;
}

@keyframes fade-out {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
