/*
Theme Name: Razem w Klasie
Theme URI: https://razemwklasie.local
Description: Prywatny portal rodziców Klasy 1A – komunikaty, kalendarz, galeria, rozmowy. Design na bazie oryginalnej aplikacji „Razem w Klasie”.
Author: Razem w Klasie
Version: 1.0.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: razem-w-klasie
*/

/* ============ ZMIENNE / RESET ============ */
:root{
  --ink:#14221f; --spruce:#1f3a34; --spruce-soft:#48756a;
  --sage:#e9f1eb; --cream:#fbfaf6; --sun:#f8c968; --coral:#efaa87; --lilac:#e9e4ff;
  --line:rgba(31,58,52,.09); --muted:#70807a; --muted-2:#81908a;
  --r:22px; --r-sm:14px;
  --shadow:0 18px 36px rgba(34,58,50,.06);
  --shadow-lg:0 23px 45px rgba(31,58,52,.16);
}
*,*::before,*::after{box-sizing:border-box;}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%;}
body{margin:0;background:var(--cream);color:var(--ink);font-family:"DM Sans",ui-sans-serif,system-ui,"Segoe UI",sans-serif;font-size:15px;line-height:1.5;min-width:320px;}
img{max-width:100%;height:auto;display:block;}
button,input,select,textarea{font:inherit;color:inherit;}
button{cursor:pointer;border:0;background:none;}
h1,h2,h3,h4{margin:0;line-height:1.2;}
p{margin:0 0 .6em;}
ul{margin:.3em 0;padding-left:1.1em;}
a{color:var(--spruce-soft);text-decoration:none;}
a:hover{text-decoration:none;}

.rk-shell{min-height:100vh;
  background:
    radial-gradient(circle at 85% 0%, rgba(248,201,104,.24), transparent 25rem),
    radial-gradient(circle at 0% 50%, rgba(220,234,224,.55), transparent 31rem),
    var(--cream);}

