:root {
  color-scheme: light;
  --app-bg: #d8e1e8;
  --shell-bg: #eef3f7;
  --sidebar: #17212b;
  --sidebar-soft: #202b36;
  --topbar: #ffffff;
  --chat-bg: #d7e2ea;
  --panel: #ffffff;
  --bubble-in: #ffffff;
  --bubble-out: #d9fdd3;
  --bubble-out-line: #bee9b7;
  --ink: #17212b;
  --ink-strong: #0e1621;
  --muted: #6f7b86;
  --muted-dark: #9aa9b7;
  --line: #dce4ea;
  --line-strong: #c8d3dc;
  --brand: #3390ec;
  --brand-dark: #2577c9;
  --telegram: #54a3e8;
  --web: #61b86a;
  --danger: #e05a56;
  --danger-dark: #c54844;
  --focus: rgba(51, 144, 236, 0.24);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--app-bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
input,
select,
.message,
.panel,
.login-panel,
.app-panel,
.list-row,
.empty {
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.shell {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 14px;
}

body.is-home {
  overflow-x: hidden;
  background: #2f54eb;
}

body.is-home .shell {
  place-items: stretch;
  padding: 0;
}

.home-panel {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-radius: 0;
  color: #fff;
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.22), transparent 24%),
    linear-gradient(135deg, #2f54eb 0%, #4a3fe9 46%, #722ed1 100%);
  box-shadow: none;
}

.home-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 22px clamp(20px, 4vw, 56px);
}

.home-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
}

.home-brand span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  font-weight: 850;
}

.home-brand strong {
  font-size: 15px;
  letter-spacing: 0;
}

.home-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.language-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(12, 18, 66, 0.18);
}

.language-switch button,
.home-login-link {
  width: auto;
  min-height: 36px;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.86);
  border-radius: 8px;
  background: transparent;
}

.language-switch button:hover,
.language-switch button.active {
  color: #2f54eb;
  background: #fff;
}

.home-login-link {
  color: #2f54eb;
  background: #fff;
  box-shadow: 0 12px 28px rgba(17, 24, 88, 0.18);
}

.home-login-link:hover {
  color: #1e3fd1;
  background: #f4f7ff;
}

