/* InvestiNode — letisztult, "Apple vibe" felület, világos/sötét témával */

@view-transition {
  navigation: auto;
}

/* A fő fülek és a Posztok-oldali fiókszűrők aktív jelölője lapváltáskor
   egyik pozícióból a másikba "csúszik", nem csak felvillan — a böngésző
   natív, azonos nevű elem közti (view-transition) animációjával. */
::view-transition-group(nav-tab-pill),
::view-transition-group(person-tab-pill) {
  animation-duration: 0.35s;
  animation-timing-function: var(--ease-spring);
}

::view-transition-new(nav-tab-pill),
::view-transition-new(person-tab-pill),
::view-transition-old(nav-tab-pill),
::view-transition-old(person-tab-pill) {
  animation-duration: 0.35s;
}

:root {
  --bg: #f2f2f7;
  --bg-elevated: #ffffff;
  --card: rgba(255, 255, 255, 0.72);
  --card-solid: #ffffff;
  --border: rgba(60, 60, 67, 0.12);
  --text: #1c1c1e;
  --text-secondary: #6e6e73;
  --text-tertiary: #8e8e93;
  --accent: #007aff;
  --accent-2: #5856d6;
  --green: #34c759;
  --red: #ff3b30;
  --yellow: #ff9f0a;
  --gray: #8e8e93;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.06), 0 16px 40px rgba(0, 0, 0, 0.10);
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.25, 0.8, 0.25, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #000000;
  --bg-elevated: #1c1c1e;
  --card: rgba(28, 28, 30, 0.72);
  --card-solid: #1c1c1e;
  --border: rgba(255, 255, 255, 0.12);
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #8e8e93;
  --accent: #0a84ff;
  --accent-2: #5e5ce6;
  --green: #30d158;
  --red: #ff453a;
  --yellow: #ffd60a;
  --gray: #98989d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4), 0 20px 48px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-elevated: #1c1c1e;
    --card: rgba(28, 28, 30, 0.72);
    --card-solid: #1c1c1e;
    --border: rgba(255, 255, 255, 0.12);
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #8e8e93;
    --accent: #0a84ff;
    --accent-2: #5e5ce6;
    --green: #30d158;
    --red: #ff453a;
    --yellow: #ffd60a;
    --gray: #98989d;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4), 0 20px 48px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

::selection { background: var(--accent); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 100px;
  border: 2px solid var(--bg);
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); background-clip: padding-box; }

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 64px;
}

/* Header */

header.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
  animation: fade-in 0.5s var(--ease);
}

.topbar-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex: none;
}

.brand .short { display: none; }

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.5);
  animation: pulse-dot 2.4s ease-out infinite;
  flex: none;
}

.brand-dot.offline { background: var(--gray); animation: none; }

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 55%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

nav.tabs {
  display: flex;
  gap: 4px;
  margin-left: 4px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

nav.tabs::-webkit-scrollbar { display: none; }

nav.tabs a {
  padding: 7px 14px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  flex: none;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.2s var(--ease-spring);
}

nav.tabs a:hover { background: var(--border); color: var(--text); transform: translateY(-1px); }
nav.tabs a:active { transform: scale(0.94); }
nav.tabs a.active {
  background: var(--accent);
  color: #fff;
  animation: tab-pop 0.3s var(--ease-spring);
  view-transition-name: nav-tab-pill;
}

@keyframes tab-pop {
  0% { transform: scale(0.85); }
  50% { transform: scale(1.1); }
  75% { transform: scale(0.97); }
  100% { transform: scale(1); }
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex: none;
}

.theme-toggle {
  width: 46px;
  height: 28px;
  border-radius: 100px;
  background: var(--border);
  border: none;
  position: relative;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.3s var(--ease);
}

.theme-toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.35s var(--ease-spring);
}

:root[data-theme="dark"] .theme-toggle::after { transform: translateX(18px); }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s var(--ease);
  box-shadow: var(--shadow);
}

