/* Velo 授权中心 — design tokens from license-ui-03 */

:root {
  --bg: #f4f5f7;
  --surface: #fff;
  --surface-2: #f0f1f3;
  --surface-3: #e6e8eb;
  --ink: #202124;
  --ink-2: #5e626b;
  --ink-3: #898d96;
  --line: rgba(32, 33, 36, 0.1);
  --line-strong: rgba(32, 33, 36, 0.18);
  --blue: #5875e8;
  --blue-hover: #4967dc;
  --blue-soft: rgba(88, 117, 232, 0.1);
  --orange: #ee7548;
  --orange-soft: rgba(238, 117, 72, 0.1);
  --green: #2c9b62;
  --green-soft: rgba(44, 155, 98, 0.1);
  --red: #d34f4b;
  --red-soft: rgba(211, 79, 75, 0.1);
  --shadow: 0 18px 50px rgba(33, 37, 45, 0.12), 0 2px 8px rgba(33, 37, 45, 0.06);
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

html[data-theme="dark"] {
  --bg: #17191e;
  --surface: #25272e;
  --surface-2: #2d3038;
  --surface-3: #353944;
  --ink: #f4f4f5;
  --ink-2: #bec1c8;
  --ink-3: #8b909b;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.17);
  --blue-soft: rgba(111, 137, 244, 0.16);
  --orange-soft: rgba(238, 117, 72, 0.14);
  --green-soft: rgba(65, 190, 124, 0.14);
  --red-soft: rgba(235, 94, 89, 0.14);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
  color: inherit;
}

button {
  cursor: pointer;
}

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

svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

.mono {
  font-family: var(--mono);
}

.muted {
  color: var(--ink-3);
}

:focus-visible {
  outline: 2px solid rgba(88, 117, 232, 0.55);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* Buttons */
.btn,
.icon-btn {
  display: inline-flex;
  height: 32px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(33, 37, 45, 0.04);
  white-space: nowrap;
  transition: transform 150ms var(--ease), background 150ms ease,
    border-color 150ms ease;
}

.icon-btn {
  width: 32px;
  padding: 0;
}

.btn:hover,
.icon-btn:hover {
  border-color: rgba(88, 117, 232, 0.34);
  background: var(--surface-2);
}

.btn:active,
.icon-btn:active {
  transform: scale(0.97);
}

.btn:disabled,
.icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.btn.primary:hover:not(:disabled) {
  background: var(--blue-hover);
}

.btn.danger {
  border-color: rgba(211, 79, 75, 0.25);
  color: var(--red);
}

.btn.danger:hover:not(:disabled) {
  background: var(--red-soft);
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.btn.sm {
  height: 28px;
  padding: 0 9px;
  font-size: 10px;
}

.icon-btn.sm {
  width: 28px;
  height: 28px;
}

/* Badges */
.badge {
  display: inline-flex;
  height: 20px;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 8.5px;
  font-weight: 650;
}

.badge.green {
  background: var(--green-soft);
  color: var(--green);
}

.badge.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge.orange {
  background: var(--orange-soft);
  color: var(--orange);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* App shell + sidebar */
.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 232px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  height: 100vh;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 74%, var(--bg));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.sidebar-head {
  display: flex;
  height: 64px;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 720;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 7px;
  background: #23252b;
  color: #fff;
}

.brand-mark svg {
  width: 16px;
  height: 16px;
}

.brand small {
  display: block;
  margin: 1px 0 0;
  color: var(--ink-3);
  font-size: 8px;
  font-weight: 550;
}

.brand > span:last-child {
  line-height: 1.25;
}

.sidebar-head .icon-btn {
  margin-left: auto;
  background: transparent;
  box-shadow: none;
}

.sidebar-account {
  padding: 15px 12px 8px;
}

.sidebar-account .account {
  width: 100%;
  height: 43px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  text-align: left;
}

.sidebar-account .account:hover {
  border-color: var(--line);
  background: var(--surface);
}

.avatar {
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border-radius: 6px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 9px;
  font-weight: 750;
  flex-shrink: 0;
}

.account-copy {
  min-width: 0;
  flex: 1;
}

.account-copy b,
.account-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy b {
  font-size: 10px;
}

.account-copy span {
  margin-top: 1px;
  color: var(--ink-3);
  font-size: 8px;
}

.sidebar-label {
  margin: 13px 18px 5px;
  color: var(--ink-3);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.side-nav {
  display: grid;
  gap: 2px;
  padding: 0 9px;
}

.side-nav .tab {
  position: relative;
  display: flex;
  width: 100%;
  height: 35px;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font-size: 11px;
  text-align: left;
}

.side-nav .tab:hover {
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--ink);
}

.side-nav .tab.active {
  color: var(--blue);
  font-weight: 650;
  background: var(--blue-soft);
}

.side-nav .tab svg {
  width: 14px;
  height: 14px;
}

.tab-count {
  min-width: 17px;
  margin-left: auto;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--ink-3);
  font: 8px var(--mono);
  text-align: center;
}

.side-nav .tab.active .tab-count {
  background: var(--blue-soft);
  color: var(--blue);
}

.sidebar-link {
  display: flex;
  height: 34px;
  align-items: center;
  gap: 8px;
  margin: 2px 9px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--ink-2);
  font-size: 10px;
}

.sidebar-link:hover {
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--ink);
}

