@font-face { font-family: Onest; src: url(fonts/onest-cyrillic.woff2) format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Onest; src: url(fonts/onest-latin.woff2) format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }

:root {
  --ink: #0B1530; --fill: #0B1530; --fill-2: #27304D; --fill-text: #fff; --hint: #AEB6CA;
  --mut: #5C6478; --line: #DFE2E8; --bg: #F1F2F5; --card: #fff;
  --acc: #1D4ED8; --acc-ink: #1D4ED8; --soft: #E9EEFB; --soft-line: #BFD0F7; --warn: #F0A020; --ok: #22A06B; --dash: #B6BCCB;
  --off: #D5D9E2; --danger: #A3261B; --tile-edge: transparent; --lift: rgba(11, 21, 48, .22); --scrim: rgba(11, 21, 48, .42);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ink: #EEF1F8; --fill: #161D35; --fill-2: #28314F; --fill-text: #EEF1F8; --hint: #8E97AE;
  --mut: #98A1B6; --line: #232B43; --bg: #070B18; --card: #10162A;
  --acc: #2F5FE8; --acc-ink: #8FB0FF; --soft: #18244A; --soft-line: #2E4382; --off: #2F3853; --danger: #FF8A80;
  --dash: #3D4763; --tile-edge: rgba(255, 255, 255, .09); --lift: rgba(0, 0, 0, .55); --scrim: rgba(2, 4, 12, .66);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
button:active, .btn:active { transform: scale(.97); }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); transition: background-color .25s, color .25s; font: 15px/1.35 Onest, -apple-system, BlinkMacSystemFont, sans-serif; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
h1 { font-size: 28px; font-weight: 600; letter-spacing: -.025em; margin: 0; text-wrap: balance; }
.note { color: var(--mut); margin: 0; }

.page { max-width: 1520px; margin: 0 auto; padding: 24px 28px 36px; display: grid; gap: 14px; }
header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.logo img { width: 36px; height: 36px; border-radius: 10px; }
.search { flex: 1 1 320px; min-width: 0; height: 54px; background: var(--fill); color: var(--fill-text); transition: box-shadow .15s, background-color .25s; border-radius: 16px; display: flex; align-items: center; padding: 0 10px 0 22px; gap: 10px; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: inherit; font-size: 17px; }
.search input::placeholder { color: var(--hint); }
.search:focus-within { box-shadow: 0 0 0 2px var(--acc); }
kbd { font: 500 13px Onest, sans-serif; background: var(--fill-2); border-radius: 9px; padding: 6px 11px; white-space: nowrap; }
nav { display: flex; gap: 2px; font-weight: 500; }
nav button { background: none; border: 0; border-radius: 11px; padding: 9px 15px; color: var(--mut); }
nav button:hover { color: var(--ink); }
nav button[aria-selected="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.btn { transition: transform .12s, box-shadow .15s, opacity .15s; background: var(--card); border: 0; border-radius: 11px; padding: 9px 14px; font-weight: 500; box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
.btn:hover { box-shadow: inset 0 0 0 1px var(--dash); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--acc); color: #fff; box-shadow: none; font-weight: 600; }
.btn.dark { background: var(--fill); color: var(--fill-text); box-shadow: none; font-weight: 600; }
.btn.danger { color: var(--danger); }
.btn.small { padding: 6px 11px; font-size: 13.5px; border-radius: 9px; }
.user { display: flex; align-items: center; gap: 8px; color: var(--mut); font-size: 13.5px; }

.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: var(--soft); border-radius: 14px; padding: 10px 16px; font-weight: 500; }
.banner .btn { margin-left: auto; }

