:root{
  --accent:#4f5dff;
  --accent-strong:#7a3cff;
  --cyan:#2ad4d0;
  --ink:#12163a;
  --text:#1c2250;
  --muted:#4f5a9a;
  --border:rgba(89,103,255,.22);
  --card:#fff;
  --radius:16px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font:16px/1.55 "Manrope", sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(122,60,255,.12), transparent 34%),
    radial-gradient(circle at 90% 20%, rgba(42,212,208,.1), transparent 30%),
    linear-gradient(180deg, #f5f6ff 0%, #ebefff 45%, #f7f8ff 100%);
  min-height:100vh;
}
a{color:var(--accent-strong); text-decoration:none}
a:hover{color:var(--accent)}
.staff-wrap{width:min(1100px, 94vw); margin-inline:auto}
.staff-header{
  position:sticky; top:0; z-index:20;
  background:rgba(18,22,58,.92);
  border-bottom:1px solid rgba(170,190,255,.22);
  backdrop-filter:blur(12px);
  box-shadow:0 10px 28px rgba(12,16,48,.28);
}
.staff-header-inner{display:flex; align-items:center; justify-content:space-between; gap:14px; min-height:78px}
.staff-header-inner--nav{display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center}
.staff-logo{display:flex; align-items:center; gap:12px; color:#eef2ff; flex:0 0 auto}
.staff-logo:hover{color:#fff}
.staff-logo img{width:42px; height:auto; filter:drop-shadow(0 6px 14px rgba(20,30,90,.35))}
.staff-logo strong{display:block; letter-spacing:.04em}
.staff-logo small{display:block; color:rgba(200,210,255,.72); font-weight:600}
.staff-nav-slider{
  position:relative;
  min-width:0;
  height:56px;
  cursor:grab;
  user-select:none;
  -webkit-user-select:none;
  touch-action:none;
}
.staff-nav-slider.is-dragging,
.staff-nav-slider.is-dragging .staff-nav-btn{cursor:grabbing}
.staff-nav-viewport{
  overflow:hidden;
  height:100%;
  mask-image:linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
  -webkit-mask-image:linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
}
.staff-nav-track{
  display:flex;
  align-items:stretch;
  gap:10px;
  height:100%;
  width:max-content;
  will-change:transform;
  user-select:none;
  -webkit-user-select:none;
}
.staff-nav-btn{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 20px;
  min-width:132px;
  height:100%;
  border:1px solid rgba(170,190,255,.28);
  background:rgba(79,93,255,.18);
  color:#eef2ff;
  font-weight:700;
  font-size:15px;
  letter-spacing:.03em;
  white-space:nowrap;
  cursor:grab;
  user-select:none;
  -webkit-user-select:none;
  -webkit-user-drag:none;
  user-drag:none;
  transition:background .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease;
}
.staff-nav-btn:hover{
  color:#fff;
  background:rgba(79,93,255,.34);
  border-color:rgba(170,190,255,.55);
  box-shadow:0 10px 28px rgba(55,70,200,.28);
}
.staff-nav-btn.is-active{
  color:#fff;
  background:linear-gradient(145deg, rgba(79,93,255,.72), rgba(122,60,255,.72));
  border-color:rgba(180,200,255,.45);
  box-shadow:0 10px 28px rgba(55,70,200,.3);
}
.staff-nav-fade{display:none}
.staff-nav-exit{
  flex:0 0 auto;
  padding:12px 16px;
  border:1px solid rgba(170,190,255,.35);
  background:rgba(255,255,255,.08);
  color:#eef2ff;
  font-weight:700;
  font-size:14px;
  letter-spacing:.02em;
  transition:background .2s ease, border-color .2s ease, color .2s ease;
}
.staff-nav-exit:hover{
  color:#fff;
  background:rgba(229,83,75,.22);
  border-color:rgba(255,160,150,.45);
}
@media (max-width:720px){
  .staff-header-inner--nav{grid-template-columns:auto minmax(0,1fr); grid-template-rows:auto auto; gap:10px; padding-block:10px}
  .staff-nav-exit{grid-column:2; justify-self:end}
  .staff-nav-slider{grid-column:1 / -1; height:48px}
  .staff-nav-btn{min-width:112px; font-size:13px; padding:0 14px}
  .staff-logo small{display:none}
}
.staff-main{padding:36px 0 64px}
.staff-footer{padding:22px 0; color:#b8c4ff; background:linear-gradient(180deg,#171d52 0%, #12163a 100%); text-align:center; font-size:14px}

.eyebrow{margin:0 0 8px; color:var(--accent-strong); text-transform:uppercase; letter-spacing:.12em; font-size:12px; font-weight:700}
.eyebrow-link{color:inherit; text-decoration:none}
.eyebrow-link:hover{color:var(--ink); text-decoration:underline; text-underline-offset:3px}
.page-title{margin:0 0 10px; font-size:clamp(28px,4vw,40px); color:var(--ink); font-weight:800; line-height:1.15}
.muted{color:var(--muted)}
.card{
  background:linear-gradient(160deg,#fff 0%, #f0f2ff 100%);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:22px;
  box-shadow:0 10px 24px rgba(70,85,190,.08);
}
.card + .card{margin-top:16px}
.grid-2{display:grid; grid-template-columns:1.2fr .8fr; gap:16px}
@media (max-width:860px){.grid-2{grid-template-columns:1fr}}

.auth-card{max-width:480px; margin:40px auto; position:relative; z-index:3}
@media (max-width:520px){
  .form .remember-label{white-space:normal}
  .auth-logo{width:56px}
}

/* Карта России на фоне входа — по принципу Сахалина на главной */
body.staff-login-page{
  position:relative;
  overflow-x:hidden;
}
body.staff-login-page .staff-main{
  position:relative;
  min-height:calc(100vh - 160px);
}
.russia-sketch{
  position:fixed;
  left:50%;
  top:50%;
  transform:translate(-50%, -50%);
  z-index:1;
  pointer-events:none;
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:0;
  width:min(100vw, 2800px);
  padding:0;
  box-sizing:border-box;
}
.russia-sketch.is-revealing{opacity:1; transition:opacity .8s ease}
.russia-svg{
  width:100%;
  height:auto;
  max-height:min(100vh, 1120px);
  display:block;
  overflow:visible;
  filter:drop-shadow(0 10px 28px rgba(55,70,180,.22));
}
.russia-group{fill:rgba(89,103,255,.10)}
.russia-path{
  fill:rgba(89,103,255,.14);
  stroke:rgba(210,224,255,.55);
  stroke-width:2.2;
  stroke-linecap:round;
  stroke-linejoin:round;
  vector-effect:non-scaling-stroke;
  opacity:0;
}
.russia-main{
  fill:rgba(122,60,255,.14);
  stroke:rgba(220,232,255,.62);
  stroke-width:2.6;
}
.russia-neon{
  fill:none !important;
  stroke:#7af7ff;
  stroke-width:3;
  stroke-linecap:round;
  stroke-linejoin:round;
  vector-effect:non-scaling-stroke;
  pointer-events:none;
  filter:
    drop-shadow(0 0 3px rgba(42,212,208,.9))
    drop-shadow(0 0 10px rgba(89,103,255,.75))
    drop-shadow(0 0 16px rgba(122,60,255,.45));
}
.russia-neon-alt{
  stroke:#c4b5ff;
  stroke-width:2.2;
  filter:
    drop-shadow(0 0 3px rgba(196,181,255,.9))
    drop-shadow(0 0 12px rgba(122,60,255,.8));
}
@keyframes russiaNeonRun{
  to{stroke-dashoffset:0}
}
.russia-sketch.is-neon .russia-path{
  stroke:rgba(120,140,220,.32);
}
@media (max-width:640px){
  .russia-sketch{opacity:.5; width:100vw}
  .russia-svg{max-height:min(96vh, 720px)}
}
.auth-title-row{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  margin:0 0 12px;
}
.auth-card h1{margin:0; font-size:30px; color:var(--ink)}
.auth-logo{
  width:72px; height:auto; display:block; flex:0 0 auto;
  object-fit:contain;
  filter:drop-shadow(0 6px 14px rgba(55,70,180,.18));
}
.form{display:grid; gap:12px}
.form label{display:grid; gap:6px; font-weight:700; color:var(--ink); font-size:14px}
.form input:not([type="checkbox"]):not([type="radio"]),
.form select,
.form textarea{
  width:100%; border:1px solid var(--border); border-radius:12px;
  background:#fff; color:var(--ink); padding:12px 14px; font:inherit;
}
.form input:not([type="checkbox"]):not([type="radio"]):focus,
.form select:focus,
.form textarea:focus{
  outline:none; border-color:var(--cyan); box-shadow:0 0 0 3px rgba(42,212,208,.2);
}
.form-row{display:flex; align-items:center; gap:10px}
.form-row label{display:flex; align-items:center; gap:8px; font-weight:600; color:var(--muted)}
.form .remember-row{margin-top:2px}
.form .remember-label{
  display:flex; flex-direction:row; align-items:center; gap:10px;
  font-weight:600; color:var(--muted); white-space:nowrap;
}
.form .remember-label input[type="checkbox"]{
  width:18px; height:18px; margin:0; flex:0 0 auto;
  accent-color:var(--accent);
}
.form-actions{display:flex; gap:10px; flex-wrap:wrap; margin-top:4px}
.btn{
  appearance:none; border:0; border-radius:12px; cursor:pointer;
  background:linear-gradient(145deg, var(--accent), var(--accent-strong));
  color:#fff; font-weight:700; padding:12px 16px;
  box-shadow:0 10px 24px rgba(79,93,255,.28); display:inline-flex; align-items:center; gap:8px;
}
.btn:hover{filter:brightness(1.05); color:#fff}
.btn-ghost{background:#fff; color:var(--ink); border:1px solid var(--border); box-shadow:none}
.btn-ghost:hover{background:rgba(79,93,255,.08); color:var(--accent-strong); filter:none}
.btn-danger{background:linear-gradient(145deg,#f0716a,#c83b34)}
.btn-sm{padding:8px 12px; font-size:14px}

.alert{padding:12px 14px; border-radius:12px; margin:0 0 14px}
.alert-ok{background:rgba(31,169,113,.12); border:1px solid rgba(31,169,113,.4); color:#0e7a4e}
.alert-error{background:rgba(229,83,75,.1); border:1px solid rgba(229,83,75,.4); color:#a32d27}

.cabinet-tiles{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-top:18px}
@media (max-width:860px){.cabinet-tiles{grid-template-columns:1fr}}
.profile-grid{margin-top:14px}
.form-row-dates{display:grid; grid-template-columns:1fr 1fr; gap:12px}
@media (max-width:600px){.form-row-dates{grid-template-columns:1fr}}
.comms-tabs{display:flex; flex-wrap:wrap; gap:8px; margin:14px 0}
.comms-tab{
  padding:8px 12px; border-radius:999px; border:1px solid var(--border);
  background:#fff; color:var(--ink); font-weight:700; font-size:13px;
}
.comms-tab:hover,.comms-tab.active{background:rgba(79,93,255,.12); color:var(--accent-strong)}
.comms-status-filters{display:flex; flex-wrap:wrap; gap:8px; margin-bottom:4px}
.comms-list{display:flex; flex-direction:column; gap:10px}
.comms-item{border:1px solid var(--border); border-radius:12px; padding:12px; background:#fff}
.comms-item.is-new{background:rgba(79,93,255,.06); border-color:rgba(79,93,255,.35)}
.comms-item-head{display:flex; justify-content:space-between; gap:10px; align-items:flex-start; margin-bottom:4px}
.comms-item-text{margin:8px 0 0; white-space:pre-wrap}
.tile{
  display:block; padding:18px; border-radius:16px; border:1px solid var(--border);
  background:linear-gradient(160deg,#fff 0%, #edf0ff 100%);
  box-shadow:0 10px 24px rgba(70,85,190,.07);
  color:var(--ink); min-height:130px;
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.tile:hover{transform:translateY(-2px); border-color:rgba(79,93,255,.4); color:var(--ink); box-shadow:0 14px 30px rgba(70,85,190,.14)}
.tile h3{margin:0 0 8px; font-size:18px}
.tile p{margin:0; color:var(--muted); font-size:14px; line-height:1.5}
.tile-static{cursor:default}
.tile-static:hover{transform:none}
.tile-actions{display:flex; flex-wrap:wrap; gap:8px; margin-top:14px}
.tile-actions .btn[aria-disabled="true"]{opacity:.45; pointer-events:none; cursor:not-allowed}
.tile-soon{opacity:.78}
.user-hello{margin:0 0 18px; color:var(--muted)}

.table{width:100%; border-collapse:collapse}
.table th,.table td{padding:12px 10px; border-bottom:1px solid rgba(89,103,255,.14); text-align:left; vertical-align:middle}
.table th{color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.05em}
.actions{display:flex; gap:8px; flex-wrap:wrap}
.badge{display:inline-block; padding:3px 8px; border-radius:999px; background:rgba(79,93,255,.1); color:var(--accent-strong); font-size:12px; font-weight:700}
.card-title{margin:0 0 14px; font-size:20px; color:var(--ink)}
.subheading{margin:0 0 10px; font-size:15px; color:var(--ink)}
.tiny{font-size:12px}
.access-box{margin:0; padding:12px 14px; border:1px solid var(--border); border-radius:12px; background:#fff; display:grid; gap:4px}
.access-box legend{padding:0 6px; font-weight:700; color:var(--ink)}
.access-box > .muted{margin:2px 0 8px}
.check-line,.form label.check-line{
  display:flex !important;
  flex-direction:row;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font-weight:600;
  color:var(--text);
  margin:0;
  padding:8px 0;
  border-bottom:1px solid rgba(89,103,255,.08);
}
.access-box .check-line:last-child{border-bottom:0; padding-bottom:0}
.form label.check-line input[type="checkbox"],
.check-line input[type="checkbox"]{
  order:2;
  width:18px;
  height:18px;
  margin:0;
  padding:0;
  flex:0 0 auto;
  accent-color:var(--accent);
  box-shadow:none;
  border-radius:4px;
  cursor:pointer;
}
.form label.check-line .check-label,
.check-line .check-label{
  order:1;
  flex:1;
  min-width:0;
  line-height:1.35;
}
.inline-form{margin:0}
.doc-list{display:flex; flex-direction:column; gap:12px}
.doc-item{
  display:flex; justify-content:space-between; gap:14px; align-items:flex-start;
  padding:12px; border:1px solid var(--border); border-radius:12px; background:#fff;
}
.doc-item p{margin:6px 0; color:var(--text); white-space:pre-wrap}
.rate-row{display:grid; grid-template-columns:1.4fr .6fr .8fr; gap:8px; margin-bottom:8px}
@media (max-width:700px){.rate-row{grid-template-columns:1fr}}
/* Library / publishing admin */
.lib-admin-head{display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:space-between; margin-bottom:14px}
.table-scroll{overflow:auto}
.lib-table img.lib-cover-thumb{width:48px; height:auto; border-radius:6px; display:block; background:#eef}
.logo-row{display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin:6px 0}
.company-logo,.authors-brand-logo{max-width:180px; height:auto; border-radius:8px}
.toc-editor{padding:10px; border:1px solid var(--border); border-radius:12px; background:#fff}
.toc-rows{display:grid; gap:8px}
.toc-row{
  display:grid; grid-template-columns:36px 1fr 90px 36px; gap:8px; align-items:center;
  padding:4px 0; border-radius:8px; transition:background .12s, box-shadow .12s, opacity .12s;
}
.toc-row.is-dragging{opacity:.45; background:rgba(79,93,255,.06)}
.toc-row.is-drop-before{box-shadow:inset 0 2px 0 0 var(--accent)}
.toc-row.is-drop-after{box-shadow:inset 0 -2px 0 0 var(--accent)}
.toc-row-num,.toc-row-handle{
  text-align:center; font-size:13px; font-weight:800; color:var(--muted);
  cursor:grab; user-select:none; touch-action:none;
  padding:8px 4px; border-radius:8px; line-height:1;
}
.toc-row-handle:hover{background:rgba(79,93,255,.1); color:var(--accent-strong)}
.toc-row-handle:active,.toc-dragging .toc-row-handle{cursor:grabbing}
body.toc-dragging{cursor:grabbing; user-select:none}
.toc-row input{width:100%}
.bib-row{grid-template-columns:36px 1fr 36px !important}
.bib-text-input{
  width:100%; min-height:56px; resize:vertical; font:inherit;
  border:1px solid var(--border); border-radius:10px; padding:8px 10px; color:var(--ink); background:#fff
}
.bib-text-input:focus{outline:none; border-color:var(--cyan); box-shadow:0 0 0 3px rgba(42,212,208,.2)}
@media (max-width:700px){.toc-row{grid-template-columns:36px 1fr 72px 32px}.bib-row{grid-template-columns:36px 1fr 32px !important}}
.cover-frame{border:1px solid var(--border); border-radius:12px; padding:10px; background:#fff; text-align:center}

.calc-cards .calc-name-card{
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  min-height:120px;
  padding:24px 18px;
}
.calc-cards .calc-name-card h3{
  margin:0;
  font-size:18px;
  line-height:1.35;
}
.tile-create-calc{
  border-style:dashed;
  background:linear-gradient(160deg, rgba(79,93,255,.08), rgba(42,212,208,.08));
}
.tile-create-calc:hover{border-color:rgba(79,93,255,.55)}
.ucalc-studio{padding:0; overflow:hidden}
.ucalc-studio-head{padding:18px 18px 0}
.ucalc-studio-grid{display:grid; grid-template-columns:minmax(280px,360px) minmax(0,1fr); gap:0; min-height:520px}
.ucalc-studio-side{padding:16px 18px 20px; border-right:1px solid var(--border); background:linear-gradient(180deg,#fbfbff,#f5f6ff)}
.ucalc-studio-preview{display:flex; flex-direction:column; min-width:0; background:#fff}
.ucalc-preview-bar{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; border-bottom:1px solid var(--border)}
.ucalc-preview-frame{flex:1; overflow:auto; padding:16px; min-height:420px}
.ucalc-preview-empty{display:grid; place-items:center; min-height:360px; border:1px dashed var(--border); border-radius:12px; background:#fafbff}
.ucalc-advanced{margin:8px 0; border:1px solid var(--border); border-radius:10px; padding:8px 10px; background:#fff}
.ucalc-advanced summary{cursor:pointer; font-weight:700; font-size:13px; color:var(--accent-strong)}
.ucalc-advanced[open] summary{margin-bottom:8px}
@media (max-width:900px){
  .ucalc-studio-grid{grid-template-columns:1fr}
  .ucalc-studio-side{border-right:0; border-bottom:1px solid var(--border)}
}
.calc-workspace{display:grid; grid-template-columns:minmax(0,1fr) minmax(220px,280px); gap:16px; align-items:start; min-height:280px}
.calc-workspace--single{grid-template-columns:1fr; min-height:0}
.calc-main{min-width:0; padding:14px; border:1px solid var(--border); border-radius:14px; background:#fff; min-height:260px}
.calc-workspace--single .calc-main{border:0; padding:0; min-height:0; background:transparent}
.calc-placeholder{padding:28px 12px; text-align:center}
.calc-panel[hidden]{display:none !important}
.calc-list{display:flex; flex-direction:column; gap:8px; position:sticky; top:12px}
.calc-list-item{
  display:flex; flex-direction:column; gap:4px; align-items:flex-start; text-align:left;
  width:100%; padding:12px 14px; border:1px solid var(--border); border-radius:12px;
  background:#fff; color:var(--ink); cursor:pointer; transition:border-color .15s, background .15s, box-shadow .15s;
}
.calc-list-item:hover{border-color:rgba(79,93,255,.35); background:rgba(79,93,255,.04)}
.calc-list-item.is-active{border-color:rgba(79,93,255,.55); background:rgba(79,93,255,.08); box-shadow:0 0 0 1px rgba(79,93,255,.18)}
.calc-list-title{font-weight:700; font-size:14px; line-height:1.35}
.calc-list-meta{font-weight:600}
.calc-widget-mount{min-height:120px}
@media (max-width:900px){
  .calc-workspace{grid-template-columns:1fr}
  .calc-list{position:static; order:-1; flex-direction:row; flex-wrap:wrap}
  .calc-list-item{flex:1 1 180px}
}
.calc-block{margin-bottom:0; padding-bottom:0; border-bottom:0}
.calc-block:last-child{margin-bottom:0; padding-bottom:0; border-bottom:0}
.calc-result{margin-top:8px; padding:10px 12px; border-radius:10px; background:rgba(79,93,255,.08); color:var(--ink); font-weight:600; display:grid; gap:6px}
.calc-breakdown{display:flex; flex-wrap:wrap; gap:8px 14px; font-size:13px; font-weight:600; color:var(--muted)}
.calc-breakdown strong{color:var(--ink)}
.calc-min{display:inline; margin-left:4px; font-weight:600}
.calc-min-warn{color:#a32d27}
.calc-materials{margin-top:6px; padding:10px; border:1px solid var(--border); border-radius:12px; background:#fff; display:grid; gap:8px}
.calc-mat-title{margin:0; font-size:13px; font-weight:800; color:var(--accent-strong); text-transform:uppercase; letter-spacing:.04em}
.calc-mat-row{display:grid; grid-template-columns:1.4fr .7fr .7fr .6fr; gap:8px; align-items:end}
.calc-mat-name{display:flex; flex-direction:column; gap:2px; font-size:13px}
.calc-mat-auto{padding-bottom:8px}
.calc-mat-sum{padding-bottom:8px}
.calc-materials-editor{margin:8px 0 4px; padding:12px; border:1px solid var(--border); border-radius:12px; background:#fff}
.mat-edit-row{display:grid; grid-template-columns:1.4fr .5fr .6fr 1.1fr .6fr .6fr; gap:6px; margin-bottom:8px}
@media (max-width:900px){
  .calc-mat-row,.mat-edit-row{grid-template-columns:1fr 1fr}
}
.authors-info{color:var(--text); line-height:1.7; white-space:pre-wrap}
/* Forum / planner */
.forum-head{display:flex; flex-wrap:wrap; gap:12px; align-items:flex-end; justify-content:space-between; margin-bottom:6px}
.month-nav{display:flex; align-items:center; gap:8px; flex-wrap:wrap}
.calendar-card{margin-top:14px}
.calendar-month-title{margin:0 0 14px; font-size:clamp(28px,4vw,42px); color:var(--ink)}
.calendar-month-title span{color:var(--muted); font-weight:600; font-size:.55em}

/* Left year calendar (same frame as mini-chat) */
.has-year-nav.has-mini-chat .staff-wrap{width:min(980px, calc(92vw - 640px))}
.has-year-nav:not(.has-mini-chat) .staff-wrap{width:min(980px, calc(92vw - 320px))}
.has-year-nav.year-nav-collapsed.has-mini-chat .staff-wrap{width:min(980px, calc(92vw - 372px))}
.has-year-nav.year-nav-collapsed:not(.has-mini-chat) .staff-wrap{width:min(980px, calc(92vw - 72px))}
.has-year-nav.has-mini-chat.mini-chat-collapsed .staff-wrap{width:min(980px, calc(92vw - 372px))}
.has-year-nav.year-nav-collapsed.has-mini-chat.mini-chat-collapsed .staff-wrap{width:min(980px, calc(92vw - 72px))}
.year-nav{
  position:fixed; left:12px; top:84px; bottom:18px; width:300px; z-index:30;
  display:flex; flex-direction:column;
  background:rgba(245,246,255,.97); border:1px solid var(--border); border-radius:16px;
  box-shadow:0 16px 40px rgba(55,70,180,.18); backdrop-filter:blur(10px); overflow:hidden;
}
.year-nav-collapsed .year-nav{width:52px}
.year-nav-collapsed .year-nav-body,
.year-nav-collapsed .year-nav-title{display:none}
.year-nav-head{display:flex; align-items:center; justify-content:space-between; padding:10px 12px; border-bottom:1px solid var(--border); gap:8px}
.year-nav-title{display:flex; align-items:center; gap:6px; font-weight:800; color:var(--ink)}
.year-nav-ybtn{
  width:28px; height:28px; display:inline-flex; align-items:center; justify-content:center;
  border:1px solid var(--border); border-radius:8px; background:#fff; color:var(--ink); font-size:18px; line-height:1;
}
.year-nav-ybtn:hover{background:rgba(79,93,255,.08); color:var(--accent-strong)}
.year-nav-body{flex:1; overflow:auto; padding:10px; display:flex; flex-direction:column; gap:12px}
.ycal-month{background:#fff; border:1px solid var(--border); border-radius:12px; padding:8px}
.ycal-month.current{box-shadow:inset 0 0 0 2px rgba(79,93,255,.35)}
.ycal-month-title{display:block; font-size:13px; font-weight:800; color:var(--ink); margin-bottom:6px}
.ycal-month-title:hover{color:var(--accent-strong)}
.ycal-grid{display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:2px}
.ycal-head{text-align:center; font-size:9px; font-weight:700; color:var(--muted); padding:2px 0}
.ycal-day{
  aspect-ratio:1; display:flex; align-items:center; justify-content:center;
  font-size:10px; font-weight:700; color:var(--ink); border-radius:6px; text-decoration:none;
  line-height:1;
}
.ycal-day.empty{pointer-events:none}
.ycal-day:hover{background:rgba(79,93,255,.12); color:var(--accent-strong)}
.ycal-day.weekend{color:#6a74b8}
.ycal-day.holiday{color:#c83b34; background:rgba(229,83,75,.08)}
.ycal-day.today{box-shadow:inset 0 0 0 1.5px var(--cyan)}
.ycal-day.selected{background:linear-gradient(145deg, rgba(79,93,255,.22), rgba(122,60,255,.16)); color:var(--accent-strong)}
.ycal-day.has-tasks::after{
  content:""; width:3px; height:3px; border-radius:50%; background:var(--accent);
  position:absolute; bottom:2px;
}
.ycal-day.has-tasks{position:relative}
.cal-grid{display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:6px}
.cal-head{text-align:center; font-size:12px; font-weight:700; color:var(--muted); padding:4px}
.cal-cell{position:relative; min-height:72px; border:1px solid var(--border); border-radius:12px; background:#fff; color:var(--ink); padding:8px; display:flex; flex-direction:column; text-decoration:none; overflow:hidden}
.cal-cell.empty{background:transparent; border-color:transparent}
.cal-cell:hover{border-color:rgba(79,93,255,.45); color:var(--ink)}
.cal-cell.weekend{background:#f7f8ff}
.cal-cell.holiday{background:rgba(229,83,75,.08)}
.cal-cell.today{box-shadow:inset 0 0 0 2px var(--cyan)}
.cal-cell.selected{background:linear-gradient(145deg, rgba(79,93,255,.18), rgba(122,60,255,.12)); border-color:rgba(79,93,255,.5)}
.cal-cell.has-bday{min-height:88px}
.cal-num{font-weight:800; font-size:16px}
.cal-bdays{display:flex; flex-direction:column; gap:1px; margin-top:4px; min-width:0; pointer-events:auto}
.cal-bday-item{
  display:block; max-width:100%; font-size:10px; font-weight:700; line-height:1.2;
  color:#a32d70; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.cal-dot{width:8px; height:8px; border-radius:50%; background:var(--accent); margin-top:auto; flex-shrink:0}
.calendar-card{position:relative}
.cal-bday-popup{
  position:fixed; z-index:50; width:min(280px, calc(100vw - 24px));
  padding:12px 14px; border-radius:12px; border:1px solid var(--border);
  background:#fff; color:var(--ink);
  box-shadow:0 16px 40px rgba(55,70,180,.22);
  font-size:13px; line-height:1.45; pointer-events:none;
}
.cal-bday-popup[hidden]{display:none !important}
.cal-bday-popup strong{display:block; margin-bottom:8px; font-size:13px}
.cal-bday-popup ul{margin:0; padding-left:18px}
.cal-bday-popup li{margin:3px 0}
.cal-bday-popup .tiny{color:var(--muted)}
.kanban-head{display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:space-between; margin-bottom:14px}
.task-add-form{display:flex; gap:8px; flex-wrap:wrap}
.task-add-form input{min-width:220px; border:1px solid var(--border); border-radius:10px; padding:8px 10px; font:inherit}
.kanban{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px}
.kanban-col{background:#fff; border:1px solid var(--border); border-radius:14px; padding:10px; min-height:220px}
.kanban-col h3{margin:0 0 10px; font-size:13px; text-transform:uppercase; letter-spacing:.04em; color:var(--accent-strong)}
.kanban-list{display:flex; flex-direction:column; gap:8px; min-height:140px; transition:background .15s ease, box-shadow .15s ease}
.kanban-list.drag-over{background:rgba(79,93,255,.08); box-shadow:inset 0 0 0 2px rgba(79,93,255,.25)}
.kanban-card{border:1px solid var(--border); border-radius:10px; padding:8px; background:linear-gradient(160deg,#fff,#f5f6ff); cursor:grab; user-select:none; touch-action:none}
.kanban-card:active{cursor:grabbing}
.kanban-card.dragging{opacity:.55; transform:scale(.98)}
.kanban-title{font-weight:700; margin-bottom:4px}
.kanban-moves{display:flex; flex-wrap:wrap; gap:4px; margin-top:6px}
.linkish{border:0; background:none; color:var(--accent-strong); cursor:pointer; font:inherit; font-size:12px; font-weight:700; padding:0}
.linkish.danger{color:var(--danger)}
.forum-feed{display:flex; flex-direction:column; gap:10px; max-height:420px; overflow:auto}
.forum-msg{border:1px solid var(--border); border-radius:12px; padding:10px 12px; background:#fff}
.forum-meta{display:flex; justify-content:space-between; gap:10px; margin-bottom:4px}
.forum-text{white-space:pre-wrap}

/* Left widgets + mini chat */
.has-widgets .staff-wrap{width:min(980px, calc(92vw - 300px))}
.has-widgets.widgets-collapsed .staff-wrap{width:min(980px, calc(92vw - 72px))}
.has-widgets.has-mini-chat .staff-wrap{width:min(980px, calc(92vw - 620px))}
.has-widgets.has-mini-chat.mini-chat-collapsed .staff-wrap{width:min(980px, calc(92vw - 372px))}
.has-widgets.widgets-collapsed.has-mini-chat .staff-wrap{width:min(980px, calc(92vw - 372px))}
.has-widgets.widgets-collapsed.has-mini-chat.mini-chat-collapsed .staff-wrap{width:min(980px, calc(92vw - 144px))}
.has-year-nav .staff-widgets{display:none}
.has-year-nav.has-widgets .staff-wrap{width:min(980px, calc(92vw - 320px))}
.has-year-nav.has-widgets.has-mini-chat .staff-wrap{width:min(980px, calc(92vw - 640px))}
.has-year-nav.has-widgets.has-mini-chat.mini-chat-collapsed .staff-wrap{width:min(980px, calc(92vw - 372px))}

.has-mini-chat:not(.has-widgets) .staff-wrap{width:min(980px, calc(92vw - 320px))}
.has-mini-chat.mini-chat-collapsed:not(.has-widgets) .staff-wrap{width:min(980px, calc(92vw - 72px))}
body.has-mini-chat{padding-right:0}
body.has-mini-chat.mini-chat-collapsed{/* место под узкую полоску чата */}

/* Staff widgets (left) */
.staff-widgets{
  position:fixed; left:12px; top:84px; bottom:18px; width:280px; z-index:28;
  display:flex; flex-direction:column;
  background:rgba(245,246,255,.97); border:1px solid var(--border); border-radius:16px;
  box-shadow:0 16px 40px rgba(55,70,180,.14); backdrop-filter:blur(10px); overflow:hidden;
}
.widgets-collapsed .staff-widgets{width:56px}
.widgets-collapsed .staff-widgets-list,
.widgets-collapsed .staff-widgets-dock,
.widgets-collapsed .staff-widgets-add{display:none}
.widgets-collapsed .staff-widgets-head{
  flex-direction:column; align-items:center; justify-content:flex-start;
  gap:10px; height:100%; border-bottom:0; padding:14px 6px;
}
.widgets-collapsed .staff-widgets-head strong{
  writing-mode:vertical-rl; transform:rotate(180deg); font-size:13px; letter-spacing:.04em;
}
.staff-widgets-head{
  display:flex; align-items:center; justify-content:space-between;
  gap:8px; padding:10px 12px; border-bottom:1px solid var(--border); flex:0 0 auto;
}
.staff-widgets-head strong{font-size:14px}
.staff-widgets-head-actions{display:flex; gap:6px}
.staff-widgets-add,
.staff-widgets-toggle{
  width:32px; height:32px; border-radius:8px; border:1px solid var(--border);
  background:#fff; cursor:pointer; font:inherit; font-weight:800;
  display:inline-flex; align-items:center; justify-content:center; padding:0;
}
.staff-widgets-add{font-size:20px; color:var(--accent-strong)}
.staff-widgets-list{
  flex:1 1 auto; min-height:0; overflow-x:hidden; overflow-y:auto;
  padding:10px; display:flex; flex-direction:column; gap:10px;
}
.staff-widgets-dock{
  flex:0 0 auto; padding:0 10px 10px;
  display:flex; flex-direction:column; gap:10px;
  border-top:1px dashed rgba(89,103,255,.2);
  min-height:0;
}
.staff-widgets-dock:empty{display:none; border:0; padding:0}
.sw-empty{margin:8px 4px; color:var(--muted); font-size:13px}
.sw-card{
  border:1px solid var(--border); border-radius:14px; background:linear-gradient(160deg,#fff,#edf0ff);
  box-shadow:0 8px 18px rgba(70,85,190,.06);
  height:148px; min-height:148px; max-height:148px; flex:0 0 148px;
  display:flex; flex-direction:column; overflow:hidden;
}
.sw-card--dock{
  height:auto; min-height:130px; max-height:none; flex:0 0 auto;
}
.sw-card.is-dragging{opacity:.55}
.sw-card.drag-over{box-shadow:inset 0 0 0 2px rgba(79,93,255,.35)}
.sw-card-head{
  display:flex; align-items:center; justify-content:space-between; gap:6px;
  padding:8px 10px; border-bottom:1px solid rgba(89,103,255,.12); flex:0 0 auto;
}
.sw-card-title{font-size:13px; font-weight:800; display:inline-flex; align-items:center; gap:6px}
.sw-card-title i{color:var(--accent-strong)}
.sw-card-actions{display:inline-flex; gap:4px}
.sw-icon-btn{
  border:0; background:transparent; cursor:pointer; width:22px; height:22px;
  border-radius:6px; color:var(--muted); font-size:14px; line-height:1;
}
.sw-icon-btn:hover{background:rgba(79,93,255,.1); color:var(--accent-strong)}
.sw-drag{cursor:grab}
.sw-card-body{
  padding:10px; flex:1 1 auto; min-height:0; font-size:13px;
  overflow-x:hidden; overflow-y:auto;
  scrollbar-width:thin;
  scrollbar-color:rgba(79,93,255,.45) transparent;
}
.sw-card-body::-webkit-scrollbar{width:8px}
.sw-card-body::-webkit-scrollbar-track{background:transparent}
.sw-card-body::-webkit-scrollbar-thumb{
  background:rgba(79,93,255,.4); border-radius:999px; border:2px solid transparent; background-clip:padding-box;
}
.sw-card-body::-webkit-scrollbar-thumb:hover{background:rgba(79,93,255,.65); background-clip:padding-box}
.sw-muted{color:var(--muted); font-size:12px; margin:0}
.sw-strong{font-weight:800; margin-bottom:4px}
.sw-text{margin:0 0 6px; line-height:1.45}
.sw-list{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:4px}
.sw-list li{display:flex; justify-content:space-between; gap:8px}
.sw-news{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px}
.sw-news a{display:block; font-size:12px; line-height:1.35; color:var(--ink)}
.sw-news a:hover{color:var(--accent-strong)}
.sw-up{color:#0e7a4e}
.sw-down{color:#a32d27}
.sw-weather{display:flex; gap:10px; align-items:center}
.sw-weather-temp{font-size:34px; font-weight:800; line-height:1; color:var(--accent-strong)}
.sw-horoscope-clamp{position:relative}
.sw-horoscope-clamp .sw-text{
  margin:0; line-height:1.4;
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3;
  overflow:hidden;
}
.sw-horoscope-pop{
  display:none; position:absolute; left:0; right:0; top:100%; z-index:5;
  margin-top:6px; padding:10px; border-radius:10px; border:1px solid var(--border);
  background:#fff; box-shadow:0 12px 28px rgba(40,50,120,.18);
  font-size:12px; line-height:1.45; white-space:pre-wrap; max-height:220px; overflow:auto;
}
.sw-horoscope-clamp:hover .sw-horoscope-pop,
.sw-horoscope-clamp:focus-within .sw-horoscope-pop{display:block}
.sw-audio-host{margin-top:4px}
.sw-clock{font-size:28px; font-weight:800; letter-spacing:.02em; line-height:1.1}
.sw-inline{display:flex; flex-direction:column; gap:4px; margin-bottom:8px; font-size:12px; color:var(--muted)}
.sw-select,.sw-input,.sw-note{
  width:100%; border:1px solid var(--border); border-radius:8px; padding:6px 8px; font:inherit; background:#fff;
}
.sw-note{resize:vertical; min-height:72px}
.sw-audio{width:100%; height:32px; margin-top:4px}
.sw-cal-title{font-weight:800; margin-bottom:6px; text-transform:capitalize}
.sw-cal-grid{display:grid; grid-template-columns:repeat(7,1fr); gap:2px; font-size:11px; text-align:center}
.sw-cal-grid span{padding:3px 0; border-radius:4px}
.sw-cal-grid .is-today{background:var(--accent); color:#fff; font-weight:800}
.sw-calc-keys{display:grid; grid-template-columns:repeat(4,1fr); gap:4px; margin-top:6px}
.sw-calc-keys button{
  border:1px solid var(--border); border-radius:6px; background:#fff; padding:6px 0; cursor:pointer; font:inherit; font-weight:700;
}
.sw-timer-actions{display:flex; gap:6px; margin-top:8px}
.sw-week{display:flex; gap:3px; margin-bottom:6px}
.sw-week span{
  flex:1; text-align:center; font-size:11px; padding:4px 0; border-radius:6px;
  background:rgba(79,93,255,.08); color:var(--muted);
}
.sw-week span.is-on{background:rgba(79,93,255,.25); color:var(--accent-strong); font-weight:800}

.widgets-modal[hidden]{display:none !important}
.widgets-modal{
  position:fixed; inset:0; z-index:86;
  display:flex; align-items:center; justify-content:center; padding:16px;
}
.widgets-modal-backdrop{position:absolute; inset:0; background:rgba(20,28,60,.45); backdrop-filter:blur(2px)}
.widgets-modal-panel{
  position:relative; z-index:1; width:min(560px,100%); max-height:min(82vh,760px);
  display:flex; flex-direction:column; background:#fff; border:1px solid var(--border);
  border-radius:16px; box-shadow:0 20px 48px rgba(40,50,120,.22); overflow:hidden;
}
.widgets-modal-head{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:14px 16px; border-bottom:1px solid var(--border);
}
.widgets-modal-head h2{margin:0; font-size:18px}
.widgets-modal-close{border:0; background:transparent; font-size:22px; cursor:pointer; color:var(--muted); width:32px; height:32px}
.widgets-modal-body{padding:14px 16px; overflow:auto; flex:1 1 auto}
.widgets-modal-foot{display:flex; justify-content:flex-end; gap:8px; padding:12px 16px; border-top:1px solid var(--border)}
.widgets-catalog{display:flex; flex-direction:column; gap:8px}
.sw-pick{
  display:flex; align-items:center; gap:10px; width:100%; text-align:left;
  border:1px solid var(--border); border-radius:12px; background:#f8f9ff; padding:10px 12px;
  cursor:pointer; font:inherit;
}
.sw-pick i{width:20px; text-align:center; color:var(--accent-strong)}
.sw-pick-text{flex:1; display:flex; flex-direction:column; gap:2px}
.sw-pick-text strong{font-size:14px}
.sw-pick-text small{color:var(--muted); font-size:12px}
.sw-pick-state{font-weight:800; color:var(--muted)}
.sw-pick.is-on{border-color:rgba(79,93,255,.5); background:rgba(79,93,255,.1)}
.sw-pick.is-on .sw-pick-state{color:var(--accent-strong)}
.mini-chat{
  position:fixed; right:12px; top:84px; bottom:18px; width:300px; z-index:30;
  display:flex; flex-direction:column;
  background:rgba(245,246,255,.97); border:1px solid var(--border); border-radius:16px;
  box-shadow:0 16px 40px rgba(55,70,180,.18); backdrop-filter:blur(10px); overflow:hidden;
}
.mini-chat-collapsed .mini-chat{width:56px; cursor:pointer}
.mini-chat-collapsed .mini-chat-list,
.mini-chat-collapsed .mini-chat-form,
.mini-chat-collapsed .mini-chat-emojis,
.mini-chat-collapsed .mini-chat-notify{display:none}
.mini-chat-collapsed .mini-chat-head{
  flex-direction:column;
  justify-content:flex-start;
  align-items:center;
  gap:10px;
  flex:0 0 auto;
  border-bottom:0;
  padding:14px 6px 8px;
}
.mini-chat-collapsed .mini-chat-head strong{
  writing-mode:vertical-rl;
  transform:rotate(180deg);
  font-size:13px;
  letter-spacing:.04em;
}
.mini-chat-collapsed .mini-chat-head-actions{flex-direction:column}
.mini-chat-badge{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:22px; height:22px; padding:0 6px; border-radius:999px;
  background:linear-gradient(135deg,var(--accent),var(--accent-strong));
  color:#fff; font-size:11px; font-weight:800; line-height:1;
}
.mini-chat-badge[hidden]{display:none !important}
.mini-chat-collapsed .mini-chat-badge{display:none !important}
.mini-chat.has-unread{
  animation:miniChatUnreadBlink 1.05s ease-in-out infinite;
  border-color:rgba(79,93,255,.65);
}
@keyframes miniChatUnreadBlink{
  0%,100%{
    box-shadow:0 16px 40px rgba(55,70,180,.18), 0 0 0 0 rgba(79,93,255,0);
    background:rgba(245,246,255,.97);
  }
  50%{
    box-shadow:0 16px 40px rgba(55,70,180,.22), 0 0 0 7px rgba(79,93,255,.28);
    background:rgba(79,93,255,.18);
  }
}
.mini-chat-head{display:flex; align-items:center; justify-content:space-between; padding:10px 12px; border-bottom:1px solid var(--border); gap:8px}
.mini-chat-head-actions{display:flex; gap:6px; align-items:center}
.mini-chat-toggle,
.mini-chat-notify,
.mini-chat-comms{
  border:0; background:#fff; border:1px solid var(--border); border-radius:8px; cursor:pointer;
  width:32px; height:32px; font:inherit; font-size:12px; font-weight:800; line-height:1;
  display:inline-flex; align-items:center; justify-content:center; padding:0;
}
.mini-chat-notify.is-on{background:rgba(79,93,255,.12); border-color:rgba(79,93,255,.45)}
.mini-chat-notify.is-off{opacity:.55}
.mini-chat-comms--new{
  color:#fff;
  background:#e53935;
  border-color:#c62828;
}
.mini-chat-comms--all{
  color:#fff;
  background:#2e7d32;
  border-color:#1b5e20;
}
.mini-chat-comms:not(.has-count){
  opacity:.55;
}
.mini-chat-comms--new.has-count{
  box-shadow:0 0 0 2px rgba(229,57,53,.25);
}
.mini-chat-collapsed .mini-chat-toggle{order:0}
.mini-chat-collapsed .mini-chat-comms--new{order:1}
.mini-chat-collapsed .mini-chat-comms--all{order:2}
.mini-chat-collapsed .mini-chat-notify{order:3}

/* Быстрый доступ в свёрнутом чате */
.mini-chat-rail{
  display:none;
  flex-direction:column;
  align-items:center;
  gap:6px;
  flex:1 1 auto;
  min-height:0;
  padding:4px 6px 10px;
  overflow:hidden;
}
.mini-chat-collapsed .mini-chat-rail{display:flex}
.mini-chat-unread-rail{
  flex:0 0 auto;
  min-width:28px; height:28px; padding:0 6px;
  border:0; border-radius:999px; cursor:default;
  background:linear-gradient(135deg,var(--accent),var(--accent-strong));
  color:#fff; font-size:11px; font-weight:800; line-height:1;
  display:inline-flex; align-items:center; justify-content:center;
}
.mini-chat-unread-rail[hidden]{display:none !important}
.mini-chat-quick-links{
  display:flex; flex-direction:column; align-items:center; gap:6px;
  flex:1 1 auto; min-height:0; overflow:hidden; width:100%;
}
.mini-chat-quick-link,
.mini-chat-quick-add,
.mini-chat-quick-edit{
  position:relative;
  width:32px; height:32px; flex:0 0 32px;
  display:inline-flex; align-items:center; justify-content:center;
  border:1px solid var(--border); border-radius:8px;
  background:#fff; color:var(--accent-strong);
  text-decoration:none; cursor:pointer;
  font-size:14px; line-height:1;
}
.mini-chat-quick-link:hover,
.mini-chat-quick-add:hover,
.mini-chat-quick-edit:hover{
  border-color:rgba(79,93,255,.45);
  background:rgba(79,93,255,.08);
}
.mini-chat-quick-add{
  font-size:20px; font-weight:700; color:var(--accent-strong);
  margin-top:auto;
}
.mini-chat-quick-add.is-disabled,
.mini-chat-quick-add:disabled{
  opacity:.4; cursor:not-allowed;
}
.mini-chat-quick-edit.is-active{
  background:rgba(79,93,255,.16);
  border-color:rgba(79,93,255,.5);
}
.mini-chat-quick-remove{
  position:absolute; top:-6px; right:-6px;
  width:16px; height:16px; border:0; border-radius:999px;
  background:#e53935; color:#fff; font-size:11px; font-weight:800;
  line-height:1; cursor:pointer; padding:0;
  display:inline-flex; align-items:center; justify-content:center;
}
.mini-chat-quick-link.is-editing{cursor:default}

.quick-access-modal[hidden]{display:none !important}
.quick-access-modal{
  position:fixed; inset:0; z-index:85;
  display:flex; align-items:center; justify-content:center;
  padding:16px;
}
.quick-access-modal-backdrop{
  position:absolute; inset:0;
  background:rgba(20,28,60,.45);
  backdrop-filter:blur(2px);
}
.quick-access-modal-panel{
  position:relative; z-index:1;
  width:min(520px, 100%);
  max-height:min(82vh, 760px);
  display:flex; flex-direction:column;
  background:#fff; border:1px solid var(--border); border-radius:16px;
  box-shadow:0 20px 48px rgba(40,50,120,.22);
  overflow:hidden;
}
.quick-access-modal-head{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:14px 16px; border-bottom:1px solid var(--border);
}
.quick-access-modal-head h2{margin:0; font-size:18px}
.quick-access-modal-close{
  border:0; background:transparent; font-size:22px; line-height:1;
  cursor:pointer; color:var(--muted); width:32px; height:32px;
}
.quick-access-modal-body{
  padding:14px 16px; overflow:auto; flex:1 1 auto;
}
.quick-access-hint{margin:0 0 12px; font-size:13px}
.quick-access-group{margin-bottom:12px}
.quick-access-group-title{
  font-size:11px; font-weight:800; letter-spacing:.04em;
  text-transform:uppercase; color:var(--muted); margin-bottom:6px;
}
.quick-access-section{
  display:flex; align-items:center; gap:10px; width:100%;
  border:1px solid var(--border); border-radius:10px;
  background:#f8f9ff; padding:8px 10px; margin-bottom:6px;
  cursor:pointer; font:inherit; text-align:left;
}
.quick-access-section i{width:18px; text-align:center; color:var(--accent-strong)}
.quick-access-section.is-selected{
  border-color:rgba(79,93,255,.55);
  background:rgba(79,93,255,.12);
  box-shadow:inset 0 0 0 1px rgba(79,93,255,.2);
}
.quick-access-icons-title{
  margin:14px 0 8px; font-size:13px; font-weight:700;
}
.quick-access-icons{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(36px,1fr)); gap:6px;
}
.quick-access-icon{
  width:36px; height:36px; border:1px solid var(--border); border-radius:8px;
  background:#fff; cursor:pointer; color:var(--accent-strong);
  display:inline-flex; align-items:center; justify-content:center;
}
.quick-access-icon.is-selected{
  border-color:rgba(79,93,255,.55);
  background:rgba(79,93,255,.12);
}
.quick-access-modal-foot{
  display:flex; justify-content:flex-end; gap:8px;
  padding:12px 16px; border-top:1px solid var(--border);
}

/* Модалка обращений у суперадмина */
.comms-modal[hidden]{display:none !important}
.comms-modal{
  position:fixed; inset:0; z-index:80;
  display:flex; align-items:center; justify-content:center;
  padding:16px;
}
.comms-modal-backdrop{
  position:absolute; inset:0;
  background:rgba(20,28,60,.45);
  backdrop-filter:blur(2px);
}
.comms-modal-panel{
  position:relative; z-index:1;
  width:min(560px, 100%);
  max-height:min(78vh, 720px);
  display:flex; flex-direction:column;
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:0 24px 60px rgba(20,30,90,.28);
  overflow:hidden;
}
.comms-modal-head{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:14px 16px; border-bottom:1px solid var(--border);
}
.comms-modal-head h2{margin:0; font-size:18px; color:var(--ink)}
.comms-modal-close{
  border:0; background:transparent; font-size:28px; line-height:1;
  cursor:pointer; color:var(--muted); width:36px; height:36px;
}
.comms-modal-body{
  padding:12px 16px; overflow:auto; flex:1;
  display:flex; flex-direction:column; gap:10px;
}
.comms-modal-foot{
  display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap;
  padding:12px 16px; border-top:1px solid var(--border); background:#fafbff;
}
.comms-notify-item{
  border:1px solid var(--border); border-radius:12px; padding:10px 12px;
  background:#fff; display:grid; gap:6px;
}
.comms-notify-item.is-new{
  border-color:rgba(229,57,53,.45);
  background:rgba(229,57,53,.06);
}
.comms-notify-item-head{
  display:flex; align-items:flex-start; justify-content:space-between; gap:8px;
}
.comms-notify-item-head strong{font-size:14px; color:var(--ink)}
.comms-notify-meta{font-size:12px; color:var(--muted)}
.comms-notify-actions{display:flex; gap:6px; flex-wrap:wrap; margin-top:2px}
.mini-chat-list{flex:1; overflow:auto; padding:10px; display:flex; flex-direction:column; gap:8px}
.mini-msg{background:#fff; border:1px solid var(--border); border-radius:12px; padding:8px; position:relative}
.mini-msg.mine{background:rgba(79,93,255,.08)}
.mini-msg.is-private{border-color:rgba(122,60,255,.45); box-shadow:inset 3px 0 0 rgba(122,60,255,.55)}
.mini-msg.is-call{
  background:linear-gradient(135deg, rgba(42,212,208,.16), rgba(79,93,255,.14));
  border-color:rgba(42,212,208,.5);
  animation:miniCallPulse 1.2s ease 2;
}
.mini-call-line{font-weight:800; color:#0f6e6a; font-size:14px}
.mini-dm-badge{
  display:inline-block; margin:0 0 6px; padding:2px 8px; border-radius:999px;
  background:rgba(122,60,255,.12); color:#5b2bb5; font-size:11px; font-weight:700;
}
@keyframes miniCallPulse{
  0%,100%{box-shadow:0 0 0 0 rgba(42,212,208,.0)}
  40%{box-shadow:0 0 0 6px rgba(42,212,208,.28)}
}
.mini-chat.is-ringing{
  animation:miniChatRing .35s ease 4;
}
@keyframes miniChatRing{
  0%,100%{transform:translateX(0)}
  25%{transform:translateX(-3px)}
  75%{transform:translateX(3px)}
}
.mini-call-btn{font-size:16px}
.mini-meta{display:flex; justify-content:space-between; gap:8px; font-size:11px; color:var(--muted); margin-bottom:4px; align-items:center}
.mini-meta-right{display:inline-flex; align-items:center; gap:4px; flex-shrink:0}
.mini-msg-del{
  border:0; background:transparent; color:#a33; cursor:pointer; width:22px; height:22px;
  border-radius:6px; line-height:1; font-size:16px; padding:0; opacity:.55;
}
.mini-msg-del:hover{opacity:1; background:rgba(180,40,40,.1)}
.mini-text{white-space:pre-wrap; font-size:14px}
.mini-file{display:block; margin-top:6px; font-size:13px}
.mini-file img{max-width:100%; border-radius:8px; display:block}
.mini-chat-form{border-top:1px solid var(--border); padding:8px; display:grid; gap:6px}
.mini-to-label{display:grid; gap:4px; font-size:11px; font-weight:700; color:var(--muted)}
.mini-to-label select{
  width:100%; border:1px solid var(--border); border-radius:10px; padding:8px 10px;
  font:inherit; color:var(--ink); background:#fff;
}
.mini-chat-form textarea{width:100%; border:1px solid var(--border); border-radius:10px; padding:8px; font:inherit; resize:none}
.mini-attach{
  display:flex; align-items:center; gap:8px; padding:8px 10px;
  border:1px dashed rgba(89,103,255,.45); border-radius:10px;
  background:rgba(79,93,255,.08); font-size:12px; color:var(--ink);
}
.mini-attach-ico{flex:0 0 auto}
.mini-attach-name{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600}
.mini-attach-clear{
  flex:0 0 auto; border:0; background:rgba(0,0,0,.06); width:24px; height:24px;
  border-radius:8px; cursor:pointer; font-size:16px; line-height:1; color:#a33;
}
.mini-attach-clear:hover{background:rgba(180,40,40,.12)}
.mini-chat-tools{display:flex; gap:6px; align-items:center}
.mini-file-btn{position:relative; overflow:hidden}
.mini-file-btn input{position:absolute; inset:0; opacity:0; cursor:pointer}
.mini-chat-emojis{display:none; flex-wrap:wrap; gap:4px; padding:6px 8px; border-top:1px solid var(--border); background:#fff; max-height:110px; overflow:auto}
.mini-chat-emojis.open{display:flex}
.emoji-item{border:0; background:transparent; cursor:pointer; font-size:18px; padding:2px}

@media (max-width:1400px){
  .has-year-nav.has-mini-chat .staff-wrap{width:min(980px, calc(92vw - 560px))}
  .has-widgets.has-mini-chat .staff-wrap{width:min(980px, calc(92vw - 560px))}
  .year-nav{width:260px}
  .mini-chat{width:260px}
  .staff-widgets{width:260px}
}
@media (max-width:1100px){
  .kanban{grid-template-columns:repeat(2,minmax(0,1fr))}
  .has-year-nav.has-mini-chat .staff-wrap,
  .has-year-nav:not(.has-mini-chat) .staff-wrap{width:min(980px, calc(92vw - 72px))}
  .has-mini-chat:not(.has-widgets) .staff-wrap{width:min(980px, calc(92vw - 280px))}
  .has-mini-chat.mini-chat-collapsed:not(.has-widgets) .staff-wrap{width:min(980px, calc(92vw - 72px))}
  .has-widgets .staff-wrap{width:min(980px, calc(92vw - 72px))}
  .staff-widgets{
    position:fixed; left:8px; right:auto; top:auto; bottom:8px; width:48px; height:48px;
  }
  .staff-widgets-list, .staff-widgets-dock, .staff-widgets-head strong{display:none}
  body:not(.widgets-collapsed) .staff-widgets{
    left:8px; right:auto; top:72px; bottom:8px; width:min(300px, calc(100vw - 24px)); height:auto; z-index:39;
  }
  body:not(.widgets-collapsed) .staff-widgets-list{display:flex}
  body:not(.widgets-collapsed) .staff-widgets-dock{display:flex}
  body:not(.widgets-collapsed) .staff-widgets-head strong{display:block}
  body:not(.widgets-collapsed) .staff-widgets-add{display:inline-flex}
  .year-nav{
    position:fixed; left:8px; right:auto; top:auto; bottom:8px; width:48px; height:48px;
  }
  .year-nav-body, .year-nav-title{display:none}
  body:not(.year-nav-collapsed) .year-nav{
    left:8px; right:8px; top:72px; bottom:auto; width:auto; height:min(70vh, 560px); z-index:40;
  }
  body:not(.year-nav-collapsed) .year-nav-body,
  body:not(.year-nav-collapsed) .year-nav-title{display:flex}
  body:not(.year-nav-collapsed) .year-nav-body{flex-direction:column}
}
@media (max-width:900px){
  .has-mini-chat .staff-wrap,
  .has-mini-chat.mini-chat-collapsed .staff-wrap,
  .has-widgets .staff-wrap{width:min(980px, 92vw)}
  .mini-chat{position:fixed; right:8px; left:8px; top:auto; bottom:8px; width:auto; height:42vh; max-height:360px; z-index:40}
  .mini-chat-collapsed .mini-chat{
    height:auto; max-height:min(70vh, 560px); width:56px;
    left:auto; right:8px; top:auto; bottom:8px;
  }
  .year-nav{bottom:64px}
  .staff-widgets{bottom:64px}
}
@media (max-width:760px){
  .staff-header-inner{flex-wrap:wrap; padding:12px 0}
  .staff-nav{width:100%}
  .doc-item{flex-direction:column}
  .kanban{grid-template-columns:1fr}
  .cal-cell{min-height:48px; padding:6px}
}

/* HR library + personnel */
.hr-doc-list{display:grid; gap:12px}
.hr-doc-item{
  display:grid; gap:10px; padding:14px; border:1px solid var(--border); border-radius:14px;
  background:rgba(255,255,255,.72);
}
.hr-doc-item h3{margin:0 0 6px; font-size:16px; color:var(--ink)}
.hr-doc-item p{margin:6px 0 0; color:var(--muted); font-size:14px}
.hr-pill{
  display:inline-block; margin-top:4px; padding:3px 8px; border-radius:999px;
  background:rgba(79,93,255,.12); color:var(--accent-strong); font-size:11px; font-weight:700;
}
.hr-person-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  margin-top:8px;
  align-items:stretch;
}
@media (max-width:960px){.hr-person-grid{grid-template-columns:1fr 1fr}}
@media (max-width:640px){.hr-person-grid{grid-template-columns:1fr}}
.hr-person-card{
  display:flex;
  flex-direction:column;
  min-height:100%;
  height:100%;
  margin:0;
}
.hr-person-card + .hr-person-card{margin-top:0}
.hr-person-card h3{margin:0 0 4px; font-size:18px; color:var(--ink); min-height:1.3em}
.hr-person-card > .muted.tiny{min-height:1.2em}
.hr-person-card.is-active{border-color:rgba(79,93,255,.55); box-shadow:0 14px 30px rgba(70,85,190,.16)}
.hr-person-meta{
  margin:12px 0 0;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px 12px;
  flex:1;
}
.hr-person-meta > div{display:grid; gap:2px; min-width:0}
.hr-person-meta dt{font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted)}
.hr-person-meta dd{
  margin:0; font-size:14px; color:var(--ink); font-weight:600;
  min-height:1.35em; overflow-wrap:anywhere;
}
.hr-person-meta dd.hr-person-email{
  overflow:hidden;
  overflow-wrap:normal;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.hr-person-meta dd.hr-person-email a{
  color:var(--accent-strong);
  text-decoration:none;
  font-weight:600;
  display:inline;
}
.hr-person-meta dd.hr-person-email a:hover{
  text-decoration:underline;
}
.hr-person-card .tile-actions{margin-top:auto; padding-top:14px}

/* ========================================
   PWA Banner - Приглашение установить приложение
   ======================================== */
.pwa-banner{
  background:linear-gradient(135deg, rgba(79,93,255,.08), rgba(122,60,255,.06));
  border:2px solid rgba(79,93,255,.28);
  border-radius:16px;
  padding:20px;
  margin:0 0 24px;
  display:flex;
  align-items:center;
  gap:16px;
  flex-wrap:wrap;
}
.pwa-banner-content{
  display:flex;
  align-items:center;
  gap:16px;
  flex:1 1 auto;
  min-width:280px;
}
.pwa-banner-icon{
  font-size:36px;
  line-height:1;
}
.pwa-banner-text h3{
  margin:0 0 4px;
  font-size:18px;
  font-weight:700;
  color:var(--ink);
}
.pwa-banner-desc{
  margin:0;
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
}
.pwa-install-btn{
  flex:0 0 auto;
  padding:10px 18px;
}
@media (max-width:680px){
  .pwa-banner{
    flex-direction:column;
    align-items:stretch;
    text-align:center;
  }
  .pwa-banner-content{
    flex-direction:column;
    align-items:center;
    text-align:center;
  }
  .pwa-install-btn{
    width:100%;
  }
}
