:root {
  --gmc-void: #070908;
  --gmc-bg: #0d110e;
  --gmc-stone-1: #131815;
  --gmc-stone-2: #1b211d;
  --gmc-stone-3: #252c27;
  --gmc-stone-4: #353e37;
  --gmc-line: #3d493f;
  --gmc-line-soft: #2a322c;
  --gmc-gold: #f2b632;
  --gmc-gold-bright: #ffd86a;
  --gmc-gold-deep: #9b5f08;
  --gmc-emerald: #57bb6d;
  --gmc-emerald-deep: #246c37;
  --gmc-purple: #8d54c6;
  --gmc-purple-deep: #4d286f;
  --gmc-water: #55a7d7;
  --gmc-danger: #e65d5d;
  --gmc-text: #f4f1e6;
  --gmc-muted: #aab3aa;
  --gmc-shadow: rgba(0, 0, 0, .48);
  --gmc-pixel: 8px;
  --gmc-cut: 8px;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--gmc-text);
  background:
    linear-gradient(180deg, rgba(22, 31, 23, .98) 0, rgba(11, 15, 12, .99) 38%, #070908 100%);
  font-family: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}

::selection { color: #1a1202; background: var(--gmc-gold-bright); }

.world-backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(255,255,255,.012) 31px 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(255,255,255,.012) 31px 32px),
    radial-gradient(circle at 50% -15%, rgba(97, 140, 89, .14), transparent 46rem);
}

.world-backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .38;
  background-image:
    linear-gradient(135deg, rgba(255,255,255,.018) 25%, transparent 25%),
    linear-gradient(315deg, rgba(255,255,255,.012) 25%, transparent 25%);
  background-position: 0 0, 16px 16px;
  background-size: 32px 32px;
}