.home-hero {
  min-height: calc(100svh - 260px);
  width: min(1680px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(360px, 1.12fr);
  align-items: center;
  gap: clamp(24px, 5vw, 82px);
  padding: clamp(22px, 5vw, 68px) clamp(20px, 4vw, 64px) clamp(20px, 4vw, 42px);
}

.home-copy {
  display: grid;
  align-content: center;
  gap: 22px;
  max-width: 680px;
  transform: translateY(-18px);
}

.home-kicker {
  width: fit-content;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.home-copy h1 {
  max-width: 760px;
  color: #fff;
  font-size: clamp(40px, 6vw, 86px);
  line-height: 0.98;
  font-weight: 850;
}

.home-copy p {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 17px;
  line-height: 1.7;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.home-actions button,
.home-actions a {
  width: auto;
  min-height: 48px;
  padding: 13px 18px;
  border-radius: 8px;
  font-weight: 800;
}

.home-actions button {
  color: #2f54eb;
  background: #fff;
  box-shadow: 0 16px 34px rgba(19, 24, 78, 0.22);
}

.home-actions button:hover {
  color: #1e3fd1;
  background: #f5f7ff;
}

.home-actions a {
  display: inline-flex;
  align-items: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.home-visual {
  position: relative;
  min-height: 520px;
  transform: rotate(-3deg) translateY(18px);
}

.home-visual::before,
.home-visual::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.home-visual::before {
  inset: 40px 16px 30px 40px;
}

.home-visual::after {
  inset: 98px 88px 92px 8px;
}

.network-lines {
  position: absolute;
  inset: 12%;
  border-radius: 8px;
  background:
    linear-gradient(112deg, transparent 0 36%, rgba(255, 255, 255, 0.36) 36.3%, transparent 37% 100%),
    linear-gradient(42deg, transparent 0 42%, rgba(255, 255, 255, 0.28) 42.4%, transparent 43% 100%),
    linear-gradient(160deg, transparent 0 48%, rgba(255, 255, 255, 0.2) 48.4%, transparent 49% 100%);
  opacity: 0.78;
}

.orbit-card {
  position: absolute;
  z-index: 1;
  display: grid;
  gap: 7px;
  min-width: 190px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 22px 48px rgba(19, 24, 78, 0.22);
  transform: rotate(3deg);
}

.orbit-card span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.orbit-card strong {
  color: #fff;
  font-size: 42px;
  line-height: 1;
}

.orbit-card p {
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  line-height: 1.45;
}

.orbit-card-main {
  top: 120px;
  right: 10%;
  min-width: 300px;
  min-height: 176px;
  background: rgba(255, 255, 255, 0.2);
}

.orbit-card-side {
  left: 4%;
  top: 44px;
}

.orbit-card-small {
  left: 18%;
  bottom: 70px;
  min-width: 160px;
}

.home-products {
  width: min(1680px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 0.95fr 1.05fr;
  gap: 1px;
  padding: 0 clamp(20px, 4vw, 56px) 32px;
}

.home-products article {
  display: grid;
  gap: 10px;
  min-height: 154px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.11);
}

.home-products article:nth-child(2) {
  transform: translateY(-18px);
}

.home-products span {
  color: rgba(255, 255, 255, 0.58);
  font-weight: 850;
}

.home-products h2 {
  color: #fff;
  font-size: 18px;
}

.home-products p {
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.55;
}

.home-ip-tool {
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px) 24px;
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(320px, 0.88fr);
  gap: 18px;
  align-items: start;
}

.home-ip-copy {
  display: grid;
  gap: 8px;
}

.home-ip-copy span {
  width: fit-content;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.home-ip-copy h2 {
  color: #fff;
  font-size: 28px;
  line-height: 1.16;
}

.home-ip-copy p {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.62;
}

.home-ip-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(16px);
}

.home-ip-form label {
  display: grid;
  gap: 7px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 800;
}

.home-ip-form input {
  min-height: 46px;
  color: #0e1621;
  border-color: rgba(255, 255, 255, 0.56);
  background: #fff;
}

.home-ip-form button {
  align-self: end;
  width: auto;
  min-height: 46px;
  padding: 0 18px;
  color: #2f54eb;
  background: #fff;
  box-shadow: 0 16px 30px rgba(19, 24, 78, 0.18);
}

.home-ip-form .hint {
  grid-column: 1 / -1;
  min-height: 18px;
  color: rgba(255, 255, 255, 0.72);
}

.home-ip-result {
  grid-column: 2;
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 22px 42px rgba(16, 24, 84, 0.16);
}

.login-panel,
.app-panel,
.panel {
  background: var(--panel);
  border: 1px solid rgba(111, 123, 134, 0.18);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(23, 33, 43, 0.18);
}

.login-panel {
  width: min(420px, 100%);
  position: relative;
  padding: 30px;
  display: grid;
  gap: 24px;
}

.login-back {
  width: fit-content;
  padding: 7px 10px;
  color: var(--brand-dark);
  background: #eef3f7;
  font-size: 13px;
}

.login-back:hover {
  background: #e2ebf2;
}

.auth-switch {
  width: 100%;
  background: transparent;
  color: var(--brand-dark);
  border-color: rgba(82, 138, 187, 0.35);
}

.delivery-panel {
  width: min(920px, 100%);
}

.delivery-card {
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid rgba(111, 123, 134, 0.18);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 20px 60px rgba(23, 33, 43, 0.18);
}

.delivery-kicker {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.delivery-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.delivery-summary div {
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}

.delivery-summary span {
  color: var(--muted);
  font-size: 12px;
}

.delivery-link-list {
  grid-column: 1 / -1;
}

.delivery-link-list a {
  display: block;
  margin-top: 7px;
  padding: 10px;
  border-radius: 7px;
  color: var(--brand-dark);
  background: #eef7ff;
  font-weight: 800;
  text-decoration: none;
}

.delivery-form textarea {
  min-height: 220px;
  resize: vertical;
}

@media (max-width: 720px) {
  .shell {
    padding: 10px;
    align-items: stretch;
  }

  .delivery-panel {
    width: 100%;
  }

  .delivery-card {
    min-height: calc(100vh - 20px);
    padding: 16px;
    gap: 14px;
    border-radius: 0;
    box-shadow: none;
  }

  .delivery-card h1 {
    font-size: 24px;
    line-height: 1.2;
  }

  .delivery-summary {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .delivery-summary div {
    padding: 9px;
  }

  .delivery-summary strong {
    overflow-wrap: anywhere;
  }

  .delivery-form {
    gap: 12px;
  }

  .delivery-form textarea {
    min-height: 260px;
  }

  .delivery-form button {
    width: 100%;
    min-height: 46px;
  }
}

@media (max-width: 980px) {
  .order-delivery-link-row {
    grid-template-columns: 1fr;
  }
}

.order-delivery-links {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.order-delivery-link-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(180px, 1fr) minmax(180px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.order-delivery-link-row strong {
  min-width: 0;
}

.app-panel {
  width: min(1760px, calc(100vw - 28px));
  height: min(980px, calc(100vh - 28px));
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  grid-template-rows: 1fr;
  overflow: hidden;
  background: var(--shell-bg);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--ink-strong);
  font-size: 20px;
  font-weight: 650;
  line-height: 1.25;
}

h2 {
  color: var(--ink-strong);
  font-size: 16px;
  font-weight: 650;
}

p,
.hint {
  color: var(--muted);
}

form {
  display: grid;
  gap: 14px;
}

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

.form-actions button {
  width: auto;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input::placeholder {
  color: #9ba7b1;
}

textarea::placeholder {
  color: #9ba7b1;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus);
}

button {
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
  font-weight: 650;
}

button:hover {
  background: var(--brand-dark);
}

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

.secondary {
  color: var(--ink);
  background: #eef3f7;
}

.secondary:hover {
  background: #e2ebf2;
}

.error {
  min-height: 20px;
  color: var(--danger);
}

.hidden {
  display: none !important;
}

.topbar {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-content: start;
  gap: 14px;
  padding: 18px 14px;
  background: var(--sidebar);
  border-right: 1px solid rgba(0, 0, 0, 0.18);
}

.topbar > div:first-child {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 11px;
  align-items: center;
  min-height: 50px;
  padding: 4px 4px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar > div:first-child::before {
  content: "SL";
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #4aa4ee, #4fb477);
  font-size: 16px;
  font-weight: 700;
}

.topbar h1 {
  color: #fff;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#status {
  margin-top: 4px;
  color: var(--muted-dark);
  font-size: 12px;
}

.top-actions {
  display: grid;
  gap: 10px;
  align-self: end;
}

.session-actions {
  display: grid;
  gap: 8px;
}

.tabs {
  display: grid;
  gap: 6px;
}

.tab {
  position: relative;
  width: 100%;
  color: #dbe7f1;
  background: transparent;
  padding: 11px 12px;
  text-align: left;
  border-radius: 8px;
}

.tab:hover {
  color: #fff;
  background: var(--sidebar-soft);
}

.tab.active {
  color: #fff;
  background: var(--brand);
}

.tab.has-unread::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff2b2b;
  box-shadow: 0 0 0 4px rgba(255, 43, 43, 0.22);
}

#logoutButton {
  width: 100%;
  color: #dbe7f1;
  background: rgba(255, 255, 255, 0.08);
}

#logoutButton:hover {
  background: rgba(255, 255, 255, 0.14);
}

.view {
  min-height: 0;
}

.chat-view {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  background: var(--chat-bg);
}

.nav-view {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  min-height: 0;
  background: #eef3f7;
}

.shop-view {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  min-height: 0;
  background: #eef3f7;
}

.store-view {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  min-height: 0;
  background: #eef3f7;
}

.agency-view {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-width: 0;
  min-height: 0;
  background: #eef3f7;
}

.server-manage-view {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  min-height: 0;
  background: #eef3f7;
}

.support-view {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  background: #eef3f7;
}

.interface-view {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  background: #eef3f7;
}

.nav-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 360px);
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar);
}

.shop-head {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar);
}

.store-view .shop-head,
.server-manage-view .shop-head,
.agency-view .shop-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.server-manage-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.server-console-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 15px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #2f54eb, #722ed1);
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(47, 84, 235, 0.22);
}

