/* Kolorystyka i UI jak w aplikacji Android (watgreen + półprzezroczyste białe karty) */

/* Roboto (czcionka z Androida) - hostowana lokalnie, wariacyjna 100-900 */
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/roboto-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/roboto-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Roboto';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/roboto-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Roboto';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/roboto-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --green-dark: #0f3824;
  --green: #195d3c;
  --green-light: #84B8A0;
  --card: rgba(255, 255, 255, .80);      /* lvItem #CCFFFFFF */
  --card-hidden: rgba(187, 187, 187, .73); /* lvItemHidden #BBBBBBBB */
  --text-on-card: #000;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font-family: inherit; }

html, body {
  color: #fff;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.4;
  min-height: 100%;
  background: var(--green) url(res/bg.png?v=1) no-repeat center center fixed;
  background-size: cover;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body { padding: 0 0 env(safe-area-inset-bottom) 0; }

.view { max-width: 640px; margin: 0 auto; min-height: 100vh; position: relative; padding-bottom: 90px; }
.hidden { display: none !important; }
.muted { color: rgba(255,255,255,.75); }
.card .muted, .list-item .muted { color: rgba(0,0,0,.55); }
.small { font-size: 13px; }
.mt { margin-top: 12px; }
.pad { padding: 12px; }
.pad-h { margin: 12px; }
.empty { text-align: center; color: #fff; padding: 40px 20px; line-height: 1.6; text-shadow: 0 1px 3px rgba(0,0,0,.4); }

/* ---------- pasek górny (toolbar jak w Android) ---------- */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
  position: sticky; top: 0; z-index: 10;
  background: var(--green);
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  color: #fff;
}
.topbar h2 { font-size: 19px; flex: 1; font-weight: 500; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-logo { width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0; }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h2 { font-size: 17px; }
.topbar-actions { display: flex; gap: 6px; }

.iconbtn {
  background: rgba(255,255,255,.14); color: #fff; border: none;
  width: 40px; height: 40px; border-radius: 10px; font-size: 18px; cursor: pointer;
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
}
.iconbtn:active { background: rgba(255,255,255,.3); }

/* ---------- przyciski / pola ---------- */
.btn {
  display: block; width: 100%; padding: 14px; border-radius: var(--radius);
  border: none; background: var(--card); color: var(--text-on-card);
  font-size: 15px; font-weight: 500; font-family: inherit; cursor: pointer; text-align: center;
}
.btn.primary { background: var(--green); color: #fff; font-weight: 600; box-shadow: 0 2px 5px rgba(0,0,0,.25); }
.btn.primary:active { background: var(--green-dark); }
.btn.danger { background: rgba(255,158,158,.9); color: #5d1010; }
.btn.ghost { background: rgba(255,255,255,.14); color: #fff; }
.btn.small { width: auto; padding: 8px 14px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }

input, select {
  width: 100%; padding: 13px; border-radius: var(--radius);
  border: none; background: var(--card); color: var(--text-on-card);
  font-size: 16px; font-family: inherit; outline: none; appearance: none;
}
input::placeholder { color: rgba(0,0,0,.45); }
input:focus { outline: 2px solid var(--green-light); }
.field-label {
  display: block; margin: 16px 0 6px; font-size: 12px; font-weight: 500; color: rgba(255,255,255,.9);
  text-transform: uppercase; letter-spacing: 1px; text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.row .btn { width: auto; flex: 0 0 auto; padding-left: 18px; padding-right: 18px; }

/* ---------- logowanie ---------- */
#view-login { display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box {
  width: 100%; max-width: 360px; text-align: center; display: flex; flex-direction: column; gap: 14px;
  background: var(--card); color: var(--text-on-card); border-radius: 14px; padding: 24px 18px;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.login-box h1 { font-size: 24px; color: var(--green-dark); }
.test-note {
  font-size: 13px; font-weight: 500; color: #8a6d00;
  background: rgba(255, 224, 130, .55); border-radius: 8px; padding: 6px 10px;
}
.payu-note {
  font-size: 12.5px; line-height: 1.5; color: #8a6d00;
  background: rgba(255, 224, 130, .4); border-radius: 8px; padding: 8px 10px;
}
#buy-premium-plans { display: flex; flex-direction: column; gap: 10px; }
.login-box .muted { color: rgba(0,0,0,.55); }
.login-logo { width: 84px; height: 84px; border-radius: 18px; margin: 0 auto; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
#login-step-email, #login-step-pin { display: flex; flex-direction: column; gap: 10px; }
#login-step-pin .btn.ghost { color: var(--green); background: transparent; }
.login-box input { background: #fff; border: 1px solid rgba(0,0,0,.2); }
#login-pin { text-align: center; letter-spacing: 8px; font-size: 24px; }
.play-link {
  display: block; margin-top: 6px; padding: 12px; border-radius: var(--radius);
  background: var(--green-dark); color: #fff; text-decoration: none; font-size: 14px;
}
.play-link:active { background: var(--green); }

/* ---------- listy ---------- */
.list { padding: 10px 14px; display: flex; flex-direction: column; gap: 12px; }
.list-item {
  background: var(--card); border-radius: 12px; color: var(--text-on-card);
  padding: 10px 12px; cursor: pointer; display: flex; align-items: center; gap: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .28), 0 1px 2px rgba(0, 0, 0, .18);
  transition: transform .08s ease, box-shadow .08s ease;
}
.list-item:active {
  background: rgba(255,255,255,.95);
  transform: scale(.985);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.list-item.selected { outline: 3px solid var(--green); outline-offset: -3px; }
/* na liście "Dodaj plan" - plan już świeżo scache'owany na serwerze, otworzy się od razu */
#add-list .list-item.cached { background: var(--green-light); }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .li-sub { font-size: 13px; color: rgba(0,0,0,.55); margin-top: 2px; }
.li-del { background: none; border: none; color: rgba(0,0,0,.4); font-size: 18px; cursor: pointer; padding: 6px; flex-shrink: 0; }
.li-del:active { color: #b00; }

/* wykres kolowy urzadzen (panel admina - Staty) */
.pie-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pie-svg { width: 120px; height: 120px; flex-shrink: 0; }
.pie-legend { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-on-card); }
.pie-legend-row { display: flex; align-items: center; gap: 6px; }
.pie-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* kompaktowa lista cache w panelu admina */
#plan-cache-list .list { gap: 4px; padding: 6px 0; }
#plan-cache-list .list-item {
  padding: 4px 8px; cursor: default; box-shadow: none; border: 1px solid rgba(0,0,0,.1); border-radius: 6px;
}
#plan-cache-list .li-title { font-size: 11px; line-height: 1.3; white-space: normal; word-break: break-all; }
#plan-cache-list .li-sub { font-size: 10px; margin-top: 0; line-height: 1.3; }
#plan-cache-list .list-item.expired { border-color: rgba(192,57,43,.4); background: rgba(192,57,43,.08); }
#plan-cache-list .expired-label { color: #c0392b; font-weight: 700; }
#plan-cache-list .src-android {
  display: inline-block; font-size: 10px; font-weight: 600; color: var(--green-dark);
  background: var(--green-light); border-radius: 4px; padding: 1px 5px; margin-left: 4px;
}

/* karta planu na liście "Moje plany" - jak favplan w Android */
.favplan { display: block; padding: 12px 14px; }
.favplan .fp-top {
  display: flex; justify-content: space-between; font-size: 13px; font-weight: 400;
  color: rgba(0,0,0,.55); letter-spacing: .3px;
}
.favplan .fp-mid { display: flex; align-items: center; }
.favplan .fp-name {
  flex: 1; text-align: center; font-size: 26px; font-weight: 300; padding: 8px 0 4px; color: #000;
  overflow: hidden; text-overflow: ellipsis; letter-spacing: .3px;
}
.favplan .fp-bottom { text-align: center; font-size: 14px; font-weight: 300; color: rgba(0,0,0,.7); }
.favplan .fp-updated { text-align: left; font-size: 11px; color: rgba(0,0,0,.45); margin-top: 2px; }
.favplan .fp-updated.stale { color: #c0392b; font-weight: 600; }
.favplan .li-del {
  width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,.06);
  display: flex; align-items: center; justify-content: center; font-size: 15px; padding: 0;
}
.favplan .li-del:active { background: rgba(192,80,77,.2); color: #b00; }

/* zablokowany plan (konto darmowe, plan poza pierwszym) */
.favplan.locked-plan { opacity: .55; filter: grayscale(.7); }
.favplan.locked-plan .fp-name { color: rgba(0,0,0,.5); }

.banner {
  margin: 12px 12px 0; padding: 12px 14px; border-radius: var(--radius);
  background: var(--card); color: var(--text-on-card); font-size: 14px; line-height: 1.4;
}
.banner.warn { background: rgba(255, 236, 179, .9); }

/* dyskretna informacja o premium na dole listy planów */
#premium-banner {
  margin: 18px 16px 0; text-align: center; font-size: 12.5px;
  color: rgba(255,255,255,.75); text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
#premium-banner.warn { color: #ffe9a8; }

/* ---------- FAB (jak w Android - ciemnozielony) ---------- */
.fab {
  position: fixed; right: max(18px, calc((100vw - 640px) / 2 + 18px)); bottom: calc(24px + env(safe-area-inset-bottom));
  width: 58px; height: 58px; border-radius: 50%; border: none;
  background: var(--green-dark); color: #fff; font-size: 28px; cursor: pointer;
  box-shadow: 0 5px 14px rgba(0,0,0,.45); z-index: 20;
}
.fab:active { background: var(--green); }

/* ---------- segmenty ---------- */
.seg { display: flex; background: rgba(255,255,255,.25); border-radius: var(--radius); padding: 4px; gap: 4px; }
.seg-btn {
  flex: 1; padding: 10px 6px; border: none; background: transparent; color: #fff;
  border-radius: 8px; font-size: 14px; cursor: pointer; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.3);
}

/* wiele zakladek (np. panel admina) - scroll zamiast sciskania przyciskow */
#admin-tabs {
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
#admin-tabs::-webkit-scrollbar { display: none; }
#admin-tabs .seg-btn { flex: 0 0 auto; padding: 10px 14px; }
.seg-btn.active { background: var(--card); color: var(--green-dark); font-weight: 600; text-shadow: none; }
.seg-btn.locked::after { content: ' ⭐'; font-size: 11px; }
.menu-item.locked::after { content: ' — Premium ⭐'; font-size: 12px; opacity: .8; }
.btn.locked::after { content: ' ⭐'; }

/* ---------- widok planu ---------- */
.daynav { display: flex; align-items: center; gap: 8px; padding: 10px 12px 4px; }
.daynav > button, .daynav .day-label {
  height: 44px; box-sizing: border-box; display: flex; align-items: center; justify-content: center;
}
.day-label {
  flex: 1; text-align: center; font-weight: 400; font-size: 17px; cursor: pointer;
  background: var(--card); color: #000; border-radius: var(--radius); padding: 0 6px;
}
.daynav .iconbtn { background: var(--card); color: #000; width: 44px; font-size: 26px; }
.daynav .btn.ghost { background: var(--card); color: #000; padding: 0 14px; }

.date-strip {
  display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.date-strip::-webkit-scrollbar { display: none; }
.date-chip {
  flex-shrink: 0; padding: 7px 9px; border-radius: 10px; border: none;
  background: var(--card); color: rgba(0,0,0,.6); font-size: 12px; cursor: pointer; text-align: center; min-width: 50px;
}
.date-chip .dc-day { font-size: 16px; font-weight: 700; color: #000; }
.date-chip.active { background: var(--green-dark); }
.date-chip.active .dc-day, .date-chip.active { color: #fff; }
.date-chip.today { outline: 2px solid var(--green-dark); }
/* dzień bez zajęć - zielony */
.date-chip.free { background: var(--green-light); color: var(--green-dark); }
.date-chip.free .dc-day { color: var(--green-dark); }
.date-chip.free.active { background: var(--green-dark); }
.date-chip.free.active .dc-day, .date-chip.free.active { color: #fff; }

.day-blocks { padding: 6px 12px 120px; display: flex; flex-direction: column; gap: 6px; }

/* cały semestr jedną listą (jak w apce Android) */
#semester-list-bar { padding: 8px 12px 0; }
#semester-list-bar .btn { background: var(--card); color: #000; }
#semester-list { padding: 8px 12px 120px; display: flex; flex-direction: column; gap: 6px; }
.cal-month-header {
  font-size: 20px; font-weight: 700; color: #fff; text-align: center; letter-spacing: .5px;
  background: var(--green-dark); border-radius: 10px; padding: 12px;
  margin-top: 18px; box-shadow: 0 3px 10px rgba(0,0,0,.3);
}
.cal-month-header:first-child { margin-top: 0; }
.cal-day-row {
  background: var(--card-hidden); border-radius: 10px; padding: 10px 12px; color: #000; cursor: pointer;
}
.cal-day-row.past { opacity: .6; }
.cal-day-row.free { background: var(--green-light); }
.cal-day-row.free .cal-free { color: #14351f; }
.cal-day-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cal-day-date { font-size: 19px; font-weight: 400; }
.cal-day-name { font-size: 14px; color: rgba(0,0,0,.65); white-space: nowrap; }
.cal-free { font-size: 14px; color: rgba(0,0,0,.6); margin-top: 4px; }
.cal-line { font-size: 14.5px; color: rgba(0,0,0,.85); margin-top: 4px; white-space: pre-wrap; }

/* karta lekcji - odwzorowanie layout_item_timebox_simple */
.tbcard {
  display: flex; gap: 8px; border-radius: var(--radius); padding: 7px 8px;
  background: var(--card); color: #000; overflow-wrap: anywhere;
}
.tbcard.empty { background: var(--card-hidden); min-height: 46px; text-shadow: none; }
.tb-time {
  width: 44px; flex-shrink: 0; display: flex; flex-direction: column;
  justify-content: space-between; font-size: 14px; color: #000; padding: 2px 0;
  min-height: 58px;
}
.tb-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tb-toprow { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; min-height: 15px; }
.tb-note { font-style: italic; flex: 1; text-align: center; }
.tb-type { text-align: right; white-space: pre-line; }
.tb-fullname { font-size: 20px; font-weight: 300; line-height: 1.25; }
.tb-extra { text-align: center; font-size: 14px; font-weight: 300; white-space: pre-line; margin-top: 2px; }
.tb-bottomrow { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.tb-pb { flex: 3; height: 7px; background: rgba(0,0,0,.15); border-radius: 4px; overflow: hidden; visibility: hidden; }
.tb-pb > div { height: 100%; background: var(--green); border-radius: 4px; }
.tb-pb.on { visibility: visible; }
.tb-location { flex: 4; text-align: center; font-size: 12px; font-weight: 300; min-height: 14px; }

/* karta z datą (wyniki wyszukiwania) */
.tb-datehead { text-align: center; font-size: 15px; color: #000; padding: 2px 0 6px; }
.search-result { background: var(--card); border-radius: var(--radius); padding: 7px 8px 7px; color: #000; }
.search-result .tbcard { padding: 0; background: transparent; border-radius: 0; }
.search-result.colored { }

/* przerwa :) */
.break-card {
  background: var(--card); border-radius: var(--radius); text-align: center;
  padding: 8px; font-size: 15px; color: #000; white-space: pre-line;
}

/* wyszukiwarka (power search) jak w Android - zielone pole */
#plan-search { padding: 10px 12px 4px; }
#power-search {
  background: var(--green); color: #fff; border: none; padding: 13px;
}
#power-search::placeholder { color: rgba(255,255,255,.7); }
#search-results { padding: 8px 12px 120px; display: flex; flex-direction: column; gap: 8px; }

/* dolny pasek: nazwa planu + data aktualizacji */
.plan-bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  max-width: 640px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--card); color: #000; font-size: 13px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  border-radius: 10px 10px 0 0;
}
.plan-bottombar span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bb-updated { font-size: 12px; }
#bb-updated.stale { color: #e74c3c; font-weight: 600; }
.plan-bottombar .muted { color: rgba(0,0,0,.55); }

/* ---------- arkusz przedmiotów ---------- */
.sheet {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50;
  display: flex; align-items: flex-end;
}
.sheet-inner {
  background: #f3f5f3; color: #000; width: 100%; max-width: 640px; margin: 0 auto;
  border-radius: 16px 16px 0 0; max-height: 80vh; overflow-y: auto; padding: 16px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet .iconbtn { background: rgba(0,0,0,.08); color: #000; }
.sheet .field-label, .field-label.dark { color: rgba(0,0,0,.6); text-shadow: none; }
.sheet .seg, .card .seg { background: rgba(0,0,0,.08); }
.sheet .seg-btn, .card .seg-btn { color: rgba(0,0,0,.55); text-shadow: none; }
.sheet .seg-btn.active, .card .seg-btn.active { background: var(--green); color: #fff; }
.sheet input, .sheet select { background: #fff; border: 1px solid rgba(0,0,0,.2); }
.sheet .list-item { background: #fff; border: 1px solid rgba(0,0,0,.1); }
.sheet .empty { color: rgba(0,0,0,.5); text-shadow: none; padding: 16px; }
.sheet .muted { color: rgba(0,0,0,.55); text-shadow: none; }
.lesson-row { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,.12); align-items: flex-start; }
.lesson-color { width: 14px; height: 14px; border-radius: 4px; margin-top: 3px; flex-shrink: 0; border: 1px solid rgba(0,0,0,.2); }
.lesson-info { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; }
.lesson-info .muted { color: rgba(0,0,0,.55); }
.lesson-info .l-profs { color: rgba(0,0,0,.6); font-size: 13px; white-space: pre-line; }

/* okno "Więcej informacji o przedmiocie" - jak w Android (ciemnozielone, lista wszystkich terminów) */
.sheet-inner.dark {
  background: var(--green-dark); color: #fff;
}
#li-title { font-size: 22px; font-weight: 700; text-align: center; padding: 6px 8px 14px; }
.li-header-card {
  background: var(--green-light); color: #0a2a1a; border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 10px;
}
.li-header-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 19px; }
.li-header-profs { margin-top: 6px; font-size: 15px; }
.li-occ-list { display: flex; flex-direction: column; gap: 8px; }
.li-occ-row { background: var(--card); color: #000; border-radius: var(--radius); padding: 10px 14px; }
.li-occ-row.past { background: var(--card-hidden); }
.li-occ-top, .li-occ-bottom { display: flex; justify-content: space-between; gap: 10px; }
.li-occ-top { font-size: 18px; }
.li-occ-bottom { font-size: 14px; margin-top: 4px; opacity: .75; }
.li-close-row { text-align: right; padding: 14px 4px 0; }
.li-close-btn {
  background: none; border: none; color: #fff; font-weight: 700; font-size: 15px;
  letter-spacing: .3px; cursor: pointer; padding: 10px;
}

/* postęp przedmiotu (ile bloków zrobione) - jak w Android */
.lesson-progress { margin-top: 6px; }
.lesson-progress .lp-bar {
  height: 7px; background: rgba(0,0,0,.12); border-radius: 4px; overflow: hidden;
}
.lesson-progress .lp-bar > div { height: 100%; background: var(--green); border-radius: 4px; }
.lesson-progress .lp-text { font-size: 12px; color: rgba(0,0,0,.55); margin-top: 3px; }
.lesson-progress.finished .lp-bar > div { background: var(--green-light); }
.lesson-progress.finished .lp-text { color: var(--green); font-weight: 500; }

/* ogólny postęp semestru na górze listy przedmiotów */
#lessons-overall {
  background: #fff; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px;
  border: 1px solid rgba(0,0,0,.1);
}
#lessons-overall .op-bar { height: 10px; background: rgba(0,0,0,.12); border-radius: 5px; overflow: hidden; }
#lessons-overall .op-bar > div { height: 100%; background: var(--green); border-radius: 5px; }
#lessons-overall .op-text { text-align: center; font-size: 13.5px; color: rgba(0,0,0,.7); margin-top: 6px; font-weight: 500; }

/* ---------- karty / admin ---------- */
.card { background: var(--card); color: var(--text-on-card); border-radius: var(--radius); padding: 14px; }
.card h3 { margin-bottom: 8px; font-size: 16px; color: var(--green-dark); }
.account-email { font-size: 17px; font-weight: 600; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--card); color: #000; border-radius: var(--radius); padding: 14px; text-align: center; }
.stat .stat-val { font-size: 26px; font-weight: 700; color: var(--green); }
.stat .stat-name { font-size: 12px; color: rgba(0,0,0,.55); margin-top: 4px; }

.admin-user { margin-bottom: 10px; }
.admin-user .au-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-user .au-email { font-weight: 600; word-break: break-all; }
.admin-user .au-meta { font-size: 13px; color: rgba(0,0,0,.6); margin-top: 6px; line-height: 1.6; }
.badge { font-size: 11px; padding: 3px 8px; border-radius: 8px; font-weight: 600; }
.badge.premium { background: var(--green); color: #fff; }
.badge.free { background: rgba(0,0,0,.1); color: rgba(0,0,0,.6); }
.badge.admin { background: #8a7422; color: #fff; }

.premium-benefits {
  background: rgba(77, 158, 77, .12); border: 1px solid rgba(77, 158, 77, .3);
  border-radius: 10px; padding: 10px 12px; font-size: 13px; color: rgba(0,0,0,.75);
}
.premium-benefits b { color: var(--green-dark); }
.premium-benefits ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.6; }
.badge.play { background: #1a73e8; color: #fff; }
.admin-user input[type="date"] { background: #fff; border: 1px solid rgba(0,0,0,.2); padding: 8px 10px; font-size: 14px; }

.code-row {
  display: flex; justify-content: space-between; gap: 8px; padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,.12); font-size: 14px; align-items: center;
}
.code-row code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.code-row .used { color: rgba(0,0,0,.4); text-decoration: line-through; }
.code-row .muted { color: rgba(0,0,0,.55); }

.dept-form { display: flex; flex-direction: column; gap: 8px; }
.df-status {
  font-size: 13px; line-height: 1.6; color: rgba(0,0,0,.6);
  background: rgba(0,0,0,.05); border-radius: 8px; padding: 8px 10px;
}
.df-status .ok { color: var(--green); }
.df-status .err { color: #b02e2b; font-weight: 500; }
.dept-form input, .dept-form select { padding: 10px 12px; font-size: 14px; background: #fff; border: 1px solid rgba(0,0,0,.2); }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: rgba(0,0,0,.7); cursor: pointer; }
.check-row input { width: auto; }

/* checkboxy: przywracamy natywny wygląd (globalne appearance:none psuło "ptaszka") */
input[type="checkbox"], input[type="radio"] {
  appearance: auto; -webkit-appearance: auto;
  width: 19px; height: 19px; padding: 0; flex-shrink: 0;
  accent-color: var(--green);
  cursor: pointer;
}

/* FAB-y w widoku planu (nad dolnym paskiem): menu na dole, lista przedmiotów nad nim - jak w Android */
.plan-fab { bottom: calc(56px + env(safe-area-inset-bottom)); }
.plan-fab2 { bottom: calc(126px + env(safe-area-inset-bottom)); font-size: 24px; }

.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-item {
  display: block; width: 100%; text-align: left; padding: 14px;
  background: #fff; color: #000; border: none; border-radius: var(--radius);
  font-size: 15px; cursor: pointer;
}
.menu-item:active { background: var(--green-light); }

textarea {
  width: 100%; padding: 13px; border-radius: var(--radius); resize: vertical;
  border: 1px solid rgba(0,0,0,.2); background: #fff; color: #000;
  font-size: 16px; outline: none; font-family: inherit; margin-top: 10px;
}
textarea:focus { outline: 2px solid var(--green-light); }

/* wskaźnik notatki na karcie */
.tb-note { color: rgba(0,0,0,.85); }

/* tryb porównania - dwie karty obok siebie */
.cmp-row { display: flex; gap: 6px; }
.cmp-row .tbcard { flex: 1; min-width: 0; }
.cmp-row .tb-fullname { font-size: 15px; }
.cmp-row .tb-time { width: 38px; font-size: 12px; min-height: 44px; }
.cmp-head { display: flex; gap: 6px; padding: 0 12px; }
.cmp-head > div {
  flex: 1; text-align: center; font-size: 13px; background: var(--green-dark); color: #fff;
  border-radius: 8px; padding: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* zgłoszenia w panelu admina */
.fb-item { margin-bottom: 10px; }
.fb-item .fb-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: rgba(0,0,0,.6); flex-wrap: wrap; }
.fb-item .fb-text { margin-top: 6px; white-space: pre-wrap; font-size: 14px; }
.fb-item.unread { outline: 2px solid var(--green); }

/* strony polityki i regulaminu */
.legal { max-width: 720px; margin: 0 auto; padding: 20px 14px 40px; }
.legal-back {
  display: inline-block; color: var(--text-on-card); text-decoration: none; margin-bottom: 12px;
  background: var(--card); padding: 10px 16px; border-radius: var(--radius); font-size: 14px; font-weight: 500;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .28), 0 1px 2px rgba(0, 0, 0, .18);
}
.legal .card { line-height: 1.6; font-size: 14.5px; }
.legal h1 { font-size: 24px; color: var(--green-dark); margin-bottom: 2px; }
.legal h2 { font-size: 16px; color: var(--green-dark); margin: 18px 0 6px; }
.legal ul { padding-left: 20px; margin: 6px 0; }
.legal li { margin: 4px 0; }
.legal p { margin: 6px 0; }
.legal a { color: var(--green); }
.legal-date { color: rgba(0,0,0,.5); font-size: 13px; margin-bottom: 10px; }

.legal-links { margin-top: 4px; font-size: 12.5px; }
.legal-links a { color: rgba(0,0,0,.5); text-decoration: none; }
.legal-links.on-green a { color: rgba(255,255,255,.75); }

#toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(30px + env(safe-area-inset-bottom)); z-index: 100;
  background: var(--green-dark); color: #fff; padding: 12px 20px; border-radius: 12px;
  font-size: 14px; max-width: 90%; text-align: center; box-shadow: 0 6px 18px rgba(0,0,0,.4);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
#toast.show { opacity: 1; }

/* ---------- Mapa WAT ---------- */
.map-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.map-suggestions button {
  background: var(--card); color: #000; border: none; border-radius: 8px;
  padding: 6px 10px; font-size: 13px; cursor: pointer;
}
.map-image-wrap {
  position: relative; margin: 4px 12px 24px; overflow: auto; border-radius: var(--radius);
  background: #fff;
}
.map-image-wrap > img#map-img, .map-image-wrap > img#admin-map-img { display: block; width: 100%; height: auto; }
#map-img-dim {
  position: absolute; inset: 0; width: 100%; height: 100%;
  filter: grayscale(1) brightness(.92); pointer-events: none;
}
.map-marker {
  position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border-radius: 50%; border: 4px solid #ff3b30; box-shadow: 0 0 0 rgba(255,59,48,.6);
  animation: map-pulse 1.4s ease-out infinite; pointer-events: none;
}
@keyframes map-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,59,48,.6); }
  70% { box-shadow: 0 0 0 16px rgba(255,59,48,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,59,48,0); }
}

/* edytor mapy w panelu admina */
.admin-map-wrap { cursor: crosshair; }
.admin-map-markers-layer, #admin-map-markers { position: absolute; inset: 0; pointer-events: none; }
.admin-map-pin {
  position: absolute; transform: translate(-50%, -50%); pointer-events: auto; cursor: pointer;
  background: #ff3b30; color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
  padding: 3px 5px; border-radius: 8px; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5);
  white-space: nowrap;
}
.admin-map-popup {
  position: absolute; z-index: 10; width: 220px;
  background: #fff; color: #000; border-radius: var(--radius); padding: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.5); transform: translate(-50%, 12px);
}
.admin-map-popup input { margin-bottom: 6px; padding: 8px; font-size: 13px; }
.admin-map-popup .row .btn { padding: 8px 10px; font-size: 13px; }

/* wlasny gest "pull to refresh" - w trybie standalone PWA (dodane do ekranu glownego na
   iOS) przegladarka nie daje wlasnego gestu odswiezania, bo nie ma paska przegladarki */
#ptr-indicator {
  position: fixed; top: 0; left: 50%; transform: translate(-50%, -100%);
  background: var(--green-dark); color: #fff; padding: 8px 16px; border-radius: 0 0 12px 12px;
  font-size: 13px; font-weight: 500; z-index: 200; box-shadow: 0 3px 10px rgba(0,0,0,.3);
  transition: transform .15s ease;
}
#ptr-indicator.visible { transform: translate(-50%, calc(env(safe-area-inset-top) + 0px)); }
#ptr-indicator.ready { background: var(--green); }
