/* LUIS brand tokens: luis.ru. System font fallback keeps the UI self-contained. */
.access-hidden { display: none !important; }
:root {
  --primary: #a4092b;
  --primary2: #920726;
  --text: #333;
  --muted: #787878;
  --line: #e5e7eb;
  --card: #fff;
  --radius: 16px;
  --shadow: 0 8px 32px #20202008;
  font-family: 'Exo 2', 'Segoe UI', Arial, sans-serif;
  background: #f3f5f8;
}
body { background: #f3f5f8; line-height: 1.5; }
body.dark { --card: #24272d; --text: #f4f4f5; --muted: #b7bcc6; --line: #424650; background: #191c22; }
.orb { display: none; }
.topbar { max-width: 1400px; margin: 0 auto; top: 0; height: auto; min-height: 88px; padding: 16px 28px; border-radius: 0 0 16px 16px; border: 0; border-bottom: 3px solid var(--primary); backdrop-filter: none; gap: 14px; flex-wrap: wrap; }
.brand-logo { width: 120px; }
nav { flex-wrap: wrap; }
nav a { border-radius: 8px; padding: 10px 12px; }
nav a.active, nav a:hover { background: #f8e9ed; color: #a4092b; }
main { max-width: 1280px; margin: 36px auto; padding: 0 24px 48px; }
.hero { gap: 48px; align-items: center; padding: 32px 0; }
.hero-copy h1 { font-size: clamp(36px, 4.5vw, 64px); line-height: 1.08; letter-spacing: -.04em; color: var(--text); background: none; -webkit-text-fill-color: currentColor; max-width: 760px; }
.hero-copy p { font-size: 18px; max-width: 580px; color: var(--muted); line-height: 1.7; }
.eyebrow, .section-head>span { color: var(--primary); font-size: 12px; letter-spacing: .14em; font-weight: 800; text-transform: uppercase; }
button, .hero-actions>button { background: var(--primary); border-radius: 8px; box-shadow: none; font: inherit; font-weight: 650; padding: 12px 20px; }
button:hover { background: #c0153a; transform: none; }
.secondary, button.secondary { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 8px; box-shadow: none; }
.secondary:hover { border-color: var(--primary); color: var(--primary); background: var(--card); }
.quick-card, .card, .auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); backdrop-filter: none; }
.quick-card { border-top: 4px solid var(--primary); padding: 28px; }
.quick-card>b { font-size: 24px; color: var(--text); }
.quick-card textarea { min-height: 145px; }
.stats { border-top: 1px solid var(--line); padding-top: 24px; gap: 32px; }
.stats b { color: var(--text); font-size: 28px; }
.card { padding: 28px; }
input, select, textarea { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid #a4092b33; border-color: var(--primary); box-shadow: none; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #0f4c81; outline-offset: 3px; }
.auth-screen { background: linear-gradient(115deg, #f3f5f8 50%, #f8e9ed 50%); }
.auth-card { padding: 36px; border-top: 4px solid var(--primary); }
.auth-card h1 { font-size: 30px; letter-spacing: -.03em; }
.auth-card input { margin-bottom: 12px; }
.auth-card button { width: 100%; }
.ticket-item, .kb-grid article { border-radius: 10px; box-shadow: none; border: 1px solid var(--line); background: var(--card); }
.ticket-item:hover, .kb-grid article:hover { border-color: #a4092b66; transform: none; }
.chat { background: #f3f5f8; border-radius: 12px; padding: 20px; }
.msg { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 12px 12px 12px 2px; box-shadow: none; line-height: 1.6; }
.msg.agent { background: #edf2ff; color: #263a50; border-color: #cfdbe6; border-radius: 12px 12px 2px 12px; }
.msg small { color: #667085; }
.attachments a, .file-chip { background: var(--card); color: #0f4c81; border-radius: 8px; overflow-wrap: anywhere; }
.paperclip, .drop { border-radius: 8px; background: var(--card); }
.toast { background: #333; color: #fff; border-radius: 10px; }
.operator-pill { color: #0f4c81; background: #edf2ff; }
.dark .chat { background: #191c22; }
.dark .msg.agent { background: #24374d; color: #f4f4f5; }
.dark .auth-screen { background: #191c22; }
.dark nav a.active { background: #482633; color: #ffb9cb; }
.dark .stats b { color: var(--text); }
@media (max-width: 1000px) { .topbar { padding: 14px 18px; } .user-badge { flex-basis: 100%; } .hero { gap: 24px; } }
@media (max-width: 700px) { main { padding: 0 14px 28px; margin-top: 20px; } .hero { display: grid; grid-template-columns: 1fr; padding-top: 8px; } .card, .quick-card, .auth-card { padding: 20px; } .topbar nav { order: 3; width: 100%; } .stats { gap: 16px; } .reply-box { display: flex; flex-wrap: wrap; } .reply-box textarea { flex-basis: 100%; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Portal v2: one clear next step, readable history and a focused conversation. */
body { font-family: 'Segoe UI', Arial, sans-serif; }
.topbar { max-width: none; border-radius: 0; border-bottom: 1px solid var(--line); padding: 16px max(24px,calc((100vw - 1240px)/2)); box-shadow: 0 2px 8px #18223005; position: relative; }
.topbar .brand-logo { width: 100px; }
.topbar nav { gap: 4px; }
.topbar nav a { font-size: 14px; font-weight: 600; }
.topbar .user-badge { font-size: 12px; max-width: 220px; overflow-wrap: anywhere; }
main { max-width: 1240px; margin-top: 32px; }
.hero { grid-template-columns: minmax(0,1.2fr) minmax(320px,1fr); gap: 48px; padding: 32px 0 48px; }
.hero-copy h1 { font-size: clamp(34px,4vw,52px); max-width: 620px; line-height: 1.15; }
.hero-copy p { font-size: 17px; }
.quick-card { border-top: 3px solid var(--primary); box-shadow: 0 10px 32px #18223008; }
.quick-card textarea { resize: vertical; min-height: 160px; }
.quick-card>button { width: 100%; margin-top: 16px; }
.stats { gap: 24px; }
.stats b { font-size: 24px; }
.section-head h2 { font-size: 28px; letter-spacing: -.025em; margin-top: 8px; }
.section-head p { color: var(--muted); line-height: 1.65; }
.form-card { max-width: 880px; margin-inline: auto; }
.form-card label { display: block; font-weight: 600; font-size: 14px; }
.form-card label input,.form-card label select,.form-card label textarea { margin-top: 8px; font-weight: 400; }
.form-card textarea { min-height: 180px; resize: vertical; }
.form-card>button { margin-top: 20px; min-width: 220px; }
input,select,textarea { min-height: 44px; }
.drop { border: 1px dashed #b5beca; padding: 24px; text-align: center; }
.drop.dragover { border-color: var(--primary); background: #a4092b0a; }
.ticket-groups h3 { font-size: 13px; color: var(--muted); letter-spacing: .03em; margin: 24px 0 12px; }
.list .ticket { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 18px 20px; margin: 10px 0; gap: 20px; box-shadow: none; cursor: pointer; }
.list .ticket:hover { border-color: #a4092b66; background: #a4092b03; transform: none; }
.list .ticket b { font-size: 12px; color: var(--primary); display: inline-block; margin-right: 8px; }
.list .ticket small { display: inline-block; margin-top: 8px; color: var(--muted); }
.badge { font-size: 12px; font-weight: 600; white-space: nowrap; }
.archive-block { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 24px; }
.archive-block summary { cursor: pointer; font-weight: 600; }
#ticket { max-width: 1000px; margin-inline: auto; }
.back-link { padding: 0; background: transparent; color: var(--muted); font-weight: 500; margin-bottom: 22px; }
.back-link:hover { color: var(--primary); background: transparent; }
.ticket-shell { padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.ticket-shell h2 { font-size: 24px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.meta-line { color: var(--muted); font-size: 13px; line-height: 1.9; }
.chat { min-height: 280px; max-height: 58dvh; overflow-y: auto; overscroll-behavior: contain; }
.msg { max-width: 85%; padding: 14px 18px; overflow-wrap: anywhere; }
.reply-box { border: 1px solid var(--line); padding: 12px; border-radius: 12px; margin-top: 16px; align-items: end; background: var(--card); }
.reply-box textarea { border: 0; min-height: 90px; background: transparent; resize: vertical; }
.reply-box button { min-height: 44px; }
.kb-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,260px),1fr)); gap: 18px; }
.kb-grid article { padding: 22px; cursor: pointer; }
.kb-grid article h3 { line-height: 1.5; color: var(--text); }
.kb-grid article p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.7; color: var(--muted); }
.kb-article { max-width: 780px; margin: auto; }
.kb-article h1 { font-size: clamp(26px,3vw,36px); line-height: 1.3; letter-spacing: -.02em; }
.kb-article p { font-size: 16px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty { text-align: center; padding: 28px; color: var(--muted); }
.auth-card { width: min(440px,calc(100vw - 32px)); }
.auth-card p { color: var(--muted); line-height: 1.65; }
.auth-card input { width: 100%; }
button:disabled { opacity: .5; cursor: not-allowed; }
.dark .list .ticket b { color: #ffb9cb; }
.dark .eyebrow,.dark .section-head>span { color: #ffb9cb; }
.dark .operator-pill { background: #24374d; color: #c9def7; }
.dark .msg small { color: #b7bcc6; }
@media(max-width: 900px) { .hero { grid-template-columns: 1fr; gap: 24px; } .hero-copy h1 { max-width: 700px; } .topbar .user-badge { max-width: none; flex-basis: auto; } .topbar nav { order: 3; width: 100%; } }
@media(max-width: 600px) { .topbar { padding: 14px 16px; gap: 12px; } .topbar nav { display: grid; grid-template-columns: 1fr 1fr; } .topbar nav a { text-align: center; } .hero { padding-top: 8px; } .hero-actions { flex-wrap: wrap; } .hero-actions>* { flex: 1; text-align: center; white-space: nowrap; } .stats { flex-wrap: wrap; gap: 20px; } .list .ticket { flex-direction: column; align-items: flex-start; gap: 12px; } .ticket-shell { flex-wrap: wrap; gap: 12px; } .msg { max-width: 96%; } .chat { padding: 12px; } .card { padding: 20px 16px; } }

/* Support center v3: quiet surfaces and a conversation-first layout. */
:root { --line: #e8e7e3; --text: #30302c; --muted: #7b7b73; --shadow: 0 4px 20px #28282005; font-family: 'Segoe UI', Arial, sans-serif; background: #f8f8f5; }
body { background: #f8f8f5; }
.topbar { max-width: none; padding: 14px max(24px,calc((100vw - 1200px)/2)); min-height: 76px; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--card); box-shadow: none; }
.brand-logo { width: 100px; }
.topbar nav a { font-size: 13px; font-weight: 500; padding: 9px 12px; }
.topbar .user-badge { border: 0; background: transparent; font-size: 12px; }
main { max-width: 1200px; margin: 36px auto; }
.hero { padding: 40px 0; gap: 64px; }
.hero-copy h1 { font-size: clamp(32px,3.7vw,50px); letter-spacing: -.045em; font-weight: 650; line-height: 1.13; }
.hero-copy>p { font-size: 16px; line-height: 1.8; max-width: 490px; }
.eyebrow { font-size: 10px; letter-spacing: .13em; font-weight: 600; }
.quick-card { border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: 0 12px 40px #24242008; }
.quick-card>b { font-size: 20px; font-weight: 600; }
.quick-card textarea { background: #fafaf8; border-radius: 9px; font-family: inherit; font-size: 14px; }
.quick-card>button { width: 100%; }
button, .secondary { border-radius: 7px; font-size: 13px; box-shadow: none; }
.card { border-radius: 12px; box-shadow: none; padding: 28px; }
.section-head h2 { font-size: 25px; font-weight: 600; letter-spacing: -.03em; }
.stats { border-top: 1px solid var(--line); padding-top: 24px; }
.stats b { font-size: 20px; font-weight: 600; }
.stats span { font-size: 12px; }
.list .ticket { border-radius: 8px; box-shadow: none; padding: 20px; }
.list .ticket:hover { border-color: #dbc1c7; background: #fdf9fa; transform: none; }
.chat { background: var(--card); border: 0; }
.msg { background: #f3f2ee; border: 1px solid var(--line); border-radius: 12px 12px 12px 3px; box-shadow: none; font-size: 14px; }
.msg.user { background: #f8e9ed; border-color: #efd9df; border-radius: 12px 12px 3px 12px; }
.reply-box { border-radius: 10px; box-shadow: 0 3px 12px #20202005; }
.kb-grid article { border-radius: 10px; box-shadow: none; }
.dark .quick-card textarea, .dark .msg { background: #2c2f35; }
.dark .msg.user { background: #432934; border-color: #63404d; }
.dark .list .ticket:hover { background: #30272c; }
@media(max-width: 900px) { .hero { gap: 28px; padding: 12px 0; } .topbar { padding: 16px 24px; } }
@media(max-width: 600px) { main { margin-top: 24px; padding-inline: 16px; } .topbar { padding: 12px 16px; } .card, .quick-card { padding: 20px; } .hero-copy h1 { font-size: 34px; } }
@media(prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Compact layout: keep list spacing independent from empty-state styling. */
body { color-scheme: light; }
main { margin: 20px auto; padding: 0 20px 24px; }
.topbar { padding-block: 10px; gap: 10px; min-height: 64px; }
.card, .quick-card { padding: 20px; }
.hero { gap: 28px; padding: 12px 0; }
.hero-copy { min-height: 0; padding: 20px; }
.section-head { margin-bottom: 16px; }
.section-head.row { gap: 12px; }
.section-head h2 { margin: 6px 0 0; }
.section-head.row button { flex-shrink: 0; }
.ticket-groups { gap: 16px; margin-top: 16px; }
.ticket-groups h3 { margin: 0 0 8px; }
.list { gap: 8px; text-align: left; }
.list .ticket { margin: 0; padding: 12px 14px; gap: 12px; align-items: flex-start; text-align: left; }
.list .ticket>div:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.list .ticket>div:last-child { display: flex; flex-wrap: wrap; gap: 6px; flex-shrink: 0; }
.list .ticket b { margin-right: 6px; }
.list .ticket small { display: block; margin-top: 4px; line-height: 1.45; }
.list .ticket br { display: none; }
.badge { margin: 0; }
.archive-block { margin-top: 0; padding-top: 12px; }
.back-link { margin-bottom: 12px; }
.ticket-shell { padding-bottom: 12px; }
.chat { padding: 12px; }
.msg { min-width: 0; overflow-wrap: anywhere; }
.reply-box { grid-template-columns: minmax(0,1fr) auto auto; }
.grid>* { min-width: 0; }
input, select, textarea { min-width: 0; max-width: 100%; }
.attachments a, .file-chip { max-width: 100%; overflow-wrap: anywhere; }
.kb-article img, .msg img { max-width: 100%; height: auto; }
.kb-article pre { max-width: 100%; overflow: auto; }
body.dark { color-scheme: dark; --card: #24272d; --text: #f0f1f3; --muted: #b3b8c2; --line: #414650; background: #191c22; }
body.dark .topbar, body.dark .hero-copy, body.dark .list .ticket { background: var(--card); border-color: var(--line); }
body.dark nav a.active, body.dark nav a:hover { background: #482b37; color: #ffb9cb; }
body.dark .badge, body.dark .eyebrow, body.dark .section-head span,
body.dark .archive-block summary span { background: #482b37; color: #ffb9cb; }
body.dark .badge.critical { background: #6b2438; color: #fff0f3; }
body.dark .list .ticket:hover { background: #302c33; border-color: #b7677e; }
body.dark .theme-toggle, body.dark .paperclip, body.dark .drop,
body.dark .reply-box, body.dark .secondary { background: var(--card); color: var(--text); border-color: var(--line); }
body.dark .attachments a, body.dark .file-chip { background: #293444; color: #b9dbff; border-color: #46566c; }
body.dark .msg:not(.agent) { background: #432934; color: var(--text); border-color: #684553; }
body.dark .msg.agent { background: #293747; color: var(--text); border-color: #46566c; }
body.dark .totp-setup code { background: #30343c; color: #ffb9cb; }
body.dark .secondary:hover, body.dark .back-link:hover { color: #ffb9cb; }
body.dark input:focus, body.dark select:focus, body.dark textarea:focus { outline: 2px solid #e898ad; border-color: #e898ad; }
body.dark button:focus-visible, body.dark a:focus-visible, body.dark summary:focus-visible { outline-color: #9acbff; }
@media (max-width: 900px) {
  main { margin: 16px auto; padding-inline: 16px; }
  .topbar { padding: 10px 16px; justify-content: flex-start; }
  .topbar .user-badge { flex: 1; min-width: 0; }
  .topbar nav { justify-content: flex-start; }
  .hero { grid-template-columns: minmax(0,1fr); gap: 16px; }
}
@media (max-width: 600px) {
  main { margin: 12px auto; padding: 0 10px 16px; }
  .topbar { padding: 10px; gap: 8px; }
  .topbar .brand-logo { width: 84px; }
  .topbar .user-badge { flex-basis: calc(100% - 100px); max-width: none; }
  .topbar nav { gap: 4px; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .topbar nav a { padding: 10px 6px; }
  .topbar button, .topbar nav a, .paperclip { min-height: 44px; }
  .theme-toggle { flex-shrink: 0; }
  .card, .quick-card, .auth-card { padding: 14px; border-radius: 10px; }
  .hero-copy { padding: 14px; }
  .hero-copy h1 { font-size: 30px; }
  .section-head h2 { font-size: 22px; }
  .section-head.row { align-items: flex-start; }
  .section-head.row button { padding-inline: 12px; }
  .list .ticket { flex-direction: column; gap: 8px; padding: 12px; }
  .list .ticket>div:last-child { flex-shrink: 1; }
  .grid { grid-template-columns: minmax(0,1fr); gap: 10px; }
  input, select, textarea { font-size: 16px; padding: 10px 12px; }
  .form-card>button { width: 100%; min-width: 0; margin-top: 12px; }
  .drop { padding: 14px 10px; }
  .chat { padding: 8px 0; }
  .msg { max-width: 96%; padding: 10px 12px; }
  .reply-box { display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 8px; padding: 10px; }
  .reply-box textarea { grid-column: 1/-1; width: 100%; min-height: 88px; }
  .reply-box .paperclip { margin: 0; width: 44px; }
  .reply-box button { justify-self: end; }
  .ticket-shell { flex-direction: column; gap: 8px; }
  .stats { margin-top: 16px; padding-top: 16px; gap: 16px; }
  .kb-grid { gap: 10px; }
  .kb-grid article { padding: 14px; }
  .auth-screen { padding: 12px; }
  .totp-setup img { max-width: 100%; height: auto; }
}