.server-console-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(47, 84, 235, 0.3);
}

.store-balance {
  display: grid;
  justify-items: end;
  gap: 3px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}

.store-balance span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.store-balance strong {
  color: var(--ink-strong);
  font-size: 20px;
  line-height: 1;
}

.nav-head p {
  margin-top: 4px;
  font-size: 13px;
}

.shop-head p {
  color: var(--muted);
  font-size: 13px;
}

.shop-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  align-content: start;
  gap: 12px;
  padding: 16px;
}

.account-body {
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  align-items: start;
}

.balance-card {
  display: grid;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 33, 43, 0.08);
}

.balance-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.balance-card strong {
  color: var(--ink-strong);
  font-size: 38px;
  line-height: 1;
  font-weight: 750;
}

.balance-card p {
  font-size: 13px;
  line-height: 1.45;
}

.account-records {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.agency-dashboard {
  display: grid;
  grid-template-columns: minmax(300px, 1.2fr) repeat(3, minmax(160px, 0.7fr));
  gap: 12px;
  padding: 16px;
}

.agency-link-card strong {
  font-size: 25px;
}

.agency-grid {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.1fr) minmax(320px, 1.1fr);
  gap: 12px;
  padding: 0 16px 16px;
  align-content: start;
}

.agency-grid .panel {
  min-width: 0;
}

.agent-row {
  align-items: stretch;
}

.agent-row-main {
  display: grid;
  gap: 10px !important;
  min-width: 0;
  flex: 1;
}

.agent-row-title {
  display: grid;
  gap: 4px !important;
}

.agent-settings-grid {
  display: grid !important;
  grid-template-columns: minmax(180px, 0.9fr) minmax(180px, 0.65fr) minmax(220px, 1fr);
  gap: 10px !important;
  align-items: stretch;
}

.agent-setting {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(248, 250, 252, 0.96);
}

.agent-setting > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.agent-discount-setting {
  border-color: rgba(47, 84, 235, 0.32);
  background: linear-gradient(135deg, rgba(47, 84, 235, 0.09), rgba(114, 46, 209, 0.08));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.agent-discount-control {
  display: grid !important;
  grid-template-columns: minmax(70px, 1fr) auto;
  align-items: center;
  gap: 8px !important;
}

.agent-discount-control input {
  width: 100%;
  min-height: 42px;
  border-color: rgba(47, 84, 235, 0.38);
  color: var(--ink-strong);
  font-size: 20px;
  font-weight: 750;
  text-align: center;
  background: #fff;
}

.agent-discount-control em {
  color: #2f54eb;
  font-style: normal;
  font-size: 16px;
  font-weight: 800;
}

.agent-setting small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.agent-register-link {
  width: 100%;
}

.agent-price-edit {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  gap: 8px;
  margin-top: 10px;
}

.agent-price-edit button {
  white-space: nowrap;
}

.store-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 16px;
}

.server-manage-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  padding: 18px;
}

.server-renewal-panel,
.server-orders-panel,
.server-telegram-panel {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(111, 123, 134, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.server-telegram-panel {
  border-color: rgba(47, 84, 235, 0.2);
  background: linear-gradient(135deg, rgba(47, 84, 235, 0.08), rgba(114, 46, 209, 0.06));
}

.telegram-bind-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.telegram-bind-card.is-bound {
  border-color: rgba(34, 151, 107, 0.28);
  background: rgba(242, 251, 247, 0.9);
}

.telegram-bind-card > div:first-child {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.telegram-bind-card strong {
  color: var(--ink-strong);
}

.telegram-bind-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.telegram-bind-card code {
  width: fit-content;
  max-width: 100%;
  padding: 7px 9px;
  border-radius: 8px;
  color: #1e3150;
  background: #eef3ff;
  overflow-wrap: anywhere;
}

.telegram-bind-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.support-layout {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
}

.support-sidebar {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.support-ticket-form textarea {
  min-height: 98px;
  resize: vertical;
}

.support-ticket-list {
  gap: 8px;
}

.support-ticket-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 11px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.support-ticket-item:hover,
.support-ticket-item.active {
  color: var(--ink);
  border-color: var(--brand);
  background: #eef7ff;
}

.support-ticket-item strong {
  color: var(--ink-strong);
  font-size: 14px;
}

.support-ticket-machine {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 6px;
  color: #fff !important;
  background: #111827;
  font-size: 12px;
  font-weight: 800;
}

.support-ticket-item span {
  color: var(--muted);
  font-size: 12px;
}

.support-chat {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--chat-bg);
}

.support-chat-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar);
}

.support-chat-head p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
  font-size: 13px;
}

