:root {
  --bg: #101214;
  --panel: #181c20;
  --panel-2: #20262b;
  --line: #303840;
  --text: #edf2f4;
  --muted: #97a4ad;
  --soft: #c5d0d7;
  --accent: #6ee7d8;
  --accent-2: #f2c14e;
  --danger: #ff6b6b;
  --success: #7bd88f;
  --shadow: 0 20px 70px rgba(0, 0, 0, .34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(110, 231, 216, .08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(110, 231, 216, .05) 1px, transparent 1px),
    radial-gradient(circle at 20% 0%, rgba(242, 193, 78, .12), transparent 28rem),
    #101214;
  background-size: 42px 42px, 42px 42px, auto, auto;
}

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

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

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

button {
  border: 1px solid var(--line);
  background: #232a30;
  color: var(--text);
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

button:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

button.primary,
.primary {
  background: var(--accent);
  color: #07110f;
  border-color: var(--accent);
  font-weight: 800;
}

button.danger,
.danger {
  border-color: rgba(255, 107, 107, .5);
  color: #ffd8d8;
}

button.ghost {
  background: transparent;
}

.full {
  width: 100%;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 18px;
  grid-template-columns: auto auto;
  color: var(--soft);
}

.boot-screen span {
  display: block;
  color: var(--muted);
  margin-top: 6px;
}

.boot-mark {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(110, 231, 216, .25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.auth-page {
  min-height: 100vh;
  padding: 32px;
  display: grid;
  place-items: center;
}

.auth-panel {
  width: min(1120px, 100%);
}

.auth-panel.normal-auth {
  width: min(460px, 100%);
}

.auth-card {
  border: 1px solid var(--line);
  background: rgba(24, 28, 32, .96);
  box-shadow: var(--shadow);
  border-radius: 10px;
  padding: 34px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.auth-lockup {
  justify-content: center;
  text-align: left;
  margin-bottom: 18px;
}

.brand-mark,
.logo span {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 10px;
  background: #dbe8e6;
  color: #101214;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 8px 8px 0 var(--accent);
}

.brand-lockup h1,
.topbar h1,
.hero-board h2,
.checkout-panel h2,
.identity-panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
}

.auth-copy {
  color: var(--soft);
  font-size: 15px;
  line-height: 1.7;
  text-align: center;
  max-width: 360px;
  margin: 0 auto 24px;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 16px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #111519;
}

.auth-tabs button {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 7px;
  padding: 0 8px;
}

.auth-tabs button.active {
  background: var(--panel-2);
  color: var(--text);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  margin-bottom: 0;
}

.form-card,
.panel,
.checkout-panel,
.plan-card,
.metric,
.hero-board {
  border: 1px solid var(--line);
  background: rgba(24, 28, 32, .94);
  box-shadow: var(--shadow);
  border-radius: 8px;
}

.form-card {
  padding: 24px;
}

.form-card.subdued {
  background: rgba(24, 28, 32, .74);
}

.form-card h2,
.panel h3,
.checkout-panel h2 {
  margin: 0 0 18px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--soft);
  font-size: 13px;
  margin-bottom: 14px;
}

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

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(110, 231, 216, .12);
}

.input-action {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.hint,
.muted,
.mini-item p,
.list-row p,
.node-row p,
.metric p {
  color: var(--muted);
}

.hint {
  font-size: 12px;
  line-height: 1.5;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(16, 18, 20, .88);
  backdrop-filter: blur(18px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 900;
}

.logo span {
  width: 40px;
  height: 40px;
  box-shadow: 5px 5px 0 var(--accent);
}

.sidebar nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  color: var(--soft);
  border-radius: 8px;
}

.sidebar nav a.active,
.sidebar nav a:hover {
  background: #232a30;
  color: var(--text);
}

.workspace {
  min-width: 0;
  padding: 28px;
  padding-bottom: 40px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  background: rgba(24, 28, 32, .9);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px 8px 8px;
}

.account-chip img,
.identity-panel img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--panel-2);
}

.content {
  max-width: 1280px;
}

.hero-board {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 28px;
  margin-bottom: 16px;
  background:
    linear-gradient(135deg, rgba(110, 231, 216, .16), transparent 48%),
    rgba(24, 28, 32, .96);
}

.hero-board h2 {
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1;
  margin-bottom: 12px;
}

.radial {
  --value: 0;
  width: 136px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #181c20 57%, transparent 58%),
    conic-gradient(var(--accent) calc(var(--value) * 1%), #303840 0);
}

.radial span,
.radial small {
  grid-area: 1 / 1;
}

.radial span {
  font-size: 28px;
  font-weight: 900;
}

.radial small {
  align-self: end;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 11px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

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

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

.metric strong {
  display: block;
  font-size: 26px;
  margin: 8px 0;
}

.panel-grid,
.shop-layout,
.support-layout,
.account-layout {
  display: grid;
  gap: 16px;
}

.panel-grid {
  grid-template-columns: 1.4fr 1fr;
}

.wide {
  grid-column: 1 / -1;
}

.panel,
.checkout-panel {
  padding: 20px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-head h3 {
  margin: 0;
}

.copy-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.copy-box code,
.qr-text {
  overflow-wrap: anywhere;
  background: #111519;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--soft);
}

.mini-item,
.list-row,
.node-row {
  border: 1px solid var(--line);
  background: rgba(32, 38, 43, .62);
  border-radius: 8px;
}

.mini-item {
  padding: 14px;
  margin-bottom: 10px;
}

.action-row,
.list-row,
.node-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shop-layout {
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
}

.plan-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.plan-card {
  padding: 20px;
  display: grid;
  gap: 16px;
  box-shadow: none;
}

.plan-card.active {
  border-color: var(--accent);
}

.plan-card h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.plan-card p {
  color: var(--muted);
  line-height: 1.6;
}

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

.plan-meta span,
.status {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  background: #111519;
  color: var(--soft);
  border: 1px solid var(--line);
}

.period-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.period-grid button {
  height: auto;
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 12px;
}

.period-grid button.active {
  border-color: var(--accent);
  background: rgba(110, 231, 216, .12);
}

.coupon-field {
  margin-top: 10px;
}

.table-list {
  display: grid;
  gap: 10px;
}

.list-row {
  padding: 14px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status.pending {
  border-color: rgba(242, 193, 78, .5);
  color: #ffe3a3;
}

.status.success {
  border-color: rgba(123, 216, 143, .5);
  color: #c9f7d2;
}

.node-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.node-row {
  padding: 12px;
  margin-bottom: 10px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  flex: 0 0 auto;
}

.dot.online {
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(123, 216, 143, .12);
}

.support-layout {
  grid-template-columns: 380px 1fr;
}

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

.stack-form label {
  margin: 0;
}

.knowledge-group {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.knowledge-group h4 {
  margin: 0 0 10px;
  color: var(--accent-2);
}

.knowledge-group article {
  padding: 12px 0;
  border-bottom: 1px solid rgba(48, 56, 64, .7);
}

.account-layout {
  grid-template-columns: 1.1fr 1fr 1fr;
}

.identity-panel {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 12px;
}

.identity-panel img {
  width: 76px;
  height: 76px;
}

.check-row {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.mobile-nav {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, .64);
}

.modal {
  position: relative;
  width: min(620px, 100%);
  max-height: min(760px, 88vh);
  overflow: auto;
  background: #181c20;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.icon-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 24px;
}

.payment-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.payment-option {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 0;
}

.payment-option input {
  width: 18px;
}

.payment-option img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 8px;
}

.ticket-thread {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.bubble {
  justify-self: start;
  max-width: 86%;
  background: #111519;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.bubble.me {
  justify-self: end;
  background: rgba(110, 231, 216, .1);
  border-color: rgba(110, 231, 216, .35);
}

.bubble p {
  margin: 0 0 8px;
  white-space: pre-wrap;
}

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

.empty {
  display: grid;
  place-items: center;
  min-height: 120px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 40;
  transform: translateX(-50%);
  background: #e8f8f6;
  color: #07110f;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.toast.error {
  background: #ffe1e1;
}

.loading-line {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: loading 1s ease-in-out infinite;
}

@keyframes loading {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@media (max-width: 1040px) {
  .auth-grid,
  .quick-grid,
  .panel-grid,
  .shop-layout,
  .support-layout,
  .account-layout,
  .node-grid {
    grid-template-columns: 1fr;
  }

  .checkout-panel {
    position: static;
  }

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

@media (max-width: 760px) {
  body {
    background-size: 34px 34px, 34px 34px, auto, auto;
  }

  .auth-page {
    padding: 18px;
    place-items: center;
  }

  .auth-card {
    padding: 24px 18px;
  }

  .auth-grid,
  .plan-list {
    grid-template-columns: 1fr;
  }

  .app-shell {
    display: block;
    padding-bottom: 78px;
  }

  .sidebar {
    display: none;
  }

  .workspace {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .account-chip span {
    display: none;
  }

  .hero-board {
    align-items: flex-start;
    padding: 20px;
  }

  .hero-board h2 {
    font-size: 32px;
  }

  .radial {
    width: 98px;
  }

  .radial span {
    font-size: 20px;
  }

  .radial small {
    display: none;
  }

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

  .copy-box,
  .list-row,
  .action-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .row-actions {
    justify-content: flex-start;
  }

  .period-grid {
    grid-template-columns: 1fr;
  }

  .mobile-nav {
    position: fixed;
    z-index: 15;
    left: 10px;
    right: 10px;
    bottom: 10px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(16, 18, 20, .9);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
  }

  .mobile-nav a {
    display: grid;
    place-items: center;
    gap: 2px;
    color: var(--muted);
    min-height: 48px;
    border-radius: 8px;
  }

  .mobile-nav a.active {
    color: #07110f;
    background: var(--accent);
  }

  .mobile-nav small {
    font-size: 11px;
  }

  .toast {
    bottom: 86px;
    width: calc(100% - 32px);
    text-align: center;
  }
}

@media (max-width: 430px) {
  .quick-grid {
    grid-template-columns: 1fr;
  }

  .hero-board {
    display: grid;
  }

  .radial {
    justify-self: start;
  }
}
