:root {
  --bg: #f4f5f8; --card: #fff; --text: #1d2130; --muted: #6b7083; --line: #e3e5ec;
  --accent: #5b4cdb; --accent-2: #ece9ff; --danger: #d64545; --ok: #1f9d55; --warn: #c27c0e;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14161d; --card: #1e2029; --text: #e8e9ef; --muted: #9a9eb0; --line: #2e313d; --accent: #8b7fff; --accent-2: #2b2750; }
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; }
.hidden { display: none !important; }
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 20px 0 8px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.narrow { max-width: 420px; width: 100%; }
label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
label.check { display: flex; gap: 8px; align-items: center; color: var(--text); }
input:not([type=checkbox]), textarea { display: block; width: 100%; margin-top: 4px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--bg); color: var(--text); }
button { font: inherit; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.small { padding: 4px 9px; font-size: 13px; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 600; }
nav { display: flex; gap: 4px; flex: 1; }
.tab { border: 0; background: none; color: var(--muted); }
.tab.active { background: var(--accent-2); color: var(--accent); font-weight: 600; }
.who { font-size: 14px; }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grid > .card { margin-bottom: 0; } .grid { margin-bottom: 16px; }
.now-track { font-size: 22px; font-weight: 600; margin-bottom: 14px; }
.quota { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; display: grid; gap: 4px; }
.box { border-radius: 10px; padding: 12px; margin-top: 8px; }
.box.warn { background: #fff4e0; color: #6a4500; } 
@media (prefers-color-scheme: dark) { .box.warn { background: #3a2d12; color: #f3d39b; } }
.countdown { font-variant-numeric: tabular-nums; font-weight: 700; }
.playlist { padding-left: 24px; margin: 0; }
.playlist li { padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.playlist li.current { font-weight: 600; color: var(--accent); }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--accent-2); color: var(--accent); white-space: nowrap; }
.badge.red { background: #fde8e8; color: var(--danger); } .badge.green { background: #e3f6ea; color: var(--ok); } .badge.gray { background: var(--line); color: var(--muted); }
.removal { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.removal .title { font-weight: 600; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 8px 0; position: relative; }
.bar > div { height: 100%; background: var(--danger); }
.bar .mark { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.log li .t { color: var(--muted); font-size: 12px; margin-right: 6px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table td.actions { text-align: right; white-space: nowrap; }
.table td.actions button { margin-left: 4px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; z-index: 50; max-width: 90vw; }
.toast.error { background: var(--danger); color: #fff; }
@media (max-width: 600px) { .topbar { padding: 10px 16px; } main { padding: 16px; } }
code{background:var(--accent-2);padding:1px 6px;border-radius:5px} details summary{cursor:pointer;font-weight:600;margin:6px 0} details ol{line-height:1.6}
.banners { position: fixed; top: 64px; right: 16px; z-index: 40; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.banner { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 10px 12px; box-shadow: 0 6px 20px rgba(0,0,0,.12); display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.banner.hot { border-left-color: var(--warn); }
.banner span { flex: 1; }
.events { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 12px; margin-bottom: 8px; }
.lyrics { margin: -4px 0 16px; padding: 10px 12px; border-radius: 10px; background: var(--accent-2); text-align: center; line-height: 1.35; }
.lyrics .ly { min-height: 1.35em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lyrics .prev, .lyrics .next { font-size: 13px; color: var(--muted); }
.lyrics .cur { font-size: 17px; font-weight: 600; color: var(--accent); margin: 2px 0; }
.lyrics .cur.muted { font-size: 13px; font-weight: 400; color: var(--muted); }
.wx { display: grid; grid-template-columns: minmax(200px, 1.2fr) 1fr 1.3fr; gap: 16px; padding: 12px 16px; align-items: start; }
.wx-main { display: flex; gap: 10px; align-items: center; }
.wx-icon { font-size: 34px; line-height: 1; }
.wx-temp { font-size: 24px; font-weight: 700; }
.wx-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 3px; }
.wx-warn { margin-top: 4px; color: var(--warn); cursor: help; }
.wx-list { margin: 0; padding: 0; list-style: none; } .wx-list li { margin-bottom: 2px; }
@media (max-width: 760px) { .wx { grid-template-columns: 1fr; gap: 8px; } }
/* Kalendarz */
.cal-layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.cal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.cal-head h2 { margin: 0; min-width: 160px; text-align: center; }
.cal-legend { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-legend .chip { display: inline-block; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-dow { font-size: 12px; color: var(--muted); text-align: center; padding: 6px 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg); }
.cal-day { min-height: 96px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; overflow: hidden; }
.cal-day:hover { background: var(--accent-2); }
.cal-day.other { opacity: .45; }
.cal-day.weekend .cal-num { color: var(--danger); }
.cal-num { font-size: 13px; font-weight: 600; margin-bottom: 2px; width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; }
.cal-day.today .cal-num { background: var(--accent); color: #fff !important; }
.chip { font-size: 11px; line-height: 1.3; padding: 1px 5px; border-radius: 4px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid; }
.chip.event { background: #e6efff; color: #1d4fb8; border-color: #3a74e0; }
.chip.vacation { background: #e3f6ea; color: #17713f; border-color: #1f9d55; }
.chip.reminder { background: #fff2dc; color: #8a5400; border-color: #e09a1e; }
.chip.holiday { background: #fde8e8; color: #a32f2f; border-color: #d64545; }
@media (prefers-color-scheme: dark) {
  .chip.event { background: #1d2c4d; color: #a9c4ff; } .chip.vacation { background: #173326; color: #9ee0b7; }
  .chip.reminder { background: #3a2d12; color: #f3d39b; } .chip.holiday { background: #3d1d1d; color: #f3aaaa; }
}
.more { font-size: 11px; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 5px; }
.dot.event { background: #3a74e0; } .dot.vacation { background: #1f9d55; } .dot.reminder { background: #e09a1e; }
.up-item { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.up-item:hover b { color: var(--accent); }
dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); padding: 20px; width: min(460px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.35); }
.seg { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.seg label { margin: 0; display: flex; align-items: center; gap: 4px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); cursor: pointer; }
.seg label:has(input:checked) { border-color: var(--accent); background: var(--accent-2); }
.row2 { display: grid; grid-template-columns: 1fr 1fr 110px; gap: 8px; }
.note { white-space: pre-wrap; background: var(--bg); padding: 8px 10px; border-radius: 8px; }
@media (max-width: 860px) { .cal-layout { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .cal-day { min-height: 58px; padding: 2px; }
  .cal-day .chip { font-size: 0; height: 6px; padding: 0; margin: 1px 0; border-left: 0; }
  .cal-day .more { display: none; }
  .row2 { grid-template-columns: 1fr 1fr; }
}
.today-card { padding: 10px 16px; }
.today-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.today-list .chip { font-size: 13px; padding: 4px 9px; margin: 0; cursor: pointer; white-space: normal; }
#today-date { text-transform: none; letter-spacing: 0; }
/* Główna */
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; align-items: start; }
.home-main > .card { margin-bottom: 16px; }
.online-card { position: sticky; top: 72px; padding: 12px 14px; }
.online-list { list-style: none; margin: 6px 0 0; padding: 0; }
.online-list li { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.online-list .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-2); color: var(--accent); font-weight: 700; font-size: 12px; display: grid; place-items: center; flex: none; position: relative; }
.avatar::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); border: 2px solid var(--card); }
.wx-full { padding: 16px; }
.wx-top { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.wx-full .wx-icon { font-size: 44px; } .wx-full .wx-temp { font-size: 32px; }
.wx-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px 18px; flex: 1; max-width: 620px; }
.wx-details div { display: flex; flex-direction: column; } .wx-details b { font-weight: 600; }
.wx-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.wx-warn summary { cursor: pointer; color: var(--warn); margin-top: 6px; font-weight: 400; }
.wx-warn div { margin-top: 4px; padding: 6px 8px; background: var(--bg); border-radius: 6px; }
.wx-src { margin-top: 10px; font-size: 11px; }
.home-track { font-size: 18px; font-weight: 600; margin: 2px 0; }
.home-actions { text-align: center; }
.hot { color: var(--danger); }
@media (max-width: 760px) { .home-layout { grid-template-columns: 1fr; } .online-card { position: static; order: -1; } .wx-bottom { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .online-list { display: flex; flex-wrap: wrap; gap: 2px 14px; } }
@media (max-width: 760px) {
  .home-layout { grid-template-columns: minmax(0, 1fr); }
  nav { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; }
  .tab { white-space: nowrap; padding: 6px 10px; }
  .wx-details { min-width: 0; }
}
@media (max-width: 760px) {
  .wx-top { flex-direction: column; align-items: stretch; gap: 10px; }
  .wx-details { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; }
  .topbar { max-width: 100vw; }
}