.support-machine-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 6px;
  color: #fff;
  background: #b91c1c;
  font-weight: 900;
}

.support-messages {
  padding: 20px clamp(18px, 3vw, 56px);
}

.support-composer {
  grid-template-columns: 1fr auto;
}

.store-main {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.server-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.server-card {
  align-content: space-between;
}

.server-specs {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}

.server-buy-form {
  grid-template-columns: 90px minmax(0, 1fr) auto;
}

.server-buy-form textarea {
  grid-column: 1 / -1;
  min-height: 72px;
}

.server-list {
  display: grid;
  gap: 12px;
}

.server-card-grid {
  display: grid;
  gap: 12px;
}

.server-card-grid--attention {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.server-card-grid--inventory {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.server-card-grid--orders {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.server-package-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.server-package-tabs button {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 11px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: none;
}

.server-package-tabs button:hover,
.server-package-tabs button.active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.server-package-tabs span {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef3f7;
  font-size: 12px;
  font-weight: 750;
}

.server-package-tabs button.active span,
.server-package-tabs button:hover span {
  color: var(--brand-dark);
  background: #fff;
}

.renewal-focus,
.server-inventory {
  display: grid;
  gap: 12px;
}

.renewal-focus {
  padding: 13px;
  border: 1px solid rgba(223, 93, 93, 0.28);
  border-radius: 8px;
  background: #fff7f7;
}

.server-inventory {
  padding: 13px;
  border: 1px solid rgba(84, 163, 232, 0.18);
  border-radius: 8px;
  background: #f8fbff;
}

.renewal-clear {
  padding: 14px;
  border: 1px solid rgba(34, 151, 107, 0.25);
  border-radius: 8px;
  color: #17694e;
  background: #f2fbf7;
  font-size: 13px;
  font-weight: 700;
}

.renewal-focus-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-strong);
}

.renewal-focus-head strong {
  font-size: 15px;
}

.renewal-focus-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.server-owned-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 33, 43, 0.06);
}

.server-owned-card--warning {
  border-color: #e3bd45;
  background: #fff8df;
}

.server-owned-card--urgent {
  border-color: #ef7f4d;
  background: #fff1e9;
}

.server-owned-card--expired,
.server-owned-card--expired-blocked {
  border-color: #df5d5d;
  background: #fff0f0;
}

.server-owned-card--expired-blocked {
  opacity: 0.86;
}

.server-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.server-card-head > div,
.server-owned-card > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.server-card-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.server-machine-number {
  color: var(--ink-strong);
  font-size: 20px;
  line-height: 1.15;
  word-break: break-word;
}

.server-expiry-badge {
  flex: 0 0 auto;
  max-width: 52%;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--ink-strong);
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(111, 123, 134, 0.2);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.server-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding-top: 2px;
}

.server-owned-card strong {
  color: var(--ink-strong);
}

.server-owned-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.order-owned-card {
  gap: 8px;
}

.server-delivery-box,
.server-renew-summary,
.server-order-section {
  display: grid;
  gap: 7px;
}

.server-delivery-box {
  padding: 10px;
  border: 1px solid rgba(47, 84, 235, 0.16);
  border-radius: 8px;
  background: #f6f8ff;
}

.server-delivery-box strong,
.server-renew-summary span {
  font-size: 12px;
}

.server-renew-summary {
  grid-column: 1 / -1;
  padding: 8px 10px;
  border: 1px solid rgba(111, 123, 134, 0.18);
  border-radius: 8px;
  background: #f7fafc;
}

.server-order-section + .server-order-section {
  margin-top: 14px;
}

.admin-server-order-section {
  padding-top: 6px;
}

.server-owned-card--compact {
  background: #fff;
}

.server-owned-card--compact .server-machine-number {
  font-size: 18px;
}

.server-owned-card--compact .renew-form button {
  background: var(--brand);
}

.delivery-content {
  max-height: 180px;
  overflow: auto;
  margin: 4px 0 0;
  padding: 10px;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.renew-form {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.renew-form .hint {
  grid-column: 1 / -1;
  min-height: 18px;
  font-size: 12px;
}

.recharge-form {
  grid-template-columns: minmax(240px, 1.2fr) minmax(150px, 0.45fr) minmax(260px, 1fr);
  align-items: end;
  margin-bottom: 14px;
}

.recharge-form button {
  grid-column: 1 / -1;
  justify-self: start;
  min-width: 180px;
}

.recharge-form .form-hint {
  grid-column: 1 / -1;
}

.recharge-row strong {
  color: var(--ink-strong);
}

.recharge-row.is-canceled {
  opacity: 0.64;
  background: #f7fafc;
}

.recharge-edit {
  display: grid !important;
  grid-template-columns: minmax(120px, 0.35fr) minmax(220px, 1fr);
  gap: 8px !important;
  margin-top: 7px;
}

.finance-recharge-panel,
.finance-log-panel {
  grid-column: 1 / -1;
}

.product-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.product-card > div {
  display: grid;
  gap: 7px;
}

.product-card span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.product-card h3 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 16px;
  line-height: 1.25;
}

.product-card strong {
  color: #2f8f4f;
  font-size: 14px;
}

.product-card p,
.product-card em {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  font-style: normal;
  white-space: pre-wrap;
}

.purchase-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px auto;
  gap: 8px;
  align-items: start;
}

