:root {
  --bg: #0A0612;
  --bg-2: #130B24;
  --violet: #8B5CF6;
  --violet-2: #A78BFA;
  --violet-3: #C4B5FD;
  --white: #FFFFFF;
  --text: #F5F2FF;
  --muted: rgba(245, 242, 255, .58);
  --faint: rgba(245, 242, 255, .34);
  --line: rgba(196, 181, 253, .14);
  --tint: rgba(139, 92, 246, .10);
  --pos: #8EE8B0;
  --neg: #FF9BB0;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg) radial-gradient(120% 70% at 50% 35%, #1B0F33 0%, var(--bg) 72%);
  color: var(--text);
  font-family: -apple-system, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Login ---------- */
.login { height: 100%; display: grid; place-items: center; padding: 24px; }
.login-box { width: 100%; max-width: 320px; text-align: center; }
.login-box h1 { font-size: 34px; font-weight: 200; margin: 0 0 6px; letter-spacing: -.01em; }
.login-box p { color: var(--muted); font-size: 15px; margin: 0 0 22px; }
.login-box input {
  width: 100%; background: var(--tint); border: 1px solid var(--line); color: var(--text);
  padding: 14px 16px; border-radius: 14px; font-size: 16px; margin-bottom: 12px; outline: none;
}
.login-box input:focus { border-color: var(--violet-2); }
.login-error { color: var(--neg) !important; font-size: 13px !important; min-height: 18px; margin: 12px 0 0 !important; }
.btn { border: 1px solid var(--line); background: var(--tint); padding: 13px 18px; border-radius: 14px; font-size: 16px; }
.btn.primary { width: 100%; background: var(--white); color: #1A0B3A; border-color: var(--white); font-weight: 600; }
.btn.ghost { background: none; }

/* ---------- App / Startseite ---------- */
.app { position: relative; height: 100%; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; overflow: hidden; }
.home-head { display: flex; justify-content: space-between; align-items: center; padding: calc(12px + var(--safe-top)) 20px 0; position: relative; z-index: 5; }
.status { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 500; }
.tick { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--violet-2); display: grid; place-items: center; box-shadow: 0 0 12px rgba(139, 92, 246, .55); transition: .4s; }
.tick svg { width: 12px; height: 12px; stroke: var(--white); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.status.offline { color: var(--muted); }
.status.offline .tick, .status.loading .tick { border-color: var(--faint); box-shadow: none; }
.status.offline .tick svg, .status.loading .tick svg { stroke: var(--muted); }
.menu-btn { width: 44px; height: 44px; margin-right: -12px; background: none; border: 0; display: grid; place-content: center; gap: 5.5px; }
.menu-btn i { display: block; width: 22px; height: 2px; border-radius: 2px; background: var(--white); }

.pnl { text-align: center; padding: 22px 20px 0; position: relative; z-index: 5; }
.pnl-label { font-size: 14px; color: var(--muted); }
.pnl-value { font-size: 52px; font-weight: 200; letter-spacing: -.02em; line-height: 1.15; margin-top: 2px; font-variant-numeric: tabular-nums; }
.pnl-sub { font-size: 13px; color: var(--faint); margin-top: 2px; }

.globe-wrap { position: relative; flex: 1; min-height: 0; }
.globe-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.trade-card {
  position: relative; z-index: 5; flex-shrink: 0; margin: 0 16px calc(16px + var(--safe-bottom)); text-align: left;
  border: 1px solid var(--line); background: rgba(19, 11, 36, .72); border-radius: 22px; padding: 14px 18px 16px;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.tc-top { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--violet-3); }
.tc-top .more { margin-left: auto; color: var(--muted); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--violet-2); box-shadow: 0 0 0 0 rgba(167, 139, 250, .7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(167, 139, 250, 0); } 100% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0); } }
.tc-main { display: flex; align-items: baseline; gap: 8px; margin: 8px 0 12px; }
.tc-main b { font-size: 22px; font-weight: 600; }
.tc-main .strat { margin-left: auto; font-size: 13px; color: var(--muted); }
.tc-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 16px; font-variant-numeric: tabular-nums; }
.tc-levels small { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }

.side { font-size: 12px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--violet-3); }

.greeting { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .6s; z-index: 30; }
.greeting.show { opacity: 1; }
.greeting span {
  padding: 20px 30px; border-radius: 26px; font-size: 25px; font-weight: 300; letter-spacing: -.01em; text-align: center;
  background: rgba(19, 11, 36, .78); border: 1px solid var(--line); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
  box-shadow: 0 0 60px rgba(139, 92, 246, .35); transform: scale(.94); transition: transform .6s cubic-bezier(.2, .8, .2, 1);
}
.greeting.show span { transform: none; }

.banner {
  position: absolute; left: 14px; right: 14px; top: calc(10px + var(--safe-top)); z-index: 40; display: grid; gap: 2px;
  padding: 13px 18px; border-radius: 18px; background: rgba(35, 20, 66, .92); border: 1px solid rgba(196, 181, 253, .28);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  transform: translateY(-160%); transition: transform .4s cubic-bezier(.2, .8, .2, 1); pointer-events: none;
}
.banner.show { transform: none; }
.banner b { font-size: 15px; font-weight: 600; }
.banner span { font-size: 14px; color: var(--muted); }

/* ---------- Menü ---------- */
.menu { position: absolute; inset: 0; z-index: 20; visibility: hidden; transition: visibility 0s .3s; }
.menu.open { visibility: visible; transition: none; }
.menu-backdrop { position: absolute; inset: 0; background: rgba(6, 3, 12, 0); transition: background .3s; }
.menu.open .menu-backdrop { background: rgba(6, 3, 12, .62); }
.menu-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: 80%; max-width: 340px; overflow-y: auto;
  background: var(--bg-2); border-left: 1px solid var(--line); transform: translateX(102%);
  transition: transform .32s cubic-bezier(.2, .8, .2, 1); padding-bottom: calc(24px + var(--safe-bottom));
}
.menu.open .menu-panel { transform: none; }
.menu-top { display: flex; justify-content: space-between; align-items: center; padding: calc(12px + var(--safe-top)) 8px 8px 24px; font-size: 13px; color: var(--muted); }
.close { width: 44px; height: 44px; background: none; border: 0; position: relative; }
.close::before, .close::after { content: ""; position: absolute; left: 13px; top: 21px; width: 18px; height: 2px; background: var(--white); border-radius: 2px; transform: rotate(45deg); }
.close::after { transform: rotate(-45deg); }
.menu-item {
  display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; background: none;
  border: 0; border-bottom: 1px solid var(--line); padding: 17px 24px; font-size: 18px; font-weight: 300;
}
.menu-item::after { content: ""; width: 8px; height: 8px; border-top: 1.5px solid var(--faint); border-right: 1.5px solid var(--faint); transform: rotate(45deg); margin-right: 4px; }
.menu-item:active { background: var(--tint); }

