@font-face {
  font-family: "Azu";
  src: url("/afro_test.otf?v=20260824a") format("opentype");
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #182026;
  --muted: #5c6870;
  --paper: #f7f8f5;
  --panel: #ffffff;
  --line: #d8ded7;
  --green: #176b52;
  --shadow: 0 16px 40px rgba(24, 32, 38, 0.08);
  --rail: #f1f2ee;
}

html[data-theme="ink"] {
  color-scheme: dark;
  --ink: #e8ebe4;
  --muted: #9aa39a;
  --paper: #161a17;
  --panel: #222824;
  --line: #3a433c;
  --green: #4cb08a;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  --rail: #121512;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.45;
}

:is(html, body)[data-script="azu"] .script-content,
:is(html, body)[data-script="azu"] .account-chip,
:is(html, body)[data-script="azu"] .signin-form,
:is(html, body)[data-script="azu"] .result-item,
:is(html, body)[data-script="azu"] .msg,
:is(html, body)[data-script="azu"] .hello,
:is(html, body)[data-script="azu"] .new-chat,
:is(html, body)[data-script="azu"] .rail-item,
:is(html, body)[data-script="azu"] .pane-card,
:is(html, body)[data-script="azu"] .profile-card,
:is(html, body)[data-script="azu"] .ticket-bar,
:is(html, body)[data-script="azu"] .thread-item,
:is(html, body)[data-script="azu"] .search,
:is(html, body)[data-script="azu"] .results {
  font-family: "Azu", Georgia, serif;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 40px);
}

body.desk-app {
  min-height: 100dvh;
}

.desk-top {
  justify-content: flex-end;
  background: transparent;
}

.desk {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: calc(100dvh - 88px);
  padding: 0 20px 18vh;
  gap: 18px;
}

.desk-logo,
.desk-logo img {
  width: 72px;
  height: 72px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(560px, 100%);
  padding: 10px 12px 10px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
  outline: none;
}

.search button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  cursor: pointer;
}

.search svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.results {
  width: min(560px, 100%);
}

.dot-menu {
  position: relative;
}

.dot-menu summary {
  list-style: none;
  cursor: pointer;
}

.dot-menu summary::-webkit-details-marker {
  display: none;
}

.dots {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  color: var(--ink);
}

.dots svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.dot-tray {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 20;
  display: flex;
  gap: 8px;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.dot-menu:not([open]) .dot-tray {
  display: none;
}

.dot-item {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
}

.dot-item svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.desk-profile .profile-card {
  left: auto;
  right: 0;
  bottom: auto;
  top: calc(100% + 10px);
}

.rail-toggle {
  display: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  color: var(--ink);
  cursor: pointer;
}

.rail-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.rail-scrim {
  display: none;
}

.top-start,
.top-end {
  display: flex;
  align-items: center;
  gap: 10px;
}

.script-switcher,
.orb-menu {
  position: relative;
}

.script-switcher summary,
.orb-menu summary {
  list-style: none;
  cursor: pointer;
}

.script-switcher summary::-webkit-details-marker,
.orb-menu summary::-webkit-details-marker {
  display: none;
}

.brand {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.brand img {
  display: block;
  width: 42px;
  height: 42px;
}

.script-symbol,
.orb {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
}

.script-symbol {
  font-size: 1.25rem;
}

.azu-letter,
:is(html, body)[data-script="azu"] .script-symbol {
  font-family: "Azu", Georgia, serif;
}

.script-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.script-switcher:not([open]) .script-menu,
.orb-menu:not([open]) .orb-tray {
  display: none;
}

.script-option {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.2rem;
}

.script-option.is-active {
  background: var(--ink);
  color: white;
}

.orb span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--ink);
}

