:root {
  color-scheme: dark;
  --surface: #201c19;
  --raised: #29231f;
  --line: #44352d;
  --text: #fff5ea;
  --muted: #c3b2a5;
  --ember: #ffa267;
  --focus: #ffc592;
  --green: #a8e2b5;
  font: 16px/1.48 system-ui, "Segoe UI", sans-serif;
  background: #151210;
  color: var(--text);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, h3, p, fieldset { margin: 0; }
button, input, select, textarea { font: inherit; }
a { color: var(--ember); text-underline-offset: .23em; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, :is(input, select, textarea):focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.skip { position: absolute; top: -100px; z-index: 2; padding: 10px; background: var(--surface); }
.skip:focus { top: 8px; }
.header { border-bottom: 1px solid #35302c; background: #181411; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 67px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-size: 1.18rem; text-decoration: none; white-space: nowrap; }
.brand strong span { color: var(--ember); }
.brand-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; background: #ffa267; color: #2a170f; }
.brand-icon svg { width: 23px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.header nav, .actions, .thread-tools, .footer { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.header nav a { color: var(--muted); text-decoration: none; padding: 10px 4px; font-size: .88rem; }
.header nav a:hover, .footer a:hover { color: var(--ember); }
.intro {
  display: grid;
  grid-template-columns: 1fr minmax(110px, 240px);
  gap: 20px;
  align-items: center;
  min-height: 250px;
  margin: 30px 0 18px;
  padding: clamp(24px, 5vw, 62px);
  border: 1px solid #654330;
  border-radius: 25px;
  background: radial-gradient(ellipse at 85% 42%, #643825, transparent 59%), linear-gradient(118deg, #241a16, #342319 72%, #2c201b);
}
.intro h1 { font-size: clamp(2.1rem, 6vw, 4.55rem); line-height: .98; letter-spacing: -.055em; }
.intro h1 span { color: #ffb47c; }
.intro p { max-width: 39ch; color: #e3cfc0; margin-top: 17px; }
.intro-sign { display: grid; place-items: center; }
.intro-sign svg { width: min(100%, 207px); overflow: visible; }
.sign-back { fill: #413028; stroke: #996645; stroke-width: 2; }
.sign-front { fill: #2e211d; stroke: #ffad72; stroke-width: 2; }
.sign-lines { stroke: #ffb77e; stroke-width: 3; stroke-linecap: round; }
.sign-spark { stroke: #ffd4ab; stroke-width: 2; stroke-linecap: round; }
.tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; padding-block: 2px; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--text);
  background: #2b241e; cursor: pointer; text-align: center; text-decoration: none; font-weight: 650;
}
button:hover, .button:hover { background: #3a2f26; border-color: #76563f; }
button:disabled { opacity: .55; cursor: wait; }
.tabs button { border-color: transparent; background: transparent; color: var(--muted); }
.tabs button[aria-pressed="true"] { color: #ffbf91; background: #35261c; border-color: #65452f; }
.primary { background: var(--ember); border-color: var(--ember); color: #26130a; }
.primary:hover { background: #ffbc91; border-color: #ffbc91; }
.status-line { color: var(--muted); min-height: 25px; margin: 6px 0; font-size: .9rem; }
.status-line[data-tone="error"] { color: #ffad9c; }
.status-line[data-tone="ok"] { color: var(--green); }
.desk { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); align-items: start; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 17px; min-width: 0; }
.queue { padding: 16px; display: grid; gap: 12px; }
.queue-head, .section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.queue-head { align-items: center; }
h2 { font-size: 1.34rem; line-height: 1.2; letter-spacing: -.025em; overflow-wrap: anywhere; }
h3 { font-size: 1.09rem; }
.section-heading p:not(.thread-meta), .blank p { color: var(--muted); margin-top: 5px; }
.icon-button { width: 43px; padding: 0; font-size: 1.2rem; }
.queue-filters, .flow { display: grid; gap: 14px; }
.queue-filters { gap: 8px; }
.detail, .account-panel { padding: clamp(16px, 3vw, 26px); }
.account-panel { max-width: 720px; }
.blank { min-height: 340px; display: grid; align-content: center; justify-items: center; text-align: center; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
label { display: grid; gap: 5px; color: #ecdccc; font-size: .9rem; }
.optional, .hint, label small { color: var(--muted); font-weight: 400; }
.optional { display: inline; font-size: .78rem; }
input:not([type="checkbox"], [type="radio"]), select, textarea {
  min-width: 0; width: 100%; min-height: 43px; border-radius: 9px; border: 1px solid #5a463a; padding: 9px 11px;
  background: #191512; color: var(--text);
}
input[type="file"] { max-width: 100%; }
input::file-selector-button { color: var(--text); background: #493428; border: 0; border-radius: 5px; padding: 4px 8px; margin-right: 8px; cursor: pointer; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #ab9a8b; }
.products { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; min-inline-size: 0; border: 0; padding: 0; }
.products legend { padding: 0 0 6px; color: #ecdccc; font-size: .9rem; }
.products label { position: relative; display: block; }
.products input { position: absolute; opacity: 0; }
.products span { display: grid; place-items: center; min-height: 46px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; overflow-wrap: anywhere; text-align: center; }
.products input:checked + span { background: #3a291f; border-color: #c68050; color: #ffbc91; }
.products input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.hint, .signin { font-size: .9rem; }
.signin, #account-result { padding: 12px 14px; border-radius: 10px; border: 1px solid #624532; background: #302219; }
.signin a { display: inline-block; margin-top: 4px; }
.ticket-list { display: flex; flex-direction: column; gap: 7px; max-height: 570px; overflow: auto; scrollbar-gutter: stable; padding: 3px; }
.ticket-list p { color: var(--muted); font-size: .9rem; }
.ticket { display: grid; flex: none; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 10px 11px; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.ticket strong, .ticket small { min-width: 0; }
.ticket small, .thread-meta { color: #e4b293; font-size: .79rem; }
.ticket[aria-current="true"] { background: #413026; border-color: #a26b44; }
.thread-meta { margin-bottom: 4px; }
.thread-tools { gap: 8px; }
.thread-tools select, .thread-tools input { width: auto; max-width: 100%; }
.messages { display: grid; align-content: start; gap: 9px; max-height: 500px; overflow: auto; }
.message { padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; background: #181513; overflow-wrap: anywhere; }
.message.own { background: #30231d; margin-left: 22px; }
.message.internal { border-color: #8c6940; background: #32281c; }
.message time { color: var(--muted); font-size: .78rem; margin-left: 8px; }
.message p { white-space: pre-wrap; }
.message img { display: block; max-width: 100%; max-height: 360px; object-fit: contain; margin-top: 8px; }
.reply { display: grid; gap: 9px; }
.reply .actions { justify-content: space-between; }
.check { display: inline-flex; align-items: center; min-height: 44px; }
.check input { accent-color: var(--ember); }
.footer { margin-top: 32px; padding-block: 18px 26px; border-top: 1px solid var(--line); color: var(--muted); gap: 8px 21px; font-size: .88rem; }
.footer a { color: var(--muted); }
dialog { width: min(480px, calc(100% - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: 17px; color: var(--text); padding: 20px; }
dialog::backdrop { background: #0c0a08c9; }
dialog p { margin: 8px 0; }
dialog form { display: grid; gap: 9px; }
@media (max-width: 720px) {
  .shell { width: calc(100% - 28px); }
  .desk { grid-template-columns: minmax(0, 1fr); }
  .queue { padding: 13px; }
  .ticket-list { max-height: 180px; }
  .status-line:empty { min-height: 0; }
}
@media (max-width: 470px) {
  .header-inner { min-height: 54px; }
  .brand { font-size: 1rem; gap: 6px; }
  .brand-icon { width: 31px; height: 31px; }
  .header nav { gap: 4px; }
  .header nav a { font-size: .75rem; }
  .intro { grid-template-columns: 1fr; min-height: 0; margin-top: 15px; padding: 25px 20px; }
  .intro-sign { display: none; }
  .tabs button { padding-inline: 10px; font-size: .84rem; }
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .section-heading { flex-wrap: wrap; }
}