.purchase-form textarea {
  grid-column: 1 / -1;
  min-height: 74px;
  resize: vertical;
}

.server-buy-summary {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(111, 123, 134, 0.18);
  border-radius: 8px;
  background: #f7fafc;
}

.server-buy-summary span,
.server-buy-summary strong {
  font-size: 12px;
  line-height: 1.35;
}

.server-buy-summary span {
  color: var(--muted);
}

.server-buy-summary strong {
  color: #188552;
}

.server-buy-summary strong.is-short {
  color: #c62828;
}

.purchase-form .hint {
  grid-column: 1 / -1;
  min-height: 18px;
  font-size: 12px;
}

.product-form {
  grid-template-columns: minmax(140px, 0.8fr) minmax(160px, 1fr) minmax(130px, 0.7fr) minmax(160px, 0.8fr);
  align-items: end;
  margin-bottom: 14px;
}

.product-form textarea {
  grid-column: span 2;
  min-height: 76px;
  resize: vertical;
}

.product-description {
  min-height: 76px;
  resize: vertical;
}

.server-shop-panel {
  grid-column: 1 / -1;
}

.server-product-form {
  grid-template-columns: minmax(130px, 0.7fr) minmax(180px, 1fr) 120px 110px minmax(220px, 1fr) 100px;
  align-items: end;
  margin-bottom: 14px;
}

.server-product-form textarea {
  grid-column: span 3;
  min-height: 76px;
  resize: vertical;
}

.server-instance-edit textarea {
  min-height: 68px;
  resize: vertical;
}

.server-transfer-meta {
  color: #2f6f9f;
  font-weight: 700;
}

.server-transfer-note {
  color: var(--muted);
  white-space: pre-wrap;
}

.server-product-form button,
.server-product-form .form-hint {
  grid-column: 1 / -1;
}

.user-server-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
  gap: 12px;
  align-items: center;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(47, 84, 235, 0.2);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(47, 84, 235, 0.07), rgba(114, 46, 209, 0.06));
}

.user-server-filter div {
  display: grid;
  gap: 4px;
}

.user-server-filter strong {
  color: var(--ink-strong);
  font-size: 14px;
}

.user-server-filter span {
  color: var(--muted);
  font-size: 12px;
}

.user-server-filter select {
  width: 100%;
}

.admin-shop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 12px;
  align-items: start;
}

.server-product-row,
.server-order-row {
  align-items: flex-start;
}

.server-product-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.server-product-row > div:first-child {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 8px;
}

.server-product-row strong,
.server-product-row span,
.server-product-row .product-description,
.server-product-row .notification-template-input {
  grid-column: 1 / -1;
}

.notification-template-input {
  min-height: 104px;
}

.compact-head {
  margin-bottom: 8px;
}

.nav-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  overflow: hidden;
}

.nav-catalog {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 0;
  overflow: auto;
}

.nav-catalog button {
  width: 100%;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  border: 1px solid var(--line);
}

.nav-catalog button:hover,
.nav-catalog button.active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.nav-catalog button[data-nav-category="置顶业务"] {
  border-color: rgba(51, 144, 236, 0.45);
  color: var(--brand);
  font-weight: 750;
  background: #eef7ff;
}

.nav-catalog button[data-nav-category="置顶业务"].active,
.nav-catalog button[data-nav-category="置顶业务"]:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #4fb477);
}

.nav-results {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  align-content: start;
  gap: 10px;
}

.featured-nav-section {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}

.nav-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 13px;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.featured-nav-card {
  min-height: 152px;
  padding: 18px;
  border: 2px solid rgba(51, 144, 236, 0.55);
  background:
    linear-gradient(135deg, rgba(51, 144, 236, 0.14), rgba(79, 180, 119, 0.12)),
    #fff;
  box-shadow: 0 12px 32px rgba(23, 33, 43, 0.14);
}

.nav-card:hover {
  border-color: var(--brand);
  box-shadow: 0 8px 24px rgba(23, 33, 43, 0.1);
}

.nav-card span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 650;
}

.nav-card strong {
  color: var(--ink-strong);
  font-size: 15px;
}

.featured-nav-card strong {
  font-size: 22px;
  line-height: 1.2;
}

.featured-nav-card span {
  font-size: 13px;
}

.featured-nav-card em {
  font-size: 14px;
}

.nav-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.roombar {
  position: relative;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar);
}

.roombar.has-unread::after {
  content: "新消息 " attr(data-unread-count);
  position: absolute;
  top: 14px;
  right: 18px;
  min-width: 78px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #fff;
  background: #e00000;
  box-shadow: 0 8px 18px rgba(224, 0, 0, 0.24);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.roombar label {
  position: relative;
  max-width: none;
  grid-template-columns: 1fr;
  gap: 4px;
  color: var(--muted);
}

.roombar label::before {
  content: "群组";
  color: var(--ink-strong);
  font-size: 15px;
  font-weight: 650;
}

.roombar select {
  width: min(420px, 100%);
  border: 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
}

.chat-layout {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
}

.room-list-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  border-right: 1px solid var(--line);
  background: #f8fbfd;
}

.room-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.room-list-head strong {
  color: var(--ink-strong);
  font-size: 14px;
}

.room-list-head span {
  min-width: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--brand);
  background: #eef7ff;
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.room-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 10px;
}

.room-list-item {
  position: relative;
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 9px 28px 9px 10px;
  color: var(--ink);
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  box-shadow: none;
}

