:root {
  --bg: #080b11;
  --side: #0b0f16;
  --panel: #111820;
  --line: #243140;
  --text: #eef3f8;
  --mute: #8b99a8;
  --ice: #66c3ff;
  --ink: #071018;
  --ok: #7ee0b0;
  --bad: #ff9aa8;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --display: "Barlow Condensed", sans-serif;
  --r: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.mbar, .tabbar { display: none; }
.banner {
  background: var(--ice); color: var(--ink); text-align: center;
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 7px 12px;
}
html, body, #ps-app { height: 100%; }
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; }
.side {
  background: var(--side); border-right: 1px solid var(--line);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
}
.logo { display: block; margin-bottom: 16px; }
.logo img { height: 26px; width: auto; }
.me {
  display: flex; gap: 10px; align-items: center; padding: 10px;
  border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 16px;
  width: 100%; background: none; color: inherit; text-align: left;
}
.me:hover, .me[aria-current=true] { border-color: var(--ice); }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; }
.avatar.lg { width: 88px; height: 88px; font-size: 22px; cursor: pointer; }
.photo-row { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
input:disabled, input[readonly].lock {
  opacity: .7; border-style: dashed; cursor: not-allowed; color: var(--mute);
}
.set { max-width: 640px; display: grid; gap: 12px; }
.set h3 { margin-bottom: 12px; }
.me p { margin: 0; }
.me b { display: block; font-size: 13px; }
.me p span { color: var(--mute); font-size: 11px; }
.avatar {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: #16344a; color: var(--ice); display: grid; place-items: center;
  font-size: 11px; font-weight: 700; overflow: hidden; padding: 0; border: 0;
}
.nav-label {
  color: #6d7c8c; font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  margin: 12px 8px 6px; display: block;
}
.side nav button, .ghost {
  width: 100%; text-align: left; background: none; border: 0;
  color: var(--mute); border-radius: 10px; padding: 9px 12px; min-height: 40px;
}
.side nav button:hover { background: #121a24; color: var(--text); }
.side nav button[aria-current=page] { background: #16344a; color: var(--ice); font-weight: 600; }
.ghost.reset { margin-top: auto; border: 1px solid var(--line); color: var(--mute); }
main { padding: 24px 32px 72px; overflow: auto; }
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.crumb { color: var(--ice); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 4px; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -.03em; font-weight: 800; }
h1 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.1; }
.lead { color: var(--mute); margin: 8px 0 0; font-size: 14px; max-width: 52ch; line-height: 1.45; }
.primary, .btn {
  border: 0; background: var(--ice); color: var(--ink); border-radius: 10px;
  padding: 10px 16px; font-weight: 700; min-height: 40px;
}
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid #5a3038; }
.primary[hidden] { display: none; }
.grid { display: grid; gap: 12px; }
.kpis { grid-template-columns: repeat(4, 1fr); }
.cols-2 { grid-template-columns: 1.15fr .85fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px;
}
.card b.big { display: block; font-family: var(--display); font-size: 1.85rem; color: var(--ice); margin: 4px 0 2px; }
.muted { color: var(--mute); font-size: 13px; }
.row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.chip {
  font-size: 11px; border: 1px solid #355064; border-radius: 99px;
  padding: 3px 8px; color: var(--ice); white-space: nowrap;
}
.chip.warn { color: var(--bad); border-color: #5a3038; }
.bar { height: 8px; background: #1b2734; border-radius: 99px; overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; background: var(--ice); }
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.col { background: #0d131b; border: 1px solid var(--line); border-radius: 14px; padding: 12px; min-height: 280px; }
.col h3 { font-size: 13px; color: var(--mute); font-family: var(--font); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; }
.item {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; margin: 0 0 8px; cursor: pointer; text-align: left; width: 100%; color: inherit;
}
.item:hover, .item:focus-visible { border-color: var(--ice); outline: none; }
.week {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px;
}
.day-tab {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 8px; text-align: center; color: var(--text); min-height: 72px;
}
.day-tab strong { display: block; font-size: 11px; color: var(--mute); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.day-tab b { display: block; font-family: var(--display); font-size: 1.4rem; margin-top: 4px; }
.day-tab[aria-current=true] { border-color: var(--ice); background: #16344a; }
.day-tab .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ice); margin: 6px auto 0; }
.agenda { display: flex; flex-direction: column; gap: 8px; }
.appt {
  display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: start;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; text-align: left; color: inherit; width: 100%;
}
.appt time { color: var(--ice); font-weight: 600; font-variant-numeric: tabular-nums; }
.tree { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 8px 0 24px; }
.person {
  width: 220px; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--panel); text-align: left;
}
.person.me { border-color: #3a6a88; }
.invite-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 8px;
}
.invite-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; margin: 8px 0; }
.invite-row input {
  font-family: ui-monospace, Menlo, monospace; font-size: 13px;
  background: #0b111a; border: 1px solid #4a5d70; border-radius: 8px; padding: 10px 12px;
}
.org { margin-top: 16px; }
.org-kids { margin: 4px 0 4px 18px; padding-left: 14px; border-left: 1px solid var(--line); }
.org-row {
  display: flex; gap: 10px; align-items: flex-start; width: 100%;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; text-align: left; color: inherit; margin: 4px 0;
}
.org-row:hover:not(:disabled) { border-color: var(--ice); }
.org-row:disabled { opacity: 1; cursor: default; }
.org-row.you { border-color: #3a6a88; }
.chev {
  width: 36px; height: 36px; border-radius: 8px; background: #16344a; color: var(--ice);
  display: grid; place-items: center; font-weight: 700; flex-shrink: 0; margin-top: 0;
  border: 0;
}
button.chev { cursor: pointer; }
button.chev:active { transform: scale(.96); }
.org-body { display: grid; gap: 2px; }
.org-body b { font-size: 14px; }
.brand-block { margin-bottom: 22px; }
h3.sec { font-size: 0.95rem; color: var(--mute); font-family: var(--font); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.spot-bp { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ice); }
.note-box { max-width: 640px; margin: 0 auto; }
.chat {
  display: flex; flex-direction: column; height: min(68vh, 640px);
  background: #0d131b; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--mute); }
.msgs { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.bubble {
  max-width: 72%; padding: 10px 12px; border-radius: 14px; text-align: left;
  border: 0; color: inherit;
}
.bubble.them { background: #1a2430; align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.me { background: #1a4a66; align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble small { display: block; color: var(--mute); font-size: 11px; margin-bottom: 4px; }
.composer {
  display: grid; grid-template-columns: 1fr auto; gap: 8px;
  padding: 12px; border-top: 1px solid var(--line); background: var(--side);
}
.composer input { background: #111820; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.drive { display: grid; grid-template-columns: 200px 1fr; gap: 16px; min-height: 420px; }
.folders { background: #0d131b; border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.folders button { width: 100%; text-align: left; background: none; border: 0; color: var(--mute); padding: 10px 12px; border-radius: 8px; }
.folders button[aria-current=true] { background: #16344a; color: var(--ice); }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.file {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; text-align: left; color: inherit; min-height: 110px;
}
a.file { display: block; text-decoration: none; color: inherit; }
.file:hover { border-color: var(--ice); }
.file .ico { font-size: 22px; margin-bottom: 10px; color: var(--ice); font-weight: 700; }
.crumb-path { display: flex; gap: 6px; align-items: center; margin-bottom: 12px; color: var(--mute); font-size: 13px; }
.plan { width: 100%; border-collapse: collapse; font-size: 14px; }
.plan th, .plan td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); }
.plan th { color: var(--mute); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
.plan td.num { font-variant-numeric: tabular-nums; color: var(--ice); font-weight: 600; }
.plan tr.is-me { background: #16344a55; }
.lessons { display: grid; grid-template-columns: 280px 1fr; gap: 16px; min-height: 480px; }
.lesson-list { background: #0d131b; border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.lesson-list button {
  width: 100%; text-align: left; background: none; border: 0; color: var(--mute);
  padding: 12px; border-radius: 10px; display: grid; gap: 2px;
}
.lesson-list button[aria-current=true] { background: #16344a; color: var(--text); }
.lesson-list em { font-style: normal; font-size: 11px; color: var(--ice); }
.reader { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px 32px; max-width: 720px; }
.reader p { line-height: 1.55; color: #c5d0da; }
.reader ol { color: #c5d0da; padding-left: 18px; }
#dlg {
  width: min(480px, 94vw); border: 1px solid #3d5568; border-radius: 16px;
  background: #111820; color: var(--text); padding: 22px;
}
#dlg::backdrop { background: #02060ccc; }
#dlg h2 { margin-bottom: 14px; font-size: 1.5rem; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--mute); margin-bottom: 12px; }
input, select, textarea {
  background: #0b111a; border: 1px solid #4a5d70; border-radius: 8px; padding: 10px; width: 100%;
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.actions .grow { flex: 1; min-width: 8px; }
.toast {
  position: fixed; right: 16px; bottom: 16px; background: #123044; border: 1px solid var(--ice);
  padding: 10px 14px; border-radius: 10px; z-index: 30; font-size: 13px;
}
.search {
  width: 100%; max-width: 420px; margin-bottom: 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.phone { display: grid; grid-template-columns: 1fr 28px; gap: 8px; align-items: start; }
.abook { min-height: 420px; }
.letter {
  color: var(--ice); font-size: 12px; font-weight: 700; letter-spacing: .12em;
  margin: 18px 0 4px; padding: 0 4px;
}
.crow {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  color: inherit; text-align: left; padding: 10px 4px; min-height: 56px; border-radius: 0;
}
.crow:hover { background: #121a24; }
.crow b { display: block; font-weight: 600; }
.mark {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  display: inline-grid; place-items: center; font-size: 12px; font-weight: 800;
}
.mark.v { background: #16344a; color: var(--ice); }
.mark.r { background: #173528; color: var(--ok); }
.index {
  position: sticky; top: 8px; display: flex; flex-direction: column; align-items: center;
  font-size: 10px; line-height: 1.35; color: var(--mute);
}
.index button {
  background: none; border: 0; color: var(--ice); padding: 0; min-height: 0; font-size: 10px; width: auto;
}
.drop {
  border: 1px dashed #3a5166; border-radius: 14px; padding: 22px; text-align: center;
  color: var(--mute); margin-bottom: 14px; background: #0d131b;
}
.drop.over { border-color: var(--ice); color: var(--ice); }
.file img.th { width: 100%; height: 72px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; }
.pitch { font-size: 15px; line-height: 1.5; }
.pitch b { color: var(--ice); }
.range {
  width: 100%; height: 28px; margin: 8px 0 4px; accent-color: var(--ice);
  -webkit-appearance: none; appearance: none; background: transparent;
}
.range::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: #1b2734; }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin-top: -8px;
  border-radius: 50%; background: var(--ice); border: 0; cursor: grab;
}
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; min-height: 100dvh; padding-top: 52px; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .mbar {
    display: flex; position: fixed; top: 0; left: 0; right: 0; z-index: 40;
    align-items: center; justify-content: space-between; gap: 10px;
    height: 52px; padding: 0 12px; background: var(--side); border-bottom: 1px solid var(--line);
  }
  .mbar img { height: 22px; width: auto; }
  .mbar-av {
    width: 44px; height: 44px; border: 0; background: none; padding: 0;
    display: grid; place-items: center; overflow: hidden; border-radius: 10px;
  }
  .mbar-av .avatar, .mbar-av .avatar img { width: 36px; height: 36px; }
  .side { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kanban { grid-template-columns: repeat(4, minmax(220px, 1fr)); overflow-x: auto; padding-bottom: 8px; }
  .week { grid-template-columns: repeat(2, 1fr); }
  .drive, .lessons, .cols-2, .cols-3, .invite-row { grid-template-columns: 1fr; }
  .tabbar {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: #0b0f16f2; border-top: 1px solid var(--line);
    padding: 6px 8px calc(10px + env(safe-area-inset-bottom));
    overflow-x: scroll; overflow-y: hidden;
    -webkit-overflow-scrolling: touch; touch-action: pan-x;
    scrollbar-width: none; cursor: grab; user-select: none;
  }
  .tabbar.is-drag { cursor: grabbing; }
  .tabbar::-webkit-scrollbar { display: none; }
  .tabbar-track { display: flex; flex-wrap: nowrap; gap: 4px; width: max-content; min-width: 100%; }
  .tabbar button {
    flex: 0 0 auto; min-width: 86px; background: none; border: 0; color: var(--mute);
    min-height: 48px; font-size: 12px; font-weight: 600; padding: 8px 14px;
    white-space: nowrap; touch-action: pan-x;
  }
  .tabbar button[aria-current=page] { color: var(--ice); }
  .tabbar button.tab-logout { color: var(--bad); }
  main { padding: 16px 16px 24px; }
  .top { margin-bottom: 14px; }
  .primary { min-height: 44px; }
}
@media (min-width: 981px) {
  .mbar, .tabbar { display: none; }
}
@media (max-width: 640px) {
  .kpis, .drive, .lessons, .cols-2, .cols-3 { grid-template-columns: 1fr; }
  main { padding: 16px; }
}
.ps-access { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; }
.ps-login { width: min(420px, 100%); padding: 28px 26px 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.ps-login img { height: 34px; width: auto; margin-bottom: 18px; }
.ps-login h2 { margin: 0 0 8px; }
.ps-login p { margin: 0 0 16px; }
.ps-inline { display: flex; flex-wrap: wrap; gap: 10px; }
#ps-notice { margin: 12px 0; color: var(--ok); font-size: 13px; }
#ps-notice.error { color: var(--bad); }
.ps-empty { padding: 36px 18px; text-align: center; border: 1px dashed #496076; border-radius: 14px; color: var(--mute); }
.slot { position: relative; display: grid; gap: 4px; margin-bottom: 10px; cursor: pointer; }
.slot .slot-title { color: var(--text); font-weight: 600; }
.slot input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.slot:has(input:valid) { border-color: var(--ice); color: var(--ice); }