/* ---------- Unterseiten ---------- */
.view { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; background: var(--bg); transform: translateX(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.view.open { transform: none; }
.view-head { display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; padding: calc(8px + var(--safe-top)) 4px 8px; border-bottom: 1px solid var(--line); }
.view-head h2 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back { width: 44px; height: 44px; background: none; border: 0; position: relative; }
.back::before { content: ""; position: absolute; left: 18px; top: 15px; width: 12px; height: 12px; border-left: 2px solid var(--white); border-bottom: 2px solid var(--white); transform: rotate(45deg); }
.view-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(28px + var(--safe-bottom)); }

.empty { text-align: center; padding: 64px 32px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.empty b { display: block; color: var(--text); font-size: 17px; font-weight: 500; margin-bottom: 6px; }

.group-head { display: flex; justify-content: space-between; padding: 22px 20px 8px; font-size: 13px; color: var(--muted); }
.row { display: flex; justify-content: space-between; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; }
button.row:active { background: var(--tint); }
.row-title { font-size: 16px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.row-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.row-levels span { white-space: nowrap; }
.row-levels { font-size: 12.5px; color: var(--faint); margin-top: 4px; font-variant-numeric: tabular-nums; }
.row-right { text-align: right; font-size: 16px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-right small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 3px; }
.more-btn { display: block; margin: 20px auto 0; }

.kv { display: flex; justify-content: space-between; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 16px; }
.kv > span:first-child { color: var(--muted); }
.kv > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.section-title { padding: 24px 20px 6px; font-size: 13px; color: var(--muted); }

.hero { padding: 26px 20px 4px; text-align: center; }
.hero .label { font-size: 14px; color: var(--muted); }
.hero .big { font-size: 44px; font-weight: 200; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.chart { display: block; width: calc(100% - 32px); margin: 12px 16px 4px; }

.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 8px 4px 20px; }
.cal-head .m { font-size: 19px; font-weight: 500; text-transform: capitalize; }
.cal-head .sum { font-size: 14px; margin-top: 3px; }
.cal-nav { display: flex; }
.cal-nav button { width: 44px; height: 44px; background: none; border: 0; position: relative; }
.cal-nav button::before { content: ""; position: absolute; left: 17px; top: 17px; width: 9px; height: 9px; border-left: 2px solid var(--white); border-bottom: 2px solid var(--white); transform: rotate(45deg); }
.cal-nav button.next::before { transform: rotate(-135deg); left: 14px; }
.cal-nav button:disabled { opacity: .25; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 10px 16px 6px; }
.cal .wd { text-align: center; font-size: 12px; color: var(--faint); padding-bottom: 4px; }
.cal .d { aspect-ratio: 1; border-radius: 13px; display: grid; place-items: center; font-size: 14px; color: var(--faint); border: 1px solid transparent; background: none; padding: 0; }
.cal .d.has { color: var(--text); cursor: pointer; }
.cal .d.today { border-color: var(--violet-2); }
.cal .d.sel { border-color: var(--white); }
.cal-detail { margin: 10px 20px 0; padding: 14px 16px; border-radius: 16px; background: var(--tint); border: 1px solid var(--line); font-size: 15px; display: flex; justify-content: space-between; }
.cal-note { padding: 14px 20px 0; font-size: 12.5px; color: var(--faint); line-height: 1.5; }

.bar { height: 5px; border-radius: 5px; background: var(--tint); margin-top: 10px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--violet), var(--violet-3)); }

.acc { border-bottom: 1px solid var(--line); }
.acc summary { list-style: none; display: flex; justify-content: space-between; gap: 12px; padding: 15px 20px; font-size: 16px; cursor: pointer; }
.acc summary::-webkit-details-marker { display: none; }
.acc p { margin: 0; padding: 0 20px 18px; font-size: 14.5px; line-height: 1.55; color: var(--muted); white-space: pre-wrap; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--neg); display: inline-block; margin-right: 8px; }

.log-tools { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 2; }
.log-tools select, .log-tools button { background: var(--tint); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 9px 12px; font-size: 15px; }
.log-tools button { margin-left: auto; }
.log { font: 11.5px/1.55 ui-monospace, "SF Mono", Menlo, monospace; padding: 12px 16px; margin: 0; color: var(--muted); }
.log div { white-space: pre-wrap; overflow-wrap: anywhere; }
.log .err { color: var(--neg); }
.log .warn { color: var(--violet-3); }

.field { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 16px; }
.field input[type=text] { width: 40%; min-width: 120px; background: var(--tint); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--text); font-size: 16px; text-align: right; outline: none; }
.switch { position: relative; width: 52px; height: 31px; flex-shrink: 0; }
.switch input { display: none; }
.switch span { position: absolute; inset: 0; border-radius: 31px; background: rgba(245, 242, 255, .16); transition: .25s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: var(--white); transition: .25s; }
.switch input:checked + span { background: var(--violet); }
.switch input:checked + span::after { transform: translateX(21px); }
.danger { display: block; width: calc(100% - 40px); margin: 28px 20px 0; color: var(--neg); }
.foot { text-align: center; color: var(--faint); font-size: 12.5px; padding: 26px 20px 0; }

@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
  .view, .menu-panel, .banner, .greeting, .greeting span { transition: none; }
}