.room-list-item.has-unread::after {
  content: "";
  position: absolute;
  top: 13px;
  right: 11px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e03131;
  box-shadow: 0 0 0 3px rgba(224, 49, 49, 0.14);
}

.room-list-item:hover {
  color: var(--ink-strong);
  border-color: rgba(51, 144, 236, 0.22);
  background: #eef7ff;
}

.room-list-item.active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.room-list-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.room-list-item span {
  color: currentColor;
  opacity: 0.72;
  font-size: 11px;
  font-weight: 650;
}

.chat-main-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.room-info {
  grid-row: 1;
  display: grid;
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar);
}

.notice-strip,
.pinned-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 18px;
  color: var(--ink);
  background: #f8fbfd;
}

.notice-strip {
  border-left: 4px solid #4fb477;
}

.pinned-strip {
  border-left: 4px solid var(--brand);
}

.notice-strip strong,
.pinned-strip strong {
  margin-right: 9px;
  color: var(--ink-strong);
  font-size: 13px;
}

.notice-strip span,
.pinned-strip span {
  min-width: 0;
  color: #405767;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.pinned-strip > div {
  min-width: 0;
}

.messages {
  grid-row: 2;
  min-height: 0;
  overflow: auto;
  padding: 12px clamp(14px, 3vw, 48px) 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background:
    linear-gradient(rgba(215, 226, 234, 0.92), rgba(215, 226, 234, 0.92)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0 1px, transparent 1px 18px);
}

.messages::-webkit-scrollbar,
.admin-view::-webkit-scrollbar {
  width: 10px;
}

.messages::-webkit-scrollbar-thumb,
.admin-view::-webkit-scrollbar-thumb {
  background: rgba(108, 127, 141, 0.42);
  border: 3px solid transparent;
  border-radius: 8px;
  background-clip: content-box;
}

.message {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  max-width: min(920px, 82%);
  border: 0;
  background: transparent;
}

.message.pinned-message .bubble {
  outline: 2px solid rgba(51, 144, 236, 0.28);
}

.message.outgoing {
  align-self: flex-end;
  justify-content: flex-end;
}

.message.incoming {
  align-self: flex-start;
}

.avatar {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #4aa4ee, #7a73d9);
  font-size: 12px;
  font-weight: 700;
}

.bubble {
  min-width: 0;
  border-radius: 10px 10px 10px 4px;
  padding: 6px 8px 5px;
  color: var(--ink);
  background: var(--bubble-in);
  box-shadow: 0 1px 2px rgba(23, 33, 43, 0.12);
}

.message.outgoing .bubble {
  border: 1px solid var(--bubble-out-line);
  border-radius: 10px 10px 4px 10px;
  background: var(--bubble-out);
}

.message.is-deleted .bubble {
  color: #7b8994;
  background: rgba(235, 240, 244, 0.92);
  box-shadow: none;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: #6f95b5;
  font-size: 11px;
  font-weight: 650;
  margin-bottom: 2px;
}

.message.outgoing .meta {
  color: #4b9657;
}

.text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.36;
  font-size: 13px;
}

.deleted-text {
  color: #7b8994;
  font-style: italic;
}

.quote-block {
  margin: 2px 0 5px;
  padding: 5px 7px;
  border-left: 3px solid var(--brand);
  border-radius: 6px;
  color: #47718e;
  background: rgba(51, 144, 236, 0.08);
  font-size: 11px;
  line-height: 1.34;
  overflow-wrap: anywhere;
}

.message.outgoing .quote-block {
  border-left-color: #4fb477;
  color: #477344;
  background: rgba(79, 180, 119, 0.11);
}

.translation {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(111, 123, 134, 0.18);
  color: #3e5f70;
  font-size: 13px;
  line-height: 1.36;
}

.message-tools {
  display: flex;
  gap: 3px;
  justify-content: flex-end;
  margin-top: 4px;
}

.pin-action {
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 600;
}

.pin-action:hover {
  color: var(--brand);
  background: rgba(51, 144, 236, 0.1);
}

.pin-action.danger-action {
  color: #c24132;
}

.pin-action.danger-action:hover {
  color: #a72f24;
  background: rgba(194, 65, 50, 0.1);
}

.pin-action.is-copied {
  color: #0f8f4f;
  background: rgba(15, 143, 79, 0.12);
}

.composer {
  grid-row: 3;
  align-self: end;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: #f4f8fb;
}

.composer-context {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 8px 10px;
  border-left: 3px solid var(--brand);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(23, 33, 43, 0.08);
}

.composer.is-editing .composer-context {
  border-left-color: #4fb477;
}

.composer-context div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.composer-context strong {
  color: var(--ink-strong);
  font-size: 12px;
}

.composer-context span {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-context button {
  width: auto;
  height: auto;
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--muted);
  background: #eef3f7;
  font-size: 12px;
  box-shadow: none;
}

.composer-context button::before {
  content: none;
}

.composer input {
  width: 100%;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(23, 33, 43, 0.08);
}

.composer button {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  padding: 0;
  font-size: 0;
  box-shadow: 0 2px 6px rgba(51, 144, 236, 0.28);
}

.composer button::before {
  content: "›";
  display: block;
  transform: translateX(1px);
  color: #fff;
  font-size: 28px;
  line-height: 36px;
}

.admin-view {
  grid-column: 2;
  grid-row: 1;
  overflow: auto;
  padding: 0 18px 18px;
  background: #eef3f7;
}

.admin-section-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 -18px 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(238, 243, 247, 0.96);
}

.admin-section-tabs button {
  width: auto;
  min-width: 108px;
  padding: 10px 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
}

.admin-section-tabs button:hover,
.admin-section-tabs button.active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

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