.avatar:hover { transform: scale(1.07); }
.avatar:active { transform: scale(0.96); }

/* Page transitions */

main { animation: rise-in 0.5s var(--ease) both; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes card-rise-in {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

h1.page-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 28px 0 4px;
}

p.page-sub {
  color: var(--text-secondary);
  margin: 0 0 24px;
  font-size: 15px;
}

/* Cards */

.card {
  background: var(--card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease), background-color 0.4s var(--ease), border-color 0.4s var(--ease);
  animation: card-rise-in 1.2s var(--ease-smooth) both;
}

.card:hover { box-shadow: var(--shadow-lg); }

.card:nth-of-type(1) { animation-delay: 0.05s; }
.card:nth-of-type(2) { animation-delay: 0.25s; }
.card:nth-of-type(3) { animation-delay: 0.45s; }
.card:nth-of-type(4) { animation-delay: 0.65s; }
.card:nth-of-type(5) { animation-delay: 0.85s; }
.card:nth-of-type(6) { animation-delay: 1.05s; }

.card h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

.section-icon { margin-right: 6px; }

/* Price grid */

.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.price-tile {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s var(--ease);
  animation: card-rise-in 1.0s var(--ease-smooth) both;
}

.price-tile {
  cursor: pointer;
}

.price-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.price-tile:active { transform: translateY(-1px) scale(0.98); }
.price-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.price-grid .price-tile:nth-child(1) { animation-delay: 0.05s; }
.price-grid .price-tile:nth-child(2) { animation-delay: 0.24s; }
.price-grid .price-tile:nth-child(3) { animation-delay: 0.43s; }
.price-grid .price-tile:nth-child(4) { animation-delay: 0.62s; }
.price-grid .price-tile:nth-child(5) { animation-delay: 0.81s; }
.price-grid .price-tile:nth-child(6) { animation-delay: 1.00s; }

.price-tile .sym { font-size: 13px; font-weight: 700; color: var(--text-secondary); letter-spacing: 0.02em; }
.price-tile .name { font-size: 12px; color: var(--text-tertiary); margin-bottom: 8px; }
.price-tile .val { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.price-tile .val.flash { animation: flash-up 0.6s var(--ease); }
.day-change { font-size: 11.5px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }

.sparkline {
  width: 100%;
  height: 30px;
  margin: 8px 0 2px;
  display: block;
  overflow: visible;
}

.sparkline polyline {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.sparkline.trend-up polyline { stroke: var(--green); }
.sparkline.trend-down polyline { stroke: var(--red); }
.sparkline.trend-flat polyline { stroke: var(--text-tertiary); }

@keyframes flash-up {
  0% { color: var(--green); }
  100% { color: var(--text); }
}

.badge-type {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 100px;
  margin-top: 8px;
  background: var(--border);
  color: var(--text-secondary);
}

/* Napi mozgások */

.movers-list { display: flex; flex-direction: column; }

.mover-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 0.15s var(--ease);
  border-radius: var(--radius-sm);
}
.mover-row:last-child { border-bottom: none; }
.mover-row:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }

.mover-rank {
  flex: none;
  width: 20px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-tertiary);
}
.mover-sym { flex: none; width: 56px; font-weight: 700; font-size: 13.5px; }
.mover-name { flex: 1; min-width: 0; color: var(--text-tertiary); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mover-price { flex: none; font-size: 13.5px; color: var(--text-secondary); }
.mover-change { flex: none; width: 76px; text-align: right; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }

/* Fiókok pontossága */

.track-record-list { display: flex; flex-direction: column; }

.track-row {
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}
.track-row:last-child { border-bottom: none; }

.track-who { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.track-name { font-weight: 700; font-size: 14px; }
.track-handle { color: var(--text-tertiary); font-size: 12.5px; }
.track-stats { display: flex; gap: 6px; flex-wrap: wrap; }

/* Alerts list */

.alert-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  animation: card-rise-in 0.95s var(--ease-smooth) both;
}

.alert-item:last-child { border-bottom: none; }

.action-badge {
  flex: none;
  width: 62px;
  height: 28px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.01em;
}

.action-BUY { background: var(--green); }
.action-SELL { background: var(--red); }
.action-WATCH { background: var(--yellow); color: #3a2a00; }
.action-IGNORE { background: var(--gray); }

.alert-body { flex: 1; min-width: 0; }
.alert-who { font-weight: 700; font-size: 14px; }
.alert-quote { color: var(--text-secondary); font-size: 13.5px; margin: 3px 0; overflow-wrap: break-word; }
.alert-meta { color: var(--text-tertiary); font-size: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.alert-symbols { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.chip {
  font-size: 11px;
  font-weight: 700;
  background: var(--border);
  padding: 2px 8px;
  border-radius: 100px;
}

.chip-sent {
  background: color-mix(in srgb, var(--green) 20%, transparent);
  color: var(--green);
  margin-left: 8px;
}

.alert-who { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.alert-meta a { color: var(--accent); font-weight: 600; }

.person-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.person-chip {
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 13.5px;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.15s var(--ease-spring);
}

.person-chip:hover { transform: translateY(-1px); border-color: var(--accent); color: var(--text); }
.person-chip:active { transform: scale(0.94); }
.person-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  animation: tab-pop 0.3s var(--ease-spring);
  view-transition-name: person-tab-pill;
}

.empty-state {
  color: var(--text-tertiary);
  text-align: center;
  padding: 32px 12px;
  font-size: 14px;
  animation: fade-in 0.5s var(--ease) both;
}

.empty-state::before {
  content: "🌱";
  display: block;
  font-size: 26px;
  margin-bottom: 8px;
  opacity: 0.8;
}

.alert-item:nth-child(1) { animation-delay: 0.05s; }
.alert-item:nth-child(2) { animation-delay: 0.20s; }
.alert-item:nth-child(3) { animation-delay: 0.35s; }
.alert-item:nth-child(4) { animation-delay: 0.50s; }
.alert-item:nth-child(5) { animation-delay: 0.65s; }
.alert-item:nth-child(6) { animation-delay: 0.80s; }
.alert-item:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); border-radius: var(--radius-sm); }

/* Status row */

.status-row { display: flex; gap: 22px; flex-wrap: wrap; }
.status-metric .k { font-size: 12px; color: var(--text-tertiary); }
.status-metric .v { font-size: 17px; font-weight: 700; margin-top: 2px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot.ok { background: var(--green); }
.dot.err { background: var(--red); }

/* Forms */

fieldset { border: none; padding: 0; margin: 0 0 22px; }
legend { font-size: 15px; font-weight: 700; margin-bottom: 10px; padding: 0; }
.field-hint { font-size: 12.5px; color: var(--text-tertiary); margin: -6px 0 12px; }

label.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

input[type="text"], input[type="password"], input[type="number"], select {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.row { display: flex; gap: 10px; margin-bottom: 10px; align-items: center; }
.row > * { flex: 1; }
.row .icon-btn { flex: none; }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s var(--ease-spring), background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.icon-btn:hover { background: color-mix(in srgb, var(--red) 12%, var(--bg-elevated)); color: var(--red); }
.icon-btn:active { transform: scale(0.9); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: 100px;
  border: none;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s var(--ease-spring), box-shadow 0.2s var(--ease), opacity 0.2s var(--ease);
}

.btn:active { transform: scale(0.96); }
.btn-primary {
  position: relative;
  overflow: hidden;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-primary:hover { box-shadow: var(--shadow-lg); }
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s var(--ease);
  pointer-events: none;
}
.btn-primary:hover::after { left: 130%; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: color-mix(in srgb, var(--accent) 14%, var(--border)); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:disabled:hover::after { left: -60%; }

.instrument-search {
  position: relative;
  margin-bottom: 14px;
}

.instrument-search-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.instrument-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.instrument-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  animation: rise-in 0.2s var(--ease) both;
}

.instrument-search-results[hidden] { display: none; }

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 0.15s var(--ease);
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--border); }

.search-result-item .sr-symbol { font-weight: 700; font-size: 13.5px; min-width: 56px; }
.search-result-item .sr-name { flex: 1; font-size: 13.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-item .sr-add {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s var(--ease-spring);
}
.search-result-item .sr-add:hover { transform: scale(1.1); }
.search-result-item.already-added .sr-add { background: var(--green); }

.search-empty {
  padding: 16px 14px;
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: center;
}

@keyframes row-highlight {
  0% { background: color-mix(in srgb, var(--green) 22%, transparent); }
  100% { background: transparent; }
}

.row.just-added { animation: row-highlight 1.4s var(--ease); border-radius: var(--radius-sm); }

.add-row-btn {
  background: none;
  border: 1.5px dashed var(--border);
  color: var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px;
  width: 100%;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.add-row-btn:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); border-color: var(--accent); }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}

.switch {
  width: 46px;
  height: 28px;
  border-radius: 100px;
  background: var(--border);
  position: relative;
  flex: none;
  cursor: pointer;
  transition: background-color 0.25s var(--ease);
}

.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s var(--ease-spring);
}

