:root {
  --blue: #146EF5;
  --blue-hover: #0F5AD1;
  --dark: #071A33;
  --dark-2: #0D2342;
  --success: #16B364;
  --white: #FFFFFF;
  --surface: #FFFFFF;
  --bg: #F5F7FA;
  --text: #101828;
  --muted: #667085;
  --border: #E4E7EC;
  --accent: #7C3AED;
  --danger: #F04438;
  --warn: #F79009;
  --sidebar-bg: #071A33;
  --sidebar-text: rgba(255, 255, 255, 0.78);
  --sidebar-text-active: #FFFFFF;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 22px;
  --shadow: 0 12px 40px rgba(16, 24, 40, 0.07);
  --shadow-sm: 0 4px 14px rgba(16, 24, 40, 0.05);
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --header: 72px;
  --bottom-nav: 68px;
  --container: 1160px;
  --ease: 220ms ease;
}

[data-theme="dark"] {
  --surface: #0D2342;
  --bg: #071A33;
  --text: #F2F4F7;
  --muted: #98A2B3;
  --border: #1D334F;
  --dark: #071A33;
  --dark-2: #0D2342;
  --sidebar-bg: #050F1F;
  --sidebar-text: rgba(255, 255, 255, 0.78);
  --sidebar-text-active: #FFFFFF;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after { box-sizing: border-box; }

/* Author display:grid/flex must not override the HTML hidden attribute */
[hidden] {
  display: none !important;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--blue);
  color: #fff;
  padding: 0.75rem 1rem;
}
.skip-link:focus { left: 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background var(--ease), color var(--ease), border-color var(--ease), transform var(--ease), box-shadow var(--ease), opacity var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: 0.55; pointer-events: none; }
.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.btn-lg { min-height: 54px; padding: 0.85rem 1.4rem; }
.btn-sm { min-height: 40px; padding: 0.45rem 0.9rem; font-size: 0.88rem; }
.btn-block { width: 100%; }
.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 22px rgba(20, 110, 245, 0.28);
}
.btn-primary:hover { background: var(--blue-hover); }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-dark {
  background: var(--dark);
  color: #fff;
}
.btn-success { background: var(--success); color: #fff; }

/* Forms */
.field { display: grid; gap: 0.4rem; }
.field label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}
.field input,
.field select {
  width: 100%;
  min-height: 50px;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(20, 110, 245, 0.12);
}

.range {
  width: 100%;
  accent-color: var(--blue);
}

/* Chips / badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-blue { background: rgba(20, 110, 245, 0.1); color: var(--blue); }
.badge-green { background: rgba(22, 179, 100, 0.12); color: var(--success); }
.badge-hit { background: #FFF4E5; color: #B54708; }
.badge-dark { background: var(--dark); color: #fff; }
.badge-purple { background: rgba(124, 58, 237, 0.1); color: var(--accent); }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chip {
  min-height: 38px;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all var(--ease);
}
.chip.is-active,
.chip:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(20, 110, 245, 0.06);
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* Toast */
.toast-host {
  position: fixed;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 90;
  display: grid;
  gap: 0.5rem;
  width: min(360px, calc(100vw - 2rem));
}
.toast {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--dark);
  color: #fff;
  box-shadow: var(--shadow);
  animation: toastIn 0.28s ease;
  font-size: 0.92rem;
  font-weight: 500;
}
.toast.ok { background: #0B5C3A; }
.toast.err { background: #912018; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 26, 51, 0.5);
  backdrop-filter: blur(4px);
  z-index: 70;
  display: grid;
  place-items: end center;
  padding: 0;
  animation: fadeIn 0.2s ease;
}
@media (min-width: 720px) {
  .modal-backdrop { place-items: center; padding: 1.5rem; }
}
.modal {
  width: min(560px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  padding: 1.25rem;
  animation: sheetUp 0.28s ease;
  box-shadow: var(--shadow);
}
@media (min-width: 720px) {
  .modal {
    border-radius: 20px;
    padding: 1.5rem;
    animation: fadeIn 0.22s ease;
  }
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.modal-head h3 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  display: grid;
  place-items: center;
  color: var(--text);
}
[data-theme="dark"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.65);
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes sheetUp {
  from { transform: translateY(24px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

/* Skeleton */
.skel {
  background: linear-gradient(90deg, #EAECF0 25%, #F2F4F7 37%, #EAECF0 63%);
  background-size: 400% 100%;
  animation: skel 1.2s ease infinite;
  border-radius: 10px;
}
@keyframes skel {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* Phone visual */
.phone-frame {
  width: 180px;
  height: 360px;
  border-radius: 36px;
  padding: 10px;
  background: linear-gradient(160deg, #1a2b45, #071A33);
  box-shadow: var(--shadow);
  position: relative;
}
.phone-screen {
  height: 100%;
  border-radius: 28px;
  background:
    radial-gradient(circle at 30% 20%, rgba(20, 110, 245, 0.35), transparent 45%),
    linear-gradient(165deg, #0c1f3a, #071018);
  display: flex;
  flex-direction: column;
  padding: 1.2rem 1rem;
  color: #fff;
}
.phone-notch {
  width: 72px;
  height: 18px;
  border-radius: 999px;
  background: #050b14;
  margin: 0 auto 1rem;
}

.profit-up { color: var(--success); font-weight: 700; }

.disclaimer-box {
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid #FEE4E2;
  background: #FEF3F2;
  color: #912018;
  font-size: 0.92rem;
}
[data-theme="dark"] .disclaimer-box {
  background: rgba(240, 68, 56, 0.12);
  border-color: rgba(240, 68, 56, 0.3);
  color: #FDA29B;
}

.empty {
  text-align: center;
  padding: 2.5rem 1.25rem;
  color: var(--muted);
}
.empty h3 {
  margin: 0 0 0.5rem;
  color: var(--text);
}

.error-box {
  text-align: center;
  padding: 2rem 1rem;
}
.error-box h3 { margin: 0 0 0.5rem; }

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