/* Основа «Описи»: шрифты, цвета, каркас. Мотив — инвентарная бирка и театральный занавес. */

@font-face { font-family: "Golos"; src: url("fonts/golos-cyr.woff2") format("woff2"); font-weight: 400 900; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos"; src: url("fonts/golos-lat.woff2") format("woff2"); font-weight: 400 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "PT Serif"; src: url("fonts/ptserif-cyr.woff2") format("woff2"); font-weight: 700; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PT Serif"; src: url("fonts/ptserif-lat.woff2") format("woff2"); font-weight: 700; font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20BD; }

:root {
  --paper: #f4efe6;
  --paper-2: #ebe3d5;
  --card: #fffdf9;
  --ink: #1d1915;
  --ink-2: #4a4239;
  --muted: #7a6f62;
  --line: #e2d8c8;
  --line-strong: #cdbfa9;
  --curtain: #7a1a20;
  --curtain-deep: #5c1217;
  --curtain-ink: #fff6ec;
  --brass: #b8892f;
  --brass-soft: #f5e8cc;
  --ok: #2d6a4a;
  --ok-soft: #e3f1e8;
  --warn: #8a5a00;
  --warn-soft: #fff1d2;
  --danger: #b3261e;
  --danger-soft: #fde6e3;
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Golos", "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "PT Serif", Georgia, serif;
  --mono: "Cascadia Mono", "Roboto Mono", Consolas, monospace;
  --shadow-sm: 0 1px 2px rgba(29, 25, 21, .06);
  --shadow: 0 1px 0 rgba(29, 25, 21, .04), 0 12px 32px -18px rgba(29, 25, 21, .35);
  --rail-w: 252px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: -.01em; line-height: 1.15; margin: 0; }
.ico { flex: 0 0 auto; display: block; }
button { font: inherit; cursor: pointer; border: 0; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }

/* ---------- каркас: телефон ---------- */
.rail {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--curtain); color: var(--curtain-ink);
  box-shadow: 0 8px 20px -14px rgba(0, 0, 0, .7);
}
.brand { display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
.brand-mark { width: 16px; height: 21px; border: 2px solid var(--brass); border-radius: 3px 3px 8px 8px; position: relative; }
.brand-mark::after { content: ""; position: absolute; top: 3px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--brass); }
.brand-text { font-family: var(--serif); font-size: 21px; letter-spacing: .01em; }
.org-chip { min-width: 0; flex: 1; display: grid; line-height: 1.2; }
.org-label { display: none; }
.org-name { font-size: 14px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-chip { display: none; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -8px 24px -18px rgba(29, 25, 21, .4);
}
.nav a { display: grid; justify-items: center; gap: 3px; padding: 9px 0 8px; font-size: 11.5px; font-weight: 500; color: var(--muted); text-decoration: none; }
.nav a.on { color: var(--curtain); }
.nav a.on .ico { stroke-width: 2.2; }

main { max-width: 1180px; margin: 0 auto; padding: 18px 16px calc(100px + env(safe-area-inset-bottom)); }

/* ---------- каркас: компьютер — боковая панель ---------- */
@media (min-width: 1024px) {
  .rail {
    position: fixed; inset: 0 auto 0 0; width: var(--rail-w);
    flex-direction: column; align-items: stretch; gap: 18px;
    padding: 26px 18px 18px;
    background: linear-gradient(180deg, var(--curtain) 0%, var(--curtain-deep) 100%);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, .06);
  }
  .rail::before { /* складки занавеса */
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .08) 0 2px, transparent 2px 28px, rgba(255, 255, 255, .04) 28px 30px, transparent 30px 56px);
  }
  .rail > * { position: relative; }
  .brand-text { font-size: 26px; }
  .org-chip { flex: 0 0 auto; padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, .18); }
  .org-label { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .6; }
  .org-name { font-size: 15px; font-weight: 600; opacity: 1; white-space: normal; }
  .nav { position: static; display: grid; grid-template-columns: none; gap: 4px; background: none; border: 0; box-shadow: none; padding: 0; }
  .nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; font-size: 15px; color: rgba(255, 246, 236, .78); justify-items: start; }
  .nav a:hover { background: rgba(255, 255, 255, .07); color: var(--curtain-ink); }
  .nav a.on { background: var(--curtain-ink); color: var(--curtain); font-weight: 600; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .5); }
  .sync { order: 10; margin-top: auto; align-self: flex-start; }
  .me-chip { order: 11; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; color: inherit; text-decoration: none; background: rgba(0, 0, 0, .18); }
  .me-chip:hover { background: rgba(0, 0, 0, .28); }
  main { margin-left: var(--rail-w); max-width: none; padding: 34px clamp(24px, 4vw, 56px) 56px; }
  main > * { max-width: 1120px; margin-left: auto; margin-right: auto; }
}

/* ---------- связь ---------- */
.sync { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, .13); white-space: nowrap; }
.sync::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #86e0a8; box-shadow: 0 0 0 3px rgba(134, 224, 168, .2); }
.sync.is-off::before { background: #ffb1a5; box-shadow: 0 0 0 3px rgba(255, 177, 165, .2); }
.sync.has-queue::before { background: #ffd36b; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .sync.has-queue::before { animation: none; } * { transition: none !important; } }

/* ---------- аватар ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; font-weight: 700; font-size: 14px; background: var(--brass-soft); color: var(--curtain); }
.avatar-lg { width: 64px; height: 64px; font-size: 24px; font-family: var(--serif); }
.me-chip .avatar { background: var(--brass); color: var(--curtain-deep); }
.me-text { display: grid; line-height: 1.25; min-width: 0; }
.me-text b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text span { font-size: 12px; opacity: .7; }