.world-backdrop::after {
  content: "";
  position: absolute;
  right: -4vw;
  bottom: -20px;
  left: -4vw;
  height: 150px;
  opacity: .4;
  background:
    linear-gradient(90deg,
      transparent 0 3%, #141a15 3% 10%, transparent 10% 12%, #111712 12% 20%, transparent 20% 23%,
      #192019 23% 34%, transparent 34% 39%, #101510 39% 49%, transparent 49% 51%, #151c16 51% 65%,
      transparent 65% 69%, #101510 69% 80%, transparent 80% 83%, #192019 83% 94%, transparent 94%),
    repeating-linear-gradient(90deg, #111611 0 31px, #0a0d0b 31px 32px);
  clip-path: polygon(0 58%, 4% 58%, 4% 36%, 10% 36%, 10% 52%, 17% 52%, 17% 20%, 25% 20%, 25% 44%, 33% 44%, 33% 64%, 41% 64%, 41% 32%, 51% 32%, 51% 51%, 59% 51%, 59% 14%, 67% 14%, 67% 43%, 77% 43%, 77% 59%, 86% 59%, 86% 28%, 94% 28%, 94% 48%, 100% 48%, 100% 100%, 0 100%);
}

.world-glow {
  position: absolute;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .13;
}
.world-glow--gold { top: -16rem; left: -10rem; background: var(--gmc-gold); }
.world-glow--purple { top: 2rem; right: -18rem; background: var(--gmc-purple); }

.world-pixels {
  position: absolute;
  width: 180px;
  height: 180px;
  opacity: .08;
  background:
    linear-gradient(90deg, transparent 0 25%, currentColor 25% 50%, transparent 50% 75%, currentColor 75%),
    linear-gradient(0deg, transparent 0 25%, currentColor 25% 50%, transparent 50% 75%, currentColor 75%);
  background-size: 32px 32px;
}
.world-pixels--left { top: 18%; left: -80px; color: var(--gmc-gold); transform: rotate(12deg); }
.world-pixels--right { top: 42%; right: -80px; color: var(--gmc-purple); transform: rotate(-11deg); }

a { color: var(--gmc-gold-bright); text-underline-offset: .2em; }
a:hover { color: #fff1aa; }

.portal-main { position: relative; z-index: 1; padding-top: clamp(2rem, 4vw, 3.5rem); padding-bottom: 4rem; }
.portal-main--guest { min-height: 100vh; display: grid; align-items: center; padding-top: 2rem; padding-bottom: 2rem; }

/* Навигация */
.portal-navbar {
  min-height: 76px;
  padding: .55rem 0;
  background:
    linear-gradient(180deg, rgba(29, 36, 30, .98), rgba(12, 16, 13, .98)),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(255,255,255,.02) 31px 32px);
  border: 0;
  border-bottom: 4px solid #080b09;
  box-shadow: 0 2px 0 var(--gmc-gold-deep), 0 12px 28px rgba(0,0,0,.35);
  backdrop-filter: blur(14px);
}

.brand-wordmark { display: inline-flex; align-items: center; gap: .75rem; color: #fff !important; text-decoration: none; }
.brand-block {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 11px);
  grid-template-rows: repeat(2, 11px);
  gap: 2px;
  width: 28px;
  height: 28px;
  padding: 2px;
  background: #131815;
  border: 2px solid #556158;
  box-shadow: 3px 3px 0 #050706, inset 0 0 0 1px #111;
}
.brand-block i:nth-child(1), .brand-block i:nth-child(4) { background: var(--gmc-gold); }
.brand-block i:nth-child(2), .brand-block i:nth-child(3) { background: var(--gmc-purple); }
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { font-size: 1.04rem; font-weight: 950; letter-spacing: .025em; }
.brand-copy strong b { color: var(--gmc-gold); text-shadow: 0 0 14px rgba(242,182,50,.55); }
.brand-copy small { margin-top: .25rem; color: #98a299; font-size: .64rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

.portal-nav { margin-left: 2rem; gap: .25rem; }
.portal-nav .nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 42px;
  padding: .65rem .82rem;
  color: #cbd2cb;
  font-size: .9rem;
  font-weight: 800;
  border: 1px solid transparent;
}
.portal-nav .nav-link:hover, .portal-nav .nav-link:focus-visible { color: #fff; background: rgba(255,255,255,.035); border-color: #303932; }
.portal-nav .nav-link.active { color: #211604; background: linear-gradient(180deg, #ffda6b, #d99516); border-color: #ffe38a; box-shadow: inset 0 -3px 0 #9a5d08, 3px 3px 0 rgba(0,0,0,.35); }
.nav-pixel { width: 6px; height: 6px; background: currentColor; opacity: .55; box-shadow: 3px 3px 0 rgba(0,0,0,.25); }
.portal-nav .nav-link.active .nav-pixel { opacity: .9; }

.account-button {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 172px;
  padding: .45rem .7rem;
  color: var(--gmc-text);
  text-align: left;
  background: #151a16;
  border: 1px solid #3b463d;
  border-radius: 0;
  box-shadow: inset 0 -3px 0 #080b09;
}
.account-button:hover, .account-button:focus { color: #fff; border-color: #6a7a6d; background: #1b221c; }
.account-head {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  color: #241701;
  font-weight: 950;
  background: var(--gmc-gold);
  border: 2px solid #ffe38a;
  box-shadow: inset 0 -4px 0 #a86c0b;
}
.account-copy { display: grid; min-width: 0; line-height: 1.05; }
.account-copy strong { max-width: 105px; overflow: hidden; text-overflow: ellipsis; font-size: .82rem; }
.account-copy small { margin-top: .25rem; color: var(--gmc-muted); font-size: .68rem; }

.pixel-toggler { display: grid; gap: 4px; width: 44px; height: 44px; padding: 9px; border: 1px solid #4a574c; border-radius: 0; }
.pixel-toggler span { display: block; height: 3px; background: var(--gmc-gold); }
.pixel-toggler:focus { box-shadow: 0 0 0 .2rem rgba(242,182,50,.22); }

.portal-offcanvas { color: var(--gmc-text); background: #101511; border-left: 3px solid var(--gmc-gold-deep); }
.portal-offcanvas .offcanvas-header { border-bottom: 1px solid #303a31; }
.mobile-nav-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .9rem 1rem;
  color: #dfe4df;
  font-weight: 800;
  text-decoration: none;
  background: #181e19;
  border: 1px solid #344036;
  box-shadow: inset 0 -3px 0 #090c0a;
}
.mobile-nav-link:hover, .mobile-nav-link.active { color: #fff; border-color: var(--gmc-gold); background: #24251c; }
.mobile-nav-link--gold { color: #241701; background: var(--gmc-gold); border-color: #ffe084; }

/* Блочные панели */
.pixel-panel {
  position: relative;
  color: var(--gmc-text);
  background:
    linear-gradient(135deg, rgba(255,255,255,.025) 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(315deg, rgba(255,255,255,.015) 25%, transparent 25%) 8px 8px / 16px 16px,
    linear-gradient(180deg, rgba(34, 42, 36, .98), rgba(19, 24, 20, .99));
  border: 2px solid #465148;
  border-radius: 0;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.07),
    inset 0 -5px 0 rgba(0,0,0,.38),
    0 0 0 2px #090c0a,
    0 11px 0 rgba(0,0,0,.16),
    0 20px 45px rgba(0,0,0,.24);
  clip-path: polygon(0 var(--gmc-cut), var(--gmc-cut) var(--gmc-cut), var(--gmc-cut) 0, calc(100% - var(--gmc-cut)) 0, calc(100% - var(--gmc-cut)) var(--gmc-cut), 100% var(--gmc-cut), 100% calc(100% - var(--gmc-cut)), calc(100% - var(--gmc-cut)) calc(100% - var(--gmc-cut)), calc(100% - var(--gmc-cut)) 100%, var(--gmc-cut) 100%, var(--gmc-cut) calc(100% - var(--gmc-cut)), 0 calc(100% - var(--gmc-cut)));
}

.pixel-panel--plain { background: linear-gradient(180deg, #202721, #141915); }

.page-heading { position: relative; margin-bottom: 1.65rem; padding-left: 1.15rem; }
.page-heading::before {
  content: "";
  position: absolute;
  top: .15rem;
  bottom: .15rem;
  left: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--gmc-gold-bright), var(--gmc-gold-deep));
  box-shadow: 5px 5px 0 rgba(0,0,0,.25);
}
.page-heading h1 { margin: .25rem 0 .45rem; font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 950; letter-spacing: -.045em; line-height: 1.02; text-shadow: 3px 3px 0 rgba(0,0,0,.28); }
.page-heading p { max-width: 54rem; margin-bottom: 0; color: var(--gmc-muted); }
.eyebrow, .auth-kicker, .ticket-id { color: var(--gmc-gold-bright); font-size: .72rem; font-weight: 950; letter-spacing: .17em; text-transform: uppercase; }

/* Кнопки */
.btn {
  position: relative;
  min-height: 42px;
  padding: .62rem 1rem;
  border-width: 2px;
  border-radius: 0;
  font-weight: 900;
  letter-spacing: .01em;
  transition: transform .13s ease, filter .13s ease, border-color .13s ease, background-color .13s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(2px); }
.btn:focus-visible { outline: 3px solid rgba(255,216,106,.38); outline-offset: 3px; box-shadow: none; }
.btn-gold {
  color: #261801;
  background: linear-gradient(180deg, #ffde77, #e6a51c);
  border-color: #ffe69a #b47509 #8b5506 #ffe69a;
  box-shadow: inset 0 -4px 0 rgba(122,72,0,.38), 4px 4px 0 rgba(0,0,0,.3);
}
.btn-gold:hover, .btn-gold:focus { color: #150d00; filter: brightness(1.08); background: linear-gradient(180deg, #ffe898, #f0b42c); border-color: #fff1b6 #c9830c #9b6107 #fff1b6; }
.btn-outline-gold { color: var(--gmc-gold-bright); background: rgba(14,17,14,.65); border-color: #8e681d; box-shadow: inset 0 -3px 0 #090b09; }
.btn-outline-gold:hover, .btn-outline-gold:focus { color: #241701; background: var(--gmc-gold); border-color: #ffe18a; }
.btn-outline-stone, .btn-outline-secondary { color: #d7ddd7; background: #151a16; border-color: #4c594e; box-shadow: inset 0 -3px 0 #090b09; }
.btn-outline-stone:hover, .btn-outline-secondary:hover { color: #fff; background: #2b342c; border-color: #77867a; }
.btn-outline-danger { color: #ff9494; background: rgba(28,13,13,.45); border-color: #7e3e3e; }
.btn-danger { background: #b33e3e; border-color: #ec7979 #702626 #5d1d1d #ec7979; box-shadow: inset 0 -4px 0 rgba(67,13,13,.5); }
.btn-sm { min-height: 34px; padding: .38rem .7rem; }
.btn-lg { min-height: 50px; padding: .78rem 1.2rem; }

/* Формы */
.form-label { margin-bottom: .45rem; color: #e9e8df; font-weight: 900; }
.form-control, .form-select {
  min-height: 48px;
  color: var(--gmc-text);
  background-color: #0e120f;
  border: 2px solid #465248;
  border-radius: 0;
  box-shadow: inset 0 3px 0 rgba(0,0,0,.42), inset 0 -1px 0 rgba(255,255,255,.025);
}
.form-control::placeholder { color: #747e75; }
.form-control:hover, .form-select:hover { border-color: #607064; }
.form-control:focus, .form-select:focus {
  color: var(--gmc-text);
  background-color: #101511;
  border-color: var(--gmc-gold);
  box-shadow: inset 0 3px 0 rgba(0,0,0,.38), 0 0 0 .22rem rgba(242,182,50,.13);
}
.form-control.is-invalid, .form-select.is-invalid { border-color: #e36a6a; background-image: none; }
.invalid-feedback { margin-top: .45rem; color: #ff9191; font-weight: 700; }
.form-textarea-lg { min-height: 210px; resize: vertical; }
.form-check-input { background-color: #111612; border: 2px solid #59655b; border-radius: 0 !important; }
.form-check-input:checked { background-color: var(--gmc-gold); border-color: #ffe28e; }
.form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(242,182,50,.15); }
.input-hint { color: var(--gmc-muted); font-size: .82rem; }

/* Авторизация */
.auth-layout { width: min(100%, 1040px); margin: auto; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr); align-items: stretch; }
.auth-world {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 620px;
  padding: clamp(2rem, 5vw, 4rem);
  overflow: hidden;
  border-color: #5a664f;
  background:
    linear-gradient(180deg, rgba(42,58,43,.92) 0 42%, rgba(25,34,27,.96) 42% 70%, rgba(18,24,19,.99) 70%),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(0,0,0,.08) 31px 32px);
}
.auth-world::before {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -12px;
  left: -30px;
  height: 225px;
  background:
    linear-gradient(180deg, #446d35 0 10px, #315628 10px 17px, #4b3525 17px 50%, #39271c 50% 100%);
  opacity: .56;
  clip-path: polygon(0 42%, 8% 42%, 8% 20%, 17% 20%, 17% 38%, 29% 38%, 29% 8%, 38% 8%, 38% 30%, 48% 30%, 48% 56%, 61% 56%, 61% 24%, 71% 24%, 71% 45%, 82% 45%, 82% 16%, 93% 16%, 93% 39%, 100% 39%, 100% 100%, 0 100%);
}
.auth-world::after {
  content: "";
  position: absolute;
  top: 11%;
  right: 8%;
  width: 86px;
  height: 86px;
  background: var(--gmc-gold);
  opacity: .55;
  box-shadow: 0 0 55px rgba(242,182,50,.42);
  clip-path: polygon(25% 0,75% 0,75% 25%,100% 25%,100% 75%,75% 75%,75% 100%,25% 100%,25% 75%,0 75%,0 25%,25% 25%);
}
.auth-world-content, .auth-world-foot { position: relative; z-index: 1; }
.auth-world h2 { max-width: 540px; margin: .65rem 0 1rem; font-size: clamp(2.4rem, 5vw, 4.9rem); font-weight: 950; letter-spacing: -.06em; line-height: .94; text-shadow: 5px 5px 0 rgba(0,0,0,.34); }
.auth-world p { max-width: 470px; color: #c3cbc3; font-size: 1.02rem; }
.auth-feature-list { display: grid; gap: .72rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.auth-feature-list li { display: flex; align-items: center; gap: .7rem; color: #e7e9e4; font-weight: 800; }
.auth-feature-list li::before { content: ""; width: 11px; height: 11px; flex: 0 0 11px; background: var(--gmc-emerald); border: 2px solid #87d595; box-shadow: 3px 3px 0 #173d20; }
.auth-world-foot { display: flex; flex-wrap: wrap; gap: .55rem; }
.world-chip { padding: .45rem .65rem; color: #d9ded8; font-size: .72rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; background: rgba(9,12,10,.68); border: 1px solid #455147; }
.auth-card { z-index: 2; align-self: center; margin-left: -16px; padding: clamp(1.7rem, 4vw, 3.2rem); background: linear-gradient(180deg, rgba(33,40,34,.99), rgba(16,20,17,.99)); }
.auth-card h1 { margin: .4rem 0 .55rem; font-size: clamp(2rem, 4vw, 3rem); font-weight: 950; letter-spacing: -.045em; }
.auth-card .auth-lead { margin-bottom: 1.7rem; color: var(--gmc-muted); }
.auth-divider { display: flex; align-items: center; gap: .7rem; margin: 1.5rem 0; color: #657066; font-size: .72rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: #38423a; }
.auth-alt { margin: 0; text-align: center; color: #b2bab2; }

/* Карточки и метрики */
.metric-card { min-height: 154px; padding: 1.3rem 1.4rem; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.metric-card::before {
  content: "";
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  opacity: .75;
  background: var(--metric-color, var(--gmc-gold));
  border: 6px solid rgba(255,255,255,.12);
  box-shadow: 7px 7px 0 rgba(0,0,0,.25);
}
.metric-card::after { content: ""; position: absolute; right: -18px; bottom: -18px; width: 86px; height: 86px; opacity: .1; background: var(--metric-color, var(--gmc-gold)); transform: rotate(45deg); }
.metric-card[data-tone="gold"] { --metric-color: var(--gmc-gold); }
.metric-card[data-tone="water"] { --metric-color: var(--gmc-water); }
.metric-card[data-tone="stone"] { --metric-color: #929a92; }
.metric-card[data-tone="emerald"] { --metric-color: var(--gmc-emerald); }
.metric-card[data-tone="purple"] { --metric-color: var(--gmc-purple); }
.metric-label { color: var(--gmc-muted); font-size: .78rem; font-weight: 950; letter-spacing: .11em; text-transform: uppercase; }
.metric-card strong { position: relative; z-index: 1; color: #fff; font-size: clamp(2.5rem, 7vw, 3.45rem); font-weight: 950; line-height: 1; text-shadow: 4px 4px 0 rgba(0,0,0,.28); }
.metric-card .metric-date { max-width: 85%; font-size: 1rem; line-height: 1.35; }

.filter-panel, .form-panel, .info-panel, .ticket-description { padding: clamp(1.15rem, 2vw, 1.7rem); }
.filter-panel { background-color: rgba(20,26,21,.96); }

.ticket-card { min-height: 100%; padding: 1.35rem; overflow: hidden; transition: transform .16s ease, border-color .16s ease, filter .16s ease; }
.ticket-card::after { content: ""; position: absolute; right: -28px; bottom: -28px; width: 90px; height: 90px; opacity: .08; background: var(--gmc-gold); transform: rotate(45deg); }
.ticket-card:hover { transform: translateY(-5px); border-color: #9a792d; filter: brightness(1.04); }
.ticket-card h3 a, .ticket-card h2 a { color: #fff; text-decoration: none; }
.ticket-card h3, .ticket-card h2 { font-weight: 950; letter-spacing: -.02em; }
.ticket-card .category-tag { display: inline-flex; margin-top: .45rem; padding: .25rem .48rem; color: #b8c1b9; font-size: .7rem; font-weight: 800; background: #101511; border: 1px solid #364138; }
.ticket-meta { display: grid; gap: .45rem; margin-top: 1.15rem; padding-top: .95rem; color: var(--gmc-muted); font-size: .8rem; border-top: 1px solid #39433b; }
.ticket-meta span { display: flex; justify-content: space-between; gap: 1rem; }
.ticket-meta b { color: #dce1dc; font-weight: 800; text-align: right; }
.ticket-excerpt { color: #c4cbc4; }
.ticket-open-hint { display: inline-flex; align-items: center; gap: .45rem; margin-top: 1rem; color: var(--gmc-gold-bright); font-size: .78rem; font-weight: 950; letter-spacing: .06em; text-transform: uppercase; }
.ticket-open-hint::after { content: ""; width: 8px; height: 8px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); }

.status-badge { padding: .52rem .68rem; border: 2px solid transparent; border-radius: 0; font-size: .68rem; font-weight: 950; letter-spacing: .07em; text-transform: uppercase; box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); }
.status-new { color: #251801; background: #efbd43; border-color: #ffe48d #a36a09 #875306 #ffe48d; }
.status-progress { color: #edf9ff; background: #337ea6; border-color: #72c1e8 #21536f #173e54 #72c1e8; }
.status-closed { color: #ecefec; background: #4a534c; border-color: #77827a #303832 #252b27 #77827a; }
.status-archive { color: #f0e3ff; background: #68408c; border-color: #a276c8 #44245f #341948 #a276c8; }
.unread-badge { color: #1d1301; background: var(--gmc-gold); border-radius: 0; box-shadow: 2px 2px 0 rgba(0,0,0,.25); }

.load-card { min-width: 215px; padding: 1.1rem 1.35rem; display: grid; align-content: center; }
.load-card span { color: var(--gmc-muted); font-size: .74rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.load-card strong { color: var(--gmc-gold-bright); font-size: 2.8rem; font-weight: 950; line-height: 1.05; }
.load-card small { color: #ccd3cc; }

.empty-state, .error-page { padding: clamp(2.7rem, 8vw, 6.3rem); text-align: center; }
.empty-state::before { content: ""; display: block; width: 54px; height: 54px; margin: 0 auto 1.4rem; background: #2e3830; border: 7px solid #455248; box-shadow: inset 0 -8px 0 #192019, 7px 7px 0 rgba(0,0,0,.28); }
.empty-state h2, .error-page h1 { font-weight: 950; letter-spacing: -.03em; }
.empty-state p, .error-page p { max-width: 580px; margin-right: auto; margin-left: auto; color: var(--gmc-muted); }

/* Загрузка файлов */
.upload-zone { margin-top: 1rem; padding: 1.35rem; background: rgba(7,10,8,.43); border: 2px dashed #536056; }
.upload-zone:hover { border-color: #8b752e; background: rgba(17,20,15,.55); }
.upload-item { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: .85rem; padding: .75rem; background: #101511; border: 1px solid #3d493f; box-shadow: inset 0 -3px 0 #080a08; }
.upload-item + .upload-item { margin-top: .55rem; }
.upload-preview { display: grid; place-items: center; width: 52px; height: 52px; object-fit: cover; color: var(--gmc-gold); background: #202820; border: 2px solid #505e52; border-radius: 0; }
.upload-meta { min-width: 0; }
.upload-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.upload-size { color: var(--gmc-muted); font-size: .76rem; }
.progress { height: 8px; background: #252d27; border: 1px solid #3c483e; border-radius: 0; }
.progress-bar { background: linear-gradient(90deg, #a7710c, var(--gmc-gold-bright)); }

/* Обращение и чат */
.attachment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: .85rem; }
.attachment-card { display: grid; gap: .45rem; padding: .5rem; color: #ddd; text-decoration: none; background: #111612; border: 1px solid #3c473e; }
.attachment-card:hover { border-color: var(--gmc-gold); }
.attachment-card img, .attachment-card video { width: 100%; aspect-ratio: 16/10; object-fit: cover; border: 1px solid #566157; border-radius: 0; background: #080a08; }
.attachment-card span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }

.chat-panel { overflow: hidden; }
.chat-header { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1.05rem 1.25rem; background: rgba(9,12,10,.52); border-bottom: 2px solid #3b463d; }
.chat-header h2 { font-weight: 950; }
.connection-state { display: inline-flex; align-items: center; gap: .42rem; color: #ddb958; font-size: .76rem; font-weight: 800; }
.connection-state::before { content: ""; width: 8px; height: 8px; background: currentColor; box-shadow: 2px 2px 0 rgba(0,0,0,.25); }
.connection-state.is-online { color: #70d988; }
.connection-state.is-offline { color: #ef7979; }
.message-list { height: min(59vh, 640px); min-height: 370px; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: .85rem; background:
  linear-gradient(rgba(6,8,6,.72), rgba(8,11,9,.78)),
  repeating-linear-gradient(0deg, transparent 0 31px, rgba(255,255,255,.017) 31px 32px),
  repeating-linear-gradient(90deg, transparent 0 31px, rgba(255,255,255,.017) 31px 32px);
  scrollbar-color: #5f6d61 #111612;
}
.chat-message { position: relative; max-width: min(84%, 760px); padding: .9rem 1rem; background: #252d27; border: 2px solid #465348; box-shadow: inset 0 -3px 0 rgba(0,0,0,.24), 4px 4px 0 rgba(0,0,0,.19); }
.chat-message::before { content: ""; position: absolute; top: 14px; width: 8px; height: 8px; background: inherit; border: inherit; transform: rotate(45deg); }
.chat-message.mine { align-self: flex-end; background: #3b321e; border-color: #826820; }
.chat-message.mine::before { right: -6px; border-bottom: 0; border-left: 0; }
.chat-message.theirs { align-self: flex-start; }
.chat-message.theirs::before { left: -6px; border-top: 0; border-right: 0; }
.chat-message.system-message { align-self: center; max-width: 94%; color: #c8d0c8; text-align: center; background: #151a16; border-style: dashed; border-color: #4c574e; box-shadow: none; }
.chat-message.system-message::before { display: none; }
.message-meta { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .4rem; color: var(--gmc-muted); font-size: .72rem; }
.message-meta strong { color: #f1efe7; }
.message-text { line-height: 1.55; }
.message-attachments { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .55rem; margin-top: .75rem; }
.message-attachments a, .message-attachments > div { display: block; }
.message-attachments img, .message-attachments video { width: 100%; max-height: 245px; object-fit: cover; background: #080a08; border: 1px solid #657067; border-radius: 0; }
.message-composer { padding: 1.05rem 1.25rem 1.25rem; background: rgba(18,23,19,.97); border-top: 2px solid #3b463d; }
.chat-locked { padding: 1.35rem; color: var(--gmc-muted); text-align: center; background: #141915; border-top: 2px solid #3b463d; }
.preserve-lines { white-space: pre-wrap; overflow-wrap: anywhere; }

.info-panel h2, .ticket-description h2 { font-weight: 950; }
.info-list { margin: 0; display: grid; gap: .7rem; }
.info-list div { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: .7rem; border-bottom: 1px solid #39433b; }
.info-list div:last-child { padding-bottom: 0; border-bottom: 0; }
.info-list dt { color: var(--gmc-muted); font-weight: 800; }
.info-list dd { margin: 0; color: #f0eee6; text-align: right; }
.timeline { margin: .5rem 0 0; padding: 0 0 0 1rem; list-style: none; border-left: 4px solid #465248; }
.timeline li { position: relative; display: grid; gap: .15rem; padding: 0 0 1.15rem 1rem; }
.timeline li::before { content: ""; position: absolute; top: .25rem; left: -1.48rem; width: 12px; height: 12px; background: var(--gmc-gold); border: 2px solid #ffe28b; box-shadow: 0 0 0 4px #202721, 3px 3px 0 rgba(0,0,0,.28); }
.timeline span, .timeline small { color: var(--gmc-muted); }

/* Админ-панель */
.portal-table { --bs-table-bg: transparent; --bs-table-color: #e6ebe6; --bs-table-border-color: #3b463d; }
.portal-table thead th { padding: .85rem .9rem; color: var(--gmc-gold-bright); font-size: .7rem; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; background: #101511; border-bottom-width: 2px; }
.portal-table tbody td { padding: .85rem .9rem; }
.portal-table tbody tr { transition: background-color .12s ease; }
.portal-table tbody tr:hover { --bs-table-accent-bg: rgba(242,182,50,.05); }
.admin-tabs { gap: .35rem; border-bottom: 2px solid #3b463d; }
.admin-tabs .nav-link { color: #bfc7bf; font-weight: 900; border: 1px solid transparent; border-radius: 0; }
.admin-tabs .nav-link:hover { color: #fff; border-color: #39433b; }
.admin-tabs .nav-link.active { color: #251801; background: var(--gmc-gold); border-color: #ffe28b; box-shadow: inset 0 -3px 0 #a66a0a; }
.page-link { color: var(--gmc-gold-bright); background: #151a16; border: 1px solid #455047; border-radius: 0 !important; }
.page-link:hover { color: #211500; background: var(--gmc-gold); border-color: #ffe28a; }
.page-item.active .page-link { color: #211500; background: var(--gmc-gold); border-color: #ffe28a; box-shadow: inset 0 -3px 0 #a66a0a; }

/* Всплывающие компоненты */
.portal-toast { color: #f1f3ef; background: #171d18; border: 2px solid #465248; border-radius: 0; box-shadow: 6px 6px 0 rgba(0,0,0,.35); }
.portal-toast .toast-header { color: #fff; background: #242c25; border-bottom: 1px solid #465248; }
.toast-pixel { width: 10px; height: 10px; margin-right: .55rem; background: var(--gmc-gold); }
.toast-success .toast-pixel { background: var(--gmc-emerald); }
.toast-danger .toast-pixel { background: var(--gmc-danger); }
.toast-warning .toast-pixel { background: var(--gmc-gold); }
.modal-content { color: var(--gmc-text); background: #1a201b; border: 2px solid #4b574d; border-radius: 0; }
.modal-header, .modal-footer { border-color: #3d483f; }
.dropdown-menu, .offcanvas { background: #151a16; border-color: #445047; border-radius: 0; }
.pixel-menu { padding: .4rem; box-shadow: 5px 5px 0 rgba(0,0,0,.32); }
.dropdown-item { padding: .65rem .75rem; color: #e2e7e2; font-weight: 700; }
.dropdown-item:hover, .dropdown-item:focus { color: #fff; background: #2a332b; }
.dropdown-divider { border-color: #3c463e; }
.btn-close { filter: invert(1) grayscale(1); }

/* Ошибки */
.error-stage { min-height: calc(100vh - 4rem); display: grid; place-items: center; }
.error-page { width: min(100%, 760px); }
.error-cube { width: 70px; height: 70px; margin: 0 auto 1.25rem; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 7px; background: #111612; border: 3px solid #566258; box-shadow: 7px 7px 0 rgba(0,0,0,.32); }
.error-cube span { background: #6b746c; }
.error-cube span:nth-child(2), .error-cube span:nth-child(3) { background: var(--gmc-gold); }
.error-code { color: var(--gmc-gold); font-size: clamp(4.8rem, 17vw, 9.5rem); font-weight: 950; letter-spacing: -.08em; line-height: .82; text-shadow: 8px 8px 0 rgba(0,0,0,.34); }

.portal-footer { position: relative; z-index: 1; padding: 1.2rem 0; color: #79847a; font-size: .74rem; font-weight: 800; border-top: 1px solid #283029; background: rgba(6,8,7,.76); }

/* Bootstrap helpers */
.text-secondary { color: var(--gmc-muted) !important; }
.text-warning { color: var(--gmc-gold-bright) !important; }
.badge.text-bg-secondary { color: #ecf0ec !important; background: #475149 !important; border-radius: 0; }
.badge.text-bg-info { color: #07131a !important; background: var(--gmc-water) !important; border-radius: 0; }

@media (max-width: 991.98px) {
  .auth-layout { grid-template-columns: 1fr; max-width: 600px; }
  .auth-world { min-height: 300px; padding: 2rem; }
  .auth-world h2 { max-width: 420px; font-size: clamp(2.3rem, 8vw, 3.8rem); }
  .auth-world-foot { display: none; }
  .auth-card { margin: -14px 16px 0; }
  .portal-main { padding-top: 2rem; }
}

@media (max-width: 767.98px) {
  .portal-main { padding-right: 1rem; padding-left: 1rem; }
  .page-heading { padding-left: .9rem; }
  .page-heading h1 { font-size: clamp(2rem, 10vw, 2.75rem); }
  .auth-world { min-height: 255px; }
  .auth-world p, .auth-feature-list { display: none; }
  .auth-card { margin-right: 8px; margin-left: 8px; padding: 1.45rem; }
  .metric-card { min-height: 135px; padding: 1.1rem; }
  .metric-card::before { width: 28px; height: 28px; top: 14px; right: 14px; }
  .chat-header { align-items: flex-start; flex-direction: column; }
  .message-list { min-height: 330px; height: 54vh; padding: .85rem; }
  .chat-message { max-width: 94%; }
  .message-meta { flex-direction: column; gap: .12rem; }
  .upload-item { grid-template-columns: 42px 1fr auto; }
  .upload-preview { width: 42px; height: 42px; }
  .ticket-meta span { display: grid; gap: .1rem; }
  .ticket-meta b { text-align: left; }
  .info-list div { display: grid; gap: .12rem; }
  .info-list dd { text-align: left; }
  .table-responsive.pixel-panel { clip-path: none; }
}

@media (max-width: 479.98px) {
  .auth-world { min-height: 220px; }
  .auth-world h2 { font-size: 2.15rem; }
  .page-heading h1 { font-size: 2.15rem; }
  .btn-lg { min-height: 48px; }
  .status-badge { white-space: normal; text-align: center; }
}

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

/* Локальные правки интерфейса v3 */
.portal-main { z-index: auto; }

/* Единая геометрия заголовков страниц */
.page-heading {
  width: 100%;
  min-width: 0;
  margin-bottom: 1.75rem;
}
.page-heading--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1.25rem;
}
.page-heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}

/* Защита от выхода длинного пользовательского текста за границы */
:where(h1, h2, h3, h4, h5, h6, p, a, button, label, dt, dd, td, th, span, strong, small) {
  overflow-wrap: anywhere;
}
.min-w-0 { min-width: 0 !important; }
.ticket-card,
.ticket-description,
.info-panel,
.filter-panel,
.form-panel,
.chat-message,
.modal-content,
.auth-card,
.empty-state { min-width: 0; }
.category-tag,
.status-badge,
.role-badge,
.btn { white-space: normal; }
.info-list dd,
.timeline li,
.message-text,
.ticket-excerpt { overflow-wrap: anywhere; word-break: break-word; }

/* Одинаковый начальный размер и автоматический рост всех textarea */
textarea.form-control {
  min-height: 144px;
  height: 144px;
  resize: none;
  overflow-y: hidden;
}
.form-textarea-lg { min-height: 144px; }

/* Упрощённые страницы входа и регистрации */
.auth-layout--single {
  width: min(100%, 560px);
  max-width: 560px;
  grid-template-columns: minmax(0, 1fr);
}
.auth-layout--single .auth-card {
  width: 100%;
  margin: 0;
  align-self: center;
}

/* Роли */
.role-badge {
  padding: .42rem .58rem;
  border: 1px solid transparent;
  border-radius: 0;
  font-weight: 900;
  letter-spacing: .015em;
}
.role-player {
  color: #f0f2f0;
  background: #555f58;
  border-color: #747f77;
}
.role-operator {
  color: #eaf6ff;
  background: #2468a2;
  border-color: #55a7e4;
}
.role-admin {
  color: #fff0f0;
  background: #a93232;
  border-color: #e36161;
}
.role-owner {
  color: #241700;
  background: linear-gradient(180deg, #ffdc69, #d99a19);
  border-color: #ffe89b;
  box-shadow: inset 0 -2px 0 #946008;
}
.role-text-player { color: #b9c0bb !important; }
.role-text-operator { color: #72bff2 !important; }
.role-text-admin { color: #ef7e7e !important; }
.role-text-owner { color: var(--gmc-gold-bright) !important; }

/* Модальные окна всегда выше backdrop и не наследуют stacking context страницы */
.modal { z-index: 1060; }
.modal-backdrop { z-index: 1050; }
.modal-dialog { pointer-events: auto; }

/* WebSocket-поиск в админ-панели */
.admin-results {
  position: relative;
  min-height: 5rem;
  transition: opacity .15s ease;
}
.admin-results[aria-busy="true"] { opacity: .58; pointer-events: none; }
.admin-search-state {
  min-height: 1.25rem;
  color: var(--gmc-muted);
  font-size: .78rem;
  font-weight: 700;
}
.admin-search-state.is-loading { color: var(--gmc-gold-bright); }
.admin-search-state.is-error { color: #ef8585; }
.admin-search-state.is-loading::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: .45rem;
  background: currentColor;
  animation: admin-search-pulse .8s steps(2, end) infinite;
}
@keyframes admin-search-pulse { 50% { opacity: .25; } }

/* Вложения без показа исходных имён */
.upload-meta { min-width: 0; }
.upload-kind { display: block; font-weight: 900; }
.upload-size { display: block; color: var(--gmc-muted); font-size: .76rem; }
.upload-preview--clickable { cursor: zoom-in; }
.upload-remove { width: 38px; min-width: 38px; padding-inline: .3rem; font-size: 1.2rem; }

.attachment-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.attachment-card {
  width: 100%;
  min-width: 0;
  padding: .5rem;
  border-radius: 0;
  cursor: default;
}
button.attachment-card {
  appearance: none;
  text-align: inherit;
}
.attachment-card--image { cursor: zoom-in; }
.attachment-card--video { grid-column: span 2; }
.attachment-card img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.attachment-card video {
  width: 100%;
  min-height: 260px;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #050706;
}

.message-attachments {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.message-attachment {
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  background: #080a08;
  border: 1px solid #657067;
  border-radius: 0;
}
button.message-attachment { appearance: none; cursor: zoom-in; }
.message-attachment--video { grid-column: 1 / -1; }
.message-attachments .message-attachment img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
}
.message-attachments .message-attachment video {
  display: block;
  width: 100%;
  min-height: 260px;
  max-height: min(70vh, 620px);
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #050706;
}

/* Полноэкранный предпросмотр изображений */
.image-lightbox[hidden] { display: none; }
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(0, 0, 0, .9);
  backdrop-filter: blur(8px);
}
.image-lightbox img {
  display: block;
  max-width: min(94vw, 1500px);
  max-height: 90vh;
  object-fit: contain;
  border: 2px solid #6a756c;
  box-shadow: 0 0 0 3px #080a08, 0 28px 80px rgba(0,0,0,.65);
}
.image-lightbox-close {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  z-index: 1;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  background: #171b18;
  border: 2px solid #737d75;
  box-shadow: 4px 4px 0 rgba(0,0,0,.45);
}
.image-lightbox-close:hover,
.image-lightbox-close:focus-visible { color: #221500; background: var(--gmc-gold); border-color: #ffe28a; }
body.lightbox-open { overflow: hidden; }

.local-time { white-space: nowrap; }

@media (max-width: 991.98px) {
  .page-heading--split { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .page-heading-actions { justify-content: flex-start; }
  .auth-layout--single { max-width: 560px; }
  .auth-layout--single .auth-card { margin: 0; }
}

@media (max-width: 767.98px) {
  .attachment-card--video { grid-column: 1 / -1; }
  .attachment-card video,
  .message-attachments .message-attachment video { min-height: 210px; }
  .local-time { white-space: normal; }
  .page-heading-actions { width: 100%; }
  .page-heading-actions > .btn,
  .page-heading-actions > form,
  .page-heading-actions > form .btn { width: 100%; }
  .load-card { width: 100%; }
}


/* Локальные правки интерфейса v4 */
.page-shell {
  width: 100%;
  min-width: 0;
}
.page-shell > .page-heading {
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.page-shell > .page-heading.page-heading--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}
.portal-content-grid > * { min-width: 0; }
.section-heading-row,
.ticket-card-head,
.card-actions,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  flex-wrap: wrap;
}
.card-actions,
.form-actions { justify-content: flex-end; margin-top: 1rem; }
.card-actions form { margin: 0; }

/* «Новое» — изумрудный статус, кнопка «Взять в работу» остаётся золотой. */
.status-new {
  color: #effff3;
  background: #2f8750;
  border-color: #68c985 #1d5933 #153f25 #68c985;
}

.ticket-heading-actions {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: .65rem;
}
.ticket-heading-action,
.ticket-heading-actions > form.ticket-heading-action,
.ticket-heading-actions > form.ticket-heading-action > .btn,
.ticket-heading-actions > .btn.ticket-heading-action {
  min-height: 44px;
  margin: 0;
}
.ticket-heading-actions > form.ticket-heading-action { display: flex; }
.ticket-heading-actions > form.ticket-heading-action > .btn,
.ticket-heading-actions > .btn.ticket-heading-action { display: inline-flex; align-items: center; justify-content: center; }
.ticket-status-slot { display: flex; align-items: stretch; }
.ticket-status-slot .status-badge {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: .9rem;
}
.escalation-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  border-color: #386e9a #203d56 #152a3b #6aa8d9;
}
.escalation-banner p { margin-top: .25rem; color: var(--gmc-muted); }

/* Кластер профиля и уведомлений в navbar */
.navbar-account-cluster,
.mobile-navbar-actions {
  display: flex;
  align-items: center;
  gap: .55rem;
}
.account-avatar,
.mobile-user-avatar,
.profile-avatar {
  object-fit: cover;
  background: #111612;
  border: 2px solid #59665c;
  image-rendering: auto;
}
.account-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}
.mobile-user-summary {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}
.mobile-user-summary > div { display: grid; gap: .28rem; min-width: 0; }
.mobile-user-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .98rem;
  text-transform: none;
  letter-spacing: 0;
}
.mobile-user-summary .role-text {
  width: fit-content;
  font-size: .72rem;
  font-weight: 900;
  text-transform: none;
  letter-spacing: 0;
}
.mobile-user-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}
.mobile-user-avatar--fallback,
.profile-avatar--fallback {
  display: grid;
  place-items: center;
  color: #211500;
  font-weight: 950;
  background: linear-gradient(180deg, var(--gmc-gold-bright), #ca8c13);
  border-color: #ffe69a #8b5a08 #714604 #ffe69a;
}

/* Уведомления */
.notification-dropdown { position: relative; }
.notification-bell {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #e7ece8;
  background: #151b17;
  border: 1px solid #465249;
  border-radius: 0;
  box-shadow: inset 0 -3px 0 #090c0a;
}
.notification-bell:hover,
.notification-bell:focus-visible,
.notification-bell.show { color: #201400; background: var(--gmc-gold); border-color: #ffe28a; }
.notification-bell-icon {
  position: relative;
  display: block;
  width: 17px;
  height: 15px;
  border: 2px solid currentColor;
  border-top-left-radius: 9px;
  border-top-right-radius: 9px;
  border-bottom: 0;
}
.notification-bell-icon::before {
  content: "";
  position: absolute;
  left: -4px;
  right: -4px;
  bottom: -4px;
  height: 3px;
  background: currentColor;
}
.notification-bell-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 5px;
  height: 3px;
  background: currentColor;
  transform: translateX(-50%);
}
.notification-count {
  position: absolute;
  top: -6px;
  right: -7px;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  color: #fff;
  font-size: .67rem;
  font-weight: 950;
  line-height: 1;
  background: #bd3535;
  border: 2px solid #111612;
  border-radius: 0;
  box-shadow: 2px 2px 0 #050706;
}
.notification-menu {
  width: min(390px, calc(100vw - 1.5rem));
  margin-top: .7rem !important;
  padding: 0;
  overflow: hidden;
  background: #101511;
  border: 2px solid #465249;
  box-shadow: 6px 6px 0 rgba(0,0,0,.45), 0 18px 44px rgba(0,0,0,.42);
}
.notification-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .9rem;
  background: #19201a;
  border-bottom: 1px solid #364138;
}
.notification-menu-head > div { display: grid; min-width: 0; }
.notification-menu-head strong { font-size: .93rem; }
.notification-menu-head small { color: var(--gmc-muted); font-size: .7rem; }
.push-toggle {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  flex: 0 0 auto;
  padding: .38rem .48rem;
  color: #b8c1ba;
  font-size: .69rem;
  font-weight: 900;
  background: #0e120f;
  border: 1px solid #475249;
}
.push-toggle-dot { width: 9px; height: 9px; background: #687169; box-shadow: inset 0 -2px 0 #313832; }
.push-toggle.is-enabled { color: #dffbe5; border-color: #438457; }
.push-toggle.is-enabled .push-toggle-dot { background: var(--gmc-emerald); }
.notification-menu-list { max-height: min(58vh, 470px); overflow-y: auto; overscroll-behavior: contain; }
.notification-menu-item,
.notification-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: .7rem;
  padding: .78rem .9rem;
  color: #e8ece9;
  text-decoration: none;
  background: #111612;
  border-bottom: 1px solid #2c352e;
}
.notification-menu-item:hover,
.notification-row:hover { color: #fff; background: #1a211b; }
.notification-menu-item.is-unread,
.notification-row.is-unread { background: #1d2118; }
.notification-marker {
  width: 8px;
  height: 8px;
  margin-top: .36rem;
  background: #536057;
  box-shadow: inset 0 -2px 0 #222a24;
}
.is-unread > .notification-marker { background: var(--gmc-gold); box-shadow: 0 0 10px rgba(242,182,50,.3); }
.notification-content { display: grid; gap: .16rem; }
.notification-content strong { color: #fff; font-size: .82rem; }
.notification-content > span { color: #b1bab3; font-size: .76rem; line-height: 1.35; }
.notification-content small { color: #778179; font-size: .68rem; }
.notification-empty { padding: 1.25rem; color: var(--gmc-muted); text-align: center; font-size: .8rem; }
.notification-all-link {
  display: block;
  padding: .8rem .9rem;
  color: var(--gmc-gold-bright);
  text-align: center;
  text-decoration: none;
  font-size: .78rem;
  font-weight: 900;
  background: #151b17;
  border-top: 1px solid #364138;
}
.notification-all-link:hover { color: #201400; background: var(--gmc-gold); }
.notification-page-panel { padding: 0; overflow: hidden; }
.notification-page-list .notification-row:last-child { border-bottom: 0; }
.notification-row { grid-template-columns: 12px minmax(0, 1fr); padding: 1rem 1.1rem; }
.notification-row .notification-content strong { font-size: .95rem; }
.notification-row .notification-content > span { font-size: .84rem; }

/* Профиль и аватар */
.profile-grid { display: grid; gap: 1.5rem; }
.profile-avatar-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1.5rem;
  padding: 1.4rem;
}
.profile-avatar-wrap { width: 152px; height: 152px; }
.profile-avatar {
  width: 152px;
  height: 152px;
  border-width: 3px;
  box-shadow: 5px 5px 0 rgba(0,0,0,.45), inset 0 0 0 2px #101510;
}
.profile-avatar--fallback { font-size: 3.5rem; }
.avatar-form { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-top: 1rem; }
.profile-metrics { margin: 0; }

@media (max-width: 991.98px) {
  .page-shell > .page-heading,
  .page-shell > .page-heading.page-heading--split { min-height: 0; }
  .page-shell > .page-heading.page-heading--split { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .ticket-heading-actions { justify-content: flex-start; }
}

@media (max-width: 767.98px) {
  /* Убираем старое растягивание всех кнопок; геометрия обращения управляется одной сеткой. */
  .ticket-heading-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .ticket-heading-actions > .ticket-heading-action,
  .ticket-heading-actions > form.ticket-heading-action,
  .ticket-heading-actions > form.ticket-heading-action > .btn,
  .ticket-heading-actions > .btn.ticket-heading-action,
  .ticket-status-slot .status-badge { width: 100%; }
  .escalation-banner { align-items: stretch; flex-direction: column; }
  .escalation-banner > .btn { width: 100%; }
  .profile-avatar-panel { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .profile-avatar-panel .eyebrow { justify-content: center; }
  .avatar-form { justify-content: center; }
  .section-heading-row { align-items: flex-start; }
  .notification-menu { position: fixed !important; top: 68px !important; right: .75rem !important; left: .75rem !important; width: auto; transform: none !important; }
}

@media (max-width: 479.98px) {
  .ticket-heading-actions { grid-template-columns: 1fr; }
  .mobile-navbar-actions { gap: .35rem; }
  .notification-bell { width: 44px; height: 44px; }
  .pixel-toggler { width: 44px; height: 44px; }
  .profile-avatar-wrap,
  .profile-avatar { width: 128px; height: 128px; }
}
.ticket-status-slot { min-width: 118px; }
.ticket-status-slot .status-badge { width: 100%; }

/* Локальные правки интерфейса v5 */
body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.portal-navbar { flex: 0 0 auto; }
.portal-main {
  width: 100%;
  flex: 1 0 auto;
}
.portal-main--guest { min-height: 0; }
.portal-footer { margin-top: auto; flex: 0 0 auto; }

/* Единая геометрия страниц и списков обращений */
.page-shell {
  width: 100%;
  min-width: 0;
}
.page-shell > .page-heading,
.page-shell > .page-heading.page-heading--split {
  min-height: 126px;
  margin: 0 0 1.75rem;
}
.ticket-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  width: 100%;
  min-width: 0;
}
.ticket-grid--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ticket-grid > .ticket-card { width: 100%; min-width: 0; }
.ticket-grid-full { grid-column: 1 / -1; width: 100%; }
.admin-content-stack { display: grid; gap: 1.5rem; width: 100%; min-width: 0; }
.admin-content-stack > .admin-tabs,
.admin-content-stack > .pagination { margin-top: 0 !important; margin-bottom: 0 !important; }
.admin-content-stack > nav { margin: 0 !important; }

/* Заголовок обращения: статус и действия всегда находятся на одной линии. */
.ticket-heading-actions { align-items: center; }
.ticket-heading-action,
.ticket-heading-actions > form.ticket-heading-action,
.ticket-heading-actions > form.ticket-heading-action > .btn,
.ticket-heading-actions > .btn.ticket-heading-action,
.ticket-status-slot,
.ticket-status-slot .status-badge {
  height: 46px;
  min-height: 46px;
}
.ticket-heading-actions > form.ticket-heading-action > .btn,
.ticket-heading-actions > .btn.ticket-heading-action,
.ticket-status-slot .status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ticket-status-slot .status-badge { padding-block: 0; }
.queue-ticket-flags {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: end;
  gap: .45rem;
}
.admin-only-badge {
  color: #eaf6ff;
  background: #225f92;
  border: 1px solid #5ca6df;
  border-radius: 0;
  font-weight: 900;
}

/* Центр оценки обращения */
.rating-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1.2rem 1.3rem;
  border-color: #8e6b23 #5b4314 #3f2d0a #c99a35;
}
.rating-form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}
.rating-fieldset { margin: 0; padding: 0; border: 0; }
.rating-stars {
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: .18rem;
  padding: .3rem .45rem;
  background: #0d110e;
  border: 1px solid #4b554d;
}
.rating-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.rating-star {
  cursor: pointer;
  color: #596159;
  font-size: 1.8rem;
  line-height: 1;
  text-shadow: 2px 2px 0 #050706;
  transition: color .12s ease, transform .12s ease;
}
.rating-star:hover,
.rating-star:hover ~ .rating-star,
.rating-input:checked + .rating-star,
.rating-input:checked + .rating-star ~ .rating-star { color: var(--gmc-gold-bright); }
.rating-input:focus-visible + .rating-star { outline: 2px solid var(--gmc-gold-bright); outline-offset: 3px; }
.rating-star:hover { transform: translateY(-2px); }
.rating-result {
  display: flex;
  align-items: baseline;
  gap: .3rem;
  min-width: 112px;
  justify-content: center;
  padding: .75rem 1rem;
  color: #241700;
  background: linear-gradient(180deg, #ffe17b, #d99a19);
  border: 2px solid #ffecad #9c670c #7b4d07 #ffecad;
  box-shadow: inset 0 -4px 0 rgba(108,65,0,.28), 4px 4px 0 rgba(0,0,0,.32);
}
.rating-result strong { font-size: 1.6rem; font-weight: 950; }
.rating-result span { font-size: .8rem; font-weight: 900; }
.rating-score-inline,
.operator-rating-value { color: var(--gmc-gold-bright); }
.rating-count { color: var(--gmc-muted); white-space: nowrap; }

/* Подвал */
.portal-footer { padding: 1.1rem 0; }
.portal-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}
.portal-footer-brand { color: #8e998f; }
.portal-footer-links { display: flex; align-items: center; justify-content: flex-end; gap: .6rem 1.2rem; flex-wrap: wrap; }
.portal-footer-links a {
  color: #aeb7b0;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.portal-footer-links a:hover,
.portal-footer-links a:focus-visible { color: var(--gmc-gold-bright); border-bottom-color: currentColor; }

/* Колокольчик совпадает по высоте с блоком аккаунта на desktop. */
@media (min-width: 992px) {
  .navbar-account-cluster .notification-bell,
  .navbar-account-cluster .account-button {
    height: 52px;
    min-height: 52px;
  }
}

/* Политика конфиденциальности */
.legal-grid {
  display: grid;
  grid-template-columns: minmax(240px, .72fr) minmax(0, 2fr);
  align-items: start;
  gap: 1.5rem;
}
.legal-summary { position: sticky; top: 104px; padding: 1.25rem; }
.legal-summary ul { display: grid; gap: .7rem; margin: 1rem 0 0; padding-left: 1.2rem; color: #c9d0ca; }
.legal-content { padding: clamp(1.25rem, 3vw, 2rem); }
.legal-content section + section { margin-top: 1.75rem; padding-top: 1.75rem; border-top: 1px solid #3a443c; }
.legal-content h2 { margin-bottom: .7rem; color: #fff; font-size: 1.15rem; }
.legal-content p { margin: 0; color: #c1c9c2; }

/* Статистика техподдержки */
.statistics-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.statistics-metric { min-width: 0; }
.statistics-metric small { display: block; margin-top: .35rem; color: var(--gmc-muted); font-size: .76rem; font-weight: 800; }
.statistics-duration { font-size: clamp(1.3rem, 3vw, 2.05rem) !important; line-height: 1.1; }
.leaderboard-panel { margin-top: 1.5rem; padding: 1.3rem; }
.leaderboard-heading { padding-bottom: 1rem; border-bottom: 1px solid #3d483f; }
.leaderboard-list { display: grid; }
.leaderboard-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  padding: 1rem .25rem;
  border-bottom: 1px solid #323b34;
}
.leaderboard-row:last-child { border-bottom: 0; }
.leaderboard-position { color: var(--gmc-gold-bright); font-weight: 950; font-size: 1rem; }
.leaderboard-user { display: flex; align-items: center; gap: .8rem; }
.leaderboard-user > div { display: grid; min-width: 0; }
.leaderboard-user strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-user span { color: var(--gmc-muted); font-size: .72rem; font-weight: 800; }
.leaderboard-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  object-fit: cover;
  color: #231600;
  font-weight: 950;
  background: var(--gmc-gold);
  border: 2px solid #6b755e;
}
.leaderboard-rating { display: flex; align-items: baseline; gap: .3rem; text-align: right; white-space: nowrap; }
.leaderboard-rating strong { color: var(--gmc-gold-bright); font-size: 1.25rem; }
.leaderboard-rating span { color: var(--gmc-muted); font-size: .72rem; }
.leaderboard-empty { padding: 2rem 1rem; }

@media (max-width: 991.98px) {
  .page-shell > .page-heading,
  .page-shell > .page-heading.page-heading--split { min-height: 0; }
  .ticket-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ticket-grid--wide { grid-template-columns: minmax(0, 1fr); }
  .rating-panel { grid-template-columns: minmax(0, 1fr); }
  .rating-form { justify-content: flex-start; }
  .legal-grid { grid-template-columns: minmax(0, 1fr); }
  .legal-summary { position: static; }
  .statistics-metrics { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767.98px) {
  .ticket-grid { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .portal-footer-inner { align-items: flex-start; flex-direction: column; }
  .portal-footer-links { justify-content: flex-start; }
  .rating-form { align-items: stretch; flex-direction: column; }
  .rating-stars { justify-content: center; align-self: stretch; }
  .rating-form .btn { width: 100%; }
  .leaderboard-row { grid-template-columns: 42px minmax(0, 1fr); }
  .leaderboard-rating { grid-column: 2; justify-content: flex-start; text-align: left; }
}

/* Финальная нормализация геометрии v5 */
/* Заголовок и содержимое используют одну левую ось; золотая направляющая вынесена в поле контейнера. */
.page-shell > .page-heading,
.page-shell > .page-heading.page-heading--split {
  padding-left: 0;
}
.page-shell > .page-heading::before {
  left: -1rem;
}
.page-shell > [data-live-ticket-list],
.page-shell > .admin-content-stack,
.page-shell > .filter-panel,
.page-shell > .form-panel,
.page-shell > .profile-grid,
.page-shell > .legal-grid,
.page-shell > .statistics-metrics,
.page-shell > .leaderboard-panel,
.page-shell > .portal-content-grid {
  width: 100%;
  min-width: 0;
  margin-left: 0;
  margin-right: 0;
}

/* Bootstrap row на странице обращения раньше давал отрицательный gutter и визуальный сдвиг. */
.portal-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 1.5rem;
  margin: 0 !important;
}
.portal-content-grid > [class*="col-"] {
  width: auto;
  max-width: none;
  padding: 0;
}

/* Метрики личного кабинета без отрицательных Bootstrap-отступов. */
.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  width: 100%;
}

.ticket-heading-actions {
  align-self: end;
  min-height: 46px;
}
.ticket-status-slot .status-badge,
.ticket-heading-actions .btn {
  margin: 0;
  line-height: 1.1;
}

/* Журнал ролей и архив получают ту же вертикальную сетку, что и остальные разделы. */
@media (min-width: 992px) {
  .navbar-account-cluster .notification-bell {
    width: 52px;
    min-width: 52px;
  }
}

@media (max-width: 1199.98px) {
  .portal-content-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767.98px) {
  .page-shell > .page-heading::before { left: -.65rem; }
  .dashboard-metrics { grid-template-columns: minmax(0, 1fr); }
}

/* Локальные правки интерфейса v6 */
/*
 * Короткие страницы (Архив, Журнал ролей и пустые списки) раньше могли не иметь
 * вертикальной полосы прокрутки. Из-за изменения доступной ширины viewport
 * центрированные .container-xl визуально сдвигались вместе с логотипом и заголовком.
 * Стабильный gutter сохраняет одну горизонтальную ось на всём портале.
 */
html { scrollbar-gutter: stable; }
@supports not (scrollbar-gutter: stable) {
  html { overflow-y: scroll; }
}

/* Архив и Журнал ролей больше не используют промежуточные layout-обёртки. */
.page-shell > .admin-static-pagination { width: 100%; min-width: 0; }
.page-shell > .admin-static-pagination > nav { margin: 0 !important; }
.page-shell > .admin-static-pagination .pagination { margin-top: 1.5rem !important; margin-bottom: 0 !important; }

/* Мобильная админ-панель: широкая desktop-таблица превращается в читаемые карточки. */
@media (max-width: 767.98px) {
  .admin-table-responsive {
    overflow: visible;
    padding: 0 !important;
    background: transparent;
    border: 0;
    box-shadow: none;
    clip-path: none;
  }

  .admin-mobile-table,
  .admin-mobile-table tbody,
  .admin-mobile-table tr,
  .admin-mobile-table td {
    display: block;
    width: 100%;
  }

  .admin-mobile-table { margin: 0; border: 0; }
  .admin-mobile-table thead { display: none; }

  .admin-mobile-table tbody {
    display: grid;
    gap: 1rem;
  }

  .admin-mobile-table tbody tr:not(.admin-table-empty-row) {
    overflow: hidden;
    background:
      linear-gradient(135deg, rgba(255,255,255,.022) 25%, transparent 25%) 0 0 / 16px 16px,
      linear-gradient(180deg, rgba(31, 38, 33, .99), rgba(17, 22, 18, .99));
    border: 2px solid #465148;
    box-shadow:
      inset 0 2px 0 rgba(255,255,255,.05),
      inset 0 -4px 0 rgba(0,0,0,.32),
      0 0 0 2px #090c0a,
      0 8px 0 rgba(0,0,0,.13);
  }

  .admin-mobile-table tbody tr:not(.admin-table-empty-row):hover {
    --bs-table-accent-bg: transparent;
  }

  .admin-mobile-table tbody tr:not(.admin-table-empty-row) > td {
    display: grid;
    grid-template-columns: minmax(104px, .75fr) minmax(0, 1.25fr);
    align-items: center;
    gap: .75rem;
    min-width: 0;
    padding: .72rem .85rem;
    text-align: left !important;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #353f37;
  }

  .admin-mobile-table tbody tr:not(.admin-table-empty-row) > td:last-child {
    border-bottom: 0;
  }

  .admin-mobile-table tbody tr:not(.admin-table-empty-row) > td::before {
    content: attr(data-label);
    min-width: 0;
    color: #98a49b;
    font-size: .68rem;
    font-weight: 950;
    letter-spacing: .06em;
    line-height: 1.2;
    text-transform: uppercase;
    overflow-wrap: anywhere;
  }

  .admin-mobile-table td > :where(strong, span, small, button, a) { min-width: 0; }
  .admin-mobile-table .role-badge { width: fit-content; max-width: 100%; }
  .admin-mobile-table .rating-count { white-space: normal; }
  .admin-mobile-table .admin-table-actions .btn { width: 100%; }

  .admin-mobile-table .admin-table-empty-row {
    display: block;
    background: #151a16;
    border: 2px solid #465148;
    box-shadow: 0 0 0 2px #090c0a;
  }
  .admin-mobile-table .admin-table-empty {
    display: block;
    padding: 2rem 1rem !important;
    text-align: center !important;
    border: 0;
  }
  .admin-mobile-table .admin-table-empty::before { display: none; content: none; }

  /* Вкладки не ломают ширину админ-панели на узких телефонах. */
  .admin-tabs {
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
  }
  .admin-tabs .nav-item { flex: 0 0 auto; }
  .admin-tabs .nav-link { white-space: nowrap; }
}

/* Колокольчик и гамбургер имеют один и тот же внешний квадрат на всех телефонах. */
@media (max-width: 991.98px) {
  .mobile-navbar-actions {
    --mobile-navbar-control-size: 44px;
    align-items: center;
  }
  .mobile-navbar-actions > .notification-dropdown {
    width: var(--mobile-navbar-control-size);
    height: var(--mobile-navbar-control-size);
    flex: 0 0 var(--mobile-navbar-control-size);
  }
  .mobile-navbar-actions .notification-bell,
  .mobile-navbar-actions .pixel-toggler {
    box-sizing: border-box;
    width: var(--mobile-navbar-control-size);
    min-width: var(--mobile-navbar-control-size);
    height: var(--mobile-navbar-control-size);
    min-height: var(--mobile-navbar-control-size);
    margin: 0;
    border-width: 1px;
    border-radius: 0;
  }
  .mobile-navbar-actions .notification-bell { padding: 0; }
  .mobile-navbar-actions .pixel-toggler {
    place-content: center;
    padding: 9px;
  }
  .mobile-navbar-actions .pixel-toggler span { width: 24px; }
}

@media (max-width: 479.98px) {
  /* Перекрываем старые v4-значения 40/42 px: оба элемента остаются 44 × 44. */
  .mobile-navbar-actions .notification-bell,
  .mobile-navbar-actions .pixel-toggler {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }
}

@media (max-width: 767.98px) {
  .admin-mobile-table .admin-cell-value {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .3rem;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .admin-mobile-table .admin-table-actions .admin-cell-value { width: 100%; }
}

/* Локальные правки интерфейса v7 */
/* Единая система аватаров: пользовательский файл и fallback имеют одну геометрию во всех местах. */
.portal-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  aspect-ratio: 1;
  max-width: 100%;
  object-fit: cover;
  overflow: hidden;
  color: #211604;
  font-weight: 950;
  line-height: 1;
  background:
    linear-gradient(135deg, rgba(255,255,255,.25) 0 18%, transparent 18% 100%),
    linear-gradient(180deg, #ffd86a, #d89213);
  border: 2px solid #ffe38a;
  border-radius: 0;
  box-shadow: inset 0 -4px 0 #9d6309, 0 0 0 1px #191007;
  image-rendering: auto;
}
.portal-avatar--fallback { text-transform: uppercase; text-shadow: 0 1px 0 rgba(255,255,255,.22); }
.portal-avatar--xs { width: 34px; height: 34px; font-size: .85rem; }
.portal-avatar--sm { width: 42px; height: 42px; font-size: 1rem; }
.portal-avatar--md { width: 48px; height: 48px; font-size: 1.1rem; }
.portal-avatar--chat { width: 30px; height: 30px; font-size: .72rem; border-width: 1px; box-shadow: inset 0 -3px 0 #9d6309, 0 0 0 1px #191007; }
.portal-avatar--xl { width: 152px; height: 152px; font-size: 3.5rem; }
.account-avatar,
.mobile-user-avatar,
.profile-avatar,
.leaderboard-avatar { border-radius: 0; }

/* Пиксельные монохромные SVG-иконки навигации вместо системных emoji. */
.nav-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  color: currentColor;
  overflow: visible;
}
.portal-nav .nav-link .nav-icon { opacity: .74; }
.portal-nav .nav-link.active .nav-icon { opacity: 1; }
.mobile-nav-link,
.nav-dropdown-link,
.mobile-logout-button,
.portal-footer-links a {
  display: flex;
  align-items: center;
}
.mobile-nav-link { gap: .72rem; }
.mobile-nav-link .nav-icon { width: 19px; height: 19px; flex-basis: 19px; color: var(--gmc-gold-bright); }
.mobile-nav-link.active .nav-icon { color: currentColor; }
.nav-dropdown-link { gap: .62rem; }
.nav-dropdown-link .nav-icon { width: 16px; height: 16px; }
.mobile-logout-button { justify-content: center; gap: .6rem; }
.portal-footer-links a { gap: .4rem; }
.portal-footer-links .nav-icon { width: 15px; height: 15px; }

/* Аватар автора находится непосредственно слева от никнейма в каждом сообщении. */
.message-meta { align-items: center; min-width: 0; }
.message-author {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
}
.message-author strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.message-avatar { flex: 0 0 30px; }
.system-message .message-avatar { filter: saturate(.7); }

/* Кнопка Push остаётся визуально понятной, даже если VAPID ещё не настроен. */
.push-toggle:disabled { opacity: .55; cursor: not-allowed; }

@media (max-width: 767.98px) {
  .portal-avatar--xl { width: 128px; height: 128px; font-size: 3rem; }
  .message-meta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .4rem .8rem;
  }
}
.notification-all-link { align-items: center; justify-content: center; gap: .45rem; }
.notification-all-link .nav-icon { width: 15px; height: 15px; }

/* Локальные правки интерфейса v8 */
/* Мобильная навигация: пиктограмма и подпись воспринимаются как единый центрированный блок. */
@media (max-width: 991.98px) {
  .portal-offcanvas .mobile-nav-link {
    justify-content: center;
    text-align: center;
  }
  .portal-offcanvas .mobile-nav-link > span {
    min-width: 0;
    text-align: center;
  }

  /* Колокольчик и гамбургер используют одну и ту же геометрию вплоть до border-box. */
  .mobile-navbar-actions {
    --mobile-navbar-control-size: 44px;
    gap: .4rem;
  }
  .mobile-navbar-actions > .notification-dropdown,
  .mobile-navbar-actions .notification-bell,
  .mobile-navbar-actions .pixel-toggler {
    box-sizing: border-box !important;
    width: var(--mobile-navbar-control-size) !important;
    min-width: var(--mobile-navbar-control-size) !important;
    max-width: var(--mobile-navbar-control-size) !important;
    height: var(--mobile-navbar-control-size) !important;
    min-height: var(--mobile-navbar-control-size) !important;
    max-height: var(--mobile-navbar-control-size) !important;
    margin: 0 !important;
  }
  .mobile-navbar-actions .notification-bell,
  .mobile-navbar-actions .pixel-toggler {
    padding: 0 !important;
    border: 1px solid #4a574c !important;
    border-radius: 0 !important;
    line-height: 1 !important;
    box-shadow: inset 0 -3px 0 #090c0a;
  }
  .mobile-navbar-actions .pixel-toggler {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
  }
  .mobile-navbar-actions .pixel-toggler span {
    width: 24px;
    height: 3px;
    margin: 0;
  }
}

/* Аватары не имеют декоративной окантовки: изображение и fallback занимают ровно свой квадрат. */
.portal-avatar,
.account-avatar,
.mobile-user-avatar,
.profile-avatar,
.leaderboard-avatar,
.message-avatar {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

/* Bootstrap сам добавляет padding при открытии modal. При зарезервированном scrollbar-gutter
   это приводит к лишнему горизонтальному смещению, поэтому компенсацию отключаем. */
html.portal-modal-opening,
html.portal-modal-visible {
  scrollbar-gutter: stable;
}
body.modal-open {
  padding-right: 0 !important;
}
body.modal-open .portal-navbar.sticky-top {
  padding-right: 0 !important;
  margin-right: 0 !important;
}
html.portal-modal-opening body,
html.portal-modal-visible body {
  padding-right: 0 !important;
}
html.portal-modal-opening .portal-navbar.sticky-top,
html.portal-modal-visible .portal-navbar.sticky-top {
  padding-right: 0 !important;
  margin-right: 0 !important;
}

/* === GupperMC v9: очередь, заявки сотрудников и финальная геометрия === */

/* Пиксельный колокольчик визуально центрируется по той же оси, что линии гамбургера. */
.notification-bell-icon { transform: translateY(-2px); }

/* Кнопка подключения — отдельная Minecraft-кнопка, а не стандартный Bootstrap primary. */
.btn-minecraft-connect {
  color: #ecfff2;
  background:
    linear-gradient(180deg, rgba(255,255,255,.09), transparent 42%),
    linear-gradient(180deg, #3d8e57, #27673e);
  border-color: #7ecf91 #1f5634 #173f27 #90dfa0;
  border-radius: 0;
  box-shadow: inset 0 -4px 0 rgba(10,54,27,.55), 4px 4px 0 rgba(0,0,0,.3);
  text-shadow: 2px 2px 0 rgba(0,0,0,.25);
}
.btn-minecraft-connect:hover,
.btn-minecraft-connect:focus-visible {
  color: #fff;
  background: linear-gradient(180deg, #50aa69, #2f7b49);
  border-color: #a6ecb4 #28643d #1c4b2e #b8f6c2;
}
.ticket-card--invited { border-color: #397850; box-shadow: inset 0 2px 0 rgba(120,224,150,.08), inset 0 -5px 0 rgba(0,0,0,.38), 0 0 0 2px #090c0a, 0 11px 0 rgba(0,0,0,.16), 0 20px 45px rgba(0,0,0,.24); }
.invited-badge { color: #effff3; background: #327649; border: 2px solid #74c98a; border-radius: 0; font-weight: 950; letter-spacing: .04em; text-transform: uppercase; }

/* Подсказка клавиатуры в composer. */
.message-keyboard-hint {
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .55rem;
  color: #8f9a91;
  font-size: .72rem;
}
.keycap {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: .1rem .42rem;
  color: #e7ece8;
  font-size: .68rem;
  font-weight: 900;
  background: #151b17;
  border: 1px solid #4a564c;
  box-shadow: inset 0 -2px 0 #080b09;
}
.hint-separator { margin-inline: .15rem; color: #5f6a61; }

/* Кнопка набора в desktop-навигации. */
.portal-nav .nav-item--recruit { margin-left: .25rem; }
.portal-nav .recruit-nav-link {
  color: #1f1502;
  background: linear-gradient(180deg, #ffe187, #dca01f);
  border-color: #ffeaa5 #a86e0b #855205 #fff0b4;
  box-shadow: inset 0 -3px 0 rgba(129,78,4,.42), 3px 3px 0 rgba(0,0,0,.28);
}
.portal-nav .recruit-nav-link:hover,
.portal-nav .recruit-nav-link:focus-visible,
.portal-nav .recruit-nav-link.active { color: #120c00; background: linear-gradient(180deg, #ffedab, #edb437); border-color: #fff4c4 #b97a0d #956009 #fff4c4; }

.mobile-offcanvas-head-actions { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
.mobile-recruit-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  color: #241701;
  background: linear-gradient(180deg, #ffe187, #d99b1a);
  border: 2px solid;
  border-color: #ffefad #a76b09 #7f4d05 #ffefad;
  text-decoration: none;
  box-shadow: inset 0 -4px 0 rgba(125,72,0,.35), 3px 3px 0 rgba(0,0,0,.28);
}
.mobile-recruit-button .nav-icon { width: 20px; height: 20px; }
.mobile-recruit-button:hover,
.mobile-recruit-button:focus-visible { color: #160e00; filter: brightness(1.08); }

/* Выбор должности. */
.position-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.35rem; }
.position-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  min-height: 190px;
  padding: 1.35rem;
  color: var(--gmc-text);
  text-decoration: none;
  transition: transform .14s ease, border-color .14s ease, filter .14s ease;
}
.position-card:hover,
.position-card:focus-visible { color: #fff; transform: translateY(-4px); border-color: #9e7b29; filter: brightness(1.06); }
.position-card h2 { margin: .25rem 0 .55rem; font-size: 1.35rem; font-weight: 950; }
.position-card p { margin: 0; color: var(--gmc-muted); line-height: 1.55; }
.position-card-icon { display: grid; place-items: center; width: 52px; height: 52px; color: #241701; background: var(--gmc-gold); box-shadow: inset 0 -5px 0 #a86d0a; }
.position-card-icon .nav-icon { width: 27px; height: 27px; }
.position-card-arrow { color: var(--gmc-gold-bright); font-size: 1.8rem; font-weight: 950; }

/* Анкета. */
.application-form-panel { padding: clamp(1rem, 3vw, 1.6rem); }
.application-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.application-question-block { margin-bottom: 1rem; }
.application-warning { width: fit-content; margin: -.2rem 0 .55rem; padding: .35rem .55rem; color: #271901; font-size: .73rem; font-weight: 950; background: #e8b944; border: 1px solid #ffe18c; box-shadow: 2px 2px 0 rgba(0,0,0,.22); }
.rules-link { color: var(--gmc-gold-bright); text-decoration: underline; text-underline-offset: 3px; }
.rules-link:hover { color: #fff0b5; }
.application-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .7rem; border-top: 1px solid #39433b; }

/* Списки и статусы заявок. */
.application-list { display: grid; gap: 1rem; }
.application-list-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1.15rem 1.25rem;
  color: var(--gmc-text);
  text-decoration: none;
}
.application-list-card:hover,
.application-list-card:focus-visible { color: #fff; border-color: #756428; filter: brightness(1.05); }
.application-list-card h2 { margin: .28rem 0 .3rem; font-size: 1.15rem; font-weight: 950; }
.application-list-card p { margin: 0; color: var(--gmc-muted); }
.application-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: .5rem .72rem;
  border: 2px solid;
  font-size: .7rem;
  font-weight: 950;
  letter-spacing: .055em;
  text-align: center;
  text-transform: uppercase;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.22);
}
.application-status--pending { color: #231701; background: #eab945; border-color: #ffe18b #9d670c #7b4f07 #ffe18b; }
.application-status--approved { color: #effff2; background: #367a49; border-color: #78ca8b #225632 #183f25 #78ca8b; }
.application-status--rejected { color: #fff0f0; background: #9a3d3d; border-color: #e47777 #672727 #4f1e1e #e47777; }
.cooldown-chip { display: inline-flex; align-items: center; min-height: 44px; padding: .55rem .8rem; color: #dfd5b8; background: #1d1c16; border: 1px solid #66572a; font-weight: 800; }

.application-answer-panel { padding: 1.35rem; }
.application-answer-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; margin: 0; }
.application-answer-list > div { min-width: 0; padding: .9rem; background: rgba(8,11,9,.42); border: 1px solid #3a463c; }
.application-answer-list .application-answer-long { grid-column: 1 / -1; }
.application-answer-list dt { margin-bottom: .38rem; color: #9ba69d; font-size: .72rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.application-answer-list dd { margin: 0; overflow-wrap: anywhere; color: #eef1ee; }
.application-answer-list a { color: var(--gmc-gold-bright); }
.application-decision { padding: 1rem 1.2rem; }
.application-decision--approved { border-color: #3c7950; }
.application-decision--rejected { border-color: #7c4141; }
.application-reason { overflow-wrap: anywhere; }
.application-review-panel form + .btn { margin-top: .5rem; }

/* Архив заявок. */
.archive-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem 1.5rem; margin-bottom: 1.75rem; padding: 1rem 1.1rem; }
.archive-filter-group { display: grid; gap: .45rem; }
.archive-filter-label { color: #9ca69e; font-size: .7rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.archive-filter-buttons { display: flex; flex-wrap: wrap; gap: .45rem; }
.archive-section > .section-heading-row { margin-bottom: 1rem; }

/* Кураторство в админ-панели. */
.admin-role-stack { display: flex; flex-direction: column; align-items: flex-start; gap: .32rem; }
.curator-chip { display: inline-flex; width: fit-content; padding: .22rem .38rem; color: #dcd4b9; background: #272317; border: 1px solid #6d5c29; font-size: .64rem; font-weight: 800; }
.curator-controls { padding: 1rem 1rem 1.15rem; border-top: 2px solid #384239; background: rgba(9,12,10,.35); }
.curator-controls[hidden] { display: none !important; }
.curator-controls-head { margin-bottom: .8rem; }
.curator-control-form + .curator-control-form { margin-top: .55rem; }

@media (max-width: 1199.98px) {
  .position-grid { grid-template-columns: minmax(0, 1fr); }
  .position-card { min-height: 0; }
}

@media (max-width: 767.98px) {
  .application-form-grid,
  .application-answer-list { grid-template-columns: minmax(0, 1fr); }
  .application-answer-list .application-answer-long { grid-column: auto; }
  .application-submit-row { align-items: stretch; flex-direction: column; }
  .application-submit-row .btn { width: 100%; }
  .application-list-card { grid-template-columns: minmax(0, 1fr); }
  .application-status { width: 100%; }
  .position-card { grid-template-columns: 44px minmax(0, 1fr); }
  .position-card-icon { width: 44px; height: 44px; }
  .position-card-arrow { display: none; }
  .archive-filter { align-items: stretch; flex-direction: column; }
  .archive-filter-buttons .btn { flex: 1 1 auto; }
}

/* === GupperMC v9.1: точное выравнивание navbar и заголовка очереди === */
/* У псевдоэлементов колокольчика есть язычок ниже собственного box. Центрируем
   всю видимую фигуру, а не только базовый прямоугольник. */
.notification-bell-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateY(-5px);
}

/* В offcanvas кнопка набора остаётся справа от профиля и имеет подпись,
   но на очень узком экране компактно сворачивается до пиктограммы. */
.mobile-recruit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  width: auto;
  min-width: 42px;
  padding: 0 .65rem;
  white-space: nowrap;
  font-size: .72rem;
  font-weight: 950;
}
.mobile-recruit-button span { line-height: 1; }
@media (max-width: 419.98px) {
  .mobile-recruit-button {
    width: 42px;
    max-width: 42px;
    padding: 0;
  }
  .mobile-recruit-button span { display: none; }
}

.application-card-decision {
  display: grid;
  justify-items: end;
  gap: .4rem;
  max-width: min(360px, 42vw);
  text-align: right;
}
.application-card-decision small { color: #aeb7b0; }
.application-card-decision p {
  margin: 0;
  color: #d5bcbc;
  font-size: .75rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
@media (max-width: 767.98px) {
  .application-card-decision {
    justify-items: stretch;
    width: 100%;
    max-width: none;
    text-align: left;
  }
}


/* === GupperMC v9.2: финальное выравнивание очереди и мобильных контролов === */
/* /staff/queue намеренно использует тот же page-heading--split, что и остальные страницы. */
@media (min-width: 992px) {
  .page-shell > .page-heading.page-heading--split {
    align-items: end;
    align-content: end;
  }
}
/* Визуальный центр колокольчика учитывает нижний пиксельный язычок. */
.notification-bell-icon {
  transform: translate(-50%, -50%) translateY(-5px);
}

/* === GupperMC v10: производительность и локальные правки === */
/* Ответ «Да / Нет» в анкете остаётся именно checkbox-полями, но визуально
   соответствует Minecraft-интерфейсу и не превращается в обычный список. */
.application-checkbox-choices {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: .75rem;
}
.application-checkbox-choice {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-width: 116px;
  min-height: 46px;
  padding: .65rem .85rem;
  color: var(--gmc-text);
  background: #141a16;
  border: 2px solid #465148;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.35), 3px 3px 0 rgba(0,0,0,.2);
  cursor: pointer;
}
.application-checkbox-choice:has(.form-check-input:checked) {
  color: #1f1502;
  background: linear-gradient(180deg, #ffe187, #dca01f);
  border-color: #ffec9e #a86e0b #855205 #ffefb0;
}
.application-checkbox-choice .form-check-input {
  width: 20px;
  height: 20px;
  margin: 0;
  border-radius: 0;
  flex: 0 0 20px;
}
.application-checkbox-choices.is-invalid { border-left: 4px solid #dc4c4c; padding-left: .7rem; }

/* В мобильном профиле кнопка набора всегда содержит понятный текст — даже
   на узком экране; при нехватке места подпись переносится, а не исчезает. */
.mobile-recruit-button {
  min-height: 42px;
  max-width: 168px;
  height: auto;
  white-space: normal;
  text-align: center;
  line-height: 1.05;
}
.mobile-recruit-button span { display: inline !important; line-height: 1.05; }
@media (max-width: 419.98px) {
  .mobile-recruit-button {
    width: auto;
    max-width: 142px;
    padding: .4rem .5rem;
  }
}


/* === GupperMC v12: /staff/queue использует ровно ту же геометрию заголовка === */
/*
 * Ранее у очереди была собственная фиксированная высота описания. Она поднимала
 * eyebrow/h1 и визуально отделяла описание от заголовка. Специальная геометрия
 * удалена: page-heading--split снова полностью наследует общий ритм страниц.
 */


/* v13 RC9: Web Push / PWA diagnostics */
.push-diagnostics-panel { margin-bottom: 1rem; padding: 1.1rem; }
.push-diagnostics-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.push-diagnostics-head h2 { margin: .15rem 0 .35rem; font-size: 1.2rem; }
.push-diagnostics-head p { margin: 0; color: var(--gmc-muted); max-width: 760px; }
.push-diagnostics-actions { display: flex; flex-wrap: wrap; gap: .55rem; justify-content: flex-end; }
.push-diagnostics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.push-diagnostics-grid > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-width: 0; padding: .7rem .8rem; background: rgba(10, 14, 11, .55); border: 1px solid rgba(126, 143, 130, .26); }
.push-diagnostics-grid span { color: var(--gmc-muted); font-size: .78rem; }
.push-diagnostics-grid strong { text-align: right; overflow-wrap: anywhere; font-size: .82rem; }
.push-diagnostics-grid strong.is-ok { color: #a9efb9; }
.push-diagnostics-grid strong.is-bad { color: #ffb1a8; }
.push-diagnostics-note { margin-top: .8rem; padding: .75rem .85rem; border-left: 3px solid var(--gmc-gold); background: rgba(223, 179, 65, .07); color: #d8ded9; font-size: .82rem; }
@media (max-width: 767.98px) {
  .push-diagnostics-head { flex-direction: column; }
  .push-diagnostics-actions { width: 100%; justify-content: stretch; }
  .push-diagnostics-actions .btn { flex: 1 1 auto; }
  .push-diagnostics-grid { grid-template-columns: 1fr; }
}
