@font-face {
  font-family: "Onest";
  src: url("/account/fonts/Onest-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --page: #060b11;
  --base: #0a1017;
  --panel: #0e1620;
  --panel-raised: #121c27;
  --panel-hover: #172432;
  --line: #263543;
  --line-soft: #192631;
  --text: #f2f6fa;
  --text-secondary: #c5d0da;
  --text-service: #8a98a8;
  --text-muted: #5e6a78;
  --cyan: #44c7f4;
  --cyan-light: #7fe2ff;
  --cyan-dark: #159fc9;
  --green: #63c174;
  --amber: #d9b25f;
  --red: #d96a6a;
  --info: #5fa8d3;
  --font: "Onest", "Segoe UI", Arial, sans-serif;
  --shadow-panel: 0 18px 45px rgba(0, 0, 0, 0.22);
  --shadow-active: 0 0 24px rgba(68, 199, 244, 0.13);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--page);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--page);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.58;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 1.8;
}

:focus-visible {
  outline: 2px solid var(--cyan-light);
  outline-offset: 3px;
}

.portal-header {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 76px;
  padding: 0 max(24px, calc((100vw - 1500px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(6, 11, 17, 0.96);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.2);
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.wordmark span {
  margin-left: 5px;
  color: var(--cyan);
}

.portal-header__right,
.header-session,
.site-link,
.button--icon-text {
  display: flex;
  align-items: center;
}

.portal-header__right,
.header-session {
  gap: 14px;
}

.site-link {
  gap: 7px;
  color: var(--text-service);
  font-size: 14px;
  font-weight: 600;
  transition: color 170ms ease;
}

.site-link svg {
  width: 16px;
  height: 16px;
}

.site-link:hover {
  color: var(--cyan-light);
}

.header-session {
  padding-left: 15px;
  border-left: 1px solid var(--line);
}

.header-session span {
  max-width: 180px;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flash {
  position: fixed;
  z-index: 40;
  top: 92px;
  left: 50%;
  width: min(720px, calc(100vw - 32px));
  padding: 13px 17px;
  border: 1px solid rgba(68, 199, 244, 0.42);
  border-left: 3px solid var(--cyan);
  border-radius: 8px;
  background: #102331;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.38);
  color: #e7faff;
  font-size: 14px;
  transform: translateX(-50%);
}

.flash.is-error {
  border-color: rgba(217, 106, 106, 0.52);
  border-left-color: var(--red);
  background: #2a161b;
  color: #ffe5e7;
}

.login-view {
  position: relative;
  min-height: calc(100vh - 76px);
  padding: 64px 24px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background-color: var(--page);
  background-image:
    linear-gradient(rgba(68, 199, 244, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(68, 199, 244, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
}

.login-view::after {
  position: absolute;
  right: 0;
  bottom: 12%;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(68, 199, 244, 0.24), transparent);
  content: "";
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(500px, 100%);
  padding: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d151e;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.46), inset 0 1px rgba(255, 255, 255, 0.025);
}

.login-card::before,
.workspace-view::before {
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 22px rgba(68, 199, 244, 0.5);
  content: "";
}

.login-card::before {
  width: 34%;
}

.login-badge {
  width: fit-content;
  margin-bottom: 22px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(68, 199, 244, 0.28);
  border-radius: 999px;
  background: rgba(68, 199, 244, 0.08);
  color: var(--cyan-light);
  font-size: 12px;
  font-weight: 700;
}

.login-badge svg {
  width: 15px;
  height: 15px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-card h1,
.section-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.login-card h1 {
  font-size: 38px;
  font-weight: 760;
  line-height: 1.12;
}

.login-card__lead {
  margin: 14px 0 30px;
  color: var(--text-secondary);
}

.login-card__note {
  margin: 22px 0 0;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--text-service);
  font-size: 13px;
}

.login-card__note svg {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--cyan-dark);
}

.inline-link {
  color: var(--cyan-light);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(127, 226, 255, 0.35);
  text-underline-offset: 3px;
  transition: color 170ms ease, text-decoration-color 170ms ease;
}

.inline-link:hover {
  color: #fff;
  text-decoration-color: var(--cyan-light);
}

.registration-view {
  padding-top: 44px;
  padding-bottom: 44px;
}

.registration-card {
  width: min(760px, 100%);
}

.registration-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.registration-form__wide {
  grid-column: 1 / -1;
}

.registration-form label small {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
}

.consent-row {
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 11px !important;
  color: var(--text-service) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.45;
  text-transform: none !important;
}

.consent-row input {
  width: 18px;
  min-height: 18px;
  margin-top: 1px;
  accent-color: var(--cyan);
}

.form-stack {
  display: grid;
  gap: 18px;
}

.form-stack label,
.ticket-form label {
  display: grid;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

input,
textarea {
  width: 100%;
  border: 1px solid #304252;
  border-radius: 8px;
  background: #080e14;
  color: var(--text);
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
  transition: border-color 170ms ease, background-color 170ms ease, box-shadow 170ms ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input {
  min-height: 52px;
  padding: 0 15px;
}

textarea {
  min-height: 136px;
  padding: 14px 15px;
  resize: vertical;
}

input:hover,
textarea:hover {
  border-color: #3d5669;
}

input:focus,
textarea:focus {
  border-color: var(--cyan);
  background: #0a131b;
  box-shadow: 0 0 0 3px rgba(68, 199, 244, 0.1), 0 0 22px rgba(68, 199, 244, 0.08);
  outline: none;
}

.button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 720;
  cursor: pointer;
  transition: background-color 170ms ease, border-color 170ms ease, color 170ms ease, box-shadow 170ms ease, transform 170ms ease;
}

.button--icon-text {
  justify-content: center;
  gap: 8px;
}

.button:active {
  transform: translateY(1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button--primary {
  border-color: #57d8ff;
  background: var(--cyan);
  box-shadow: 0 9px 24px rgba(68, 199, 244, 0.12), inset 0 1px rgba(255, 255, 255, 0.28);
  color: #041119;
}

.button--primary:hover:not(:disabled) {
  background: var(--cyan-light);
  box-shadow: 0 12px 28px rgba(68, 199, 244, 0.2), inset 0 1px rgba(255, 255, 255, 0.36);
  transform: translateY(-1px);
}

.button--secondary {
  border-color: #3b5062;
  background: var(--panel-raised);
  color: var(--text-secondary);
}

.button--quiet {
  border-color: #30404e;
  background: transparent;
  color: var(--text-secondary);
}

.button--secondary:hover:not(:disabled),
.button--quiet:hover:not(:disabled) {
  border-color: var(--cyan-dark);
  background: rgba(68, 199, 244, 0.06);
  color: var(--cyan-light);
}

.button--danger {
  border-color: #713d44;
  background: #29171b;
  color: #ffbec3;
}

.portal-app {
  min-height: calc(100vh - 76px);
  background: var(--base);
}

.portal-shell {
  width: min(1500px, 100%);
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
}

.sidebar {
  padding: 30px 22px;
  border-right: 1px solid var(--line-soft);
  background: #080e14;
}

.sidebar__caption {
  margin: 0 8px 13px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar__identity {
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--base);
}

.sidebar__identity div {
  min-width: 0;
  display: grid;
}

.sidebar__identity strong {
  overflow: hidden;
  font-size: 16px;
  font-weight: 720;
  text-overflow: ellipsis;
}

.sidebar__identity > div > span {
  color: var(--text-service);
  font-size: 12px;
}

.avatar {
  position: relative;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(68, 199, 244, 0.62);
  border-radius: 50%;
  background: #0f2b39;
  box-shadow: 0 0 22px rgba(68, 199, 244, 0.13), inset 0 0 16px rgba(68, 199, 244, 0.06);
  color: var(--cyan-light);
  font-size: 18px;
  font-weight: 800;
}

.avatar--button {
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}

.avatar img,
.avatar-editor__preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.avatar__edit {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(3, 11, 17, 0.7);
  color: #fff;
  opacity: 0;
  transition: opacity 160ms ease;
}

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

.avatar--button:hover .avatar__edit,
.avatar--button:focus-visible .avatar__edit {
  opacity: 1;
}

.portal-nav {
  margin-top: 26px;
  display: grid;
  gap: 7px;
}

.portal-nav__item {
  position: relative;
  min-height: 50px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-service);
  font-size: 15px;
  font-weight: 620;
  text-align: left;
  cursor: pointer;
  transition: color 170ms ease, background-color 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.portal-nav__item::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: transparent;
  content: "";
}

.portal-nav__item:hover {
  background: #0e1821;
  color: var(--text);
}

.portal-nav__item.is-active {
  border-color: rgba(68, 199, 244, 0.18);
  background: rgba(68, 199, 244, 0.1);
  box-shadow: inset 0 1px rgba(127, 226, 255, 0.04), var(--shadow-active);
  color: var(--cyan-light);
}

.portal-nav__item.is-active::before {
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(68, 199, 244, 0.65);
}

.workspace {
  min-width: 0;
  padding: 46px 48px 80px;
  background-color: var(--base);
  background-image: linear-gradient(rgba(68, 199, 244, 0.018) 1px, transparent 1px);
  background-size: 100% 52px;
}

.workspace-view {
  position: relative;
  max-width: 1120px;
  animation: panel-enter 240ms ease-out;
}

.workspace-view::before {
  width: 72px;
}

@keyframes panel-enter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-heading,
.subsection-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.section-heading {
  min-height: 100px;
  padding: 26px 0 25px;
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  font-size: 38px;
  font-weight: 740;
  line-height: 1.08;
}

.state-badge,
.status-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-weight: 700;
}

.state-badge {
  padding: 6px 10px;
  border: 1px solid;
  font-size: 12px;
}

.state-badge--ok {
  border-color: rgba(99, 193, 116, 0.38);
  background: rgba(99, 193, 116, 0.1);
  color: #9de2a9;
}

.identity-strip {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1.35fr 1fr 0.72fr 1fr;
  gap: 12px;
}

.identity-metric {
  min-width: 0;
  min-height: 146px;
  padding: 19px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr;
  gap: 18px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.018);
}

.metric-icon,
.balance__icon,
.settings-copy__icon {
  display: grid;
  place-items: center;
  border: 1px solid rgba(68, 199, 244, 0.21);
  background: rgba(68, 199, 244, 0.07);
  color: var(--cyan);
}

.metric-icon {
  width: 34px;
  height: 34px;
  grid-row: 1;
  border-radius: 7px;
}

.metric-icon svg {
  width: 17px;
  height: 17px;
}

.identity-metric > span {
  align-self: center;
  color: var(--text-service);
  font-size: 12px;
  font-weight: 700;
}

.identity-metric strong {
  min-width: 0;
  grid-column: 1 / -1;
  align-self: end;
  overflow: hidden;
  font-size: 19px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subsection-head {
  margin: 42px 0 16px;
  align-items: flex-end;
}

.subsection-head h3,
.settings-section h3 {
  margin: 0;
  font-size: 23px;
  font-weight: 700;
}

.subsection-head p,
.settings-section p {
  margin: 5px 0 0;
  color: var(--text-service);
  font-size: 14px;
}

.session-list {
  display: grid;
  gap: 9px;
}

.session-row {
  min-height: 78px;
  padding: 15px 17px;
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) 0.55fr 0.85fr auto;
  align-items: center;
  gap: 20px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
}

.session-row strong,
.session-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-agent {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.session-agent svg {
  width: 17px;
  height: 17px;
  color: var(--cyan-dark);
}

.session-row strong {
  color: var(--text-secondary);
  font-weight: 650;
}

.session-row small {
  color: var(--text-service);
}

.session-current {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(99, 193, 116, 0.1);
  color: #9de2a9;
  font-size: 11px;
  font-weight: 700;
}

.balance {
  min-width: 190px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(68, 199, 244, 0.2);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-active);
}

.balance__icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.balance > div:last-child {
  display: grid;
}

.balance > div:last-child > span {
  color: var(--text-service);
  font-size: 11px;
  font-weight: 700;
}

.balance strong {
  color: var(--cyan-light);
  font-size: 23px;
  font-weight: 760;
  line-height: 1.2;
}

.balance strong span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.notice {
  margin-top: 22px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border: 1px solid rgba(217, 178, 95, 0.24);
  border-radius: 8px;
  background: rgba(217, 178, 95, 0.075);
  color: #d8c89f;
  font-size: 14px;
}

.notice svg {
  margin-top: 2px;
  color: var(--amber);
}

.notice strong {
  color: #eddba8;
}

.product-list {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product {
  min-height: 176px;
  padding: 21px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-panel), inset 0 1px rgba(255, 255, 255, 0.018);
  transition: border-color 170ms ease, background-color 170ms ease, transform 170ms ease;
}

.product--with-image {
  grid-template-rows: auto auto 1fr auto;
  padding-top: 12px;
}

.product__media {
  aspect-ratio: 16 / 9;
  margin: 0 -9px 4px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #091018;
}

.product__media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 260ms ease;
}

.product:hover .product__media img {
  transform: scale(1.02);
}

.product:hover {
  border-color: #355063;
  background: #101a24;
  transform: translateY(-2px);
}

.product h3 {
  margin: 0;
  font-size: 21px;
}

.product p {
  margin: 0;
  color: var(--text-service);
  font-size: 14px;
}

.product__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.product__price {
  color: var(--cyan-light);
  font-size: 19px;
  font-weight: 760;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

th {
  background: #0b1219;
  color: var(--text-service);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

td {
  color: var(--text-secondary);
  font-size: 14px;
}

tbody tr {
  transition: background-color 150ms ease;
}

tbody tr:hover {
  background: rgba(68, 199, 244, 0.025);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.ticket-form {
  margin-top: 22px;
  padding: 22px;
  display: grid;
  gap: 17px;
  border: 1px solid rgba(68, 199, 244, 0.28);
  border-radius: 8px;
  background: #0d1b24;
  box-shadow: var(--shadow-active);
}

.form-actions {
  display: flex;
  gap: 10px;
}

.support-layout {
  min-height: 460px;
  margin-top: 22px;
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-panel);
}

.ticket-list {
  padding: 8px;
  border-right: 1px solid var(--line);
  background: #0a1118;
}

.ticket-list__empty,
.empty-state {
  min-height: 240px;
  padding: 28px;
  display: grid;
  place-content: center;
  gap: 7px;
  color: var(--text-service);
  text-align: center;
}

.empty-state strong {
  color: var(--text);
  font-size: 19px;
}

.ticket-item {
  width: 100%;
  min-height: 82px;
  margin-bottom: 5px;
  padding: 14px 15px;
  display: grid;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.ticket-item:hover {
  background: var(--panel-raised);
}

.ticket-item.is-active {
  border-color: rgba(68, 199, 244, 0.22);
  background: rgba(68, 199, 244, 0.09);
  box-shadow: inset 3px 0 var(--cyan);
}

.ticket-item.is-closed {
  opacity: 0.62;
}

.ticket-item strong {
  overflow: hidden;
  font-size: 15px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-item__head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ticket-item__head strong {
  min-width: 0;
}

.ticket-item__head .status-label {
  flex: 0 0 auto;
}

.ticket-item__meta {
  color: var(--text-service);
  font-size: 12px;
}

.conversation {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
}

.conversation__head {
  min-height: 74px;
  padding: 15px 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: #0c141c;
}

.conversation__head h3 {
  margin: 0;
  font-size: 18px;
}

.conversation__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.button--close-ticket:hover:not(:disabled) {
  border-color: #8a4b54;
  background: rgba(217, 106, 106, 0.08);
  color: #ffc5ca;
}

.message-list {
  min-height: 310px;
  max-height: 480px;
  flex: 1 1 auto;
  padding: 20px;
  display: grid;
  align-content: start;
  gap: 14px;
  overflow-y: auto;
  scrollbar-color: #355468 transparent;
  scrollbar-width: thin;
}

.message-list::-webkit-scrollbar,
.reply-form textarea::-webkit-scrollbar {
  width: 7px;
}

.message-list::-webkit-scrollbar-track,
.reply-form textarea::-webkit-scrollbar-track {
  background: transparent;
}

.message-list::-webkit-scrollbar-thumb,
.reply-form textarea::-webkit-scrollbar-thumb {
  border-radius: 7px;
  background: #355468;
}

.message-list::-webkit-scrollbar-button,
.reply-form textarea::-webkit-scrollbar-button {
  display: none;
}

.message {
  max-width: 76%;
  padding: 12px 14px;
  border: 1px solid #293947;
  border-radius: 8px 8px 8px 3px;
  background: #0a1118;
}

.message--staff {
  justify-self: start;
  border-color: rgba(68, 199, 244, 0.24);
  background: #0c202b;
}

.message--user {
  justify-self: end;
  border-color: #34495a;
  border-radius: 8px 8px 3px 8px;
  background: #17232e;
}

.message__meta {
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--text-service);
  font-size: 11px;
}

.message p {
  margin: 0;
  color: #e7edf1;
  white-space: pre-wrap;
}

.reply-form {
  min-height: 74px;
  padding: 11px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: #0b131a;
}

.reply-form textarea {
  min-height: 50px;
  max-height: 150px;
  padding-top: 12px;
  padding-bottom: 12px;
  resize: none;
  overflow-y: hidden;
  scrollbar-color: #355468 transparent;
  scrollbar-width: thin;
}

.reply-form .button {
  min-height: 50px;
}

.ticket-form textarea {
  resize: none;
}

.ticket-closed {
  margin: 0 19px 19px;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0b131a;
}

.ticket-closed div {
  display: grid;
  gap: 3px;
}

.ticket-closed span {
  color: var(--text-service);
  font-size: 13px;
}

.settings-section {
  margin-top: 28px;
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(230px, 0.75fr) minmax(360px, 1fr);
  gap: 64px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-panel);
}

.settings-copy__icon {
  width: 46px;
  height: 46px;
  margin-bottom: 20px;
  border-radius: 8px;
}

.form-stack--compact {
  max-width: 520px;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-service);
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: rgba(68, 199, 244, 0.08);
  color: var(--cyan-light);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

.avatar-settings {
  min-height: 106px;
  padding: 18px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0b131a;
}

.avatar--preview {
  width: 72px;
  height: 72px;
  overflow: hidden;
  font-size: 25px;
}

.avatar-settings > div:nth-child(2) {
  display: grid;
  gap: 4px;
}

.avatar-settings > div:nth-child(2) span {
  color: var(--text-service);
  font-size: 13px;
}

.modal {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid #304453;
  border-radius: 8px;
  background: #0d151e;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.66);
  color: var(--text);
}

.modal::backdrop {
  background: rgba(2, 7, 11, 0.8);
  backdrop-filter: blur(3px);
}

.modal[open] {
  animation: modal-enter 180ms ease-out;
}

@keyframes modal-enter {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal__head {
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.modal__head h2 {
  margin: 0;
  font-size: 22px;
}

.modal__head p {
  margin: 7px 0 0;
  color: var(--text-service);
  font-size: 14px;
}

.modal__icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(68, 199, 244, 0.25);
  border-radius: 8px;
  background: rgba(68, 199, 244, 0.08);
  color: var(--cyan);
}

.modal__actions {
  padding: 16px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--line);
  background: #0a1118;
}

.modal__actions--split {
  justify-content: space-between;
}

.modal__actions--split > div {
  display: flex;
  gap: 9px;
}

.avatar-editor {
  padding: 4px 24px 24px;
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.avatar-editor__preview {
  width: 156px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(68, 199, 244, 0.5);
  border-radius: 8px;
  background: #0f2b39;
  color: var(--cyan-light);
  font-size: 48px;
  font-weight: 800;
}

.file-picker {
  min-height: 112px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px dashed #3a5669;
  border-radius: 8px;
  background: #0a1219;
  cursor: pointer;
}

.file-picker:hover {
  border-color: var(--cyan-dark);
  background: rgba(68, 199, 244, 0.05);
}

.file-picker > svg {
  color: var(--cyan);
}

.file-picker span {
  display: grid;
  gap: 4px;
}

.file-picker small {
  color: var(--text-service);
}

.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.empty-wide {
  grid-column: 1 / -1;
  min-height: 190px;
  padding: 42px 24px;
  display: grid;
  place-content: center;
  border: 1px dashed #34495a;
  border-radius: 8px;
  background: rgba(14, 22, 32, 0.62);
  color: var(--text-service);
  text-align: center;
}

.empty-wide svg,
.ticket-list__empty svg,
.empty-state > svg {
  width: 28px;
  height: 28px;
  margin: 0 auto 7px;
  color: var(--cyan-dark);
}

.empty-wide strong {
  margin-bottom: 3px;
  color: var(--text-secondary);
  font-size: 18px;
}

.empty-wide span {
  color: var(--text-service);
}

.status-label {
  padding: 4px 8px;
  background: #192630;
  color: #b7c4cd;
  font-size: 11px;
}

.status-label--open,
.status-label--fulfilled {
  background: rgba(99, 193, 116, 0.11);
  color: #9de2a9;
}

.status-label--waiting_player,
.status-label--pending {
  background: rgba(217, 178, 95, 0.12);
  color: #e4c87e;
}

.status-label--reopened {
  background: rgba(95, 168, 211, 0.12);
  color: #9fd4f1;
}

.status-label--closed,
.status-label--cancelled {
  background: #202a32;
  color: #a9b3ba;
}

@media (max-width: 1080px) {
  .portal-shell {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .workspace {
    padding-right: 30px;
    padding-left: 30px;
  }

  .identity-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .support-layout {
    grid-template-columns: 300px minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .portal-app,
  .portal-shell,
  .sidebar,
  .workspace {
    min-width: 0;
    max-width: 100%;
  }

  .portal-shell {
    grid-template-columns: 1fr;
    overflow: hidden;
  }

  .sidebar {
    padding: 13px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .sidebar__caption,
  .sidebar__identity {
    display: none;
  }

  .portal-nav {
    width: 100%;
    max-width: 100%;
    margin: 0;
    display: flex;
    gap: 5px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  .portal-nav__item {
    min-width: max-content;
    min-height: 44px;
    padding: 0 13px;
  }

  .portal-nav__item::before {
    top: auto;
    right: 12px;
    bottom: 0;
    left: 12px;
    width: auto;
    height: 2px;
  }

  .workspace {
    padding: 34px 24px 64px;
  }

  .settings-section {
    gap: 38px;
  }
}

@media (max-width: 680px) {
  .registration-form {
    grid-template-columns: 1fr;
  }

  .registration-form__wide {
    grid-column: auto;
  }

  .portal-header {
    min-height: 64px;
    padding: 0 16px;
  }

  .site-link,
  .header-session > span {
    display: none;
  }

  .header-session {
    padding-left: 0;
    border-left: 0;
  }

  .wordmark {
    font-size: 20px;
  }

  .login-view {
    min-height: calc(100vh - 64px);
    padding: 28px 16px;
  }

  .login-card {
    padding: 30px 22px;
  }

  .login-card h1 {
    font-size: 32px;
  }

  .sidebar {
    padding-right: 12px;
    padding-left: 12px;
  }

  .portal-nav__item span {
    display: none;
  }

  .portal-nav__item {
    width: 46px;
    min-width: 46px;
    padding: 0;
    justify-content: center;
  }

  .workspace {
    padding: 30px 16px 52px;
  }

  .section-heading,
  .subsection-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading h2 {
    font-size: 34px;
  }

  .identity-strip {
    grid-template-columns: 1fr;
  }

  .identity-metric {
    min-height: 122px;
  }

  .session-row {
    grid-template-columns: 1fr auto;
    gap: 7px 12px;
  }

  .session-row > :nth-child(2),
  .session-row > :nth-child(3) {
    grid-column: 1;
  }

  .session-row > :last-child {
    grid-column: 2;
    grid-row: 1 / span 3;
  }

  .balance {
    width: 100%;
  }

  .product-list {
    grid-template-columns: 1fr;
  }

  .support-layout {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .ticket-list {
    max-height: 250px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-y: auto;
  }

  .message {
    max-width: 92%;
  }

  .reply-form {
    grid-template-columns: 1fr;
  }

  .conversation__head,
  .ticket-closed {
    align-items: flex-start;
    flex-direction: column;
  }

  .conversation__actions,
  .ticket-closed .button {
    width: 100%;
  }

  .settings-section {
    padding: 22px;
    grid-template-columns: 1fr;
    gap: 28px;
  }

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

  .avatar-settings .button {
    grid-column: 1 / -1;
  }

  .avatar-editor {
    grid-template-columns: 1fr;
  }

  .avatar-editor__preview {
    margin: 0 auto;
  }

  .modal__actions--split {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .modal__actions--split > div,
  .modal__actions--split .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