.chat-admin-panel {
  grid-column: 1 / -1;
}

.interface-grid {
  display: grid;
  max-width: 760px;
  gap: 14px;
}

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

.interface-form label:nth-child(2),
.interface-form label:nth-child(5),
.interface-form button,
.interface-form .hint {
  grid-column: 1 / -1;
}

.wechat-push-panel {
  grid-column: 1 / -1;
}

.wechat-push-form .wide-field,
.wechat-push-form .check-row {
  grid-column: 1 / -1;
}

.copy-field-stack {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.wechat-task-list {
  max-height: 520px;
  overflow: auto;
}

.wechat-task-row textarea {
  min-height: 96px;
  resize: vertical;
}

.wechat-task-sent {
  border-left: 4px solid #0a7a3d;
}

.wechat-task-failed {
  border-left: 4px solid #b31312;
}

.wechat-task-claimed {
  border-left: 4px solid #b26a00;
}

.error-text {
  color: #b31312;
}

.wechat-remark-edit {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.wechat-remark-edit button {
  white-space: nowrap;
}

.ip-check-form {
  margin-bottom: 14px;
}

.ip-check-result {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 8px solid #718096;
  border-radius: 8px;
  background: #f7fafc;
}

.ip-check-result.ip-result-residential {
  border-color: #0a7a3d;
  border-left-color: #005f2a;
  background: #eefcf4;
}

.ip-check-result.ip-result-datacenter {
  border-color: #b31312;
  border-left-color: #8f0f0f;
  background: #fff1f0;
}

.ip-check-result.ip-result-unknown {
  border-color: #b26a00;
  border-left-color: #8a5200;
  background: #fff8e8;
}

.ip-result-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ip-result-summary > div {
  display: grid;
  gap: 3px;
}

.ip-result-summary strong {
  color: var(--ink-strong);
  font-size: 18px;
}

.ip-result-summary span {
  color: var(--muted);
  font-size: 13px;
}

.ip-result-badge {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 8px 18px rgba(14, 22, 33, 0.18);
}

.ip-badge-residential {
  background: #005f2a;
}

.ip-badge-datacenter {
  background: #9f1111;
}

.ip-badge-unknown {
  background: #8a5200;
}

.ip-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ip-result-grid div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.ip-result-grid span,
.ip-source-row span {
  color: var(--muted);
  font-size: 12px;
}

.ip-result-grid strong {
  min-width: 0;
  color: var(--ink-strong);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.ip-result-reasons,
.ip-source-list {
  display: grid;
  gap: 7px;
}

.ip-result-reasons span {
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
}

.ip-source-row {
  display: grid;
  grid-template-columns: minmax(96px, 0.5fr) minmax(70px, 0.3fr) minmax(0, 1.7fr);
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.ip-source-row strong {
  color: var(--ink-strong);
  font-size: 13px;
}

.ip-source-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.ip-source-row-error {
  opacity: 0.74;
}

.panel {
  padding: 18px;
  box-shadow: none;
}

.panel:last-child {
  grid-column: 1 / -1;
}

.panel-head {
  display: grid;
  gap: 5px;
  margin-bottom: 16px;
}

.panel-head p {
  font-size: 13px;
  line-height: 1.45;
}

.inline-form {
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.8fr) auto;
  align-items: end;
  margin-bottom: 14px;
}

.user-form {
  grid-template-columns: 1fr 1fr 160px auto;
}

.user-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 0 0 14px;
}

.user-tools span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.nav-link-form {
  grid-template-columns: minmax(130px, 0.8fr) minmax(130px, 0.8fr) minmax(180px, 1.2fr) minmax(150px, 1fr) 90px auto minmax(90px, 0.6fr);
}

.glossary-form {
  grid-template-columns: 130px 130px minmax(140px, 1fr) minmax(140px, 1fr) minmax(140px, 1fr) 130px 82px minmax(150px, 1fr);
  align-items: center;
  margin-bottom: 14px;
}

.glossary-form button,
.glossary-form .form-hint {
  grid-column: span 2;
}

.glossary-row {
  align-items: flex-start;
}

.glossary-row.is-disabled {
  opacity: 0.64;
}

.glossary-row-main {
  min-width: 0;
  display: grid;
  gap: 7px;
  flex: 1;
}

.glossary-edit-grid {
  display: grid;
  grid-template-columns: 110px 110px minmax(120px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) 128px 78px minmax(120px, 1fr) 118px;
  gap: 8px;
  align-items: center;
}

.glossary-edit-grid input,
.glossary-edit-grid select {
  min-width: 0;
}

.form-hint {
  align-self: center;
  min-height: 20px;
  font-size: 13px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.check-row input {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
}

.room-access {
  margin-top: 9px;
  display: grid;
  gap: 7px;
}

.room-access .check-row {
  color: var(--ink);
}

.room-access-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.workload-settings {
  margin-top: 8px;
  display: grid;
  grid-template-columns: minmax(150px, max-content) minmax(220px, 1fr) 88px minmax(150px, max-content);
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}

.workload-settings input {
  min-width: 0;
}

.workload-settings .check-row {
  color: var(--ink);
  font-size: 13px;
}

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

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  padding: 14px;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.72);
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.chat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.chat-row-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.chat-row-main .copy-field,
.chat-row-main .announcement-input,
.chat-row-main .workload-settings {
  width: 100%;
  max-width: 760px;
}

.chat-row-actions {
  display: grid !important;
  grid-template-columns: 1fr;
  align-content: start;
  min-width: 118px;
}

.chat-row-actions .small {
  width: 100%;
}

.list-row:hover {
  border-color: var(--line-strong);
}

.list-row div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.list-row strong {
  color: var(--ink-strong);
  font-weight: 650;
}

.row-actions {
  display: flex !important;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px !important;
}

.list-row span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.small {
  padding: 8px 12px;
  white-space: nowrap;
}

.danger {
  color: #fff;
  background: var(--danger);
}

.danger:hover {
  background: var(--danger-dark);
}

.copy-field {
  margin-top: 7px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--muted);
  background: #f7fafc;
}

.nav-link-row .copy-field {
  margin-top: 5px;
}

.announcement-input {
  min-height: 76px;
  resize: vertical;
  line-height: 1.45;
}

@media (max-width: 1280px) {
  .chat-row {
    grid-template-columns: 1fr;
  }

  .chat-row-actions {
    grid-template-columns: repeat(auto-fit, minmax(104px, max-content));
    width: 100%;
  }

  .chat-row-actions .small {
    width: auto;
  }

  .chat-row-main .copy-field,
  .chat-row-main .announcement-input,
  .chat-row-main .workload-settings {
    max-width: none;
  }

  .workload-settings {
    grid-template-columns: minmax(150px, max-content) minmax(220px, 1fr) 88px;
  }

  .workload-settings .check-row:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .shell {
    padding: 0;
  }

  .login-panel,
  .home-panel,
  .app-panel {
    min-height: 100vh;
    width: 100%;
    border: 0;
    border-radius: 0;
  }

  .home-panel {
    grid-template-rows: auto auto auto;
  }

  .home-nav {
    align-items: flex-start;
    padding: 16px;
  }

  .home-brand strong {
    max-width: 150px;
    line-height: 1.25;
  }

  .home-nav-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }

  .home-hero {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 22px 16px 8px;
  }

  .home-copy {
    transform: none;
    gap: 16px;
  }

  .home-copy h1 {
    font-size: 42px;
    line-height: 1.05;
  }

  .home-copy p {
    font-size: 15px;
    line-height: 1.58;
  }

  .home-visual {
    min-height: 310px;
    transform: none;
  }

  .orbit-card-main {
    top: 70px;
    right: 4%;
    min-width: 230px;
    min-height: 138px;
  }

  .orbit-card-side {
    left: 0;
    top: 20px;
  }

  .orbit-card-small {
    left: 10%;
    bottom: 28px;
  }

  .orbit-card strong {
    font-size: 30px;
  }

  .home-products {
    grid-template-columns: 1fr;
    padding: 8px 16px 20px;
  }

  .home-products article,
  .home-products article:nth-child(2) {
    min-height: auto;
    transform: none;
  }

  .home-ip-tool {
    grid-template-columns: 1fr;
    padding: 8px 16px 18px;
  }

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

  .home-ip-form button {
    width: 100%;
  }

  .home-ip-result {
    grid-column: 1;
  }

  .app-panel {
    height: 100vh;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .topbar {
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto;
    align-items: center;
    padding: 10px 12px;
  }

  .topbar > div:first-child {
    grid-template-columns: 38px minmax(0, 1fr);
    min-height: 42px;
    padding: 0;
    border-bottom: 0;
  }

  .topbar > div:first-child::before {
    width: 38px;
    height: 38px;
  }

  .top-actions {
    display: flex;
    align-items: center;
  }

  .session-actions {
    display: flex;
    gap: 8px;
  }

  .tabs {
    display: flex;
  }

  .tab {
    width: auto;
    padding: 8px 10px;
    text-align: center;
  }

  #logoutButton {
    width: auto;
  }

  .chat-view,
  .nav-view,
  .store-view,
  .server-manage-view,
  .agency-view,
  .support-view,
  .admin-view,
  .interface-view {
    grid-column: 1;
    grid-row: 2;
  }

  .chat-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .room-list-panel {
    max-height: 132px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .room-list {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .room-list-item {
    min-width: 158px;
  }

  .message {
    max-width: 96%;
  }

  .composer,
  .inline-form,
  .user-form,
  .user-tools,
  .recharge-form,
  .nav-link-form,
  .glossary-form,
  .glossary-edit-grid,
  .workload-settings,
  .nav-head,
  .nav-body,
  .account-body,
  .store-body,
  .server-manage-body,
  .agency-dashboard,
  .agency-grid,
  .support-layout,
  .store-view .shop-head,
  .server-manage-view .shop-head,
  .agency-view .shop-head,
  .server-products,
  .server-card-grid--attention,
  .server-card-grid--inventory,
  .server-card-grid--orders,
  .server-buy-form,
  .renew-form,
  .server-product-form,
  .admin-shop-layout,
  .notice-strip,
  .pinned-strip,
  .admin-grid,
  .interface-grid,
  .interface-form,
  .ip-result-grid,
  .ip-source-row,
  .agent-settings-grid,
  .user-server-filter,
  .list-row,
  .row-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .chat-main-panel .composer {
    grid-template-columns: minmax(0, 1fr) 40px;
    flex-direction: row;
    align-items: center;
  }

  .chat-main-panel .composer input {
    width: 100%;
    min-width: 0;
    height: 40px;
    max-height: 40px;
  }

  .chat-main-panel .composer button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    justify-self: end;
  }

  .server-manage-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .server-console-link {
    width: 100%;
  }

  .glossary-form button,
  .glossary-form .form-hint {
    grid-column: auto;
  }

  .panel:last-child {
    grid-column: auto;
  }
}

@media (min-width: 1760px) {
  .app-panel {
    width: calc(100vw - 32px);
  }

  .message {
    max-width: min(980px, 72%);
  }
}
