/* SauFox customer portal. Same palette as the main site; a dashboard
   layout: sidebar, top bar, and panels. */

@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("assets/fonts/vazirmatn-nl.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0b0b0d;
  --panel: #151518;
  --panel-2: #1c1c20;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f5f3ef;
  --soft: #d9d6d0;
  --muted: #8e8c95;
  --accent: #ff7a1a;
  --green: #57d6a3;
  --gold: #e6b84a;
  --radius: 12px;
  --side: 248px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

:lang(fa) {
  --font: "Vazirmatn", "Inter", Tahoma, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* No blue box flashing on whatever a finger taps (phones). */
html {
  -webkit-tap-highlight-color: transparent;
}

*,
*::before,
*::after {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--soft);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
}

svg {
  width: 20px;
  height: 20px;
  flex: none;
}

/* ---------- Loading ---------- */
.boot {
  display: none;
}

.is-booting .boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}

.boot img {
  width: 64px;
  height: auto;
  opacity: 0.7;
  animation: breathe 1.4s ease-in-out infinite;
}

@keyframes breathe {
  50% {
    opacity: 0.25;
    transform: scale(0.96);
  }
}

.loading {
  display: grid;
  place-items: center;
  min-height: 240px;
}

.loading span {
  width: 28px;
  height: 28px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Buttons, fields ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: 600 14px/1 var(--font);
  color: var(--text);
  background: var(--panel-2);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.button:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.button--primary {
  border-color: transparent;
  color: #1a0d04;
  background: var(--accent);
}

.button--primary:hover {
  background: #ff8c3a;
}

.button--quiet {
  border-color: transparent;
  color: var(--muted);
  background: none;
}

.button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.button svg {
  width: 18px;
  height: 18px;
}

input,
select,
textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: 15px/1.6 var(--font);
  color: var(--text);
  background: var(--bg);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lang {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 600 12px/1 "Vazirmatn", var(--font);
  color: var(--muted);
  background: none;
  cursor: pointer;
}

.lang:hover {
  color: var(--text);
}

/* ---------- Sign-in screen ---------- */
.gate {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px 16px;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(255, 122, 26, 0.12), transparent 70%),
    radial-gradient(50% 40% at 50% 100%, rgba(255, 255, 255, 0.04), transparent 70%);
}

.gate__card {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(440px, 100%);
  padding: 40px 32px 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.gate__logo {
  width: 96px;
  height: auto;
  margin-bottom: 8px;
}

.gate__kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.gate__title {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  color: var(--text);
}

.gate__lead {
  margin: 0 0 12px;
  color: var(--muted);
}

.gate__problem {
  margin: 0 0 6px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  color: #ffb4a8;
  background: rgba(255, 90, 60, 0.1);
}

.gate__go {
  width: 100%;
  height: 48px;
  font-size: 15px;
}

.gate__alt {
  margin: 6px 0 10px;
  font-size: 14px;
  color: var(--muted);
}

.gate__wait {
  display: grid;
  place-items: center;
  min-height: 100vh;
  margin: 0;
  color: var(--muted);
}

/* ---------- App layout ---------- */
.app {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 22px 14px;
  border-inline-end: 1px solid var(--line);
  background: linear-gradient(180deg, #111114, #0d0d0f);
}

.side__brand {
  display: grid;
  gap: 6px;
  padding: 4px 10px 22px;
  text-decoration: none;
}

.side__brand img {
  width: 132px;
  height: auto;
  filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.12));
}

.side__brand span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.side__nav {
  display: grid;
  gap: 4px;
}

.side__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.side__link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.side__link.is-here {
  color: var(--text);
  background: rgba(255, 122, 26, 0.12);
  box-shadow: inset 3px 0 0 var(--accent);
}

[dir="rtl"] .side__link.is-here {
  box-shadow: inset -3px 0 0 var(--accent);
}

.side__link.is-here svg {
  color: var(--accent);
}

.side__count {
  margin-inline-start: auto;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: #1a0d04;
  background: var(--accent);
}