.sidebar-link svg {
  width: 14px;
}

.sidebar-spacer {
  flex: 1;
}

.sidebar-foot {
  padding: 13px 16px 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 8px;
}

.sidebar-foot .status-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
  color: var(--ink-2);
}

.sidebar-foot .dot {
  color: var(--green);
}

/* Main */
.app-shell main {
  width: min(1020px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.view {
  display: none;
  animation: enter 230ms var(--ease);
}

.view.active {
  display: block;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.page-head {
  display: flex;
  min-height: 54px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.page-head h1 {
  margin: 0;
  font-size: 23px;
  letter-spacing: 0;
}

.page-head p {
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 11px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  color: var(--ink-3);
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.eyebrow:before {
  content: "";
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--orange);
}

/* Overview */
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.65fr);
  gap: 12px;
}

.primary-license {
  position: relative;
  display: flex;
  min-height: 300px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.license-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 20px 16px;
}

.license-heading {
  display: flex;
  gap: 11px;
}

.license-logo {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  flex-shrink: 0;
}

.license-logo svg {
  width: 18px;
  height: 18px;
}

.license-heading h2 {
  margin: 0;
  font-size: 16px;
}

.license-heading p {
  margin: 3px 0 0;
  color: var(--ink-3);
  font-size: 9.5px;
}

.key-area {
  padding: 0 20px 17px;
}

.key-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--ink-3);
  font-size: 8.5px;
}

.key-field {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
}

.key-value {
  display: flex;
  height: 38px;
  align-items: center;
  padding: 0 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  font: 11px var(--mono);
  white-space: nowrap;
}

.key-value.hidden {
  color: transparent;
  text-shadow: 0 0 7px var(--ink-2);
  user-select: none;
}

.license-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.fact {
  min-height: 67px;
  padding: 12px 20px;
  border-right: 1px solid var(--line);
}

.fact:last-child {
  border: 0;
}

.fact span {
  display: block;
  color: var(--ink-3);
  font-size: 8px;
}

.fact b {
  display: block;
  margin-top: 4px;
  font-size: 10px;
}

.fact .usage {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-progress {
  width: 56px;
  height: 4px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--surface-3);
}

.mini-progress i {
  display: block;
  height: 100%;
  background: var(--blue);
}

.quick-panel {
  display: flex;
  min-height: 300px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.quick-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.quick-head h2 {
  margin: 0;
  font-size: 12px;
}

.quick-head p {
  margin: 3px 0 0;
  color: var(--ink-3);
  font-size: 9px;
}

.quick-actions {
  padding: 6px 8px;
}

.quick-action {
  display: grid;
  width: 100%;
  grid-template-columns: 31px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 9px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
}

.quick-action:hover {
  background: var(--surface-2);
}

.quick-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink-2);
}

.quick-action:nth-child(1) .quick-icon {
  background: var(--blue-soft);
  color: var(--blue);
}

.quick-action:nth-child(2) .quick-icon {
  background: var(--orange-soft);
  color: var(--orange);
}

.quick-action b {
  display: block;
  font-size: 10px;
}