.orb-tray {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 20;
  display: flex;
  gap: 8px;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.orb-item {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px dashed var(--line);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.55rem;
  letter-spacing: 0.02em;
}

a.orb-item {
  border-style: solid;
}

html.chat-app,
body.chat-app {
  height: 100dvh;
  overflow: hidden;
}

body.chat-app {
  display: flex;
  flex-direction: column;
}

.app {
  display: flex;
  flex: 1;
  min-height: 0;
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 260px;
  padding: 12px;
  border-right: 1px solid var(--line);
  background: var(--rail);
  position: relative;
}

.stage-toggle {
  display: none;
}

.rail-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rail-collapse {
  margin-left: auto;
}

.rail-collapse {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
  color: var(--ink);
  cursor: pointer;
}

.rail-collapse svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

html.rail-slim .rail-collapse svg {
  transform: rotate(180deg);
}

html.rail-slim .rail {
  width: 72px;
  align-items: center;
}

html.rail-slim .rail-label,
html.rail-slim .rail-agents,
html.rail-slim .threads {
  display: none;
}

.rail-brand {
  width: 32px;
  height: 32px;
  margin: 0;
}

.rail-brand img {
  width: 32px;
  height: 32px;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rail-item,
.new-chat {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.rail-item.is-current,
.new-chat.is-current,
.thread-item.is-current {
  background: var(--panel);
}

.rail-ico {
  width: 1.2rem;
  text-align: center;
  color: var(--muted);
}

.rail-agents {
  margin: 12px 4px 0;
}

.rail-agents h2,
.kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.agent-item {
  margin: 0;
  padding: 4px 6px;
  color: var(--ink);
  font-size: 0.9rem;
}

.pane {
  flex: 1;
  overflow: auto;
  padding: 28px 20px;
}

.pane-card {
  width: min(640px, 100%);
  margin: 8vh auto 0;
  padding: 22px 22px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.pane-card h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.pane-card p {
  margin: 0 0 12px;
  color: var(--muted);
}

.pair-code {
  font-size: 2rem;
  letter-spacing: 0.18em;
  color: var(--ink);
}

.cmd,
.file-view {
  overflow: auto;
  padding: 10px 12px;
  background: var(--paper);
  border-radius: 10px;
  font-size: 0.85rem;
}

.files {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

.files button {
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.view {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.view.is-current {
  display: flex;
}

.threads {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: auto;
}

.thread-item {
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-item.is-current {
  background: var(--panel);
}

.stage {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

.thread {
  flex: 1;
  overflow: auto;
  padding: 12px 16px 8px;
}

.hello {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin: 12vh 0 8vh;
  color: var(--ink);
}

.hello h1 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 600;
  text-align: center;
}

.msg {
  width: min(720px, 100%);
  margin: 0 auto 14px;
}

.msg.user .msg-body {
  margin-left: auto;
  width: fit-content;
  max-width: 85%;
  padding: 10px 14px;
  background: var(--ink);
  color: white;
  border-radius: 18px 18px 6px 18px;
}

.msg.support .msg-body {
  padding: 12px 4px;
}

.msg-body h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.msg-body p,
.escalate {
  margin: 0 0 8px;
  color: var(--muted);
}

.escalate a,
.escalate .js-person,
button.js-person {
  color: var(--ink);
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.msg.person .msg-body {
  padding: 12px 4px;
}

.escalate.quiet {
  font-size: 0.85rem;
}

.msg.pending .msg-body p {
  letter-spacing: 0.16em;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: min(720px, calc(100% - 24px));
  margin: 0 auto 16px;
  padding: 10px 8px 10px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.composer-plus {
  position: relative;
}

.composer-plus summary {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  list-style: none;
  cursor: pointer;
  color: var(--ink);
}

.composer-plus summary::-webkit-details-marker {
  display: none;
}

.composer-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  display: grid;
  gap: 4px;
  min-width: 160px;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.composer-plus:not([open]) .composer-menu {
  display: none;
}

.composer-menu button,
.composer-menu a {
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  font: inherit;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.composer textarea {
  flex: 1;
  min-width: 0;
  max-height: 160px;
  border: 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
  line-height: 1.4;
  outline: none;
}

.composer button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  cursor: pointer;
}

.composer svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.profile-card .signin-form,
.profile-card .note,
.profile-card .account-chip {
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.result-item,
.account-chip,
.signin-form,
.note {
  padding: 16px 18px;
  margin: 0 0 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.result-item h2,
.account-chip strong {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 600;
}

.result-item p,
.note,
.signin-form p {
  margin: 0;
  color: var(--muted);
}

.meter {
  display: block;
  height: 4px;
  margin: 8px 0 0;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.meter > span {
  display: block;
  height: 100%;
  background: var(--green);
}

.signin-form {
  min-width: 0;
}

.profile-pop {
  position: relative;
  margin-top: auto;
}

.profile-pop summary {
  list-style: none;
  cursor: pointer;
}

.profile-pop summary::-webkit-details-marker {
  display: none;
}

.profile-round {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font-weight: 600;
}

.profile-card {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 40;
  width: min(280px, 72vw);
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.profile-pop:not([open]) .profile-card {
  display: none;
}

.profile-sheet strong {
  display: block;
  margin: 0 0 8px;
  word-break: break-all;
}

.theme-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0 0;
}

.theme-row button {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  cursor: pointer;
}

.theme-row button.is-active {
  background: var(--ink);
  color: var(--paper);
}

.ticket-bar {
  padding: 8px 20px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.ticket-list ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.ticket-list li {
  display: grid;
  gap: 4px;
  margin: 0 0 10px;
  font-size: 0.85rem;
}

.ticket-open {
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.signin-form label {
  display: block;
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.signin-form input {
  width: 100%;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}

.credit-form {
  margin: 8px 0 0;
}

.credit-form button,
.signin-form button,
.ghost {
  border: 0;
  background: var(--ink);
  color: white;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
}

.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.account-chip {
  min-width: 160px;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.register {
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .rail-toggle,
  .stage-toggle {
    display: grid;
  }

  .stage-toggle {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
  }

  .rail {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 30;
    width: min(280px, 86vw);
    box-shadow: var(--shadow);
  }

  .rail.is-open {
    display: flex;
  }

  .rail-scrim.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(24, 32, 38, 0.28);
  }

  .orb-tray {
    flex-wrap: wrap;
    max-width: 180px;
    border-radius: 22px;
  }
}
