:root{
  --bg:#0E1F17; --surface:#16311F; --surface-2:#1E3D28; --felt:#1F5B38;
  --text:#F4EFE3; --text-2:#B9C4B4; --accent:#D9A441; --accent-on:#1A130A;
  --border:#2C4A36; --danger:#C4453D; --danger-text:#F0958C; --success:#6FAE7F; --cushion:#6B4A2F;
}
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:Rubik,system-ui,sans-serif;background:#081209;color:var(--text);line-height:1.55;font-size:16px;display:flex;justify-content:center;min-height:100dvh}
.phone{width:100%;max-width:430px;background:var(--bg);min-height:100dvh;display:flex;flex-direction:column;position:relative}
header.app{padding:18px 20px 10px;display:flex;align-items:center;gap:10px;justify-content:space-between}
header.app .brand{display:flex;align-items:center;gap:10px;font-weight:700;font-size:18px}
select#lang{background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:4px 8px;font:inherit;font-size:13px}
main{flex:1;overflow-y:auto;padding:4px 16px 96px}
h2{font-size:22px;font-weight:600;margin:18px 4px 10px}
h3{font-size:17px;font-weight:600;margin:12px 0 6px}
.card{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:16px;margin-bottom:12px}
.muted{color:var(--text-2);font-size:14px}
.row{display:flex;align-items:center;gap:12px}
.spread{justify-content:space-between}
.ball{min-width:40px;width:40px;height:40px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:17px}
.pill{font:inherit;font-weight:600;background:var(--accent);color:var(--accent-on);border:0;border-radius:999px;padding:11px 24px;cursor:pointer;width:100%;margin-top:10px}
.pill:disabled{opacity:.45;cursor:not-allowed}
.pill:active{transform:scale(.98)}
.pill.danger{background:var(--danger);color:#fff}
.ghost{font:inherit;background:transparent;color:var(--text);border:1px solid var(--border);border-radius:999px;padding:9px 20px;cursor:pointer}
.ghost:hover{border-color:var(--accent);color:var(--accent)}
.bar{height:8px;background:var(--surface-2);border-radius:999px;overflow:hidden;margin:8px 0 4px}
.bar>div{height:100%;background:var(--accent);border-radius:999px}
nav.bottom{position:fixed;bottom:0;width:100%;max-width:430px;background:var(--surface);border-top:1px solid var(--border);display:flex;z-index:10}
nav.bottom button{flex:1;background:none;border:0;color:var(--text-2);font:inherit;font-size:11.5px;padding:10px 0 12px;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:3px}
nav.bottom button.on{color:var(--accent)}
nav.bottom svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.unit{display:flex;gap:12px;align-items:center;padding:12px;border:1px solid var(--border);border-radius:12px;margin-bottom:8px;cursor:pointer;background:var(--surface)}
.unit:hover{border-color:var(--accent)}
.unit .n{min-width:34px;height:34px;border-radius:50%;background:var(--surface-2);display:flex;align-items:center;justify-content:center;font-weight:600;font-size:14px;font-variant-numeric:tabular-nums}
.unit.done .n{background:var(--success);color:#0E1F17}
.num{font-variant-numeric:tabular-nums;direction:ltr;unicode-bidi:isolate}
.tablewrap{background:var(--cushion);border-radius:14px;padding:10px;touch-action:none}
svg.snooker{display:block;width:100%;border-radius:8px;background:var(--felt)}
.notice{font-size:12.5px;color:var(--text-2);border:1px dashed var(--border);border-radius:10px;padding:8px 12px;margin:10px 0}
.tag{font-size:12px;border:1px solid var(--border);border-radius:999px;padding:2px 10px;color:var(--text-2)}
.tag.draft{border-color:var(--text-2)}
.seg{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}
.seg button{font:inherit;font-size:14px;background:var(--surface-2);border:1px solid var(--border);color:var(--text);border-radius:999px;padding:7px 16px;cursor:pointer}
.seg button.on{background:var(--accent);color:var(--accent-on);border-color:var(--accent);font-weight:600}
.stepper{display:flex;align-items:center;gap:16px;justify-content:center;margin:10px 0}
.stepper button{width:44px;height:44px;border-radius:50%;border:1px solid var(--border);background:var(--surface-2);color:var(--text);font-size:22px;cursor:pointer}
.stepper b{font-size:28px;min-width:72px;text-align:center}
.back{background:none;border:0;color:var(--accent);font:inherit;cursor:pointer;padding:6px 0;font-weight:500}
.modal-bg{position:fixed;inset:0;background:rgba(0,0,0,.55);display:flex;align-items:center;justify-content:center;z-index:50;padding:20px}
.modal{background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:20px;max-width:360px;width:100%}
.principle-full{display:flex;flex-direction:column;justify-content:center;min-height:55dvh;text-align:center;padding:24px}
.principle-full .t{font-size:26px;font-weight:700;margin-bottom:12px}
.principle-full .b{font-size:18px;color:var(--text-2)}
table.simple{width:100%;border-collapse:collapse;font-size:14px}
table.simple td,table.simple th{padding:8px 10px;border-bottom:1px solid var(--border);text-align:start}
table.simple th{color:var(--text-2);font-weight:500}
.palette{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}
.palette button{width:34px;height:34px;border-radius:50%;border:2px solid transparent;cursor:pointer}
.palette button.on{border-color:var(--accent)}
.toolbar{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.toolbar .ghost{flex:1;min-width:110px}
@media (prefers-reduced-motion: reduce){*{transition:none!important}}
/* tap targets: at least 44px (Q2 finding, 13.11) */
.ghost,.back,.seg button,select#lang{min-height:44px;min-width:44px}
.palette button{width:44px;height:44px}
/* a11y (13.11): visible keyboard focus; brand is the page h1 */
:focus-visible{outline:3px solid var(--accent);outline-offset:2px;border-radius:6px}
header.app h1.brand{margin:0;line-height:1.2}
/* S4 (13.11): admin screen on desktop widths. Phone layout is unchanged below 1024px. */
@media (min-width:1024px){
 body.admin-wide .phone{max-width:1180px}
 body.admin-wide nav.bottom{max-width:1180px}
 body.admin-wide .admin-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start}
 body.admin-wide .admin-grid .card{margin-bottom:0}
 body.admin-wide .admin-grid .admin-main{grid-row:span 2}
 body.admin-wide main{padding-inline:32px}
}

/* payments (13.11) */
.shop .pkg{position:relative}
.shop .pkg.best{border-color:var(--accent)}
.shop .price{font-size:28px;font-weight:700;margin:6px 0 2px;color:var(--text)}
.best-tag{border-color:var(--accent);color:var(--accent)}
.ok-tag{border-color:var(--success);color:var(--success)}
.pay-err{color:var(--danger-text);border:1px solid var(--danger);border-radius:10px;padding:8px 12px;margin:12px 0 0;font-size:14px}
.pay-done{text-align:center}
.pay-done .big-check{width:64px;height:64px;border-radius:50%;background:var(--success);color:#0E1F17;font-size:34px;font-weight:700;display:flex;align-items:center;justify-content:center;margin:4px auto 12px}
@media (min-width:600px){.shop{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.shop .card{margin-bottom:0}}

/* =====================================================================
   SOCIAL NETWORK (Instagram-style)
   ===================================================================== */
.av{border-radius:50%;object-fit:cover;flex-shrink:0;display:inline-block;background:var(--surface-2)}
.av-init{display:inline-flex;align-items:center;justify-content:center;color:#fff;font-weight:600;border-radius:50%}
.mini-badge{font-size:10.5px;font-weight:600;padding:1px 7px;border-radius:999px;vertical-align:middle;letter-spacing:.02em}
.mini-badge.coach{background:rgba(217,164,65,.16);color:var(--accent);border:1px solid rgba(217,164,65,.4)}
.mini-badge.admin{background:rgba(111,174,127,.16);color:var(--success);border:1px solid rgba(111,174,127,.4)}
.mini-badge.grade{background:var(--surface-2);color:var(--text-2);border:1px solid var(--border)}
.handle{color:var(--text-2);font-weight:400;font-size:13px}
.feed-head{display:flex;align-items:center;justify-content:space-between;margin:14px 4px 4px}
.feed-head h2{margin:0}
.icon-btn{background:none;border:0;color:var(--text);cursor:pointer;width:40px;height:40px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:18px;transition:background .15s}
.icon-btn:hover{background:var(--surface-2)}
.icon-btn.sm{width:32px;height:32px;font-size:14px;color:var(--text-2)}
.icon-btn svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.link-btn{background:none;border:0;color:var(--accent);font:inherit;font-weight:600;cursor:pointer;padding:6px 4px}
.link-btn.disabled{color:var(--text-2);pointer-events:none;opacity:.6}
.feed-scope{justify-content:center;gap:0;background:var(--surface);border:1px solid var(--border);border-radius:999px;padding:4px;max-width:280px;margin:8px auto 14px}
.feed-scope button{flex:1;border:0;background:none;border-radius:999px;padding:8px 14px}
.feed-scope button.on{background:var(--accent);color:var(--accent-on)}
.composer-row{display:flex;align-items:center;gap:12px;cursor:pointer;padding:12px 16px}
.composer-hint{flex:1;color:var(--text-2);font-size:14.5px}
.comp-ico{width:22px;height:22px;stroke:var(--accent);fill:none;stroke-width:2;stroke-linecap:round}
.post-card{padding:0;overflow:hidden}
.post-top{display:flex;align-items:center;gap:10px;padding:12px 14px 10px}
.post-author{display:flex;align-items:center;gap:10px;flex:1;cursor:pointer;min-width:0;color:var(--text)}
.pa-meta{display:flex;flex-direction:column;line-height:1.3;min-width:0}
.pa-meta b{font-size:14.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nl{display:flex;align-items:center;gap:6px;flex-wrap:wrap;min-width:0}
.nl b{font-size:14.5px}
.c-head .nl b{font-size:14px}
.post-time{font-size:12px}
.post-img{background:#081209;position:relative;cursor:pointer;aspect-ratio:1/1;display:flex;align-items:center;justify-content:center;overflow:hidden}
.post-img img{width:100%;height:100%;object-fit:cover;display:block}
.post-img-skel{aspect-ratio:1/1;background:var(--surface-2);animation:pulse 1.4s ease-in-out infinite}
@keyframes pulse{0%,100%{opacity:.4}50%{opacity:.7}}
.post-text{padding:4px 16px 14px;font-size:16px;line-height:1.5;white-space:pre-wrap;word-break:break-word}
.post-text.pinned-text{font-size:16.5px}
.post-actions{display:flex;gap:4px;padding:8px 10px 2px}
.post-actions .act{background:none;border:0;cursor:pointer;color:var(--text);padding:6px;border-radius:50%;transition:transform .12s}
.post-actions .act:active{transform:scale(.85)}
.post-actions .act svg{width:26px;height:26px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.post-actions .act.liked{color:var(--danger)}
.post-actions .act svg.filled{fill:var(--danger);stroke:var(--danger)}
.post-likes{padding:2px 16px;font-weight:600;font-size:14px;cursor:pointer}
.post-cap{padding:2px 16px 6px;font-size:14.5px;line-height:1.5;word-break:break-word}
.post-cap b{margin-inline-end:5px}
.post-cc{padding:2px 16px 14px;font-size:13.5px;cursor:pointer}
.load-more{width:100%;margin:4px 0 16px}
.feed-end{text-align:center;font-size:13px;padding:10px 0 20px;letter-spacing:.04em}
.empty-state{text-align:center;padding:28px 18px}
.empty-state .pill{max-width:220px;margin:14px auto 0}
.heart-burst{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:90px;color:#fff;pointer-events:none;animation:heartpop .8s ease-out forwards;text-shadow:0 2px 16px rgba(0,0,0,.5)}
@keyframes heartpop{0%{transform:scale(.2);opacity:0}25%{transform:scale(1.1);opacity:.95}70%{transform:scale(1);opacity:.9}100%{transform:scale(1.25);opacity:0}}
/* nav notification dot */
.nav-ic-wrap{position:relative;display:inline-flex}
.notif-dot{position:absolute;top:-5px;inset-inline-end:-7px;min-width:16px;height:16px;padding:0 4px;background:var(--danger);color:#fff;border-radius:999px;font-size:10px;font-weight:700;display:flex;align-items:center;justify-content:center;line-height:1}
/* composer modal */
.modal.composer,.modal.list-modal{max-width:440px;padding:0;overflow:hidden}
.modal-head{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid var(--border)}
.modal-head b{font-size:16px}
.composer-body{padding:16px}
.comp-text{flex:1;background:transparent;border:0;color:var(--text);font:inherit;font-size:15.5px;resize:vertical;outline:none;min-height:90px}
.comp-preview{position:relative;margin-top:12px;border-radius:12px;overflow:hidden}
.comp-preview img{width:100%;display:block;max-height:380px;object-fit:cover}
.comp-preview .remove{position:absolute;top:8px;inset-inline-end:8px;background:rgba(0,0,0,.6);color:#fff}
.comp-add{display:inline-flex;align-items:center;gap:8px;margin-top:14px;color:var(--accent);font-weight:600;cursor:pointer;font-size:14.5px}
.comp-add svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
/* comments */
.comments{padding:0 2px}
.comment{display:flex;gap:10px;padding:10px 4px;align-items:flex-start}
.comment .c-body{flex:1;min-width:0}
.c-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.c-head b{font-size:14px}
.c-time{font-size:12px}
.c-text{font-size:14.5px;line-height:1.45;margin-top:2px;word-break:break-word}
.comment-bar{position:sticky;bottom:0;display:flex;align-items:center;gap:10px;padding:10px 6px;background:var(--bg);border-top:1px solid var(--border)}
.comment-bar input{flex:1;background:var(--surface-2);border:1px solid var(--border);border-radius:999px;color:var(--text);font:inherit;padding:10px 16px;outline:none}
/* profile */
.profile-head{margin-bottom:12px}
.prof-cover{height:120px;border-radius:14px;background-size:cover;background-position:center;margin-bottom:-44px}
.prof-cover.plain{background:linear-gradient(135deg,var(--felt),var(--surface-2))}
.prof-main{display:flex;align-items:flex-end;gap:14px;padding:0 6px}
.prof-avatar .av{border:4px solid var(--bg);box-shadow:0 2px 10px rgba(0,0,0,.3)}
.prof-info{flex:1;padding-bottom:4px}
.prof-name{font-size:19px;font-weight:700;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.prof-counts{display:flex;gap:18px;margin-top:8px}
.prof-counts .stat{font-size:13.5px;color:var(--text-2);cursor:pointer}
.prof-counts .stat b{color:var(--text);font-size:15px;margin-inline-end:3px}
.prof-bio{padding:12px 6px 4px;font-size:14.5px;line-height:1.5;color:var(--text)}
.prof-actions{padding:10px 6px 4px}
.prof-btn{width:100%;max-width:100%}
.pill.following,.ghost.following{background:var(--surface-2);color:var(--text);border:1px solid var(--border)}
.post-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:3px;margin-top:6px}
.grid-cell{position:relative;aspect-ratio:1/1;border:0;padding:0;cursor:pointer;background:var(--surface-2);overflow:hidden;border-radius:4px}
.grid-cell img{width:100%;height:100%;object-fit:cover;display:block}
.grid-cell.text-cell{display:flex;align-items:center;justify-content:center;padding:10px;background:linear-gradient(135deg,var(--surface),var(--surface-2))}
.grid-cell.text-cell span{font-size:12.5px;color:var(--text-2);line-height:1.4;overflow:hidden;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical}
.cell-likes{position:absolute;bottom:4px;inset-inline-start:6px;color:#fff;font-size:12px;font-weight:600;text-shadow:0 1px 4px rgba(0,0,0,.6)}
.edit-avatar{display:flex;flex-direction:column;align-items:center;gap:6px;padding:16px}
/* people list / search */
.search-bar{display:flex;align-items:center;gap:10px;background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:10px 14px;margin:10px 0}
.search-bar svg{width:20px;height:20px;stroke:var(--text-2);fill:none;stroke-width:2;stroke-linecap:round}
.search-bar input{flex:1;background:none;border:0;color:var(--text);font:inherit;outline:none}
.people-list{padding:4px}
.list-modal .people-list{max-height:60vh;overflow-y:auto;padding:8px}
.person{display:flex;align-items:center;gap:12px;padding:10px 8px;cursor:pointer;border-radius:10px}
.person:hover{background:var(--surface-2)}
.person .p-meta{flex:1;min-width:0;font-size:14.5px}
.follow-sm{padding:6px 16px;font-size:13px;min-height:auto}
.follow-sm.following{background:var(--surface-2)}
/* notifications */
.notif-list{display:flex;flex-direction:column;gap:2px}
.notif{display:flex;align-items:center;gap:12px;padding:12px 10px;border-radius:10px;cursor:pointer;position:relative}
.notif:hover{background:var(--surface)}
.notif.unread{background:rgba(217,164,65,.07)}
.notif.unread::before{content:'';position:absolute;inset-inline-start:0;top:50%;transform:translateY(-50%);width:4px;height:60%;background:var(--accent);border-radius:999px}
.notif .n-body{flex:1;min-width:0;display:flex;flex-direction:column}
.notif .n-body span:first-child{font-size:14px;line-height:1.4}
.n-time{font-size:12px}
.n-ico{font-size:17px}
.n-ico.like{color:var(--danger)}

/* =====================================================================
   RESPONSIVE: tablet & desktop for the WHOLE app (not just admin)
   Phone-first layout below is untouched under 720px.
   ===================================================================== */
@media (min-width:720px){
  body{background:radial-gradient(1200px 600px at 50% -10%, #10261a 0%, #081209 60%)}
  .phone{max-width:680px;box-shadow:0 0 0 1px var(--border),0 30px 80px rgba(0,0,0,.45);border-radius:0}
  main{padding:4px 28px 110px}
  .shop{grid-template-columns:repeat(3,1fr)}
  .post-img,.post-img-skel{aspect-ratio:4/3}
}
/* Desktop: sidebar nav + roomy content; applies to every screen, every role */
@media (min-width:1040px){
  body{align-items:stretch}
  .phone{max-width:1180px;width:100%;display:grid;grid-template-columns:230px 1fr;grid-template-rows:auto 1fr;grid-template-areas:'head head' 'nav main';min-height:100dvh}
  header.app{grid-area:head;border-bottom:1px solid var(--border);padding:16px 28px}
  nav.bottom{grid-area:nav;position:static;width:auto;max-width:none;flex-direction:column;border-top:0;border-inline-end:1px solid var(--border);padding:16px 12px;gap:4px;background:transparent}
  nav.bottom button{flex:0 0 auto;flex-direction:row;justify-content:flex-start;gap:14px;font-size:15px;padding:12px 16px;border-radius:12px;width:100%}
  nav.bottom button svg{width:24px;height:24px}
  nav.bottom button.on{background:var(--surface);color:var(--accent)}
  nav.bottom button:hover{background:var(--surface-2)}
  .nav-ic-wrap .notif-dot{top:-4px;inset-inline-end:auto;inset-inline-start:14px}
  main{grid-area:main;padding:20px 40px 60px;max-width:1000px}
  /* feed reads best in a centred column even on wide screens */
  .feed-head,.feed-scope,.composer-row,.post-card,.load-more,.feed-end,#view>.comments,#view>.comment-bar,.profile-head,.post-grid,.search-bar,.people-list,.notif-list,#view>h2,#view>h3,#view>.notice,#view>.card:not(.admin-grid .card),#view>.seg,#view>.unit{max-width:620px;margin-inline:auto}
  .feed-head{margin-inline:auto}
  body.admin-wide .phone{max-width:1320px}
  body.admin-wide main{max-width:none}
  body.admin-wide .admin-grid{max-width:none}
  .comment-bar{position:sticky}
}
@media (min-width:1040px){
  /* post detail + profile grids can breathe a bit wider */
  .post-card.detail{max-width:620px}
  .post-grid{gap:4px}
}
