/* Knapcorp Agent - dodatki do wspólnego app.css (ten sam styl co Athlete). */
.view > .card, .view > details.card { margin-bottom: 18px; scroll-margin-top: 76px; }
.ag-note { margin: 0 0 10px; }
.ag-hint { margin: 0 0 8px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--accent-dim); font-size: 14.5px; }
.ag-setup { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 16px; margin: 12px 0 0; border: 1px dashed var(--border-strong); border-radius: var(--r-sm); }
.ag-setup p { margin: 2px 0 0; }
.ag-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 6px 28px; }
.mini-bar.bad > div { background: var(--bad); }
.mini-bar.good > div { background: var(--good); }
.mini-bar > div { background: var(--accent); }

/* brief */
.ag-brief { padding: 10px 24px; }
.ag-brief-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--border); }
.ag-brief-row:last-child { border-bottom: 0; }
.ag-brief-row > span { font: 700 15px var(--digits); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ag-brief-row > p { margin: 0; font-size: 17px; line-height: 1.45; }
.ag-brief-row.is-warn > span { color: var(--amber); }
@media (max-width: 600px) { .ag-brief { padding: 6px 18px; } .ag-brief-row { grid-template-columns: 1fr; gap: 2px; } .ag-brief-row > p { font-size: 16px; } }

/* liczby */
.ag-big { font: 700 clamp(40px, 4vw, 58px)/1 var(--digits); text-transform: capitalize; margin-bottom: 4px; }
.ag-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 16px 0 4px; }
.ag-kv4 { grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); }
.ag-kv > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ag-kv span { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.ag-kv b { font: 700 clamp(26px, 2.2vw, 34px)/1.05 var(--digits); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ag-kv b em, .ag-macro b em { font: 600 14px var(--sans); color: var(--muted); margin-left: 5px; }
.ag-kv small { font-size: 13px; }
.ag-num { font: 700 24px var(--digits); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ag-num small { font: 500 13px var(--sans); }
.ag-events { display: grid; gap: 8px; margin-top: 16px; }
.ag-events > div { display: flex; align-items: baseline; gap: 10px; }
.ag-events b { font: 700 30px/1 var(--digits); min-width: 58px; font-variant-numeric: tabular-nums; }

/* pogoda */
.ag-wx { display: flex; align-items: center; gap: 18px; }
.ag-temp { font: 700 clamp(64px, 6vw, 88px)/.9 var(--digits); font-variant-numeric: tabular-nums; }
.ag-hours { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; align-items: end; margin-top: 18px; }
.ag-hours > div { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.ag-hours small { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ag-hours i { display: block; width: 70%; border-radius: 6px 6px 2px 2px; background: color-mix(in srgb, var(--accent) 55%, transparent); }
.ag-hours u { display: block; width: 70%; height: 5px; border-radius: 3px; background: #3b82f6; }
.ag-hours span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ag-legend { margin: 10px 0 0; }

/* trening */
.ag-wk, .ag-acc { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 14px 16px; margin-bottom: 10px; background: var(--surface-2); }
.ag-wk.done { border-left: 3px solid var(--good); }
.ag-wk.plan { border-left: 3px solid var(--accent); }
.ag-wk.skipped { opacity: .6; }
.ag-wk p { margin: 8px 0 0; }
.ag-wk-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ag-wk-top b { font-size: 17px; }
.ag-tips { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 5px; font-size: 14.5px; }
.ag-quote { border-left: 2px solid var(--border-strong); padding-left: 10px; white-space: pre-wrap; }

/* dieta */
.ag-macros { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 16px; margin: 6px 0 6px; }
.ag-macro { display: flex; flex-direction: column; min-width: 0; }
.ag-macro span { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.ag-macro b { font: 700 clamp(30px, 2.6vw, 40px)/1.05 var(--digits); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ag-week { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: end; height: 84px; }
.ag-week > div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.ag-week i { display: block; width: 62%; border-radius: 6px 6px 2px 2px; background: var(--good); }
.ag-week i.over { background: var(--bad); }
.ag-week .none i { background: var(--surface-3); }
.ag-week span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 14px; }
.ag-week em { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--border-strong); pointer-events: none; }

/* wiadomości */
.ag-news { list-style: none; margin: 0; padding: 0; }
.ag-news li { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.ag-news li:last-child { border-bottom: 0; }
.ag-news a, .ag-news span { color: var(--text); font-size: 15.5px; line-height: 1.4; overflow-wrap: anywhere; }
.ag-news a:hover { color: var(--accent-text); }
.ag-news small { font-size: 12.5px; }
.ag-more { margin-top: 8px; }
.ag-more summary, .ag-status summary { cursor: pointer; font-weight: 600; color: var(--text-2); font-size: 14.5px; }

/* trading */
.ag-accs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 12px; margin-top: 14px; }
.ag-acc { margin: 0; }
.ag-acc.is-bad { border-color: var(--bad); }
.ag-meter { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--text-2); margin-top: 10px; }

/* stan źródeł */
.ag-status ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.ag-status li { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ag-status i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--bad); flex: none; }
.ag-status i.ok { background: var(--good); }

/* ustawienia */
.ag-places { display: grid; gap: 8px; margin-top: 10px; }
.ag-places button { text-align: left; justify-content: flex-start; }
.ag-days { display: flex; gap: 6px; flex-wrap: wrap; }
.ag-days label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; }
.ag-linked { color: var(--good-text); font-weight: 600; }

/* ============================================================================================
   Wygląd Agenta: ciemny pulpit HUD (wyjątek od wspólnego stylu, jak Algo - zob. ZASADY.md).
   Jedno światło sygnałowe (cyjan), bursztyn tylko dla ostrzeżeń, panele z cienkiej linii zamiast szkła.
   ============================================================================================ */
html:root[data-theme][data-bg] {
  --bg: #05090d; --surface-solid: #0a1218; --glass: rgba(10, 18, 24, .72); --glass-strong: rgba(13, 24, 32, .92);
  --surface-2: rgba(79, 216, 255, .045); --surface-3: rgba(79, 216, 255, .1);
  --border: rgba(79, 216, 255, .14); --border-strong: rgba(79, 216, 255, .3); --edge: transparent;
  --text: #d9eef5; --text-2: #a5c3ce; --muted: #6a8794;
  --accent: #4fd8ff; --accent-2: #2a8fb5; --accent-dim: rgba(79, 216, 255, .12); --accent-text: #8be6ff; --on-accent: #03222c;
  --good: #54e6a0; --good-text: #6ff0b2; --good-soft: rgba(84, 230, 160, .13);
  --bad: #ff6b6b; --bad-soft: rgba(255, 107, 107, .14);
  --amber: #ffb347; --amber-dim: rgba(255, 179, 71, .12);
  --r-xl: 6px; --r-lg: 4px; --r-md: 4px; --r-sm: 3px;
  --shadow: none; --shadow-lg: 0 30px 80px -30px rgba(0, 0, 0, .9);
  --display: var(--digits);
  color-scheme: dark;
}
html { background: #05090d; }
body::before {
  background:
    radial-gradient(70vmax 50vmax at 78% -12%, rgba(79, 216, 255, .13), transparent 62%),
    radial-gradient(50vmax 40vmax at -8% 108%, rgba(42, 143, 181, .1), transparent 60%),
    linear-gradient(rgba(79, 216, 255, .035) 1px, transparent 1px) 0 0 / 100% 44px,
    linear-gradient(90deg, rgba(79, 216, 255, .035) 1px, transparent 1px) 0 0 / 44px 100%,
    #05090d !important;
}
h1 { font: 700 44px/1 var(--digits); letter-spacing: .01em; }
h2 { font: 700 21px/1.2 var(--digits); letter-spacing: .04em; color: var(--accent-text); }
h2 small { font-family: var(--sans); }
.brand-name { font: 700 22px var(--digits); letter-spacing: .04em; }
.sidebar { background: rgba(5, 9, 13, .88) !important; }
.topbar { background: rgba(5, 9, 13, .92); border-bottom-color: var(--border); }
.nav-item.active { background: var(--accent-dim); }
.btn { border-radius: 3px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
input, select, textarea { border-radius: 3px; background: rgba(5, 9, 13, .7); }
.segmented, .segmented button { border-radius: 3px; }
.segmented button.on { background: var(--accent-dim); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--border-strong); }
.badge { border-radius: 2px; }
.warn { border-left: 2px solid var(--amber); border-radius: 0 3px 3px 0; }
.mini-bar { height: 4px; border-radius: 0; }
.mini-bar > div { border-radius: 0; box-shadow: 0 0 10px currentColor; }
.section-label { font: 700 16px var(--digits); letter-spacing: .06em; color: var(--text-2); }
.section-label small { font-family: var(--sans); letter-spacing: 0; }

/* panel: cienka ramka + znaczniki w dwóch narożnikach */
.card { position: relative; background: rgba(8, 15, 20, .78) !important; border: 1px solid var(--border); border-radius: 4px; }
.card::before, .card::after { content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none; }
.card::before { top: -1px; left: -1px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.card::after { bottom: -1px; right: -1px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.login-card::before, .login-card::after { display: block; }
.ag-wk, .ag-acc { border-radius: 3px; background: rgba(79, 216, 255, .035); }
.ag-hint { border-left: 2px solid var(--accent); border-radius: 0 3px 3px 0; }
.ag-hours i { border-radius: 1px; background: linear-gradient(to top, rgba(79, 216, 255, .15), rgba(79, 216, 255, .75)); }
.ag-hours u { border-radius: 0; background: var(--accent); }
.ag-week i { border-radius: 1px; }
.ag-temp, .ag-big { text-shadow: 0 0 28px rgba(79, 216, 255, .35); }
.ag-brief-row > span { text-transform: none; letter-spacing: .06em; font-size: 17px; color: var(--accent-text); }

/* rdzeń: tarcza doby + brief */
.ag-core { display: grid; grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); gap: 10px 34px; align-items: center; padding: 22px 28px; }
.ag-core .ag-brief { padding: 0; }
.ag-dial { width: 100%; max-width: 400px; margin: 0 auto; display: block; }
.ag-dial text { font-family: var(--digits); fill: var(--muted); }
.ag-dial .d-ring { fill: none; stroke: rgba(79, 216, 255, .16); stroke-width: 1; }
.ag-dial .d-tick { stroke: rgba(79, 216, 255, .35); stroke-width: 1; }
.ag-dial .d-night { fill: none; stroke: rgba(79, 216, 255, .1); stroke-width: 10; }
.ag-dial .d-day { fill: none; stroke: rgba(255, 179, 71, .5); stroke-width: 2; }
.ag-dial .d-work { fill: none; stroke: rgba(217, 238, 245, .32); stroke-width: 10; }
.ag-dial .d-train { fill: none; stroke: var(--accent); stroke-width: 10; filter: drop-shadow(0 0 6px rgba(79, 216, 255, .8)); }
.ag-dial .d-now { stroke: #fff; stroke-width: 2; }
.ag-dial .d-nowdot { fill: #fff; filter: drop-shadow(0 0 6px #fff); }
.ag-dial .d-time { font-size: 62px; font-weight: 700; fill: var(--text); }
.ag-dial .d-date { font-size: 17px; fill: var(--text-2); letter-spacing: .04em; }
.ag-dial .d-spin { transform-origin: 200px 200px; animation: ag-spin 90s linear infinite; }
@keyframes ag-spin { to { transform: rotate(360deg); } }
.ag-keys { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; margin-top: 6px; font-size: 13px; color: var(--text-2); }
.ag-keys i { display: inline-block; width: 16px; height: 4px; margin-right: 6px; vertical-align: middle; }
/* jedno wejście przy starcie: wiersze briefu pojawiają się po kolei */
.boot .ag-brief-row { opacity: 0; animation: ag-in .45s ease-out forwards; animation-delay: calc(var(--i) * 110ms + 150ms); }
.boot .ag-dial { animation: ag-dial .9s ease-out both; }
@keyframes ag-in { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes ag-dial { from { opacity: 0; transform: scale(.94) rotate(-8deg); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) { .ag-core { grid-template-columns: 1fr; padding: 18px; } .ag-dial { max-width: 320px; } }
@media (max-width: 600px) { h1 { font-size: 36px; } }