/* tiles */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; grid-auto-flow: dense; }
.tile { --c: #0B1530; box-shadow: inset 0 0 0 1px var(--tile-edge); position: relative; overflow: hidden; border-radius: 20px; background: var(--c); color: #fff; padding: 20px 22px; display: flex; flex-direction: column; min-height: clamp(235px, 36vh, 335px); min-width: 0; grid-column: span 3; transition: transform .22s cubic-bezier(.2, .8, .2, 1), box-shadow .22s; }
.tile.wide { grid-column: span 4; }
.tile.main { grid-column: span 5; }
.tile:hover { transform: translateY(-5px); box-shadow: inset 0 0 0 1px var(--tile-edge), 0 18px 34px -12px var(--lift); }
.tile.sel { box-shadow: 0 0 0 3px var(--acc); }
.tile.bad, .tile.bad:hover { box-shadow: inset 0 0 0 2px var(--warn); }
.tile.bad.sel { box-shadow: inset 0 0 0 2px var(--warn), 0 0 0 3px var(--acc); }
.tile.off { opacity: .5; }
.cover { position: absolute; inset: 0; z-index: 2; background: none; border: 0; border-radius: inherit; width: 100%; }
.bgimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bgshade { position: absolute; inset: 0; background: linear-gradient(to top, var(--c) 8%, transparent 75%); }
.tlogo { position: absolute; right: 16px; top: 16px; width: 56%; max-width: 165px; height: 165px; object-fit: contain; object-position: top right; transform-origin: 70% 35%; transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.tile:hover .tlogo { transform: scale(1.07) rotate(-2.5deg); }
.tile.wide .tlogo { max-width: 215px; height: 215px; }
.tile.main .tlogo { max-width: 255px; height: 255px; }
.ttop { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; min-width: 0; }
.k { width: 26px; height: 26px; flex: none; border-radius: 8px; background: rgba(255, 255, 255, .14); display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.st { font-size: 13px; color: rgba(255, 255, 255, .72); display: flex; gap: 7px; align-items: center; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.st.wait::before { background: rgba(255, 255, 255, .4); }
.st.none::before { display: none; }
.bad .st { color: #FFC45C; }
.bad .st::before { background: var(--warn); }
.tname { margin-top: auto; padding-top: 12px; font-weight: 600; font-size: 29px; line-height: 1.08; letter-spacing: -.025em; position: relative; z-index: 1; overflow-wrap: anywhere; }
.tile.main .tname { font-size: 58px; }
.tsub { margin-top: 6px; font-size: 14px; color: rgba(255, 255, 255, .72); position: relative; z-index: 1; }
.tfix { position: relative; z-index: 3; align-self: flex-start; margin-top: 10px; background: #fff; color: #0B1530; border: 0; border-radius: 10px; padding: 7px 12px; font-weight: 600; font-size: 13.5px; }
.tedit { position: absolute; z-index: 3; right: 12px; bottom: 12px; background: rgba(255, 255, 255, .16); color: #fff; border: 0; border-radius: 9px; padding: 6px 11px; font-size: 13px; font-weight: 500; opacity: 0; transition: opacity .1s; }
.tile:hover .tedit, .tile:focus-within .tedit { opacity: 1; }
.tedit:hover { background: rgba(255, 255, 255, .3); }
.ghead { margin: 0 0 12px; font-size: 18px; font-weight: 600; letter-spacing: -.015em; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.ghead small { font-size: 13.5px; font-weight: 400; letter-spacing: 0; color: var(--mut); }
.tile.link { min-height: clamp(205px, 28vh, 260px); }
.tile.link .tlogo { max-width: 130px; height: 130px; }
.tile.link .tname { font-size: 27px; }
.tletter { display: grid; place-items: center; font-size: 74px; font-weight: 600; letter-spacing: -.03em; color: rgba(255, 255, 255, .92); }
.addtile { background: none; color: var(--mut); border: 1.5px dashed var(--dash); box-shadow: none; align-items: center; justify-content: center; gap: 6px; font-weight: 500; font-size: 15px; }
.addtile span { font-size: 34px; font-weight: 400; line-height: 1; }
.addtile:hover { color: var(--ink); border-color: var(--acc); box-shadow: none; }
.empty { grid-column: 1 / -1; background: var(--card); border-radius: 20px; padding: 40px 24px; text-align: center; color: var(--mut); box-shadow: inset 0 0 0 1px var(--line); }


/* tables */
.scroll { overflow-x: auto; background: var(--card); border-radius: 18px; box-shadow: inset 0 0 0 1px var(--line); }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 14px 10px; text-align: center; border-bottom: 1px solid var(--line); font-weight: 400; }
tr:last-child td { border-bottom: 0; }
th { font-size: 12.5px; color: var(--mut); font-weight: 500; vertical-align: bottom; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; padding-left: 22px; }
th .ic { display: block; width: 40px; height: 40px; border-radius: 11px; margin: 0 auto 7px; padding: 4px; object-fit: contain; }
th span.ic { display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 14px; padding: 0; }
.left { text-align: left !important; }
.who-cell { display: flex; align-items: center; gap: 11px; font-weight: 600; white-space: nowrap; }
.who-cell small { display: block; font-weight: 400; color: var(--mut); font-size: 13px; }
.av { width: 36px; height: 36px; border-radius: 50%; background: var(--soft); color: var(--acc-ink); display: grid; place-items: center; font-weight: 600; flex: none; }
.sw { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; margin: 0; border-radius: 11px; background: var(--off); position: relative; cursor: pointer; vertical-align: middle; transition: background .1s; }
.sw::after { content: ""; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .1s; }
.sw:checked { background: var(--acc); }
.sw:checked::after { left: 18px; }
.rowacts { display: flex; gap: 6px; justify-content: flex-end; padding-right: 8px; }
.field-in { width: 100%; min-width: 220px; height: 38px; border: 0; border-radius: 9px; padding: 0 11px; box-shadow: inset 0 0 0 1px var(--line); background: var(--card); font-size: 13.5px; }
.bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.bar > div { flex: 1 1 320px; min-width: 0; }
.bar p { margin-top: 4px; }
.addform { display: flex; flex-wrap: wrap; gap: 8px; }
.addform input { flex: 1 1 200px; min-width: 0; height: 42px; border: 0; border-radius: 11px; padding: 0 13px; box-shadow: inset 0 0 0 1px var(--line); background: var(--card); }
.invite { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; background: var(--soft); border-radius: 14px; padding: 12px 16px; }
.invite code { flex: 1 1 280px; min-width: 0; overflow-wrap: anywhere; font: 13px ui-monospace, Menlo, monospace; }

/* edit panel */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 10; }
.panel { position: fixed; right: 0; top: 0; bottom: 0; z-index: 11; width: min(560px, 100%); background: var(--card); padding: 26px 30px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.lbl { display: block; font-size: 13px; font-weight: 500; color: var(--mut); margin-bottom: 6px; }
.inp { width: 100%; height: 44px; border: 0; border-radius: 11px; padding: 0 13px; box-shadow: inset 0 0 0 1px var(--line); background: var(--card); }
.inp:focus { outline: 0; box-shadow: inset 0 0 0 2px var(--acc); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.drops { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.drop { display: flex; flex-direction: column; gap: 9px; border: 1.5px dashed var(--dash); border-radius: 15px; padding: 12px; min-width: 0; }
.drop.over { border-color: var(--acc); background: var(--soft); }
.prev { height: 112px; border-radius: 11px; background: var(--c, #0B1530); display: grid; place-items: center; overflow: hidden; color: rgba(255, 255, 255, .7); font-size: 13px; text-align: center; padding: 6px; }
.prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.prev img.fill { width: 100%; height: 100%; object-fit: cover; }
.drop .acts { display: flex; flex-wrap: wrap; gap: 6px; }
.seg { display: flex; gap: 7px; }
.seg button { flex: 1; border: 0; border-radius: 10px; padding: 8px; background: none; font-weight: 500; color: var(--mut); box-shadow: inset 0 0 0 1px var(--line); }
.seg button[aria-pressed="true"] { background: var(--acc); color: #fff; box-shadow: none; }
.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.swatches button { width: 32px; height: 32px; border: 0; border-radius: 9px; padding: 0; }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--acc); }
.swatches input { width: 40px; height: 32px; border: 0; background: none; padding: 0; cursor: pointer; }
.swatches span { color: var(--mut); font-size: 13px; }
.who { display: flex; flex-wrap: wrap; gap: 7px; }
.who button { border: 0; border-radius: 10px; padding: 8px 12px; font-weight: 500; font-size: 14px; background: none; color: var(--mut); box-shadow: inset 0 0 0 1px var(--line); }
.who button[aria-pressed="true"] { background: var(--soft); color: var(--acc-ink); box-shadow: inset 0 0 0 1px var(--soft-line); }
.save { margin-top: auto; padding-top: 6px; display: flex; gap: 9px; }
.save .primary { flex: 1; padding: 13px; }
.err { color: var(--danger); font-size: 13.5px; margin: 0; }

/* sign in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth form { width: min(400px, 100%); background: var(--card); border-radius: 22px; padding: 30px; display: flex; flex-direction: column; gap: 15px; box-shadow: inset 0 0 0 1px var(--line); }
.auth .primary { padding: 13px; }

.toast { animation: toast-in .24s cubic-bezier(.2, .8, .2, 1); position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 30; background: var(--fill); color: var(--fill-text); box-shadow: 0 10px 30px var(--lift); padding: 10px 16px; border-radius: 12px; max-width: calc(100% - 32px); }

@media (max-width: 1100px) {
  .tile, .tile.wide { grid-column: span 6; }
  .tile.main { grid-column: span 12; }
}
@media (max-width: 680px) {
  .page { padding: 16px 16px 28px; }
  .tile, .tile.wide, .tile.main { grid-column: span 12; min-height: 190px; }
  .tile.main .tname { font-size: 40px; }
  .tlogo, .tile.wide .tlogo, .tile.main .tlogo { max-width: 120px; height: 120px; }
  .tedit { opacity: 1; }
  .search kbd { display: none; }
  .two, .drops { grid-template-columns: 1fr; }
  .panel { padding: 20px 16px; }
}
/* motion */
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-logo { from { opacity: 0; transform: scale(.82) rotate(-5deg); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { transform: translateX(44px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes pulse-ok { 0% { box-shadow: 0 0 0 0 rgba(34, 160, 107, .55); } 75%, 100% { box-shadow: 0 0 0 7px rgba(34, 160, 107, 0); } }
@keyframes pulse-bad { 0% { box-shadow: 0 0 0 0 rgba(240, 160, 32, .7); } 75%, 100% { box-shadow: 0 0 0 9px rgba(240, 160, 32, 0); } }
.enter .tile { animation: rise .5s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
.enter .tlogo { animation: pop-logo .6s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 45ms + 120ms); }
.view-in { animation: fade .25s ease; }
.st::before { animation: pulse-ok 2.6s ease-out infinite; }
.st.wait::before, .st.none::before { animation: none; }
.bad .st::before { animation: pulse-bad 1.5s ease-out infinite; }
.scrim.opening { animation: fade .2s ease; }
.panel.opening { animation: slide-in .3s cubic-bezier(.2, .8, .2, 1); }
.auth form { animation: rise .45s cubic-bezier(.2, .8, .2, 1); }
.theme { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; font-size: 16px; }
.theme span { display: block; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.theme:hover span { transform: rotate(25deg) scale(1.12); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
