:root {
  color-scheme: dark;
  --bg: #0c0c0f;
  --panel: #121217;
  --panel-soft: #17171d;
  --panel-strong: #1a1b22;
  --line: #262730;
  --line-soft: #2f3039;
  --text: #f5f7fb;
  --muted: #9297a7;
  --gold: #f4b012;
  --gold-soft: rgba(244, 176, 18, 0.14);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.14);
  --radius: 18px;
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.28);
  --sidebar-width: 255px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  font-size: 16px;
}

body.auth-page {
  background:
    radial-gradient(circle at top, rgba(244, 176, 18, 0.12), transparent 32%),
    var(--bg);
}

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

button {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
}

.sidebar {
  background: #0f0f14;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 28px 20px 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  min-height: 48px;
  margin-bottom: 18px;
}

.brand img {
  width: 118px;
  max-width: 100%;
  display: block;
}

.nav-section + .nav-section {
  margin-top: 26px;
}

.nav-label {
  margin: 0 0 10px;
  color: #646b7f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #c0c4d4;
  transition: background 0.2s ease, color 0.2s ease;
}

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

.nav-item.active {
  color: var(--gold);
  font-weight: 700;
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.nav-icon svg,
.page-icon svg,
.mini-icon svg,
.device-icon svg,
.primary-btn svg,
.chevron {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.main-panel {
  min-width: 0;
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar {
  height: 76px;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  margin-right: auto;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel);
  padding: 10px;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 2px;
  background: #e5e7eb;
}

.menu-toggle span + span {
  margin-top: 5px;
}

.account-pill {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #d4d7e1;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 176, 18, 0.18);
  border: 1px solid rgba(244, 176, 18, 0.45);
  color: #f7cd54;
  font-weight: 700;
}

.account-email {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.chevron {
  width: 16px;
  height: 16px;
  color: #7f8496;
  flex: none;
}

.logout-link {
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #c8cddd;
  font-size: 0.94rem;
  font-weight: 700;
}

.logout-link:hover {
  background: rgba(255, 255, 255, 0.09);
}

.content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 38px 28px 56px;
}

.page-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.page-icon {
  width: 22px;
  height: 22px;
  color: var(--gold);
  flex: none;
}

.page-head h1,
.section-head h2 {
  margin: 0;
}

.page-head h1 {
  font-size: clamp(2rem, 3vw, 2.6rem);
  line-height: 1.05;
}

.page-head p,
.section-head p,
.device-row p,
.copy-feedback {
  margin: 0;
  color: var(--muted);
}

.flash {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 600;
}

.flash-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.22);
  color: #9ff0b7;
}

.flash-error {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.22);
  color: #ffb4b4;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 20px 22px;
}

.card-head,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.card-head span:first-child {
  color: #b6bbca;
  font-size: 0.95rem;
}

.mini-icon {
  width: 18px;
  height: 18px;
  color: var(--gold);
  flex: none;
}

.stat-card strong,
.device-row strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.7rem, 2vw, 2.25rem);
  line-height: 1.1;
}

.license-card,
.devices-card,
.info-card {
  padding: 24px;
}

.form-card,
.list-card {
  padding: 24px;
}

.license-card {
  margin-bottom: 24px;
}

.section-head {
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: 1.05rem;
}

.section-head p {
  margin-top: 6px;
  font-size: 0.98rem;
}

.license-box {
  padding: 16px 18px;
  border: 1px solid rgba(244, 176, 18, 0.28);
  border-radius: 14px;
  background: rgba(7, 7, 10, 0.42);
  color: #f4c449;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.primary-btn,
.danger-btn {
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.primary-btn:hover,
.danger-btn:hover {
  transform: translateY(-1px);
}

.primary-btn {
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--gold);
  color: #17120a;
  font-weight: 800;
}

.primary-btn svg {
  width: 18px;
  height: 18px;
}

.copy-feedback {
  min-height: 20px;
  margin-top: 10px;
  font-size: 0.92rem;
}

.copy-feedback.success {
  color: #7ee7a0;
}

.devices-card {
  margin-bottom: 24px;
}

.device-count,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(244, 176, 18, 0.12);
  border: 1px solid rgba(244, 176, 18, 0.28);
  color: #f1bd35;
  font-size: 0.9rem;
  font-weight: 800;
}

