:root {
  color-scheme: light;
  --ink: #1f2335;
  --muted: #5e657d;
  --subdued: #777e94;
  --border: #e2e4ee;
  --wash: #f7f7fc;
  --surface: #fff;
  --accent: #6347d5;
  --accent-dark: #4e31be;
  --accent-wash: #f0ebff;
  --dark: #202139;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--wash);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, select, textarea, input { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible, a:focus-visible, select:focus-visible, textarea:focus-visible, input:focus-visible {
  outline: 2px solid #765af1;
  outline-offset: 2px;
}
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
h1, h2, p { margin: 0; }
svg, img { vertical-align: middle; flex: none; }
.topbar {
  height: 67px; display: flex; align-items: center; gap: 16px; padding: 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex; align-items: center; gap: 11px; text-decoration: none;
  font-size: 17px; font-weight: 760; letter-spacing: -.4px; white-space: nowrap;
}
.demo-tag {
  font-size: 10px; line-height: 1.2; color: #5840a1; background: var(--accent-wash);
  border: 1px solid #e7ddff; padding: 4px 7px; border-radius: 5px; font-weight: 750; letter-spacing: .06em;
}
.top-nav { display: flex; align-self: stretch; gap: 20px; margin-left: 25px; }
.top-nav a {
  display: flex; align-items: center; position: relative; color: var(--muted);
  text-decoration: none; font-size: 14px; font-weight: 620;
}
.top-nav a[aria-current] { color: var(--accent-dark); }
.top-nav a[aria-current]::after {
  content: ""; position: absolute; inset: auto 0 -1px; height: 3px; border-radius: 4px 4px 0 0; background: var(--accent);
}
.persona { display: flex; align-items: center; gap: 9px; margin-left: auto; font-size: 13px; color: var(--muted); min-width: 0; }
select { padding: 7px 29px 7px 10px; border: 1px solid var(--border); border-radius: 7px; background-color: #fff; min-width: 0; }
.persona select { color: var(--ink); max-width: 100%; }
.desk { display: grid; min-width: 0; }
.operator-desk { height: calc(100dvh - 67px); min-height: 510px; grid-template-columns: 228px minmax(275px, 325px) minmax(0, 1fr); }
.sidebar {
  display: flex; flex-direction: column; padding: 20px 12px 14px; color: #fff; background: var(--dark);
  overflow-y: auto; min-height: 0;
}
.workspace { display: flex; align-items: center; gap: 10px; padding: 2px 8px 24px; }
.workspace-icon {
  display: grid; width: 35px; height: 35px; place-items: center; border-radius: 8px;
  background: #373552; color: #d6ccff;
}
.workspace strong, .sidebar-foot strong { display: block; font-size: 13px; line-height: 1.3; }
.workspace small, .sidebar-foot small { color: #b5b6cb; font-size: 11px; }
.side-label { padding: 0 9px 8px; color: #a7acc6; font-size: 10px; font-weight: 750; letter-spacing: .11em; }
.projects-label { margin-top: 25px; }
.side-link {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 9px 8px;
  background: transparent; border: 1px solid transparent; color: #d9dbec; border-radius: 7px; font-size: 12.5px;
}
.side-link span { flex: 1; min-width: 0; }
.side-link small { min-width: 19px; padding: 0 3px; text-align: center; color: #d9dbec; }
.side-link:hover, .side-link.selected { color: #fff; background: #353452; }
.side-link.selected { border-color: #48466b; }
.project-dot { width: 7px; height: 7px; margin: 0 5px; border-radius: 50%; background: #a992ff; }
.sidebar-foot { margin-top: auto; padding: 16px 7px 0; display: flex; align-items: center; gap: 9px; }
.sidebar-foot .avatar { background: #433b67; color: #eee6ff; }
.list-pane {
  display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); min-width: 0; min-height: 0;
}
.list-header { padding: 25px 19px 20px; border-bottom: 1px solid var(--border); }
.eyebrow { color: var(--accent-dark); font-size: 10px; font-weight: 790; letter-spacing: .105em; text-transform: uppercase; }
.list-header h1 { font-size: 29px; line-height: 1.15; letter-spacing: -.045em; margin: 5px 0; }
.list-header p { color: var(--muted); font-size: 12.5px; }
.ticket-list { overflow: auto; min-height: 0; padding: 9px; }
.ticket {
  width: 100%; display: grid; min-width: 0; text-align: left; gap: 4px; padding: 11px 11px 10px;
  margin-bottom: 4px; border: 1px solid transparent; border-bottom-color: #ececf4; border-radius: 8px;
  background: var(--surface);
}
.ticket:hover { background: #f8f6ff; }
.ticket.selected { background: #f5f1ff; border-color: #dfd2ff; }
.ticket strong { font-size: 13.5px; line-height: 1.4; overflow-wrap: anywhere; }
.ticket-preview { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-meta { display: flex; justify-content: space-between; gap: 8px; align-items: center; color: var(--muted); font-size: 11px; }
.ticket-meta > time { white-space: nowrap; }
.ticket-bottom { margin-top: 5px; }
.badge {
  width: max-content; display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap; line-height: 1.4; border-radius: 6px; font-size: 11px; font-weight: 700; padding: 3px 7px;
}
.badge span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.new { color: #78491a; background: #fff0d8; }
.badge.active { color: #4e31a7; background: #eae2ff; }
.badge.closed { color: #25634f; background: #e2f4eb; }
.detail-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #f9f9fd; }
.detail-header {
  min-height: 120px; display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
  padding: 23px 26px 17px; border-bottom: 1px solid var(--border); background: #fff;
}
.detail-header h2 { font-size: clamp(20px, 2.15vw, 28px); line-height: 1.22; margin: 7px 0 9px; letter-spacing: -.035em; overflow-wrap: anywhere; }
.detail-title { min-width: 0; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.mid-meta { font-size: 12px; color: var(--muted); }
.middle-dot { color: var(--subdued); padding: 0 2px; }
.detail-header button { white-space: nowrap; flex-shrink: 0; }
.primary, .secondary, .subtle {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 12px;
  border-radius: 7px; border: 1px solid transparent; font-weight: 670; font-size: 13px;
}
.primary { background: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-dark); }
.secondary { background: #fff; border-color: #dadce8; color: #3f4660; }
.secondary:hover, .subtle:hover { background: #f3efff; }
.subtle { background: transparent; color: var(--accent-dark); }
.messages { padding: 22px 26px; flex: 1; min-height: 0; overflow: auto; }
.message-day {
  margin: 0 auto 22px; color: var(--muted); width: max-content; padding: 3px 8px; border-radius: 5px;
  background: #f0f0f8; font-size: 11px; max-width: 100%;
}
.message { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; min-width: 0; }
.message > div { min-width: 0; max-width: min(88%, 670px); }
.avatar {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none;
  background: #eae6f6; color: #524675; font-size: 11px; font-weight: 780;
}
.message.own .avatar { color: #f8f5ff; background: var(--accent); }
.message-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 0 0 4px; font-size: 12px; }
.message-meta time { color: var(--muted); font-size: 11px; }
.message p {
  white-space: pre-wrap; overflow-wrap: anywhere; background: #fff; border: 1px solid var(--border);
  border-radius: 3px 10px 10px; padding: 10px 13px; font-size: 14px;
}
.message.own p { background: #f0ebff; border-color: #e4d9fd; }
.composer, .read-only { background: #fff; border-top: 1px solid var(--border); padding: 15px 26px; }
.composer label, .new-form label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 5px; }
textarea, input {
  display: block; width: 100%; padding: 9px 11px; border-radius: 7px; border: 1px solid #d8dbe9; background: #fff;
}
textarea { resize: vertical; min-height: 54px; max-height: 220px; }
textarea::placeholder, input::placeholder { color: #70768c; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
.composer-footer span { color: var(--muted); font-size: 12px; }
.read-only { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.list-empty { padding: 17px 10px; color: var(--muted); font-size: 13px; }
.empty-detail { display: grid; place-content: center; justify-items: center; height: 100%; min-height: 130px; text-align: center; }
.empty-icon { display: grid; place-items: center; border-radius: 14px; background: #eee8ff; color: var(--accent-dark); width: 49px; height: 49px; }
.empty-detail h2 { margin: 8px 0 4px; font-size: 18px; }
.empty-detail p { color: var(--muted); font-size: 13px; }
#compact-filters, .mobile-back { display: none; }
.project-shell { max-width: 1120px; margin: 0 auto; padding: 23px 24px; }
.project-heading { margin-bottom: 15px; }
.project-heading h1 { font-size: 28px; letter-spacing: -.045em; margin: 1px 0; }
.project-heading p { color: var(--muted); font-size: 13px; }
.project-frame {
  width: 100%; height: max(550px, calc(100dvh - 206px)); display: block; border: 1px solid #dedfed;
  border-radius: 13px; background: #fff;
}
.client-desk { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); height: 100dvh; }
.client-desk .list-header .primary { margin-top: 14px; }
.new-form { max-width: 560px; padding: 4px 0; }
.new-form label:not(:first-child) { margin-top: 12px; }
.new-form .composer-footer { justify-content: flex-end; margin-top: 15px; }
#notice {
  position: fixed; z-index: 5; bottom: 15px; right: 15px; max-width: min(380px, calc(100% - 30px));
  padding: 10px 14px; color: #fff; border-radius: 8px; background: #2d2d4d; box-shadow: 0 7px 26px #1d1a3b2b;
  font-size: 13px;
}
#notice.error { background: #8e344e; }
@media (max-width: 1040px) {
  .operator-desk { grid-template-columns: 190px minmax(238px, 285px) minmax(0, 1fr); }
  .detail-header, .messages, .composer, .read-only { padding-left: 17px; padding-right: 17px; }
}
@media (max-width: 860px) {
  .operator-desk { grid-template-columns: minmax(225px, 280px) minmax(0, 1fr); }
  .sidebar { display: none; }
  #compact-filters { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
  #compact-filters select { font-size: 11px; padding-right: 4px; }
  .topbar { padding-inline: 14px; }
  .top-nav { margin-left: 0; gap: 12px; }
  .persona > span { display: none; }
}
@media (max-width: 660px) {
  .topbar { height: auto; min-height: 66px; padding: 9px 12px; gap: 8px; flex-wrap: wrap; }
  .brand { font-size: 15px; gap: 6px; }
  .brand img { width: 31px; height: 31px; }
  .top-nav { order: 4; flex-basis: 100%; }
  .top-nav a { padding-bottom: 5px; font-size: 13px; }
  .persona select { font-size: 11px; padding: 5px 3px; }
  .operator-desk { height: calc(100dvh - 81px); }
  .desk { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .detail-pane { display: none; }
  .desk.detail-open .list-pane { display: none; }
  .desk.detail-open .detail-pane { display: flex; }
  .mobile-back { display: inline-flex; align-self: flex-start; margin: 5px 6px; }
  .list-header { padding: 16px 14px; }
  .detail-header { min-height: 0; flex-wrap: wrap; padding-top: 11px; padding-bottom: 13px; }
  .detail-header h2 { margin-block: 4px; }
  .detail-header button { padding: 5px 8px; font-size: 12px; }
  .messages { padding-top: 15px; }
  .project-shell { padding: 13px 9px; }
  .project-heading h1 { font-size: 22px; }
  .project-heading p { font-size: 12px; }
  .project-frame { height: max(490px, calc(100dvh - 189px)); }
}
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.auth-shell { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(100%, 420px); border: 1px solid var(--border); border-radius: 14px; padding: 28px; background: white; }
.auth-card .brand { margin-bottom: 22px; }
.auth-card h1, .settings h1 { font-size: 28px; letter-spacing: -.04em; line-height: 1.2; margin-block: 5px 8px; }
.auth-card label, .settings form label { display: block; margin-block: 12px 5px; font-size: 13px; font-weight: 700; }
.auth-card .primary, .settings form .primary { margin-top: 14px; }
.auth-card .primary { width: 100%; }
.inline-error { color: #8e344e; margin-top: 7px; font-size: 13px; }
.settings { max-width: 1060px; margin: auto; padding: 26px 20px; }
.settings-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.settings-card { border: 1px solid var(--border); border-radius: 12px; padding: 17px 19px; background: white; margin-top: 14px; }
.settings-card h2 { font-size: 18px; margin-bottom: 6px; }
.access-project { border-top: 1px solid var(--border); padding-block: 12px; }
.access-project h3 { margin: 0; font-size: 15px; }
.access-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.staff-list { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 9px; }
.staff-list label { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.staff-list input { width: auto; }
.staff-list small { color: var(--muted); }
.integration-key { border-color: #d7c9fb; background: #f9f6ff; }
.integration-key dt { font-weight: 700; }
.integration-key dd { margin: 3px 0 9px; overflow-wrap: anywhere; }
#search { margin-top: 11px; font-size: 13px; }
.unread-label { color: var(--accent-dark) !important; margin-top: 6px; }
.unread-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; vertical-align: 1px; border-radius: 50%; background: var(--accent); }
.pagination { display: flex; justify-content: space-between; align-items: center; padding: 8px 11px; border-top: 1px solid var(--border); }
.pagination button:disabled { cursor: default; }
.ticket-controls { display: grid; gap: 5px; justify-items: end; }
.ticket-controls form { display: flex; gap: 5px; }
.ticket-controls select { font-size: 12px; max-width: 145px; }
.message.internal .avatar { background: #f2e4bc; color: #735015; }
.message.internal p { background: #fff6de; border-color: #f1e3b9; }
.note-tag { color: #7a5316; background: #fff0d2; padding: 1px 5px; border-radius: 4px; }
.file-label { min-width: 0; color: var(--muted); font-size: 12px !important; }
.file-label input { font-size: 12px; margin-top: 3px; padding: 3px; width: min(230px, 100%); }
.attachment { display: block; max-width: 100%; overflow-wrap: anywhere; margin-top: 4px; background: var(--accent-wash); color: var(--accent-dark); border: 1px solid #ded3fb; border-radius: 6px; padding: 4px 8px; text-align: left; }
.message-mode { margin-bottom: 5px; font-size: 13px; }
.older-messages { margin: 0 0 15px; }
#reopen-hint { font-size: 12px; margin-top: 4px; }
@media (max-width: 660px) {
  .ticket-controls { justify-items: start; }
  .ticket-controls select { max-width: 130px; }
}

.composer.note-mode { background: #fff9e9; }

.auth-link { margin-top: 17px; color: var(--accent-dark); font-size: 13px; }
.install-card { width: min(100%, 510px); }
.install-steps { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 16px 0; padding: 0; }
.install-steps li { padding: 4px 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font-size: 13px; }
.install-steps li[aria-current="step"] { border-color: #d7c9fb; background: var(--accent-wash); color: var(--accent-dark); font-weight: 700; }
.install-actions { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; margin-top: 14px; }
.install-actions .primary { margin: 0; }
.field-hint { margin-top: 6px; font-size: 13px; }
.company-list { list-style: none; padding: 0; margin: 0; }
.company-list li { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; border-bottom: 1px solid var(--border); padding: 8px 0; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.auth-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.auth-card .auth-tools .brand { margin-bottom: 0; }
.language-picker { display: inline-flex; align-items: center; flex: 0 0 auto; }
.language-picker select { max-width: 100%; font-size: 12px; }
.client-language { height: 41px; display: flex; align-items: center; justify-content: flex-end; padding: 0 12px; background: #fff; border-bottom: 1px solid var(--border); }
.client-language + .client-desk { height: calc(100dvh - 41px); }

.help-link { color: var(--accent-dark); font-size: 13px; font-weight: 600; }
.auth-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 17px; font-size: 13px; color: var(--accent-dark); }
.client-language { gap: 12px; }
.help-topbar { height: auto; min-height: 67px; flex-wrap: wrap; padding-block: 10px; }
.help-home { color: var(--accent-dark); font-size: 13px; }
.help-languages { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; font-size: 13px; }
.help-languages a { padding: 4px 7px; border-radius: 6px; }
.help-languages a[aria-current="page"] { background: var(--accent-wash); color: var(--accent-dark); font-weight: 700; }
.help-page { max-width: 1160px; margin: 0 auto; padding: 26px 20px 40px; }
.help-page > h1 { font-size: clamp(25px, 4vw, 37px); margin-bottom: 4px; }
.help-layout { display: grid; grid-template-columns: minmax(180px, 235px) minmax(0, 1fr); gap: 16px; margin-top: 20px; }
.help-contents, .help-section { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.help-contents { align-self: start; }
.help-contents h2, .help-section h2 { font-size: 18px; }
.help-contents ul, .help-section ul { margin: 8px 0 0; padding-left: 20px; }
.help-contents li + li, .help-section li + li { margin-top: 7px; }
.help-contents a { color: var(--accent-dark); }
.help-section + .help-section { margin-top: 12px; }
.help-section li { overflow-wrap: anywhere; }
@media (max-width: 660px) {
  .help-page { padding: 16px 12px 28px; }
  .help-layout { grid-template-columns: minmax(0, 1fr); }
  .help-languages { margin-left: 0; }
}