.quick-action small {
  display: block;
  margin-top: 1px;
  color: var(--ink-3);
  font-size: 8px;
}

.quick-action > svg {
  width: 12px;
  color: var(--ink-3);
}

.service-state {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding: 11px 15px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 8.5px;
}

.service-state .dot {
  color: var(--green);
}

/* Sections & devices */
.section {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

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

.section-head h2 {
  margin: 0;
  font-size: 11px;
}

.section-head p {
  margin: 2px 0 0;
  color: var(--ink-3);
  font-size: 8.5px;
}

.device-list {
  padding: 0 14px;
}

.device-row {
  display: grid;
  min-height: 65px;
  grid-template-columns: 35px minmax(170px, 1.2fr) minmax(120px, 0.8fr) minmax(90px, 0.6fr) auto;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--line);
}

.device-row:last-child {
  border: 0;
}

.device-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink-2);
}

.device-icon svg {
  width: 15px;
}

.device-name b {
  display: block;
  font-size: 10px;
}

.device-name span,
.device-meta span {
  display: block;
  margin-top: 1px;
  color: var(--ink-3);
  font-size: 8px;
}

.device-meta b {
  font-size: 9px;
  font-weight: 550;
}

.activation-strip {
  display: grid;
  margin-top: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.activation-strip h2 {
  margin: 0;
  font-size: 13px;
}

.activation-strip p {
  max-width: 650px;
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 9.5px;
}

.activation-steps {
  display: flex;
  align-items: center;
  gap: 6px;
}

.activation-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 8.5px;
  white-space: nowrap;
}

.activation-step b {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 4px;
  background: var(--surface);
  color: var(--blue);
  font: 8px var(--mono);
}

.activation-steps > svg {
  width: 11px;
  color: var(--ink-3);
}

/* License list */
.license-list {
  display: grid;
  gap: 10px;
}

.license-card {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(250px, 1.1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.license-card-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.license-card-main .license-logo {
  width: 35px;
  height: 35px;
}

.license-card-main h2 {
  margin: 0;
  font-size: 12px;
}

.license-card-main p {
  margin: 2px 0 0;
  color: var(--ink-3);
  font-size: 8px;
}

.license-card-key label {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-3);
  font-size: 8px;
}

.compact-key {
  display: flex;
  align-items: center;
  gap: 7px;
}

.compact-key code {
  min-width: 0;
  overflow: hidden;
  font: 9.5px var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.license-card-actions {
  display: flex;
  gap: 6px;
}

.license-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  color: var(--ink-3);
  font-size: 8px;
}

.license-summary i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink-3);
}

/* Redeem history */
.redeem-history-section {
  margin-top: 12px;
}

.history-wrap {
  overflow: auto;
  padding: 4px 0 2px;
}

.history-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
}

.history-table th,
.history-table td {
  height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  font-size: 12px;
  vertical-align: middle;
  color: var(--ink);
}

.history-table th {
  height: 36px;
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

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

.history-table tbody tr {
  transition: background 120ms ease;
}

.history-table tbody tr:hover {
  background: color-mix(in srgb, var(--blue-soft) 40%, transparent);
}

.history-plan {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
}

.history-plan-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--orange-soft);
  color: var(--orange);
}

.history-plan-icon svg {
  width: 15px;
  height: 15px;
}

/* Only the text column — not the icon span */
.history-plan-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.history-plan-text b {
  display: block;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.25;
}

.history-plan-text small {
  display: block;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.2;
}

.history-table .mono {
  font: 12px var(--mono);
  color: var(--ink-2);
}

.history-table .muted {
  color: var(--ink-3);
}

.history-empty {
  padding: 40px 20px;
  text-align: center;
}

.history-empty h3 {
  margin: 0;
  font-size: 13px;
  color: var(--ink);
}

.history-empty p {
  margin: 8px 0 0;
  color: var(--ink-3);
  font-size: 12px;
}

.history-empty .empty-icon {
  display: grid;
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  place-items: center;
  border-radius: 10px;
  background: var(--orange-soft);
  color: var(--orange);
}

.history-empty .empty-icon svg {
  width: 18px;
  height: 18px;
}

