/* Jarvis – high-contrast, phone-first. Dark by default on dark phones, light otherwise. */
:root {
  --bg: #eceef2; --card: #ffffff; --card-2: #f4f5f8; --text: #0a0b0d; --muted: #4a5160; --line: #d3d7df;
  --accent: #1f5eff; --accent-text: #fff;
  --ok: #0b8a3e; --tight: #b45309; --over: #c81e1e;
  --ok-bg: #0e9f47; --tight-bg: #d97706; --over-bg: #dc2626;
  --ok-soft: #dcf5e6; --tight-soft: #fdf0d5; --over-soft: #fde2e2; --info-soft: #e6ecfb;
  --chip: #e5e8ee; --radius: 16px; --tabs-h: 64px;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 4px 14px rgb(0 0 0 / 5%);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --card: #15171c; --card-2: #1d2027; --text: #ffffff; --muted: #b3b9c5; --line: #2d313a;
    --accent: #4d8bff; --accent-text: #fff;
    --ok: #34d36c; --tight: #fbbf24; --over: #ff5a5a;
    --ok-bg: #12823e; --tight-bg: #b86a05; --over-bg: #c42424;
    --ok-soft: #0e2c1a; --tight-soft: #33250a; --over-soft: #3a1414; --info-soft: #172442;
    --chip: #262a33; --shadow: none;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.42 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top) 0 calc(var(--tabs-h) + env(safe-area-inset-bottom)) 0;
  -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); font-weight: 600; text-decoration: none; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.top h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.icon { border: 0; background: var(--chip); border-radius: 50%; width: 40px; height: 40px; font-size: 18px; }