.switch:has(input:checked) { background: var(--green); }
.switch:has(input:checked)::after { transform: translateX(18px); }

.pw-wrap { position: relative; }
.pw-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 8px;
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: var(--text);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 100px;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  animation: toast-in 0.4s var(--ease-spring) both, toast-out 0.4s var(--ease) 2.6s both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Onboarding / login */

.center-screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

.center-screen::before,
.center-screen::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
  z-index: 0;
  animation: float-blob 18s ease-in-out infinite;
  pointer-events: none;
}

.center-screen::before { top: -140px; left: -120px; background: var(--accent); }
.center-screen::after { bottom: -160px; right: -130px; background: var(--accent-2); animation-delay: -9s; }

@keyframes float-blob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 25px) scale(1.12); }
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  text-align: center;
  animation: rise-in 0.6s var(--ease-spring) both;
}

.auth-logo {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: var(--shadow-lg);
  animation: logo-pop 0.6s var(--ease-spring) 0.1s both;
}

@keyframes logo-pop {
  0% { transform: scale(0.5) rotate(-8deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.auth-card h1 { font-size: 22px; margin: 0 0 6px; }
.auth-card p { color: var(--text-secondary); font-size: 14px; margin: 0 0 24px; }
.auth-error { color: var(--red); font-size: 13px; margin-top: 10px; animation: shake 0.4s var(--ease); }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

footer.foot {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 12px;
  margin-top: 40px;
}

/* Nagyított árfolyam-grafikon (modal) */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fade-in 0.25s var(--ease);
}

.modal-overlay[hidden] { display: none; }

.modal-card {
  width: 100%;
  max-width: 620px;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modal-in 0.35s var(--ease-spring) both;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s var(--ease-spring), background-color 0.2s var(--ease);
}

.modal-close:hover { background: color-mix(in srgb, var(--red) 15%, var(--border)); color: var(--red); }
.modal-close:active { transform: scale(0.9); }

.modal-head { display: flex; align-items: baseline; gap: 10px; padding-right: 40px; }
.modal-sym { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.modal-name { font-size: 15px; color: var(--text-secondary); }
.modal-price { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.modal-change { font-size: 15px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.modal-change.up { color: var(--green); }
.modal-change.down { color: var(--red); }
.modal-range { font-size: 13px; color: var(--text-tertiary); margin-top: 2px; }

.modal-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.modal-stats[hidden] { display: none; }

.modal-stat { display: flex; flex-direction: column; gap: 3px; }
.modal-stat .k { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-tertiary); }
.modal-stat .v { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }

.modal-chart-wrap {
  position: relative;
  margin-top: 20px;
  touch-action: none;
}

.modal-chart {
  width: 100%;
  height: 220px;
  overflow: visible;
  cursor: crosshair;
}

.modal-chart polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: stroke-dashoffset 0.9s var(--ease);
}

.modal-crosshair-line {
  stroke: var(--text-tertiary);
  stroke-width: 1;
  stroke-dasharray: 4 3;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.modal-crosshair-dot {
  fill: var(--accent);
  stroke: var(--card-solid);
  stroke-width: 2;
  pointer-events: none;
}

.modal-marker-line {
  stroke-width: 1.5;
  stroke-dasharray: 2 3;
  opacity: 0.55;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.modal-marker-dot {
  stroke: var(--card-solid);
  stroke-width: 2;
  cursor: pointer;
  transition: r 0.15s var(--ease);
}
.modal-marker-dot:hover { r: 7; }

.modal-hover-tip {
  position: absolute;
  pointer-events: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 11px;
  box-shadow: var(--shadow);
  white-space: nowrap;
  z-index: 5;
}
.modal-hover-tip .tip-time { font-size: 11px; color: var(--text-tertiary); margin-bottom: 2px; }
.modal-hover-tip .tip-price { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.modal-hover-tip .tip-pct { font-size: 12px; font-weight: 700; }
.modal-hover-tip .tip-pct.up { color: var(--green); }
.modal-hover-tip .tip-pct.down { color: var(--red); }

.modal-post-tip {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 13px;
  animation: rise-in 0.3s var(--ease) both;
}
.modal-post-tip[hidden] { display: none; }
.modal-post-tip .pt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.modal-post-tip .pt-who { font-weight: 700; }
.modal-post-tip .pt-time { color: var(--text-tertiary); font-size: 11.5px; margin-bottom: 8px; }
.modal-post-tip .pt-quote { color: var(--text-secondary); margin-bottom: 8px; overflow-wrap: break-word; }
.modal-post-tip .pt-hist { color: var(--text-tertiary); font-size: 12.5px; line-height: 1.5; }
.modal-post-tip .pt-hist .val { font-weight: 700; font-variant-numeric: tabular-nums; }
.modal-post-tip .pt-hist .val.good { color: var(--green); }
.modal-post-tip .pt-hist .val.bad { color: var(--red); }

.modal-legend {
  margin: 12px 0 0;
  font-size: 11.5px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.modal-legend[hidden] { display: none; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 8px; }
.legend-dot:first-child { margin-left: 0; }

.modal-empty {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
  padding: 40px 10px;
}

@media (max-width: 640px) {
  .topbar-inner { padding: 12px 14px; gap: 10px; }
  .brand { font-size: 15px; }
  .brand .full { display: none; }
  .brand .short { display: inline; }
  nav.tabs a { padding: 7px 11px; font-size: 13px; }
  h1.page-title { font-size: 24px; }
  .wrap { padding: 0 14px 48px; }
}

/* Szimulátor */

.mono { font-variant-numeric: tabular-nums; }
.good { color: var(--green); }
.bad { color: var(--red); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
}

.stat-grid .stat { background: var(--bg-elevated); padding: 16px 18px; transition: background-color 0.3s var(--ease); }
.stat-grid .stat .k { font-size: 12px; color: var(--text-tertiary); margin-bottom: 5px; }
.stat-grid .stat .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-grid .stat .v.flash { animation: flash-up 0.6s var(--ease); }

details.sim-reset { margin-top: 4px; }
details.sim-reset summary {
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
}
details.sim-reset summary::-webkit-details-marker { display: none; }
details.sim-reset summary::before { content: "▸ "; }
details.sim-reset[open] summary::before { content: "▾ "; }

.sim-buy-cell { display: flex; flex-direction: column; gap: 8px; }
.sim-buy-cell:nth-child(1) .price-tile { animation-delay: 0.05s; }
.sim-buy-cell:nth-child(2) .price-tile { animation-delay: 0.24s; }
.sim-buy-cell:nth-child(3) .price-tile { animation-delay: 0.43s; }
.sim-buy-cell:nth-child(4) .price-tile { animation-delay: 0.62s; }
.sim-buy-cell:nth-child(5) .price-tile { animation-delay: 0.81s; }
.sim-buy-cell:nth-child(6) .price-tile { animation-delay: 1.00s; }

.sim-buy-form, .sim-sell-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sim-buy-form input, .sim-sell-form input {
  flex: 1;
  min-width: 90px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.sim-buy-form button, .sim-sell-form button { flex: none; padding: 9px 16px; }

.pl-pill {
  flex: none;
  min-width: 62px;
  height: 28px;
  padding: 0 10px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}
.pl-pill.good { background: var(--green); }
.pl-pill.bad { background: var(--red); }

.chip.good, .chip.bad { background: var(--bg-elevated); border: 1px solid currentcolor; }

@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr; }
  .sim-sell-form { flex-wrap: wrap; }
  .sim-sell-form input { width: 100%; }
}

/* --- Állapot- és figyelmeztető sávok --- */

.banner {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid var(--border);
  animation: fade-in 0.4s var(--ease) both;
}
.banner[hidden], .market-note[hidden], .status-error[hidden] { display: none; }
.banner-conn { background: color-mix(in srgb, var(--yellow) 18%, var(--bg-elevated)); border-color: var(--yellow); }
.banner-health { background: color-mix(in srgb, var(--red) 12%, var(--bg-elevated)); border-color: var(--red); }
.banner-line + .banner-line { margin-top: 6px; }

.market-note {
  background: color-mix(in srgb, var(--accent) 9%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.status-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.status-actions .btn { padding: 8px 16px; font-size: 13.5px; }
.status-error {
  margin-top: 12px;
  font-size: 13px;
  color: var(--red);
  overflow-wrap: anywhere;
}

/* Árkártya: piacjelzés */

.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.mkt {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 100px;
  background: var(--border);
  color: var(--text-tertiary);
  white-space: nowrap;
}
.mkt-open, .mkt-always { color: var(--green); background: color-mix(in srgb, var(--green) 16%, transparent); }
.mkt-closed { color: var(--text-secondary); }
.price-tile.is-closed .val { color: var(--text-secondary); }
.price-tile.is-stale .val { opacity: 0.55; }

/* Nagyított grafikon: időtartomány-választó és piacjelzés */

.range-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  margin: 14px 0 6px;
  background: var(--border);
  border-radius: 100px;
}
.range-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 13px;
  border-radius: 100px;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.range-tab:hover { color: var(--text); }
.range-tab.active { background: var(--bg-elevated); color: var(--text); box-shadow: var(--shadow); }

.modal-market { font-size: 12.5px; margin-top: 6px; line-height: 1.45; }
.modal-market[hidden] { display: none; }
.modal-market.open { color: var(--green); }
.modal-market.closed { color: var(--text-tertiary); }

/* Telefon: a négy fül külön sorba kerül, hogy mindegyik (a Beállítások is) látszódjon,
   ne kelljen a rejtett, oldalra görgethető sávot felfedezni. */
@media (max-width: 640px) {
  .topbar-inner { flex-wrap: wrap; row-gap: 8px; }
  .brand { order: 1; }
  .topbar-right { order: 2; margin-left: auto; }
  nav.tabs { order: 3; flex: 1 1 100%; margin-left: 0; gap: 2px; }
  nav.tabs a { flex: 1 1 0; text-align: center; padding: 7px 4px; font-size: 12.5px; }
  .range-tab { padding: 5px 10px; }
}