.device-row {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  background: var(--panel-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.stack-list {
  display: grid;
  gap: 14px;
}

.device-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.device-icon {
  width: 18px;
  height: 18px;
  color: #9ca3af;
  flex: none;
}

.device-row strong {
  margin-top: 0;
  font-size: 1rem;
}

.device-row p {
  margin-top: 4px;
  font-size: 0.92rem;
}

.danger-btn {
  min-width: 86px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  background: var(--red-soft);
  border: 1px solid rgba(248, 113, 113, 0.24);
  color: #fda4a4;
  font-weight: 700;
}

.secondary-btn {
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  font-weight: 700;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.list-row {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  background: var(--panel-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.list-row.vertical {
  align-items: flex-start;
}

.list-row strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 6px;
}

.list-row p {
  margin: 0;
  color: var(--muted);
}

.meta-row {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-text {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #c8cddd;
  font-size: 0.9rem;
}

.empty-state {
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: var(--muted);
}

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

.info-grid dt {
  margin-bottom: 8px;
  color: #8b91a4;
  font-size: 0.9rem;
}

.info-grid dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
}

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

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

.field span {
  color: #d5d9e7;
  font-size: 0.95rem;
  font-weight: 700;
}

.field input {
  min-height: 50px;
  width: 100%;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;
}

.field input:focus {
  border-color: rgba(244, 176, 18, 0.55);
  box-shadow: 0 0 0 3px rgba(244, 176, 18, 0.12);
}

.field input[type="file"] {
  padding: 12px 14px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d5d9e7;
}

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

.inline-note {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(244, 176, 18, 0.1);
  border: 1px solid rgba(244, 176, 18, 0.18);
  color: #f7dda0;
}

.admin-grid,
.inline-grid {
  display: grid;
  gap: 18px;
}

.admin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 24px;
}

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

.full-span {
  grid-column: 1 / -1;
}

.field-end {
  align-self: end;
}

.compact-btn {
  width: auto;
  min-width: 180px;
  margin-top: 0;
}

.top-space {
  margin-top: 18px;
}

.divider {
  height: 1px;
  margin: 22px 0;
  background: rgba(255, 255, 255, 0.08);
}

.inline-form {
  display: flex;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.panel-header-lite {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.step-card {
  padding: 20px;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.connected-box,
.callback-box,
.custom-folder-row {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.connected-box strong {
  display: block;
  margin-top: 10px;
  margin-bottom: 4px;
}

.connected-box p {
  margin: 0;
  color: var(--muted);
}

.callback-box code {
  display: block;
  margin-top: 8px;
  white-space: normal;
  word-break: break-all;
  color: #f1bd35;
}

.small-label {
  color: #d5d9e7;
  font-size: 0.92rem;
  font-weight: 700;
}

.muted-inline {
  color: var(--muted);
  font-weight: 400;
}

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

.danger-ghost {
  min-height: 50px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--red-soft);
  border: 1px solid rgba(248, 113, 113, 0.24);
  color: #fda4a4;
  font-weight: 700;
}

.is-success {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.28);
  color: #86efac;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
}

.auth-card {
  width: min(100%, 460px);
  padding: 28px;
  background: rgba(18, 18, 23, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.auth-brand img {
  width: 120px;
  display: block;
}

.auth-copy {
  margin: 22px 0;
}

.auth-copy h1 {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
}

.auth-copy p,
.login-help p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-btn {
  width: 100%;
}

.login-help {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.login-help strong {
  color: #f6d26f;
}

body.menu-open {
  overflow: hidden;
}

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

  .info-grid,
  .admin-grid,
  .inline-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 310px);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 40;
  }

  body.menu-open .sidebar {
    transform: translateX(0);
  }

  .main-panel {
    min-width: 0;
  }

  .menu-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
  }

  .topbar {
    justify-content: space-between;
    gap: 16px;
  }
}

@media (max-width: 640px) {
  .topbar,
  .content {
    padding-left: 18px;
    padding-right: 18px;
  }

  .content {
    padding-top: 28px;
  }

  .account-email {
    max-width: 130px;
  }

  .license-card,
  .devices-card,
  .info-card,
  .stat-card {
    padding: 18px;
  }

  .device-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .list-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .danger-btn {
    width: 100%;
  }

  .secondary-btn,
  .logout-link {
    width: 100%;
  }

  .account-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
}

body.workspace-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(201, 146, 42, 0.16), transparent 28%),
    linear-gradient(180deg, #0f0e0b 0%, #11100d 54%, #0b0a08 100%);
  color: #f7f1e3;
}

.workspace-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.workspace-flash {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  min-width: min(92vw, 420px);
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.35);
  text-align: center;
  font-size: 0.94rem;
  font-weight: 700;
}

.workspace-flash-success {
  background: rgba(16, 185, 129, 0.14);
  color: #b8f3d7;
}

.workspace-flash-error {
  background: rgba(239, 68, 68, 0.15);
  color: #fecaca;
}

.workspace-header,
.workspace-main {
  width: min(1820px, calc(100vw - 48px));
  margin: 0 auto;
}

.workspace-header {
  padding: 26px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.workspace-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.workspace-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(28, 24, 18, 0.95);
  border: 1px solid rgba(201, 146, 42, 0.24);
  box-shadow: 0 0 0 1px rgba(255, 202, 97, 0.06), 0 18px 30px rgba(0, 0, 0, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.workspace-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.workspace-brand-copy {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
}

.workspace-version {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #c9922a;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
}

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

.workspace-icon-btn,
.workspace-settings-btn,
.workspace-logout,
.workspace-mini-btn,
.workspace-console-btn,
.workspace-console-close {
  border: 1px solid rgba(201, 146, 42, 0.14);
  background: rgba(36, 30, 22, 0.95);
  color: #d6b56d;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.workspace-icon-btn:hover,
.workspace-settings-btn:hover,
.workspace-logout:hover,
.workspace-mini-btn:hover,
.workspace-console-btn:hover,
.workspace-console-close:hover {
  transform: translateY(-1px);
  border-color: rgba(201, 146, 42, 0.32);
  background: rgba(49, 40, 28, 0.98);
  color: #f2cb70;
}

.workspace-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.workspace-btn-icon {
  font-size: 1rem;
  line-height: 1;
}

.workspace-settings-btn,
.workspace-logout {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
}

.workspace-account {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-left: 6px;
}

.workspace-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(201, 146, 42, 0.18);
  border: 1px solid rgba(201, 146, 42, 0.34);
  color: #f2cb70;
  font-size: 0.92rem;
  font-weight: 800;
}

.workspace-account-copy {
  display: grid;
  min-width: 0;
}

.workspace-account-copy strong,
.workspace-account-copy span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-account-copy strong {
  color: #fff;
  font-size: 0.9rem;
}

.workspace-account-copy span {
  color: #a89060;
  font-size: 0.78rem;
}

.workspace-main {
  flex: 1;
  padding: 64px 0 150px;
}

.workspace-hero {
  text-align: center;
}

.workspace-hero-copy h1 {
  margin: 0;
  font-size: clamp(2.6rem, 4.8vw, 5rem);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: 0;
  color: #fff;
}

.workspace-hero-copy p {
  margin: 12px 0 0;
  color: #b89d68;
  font-size: 1.1rem;
  font-weight: 500;
}

.workspace-command {
  width: min(100%, 840px);
  margin: 42px auto 0;
  position: relative;
}

.workspace-command-glow {
  position: absolute;
  inset: 12px 32px auto;
  height: 70px;
  border-radius: 999px;
  background: rgba(201, 146, 42, 0.16);
  filter: blur(40px);
  opacity: 0.45;
  pointer-events: none;
}

.workspace-command-row {
  position: relative;
  min-height: 72px;
  padding: 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 32px;
  background: rgba(32, 26, 19, 0.96);
  border: 1px solid rgba(201, 146, 42, 0.12);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.34);
}

.workspace-source-badge {
  margin-left: 10px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(184, 28, 28, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.18);
  color: #f66;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.workspace-source-badge img,
.workspace-source-tab img,
.workspace-submit img {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.workspace-input {
  flex: 1;
  min-width: 0;
  min-height: 54px;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 1.02rem;
}

.workspace-input::placeholder {
  color: #8f7850;
}

.workspace-file-input {
  display: none;
}

.workspace-submit {
  min-width: 200px;
  min-height: 54px;
  padding: 0 20px;
  border-radius: 18px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #c9922a, #e0ab32);
  color: #fff;
  font-size: 0.98rem;
  font-weight: 800;
  box-shadow: 0 16px 30px rgba(201, 146, 42, 0.18);
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.workspace-submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.workspace-source-tabs {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.workspace-source-tab {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(201, 146, 42, 0.12);
  background: rgba(31, 25, 18, 0.84);
  color: #d0b37d;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 700;
}

.workspace-source-tab.active {
  background: rgba(127, 29, 29, 0.22);
  border-color: rgba(239, 68, 68, 0.28);
  color: #ff6b6b;
}

.workspace-source-tab.disabled {
  opacity: 0.42;
}

.workspace-source-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #8f7850;
}

.workspace-grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.workspace-card {
  min-height: 168px;
  padding: 26px 24px 24px;
  border-radius: 28px;
  background: rgba(19, 17, 13, 0.72);
  border: 1px solid rgba(201, 146, 42, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.workspace-card:hover {
  transform: translateY(-3px);
  border-color: rgba(201, 146, 42, 0.26);
  background: rgba(23, 20, 15, 0.92);
}

.workspace-card-icon {
  width: 68px;
  height: 68px;
  border-radius: 24px;
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(201, 146, 42, 0.1);
  border: 1px solid rgba(201, 146, 42, 0.12);
}

.workspace-card-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.workspace-card strong {
  color: #d5b16a;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.workspace-card p {
  margin: 10px 0 0;
  color: #8f7850;
  font-size: 0.92rem;
  line-height: 1.55;
}

.workspace-meta-grid {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.workspace-meta-card {
  min-height: 120px;
  padding: 20px 22px;
  border-radius: 22px;
  background: rgba(18, 16, 12, 0.88);
  border: 1px solid rgba(201, 146, 42, 0.08);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.workspace-meta-card-wide {
  grid-column: span 1;
}

.workspace-meta-label {
  display: block;
  color: #8f7850;
  font-size: 0.86rem;
  font-weight: 700;
}

.workspace-meta-card strong {
  display: block;
  margin-top: 10px;
  color: #fff;
  font-size: 1.48rem;
  line-height: 1.15;
}

.workspace-license-text {
  font-size: 1rem !important;
  color: #f2cb70 !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}

.workspace-mini-btn {
  margin-top: 14px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.workspace-jobs {
  margin-top: 24px;
  padding: 22px;
  border-radius: 24px;
  background: rgba(18, 16, 12, 0.9);
  border: 1px solid rgba(201, 146, 42, 0.08);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

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

.workspace-jobs-head h2 {
  margin: 0;
  font-size: 1.08rem;
  color: #fff;
}

.workspace-jobs-head p {
  margin: 6px 0 0;
  color: #8f7850;
  font-size: 0.9rem;
}

.workspace-jobs-head .workspace-mini-btn {
  margin-top: 0;
}

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

.workspace-job-row {
  padding: 15px 16px;
  border-radius: 16px;
  background: rgba(27, 23, 17, 0.92);
  border: 1px solid rgba(201, 146, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.workspace-job-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.workspace-job-main strong,
.workspace-job-main span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-job-main strong {
  color: #fff;
  font-size: 0.96rem;
}

.workspace-job-main span {
  color: #8f7850;
  font-size: 0.8rem;
}

.workspace-job-side {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workspace-job-status,
.workspace-job-progress {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 800;
}

.workspace-job-progress {
  background: rgba(255, 255, 255, 0.05);
  color: #d5b16a;
}

.workspace-job-status {
  text-transform: uppercase;
}

.workspace-job-status.status-queued,
.workspace-job-status.status-downloading,
.workspace-job-status.status-processing {
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
}

.workspace-job-status.status-done {
  background: rgba(16, 185, 129, 0.14);
  color: #86efac;
}

.workspace-job-status.status-failed {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
}

.workspace-console {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  background: rgba(10, 9, 6, 0.96);
  border-top: 1px solid rgba(201, 146, 42, 0.12);
  box-shadow: 0 -20px 45px rgba(0, 0, 0, 0.35);
}

.workspace-console-head,
.workspace-console-body {
  width: min(1880px, calc(100vw - 32px));
  margin: 0 auto;
}

.workspace-console-head {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(201, 146, 42, 0.08);
}

.workspace-console-title,
.workspace-console-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.workspace-console-title {
  color: #b28a3d;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.workspace-console-mark {
  color: #d5a132;
}

.workspace-console-actions {
  color: #9c7b3a;
  font-size: 0.78rem;
  font-weight: 700;
}

.workspace-console-btn,
.workspace-console-close {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 0.74rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.workspace-console-close {
  width: 30px;
  padding: 0;
}

.workspace-console-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #e0ab32;
}

.workspace-console-status i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #e0ab32;
  display: inline-block;
}

.workspace-console-body {
  padding: 14px 0 18px;
  display: grid;
  gap: 8px;
}

.workspace-log-line {
  color: #e2d8c3;
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  display: flex;
  align-items: center;
  gap: 18px;
}

.workspace-log-line span:first-child {
  color: #af8a47;
  width: 72px;
  flex: none;
}

body.workspace-light {
  background:
    radial-gradient(circle at top, rgba(201, 146, 42, 0.14), transparent 32%),
    linear-gradient(180deg, #f5f0e6 0%, #efe7d5 100%);
  color: #1d1812;
}

body.workspace-light .workspace-brand-copy strong,
body.workspace-light .workspace-hero-copy h1,
body.workspace-light .workspace-meta-card strong {
  color: #1d1812;
}

body.workspace-light .workspace-hero-copy p,
body.workspace-light .workspace-card p,
body.workspace-light .workspace-meta-label,
body.workspace-light .workspace-account-copy span {
  color: #6b5632;
}

body.workspace-light .workspace-command-row,
body.workspace-light .workspace-card,
body.workspace-light .workspace-meta-card,
body.workspace-light .workspace-icon-btn,
body.workspace-light .workspace-settings-btn,
body.workspace-light .workspace-logout,
body.workspace-light .workspace-console-btn,
body.workspace-light .workspace-console-close {
  background: rgba(255, 249, 240, 0.95);
  color: #946a22;
  border-color: rgba(148, 106, 34, 0.14);
}

body.workspace-light .workspace-source-tab {
  background: rgba(255, 249, 240, 0.92);
  color: #946a22;
}

body.workspace-light .workspace-input {
  color: #1d1812;
}

body.workspace-light .workspace-console {
  background: rgba(246, 239, 226, 0.96);
}

body.workspace-light .workspace-log-line {
  color: #4a3a21;
}

@media (max-width: 1280px) {
  .workspace-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 980px) {
  .workspace-header,
  .workspace-main,
  .workspace-console-head,
  .workspace-console-body {
    width: min(100vw - 24px, 100%);
  }

  .workspace-header {
    padding-top: 18px;
  }

  .workspace-actions {
    gap: 8px;
  }

  .workspace-account {
    width: 100%;
    justify-content: flex-end;
    margin-left: 0;
  }

  .workspace-command-row {
    flex-wrap: wrap;
    border-radius: 26px;
  }

  .workspace-source-badge {
    margin-left: 0;
  }

  .workspace-submit {
    width: 100%;
    min-width: 0;
  }

  .workspace-grid,
  .workspace-meta-grid {
    grid-template-columns: 1fr;
  }

  .workspace-console-head {
    padding: 8px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace-console-actions {
    flex-wrap: wrap;
  }

  .workspace-main {
    padding-bottom: 220px;
  }
}

@media (max-width: 720px) {
  .workspace-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .workspace-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .workspace-account {
    justify-content: flex-start;
  }

  .workspace-hero-copy h1 {
    font-size: 2.35rem;
  }
}