/* Card layout for narrow viewports */
.history-cards {
  display: none;
  gap: 8px;
  padding: 10px 12px 14px;
}

.history-card {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.history-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-card-meta {
  display: grid;
  gap: 4px;
  color: var(--ink-3);
  font-size: 11px;
}

.history-card-meta .mono {
  font: 11.5px var(--mono);
  color: var(--ink-2);
}

@media (max-width: 720px) {
  .history-table {
    display: none;
  }

  .history-cards {
    display: grid;
  }

  .history-wrap {
    overflow: visible;
  }
}

.empty-license {
  padding: 28px;
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 38px;
  height: 38px;
  margin: 0 auto 10px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-3);
}

.empty-license h3 {
  margin: 0;
  font-size: 11px;
}

.empty-license p {
  margin: 4px 0 12px;
  color: var(--ink-3);
  font-size: 8.5px;
}

/* Guest empty state */
.guest-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 40px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.guest-panel .empty-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  background: var(--blue-soft);
  color: var(--blue);
}

.guest-panel h2 {
  margin: 0;
  font-size: 16px;
}

.guest-panel p {
  margin: 6px 0 18px;
  max-width: 360px;
  color: var(--ink-2);
  font-size: 11px;
}

/* Redeem */
.redeem-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(270px, 0.8fr);
  gap: 12px;
}

.redeem-main,
.redeem-help {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.redeem-main {
  padding: 22px;
}

.redeem-mark {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 8px;
  background: var(--orange-soft);
  color: var(--orange);
}

.redeem-main h2 {
  margin: 0;
  font-size: 15px;
}

.redeem-main > p {
  margin: 4px 0 18px;
  color: var(--ink-2);
  font-size: 9.5px;
}

.field label {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-2);
  font-size: 9px;
  font-weight: 600;
}

.field small {
  display: block;
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 8px;
}

.input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  outline: none;
}

.input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.input:disabled {
  color: var(--ink-3);
  background: var(--surface-2);
  cursor: default;
}

.redeem-input {
  height: 42px;
  font: 11px var(--mono);
  text-transform: uppercase;
}

.redeem-submit {
  display: flex;
  gap: 7px;
  margin-top: 8px;
}

.redeem-submit .btn {
  height: 38px;
}

.redeem-note {
  margin-top: 10px;
  color: var(--ink-3);
  font-size: 8px;
}

.redeem-help {
  padding: 18px;
}

.redeem-help h2 {
  margin: 0 0 12px;
  font-size: 11px;
}

.help-step {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  margin: 12px 0;
}

.help-step b {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--blue);
  font: 8px var(--mono);
}

.help-step span {
  color: var(--ink-2);
  font-size: 8.5px;
}

.help-step span strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 9px;
}

/* Account */
.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 12px;
}

.account-main,
.account-side {
  display: grid;
  gap: 12px;
}

.form-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.form-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.form-head h2 {
  margin: 0;
  font-size: 11px;
}

.form-head p {
  margin: 2px 0 0;
  color: var(--ink-3);
  font-size: 8px;
}

.form-body {
  padding: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.form-actions .btn {
  min-height: 32px;
}

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

.session-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  background: var(--green-soft);
  color: var(--green);
}

.session-icon svg {
  width: 15px;
  height: 15px;
}

.session-copy {
  flex: 1;
  min-width: 0;
}