/* ============ TABLICA I KREDA ============ */
.chalk-card{position:relative;overflow:hidden;color:#fdfdf7;border-radius:26px;padding:26px 22px;
  background:
    radial-gradient(rgba(255,255,255,.045) 1px, transparent 1px) 0 0/9px 9px,
    linear-gradient(160deg,#274b41,#1f3a34 60%,#183029);
  box-shadow:var(--shadow-lg);}
.chalk-card::before{content:"";position:absolute;width:210px;height:210px;right:-48px;top:-84px;border:1.5px solid rgba(255,255,255,.18);border-radius:50%;
  box-shadow:0 0 0 26px rgba(255,255,255,.04),0 0 0 55px rgba(255,255,255,.03);}
.chalk-card::after{content:"";position:absolute;width:120px;height:120px;left:-40px;bottom:-62px;border-radius:38px;transform:rotate(24deg);background:var(--sun);opacity:.85;}
.chalk-card>*{position:relative;z-index:1;}
.chalk-title{font-family:"Caveat",cursive;font-weight:700;font-size:clamp(1.9rem,6vw,2.6rem);letter-spacing:.5px;line-height:1.05;
  text-shadow:0 0 6px rgba(253,253,247,.28),0 1px 0 rgba(0,0,0,.25);transform:rotate(-.4deg);}
.chalk-sub{color:rgba(253,253,247,.75);font-size:.92rem;margin-top:8px;max-width:520px;}
.chalk-eyebrow{display:inline-flex;align-items:center;gap:7px;font-family:"Caveat",cursive;font-weight:600;font-size:1.12rem;letter-spacing:.4px;color:#fdeec9;transform:rotate(-.6deg);}
.chalk-inline{font-family:"Caveat",cursive;font-weight:600;color:var(--spruce);transform:rotate(-.5deg);}
.chalk-doodle{font-family:"Caveat",cursive;font-size:1.35rem;color:#cfe3d9;transform:rotate(-1deg);opacity:.9;}

/* ============ UKŁAD MOBILNY (domyślny) ============ */
.mobile-top{position:sticky;top:0;z-index:40;display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:10px 14px;background:rgba(251,250,246,.88);backdrop-filter:blur(14px);border-bottom:1px solid var(--line);}
.brand{display:flex;align-items:center;gap:10px;color:var(--spruce);}
.brand-mark{display:grid;width:38px;height:38px;place-items:center;border-radius:13px;color:#fff;background:var(--spruce);
  box-shadow:0 9px 24px rgba(31,58,52,.2);font-size:19px;}
.brand-name{font-family:"Caveat",cursive;font-weight:700;font-size:1.32rem;line-height:1;transform:rotate(-.5deg);}
.brand-year{display:block;font-family:"DM Sans";font-size:.6rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted-2);margin-top:2px;}
.top-actions{display:flex;align-items:center;gap:9px;}

.icon-btn{position:relative;display:inline-grid;width:42px;height:42px;place-items:center;border:1px solid var(--line);border-radius:14px;
  color:var(--spruce);background:rgba(255,255,255,.72);transition:transform .15s ease;}
.icon-btn:active{transform:scale(.94);}
.badge-dot{position:absolute;top:-5px;right:-5px;min-width:18px;height:18px;padding:0 4px;display:grid;place-items:center;
  border-radius:99px;background:#e2574c;color:#fff;font-size:.64rem;font-weight:800;border:2px solid #fff;}

.avatar{display:inline-grid;width:38px;height:38px;place-items:center;border:2px solid #fff;border-radius:50%;color:var(--spruce);
  background:linear-gradient(135deg,#f6d484,#d7e9de);box-shadow:0 4px 14px rgba(31,58,52,.12);font-size:.78rem;font-weight:800;}
.avatar.sm{width:30px;height:30px;font-size:.66rem;}

.main-area{width:100%;max-width:1180px;margin:0 auto;padding:16px 14px 96px;}

.bottom-tabs{position:fixed;left:10px;right:10px;bottom:10px;z-index:45;display:grid;grid-template-columns:repeat(5,1fr);
  padding:6px 4px;border:1px solid var(--line);border-radius:20px;background:rgba(255,255,255,.93);
  box-shadow:0 13px 31px rgba(31,58,52,.17);backdrop-filter:blur(16px);}
.btab{display:grid;place-items:center;gap:2px;min-height:50px;padding:4px 2px;border-radius:14px;color:#7c8c85;font-size:.56rem;font-weight:800;letter-spacing:.02em;}
.btab .ico{font-size:19px;line-height:1;filter:saturate(.85);}
.btab.active{color:#fff;background:var(--spruce);box-shadow:0 8px 20px rgba(31,58,52,.25);}
.btab.active .ico{filter:none;}

/* Arkusz „Więcej” */
.sheet-backdrop{position:fixed;inset:0;z-index:60;background:rgba(20,34,31,.35);backdrop-filter:blur(3px);opacity:0;pointer-events:none;transition:opacity .2s ease;}
.sheet{position:fixed;left:10px;right:10px;bottom:74px;z-index:61;border-radius:24px;background:#fff;border:1px solid var(--line);
  box-shadow:0 24px 60px rgba(20,34,31,.28);padding:16px;transform:translateY(16px);opacity:0;pointer-events:none;transition:all .22s cubic-bezier(.23,1,.32,1);max-height:72vh;overflow:auto;}
body.sheet-open .sheet-backdrop{opacity:1;pointer-events:auto;}
body.sheet-open .sheet{transform:none;opacity:1;pointer-events:auto;}
.sheet h3{font-family:"Caveat",cursive;font-weight:700;font-size:1.4rem;color:var(--spruce);margin-bottom:8px;}
.sheet-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;}
.sheet-link{display:grid;justify-items:center;gap:5px;padding:13px 6px;border-radius:16px;background:#f4f8f5;color:var(--ink);
  font-size:.68rem;font-weight:800;text-align:center;transition:background .15s;}
.sheet-link:active{background:var(--sage);}
.sheet-link .ico{font-size:22px;}
.sheet-sep{margin:14px 0 10px;border-top:1px dashed var(--line);}
.sheet-mod-title{font-size:.62rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:var(--muted-2);margin:0 0 8px;}

/* Panel powiadomień */
.notif-panel{position:fixed;top:60px;right:10px;left:10px;z-index:59;border-radius:20px;background:#fff;border:1px solid var(--line);
  box-shadow:0 24px 60px rgba(20,34,31,.22);padding:14px;display:none;max-height:70vh;overflow:auto;}
.notif-panel.open{display:block;}
.notif-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;}
.notif-head h4{font-size:.95rem;font-weight:800;}
.notif-item{display:flex;gap:10px;padding:11px 4px;border-bottom:1px solid #eef0eb;cursor:pointer;}
.notif-item:last-child{border-bottom:0;}
.notif-item.unread{background:#f6faf7;border-radius:12px;padding-left:8px;padding-right:8px;}
.notif-item .t{font-size:.82rem;font-weight:700;color:#2a423b;}
.notif-item.readed .t{font-weight:500;color:#5c6b65;}
.notif-item .w{font-size:.68rem;color:var(--muted-2);margin-top:2px;}
.link-btn{border:0;color:var(--spruce-soft);font-size:.76rem;font-weight:800;padding:4px 6px;border-radius:9px;}
.link-btn:hover{background:var(--sage);}

/* ============ NAGŁÓWKI SEKCJI ============ */
.view-head{margin-bottom:18px;}
.eyebrow{margin:0 0 4px;color:#76837f;font-size:.68rem;font-weight:800;letter-spacing:.14em;text-transform:uppercase;}
.view-title{font-family:"DM Serif Display",Georgia,serif;font-size:clamp(1.55rem,5vw,2.1rem);letter-spacing:-.03em;color:var(--ink);}
.view-sub{color:var(--muted);font-size:.86rem;margin-top:5px;max-width:540px;}

.surface{border:1px solid var(--line);border-radius:var(--r);background:rgba(255,255,255,.82);box-shadow:var(--shadow);}
.card{padding:18px;}
.section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:14px;}
.section-title{font-size:1.02rem;font-weight:800;letter-spacing:-.02em;color:#243a34;}
.section-hint{font-size:.72rem;color:var(--muted);margin-top:2px;}
.grid{display:grid;gap:16px;}
.mt{margin-top:16px;}

.pill{display:inline-flex;align-items:center;gap:5px;padding:4px 9px;border-radius:999px;font-size:.68rem;font-weight:800;}
.pill-sun{color:#634810;background:#fde3a5;}
.pill-sage{color:#285346;background:#e4f0e9;}
.pill-lilac{color:#554d8a;background:#ebe8ff;}
.pill-coral{color:#8e432c;background:#ffe4d8;}
.pill-gray{color:#54655e;background:#eef2ef;}
.pill-red{color:#8c2f22;background:#ffe3de;}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px;padding:9px 16px;border-radius:13px;
  font-size:.85rem;font-weight:800;transition:transform .14s ease,background .15s ease;}
.btn:active{transform:scale(.97);}
.btn-primary{background:var(--spruce);color:#fff;box-shadow:0 8px 20px rgba(31,58,52,.22);}
.btn-light{background:#fff;color:var(--spruce);border:1px solid #cfe0d6;}
.btn-ghost{background:rgba(31,58,52,.07);color:var(--spruce);}
.btn-danger{background:#8f4c3a;color:#fff;}
.btn-xs{min-height:36px;padding:5px 11px;font-size:.74rem;border-radius:11px;}

input[type=text],input[type=email],input[type=password],input[type=date],input[type=time],input[type=number],
input[type=search],input[type=url],textarea,select{
  width:100%;padding:12px 13px;border:1px solid #dbe5df;border-radius:13px;background:#fbfcfa;color:#2d433d;font-size:.92rem;outline:none;}
textarea{min-height:96px;resize:vertical;}
input:focus,textarea:focus,select:focus{border-color:#88aa9f;box-shadow:0 0 0 3px rgba(95,140,125,.14);}
label.f-label{display:block;font-size:.72rem;font-weight:800;color:#577066;margin:12px 0 5px;letter-spacing:.02em;}
.check-row{display:flex;align-items:center;gap:9px;margin-top:12px;font-size:.85rem;font-weight:700;color:#3c544b;}
.check-row input{width:19px;height:19px;accent-color:#1f3a34;}

details.composer{border-radius:var(--r);overflow:hidden;}
details.composer>summary{list-style:none;display:flex;align-items:center;gap:9px;padding:15px 18px;font-weight:800;color:var(--spruce);
  background:linear-gradient(135deg,#eaf3ee,#f7f1de);cursor:pointer;font-size:.9rem;}
details.composer>summary::-webkit-details-marker{display:none;}
details.composer>summary::after{content:"▾";margin-left:auto;transition:transform .2s;}
details.composer[open]>summary::after{transform:rotate(180deg);}
.composer-body{padding:6px 18px 18px;background:#fff;}

.empty-state{display:flex;gap:12px;align-items:flex-start;border:1.5px dashed #d8e6de;border-radius:17px;background:#f6faf7;padding:14px;}
.empty-state .spark{flex:0 0 auto;display:grid;width:30px;height:30px;place-items:center;border-radius:50%;background:#fff;color:#4d7668;box-shadow:0 2px 8px rgba(31,58,52,.08);font-size:15px;}
.empty-state .k{font-size:.64rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:#55786c;}
.empty-state .msg{font-size:.8rem;color:#61776d;line-height:1.45;}
.empty-state .next{font-size:.78rem;color:#46695c;font-weight:600;margin-top:4px;}

/* ============ KOMUNIKATY / FEED ============ */
.feed-item{display:grid;grid-template-columns:36px minmax(0,1fr);gap:12px;padding:15px 0;border-bottom:1px solid #eef0eb;}
.feed-item:last-child{border-bottom:0;}
.feed-icon{display:grid;width:36px;height:36px;place-items:center;border-radius:12px;font-size:16px;background:#eaf3ed;color:#37665a;}
.feed-item.is-urgent .feed-icon{background:#fdecd9;color:#8e432c;}
.feed-meta-row{display:flex;flex-wrap:wrap;gap:6px;align-items:center;}
.feed-title{margin:7px 0 4px;font-size:.95rem;font-weight:800;color:#2a423b;}
.feed-body{white-space:pre-wrap;color:#5d6f68;font-size:.86rem;line-height:1.55;}
.feed-foot{display:flex;flex-wrap:wrap;gap:10px;margin-top:9px;color:var(--muted-2);font-size:.7rem;font-weight:700;align-items:center;}

.agenda-item{display:flex;gap:12px;padding:13px 0;border-bottom:1px solid #edf0ea;}
.agenda-item:last-child{border-bottom:0;}
.agenda-date{flex:0 0 46px;display:grid;height:47px;place-items:center;border-radius:13px;background:#e3f0e8;color:#275546;
  font-size:.68rem;font-weight:800;text-align:center;line-height:1.15;}
.agenda-body{min-width:0;flex:1;}
.agenda-title{font-size:.9rem;font-weight:800;color:#2b433c;margin-right:6px;}
.agenda-meta{font-size:.73rem;color:var(--muted-2);margin-top:3px;}
.agenda-desc{font-size:.8rem;color:#657971;line-height:1.5;margin-top:6px;white-space:pre-wrap;}

.rsvp-box{margin-top:12px;background:#f4f8f5;border-radius:14px;padding:12px;}
.rsvp-box .lbl{font-size:.68rem;font-weight:800;color:#527466;}
.rsvp-btns{display:flex;flex-wrap:wrap;gap:7px;margin-top:8px;}
.rsvp-summary{margin-top:9px;font-size:.72rem;color:#6e8178;line-height:1.45;}

.filters{display:flex;flex-wrap:wrap;gap:7px;margin:12px 0 4px;}
.chip{padding:8px 13px;border-radius:999px;border:1px solid #dbe7df;font-size:.74rem;font-weight:800;color:#6b7f76;background:#fff;}
.chip.on{border-color:transparent;background:var(--spruce);color:#fff;}

.schedule-list{display:flex;flex-direction:column;}
.sched-item{display:grid;grid-template-columns:52px minmax(0,1fr) auto;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid #eef0eb;}
.sched-item:last-child{border-bottom:0;}
.sched-time{font-size:.74rem;font-weight:800;color:#85928d;}
.sched-name{font-size:.86rem;font-weight:800;color:#2d433d;}
.sched-room{font-size:.72rem;color:#80908a;}
.day-block h4{font-family:"Caveat",cursive;font-weight:700;font-size:1.3rem;color:var(--spruce);margin:14px 0 4px;transform:rotate(-.5deg);}

.metric-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;}
.metric{padding:13px 10px;border-radius:16px;background:#f2f6f2;text-align:center;}
.metric:nth-child(2){background:#fdf5e5;}
.metric:nth-child(3){background:#f0eeff;}
.metric b{display:block;font-family:"DM Serif Display";font-size:1.35rem;font-weight:400;color:#2b443d;}
.metric span{display:block;margin-top:3px;font-size:.62rem;font-weight:800;color:#778681;line-height:1.3;}

.quick-tiles{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;}
.qtile{display:grid;justify-items:start;gap:4px;padding:15px;border-radius:18px;color:var(--ink);
  background:linear-gradient(140deg,#ffffff,#f1f7f2);border:1px solid var(--line);font-size:.78rem;font-weight:800;}
.qtile:nth-child(2){background:linear-gradient(140deg,#fffdf4,#fdeecb);}
.qtile:nth-child(3){background:linear-gradient(140deg,#f6f4ff,#e7e0fa);}
.qtile:nth-child(4){background:linear-gradient(140deg,#fff6f0,#ffdcc9);}
.qtile .ico{font-size:21px;}
.qtile small{font-weight:600;color:var(--muted);font-size:.68rem;}

.cost-amount{font-family:"DM Serif Display";font-size:1.5rem;color:#233c35;}
.pay-status-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px;align-items:center;}
.pay-note{font-size:.74rem;color:#7d8b84;}

.event-hero{position:relative;overflow:hidden;border-radius:var(--r);min-height:170px;padding:20px;background:#dbece2;color:#17312b;border:1px solid #cfe3d7;}
.event-hero::after{content:"";position:absolute;right:-20px;bottom:-36px;width:130px;height:130px;border-radius:44px;transform:rotate(35deg);background:rgba(255,255,255,.4);}
.event-hero>*{position:relative;z-index:1;}
.event-hero .date{font-size:.7rem;font-weight:800;letter-spacing:.1em;text-transform:uppercase;color:#53776b;}
.event-hero .name{font-family:"DM Serif Display";font-size:1.4rem;line-height:1.1;letter-spacing:-.02em;margin-top:8px;}

/* Galeria */
.album-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:11px;}
.album-tile{position:relative;border-radius:19px;overflow:hidden;background:#e8efe9;border:1px solid var(--line);display:block;}
.album-cover{aspect-ratio:1;width:100%;object-fit:cover;background:linear-gradient(135deg,#d7ebdf,#f4d597);}
.album-tile .cap{position:absolute;left:0;right:0;bottom:0;padding:26px 11px 10px;color:#fff;font-weight:800;font-size:.78rem;
  background:linear-gradient(transparent,rgba(20,34,31,.72));text-shadow:0 1px 3px rgba(0,0,0,.4);}
.photo-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;}
.ph{position:relative;border-radius:14px;overflow:hidden;aspect-ratio:1;cursor:pointer;background:#eee;}
.ph img{width:100%;height:100%;object-fit:cover;}
.ph .vid{position:absolute;inset:0;display:grid;place-items:center;color:#fff;font-size:26px;background:linear-gradient(140deg,#31584b,#1f3a34);}
.ph .cnt{position:absolute;bottom:6px;right:6px;font-size:.62rem;font-weight:800;color:#fff;background:rgba(20,34,31,.55);border-radius:99px;padding:2px 7px;}

.lightbox{position:fixed;inset:0;z-index:80;display:none;background:rgba(16,26,23,.94);}
.lightbox.open{display:flex;flex-direction:column;}
.lb-top{display:flex;justify-content:space-between;align-items:center;padding:12px 14px;color:#fff;gap:10px;}
.lb-stage{flex:1;display:flex;align-items:center;justify-content:center;min-height:0;padding:0 8px 12px;}
.lb-stage img{max-width:100%;max-height:100%;border-radius:10px;object-fit:contain;}
.lb-stage video{max-width:100%;max-height:100%;border-radius:10px;outline:none;}
.lb-nav{position:absolute;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:46px;height:46px;border-radius:50%;background:rgba(255,255,255,.14);color:#fff;font-size:20px;}
.lb-prev{left:8px;} .lb-next{right:8px;}
.lb-like{display:inline-flex;align-items:center;gap:6px;padding:8px 13px;border-radius:99px;background:rgba(255,255,255,.14);color:#fff;font-weight:800;font-size:.8rem;}
.lb-like.on{background:#e2574c;}

/* Rozmowy */
.thread-card{display:block;padding:15px 17px;border-bottom:1px solid #edf0ea;}
.thread-card:last-child{border-bottom:0;}
.thread-top{display:flex;align-items:center;gap:9px;font-size:.72rem;color:var(--muted-2);}
.thread-title{margin:7px 0 4px;font-size:.95rem;font-weight:800;color:#29423a;}
.thread-ex{font-size:.82rem;color:#687771;line-height:1.5;}
.thread-foot{display:flex;gap:13px;margin-top:8px;font-size:.7rem;font-weight:700;color:#7c8b85;}
.msg{display:flex;gap:10px;padding:12px 0;border-bottom:1px solid #eef0eb;}
.msg:last-child{border-bottom:0;}
.msg-body{min-width:0;flex:1;}
.msg-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:7px;font-size:.7rem;color:var(--muted-2);}
.msg-head b{font-size:.8rem;color:#2a423b;}
.msg-text{white-space:pre-wrap;font-size:.87rem;color:#3d5149;line-height:1.55;margin-top:3px;}
.msg-actions{display:flex;gap:11px;margin-top:6px;}
.msg-actions button{font-size:.68rem;font-weight:800;color:#7c8b85;}
.msg-actions button:hover{color:var(--spruce);}
.edited-mark{font-style:italic;font-size:.64rem;color:#9aa8a1;}

/* Materiały */
.res-item{display:flex;align-items:center;gap:12px;padding:13px 0;border-bottom:1px solid #edf0ea;}
.res-item:last-child{border-bottom:0;}
.res-icon{flex:0 0 auto;display:grid;width:42px;height:42px;place-items:center;border-radius:14px;font-size:18px;background:#edebff;color:#5a4e94;}
.res-icon.pdf{background:#ffe9dd;color:#8e432c;}
.res-icon.img{background:#e4f0e9;color:#285346;}
.res-name{font-size:.85rem;font-weight:800;color:#29423a;}
.res-meta{font-size:.7rem;color:#84918c;margin-top:2px;}
.res-actions{margin-left:auto;display:flex;gap:7px;flex-shrink:0;}

/* Koszty */
.exp-card{padding:17px;}
.exp-head{display:flex;gap:11px;align-items:flex-start;}
.exp-ico{flex:0 0 auto;display:grid;width:38px;height:38px;place-items:center;border-radius:13px;background:#fde7c2;color:#8c5520;font-size:17px;}
.exp-due{font-size:.72rem;color:#7f8d87;}
.exp-instr{font-size:.8rem;color:#657971;white-space:pre-wrap;line-height:1.5;}

/* Moderacja / zaproszenia */
.mod-row{padding:12px 0;border-bottom:1px dashed #e4ebe6;}
.mod-row:last-child{border-bottom:0;}
.code-box{margin-top:10px;padding:13px;border-radius:13px;background:#eef5f0;color:#38564b;font-size:.95rem;font-weight:800;letter-spacing:.06em;word-break:break-all;display:none;}
.code-box.show{display:block;}

/* Regulamin */
.rules-grid{display:grid;gap:16px;max-width:940px;}
.privacy-card{background:#3b5950;color:#fff;border:0;}
.privacy-card p{color:rgba(255,255,255,.78);}
.privacy-card ul li{color:#eaf2ed;font-size:.82rem;margin:6px 0;}
.rules-grid ul li{font-size:.85rem;color:#4d5f58;margin:6px 0;}

/* Strona ustaleń (tabele) */
.doc-table{width:100%;border-collapse:collapse;margin:10px 0 18px;font-size:.84rem;}
.doc-table th{background:var(--sage);text-align:left;padding:10px 12px;border-radius:10px 10px 0 0;color:#285346;font-size:.78rem;}
.doc-table td{padding:10px 12px;border-bottom:1px solid #e7ede8;color:#3f544c;vertical-align:top;}
.doc-table tr:last-child td{border-bottom:0;}
.doc-table td:first-child{white-space:nowrap;font-weight:700;color:#2b433c;}
.entry-content h3{font-family:"Caveat",cursive;font-weight:700;font-size:1.7rem;color:var(--spruce);margin:22px 0 8px;transform:rotate(-.4deg);}
.entry-content h4{margin:18px 0 6px;font-size:1rem;font-weight:800;color:#243a34;}

/* Dołącz - FIX: desktop nie ucina, 2 kolumny na szerokim ekranie */
.gate-wrap{min-height:calc(100dvh - 40px);display:flex;align-items:center;justify-content:center;padding:32px 20px;}
.gate-card{width:min(100%,980px);display:grid;gap:22px;align-items:start;}
.gate-card > .chalk-card{margin:0;}
.gate-card > .surface.card{margin:0;}
.gate-list{margin-top:14px;}
.gate-list li{font-size:.82rem;color:#4d5f58;margin:7px 0;}

/* Mobile: wąski stack wyśrodkowany (zachowuje obecny dobry wygląd) */
@media(max-width:859.9px){
  .gate-card{width:min(100%,430px);grid-template-columns:1fr;}
  .gate-wrap{padding:24px 14px;align-items:flex-start;}
}

/* Desktop: tablica + formularz obok siebie, wyśrodkowane, bez ucięcia */
@media(min-width:860px){
  .gate-card{grid-template-columns:400px minmax(0,1fr);gap:28px;}
  .gate-card .chalk-card{position:sticky;top:24px;min-height:420px;display:flex;flex-direction:column;justify-content:center;padding:36px 30px;}
  .gate-card .chalk-title{font-size:2.55rem;}
  .gate-card .chalk-sub{font-size:.96rem;max-width:32ch;}
  .gate-card .surface.card{padding:26px 28px;}
  .gate-card > p:last-child{grid-column:1 / -1;text-align:center;margin-top:2px;}
}

/* Toast */
.toast{position:fixed;left:14px;right:14px;bottom:78px;z-index:90;max-width:420px;margin:0 auto;padding:13px 16px;border-radius:15px;
  border:1px solid #d5e3da;background:#f4fbf7;color:#245545;font-size:.8rem;font-weight:700;box-shadow:0 15px 30px rgba(31,58,52,.16);
  opacity:0;transform:translateY(8px);transition:all .25s ease;pointer-events:none;}
.toast.show{opacity:1;transform:none;}
.toast.err{background:#fdf1ee;border-color:#f3d3cb;color:#8c3a2b;}

/* ============ DESKTOP ≥ 900px ============ */
@media(min-width:900px){
  body{font-size:15.5px;}
  .rk-shell{display:grid;grid-template-columns:240px minmax(0,1fr);max-width:1440px;margin:0 auto;min-height:100vh;}
  /* FIX: wylogowany nie ma side-nav - nie zostawiaj pustej kolumny 240px */
  body:not(.logged-in) .rk-shell{display:block;max-width:1180px;}
  body:not(.logged-in) .main-area{max-width:1180px;margin:0 auto;padding:40px 28px 50px;}
  .mobile-top,.bottom-tabs,.sheet-backdrop,.sheet{display:none;}
  .side-nav{position:sticky;top:0;height:100vh;display:flex;flex-direction:column;padding:28px 16px 20px;border-right:1px solid var(--line);
    background:rgba(251,250,246,.75);backdrop-filter:blur(18px);overflow:auto;}
  .side-nav nav{margin-top:34px;display:flex;flex-direction:column;gap:3px;}
  .nbtn{display:flex;align-items:center;gap:11px;width:100%;padding:11px 12px;border-radius:14px;color:#64726d;font-size:.9rem;font-weight:700;
    text-align:left;transition:background .16s,color .16s,transform .16s;}
  .nbtn .ico{font-size:17px;width:22px;text-align:center;filter:saturate(.9);}
  .nbtn:hover{background:rgba(31,58,52,.06);color:var(--spruce);}
  .nbtn:active{transform:scale(.98);}
  .nbtn.active{background:var(--spruce);color:#fff;box-shadow:0 8px 20px rgba(31,58,52,.16);}
  .side-privacy{margin-top:auto;margin-bottom:12px;display:flex;gap:8px;padding:11px;border-radius:16px;background:#edf4ef;
    font-size:.66rem;line-height:1.45;color:#587168;font-weight:600;}
  .side-user{display:flex;align-items:center;gap:10px;padding:8px 6px;border-radius:14px;}
  .side-user .nm{min-width:0;}
  .side-user .nm b{display:block;font-size:.76rem;color:#344f46;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .side-user a{display:block;font-size:.66rem;color:#82918b;font-weight:700;}
  .main-area{padding:26px 34px 46px;}
  .notif-panel{left:auto;width:380px;top:20px;right:24px;}
  .toast{right:24px;left:auto;bottom:24px;max-width:360px;}
  .dash-grid{display:grid;grid-template-columns:minmax(0,1.42fr) minmax(290px,.9fr);gap:18px;align-items:start;}
  .cal-grid{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(280px,.72fr);gap:18px;align-items:start;}
  .album-grid{grid-template-columns:repeat(auto-fill,minmax(190px,1fr));}
  .photo-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:9px;}
  .quick-tiles{grid-template-columns:repeat(4,1fr);}
  .rules-grid{grid-template-columns:1fr 1fr;}
  .two-col{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start;}
}
@media(max-width:899.9px){
  .side-nav{display:none;}
}

@media(prefers-reduced-motion:no-preference){
  .surface,.chalk-card,.event-hero{animation:rise .4s cubic-bezier(.23,1,.32,1) both;}
  @keyframes rise{from{opacity:0;transform:translateY(8px);}to{opacity:1;transform:translateY(0);}}
}
