/* Портал поддержки: компоненты поверх base.css (стиль ncgroup-it.ru — Monokai, неон, Arial). */

.brand-sub { color: var(--comment); font-size: 0.9375rem; margin-left: 10px; }
.top .left { display: flex; align-items: baseline; gap: 4px; min-width: 0; }
.top .right { display: flex; align-items: center; gap: 18px; }
.top .who { color: var(--comment); font-size: 0.8125rem; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkish { font: inherit; font-size: 0.9375rem; color: var(--muted); background: none; border: 0; padding: 4px 0; cursor: pointer; }
.linkish:hover { color: var(--fg); }

main.page { padding-block: clamp(32px, 6vh, 64px) clamp(56px, 9vh, 96px); min-height: 70vh; }
.page h1 { margin: 0; font: 700 clamp(2rem, 1.4rem + 2.4vw, 3rem)/1.05 var(--font); letter-spacing: -0.03em; text-wrap: balance; }
.page .lede { margin: 12px 0 0; color: var(--muted); max-width: 56ch; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.spacer { flex: 1; }

.btn-ghost { font: 700 0.9375rem/1 var(--font); color: var(--fg); background: transparent; border: 1px solid var(--line-hi); border-radius: 6px; padding: 13px 18px; cursor: pointer; transition: border-color .15s, color .15s; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
a.btn { display: inline-flex; align-items: center; text-decoration: none; border: 0; }
a.btn:hover { color: #1b1c18; text-shadow: none; }

/* ---------- вход ---------- */
.auth { max-width: 440px; margin: clamp(24px, 8vh, 80px) auto 0; }
.auth .card h1 { font-size: 1.75rem; }
.auth .lede { margin-bottom: 22px; font-size: 0.9375rem; }
.code-input { font: 700 1.75rem/1 var(--font) !important; letter-spacing: 0.4em; text-align: center; padding: 14px !important; }
.note { margin: 14px 0 0; color: var(--muted); font-size: 0.875rem; }
.note.error, .form-error { color: #ff7aa8; }
.form-error { margin: 14px 0 0; font-size: 0.875rem; }
.form-error:empty { display: none; }
.captcha { margin-top: 14px; }

/* ---------- главная ---------- */
.hero-search { margin-top: 26px; max-width: 640px; position: relative; }
.search-input { width: 100%; font: inherit; font-size: 1.0625rem; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 15px 16px; }
.search-input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cyan) 22%, transparent); }
.kb-results { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.kb-results:empty { display: none; }
.kb-results a { display: block; padding: 10px 12px; border: 0; border-radius: 6px; color: var(--fg); background: color-mix(in srgb, var(--panel) 70%, transparent); }
.kb-results a:hover { background: var(--panel); color: var(--cyan); text-shadow: none; }
.kb-title { margin: 18px 0 6px; color: var(--comment); font-size: 0.8125rem; }
.actions { margin-top: 26px; }

.section-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: clamp(40px, 7vh, 64px) 0 16px; }
.section-head h2 { margin: 0; font: 700 1.5rem/1.2 var(--font); }
.tabs { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; }
.tabs button { font: inherit; font-size: 0.875rem; color: var(--muted); background: none; border: 0; border-radius: 6px; padding: 7px 12px; cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--panel); color: var(--fg); box-shadow: inset 0 -2px 0 var(--pink); }

.tickets { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.tickets li { border-bottom: 1px solid var(--line); }
.tickets a { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto auto; align-items: center; gap: 4px 18px; padding: 14px 8px; border: 0; color: var(--fg); }
.tickets a:hover { background: color-mix(in srgb, var(--panel) 70%, transparent); text-shadow: none; color: var(--fg); }
.t-num { color: var(--yellow); font-size: 0.9375rem; }
.t-title { min-width: 0; }
.t-title b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-title span { color: var(--comment); font-size: 0.8125rem; }
.t-date { color: var(--comment); font-size: 0.8125rem; white-space: nowrap; }
.unread { display: inline-block; margin-left: 8px; padding: 2px 7px; border-radius: 999px; font-size: 0.6875rem; font-weight: 700; color: #1b1c18; background: var(--green); box-shadow: 0 0 10px color-mix(in srgb, var(--green) 60%, transparent); vertical-align: 2px; }
.empty { padding: 32px 8px; color: var(--muted); }
.pager { display: flex; gap: 10px; align-items: center; margin-top: 16px; color: var(--comment); font-size: 0.875rem; }

.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; border: 1px solid currentColor; }
.chip.new { color: var(--cyan); }
.chip.in_progress { color: var(--yellow); }
.chip.waiting { color: var(--orange); box-shadow: 0 0 10px color-mix(in srgb, var(--orange) 30%, transparent); }
.chip.closed { color: var(--green); }
.chip.merged { color: var(--purple); }

/* ---------- новое обращение ---------- */
.form-wide { max-width: 760px; margin-top: 28px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
select { width: 100%; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 11px 13px; }
select:focus { outline: none; border-color: var(--cyan); }
.field .hint-line { margin: 0; color: var(--comment); font-size: 0.8125rem; }
.field > label:not(.sr-only) { font-size: 0.875rem; color: var(--muted); }
.suggest { margin-top: 8px; padding: 12px 14px; border: 1px dashed color-mix(in srgb, var(--cyan) 45%, var(--line)); border-radius: 8px; }
.suggest[hidden] { display: none; }
.suggest p { margin: 0 0 6px; color: var(--cyan); font-size: 0.8125rem; }
.suggest ul { margin: 0; padding-left: 18px; }
.drop { display: grid; gap: 8px; padding: 14px; border: 1px dashed var(--line-hi); border-radius: 8px; color: var(--muted); font-size: 0.875rem; }
.drop.over { border-color: var(--green); background: color-mix(in srgb, var(--green) 6%, transparent); }
.drop input[type=file] { font-size: 0.875rem; color: var(--muted); }
.file-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.file-list li { display: flex; align-items: center; gap: 10px; font-size: 0.875rem; }
.file-list li span { color: var(--comment); }
.file-list button { margin-left: auto; }

/* ---------- обращение ---------- */
.ticket-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 20px; }
.ticket-head h1 { flex: 1 1 420px; font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem); }
.ticket-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 10px; color: var(--comment); font-size: 0.875rem; }
.ticket-meta .t-num { font-size: 0.875rem; }
.banner { margin-top: 18px; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 0.9375rem; }
.banner.warn { border-color: color-mix(in srgb, var(--orange) 55%, var(--line)); }