.session-copy b {
  display: block;
  font-size: 10px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-copy span {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 8px;
}

.session > .badge {
  flex: 0 0 auto;
  margin-left: auto;
}

.side-action {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.side-action:last-child {
  border: 0;
}

.side-action > svg {
  margin-top: 1px;
  color: var(--ink-3);
}

.side-action b {
  display: block;
  font-size: 9px;
}

.side-action p {
  margin: 2px 0 8px;
  color: var(--ink-3);
  font-size: 8px;
}

details.form-card summary {
  list-style: none;
  cursor: pointer;
}

details.form-card summary::-webkit-details-marker {
  display: none;
}

/* Assets placeholder */
.asset-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.asset-stat {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.asset-stat span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-3);
  font-size: 8px;
}

.asset-stat span svg {
  width: 13px;
}

.asset-stat strong {
  display: block;
  margin: 7px 0 2px;
  font: 18px var(--mono);
}

.asset-stat small {
  color: var(--ink-3);
  font-size: 7.5px;
}

.coming-soon {
  padding: 32px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.coming-soon h3 {
  margin: 0 0 6px;
  font-size: 13px;
}

.coming-soon p {
  margin: 0;
  color: var(--ink-3);
  font-size: 10px;
}

/* Modal */
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(23, 25, 30, 0.34);
  backdrop-filter: blur(6px);
}

.modal-layer.open {
  display: grid;
}

.modal {
  width: min(430px, 100%);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(23, 25, 30, 0.34);
  animation: pop 200ms var(--ease);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(7px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 11px;
}

.modal-body {
  padding: 16px;
}

.modal-body h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.modal-body p {
  margin: 0 0 13px;
  color: var(--ink-2);
  font-size: 9.5px;
}

.modal-body .field {
  margin-bottom: 10px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: min(420px, calc(100% - 32px));
  padding: 8px 11px;
  transform: translate(-50%, 14px);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
  font-size: 9px;
  white-space: pre-wrap;
  word-break: break-word;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.toast svg {
  width: 12px;
  flex-shrink: 0;
  color: var(--green);
}

.toast.err svg {
  color: var(--red);
}

.toast.err {
  border-color: rgba(211, 79, 75, 0.3);
}

/* Responsive */
@media (max-width: 860px) {
  .overview-grid,
  .redeem-layout,
  .account-grid {
    grid-template-columns: 1fr;
  }

  .license-card {
    grid-template-columns: 1fr 1fr;
  }

  .license-card-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

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

  .activation-steps {
    overflow-x: auto;
  }

  .device-row {
    grid-template-columns: 35px 1fr auto;
  }

  .device-meta {
    display: none;
  }

  .asset-overview {
    grid-template-columns: 1fr 1fr;
  }

  .asset-overview .asset-stat:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    top: auto;
    z-index: 55;
    display: block;
    width: 100%;
    height: 58px;
    border-top: 1px solid var(--line);
    border-right: 0;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
  }

  .sidebar-head,
  .sidebar-account,
  .sidebar-label,
  .sidebar-link,
  .sidebar-spacer,
  .sidebar-foot {
    display: none;
  }

  .side-nav {
    display: grid;
    height: 58px;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    padding: 0 3px;
  }

  .side-nav .tab {
    position: relative;
    width: 100%;
    height: 58px;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 0;
    border-radius: 0;
    font-size: 7px;
  }

  .side-nav .tab:hover {
    background: transparent;
  }

  .side-nav .tab.active {
    background: transparent;
  }

  .side-nav .tab.active:after {
    content: "";
    position: absolute;
    display: block;
    top: 0;
    right: 24%;
    bottom: auto;
    left: 24%;
    height: 2px;
    border-radius: 0 0 2px 2px;
    background: var(--blue);
  }

  .side-nav .tab-count {
    display: none;
    margin: 0;
  }

  .app-shell main {
    width: calc(100% - 24px);
    padding: 24px 0 84px;
  }
}

@media (max-width: 620px) {
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-head > .btn {
    width: 100%;
  }

  .primary-license {
    min-height: auto;
  }

  .license-top {
    padding: 16px;
  }

  .key-area {
    padding: 0 16px 15px;
  }

  .key-field {
    grid-template-columns: 1fr auto;
  }

  .key-field .copy-key {
    display: none;
  }

  .license-facts {
    grid-template-columns: 1fr;
  }

  .fact {
    min-height: 53px;
    padding: 9px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .fact:last-child {
    border-bottom: 0;
  }

  .device-row {
    grid-template-columns: 32px 1fr auto;
    gap: 8px;
  }

  .device-row .btn span {
    display: none;
  }

  .activation-steps {
    align-items: stretch;
    flex-direction: column;
  }

  .activation-steps > svg {
    display: none;
  }

  .license-card {
    grid-template-columns: 1fr;
  }

  .license-card-actions {
    grid-column: auto;
    justify-content: stretch;
  }

  .license-card-actions .btn {
    flex: 1;
  }

  .redeem-main {
    padding: 17px;
  }

  .redeem-submit {
    flex-direction: column;
  }

  .redeem-submit .btn {
    width: 100%;
  }

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