main { padding: 2px 14px 28px; max-width: 640px; margin: 0 auto; }
.pad { padding: 24px 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.row { display: flex; gap: 8px; align-items: center; }
.row > .grow, .grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.hidden { display: none !important; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 15px; margin: 10px 0; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 8px; font-size: 17px; font-weight: 750; }
.card h2 .count { color: var(--muted); font-weight: 500; }
.section-title { margin: 16px 2px 4px; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.sub { font-size: 13.5px; color: var(--muted); }

/* the one number */
.hero-big { border-radius: 22px; padding: 18px 18px 14px; margin: 6px 0 10px; color: #fff; box-shadow: 0 6px 22px rgb(0 0 0 / 18%); }
.hero-big.state-ok { background: linear-gradient(160deg, var(--ok-bg), color-mix(in srgb, var(--ok-bg) 70%, #000)); }
.hero-big.state-tight { background: linear-gradient(160deg, var(--tight-bg), color-mix(in srgb, var(--tight-bg) 70%, #000)); }
.hero-big.state-over { background: linear-gradient(160deg, var(--over-bg), color-mix(in srgb, var(--over-bg) 70%, #000)); }
.hero-big.state-unknown { background: #3a3f4a; }
.hero-label { font-size: 14px; font-weight: 600; opacity: 0.92; }
.hero-num { font-size: 46px; font-weight: 850; letter-spacing: -0.03em; line-height: 1.08; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.hero-sub { font-size: 14.5px; font-weight: 500; opacity: 0.95; }
.hero-hint { font-size: 12px; opacity: 0.75; margin-top: 8px; }

.tile { cursor: pointer; }
.tile-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.tile-num { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile-num.small-num { font-size: 18px; }
.text-ok { color: var(--ok); } .text-tight { color: var(--tight); } .text-over { color: var(--over); } .text-unknown { color: var(--muted); }
.state-border-ok { border-left: 6px solid var(--ok); }
.state-border-tight { border-left: 6px solid var(--tight); }
.state-border-over { border-left: 6px solid var(--over); }
.state-border-unknown { border-left: 6px solid var(--muted); }
.chev { font-size: 28px; color: var(--muted); font-weight: 300; }

/* tips */
.tip { border-radius: 12px; padding: 10px 12px; margin: 8px 0; border-left: 5px solid var(--muted); background: var(--card-2); cursor: pointer; }
.tip-red { border-color: var(--over); background: var(--over-soft); }
.tip-yellow { border-color: var(--tight); background: var(--tight-soft); }
.tip-green { border-color: var(--ok); background: var(--ok-soft); }
.tip-info { border-color: var(--accent); background: var(--info-soft); }
.tip-title { font-weight: 750; }
.tip-text { font-size: 14px; margin-top: 2px; }

/* segmented control */
.seg { display: flex; background: var(--chip); border-radius: 12px; padding: 3px; margin: 4px 0 8px; position: sticky; top: 58px; z-index: 4; }
.seg button { flex: 1; border: 0; background: none; padding: 9px 4px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.seg button.sel { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgb(0 0 0 / 18%); }

.verdict { border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.verdict.green { background: var(--ok-soft); }
.verdict.yellow { background: var(--tight-soft); }
.verdict.red { background: var(--over-soft); }
.verdict.unknown { background: var(--chip); }
.verdict b { display: block; margin-bottom: 2px; }

input[type=text], input[type=number], input[type=password], input[type=date], input[type=time], select, textarea {
  width: 100%; border: 1.5px solid var(--line); background: var(--card-2); border-radius: 11px; padding: 10px 12px; font-size: 16px; min-height: 46px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 80px; resize: vertical; }
label { display: block; font-size: 13.5px; color: var(--muted); margin: 11px 0 4px; font-weight: 600; }
.btn { border: 0; border-radius: 12px; padding: 11px 14px; min-height: 46px; background: var(--accent); color: var(--accent-text); font-weight: 700; }
.btn.secondary { background: var(--chip); color: var(--text); }
.btn.danger { background: var(--over-soft); color: var(--over); }
.btn.block { width: 100%; margin-top: 12px; }
.btn:disabled { opacity: 0.5; }
.link { border: 0; background: none; color: var(--accent); padding: 6px 0; font-weight: 700; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .main { flex: 1; min-width: 0; }
.list .title { overflow-wrap: anywhere; font-weight: 550; }
.amount { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 750; }
.amount.in { color: var(--ok); }
.check { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--muted); background: none; flex: none; font-size: 15px; line-height: 1; }
.check.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.mini { border: 0; background: var(--chip); border-radius: 9px; padding: 7px 10px; font-size: 13.5px; font-weight: 650; flex: none; }
.chip { display: inline-block; background: var(--chip); border-radius: 999px; padding: 2px 9px; font-size: 12px; color: var(--muted); font-weight: 650; }
.chip.main { background: var(--accent); color: #fff; }
.chip.warn { background: var(--tight-soft); color: var(--tight); }
.chip.bad { background: var(--over-soft); color: var(--over); }

.bar { height: 9px; background: var(--chip); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.bar.warn > i { background: var(--tight); }
.bar.over > i { background: var(--over); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.stat .v { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 12.5px; color: var(--muted); font-weight: 600; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--card) 94%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11.5px;
  color: var(--muted); text-decoration: none; font-weight: 700; }
.tabs a span { font-size: 22px; filter: grayscale(1); opacity: 0.6; }
.tabs a.active { color: var(--accent); }
.tabs a.active span { filter: none; opacity: 1; }

.sheet { position: fixed; inset: 0; z-index: 20; background: rgb(0 0 0 / 55%); display: flex; align-items: flex-end; }
.sheet-body { background: var(--card); width: 100%; max-height: 90vh; overflow: auto; border-radius: 20px 20px 0 0; border-top: 1px solid var(--line);
  padding: 16px 16px calc(22px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; animation: up 0.18s ease-out; }
.sheet-body h3 { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.sheet-body .card { border: 0; box-shadow: none; padding: 0; margin: 0; }
@keyframes up { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pick button { border: 1.5px solid var(--line); background: var(--card-2); border-radius: 999px; padding: 8px 12px; font-weight: 600; }
.pick button.sel { background: var(--accent); color: #fff; border-color: var(--accent); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs-h) + 14px + env(safe-area-inset-bottom)); z-index: 30;
  background: var(--text); color: var(--bg); padding: 11px 15px; border-radius: 12px; max-width: 92vw; font-size: 14.5px; font-weight: 600; box-shadow: 0 6px 20px rgb(0 0 0 / 30%); }

.chat { display: flex; flex-direction: column; gap: 8px; padding-bottom: 80px; }
.msg { max-width: 86%; padding: 10px 13px; border-radius: 17px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.msg.assistant { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.thinking { color: var(--muted); font-style: italic; }
.composer { position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); z-index: 9; padding: 8px 12px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.composer form { display: flex; gap: 8px; max-width: 640px; margin: 0 auto; }

.token { font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: var(--chip); padding: 10px; border-radius: 10px; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
ol.steps { padding-left: 20px; margin: 6px 0; }
ol.steps li { margin: 6px 0; }
.login { max-width: 380px; margin: 8vh auto 0; }
.login .logo { width: 84px; height: 84px; border-radius: 20px; display: block; margin: 0 auto 12px; }

/* goal order arrows */
.order { display: flex; flex-direction: column; gap: 4px; }
.order .mini { padding: 4px 8px; font-size: 12px; line-height: 1; }
.order .mini:disabled { opacity: 0.3; }

/* Egyetem */
.list li.uni-next { border: 2px solid var(--accent); border-radius: 14px; padding: 12px; }
.list li.uni-next .title { font-size: 17px; font-weight: 750; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: '▸ '; }
details[open] > summary::before { content: '▾ '; }
.cbline { display: flex; gap: 8px; align-items: center; padding: 6px 0; font-size: 15px; }