.feed { display: grid; gap: 16px; margin: 28px 0 0; padding: 0; list-style: none; }
.msg { max-width: min(680px, 88%); padding: 14px 16px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.msg.agent { justify-self: start; border-color: color-mix(in srgb, var(--pink) 40%, var(--line)); box-shadow: 0 0 16px color-mix(in srgb, var(--pink) 10%, transparent); }
.msg.customer { justify-self: end; background: color-mix(in srgb, var(--cyan) 7%, var(--panel)); border-color: color-mix(in srgb, var(--cyan) 30%, var(--line)); }
.msg.system { justify-self: center; background: transparent; color: var(--comment); font-size: 0.875rem; }
.msg-head { display: flex; gap: 12px; justify-content: space-between; margin-bottom: 8px; font-size: 0.8125rem; color: var(--comment); }
.msg-head b { color: var(--fg); }
.msg.agent .msg-head b { color: #ffd6e5; text-shadow: 0 0 8px color-mix(in srgb, var(--pink) 60%, transparent); }
.msg-body { overflow-wrap: anywhere; line-height: 1.55; }
.msg-body p { margin: 0 0 0.7em; }
.msg-body p:last-child { margin-bottom: 0; }
.msg-body img { max-width: 100%; height: auto; border-radius: 6px; }
.msg-body blockquote { margin: 0.6em 0; padding-left: 12px; border-left: 2px solid var(--line-hi); color: var(--muted); }
.msg-body pre { overflow-x: auto; padding: 10px; background: var(--bg); border-radius: 6px; }
.msg-body table { border-collapse: collapse; display: block; overflow-x: auto; }
.msg-body td, .msg-body th { border: 1px solid var(--line); padding: 4px 8px; }
.atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.att { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 0.8125rem; color: var(--fg); }
.att:hover { border-color: var(--green); color: var(--green); text-shadow: none; }
.att span { color: var(--comment); }
.reply { margin-top: 28px; }

.offline { margin: 0 0 18px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--pink) 50%, var(--line)); border-radius: 8px; color: var(--fg); background: color-mix(in srgb, var(--pink) 8%, var(--panel)); font-size: 0.9375rem; }
.offline[hidden] { display: none; }
.loading { color: var(--comment); padding: 24px 0; }

@media (max-width: 720px) {
  .grid2 { grid-template-columns: 1fr; }
  .tickets a { grid-template-columns: minmax(0, 1fr) auto; }
  .t-num { grid-column: 1; grid-row: 1; font-size: 0.8125rem; }
  .t-title { grid-column: 1; grid-row: 2; }
  .tickets .chip { grid-column: 2; grid-row: 1; justify-self: end; }
  .t-date { grid-column: 2; grid-row: 2; justify-self: end; }
  .msg { max-width: 94%; }
  .top .who { display: none; }
  .brand-sub { display: none; }
}

[hidden] { display: none !important; }
.nav-link { color: var(--muted); border: 0; font-size: 0.9375rem; padding-block: 4px; }
.nav-link:hover { color: var(--fg); text-shadow: none; }
.nav-link[aria-current] { color: var(--fg); box-shadow: 0 2px 0 var(--pink); }
main.page:focus { outline: none; }
input[type=file]::file-selector-button { font: 700 0.8125rem var(--font); color: var(--fg); background: var(--panel); border: 1px solid var(--line-hi); border-radius: 6px; padding: 8px 12px; margin-right: 12px; cursor: pointer; }
input[type=file]::file-selector-button:hover { border-color: var(--green); color: var(--green); }
.msg.system { justify-self: start; background: transparent; border-style: dashed; color: var(--muted); }
.fields, .field, .grid2 > * { min-width: 0; }
.form-wide .consent label, .auth .consent label { white-space: normal; }
.nav-link, .linkish { white-space: nowrap; }
@media (max-width: 720px) {
  .top .right { gap: 12px; }
  .nav-link, .top .linkish { font-size: 0.8125rem; }
}
@media (max-width: 380px) {
  .nav-link[href="/"] { display: none; }
}
