:root{--bg:#0b1120;--surface:#111827;--text:#111827;--muted:#64748b;--line:#e5e7eb;--red:#921f32;--red2:#ad2941;--danger:#b42318;--green:#16804d;--blue:#2563eb;--soft:#f8fafc}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial;background:#f3f4f6;color:var(--text)}button,input,select,textarea{font:inherit}a{text-decoration:none;color:inherit}.hidden{display:none!important}.muted{color:var(--muted)}.small-text{font-size:12px}
.topbar{min-height:76px;background:var(--bg);color:#fff;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 24px;position:sticky;top:0;z-index:30;box-shadow:0 2px 12px #0002}.brand{display:flex;align-items:center;gap:12px}.brand-link:hover{opacity:.92}.logo{width:42px;height:42px;border-radius:11px;background:linear-gradient(135deg,var(--red2),#641425);display:grid;place-items:center;font-size:22px;font-weight:900}.brand strong{display:block;font-size:17px}.brand span{display:block;color:#cbd5e1;font-size:12px}.topbar-right{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.db-status{font-size:12px;font-weight:800;color:#fde68a}.db-status.ok{color:#86efac}.db-status.bad{color:#fca5a5}.teacher-badge{font-size:12px;background:#ffffff12;border:1px solid #ffffff25;padding:8px 10px;border-radius:999px;font-weight:800}
.wrap{max-width:1380px;margin:30px auto;padding:0 18px}.narrow-wrap{max-width:620px}.card{background:#fff;border:1px solid var(--line);border-radius:18px;padding:22px;box-shadow:0 8px 28px #0f172a0c;margin-bottom:20px}.hero{background:linear-gradient(135deg,#101827,#2b1620);color:#fff;border-radius:22px;padding:34px;margin-bottom:20px}.hero h1{font-size:clamp(32px,4vw,46px);margin:8px 0}.hero p{color:#d5dbea;max-width:850px}.student-hero{background:linear-gradient(135deg,#102019,#162538)}.eyebrow{font-size:11px;letter-spacing:.14em;font-weight:900;color:#c52f49}
.btn{border:0;background:var(--red);color:#fff;padding:11px 17px;border-radius:10px;font-weight:800;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}.btn:hover{background:var(--red2)}.btn-outline{background:transparent;border:1px solid #ffffff40}.btn-secondary{background:#475569}.btn-danger{background:var(--danger)}.link-btn{border:0;background:none;color:var(--red2);font-weight:800;cursor:pointer}.admin-btn{border:1px solid #ffffff38;background:#ffffff0a;color:#fff;padding:9px 14px;border-radius:10px;font-weight:800;cursor:pointer}.admin-btn:hover{background:#ffffff16}.admin-btn.logged{color:#86efac;border-color:#86efac55}
.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:20px}.stat-card{background:#fff;border:1px solid var(--line);border-radius:15px;padding:18px}.stat-card span{display:block;font-size:11px;text-transform:uppercase;color:var(--muted);font-weight:800}.stat-card strong{font-size:30px;display:block;margin-top:3px}.tabs{display:flex;gap:7px;padding:9px;position:sticky;top:88px;z-index:15;overflow:auto}.tab{border:0;background:transparent;padding:10px 16px;border-radius:9px;color:#475569;font-weight:800;cursor:pointer;white-space:nowrap}.tab.active{background:#f5e9ec;color:var(--red)}
.grid-2{display:grid;grid-template-columns:minmax(360px,.8fr) minmax(520px,1.2fr);gap:20px}.section-title{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}.section-title h2,.section-title h3{margin:3px 0 0}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.form-grid label,.stack-form label,.admin-form label{display:flex;flex-direction:column;gap:7px;font-weight:700;font-size:13px;color:#374151}.form-grid .full,.admin-grid .full{grid-column:1/-1}.compact{grid-template-columns:repeat(3,1fr)}.wide-field{grid-column:span 1}input,select,textarea{width:100%;border:1px solid #cbd5e1;border-radius:10px;padding:11px 12px;background:#fff;outline:none}input:focus,select:focus,textarea:focus{border-color:var(--red2);box-shadow:0 0 0 3px #ad29411d}.stack-form{display:flex;flex-direction:column;gap:14px}.teacher-login-card{margin-top:70px;padding:30px}.teacher-login-card h1{font-size:38px;margin:8px 0}.small-select{max-width:180px}.search{max-width:340px}
.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;font-size:14px}th,td{padding:11px 10px;border-bottom:1px solid var(--line);text-align:left;vertical-align:middle}th{font-size:11px;color:var(--muted);text-transform:uppercase;white-space:nowrap}.icon-btn{border:0;background:#eef2f7;padding:7px 9px;border-radius:8px;font-weight:700;cursor:pointer}.icon-btn.danger{background:#fee2e2;color:var(--danger)}
.class-filter,.attendance-tools{display:flex;gap:8px;flex-wrap:wrap}.chip-btn{border:1px solid #cbd5e1;background:#fff;padding:8px 12px;border-radius:999px;font-weight:700;cursor:pointer}.chip-btn.active-filter{background:var(--red);color:#fff;border-color:var(--red)}.attendance-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:18px 0}.class-checks{display:flex;gap:10px;flex-wrap:wrap;margin-top:6px}.check-card{position:relative!important;display:block!important}.check-card input{position:absolute;opacity:0;pointer-events:none}.check-card span{display:block;padding:10px 18px;border:1px solid #cbd5e1;border-radius:11px;background:#fff;font-size:14px;font-weight:900;cursor:pointer}.check-card input:checked+span{background:#f4e7ea;border-color:#b52c45;color:var(--red)}.selected-class-summary{font-size:13px;color:#475569;font-weight:800;margin:2px 0 12px}.attendance-roster{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin:15px 0 18px}.attendance-person{display:grid;grid-template-columns:1fr 155px;gap:10px;align-items:center;border:1px solid var(--line);border-radius:12px;padding:10px}.attendance-person strong{display:block}.attendance-person small{color:var(--muted)}.class-group-label{grid-column:1/-1;margin-top:10px;padding:8px 2px 2px;font-weight:900;color:var(--red);border-bottom:1px solid #e5e7eb}
.history-list{display:flex;flex-direction:column;gap:9px}.history-item{border:1px solid var(--line);border-radius:12px;padding:12px;display:flex;justify-content:space-between;gap:12px}.history-item p{margin:7px 0 0}.lesson-class-badges{display:flex;gap:5px;flex-wrap:wrap;margin-bottom:5px}.class-badge{display:inline-block;background:#eef2ff;color:#3730a3;font-size:10px;font-weight:900;padding:4px 7px;border-radius:999px}
.alert{padding:12px 14px;border-radius:10px;margin-top:12px}.alert-error{background:#fee2e2;color:#991b1b;border:1px solid #fecaca}.admin-message{margin-top:16px;border-radius:10px;padding:11px 13px;font-weight:700;font-size:13px;background:#dcfce7;color:#166534;border:1px solid #bbf7d0}.admin-message.error{background:#fee2e2;color:#991b1b;border-color:#fecaca}
.admin-modal{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:18px}.admin-backdrop{position:absolute;inset:0;background:#020617b8;backdrop-filter:blur(5px)}.admin-dialog{position:relative;z-index:1;width:min(520px,100%);max-height:92vh;overflow:auto;background:#fff;border-radius:20px;padding:28px;box-shadow:0 30px 90px #0006;border:1px solid #e5e7eb}.admin-dialog-large{width:min(960px,100%)}.admin-dialog h2{font-size:27px;margin:6px 0 8px}.admin-close{position:absolute;right:14px;top:12px;width:38px;height:38px;border:0;border-radius:10px;background:#f1f5f9;color:#475569;font-size:26px;cursor:pointer}.admin-form{display:flex;flex-direction:column;gap:14px;margin-top:18px}.admin-grid{display:grid;grid-template-columns:1fr 1fr}.admin-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.admin-tabs{display:flex;gap:8px;border-bottom:1px solid var(--line);margin:18px 0}.admin-tab{border:0;background:none;padding:10px 12px;font-weight:900;color:#64748b;cursor:pointer;border-bottom:2px solid transparent}.admin-tab.active{color:var(--red);border-color:var(--red)}.admin-teacher-grid{display:grid;grid-template-columns:360px 1fr;gap:24px}.teacher-account-list{display:flex;flex-direction:column;gap:9px}.teacher-account{border:1px solid var(--line);border-radius:12px;padding:12px;display:flex;align-items:center;justify-content:space-between;gap:10px}.teacher-account small{color:var(--muted)}.teacher-account .inactive{color:#b42318}.check-line{display:flex!important;flex-direction:row!important;align-items:center!important;gap:8px!important}.check-line input{width:auto}
.landing-body{background:radial-gradient(circle at 50% -20%,#2a1720 0,#0b1120 42%,#080d18 100%);min-height:100vh;color:#fff}.landing-topbar{background:transparent;box-shadow:none;position:relative}.landing-wrap{max-width:1120px;margin:50px auto;padding:0 20px}.landing-hero{text-align:center;max-width:780px;margin:0 auto 40px}.landing-hero h1{font-size:clamp(40px,6vw,68px);line-height:1.02;margin:10px 0 16px}.landing-hero p{color:#cbd5e1;font-size:18px;line-height:1.6}.view-choice-grid{display:grid;grid-template-columns:1fr 1fr;gap:22px}.view-choice{position:relative;display:flex;gap:18px;padding:30px;border:1px solid #ffffff18;border-radius:22px;background:#ffffff0b;backdrop-filter:blur(10px);transition:.2s ease;min-height:245px}.view-choice:hover{transform:translateY(-4px);background:#ffffff10;border-color:#ffffff2d}.choice-icon{width:58px;height:58px;flex:0 0 58px;border-radius:15px;background:#ffffff12;display:grid;place-items:center;font-size:28px}.view-choice h2{font-size:30px;margin:8px 0 10px}.view-choice p{color:#cbd5e1;line-height:1.55}.choice-link{display:inline-block;margin-top:15px;font-weight:900;color:#fff}.student-choice{box-shadow:inset 0 1px #ffffff10}.teacher-choice{background:linear-gradient(145deg,#ffffff0b,#921f3214)}
.public-filters{display:grid;grid-template-columns:220px 1fr;gap:16px}.public-filters label{font-weight:800;font-size:13px}.public-filters label input,.public-filters label select{margin-top:7px}.public-title{margin-top:28px}.public-lessons-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.public-lesson-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:18px;box-shadow:0 6px 20px #0f172a0a}.public-lesson-card h3{margin:9px 0 8px}.public-lesson-meta{font-size:12px;color:var(--muted);line-height:1.6}.public-lesson-topic{font-size:14px;line-height:1.5;margin-top:12px}.public-date{font-weight:900;color:#334155}
footer{text-align:center;color:#64748b;padding:28px}.landing-body footer{color:#94a3b8}
@media(max-width:1100px){.grid-2{grid-template-columns:1fr}.stats-grid{grid-template-columns:1fr 1fr}.public-lessons-grid{grid-template-columns:1fr 1fr}.admin-teacher-grid{grid-template-columns:1fr}.compact{grid-template-columns:1fr 1fr}}
@media(max-width:700px){.topbar{padding:10px 12px}.db-status{display:none}.wrap{padding:0 10px}.hero h1{font-size:32px}.form-grid,.compact,.admin-grid{grid-template-columns:1fr}.form-grid .full,.admin-grid .full{grid-column:auto}.attendance-roster{grid-template-columns:1fr}.attendance-person{grid-template-columns:1fr}.stats-grid{grid-template-columns:1fr 1fr}.tabs{top:100px}.view-choice-grid{grid-template-columns:1fr}.view-choice{min-height:0}.public-filters{grid-template-columns:1fr}.public-lessons-grid{grid-template-columns:1fr}.landing-wrap{margin-top:25px}.teacher-badge{display:none}.topbar-right{gap:6px}.admin-dialog{padding:22px 16px}.admin-panel-head{flex-direction:column}}

/* FULLSCREEN LOBBY PATCH - scoped */
.landing-body{position:relative;min-height:100vh}
.landing-body .bg-photo{
  position:fixed;inset:0;z-index:0;
  background:url("landing-school-bg.png") center center/cover no-repeat;
  filter:blur(5px) saturate(1.08) brightness(.82);
  transform:scale(1.06);
}
.landing-body .bg-overlay{
  position:fixed;inset:0;z-index:1;
  background:
    linear-gradient(180deg,rgba(20,9,24,.46) 0%,rgba(22,15,36,.54) 30%,rgba(8,12,22,.70) 100%),
    radial-gradient(circle at 15% 18%,rgba(255,214,229,.22),transparent 26%),
    radial-gradient(circle at 85% 22%,rgba(255,171,202,.16),transparent 24%),
    radial-gradient(circle at 50% 100%,rgba(255,255,255,.05),transparent 28%);
}
.landing-body .landing-body .petals{position:fixed;inset:0;z-index:2;pointer-events:none}
.landing-body .petal{
  position:absolute;width:20px;height:20px;
  background:radial-gradient(circle at 35% 35%,#ffe8f1 0 35%,#ffbad2 36% 100%);
  border-radius:70% 0 70% 0;
  opacity:.52;
  box-shadow:0 0 18px rgba(255,194,220,.20);
}
.landing-body .p1{left:8%;top:20%}.landing-body .p2{left:15%;top:72%;width:16px;height:16px}.landing-body .p3{left:28%;top:10%;width:13px;height:13px}
.landing-body .p4{left:68%;top:16%;width:17px;height:17px}.landing-body .p5{left:84%;top:25%;width:20px;height:20px}.landing-body .p6{left:77%;top:68%;width:15px;height:15px}
.landing-body .p7{left:44%;top:82%;width:18px;height:18px}.landing-body .p8{left:92%;top:56%;width:14px;height:14px}

.landing-body .site-topbar{
  position:relative;z-index:5;
  height:84px;padding:18px 28px;
  display:flex;align-items:center;
  background:linear-gradient(180deg,rgba(8,9,16,.48),rgba(8,9,16,.20));
  border-bottom:1px solid rgba(255,255,255,.06);
  backdrop-filter:blur(10px);
}
.landing-body .brand{display:flex;align-items:center;gap:12px}
.landing-body .landing-body .brand-mark{
  width:42px;height:42px;border-radius:12px;
  display:grid;place-items:center;
  background:linear-gradient(145deg,#c13758,#7f1731);
  font-size:22px;font-weight:900;
  box-shadow:0 8px 22px rgba(145,31,50,.32);
}
.landing-body .landing-body .brand-copy strong{display:block;font-size:16px}
.landing-body .landing-body .brand-copy span{display:block;font-size:12px;color:#e8c7d4}

.landing-body .landing-main{
  position:relative;z-index:4;
  min-height:calc(100vh - 84px);
  display:flex;align-items:center;justify-content:center;
  padding:22px 24px 30px;
}
.landing-body .landing-shell{
  width:min(1180px,100%);
}
.landing-body .hero-panel{
  max-width:860px;margin:0 auto 22px;
  padding:26px 28px 22px;
  text-align:center;
  border-radius:30px;
  border:1px solid var(--line);
  background:linear-gradient(145deg,rgba(255,255,255,.15),rgba(255,255,255,.07));
  backdrop-filter:blur(18px);
  box-shadow:var(--shadow);
}
.landing-body .school-logo{
  width:min(280px,82%);
  max-height:150px;
  object-fit:contain;
  display:block;
  margin:0 auto 12px;
  filter:drop-shadow(0 10px 28px rgba(0,0,0,.25));
}
.landing-body .hero-kicker{
  margin:0 0 8px;
  color:var(--pink2);
  font-size:12px;font-weight:900;
  letter-spacing:.18em;text-transform:uppercase;
}
.landing-body .hero-panel h1{
  margin:0;
  font-size:clamp(40px,5vw,68px);
  line-height:1;
}
.landing-body .hero-text{
  margin:16px auto 0;
  max-width:760px;
  color:var(--text-soft);
  font-size:17px;
  line-height:1.7;
}
.landing-body .cards-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:22px;
}
.landing-body .lobby-card{
  min-height:210px;
  display:flex;gap:18px;
  padding:26px;
  border-radius:28px;
  border:1px solid var(--line);
  background:linear-gradient(145deg,rgba(255,255,255,.14),rgba(255,255,255,.08));
  backdrop-filter:blur(18px);
  box-shadow:var(--shadow);
  transition:.18s ease;
  overflow:hidden;
  position:relative;
}
.landing-body .lobby-card:before{
  content:"";
  position:absolute;
  right:-38px;bottom:-44px;
  width:170px;height:170px;border-radius:50%;
  background:radial-gradient(circle,rgba(255,198,220,.18),transparent 72%);
}
.landing-body .lobby-card:hover{
  transform:translateY(-4px);
  border-color:rgba(255,222,233,.28);
  box-shadow:0 30px 70px rgba(5,10,25,.42);
}
.landing-body .teacher-card{
  background:linear-gradient(145deg,rgba(255,255,255,.14),rgba(146,31,50,.16));
}
.landing-body .card-icon{
  width:62px;height:62px;flex:0 0 62px;
  display:grid;place-items:center;
  border-radius:18px;
  background:linear-gradient(145deg,rgba(255,255,255,.18),rgba(255,222,233,.12));
  border:1px solid rgba(255,255,255,.10);
  font-size:28px;
}
.landing-body .card-label{
  display:block;
  color:var(--pink);
  font-size:12px;
  font-weight:900;
  letter-spacing:.16em;
  text-transform:uppercase;
  margin-bottom:8px;
}
.landing-body .card-copy h2{
  margin:0 0 10px;
  font-size:30px;
}
.landing-body .card-copy p{
  margin:0;
  color:#edd9e1;
  font-size:16px;
  line-height:1.6;
}
.landing-body .card-link{
  display:inline-block;
  margin-top:18px;
  font-weight:900;
  color:#fff;
}

@media (max-width: 980px){
  .landing-body{overflow:auto}
  .landing-body .landing-main{min-height:auto;align-items:flex-start;padding-top:22px}
  .landing-body .cards-grid{grid-template-columns:1fr}
}
@media (max-width: 700px){
  .landing-body .site-topbar{padding:14px 16px;height:74px}
  .landing-body .landing-main{min-height:calc(100vh - 74px);padding:16px 14px 20px}
  .landing-body .hero-panel{padding:20px 16px 18px;border-radius:24px}
  .landing-body .school-logo{width:min(220px,80%);max-height:120px}
  .landing-body .hero-text{font-size:15px;line-height:1.6}
  .landing-body .lobby-card{padding:20px 18px;border-radius:22px;min-height:0}
  .landing-body .card-copy h2{font-size:28px}
}



/* =========================================================
   TEACHER + STUDENT — PHOTO BACKGROUND / GLASS / INTRO
   Wszystkie reguły są scope'owane do .portal-page.
   ========================================================= */
.portal-page{
  position:relative;
  min-height:100vh;
  background:#0a1020;
  color:#111827;
  overflow-x:hidden;
}

.portal-page .portal-bg{
  position:fixed;
  inset:0;
  z-index:-3;
  background:url("landing-school-bg.png") center center/cover no-repeat;
  filter:blur(6px) saturate(1.10) brightness(.78);
  transform:scale(1.06);
}

.portal-page .portal-overlay{
  position:fixed;
  inset:0;
  z-index:-2;
  pointer-events:none;
  background:
    linear-gradient(180deg,rgba(18,9,23,.52) 0%,rgba(15,17,31,.54) 35%,rgba(8,13,23,.72) 100%),
    radial-gradient(circle at 12% 18%,rgba(255,201,222,.19),transparent 26%),
    radial-gradient(circle at 84% 20%,rgba(255,167,200,.14),transparent 24%),
    radial-gradient(circle at 50% 95%,rgba(255,255,255,.05),transparent 30%);
}

.portal-page .topbar{
  background:linear-gradient(180deg,rgba(8,10,18,.78),rgba(8,10,18,.62));
  backdrop-filter:blur(18px);
  border-bottom:1px solid rgba(255,255,255,.10);
  box-shadow:0 8px 28px rgba(0,0,0,.12);
}

.portal-page .wrap{
  position:relative;
  z-index:2;
}

.portal-page .hero{
  background:
    linear-gradient(135deg,rgba(17,24,39,.90),rgba(54,22,41,.82));
  border:1px solid rgba(255,255,255,.13);
  box-shadow:0 18px 48px rgba(7,12,24,.25);
  backdrop-filter:blur(16px);
}

.portal-page .student-hero{
  background:
    linear-gradient(135deg,rgba(22,45,39,.88),rgba(26,39,58,.84));
}

.portal-page .card,
.portal-page .stat-card,
.portal-page .public-lesson-card{
  background:rgba(255,255,255,.90);
  border-color:rgba(255,255,255,.54);
  box-shadow:0 14px 38px rgba(5,12,25,.18);
  backdrop-filter:blur(16px);
}

.portal-page .tabs{
  background:rgba(255,255,255,.90);
  backdrop-filter:blur(18px);
}

.portal-page .stat-card{
  transition:transform .18s ease, box-shadow .18s ease;
}

.portal-page .stat-card:hover{
  transform:translateY(-2px);
  box-shadow:0 18px 44px rgba(5,12,25,.24);
}

.portal-page .teacher-login-card{
  background:rgba(255,255,255,.92);
  box-shadow:0 24px 65px rgba(5,10,24,.30);
  border:1px solid rgba(255,255,255,.60);
}

.portal-page .admin-dialog{
  background:rgba(255,255,255,.96);
  backdrop-filter:blur(18px);
}

.portal-page footer{
  position:relative;
  z-index:2;
  color:#f0d6e1;
  text-shadow:0 1px 10px rgba(0,0,0,.35);
}

.portal-page .public-title{
  color:#fff;
  text-shadow:0 2px 14px rgba(0,0,0,.28);
}

.portal-page .public-title .eyebrow{
  color:#ff9ab8;
}

.portal-page .teacher-badge{
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.15);
  padding:8px 11px;
  border-radius:999px;
  backdrop-filter:blur(8px);
}

/* Delikatne wejście zawartości po splashu */
.portal-page > header,
.portal-page > main,
.portal-page > footer{
  animation:portalContentIn .72s cubic-bezier(.2,.8,.2,1) .92s both;
}

@keyframes portalContentIn{
  from{opacity:0;transform:translateY(12px)}
  to{opacity:1;transform:translateY(0)}
}

/* =========================================================
   JAPANESE SAKURA INTRO
   ========================================================= */
.page-intro{
  position:fixed;
  inset:0;
  z-index:3000;
  display:grid;
  place-items:center;
  overflow:hidden;
  background:
    radial-gradient(circle at 50% 42%,rgba(111,34,67,.40),transparent 30%),
    linear-gradient(180deg,#120d19 0%,#111322 56%,#090d17 100%);
  animation:introDisappear .72s ease 1.75s forwards;
  pointer-events:none;
}

.intro-glow{
  position:absolute;
  width:min(650px,85vw);
  height:min(650px,85vw);
  border-radius:50%;
  background:radial-gradient(circle,rgba(255,188,213,.18),rgba(255,188,213,.04) 45%,transparent 72%);
  filter:blur(4px);
  animation:introGlow 1.5s ease both;
}

.intro-content{
  position:relative;
  z-index:2;
  display:flex;
  flex-direction:column;
  align-items:center;
}

.sakura-tree{
  width:min(430px,78vw);
  height:auto;
  overflow:visible;
  filter:drop-shadow(0 16px 32px rgba(0,0,0,.25));
}

.tree-trunk path,
.tree-branches path{
  fill:none;
  stroke:#4d302f;
  stroke-width:12;
  stroke-linecap:round;
  stroke-linejoin:round;
  stroke-dasharray:420;
  stroke-dashoffset:420;
  animation:drawBranch .9s cubic-bezier(.3,.7,.2,1) .15s forwards;
}

.tree-branches path{
  stroke-width:7;
  animation-delay:.42s;
}

.blossoms circle{
  fill:#f8a8c2;
  stroke:#ffd6e4;
  stroke-width:3;
  opacity:0;
  transform-box:fill-box;
  transform-origin:center;
  animation:bloom .42s cubic-bezier(.2,.9,.2,1.2) forwards;
}

.blossoms circle:nth-child(1){animation-delay:.55s}
.blossoms circle:nth-child(2){animation-delay:.59s}
.blossoms circle:nth-child(3){animation-delay:.63s}
.blossoms circle:nth-child(4){animation-delay:.67s}
.blossoms circle:nth-child(5){animation-delay:.71s}
.blossoms circle:nth-child(6){animation-delay:.75s}
.blossoms circle:nth-child(7){animation-delay:.79s}
.blossoms circle:nth-child(8){animation-delay:.83s}
.blossoms circle:nth-child(9){animation-delay:.87s}
.blossoms circle:nth-child(10){animation-delay:.91s}
.blossoms circle:nth-child(11){animation-delay:.95s}
.blossoms circle:nth-child(12){animation-delay:.99s}
.blossoms circle:nth-child(13){animation-delay:1.03s}
.blossoms circle:nth-child(14){animation-delay:1.07s}
.blossoms circle:nth-child(15){animation-delay:1.11s}
.blossoms circle:nth-child(16){animation-delay:1.15s}

.intro-school{
  margin-top:-8px;
  color:#ffdce8;
  font-size:13px;
  font-weight:900;
  letter-spacing:.34em;
  text-indent:.34em;
  text-shadow:0 5px 24px rgba(0,0,0,.30);
  opacity:0;
  animation:introText .50s ease 1.00s forwards;
}

.intro-line{
  width:0;
  height:1px;
  margin-top:10px;
  background:linear-gradient(90deg,transparent,#ff9dbd,transparent);
  animation:introLine  .50s ease 1.08s forwards;
}

.intro-petal{
  position:absolute;
  z-index:3;
  width:16px;
  height:16px;
  border-radius:70% 0 70% 0;
  background:linear-gradient(135deg,#ffe8f1,#f49ab8);
  opacity:0;
  animation:petalFall 1.15s ease-in forwards;
}

.ip1{left:19%;top:16%;animation-delay:.55s}
.ip2{left:31%;top:8%;animation-delay:.72s}
.ip3{left:60%;top:11%;animation-delay:.66s}
.ip4{left:73%;top:17%;animation-delay:.82s}
.ip5{left:41%;top:20%;animation-delay:.92s}
.ip6{left:82%;top:10%;animation-delay:.58s}

@keyframes drawBranch{
  to{stroke-dashoffset:0}
}
@keyframes bloom{
  0%{opacity:0;transform:scale(.15)}
  75%{opacity:1;transform:scale(1.08)}
  100%{opacity:1;transform:scale(1)}
}
@keyframes introGlow{
  from{opacity:0;transform:scale(.75)}
  to{opacity:1;transform:scale(1)}
}
@keyframes introText{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:translateY(0)}
}
@keyframes introLine{
  to{width:220px}
}
@keyframes petalFall{
  0%{opacity:0;transform:translate(0,-15px) rotate(0deg)}
  20%{opacity:.85}
  100%{opacity:0;transform:translate(55px,210px) rotate(250deg)}
}
@keyframes introDisappear{
  0%{opacity:1;visibility:visible}
  100%{opacity:0;visibility:hidden}
}

/* Dostępność: użytkownicy preferujący mniej animacji */
@media (prefers-reduced-motion: reduce){
  .page-intro{display:none}
  .portal-page > header,
  .portal-page > main,
  .portal-page > footer{animation:none}
}

@media(max-width:700px){
  .portal-page .card,
  .portal-page .stat-card,
  .portal-page .public-lesson-card{
    background:rgba(255,255,255,.94);
  }
  .sakura-tree{width:min(330px,84vw)}
  .intro-school{font-size:11px}
}



/* =========================================================
   STUDENT PROFILE SEARCH / KARTOTEKA UCZNIA
   ========================================================= */
.student-portal .student-profile-search{
  position:relative;
  z-index:5;
  overflow:visible;
  padding:24px;
  background:linear-gradient(145deg,rgba(255,255,255,.94),rgba(255,247,251,.89));
}

.student-profile-search-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin-bottom:18px;
}

.student-profile-search-head h2{
  margin:4px 0 6px;
  font-size:25px;
}

.student-profile-search-head p{
  margin:0;
  color:#64748b;
}

.profile-search-icon{
  width:54px;
  height:54px;
  flex:0 0 54px;
  display:grid;
  place-items:center;
  border-radius:18px;
  background:linear-gradient(145deg,#ffe6ef,#f9c0d4);
  box-shadow:0 10px 25px rgba(173,41,65,.16);
  font-size:25px;
}

.character-search-wrap{
  position:relative;
  max-width:820px;
}

.character-search-box{
  position:relative;
  display:flex;
  align-items:center;
}

.character-search-glass{
  position:absolute;
  left:16px;
  top:50%;
  transform:translateY(-50%);
  color:#921f32;
  font-size:24px;
  font-weight:900;
  z-index:2;
  pointer-events:none;
}

.character-search-box input{
  height:56px;
  padding:12px 52px 12px 48px;
  border:1px solid #e4bac8;
  border-radius:16px;
  background:#fff;
  font-size:16px;
  box-shadow:0 10px 28px rgba(80,30,48,.06);
}

.character-search-box input:focus{
  border-color:#c94b70;
  box-shadow:0 0 0 4px rgba(201,75,112,.12),0 12px 30px rgba(80,30,48,.08);
}

.character-search-clear{
  position:absolute;
  right:10px;
  width:38px;
  height:38px;
  border:0;
  border-radius:11px;
  background:#f8e8ee;
  color:#921f32;
  font-size:24px;
  cursor:pointer;
}

.character-results{
  position:absolute;
  z-index:80;
  left:0;
  right:0;
  top:calc(100% + 8px);
  max-height:360px;
  overflow:auto;
  padding:7px;
  border:1px solid rgba(146,31,50,.15);
  border-radius:16px;
  background:rgba(255,255,255,.98);
  box-shadow:0 24px 55px rgba(20,20,35,.22);
  backdrop-filter:blur(18px);
}

.character-result{
  width:100%;
  border:0;
  background:transparent;
  display:grid;
  grid-template-columns:46px 1fr auto;
  align-items:center;
  gap:12px;
  padding:10px 11px;
  border-radius:12px;
  text-align:left;
  cursor:pointer;
  transition:.15s ease;
}

.character-result:hover{
  background:#fbedf2;
  transform:translateX(2px);
}

.character-result-avatar{
  width:46px;
  height:46px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:linear-gradient(145deg,#b52c49,#7c1730);
  color:#fff;
  font-weight:900;
  box-shadow:0 8px 18px rgba(146,31,50,.18);
}

.character-result-copy strong{
  display:block;
  color:#172033;
  font-size:14px;
}

.character-result-copy small{
  display:block;
  margin-top:3px;
  color:#64748b;
  font-size:12px;
}

.character-result-arrow{
  color:#a32846;
  font-weight:900;
  font-size:18px;
}

.character-no-results{
  padding:15px;
  color:#64748b;
  font-size:13px;
  text-align:center;
}

.student-profile{
  position:relative;
  scroll-margin-top:96px;
  animation:studentProfileIn .42s cubic-bezier(.2,.8,.2,1) both;
}

@keyframes studentProfileIn{
  from{opacity:0;transform:translateY(12px)}
  to{opacity:1;transform:translateY(0)}
}

.student-profile.profile-loading{
  opacity:.72;
  pointer-events:none;
}

.student-profile-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding:25px;
  background:
    linear-gradient(120deg,rgba(255,255,255,.96),rgba(255,240,247,.92));
  border-color:rgba(255,255,255,.75);
}

.profile-identity{
  display:flex;
  align-items:center;
  gap:17px;
  min-width:0;
}

.profile-avatar{
  width:76px;
  height:76px;
  flex:0 0 76px;
  display:grid;
  place-items:center;
  border-radius:23px;
  background:
    linear-gradient(145deg,#c63e61,#7b1730);
  color:#fff;
  font-size:27px;
  font-weight:900;
  letter-spacing:.03em;
  box-shadow:0 15px 32px rgba(133,29,54,.22);
}

.profile-badges{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  margin-bottom:6px;
}

.profile-class-badge,
.profile-status-badge{
  display:inline-flex;
  padding:5px 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:900;
}

.profile-class-badge{
  background:#921f32;
  color:#fff;
}

.profile-status-badge{
  background:#f8e5ec;
  color:#921f32;
}

.profile-identity h2{
  margin:0;
  font-size:30px;
  line-height:1.1;
}

.profile-identity p{
  margin:6px 0 0;
}

.profile-main-stats{
  display:grid;
  grid-template-columns:repeat(3,minmax(115px,1fr));
  gap:10px;
}

.profile-stat{
  min-width:116px;
  padding:14px 15px;
  border-radius:16px;
  background:rgba(255,255,255,.75);
  border:1px solid #eadce1;
}

.profile-stat-accent{
  background:linear-gradient(145deg,#fff4f8,#ffe7ef);
}

.profile-stat span{
  display:block;
  color:#64748b;
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
}

.profile-stat strong{
  display:block;
  margin-top:4px;
  color:#172033;
  font-size:25px;
}

.student-profile-grid{
  display:grid;
  grid-template-columns:1.1fr .9fr;
  gap:20px;
}

.profile-grades-list{
  display:flex;
  flex-direction:column;
  gap:9px;
}

.profile-grade-row{
  display:grid;
  grid-template-columns:48px 1fr auto;
  align-items:center;
  gap:12px;
  padding:11px 12px;
  border:1px solid #e8e2e5;
  border-radius:13px;
  background:rgba(255,255,255,.76);
}

.profile-grade-value{
  width:45px;
  height:45px;
  display:grid;
  place-items:center;
  border-radius:13px;
  background:#eef2f7;
  color:#172033;
  font-size:21px;
  font-weight:900;
}

.grade-1,.grade-2{background:#fee2e2;color:#991b1b}
.grade-3{background:#fef3c7;color:#92400e}
.grade-4{background:#e0f2fe;color:#075985}
.grade-5,.grade-6{background:#dcfce7;color:#166534}

.profile-grade-copy strong{
  display:block;
  color:#172033;
}

.profile-grade-copy span,
.profile-grade-copy small{
  display:block;
  margin-top:3px;
  color:#64748b;
  font-size:12px;
}

.profile-grade-copy small{
  color:#805263;
}

.profile-grade-date{
  color:#64748b;
  font-size:11px;
  font-weight:800;
}

.attendance-circle-row{
  display:grid;
  grid-template-columns:160px 1fr;
  gap:22px;
  align-items:center;
}

.attendance-ring{
  --attendance:0;
  width:150px;
  height:150px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:
    conic-gradient(#c63e61 calc(var(--attendance) * 1%),#f1e5e9 0);
  box-shadow:inset 0 0 0 1px rgba(146,31,50,.06);
}

.attendance-ring-inner{
  width:112px;
  height:112px;
  border-radius:50%;
  display:grid;
  place-content:center;
  text-align:center;
  background:#fff;
  box-shadow:0 8px 22px rgba(64,33,44,.08);
}

.attendance-ring-inner strong{
  color:#172033;
  font-size:29px;
}

.attendance-ring-inner span{
  color:#64748b;
  font-size:11px;
  font-weight:800;
}

.attendance-breakdown{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.attendance-breakdown > div{
  display:grid;
  grid-template-columns:10px 1fr auto;
  align-items:center;
  gap:8px;
  padding:7px 0;
  border-bottom:1px solid #eee7ea;
  font-size:13px;
}

.attendance-breakdown strong{
  color:#172033;
}

.attendance-dot{
  width:9px;
  height:9px;
  border-radius:50%;
}

.attendance-dot.present{background:#22c55e}
.attendance-dot.late{background:#f59e0b}
.attendance-dot.absent{background:#ef4444}
.attendance-dot.excused{background:#818cf8}

.profile-attendance-history{
  margin-top:18px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.profile-attendance-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 11px;
  border-radius:12px;
  border:1px solid #e8e2e5;
  background:rgba(255,255,255,.72);
}

.profile-attendance-row strong{
  display:block;
  color:#172033;
  font-size:13px;
}

.profile-attendance-row small{
  display:block;
  margin-top:3px;
  color:#64748b;
  font-size:11px;
}

.attendance-status{
  display:inline-flex;
  flex:0 0 auto;
  padding:6px 9px;
  border-radius:999px;
  font-size:10px;
  font-weight:900;
}

.attendance-present{background:#dcfce7;color:#166534}
.attendance-late{background:#fef3c7;color:#92400e}
.attendance-absent{background:#fee2e2;color:#991b1b}
.attendance-excused{background:#e0e7ff;color:#3730a3}

.profile-empty{
  padding:18px;
  border:1px dashed #d8cdd2;
  border-radius:12px;
  color:#64748b;
  text-align:center;
  font-size:13px;
}

@media(max-width:950px){
  .student-profile-header{
    align-items:flex-start;
    flex-direction:column;
  }

  .profile-main-stats{
    width:100%;
  }

  .student-profile-grid{
    grid-template-columns:1fr;
  }
}

@media(max-width:650px){
  .student-profile-search-head{
    align-items:flex-start;
  }

  .profile-search-icon{
    display:none;
  }

  .profile-identity{
    align-items:flex-start;
  }

  .profile-avatar{
    width:58px;
    height:58px;
    flex-basis:58px;
    border-radius:18px;
    font-size:21px;
  }

  .profile-identity h2{
    font-size:24px;
  }

  .profile-main-stats{
    grid-template-columns:1fr 1fr;
  }

  .profile-stat:last-child{
    grid-column:1/-1;
  }

  .attendance-circle-row{
    grid-template-columns:1fr;
    justify-items:center;
  }

  .attendance-breakdown{
    width:100%;
  }

  .profile-grade-row{
    grid-template-columns:44px 1fr;
  }

  .profile-grade-date{
    grid-column:2;
  }
}



/* =========================================================
   PROFIL UCZNIA — CHOWANIE
   ========================================================= */
.profile-hide-btn{
  margin-top:10px;
  border:1px solid #e4c4cf;
  background:rgba(255,255,255,.72);
  color:#8f2340;
  padding:7px 11px;
  border-radius:10px;
  font-size:12px;
  font-weight:900;
  cursor:pointer;
  transition:.16s ease;
}

.profile-hide-btn:hover{
  background:#fbeaf0;
  border-color:#d99aad;
  transform:translateY(-1px);
}

.profile-hide-btn span{
  margin-right:4px;
}

.student-profile.profile-closing{
  animation:studentProfileOut .22s ease both;
}

@keyframes studentProfileOut{
  from{opacity:1;transform:translateY(0);max-height:1200px}
  to{opacity:0;transform:translateY(-8px);max-height:0}
}


/* =========================================================
   WSPÓLNE PRZEJŚCIA: LOBBY <-> UCZEŃ <-> NAUCZYCIEL
   Logo szkoły + spadające płatki sakury
   ========================================================= */
.site-transition{
  position:fixed;
  inset:0;
  z-index:99999;
  display:grid;
  place-items:center;
  overflow:hidden;
  background:
    radial-gradient(circle at 50% 38%,rgba(180,52,93,.30),transparent 28%),
    radial-gradient(circle at 18% 15%,rgba(255,201,222,.15),transparent 22%),
    linear-gradient(180deg,#160d19 0%,#111425 54%,#090d17 100%);
  opacity:1;
  visibility:visible;
  transition:opacity .48s ease, visibility .48s ease;
  pointer-events:all;
}

.site-transition.transition-hidden{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}

.site-transition.transition-leaving{
  opacity:1;
  visibility:visible;
  pointer-events:all;
}

.transition-center{
  position:relative;
  z-index:5;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  animation:transitionLogoIn .58s cubic-bezier(.2,.85,.2,1) both;
}

.transition-center img{
  width:min(330px,70vw);
  max-height:230px;
  object-fit:contain;
  filter:drop-shadow(0 18px 34px rgba(0,0,0,.30));
}

.transition-center span{
  color:#ffd7e5;
  font-size:11px;
  font-weight:900;
  letter-spacing:.28em;
  text-indent:.28em;
  text-shadow:0 4px 18px rgba(0,0,0,.32);
}

.transition-leaving .transition-center{
  animation:transitionLogoLeave .58s cubic-bezier(.2,.8,.2,1) both;
}

.transition-petals{
  position:absolute;
  inset:0;
  z-index:3;
  overflow:hidden;
}

.transition-petal{
  --left:50%;
  --delay:0s;
  --duration:1.5s;
  --drift:20px;
  --size:14px;

  position:absolute;
  left:var(--left);
  top:-8%;
  width:var(--size);
  height:var(--size);
  opacity:0;
  border-radius:72% 0 72% 0;
  background:linear-gradient(135deg,#fff0f6 0%,#f8a8c3 62%,#e87c9e 100%);
  box-shadow:0 0 14px rgba(255,180,209,.24);
  animation:transitionPetalFall var(--duration) linear var(--delay) infinite;
}

.transition-petal:nth-child(3n){
  border-radius:50% 80% 40% 80%;
}

.transition-petal:nth-child(4n){
  filter:blur(.3px);
}

.transition-tree-branch{
  position:absolute;
  right:-40px;
  top:-20px;
  width:360px;
  height:250px;
  z-index:2;
  opacity:.28;
  transform:rotate(-8deg);
}

.transition-tree-branch::before{
  content:"";
  position:absolute;
  right:35px;
  top:55px;
  width:300px;
  height:80px;
  border-top:15px solid #3f2629;
  border-radius:55% 0 0 0;
  transform:rotate(-20deg);
}

.transition-tree-branch::after{
  content:"";
  position:absolute;
  right:128px;
  top:88px;
  width:190px;
  height:65px;
  border-top:9px solid #3f2629;
  border-radius:55% 0 0 0;
  transform:rotate(18deg);
}

.transition-tree-branch i{
  position:absolute;
  width:42px;
  height:42px;
  border-radius:50%;
  background:radial-gradient(circle,#ffd9e7 0 24%,#f7a1be 25% 68%,#d66b91 69%);
  box-shadow:
    40px 18px 0 -6px #f4a0bc,
    -34px 26px 0 -9px #ffd0e0,
    20px -30px 0 -10px #f8bed2;
}

.transition-tree-branch i:nth-child(1){right:42px;top:30px}
.transition-tree-branch i:nth-child(2){right:112px;top:74px;transform:scale(.85)}
.transition-tree-branch i:nth-child(3){right:170px;top:33px;transform:scale(.72)}
.transition-tree-branch i:nth-child(4){right:228px;top:94px;transform:scale(.80)}
.transition-tree-branch i:nth-child(5){right:282px;top:57px;transform:scale(.62)}

@keyframes transitionLogoIn{
  from{opacity:0;transform:scale(.88) translateY(10px)}
  to{opacity:1;transform:scale(1) translateY(0)}
}

@keyframes transitionLogoLeave{
  0%{opacity:.15;transform:scale(.92)}
  100%{opacity:1;transform:scale(1)}
}

@keyframes transitionPetalFall{
  0%{
    opacity:0;
    transform:translate3d(0,-30px,0) rotate(0deg);
  }
  12%{opacity:.82}
  88%{opacity:.55}
  100%{
    opacity:0;
    transform:translate3d(var(--drift),115vh,0) rotate(540deg);
  }
}

@media(prefers-reduced-motion:reduce){
  .site-transition{
    display:none!important;
  }
  .student-profile.profile-closing{
    animation:none;
  }
}



/* =========================================================
   V4 — WIDOK UCZNIA: UWAGI / POCHWAŁY
   ========================================================= */
.profile-notes-card{
  margin-top:20px;
}

.profile-notes-count{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:6px 10px;
  border-radius:999px;
  background:#f7e9ee;
  color:#8f2340;
  font-size:11px;
  font-weight:900;
}

.profile-notes-list{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}

.profile-note{
  display:grid;
  grid-template-columns:46px 1fr;
  gap:12px;
  padding:14px;
  border-radius:15px;
  border:1px solid #e8e2e5;
  background:rgba(255,255,255,.80);
  transition:transform .16s ease, box-shadow .16s ease;
}

.profile-note:hover{
  transform:translateY(-2px);
  box-shadow:0 12px 28px rgba(30,20,30,.08);
}

.profile-note-icon{
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  border-radius:13px;
  font-size:18px;
  font-weight:1000;
}

.profile-note-warning .profile-note-icon{
  background:#fee2e2;
  color:#b42318;
}

.profile-note-praise .profile-note-icon{
  background:#dcfce7;
  color:#15803d;
}

.profile-note-info .profile-note-icon{
  background:#e0e7ff;
  color:#4338ca;
}

.profile-note-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.profile-note-type{
  font-size:12px;
  font-weight:900;
  color:#172033;
}

.profile-note-date{
  flex:0 0 auto;
  font-size:11px;
  color:#64748b;
  font-weight:800;
}

.profile-note-content p{
  margin:7px 0 10px;
  color:#334155;
  line-height:1.55;
  font-size:13px;
}

.profile-note-teacher{
  display:flex;
  gap:5px;
  align-items:center;
  color:#64748b;
  font-size:11px;
}

.profile-note-teacher strong{
  color:#7f2943;
}


/* =========================================================
   V4 — LEKCJE W STYLU E-DZIENNIKA
   ========================================================= */
.public-lessons-grid{
  gap:16px;
}

.portal-page .public-lesson-card.journal-lesson-card{
  position:relative;
  min-height:250px;
  display:flex;
  flex-direction:column;
  padding:0;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.68);
  border-radius:20px;
  background:rgba(255,255,255,.93);
  box-shadow:0 16px 40px rgba(7,12,25,.18);
  backdrop-filter:blur(18px);
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}

.portal-page .public-lesson-card.journal-lesson-card::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:5px;
  background:linear-gradient(180deg,#b52c49,#7c1730);
}

.portal-page .public-lesson-card.journal-lesson-card:hover{
  transform:translateY(-3px);
  box-shadow:0 22px 50px rgba(7,12,25,.25);
  border-color:rgba(255,210,226,.92);
}

.journal-card-top{
  display:flex;
  align-items:flex-start;
  gap:14px;
  padding:17px 18px 12px 21px;
}

.journal-date-tile{
  width:58px;
  height:63px;
  flex:0 0 58px;
  display:grid;
  align-content:center;
  justify-items:center;
  border-radius:15px;
  background:linear-gradient(145deg,#9f2441,#6f152b);
  color:#fff;
  box-shadow:0 10px 22px rgba(132,31,57,.20);
}

.journal-day{
  display:block;
  font-size:24px;
  line-height:1;
  font-weight:950;
}

.journal-month{
  display:block;
  margin-top:4px;
  font-size:9px;
  font-weight:900;
  letter-spacing:.14em;
}

.journal-card-heading{
  min-width:0;
  flex:1;
}

.journal-card-heading .lesson-class-badges{
  margin:0 0 6px;
}

.journal-card-heading h3{
  margin:0!important;
  color:#172033;
  font-size:20px;
  line-height:1.18;
}

.journal-full-date{
  display:block;
  margin-top:4px;
  color:#7b8798;
  font-size:11px;
  font-weight:700;
}

.journal-topic-box{
  margin:0 18px 14px 21px;
  padding:12px 13px;
  border-radius:13px;
  background:linear-gradient(145deg,#f8f4f6,#f6eef1);
  border:1px solid #eadde2;
}

.journal-topic-label{
  display:block;
  margin-bottom:5px;
  color:#9a2d4a;
  font-size:9px;
  font-weight:950;
  letter-spacing:.13em;
}

.journal-topic-box p{
  margin:0;
  color:#263244;
  font-size:14px;
  line-height:1.5;
  font-weight:650;
}

.journal-teacher{
  margin-top:auto;
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 18px 14px 21px;
  border-top:1px solid #ece6e8;
  background:rgba(250,249,250,.72);
}

.journal-teacher-avatar{
  width:42px;
  height:42px;
  flex:0 0 42px;
  border-radius:50%;
  object-fit:cover;
  border:2px solid #fff;
  box-shadow:0 4px 12px rgba(40,20,30,.12);
}

.journal-teacher-fallback{
  display:grid;
  place-items:center;
  background:linear-gradient(145deg,#b52c49,#76162e);
  color:#fff;
  font-size:13px;
  font-weight:950;
}

.journal-teacher-copy{
  min-width:0;
}

.journal-teacher-copy span{
  display:block;
  color:#8a95a4;
  font-size:9px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.journal-teacher-copy strong{
  display:block;
  margin-top:2px;
  color:#263244;
  font-size:13px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}


/* =========================================================
   V4 — PROFIL NAUCZYCIELA / ZDJĘCIE POSTACI
   ========================================================= */
.teacher-profile-btn{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:40px;
  padding:5px 11px 5px 6px;
  border:1px solid rgba(255,255,255,.20);
  border-radius:12px;
  background:rgba(255,255,255,.08);
  color:#fff;
  font-size:12px;
  font-weight:850;
  cursor:pointer;
  transition:.16s ease;
}

.teacher-profile-btn:hover{
  background:rgba(255,255,255,.14);
  border-color:rgba(255,255,255,.34);
}

.teacher-top-avatar{
  width:30px;
  height:30px;
  display:grid;
  place-items:center;
  overflow:hidden;
  border-radius:50%;
  background:linear-gradient(145deg,#c03a5d,#79172f);
  color:#fff;
  font-size:10px;
  font-weight:950;
}

.teacher-top-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.teacher-profile-modal{
  position:fixed;
  inset:0;
  z-index:1100;
  display:grid;
  place-items:center;
  padding:18px;
}

.teacher-profile-backdrop{
  position:absolute;
  inset:0;
  background:rgba(2,6,23,.68);
  backdrop-filter:blur(7px);
}

.teacher-profile-dialog{
  position:relative;
  z-index:2;
  width:min(560px,100%);
  padding:26px;
  border-radius:22px;
  background:rgba(255,255,255,.97);
  border:1px solid rgba(255,255,255,.75);
  box-shadow:0 30px 85px rgba(0,0,0,.33);
}

.teacher-profile-dialog-head{
  display:flex;
  align-items:center;
  gap:17px;
  padding-right:28px;
}

.teacher-profile-dialog-head h2{
  margin:5px 0 5px;
  color:#172033;
  font-size:24px;
}

.teacher-profile-dialog-head p{
  margin:0;
  line-height:1.5;
}

.teacher-profile-preview{
  width:92px;
  height:92px;
  flex:0 0 92px;
  display:grid;
  place-items:center;
  overflow:hidden;
  border-radius:24px;
  background:linear-gradient(145deg,#c33c60,#74172d);
  color:#fff;
  font-size:28px;
  font-weight:950;
  box-shadow:0 14px 32px rgba(119,25,48,.23);
}

.teacher-profile-preview img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.teacher-avatar-form{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-top:22px;
}

.teacher-avatar-form label{
  display:flex;
  flex-direction:column;
  gap:7px;
  color:#374151;
  font-size:13px;
  font-weight:800;
}

.teacher-avatar-help{
  color:#64748b;
  font-size:11px;
  line-height:1.45;
}

.teacher-lesson-history{
  display:grid!important;
  grid-template-columns:44px 1fr auto;
  align-items:center!important;
}

.teacher-history-avatar{
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  overflow:hidden;
  border-radius:50%;
  background:linear-gradient(145deg,#b52c49,#77172e);
  color:#fff;
  font-size:12px;
  font-weight:950;
}

.teacher-history-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.teacher-history-main{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:3px;
}


/* =========================================================
   ADMIN — miniatura zdjęcia nauczyciela
   ========================================================= */
.teacher-account{
  gap:12px;
}

.teacher-account-main{
  display:flex;
  align-items:center;
  gap:10px;
}

.teacher-account-avatar{
  width:38px;
  height:38px;
  overflow:hidden;
  display:grid;
  place-items:center;
  flex:0 0 38px;
  border-radius:12px;
  background:#f1d8e2;
  color:#8f2340;
  font-size:10px;
  font-weight:950;
}

.teacher-account-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
}


@media(max-width:900px){
  .profile-notes-list{
    grid-template-columns:1fr;
  }
}

@media(max-width:700px){
  .teacher-profile-btn > span:last-child{
    display:none;
  }

  .teacher-profile-btn{
    padding:5px;
  }

  .teacher-profile-dialog-head{
    align-items:flex-start;
  }

  .teacher-profile-preview{
    width:72px;
    height:72px;
    flex-basis:72px;
    border-radius:19px;
  }

  .portal-page .public-lesson-card.journal-lesson-card{
    min-height:230px;
  }

  .profile-notes-list{
    grid-template-columns:1fr;
  }
}


/* =========================================================
   V4.1 — WIDOCZNY PROFIL NAUCZYCIELA + WIDOCZNE UWAGI UCZNIA
   ========================================================= */
.teacher-profile-tab-btn{
  position:relative;
}
.teacher-profile-tab-btn::after{
  content:'●';
  margin-left:7px;
  color:#d64c73;
  font-size:8px;
  vertical-align:middle;
}

.teacher-profile-page-grid{
  display:grid;
  grid-template-columns:minmax(0,1.35fr) minmax(280px,.65fr);
  gap:20px;
}
.teacher-profile-page-card{
  background:linear-gradient(145deg,rgba(255,255,255,.96),rgba(255,243,248,.92));
}
.profile-live-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 10px;
  border-radius:999px;
  background:#dcfce7;
  color:#166534;
  font-size:11px;
  font-weight:900;
}
.profile-live-badge::before{
  content:'';
  width:7px;
  height:7px;
  border-radius:50%;
  background:#22c55e;
}
.teacher-profile-page-main{
  display:flex;
  align-items:center;
  gap:22px;
  margin:12px 0 22px;
  padding:18px;
  border-radius:18px;
  background:rgba(255,255,255,.72);
  border:1px solid #eadde2;
}
.teacher-profile-page-avatar{
  width:118px;
  height:118px;
  flex:0 0 118px;
  display:grid;
  place-items:center;
  border-radius:28px;
  overflow:hidden;
  background:linear-gradient(145deg,#b72f52,#72152b);
  color:white;
  font-size:34px;
  font-weight:900;
  box-shadow:0 16px 38px rgba(120,22,47,.22);
}
.teacher-profile-page-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.teacher-profile-page-copy h2{margin:0 0 8px;font-size:28px}
.teacher-profile-page-copy p{margin:4px 0;line-height:1.55}
.teacher-profile-page-form{display:flex;flex-direction:column;gap:14px}
.teacher-upload-dropzone{
  display:flex!important;
  align-items:center;
  gap:14px;
  padding:17px;
  border:1.5px dashed #dba6b8;
  border-radius:16px;
  background:#fff8fb;
  cursor:pointer;
  transition:.16s ease;
}
.teacher-upload-dropzone:hover{background:#fdeff4;border-color:#c85a7a}
.teacher-upload-dropzone input{display:none}
.teacher-upload-dropzone strong,.teacher-upload-dropzone small{display:block}
.teacher-upload-dropzone small{margin-top:3px;color:#64748b;font-weight:600}
.teacher-upload-icon{
  width:44px;height:44px;display:grid;place-items:center;border-radius:13px;
  background:#f7dce6;color:#962541;font-size:26px;font-weight:400;
}
.teacher-profile-help-card{align-self:start}
.teacher-profile-help-card h3{margin:5px 0 16px}
.teacher-profile-help-list{display:flex;flex-direction:column;gap:12px}
.teacher-profile-help-list>div{display:grid;grid-template-columns:34px 1fr;gap:10px;align-items:start}
.teacher-profile-help-list span{width:30px;height:30px;display:grid;place-items:center;border-radius:10px;background:#921f32;color:white;font-weight:900}
.teacher-profile-help-list p{margin:4px 0;color:#475569;line-height:1.45}

.student-portal .profile-notes-card{
  margin-bottom:20px;
  border:1px solid rgba(212,102,136,.24);
  background:linear-gradient(145deg,rgba(255,255,255,.96),rgba(255,241,247,.93));
  box-shadow:0 18px 46px rgba(83,29,48,.17);
}
.profile-stat-notes{
  background:linear-gradient(145deg,#fff5f8,#ffe7ef)!important;
}
.profile-notes-card .section-title{
  padding-bottom:12px;
  border-bottom:1px solid #eddfe4;
}
.profile-notes-count{
  background:#921f32;
  color:#fff;
  border-radius:999px;
  padding:7px 11px;
  font-size:11px;
  font-weight:900;
}
.profile-notes-list{
  margin-top:12px;
}
.profile-note{
  display:grid;
  grid-template-columns:46px 1fr;
  gap:12px;
  padding:13px;
  border-radius:14px;
  border:1px solid #e7dce0;
  background:rgba(255,255,255,.78);
  margin-bottom:9px;
}
.profile-note-icon{
  width:44px;height:44px;display:grid;place-items:center;border-radius:13px;
  font-size:20px;background:#f4e8ed;
}
.profile-note-head{display:flex;justify-content:space-between;gap:10px;align-items:center}
.profile-note-type{font-weight:900;color:#172033}
.profile-note-date{font-size:11px;color:#64748b;font-weight:800}
.profile-note-content p{margin:7px 0;color:#334155;line-height:1.5}
.profile-note-teacher{font-size:11px;color:#64748b}
.profile-note-teacher strong{color:#334155}
.profile-note-praise{border-left:4px solid #22c55e}
.profile-note-praise .profile-note-icon{background:#dcfce7}
.profile-note-warning{border-left:4px solid #ef4444}
.profile-note-warning .profile-note-icon{background:#fee2e2}
.profile-note-info{border-left:4px solid #818cf8}
.profile-note-info .profile-note-icon{background:#e0e7ff}

@media(max-width:900px){
  .teacher-profile-page-grid{grid-template-columns:1fr}
  .teacher-profile-page-main{align-items:flex-start}
}
@media(max-width:620px){
  .teacher-profile-page-main{flex-direction:column}
  .teacher-profile-page-avatar{width:92px;height:92px;flex-basis:92px;border-radius:22px}
  .profile-main-stats{grid-template-columns:1fr 1fr!important}
}

.attendance-save-row{display:flex;gap:9px;flex-wrap:wrap;align-items:center}
.lesson-actions{display:flex;gap:6px;align-items:flex-start;flex-shrink:0}
/* Uczen bez wybranego statusu - nie dostanie zadnego wpisu za lekcje, wiec ma byc widac. */
select.att-unmarked{border-color:#f59e0b;background:#fffbeb;color:#92400e}