.side__foot {
  display: grid;
  justify-items: start;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.side__link--quiet {
  width: 100%;
  font-size: 14px;
}

[dir="rtl"] .side__link--quiet svg,
[dir="rtl"] .back svg {
  transform: scaleX(-1);
}

.main {
  min-width: 0;
}

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 clamp(16px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
  background: rgba(11, 11, 13, 0.85);
  backdrop-filter: blur(12px);
}

.top__where {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

.top__me {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.top__name {
  font-size: 14px;
  color: var(--text);
}

.top__out {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: none;
  cursor: pointer;
}

.top__out:hover {
  color: var(--text);
}

[dir="rtl"] .top__out svg {
  transform: scaleX(-1);
}

.view {
  display: grid;
  gap: 22px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px clamp(16px, 3vw, 36px) 72px;
  outline: none;
}

/* ---------- Pieces ---------- */
.hello {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.hello__title {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
  color: var(--text);
}

.hello__lead {
  margin: 6px 0 0;
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.stat {
  display: grid;
  gap: 4px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.stat__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat__value {
  font-size: 30px;
  line-height: 1.1;
  color: var(--text);
}

.stat__note {
  font-size: 12px;
  color: var(--muted);
}

.stat--hot {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  background: linear-gradient(135deg, rgba(255, 122, 26, 0.14), var(--panel) 60%);
}

.stat--hot .stat__value {
  color: var(--accent);
}

.stat--gold .stat__value {
  color: var(--gold);
}

.stat--titanium .stat__value {
  color: #dfe5ea;
}

.stat--iron .stat__value {
  color: #aab0b7;
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel__head h2,
.panel h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel__head a {
  font-size: 13px;
  text-decoration: none;
}

.rows {
  display: grid;
  gap: 8px;
}

.row {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: inherit;
  background: var(--panel-2);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

a.row:hover {
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.row.is-unread {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.row--closed {
  opacity: 0.72;
}

.row__top {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.row__num {
  color: var(--muted);
}

.row__new {
  margin-inline-start: auto;
  font-weight: 700;
  color: var(--accent);
}

.row__title {
  color: var(--text);
}

.row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  font-size: 13px;
  color: var(--muted);
}

.row__help {
  margin-inline-start: auto;
  font-weight: 600;
  text-decoration: none;
}

.badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
}

.badge--open,
.badge--order-awaiting_payment {
  color: #ffb070;
  background: rgba(255, 122, 26, 0.14);
}

.badge--answered,
.badge--order-paid,
.badge--order-completed {
  color: var(--green);
  background: rgba(62, 194, 143, 0.14);
}

.badge--order-processing {
  color: #9cc4ff;
  background: rgba(90, 150, 255, 0.14);
}

.empty {
  display: grid;
  gap: 4px;
  padding: 26px 16px;
  text-align: center;
  color: var(--muted);
}

.empty p {
  margin: 0;
}

.empty__hint {
  font-size: 14px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 600 13px/1 var(--font);
  color: var(--muted);
  background: none;
  cursor: pointer;
}

.chip small {
  opacity: 0.7;
}

.chip.is-on {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(255, 122, 26, 0.12);
}

.search {
  width: min(280px, 100%);
  height: 38px;
  padding: 0 14px;
}

/* ---------- Forms ---------- */
.form {
  display: grid;
  gap: 16px;
}

.form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.field small {
  font-weight: 400;
}

.attach {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.attach input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.attach__button {
  padding: 8px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  color: var(--text);
  white-space: nowrap;
}

.attach:hover .attach__button {
  border-color: var(--accent);
}

.attach__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.note {
  flex: 1 1 160px;
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- One ticket ---------- */
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
}

.back:hover {
  color: var(--text);
}

.back svg {
  width: 16px;
  height: 16px;
}

.kicker {
  margin: 14px 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.ticket-head__title {
  margin: 0;
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.3;
  color: var(--text);
}

.ticket-head__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.thread {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.msg {
  max-width: 86%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.msg--staff {
  justify-self: end;
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  background: linear-gradient(135deg, rgba(255, 122, 26, 0.1), var(--panel) 60%);
}

.msg__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 6px;
  font-size: 13px;
}

.msg__head strong {
  color: var(--text);
}

.msg__head time {
  color: var(--muted);
}

.msg__mark {
  width: 22px;
  height: auto;
}

.msg__tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  color: #1a0d04;
  background: var(--accent);
}

.msg__body {
  margin: 0;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #e6e3de;
}

.msg__file {
  display: inline-block;
  margin-top: 10px;
  font-size: 14px;
}

.msg__file img {
  display: block;
  max-width: min(320px, 100%);
  max-height: 240px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* ---------- Help ---------- */
.helps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.help {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--panel);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.help:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.help strong {
  color: var(--text);
}

.contact {
  display: grid;
  gap: 10px;
}

.contact p {
  display: flex;
  gap: 16px;
  margin: 0;
}

.contact span {
  min-width: 60px;
  color: var(--muted);
}

/* ---------- Small screens: the sidebar becomes a bar at the bottom ---------- */
@media (max-width: 820px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .side {
    position: fixed;
    inset: auto 0 0;
    z-index: 10;
    flex-direction: row;
    height: auto;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-inline-end: 0;
    border-top: 1px solid var(--line);
    background: rgba(13, 13, 15, 0.96);
    backdrop-filter: blur(12px);
  }

  .side__brand,
  .side__foot {
    display: none;
  }

  .side__nav {
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    width: 100%;
  }

  .side__link {
    position: relative;
    flex-direction: column;
    gap: 3px;
    padding: 8px 4px;
    font-size: 11px;
    text-align: center;
  }

  .side__link.is-here,
  [dir="rtl"] .side__link.is-here {
    box-shadow: none;
  }

  .side__count {
    position: absolute;
    top: 2px;
    inset-inline-end: 22%;
    margin: 0;
  }

  .view {
    padding-bottom: 110px;
  }

  .top__name {
    display: none;
  }

  .msg {
    max-width: 100%;
  }
}

/* ---------- Chat (a ticket) and the admins' desk ---------- */
.view--chat,
.view--desk {
  display: block;
  height: calc(100vh - 64px);
  height: calc(100dvh - 64px);
  padding-top: 18px;
  padding-bottom: 18px;
}

.view--desk {
  max-width: none;
  padding: 0;
}

.chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(255, 122, 26, 0.05), transparent 60%),
    var(--panel);
  overflow: hidden;
}

.chat--desk {
  border: 0;
  border-radius: 0;
}

.chat__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(21, 21, 24, 0.9);
}

.chat__back {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--muted);
}

.chat__back:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

[dir="rtl"] .chat__back svg {
  transform: scaleX(-1);
}

.chat--desk .chat__back {
  display: none;
}

.chat__title {
  flex: 1;
  min-width: 0;
}

.chat__who {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.chat__who strong {
  display: block;
  color: var(--text);
}

.chat__mail {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}

.chat__avatar,
.conv__avatar,
.bubble__face--text {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  background: linear-gradient(135deg, #3a3a42, #232328);
  border: 1px solid var(--line);
}

.chat__subject {
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat__subject b {
  color: var(--muted);
  font-weight: 600;
}

.chat__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.chat__toggle {
  flex: none;
  height: 36px;
}

.chat__order {
  margin: 0;
  padding: 8px 18px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.chat__order:empty {
  display: none;
}

.chat__list {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 18px 18px 8px;
  overflow-y: auto;
  list-style: none;
  overscroll-behavior: contain;
}

.chat__day {
  display: flex;
  justify-content: center;
  margin: 14px 0 12px;
}

.chat__day span {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

/* A message: on the near side with a face, or on the far side. */
.bubble {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 0 0 4px;
}

.bubble--last {
  margin-bottom: 14px;
}

.bubble--mine {
  flex-direction: row-reverse;
}

.bubble__face,
.bubble__gap {
  flex: none;
  width: 32px;
}

img.bubble__face {
  height: auto;
}

.bubble__face--text {
  width: 32px;
  height: 32px;
  font-size: 11px;
}

.bubble--mine .bubble__gap {
  display: none;
}

.bubble__box {
  position: relative;
  max-width: min(72%, 560px);
  padding: 9px 13px 7px;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.bubble--last:not(.bubble--mine) .bubble__box {
  border-end-start-radius: 4px;
}

.bubble--mine .bubble__box {
  border-color: transparent;
  background: linear-gradient(135deg, #ff8a33, #ff6a00);
}

.bubble--mine.bubble--last .bubble__box {
  border-end-end-radius: 4px;
}

.bubble__who {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  color: var(--accent);
}

.bubble--staff:not(.bubble--mine) .bubble__who {
  color: var(--gold);
}

.bubble__text {
  margin: 0;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
}

.bubble--mine .bubble__text {
  color: #1a0d04;
}

.bubble__file {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  color: inherit;
}

.bubble__file img {
  display: block;
  max-width: 100%;
  max-height: 260px;
  border-radius: 10px;
}

.bubble__time {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  text-align: end;
  color: var(--muted);
}

.bubble--mine .bubble__time {
  color: rgba(26, 13, 4, 0.65);
}

/* The box at the bottom. */
.chat__form {
  padding: 10px 14px 14px;
  border-top: 1px solid var(--line);
  background: rgba(21, 21, 24, 0.95);
}

.chat__closed,
.chat__note {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
}

.chat__note:empty {
  display: none;
}

.chat__bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.chat__input {
  flex: 1;
  min-height: 44px;
  max-height: 180px;
  padding: 11px 14px;
  border-radius: 22px;
  resize: none;
  line-height: 1.45;
}

.chat__attach,
.chat__send {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--panel-2);
  cursor: pointer;
}

.chat__attach:hover {
  color: var(--text);
}

.chat__send {
  border-color: transparent;
  color: #1a0d04;
  background: var(--accent);
}

.chat__send:hover {
  background: #ff8c3a;
}

.chat__send:disabled {
  opacity: 0.6;
}

[dir="rtl"] .chat__send svg {
  transform: scaleX(-1);
}

.chat__file-name {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.chat__file-name:empty {
  display: none;
}

/* The desk: conversations on one side, the chat on the other. */
.desk {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  height: 100%;
}

.desk__list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-inline-end: 1px solid var(--line);
  background: #111114;
}

.desk__tools {
  display: grid;
  gap: 10px;
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--line);
}

.desk__title {
  margin: 0;
  font-size: 18px;
  color: var(--text);
}

.chips--small .chip {
  height: 30px;
  padding: 0 11px;
  font-size: 12px;
}

.desk__tools .search {
  width: 100%;
}

.desk__rows {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px;
}

.conv {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}

.conv:hover {
  background: rgba(255, 255, 255, 0.04);
}

.conv.is-here {
  background: rgba(255, 122, 26, 0.12);
}

.conv__main {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.conv__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.conv__top strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv__top time {
  flex: none;
  font-size: 11px;
  color: var(--muted);
}

.conv__subject,
.conv__last {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv__subject {
  color: var(--soft);
}

.conv__last {
  color: var(--muted);
}

.conv.is-unread .conv__top strong,
.conv.is-unread .conv__last {
  color: var(--text);
  font-weight: 600;
}

.conv__dot {
  position: absolute;
  top: 16px;
  inset-inline-end: 10px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.2);
}

.conv.is-unread .conv__top time {
  margin-inline-end: 14px;
}

.desk__pane {
  min-width: 0;
  min-height: 0;
}

.desk__empty {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  height: 100%;
  color: var(--muted);
}

.desk__empty img {
  width: 72px;
  height: auto;
  opacity: 0.35;
}

@media (max-width: 820px) {
  .view--chat,
  .view--desk {
    height: calc(100vh - 64px - 64px);
    height: calc(100dvh - 64px - 64px);
    padding: 0;
  }

  .view--chat .chat {
    border: 0;
    border-radius: 0;
  }

  .desk {
    grid-template-columns: minmax(0, 1fr);
  }

  .desk--open .desk__list,
  .desk:not(.desk--open) .desk__pane {
    display: none;
  }

  .chat--desk .chat__back {
    display: grid;
  }

  .bubble__box {
    max-width: 82%;
  }
}

.badge {
  white-space: nowrap;
}

@media (max-width: 820px) {
  .side__link span {
    max-width: 100%;
    overflow: hidden;
    font-size: 10.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .chat__head {
    padding: 10px 12px;
    gap: 8px;
  }

  .chat__meta span:not(.badge) {
    display: none;
  }
}

/* ---------- Motion ----------
   One curve for everything (a long, soft ease-out), a springy one for
   things that pop. portal.js drives the entrances; these are the hovers,
   the glides and the ambient bits. All of it stops for people who ask
   their system for less motion (the block at the very end). */
:root {
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --glide: cubic-bezier(0.34, 1.2, 0.64, 1);
}

/* A thin, glowing scrollbar, like the main site's. */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 122, 26, 0.55) transparent;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, #ffb070, #ff7a1a 50%, #ff5a00);
  box-shadow: 0 0 8px rgba(255, 122, 26, 0.7);
}

/* The page on its way out, while the next one loads. */
.view {
  transition: opacity 0.35s var(--ease), filter 0.35s var(--ease), transform 0.5s var(--ease);
}

.view.is-leaving {
  opacity: 0.35;
  filter: blur(2px) saturate(0.8);
  transform: scale(0.995);
  pointer-events: none;
}

/* A spinner only when loading takes a moment. */
.loading span {
  animation: spin 0.8s linear infinite, appear 0.4s 0.2s var(--ease) both;
}

@keyframes appear {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}

/* The loading line under the top bar. */
.top__progress {
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ff9a4a 30%, var(--accent) 70%, #ffd2a8);
  box-shadow: 0 0 10px rgba(255, 122, 26, 0.8), 0 0 2px rgba(255, 180, 120, 0.9);
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
  pointer-events: none;
}

[dir="rtl"] .top__progress {
  transform-origin: right;
}

.top__progress.is-going {
  opacity: 1;
  transform: scaleX(0.85);
  transition: transform 6s cubic-bezier(0.1, 0.8, 0.2, 1), opacity 0.2s ease;
}

.top__progress.is-done {
  opacity: 0;
  transform: scaleX(1);
  transition: transform 0.35s var(--ease), opacity 0.5s 0.3s ease;
}

/* The sidebar: a highlight that glides to the current page. */
.side__nav {
  position: relative;
}

.side__pill {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(255, 122, 26, 0.16), rgba(255, 122, 26, 0.07));
  box-shadow: inset 3px 0 0 var(--accent), 0 0 24px rgba(255, 122, 26, 0.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

[dir="rtl"] .side__pill {
  background: linear-gradient(270deg, rgba(255, 122, 26, 0.16), rgba(255, 122, 26, 0.07));
  box-shadow: inset -3px 0 0 var(--accent), 0 0 24px rgba(255, 122, 26, 0.08);
}

.side__pill.is-shown {
  opacity: 1;
}

.side__pill.is-ready {
  transition: transform 0.6s var(--glide), width 0.6s var(--glide), height 0.6s var(--glide), opacity 0.3s ease;
}

.side__link {
  position: relative;
  z-index: 1;
  overflow: hidden;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

.side__link.is-here,
[dir="rtl"] .side__link.is-here {
  background: none;
  box-shadow: none;
}

.side__link svg {
  transition: transform 0.45s var(--spring), color 0.3s ease;
}

.side__link:hover svg {
  transform: translateY(-1px) scale(1.12);
}

.side__link.is-here svg {
  filter: drop-shadow(0 0 6px rgba(255, 122, 26, 0.55));
}

[dir="rtl"] .side__link--quiet:hover svg {
  transform: scaleX(-1) translateX(2px);
}

.side__link--quiet:hover svg {
  transform: translateX(-2px);
}

.side__brand img {
  transition: filter 0.5s var(--ease), transform 0.6s var(--ease);
}

.side__brand:hover img {
  transform: scale(1.03);
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.22));
}

.side__count {
  box-shadow: 0 0 0 0 rgba(255, 122, 26, 0.5);
  animation: beacon 2.4s var(--ease) infinite;
}

@keyframes beacon {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 122, 26, 0.55);
  }
  70%,
  100% {
    box-shadow: 0 0 0 8px rgba(255, 122, 26, 0);
  }
}

@media (max-width: 820px) {
  .side__pill,
  [dir="rtl"] .side__pill {
    background: rgba(255, 122, 26, 0.1);
    box-shadow: none;
  }

  .side__pill::after {
    content: "";
    position: absolute;
    top: -7px;
    left: 50%;
    width: 22px;
    height: 3px;
    margin-left: -11px;
    border-radius: 0 0 3px 3px;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(255, 122, 26, 0.9);
  }

  .side__link {
    overflow: visible;
  }
}

/* Cards light up where the pointer is (portal.js sets --mx and --my). */
.glow {
  position: relative;
  isolation: isolate;
}

.glow::before,
.glow::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--ease);
}

.glow::before {
  inset: 0;
  z-index: -1;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 122, 26, 0.09), transparent 65%);
}

/* The rim catches the light too. */
.glow::after {
  inset: -1px;
  padding: 1px;
  background: radial-gradient(200px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 170, 110, 0.6), transparent 65%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.glow:hover::before,
.glow:hover::after {
  opacity: 1;
}

.stat,
.help,
.row,
.panel {
  transition: transform 0.5s var(--ease), border-color 0.4s var(--ease), box-shadow 0.5s var(--ease), background 0.4s var(--ease);
}

.stat:hover,
.help:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

a.row:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.stat--hot {
  animation: warm 3.2s ease-in-out infinite;
}

@keyframes warm {
  50% {
    box-shadow: 0 0 0 1px rgba(255, 122, 26, 0.25), 0 0 32px rgba(255, 122, 26, 0.14);
  }
}

.row.is-unread .row__new {
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  50% {
    opacity: 0.55;
  }
}

/* Buttons: a press that gives, a shine across the main ones, and ink
   where they're touched. */
.button,
.chip,
.chat__send,
.chat__attach {
  position: relative;
  overflow: hidden;
  transition: transform 0.5s var(--spring), background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.4s var(--ease);
}

.button:active,
.chip:active,
.chat__send:active,
.chat__attach:active {
  transform: scale(0.95);
  transition-duration: 0.12s;
}

.button--primary {
  box-shadow: 0 6px 18px rgba(255, 122, 26, 0.22);
}

.button--primary:hover {
  box-shadow: 0 10px 28px rgba(255, 122, 26, 0.38);
  transform: translateY(-1px);
}

.button--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.45) 50%, transparent 65%);
  transform: translateX(-120%);
  pointer-events: none;
}

.button--primary:hover::after {
  transform: translateX(120%);
  transition: transform 0.9s var(--ease);
}

.button svg {
  transition: transform 0.5s var(--spring);
}

.button--primary:hover svg {
  transform: rotate(90deg);
}

.ink {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  pointer-events: none;
}

.chip:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.chip.is-on {
  box-shadow: 0 0 18px rgba(255, 122, 26, 0.18);
}

.top__out,
.lang,
.chat__back,
.top__avatar {
  transition: transform 0.45s var(--spring), color 0.3s ease, border-color 0.3s ease, background 0.3s ease, box-shadow 0.4s ease;
}

.top__out:hover {
  transform: translateX(2px);
  border-color: rgba(255, 255, 255, 0.2);
}

[dir="rtl"] .top__out:hover {
  transform: translateX(-2px);
}

.top__avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.35);
}

.lang:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

/* Fields glow softly when in use. */
input,
select,
textarea {
  transition: border-color 0.35s var(--ease), box-shadow 0.45s var(--ease), background 0.35s ease;
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 4px rgba(255, 122, 26, 0.12), 0 0 24px rgba(255, 122, 26, 0.08);
}

.attach__button {
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.45s var(--spring);
}

.attach:hover .attach__button {
  background: rgba(255, 122, 26, 0.08);
  transform: translateY(-1px);
}

/* The sign-in screen: slow light drifting behind the card. */
.gate {
  position: relative;
  overflow: hidden;
}

.aurora {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.aurora i {
  position: absolute;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  will-change: transform;
}

.aurora i:nth-child(1) {
  top: -22vmax;
  left: -10vmax;
  background: radial-gradient(circle, rgba(255, 122, 26, 0.45), transparent 65%);
  animation: drift-a 22s ease-in-out infinite alternate;
}

.aurora i:nth-child(2) {
  right: -16vmax;
  bottom: -24vmax;
  background: radial-gradient(circle, rgba(230, 184, 74, 0.28), transparent 65%);
  animation: drift-b 26s ease-in-out infinite alternate;
}

.aurora i:nth-child(3) {
  top: 30%;
  left: 40%;
  width: 30vmax;
  height: 30vmax;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 65%);
  animation: drift-c 30s ease-in-out infinite alternate;
}

@keyframes drift-a {
  to {
    transform: translate(18vmax, 14vmax) scale(1.15);
  }
}

@keyframes drift-b {
  to {
    transform: translate(-16vmax, -12vmax) scale(0.9);
  }
}

@keyframes drift-c {
  to {
    transform: translate(-22vmax, 8vmax) scale(1.3);
  }
}

.gate__card {
  z-index: 1;
  background: rgba(21, 21, 24, 0.78);
  backdrop-filter: blur(18px);
}

.gate__logo {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  50% {
    transform: translateY(-6px);
    filter: drop-shadow(0 12px 18px rgba(255, 122, 26, 0.18));
  }
}

/* The desk and the chat. */
.conv {
  transition: background 0.35s var(--ease), transform 0.45s var(--ease);
}

.conv:hover {
  transform: translateX(3px);
}

[dir="rtl"] .conv:hover {
  transform: translateX(-3px);
}

.conv.is-here {
  box-shadow: inset 3px 0 0 var(--accent);
}

[dir="rtl"] .conv.is-here {
  box-shadow: inset -3px 0 0 var(--accent);
}

.conv__avatar {
  transition: transform 0.5s var(--spring), box-shadow 0.4s ease;
}

.conv:hover .conv__avatar {
  transform: scale(1.08) rotate(-4deg);
}

.conv.is-here .conv__avatar {
  box-shadow: 0 0 0 2px rgba(255, 122, 26, 0.55);
}

.conv__dot {
  animation: beacon 2s var(--ease) infinite;
}

.desk__empty img {
  animation: float 6s ease-in-out infinite;
}

.chat__day span {
  backdrop-filter: blur(6px);
}

.bubble__box {
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}

.bubble--mine .bubble__box {
  box-shadow: 0 6px 18px rgba(255, 106, 0, 0.18);
}

.bubble__file img {
  transition: transform 0.5s var(--ease), filter 0.4s ease;
}

.bubble__file:hover img {
  transform: scale(1.02);
  filter: brightness(1.08);
}

.chat__send {
  box-shadow: 0 6px 18px rgba(255, 122, 26, 0.28);
}

.chat__send:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 26px rgba(255, 122, 26, 0.45);
}

.chat__attach:hover svg {
  transform: rotate(-18deg);
}

.chat__attach svg {
  transition: transform 0.5s var(--spring);
}

.chat__input:focus {
  box-shadow: 0 0 0 4px rgba(255, 122, 26, 0.1);
}

.chat__back:hover svg {
  transform: translateX(-2px);
}

[dir="rtl"] .chat__back:hover svg {
  transform: scaleX(-1) translateX(-2px);
}

.chat__back svg {
  transition: transform 0.4s var(--spring);
}

.badge {
  transition: background 0.4s ease, color 0.4s ease;
}

/* Less motion, when asked for. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .aurora {
    display: none;
  }
}
