:root {
  --bg: #080a0e;
  --panel: #0f1218;
  --panel-2: #151922;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #f4f5f7;
  --muted: #8d94a3;
  --muted-2: #606778;
  --accent: #7c5cff;
  --accent-2: #a46eff;
  --cyan: #45d6cf;
  --danger: #ff6b7a;
  --success: #4bd69a;
  --radius: 18px;
  color-scheme: dark;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

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

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

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

button {
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-size: 18px;
  font-weight: 760;
  gap: 12px;
  letter-spacing: -0.02em;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(145deg, var(--accent), #af78ff);
  border-radius: 10px;
  box-shadow: 0 0 32px rgba(124, 92, 255, 0.28);
  display: inline-flex;
  gap: 3px;
  height: 34px;
  justify-content: center;
  transform: rotate(-7deg);
  width: 34px;
}

.brand-mark i {
  background: white;
  border-radius: 3px;
  display: block;
  height: 13px;
  opacity: 0.96;
  width: 3px;
}

.brand-mark i:nth-child(1) {
  height: 8px;
}

.brand-mark i:nth-child(3) {
  height: 18px;
}

.brand-mark--image {
  background: none;
  border-radius: 0;
  box-shadow: none;
  display: block;
  flex: none;
  height: 34px;
  transform: none;
  width: 34px;
}

.brand-wordmark {
  align-items: baseline;
  display: inline-flex;
  gap: 6px;
}

.brand-wordmark small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0;
}

.welcome-icon {
  align-items: center;
  background: linear-gradient(145deg, var(--accent), #af78ff);
  border-radius: 11px;
  box-shadow: 0 0 32px rgba(124, 92, 255, 0.28);
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  height: 46px;
  justify-content: center;
  transform: rotate(-7deg);
  width: 46px;
}

.welcome-icon i {
  background: white;
  border-radius: 3px;
  display: block;
  height: 16px;
  opacity: 0.96;
  width: 3px;
}

.welcome-icon i:first-child {
  height: 9px;
}

.welcome-icon i:last-child {
  height: 21px;
}

.eyebrow {
  align-items: center;
  color: #9ea4b2;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  gap: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow b {
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(124, 92, 255, 0.85);
  display: inline-block;
  height: 6px;
  width: 6px;
}

.status-dot {
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(75, 214, 154, 0.1);
  display: inline-block;
  height: 7px;
  width: 7px;
}

.toast {
  background: #f5f6f8;
  border-radius: 10px;
  bottom: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  color: #11141b;
  font-size: 14px;
  left: 50%;
  max-width: min(90vw, 460px);
  opacity: 0;
  padding: 12px 18px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 14px);
  transition: 180ms ease;
  z-index: 100;
}

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

.toast.error {
  background: #ffedf0;
  color: #8e2431;
}

/* Authentication */

.auth-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(420px, 1.15fr) minmax(400px, 0.85fr);
}

.auth-hero {
  background:
    radial-gradient(circle at 78% 24%, rgba(113, 76, 255, 0.23), transparent 25%),
    radial-gradient(circle at 20% 82%, rgba(61, 213, 203, 0.1), transparent 30%),
    #080a0e;
  border-right: 1px solid var(--line);
  overflow: hidden;
  padding: 46px 6vw;
  position: relative;
}

.hero-copy {
  max-width: 660px;
  position: relative;
  top: 45%;
  transform: translateY(-50%);
  z-index: 2;
}

.hero-copy h1 {
  font-size: clamp(48px, 5.1vw, 82px);
  font-weight: 660;
  letter-spacing: -0.065em;
  line-height: 0.98;
  margin: 24px 0 28px;
}

.hero-copy > p {
  color: #9da3b0;
  font-size: 17px;
  line-height: 1.8;
  max-width: 560px;
}

.hero-proof {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 56px;
  padding-top: 28px;
}

.hero-proof div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-proof strong {
  font-size: 14px;
}

.hero-proof span {
  color: var(--muted-2);
  font-size: 12px;
}

.hero-orb {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  position: absolute;
}

.orb-one {
  height: 440px;
  right: -180px;
  top: 10%;
  width: 440px;
}

.orb-two {
  bottom: -280px;
  height: 600px;
  left: -160px;
  width: 600px;
}

.auth-panel {
  align-items: center;
  background: #0b0d12;
  display: flex;
  justify-content: center;
  padding: 40px;
}

.auth-card {
  max-width: 420px;
  width: 100%;
}

.mobile-brand {
  align-items: center;
  display: none;
  font-size: 18px;
  font-weight: 760;
  gap: 12px;
  margin-bottom: 64px;
}

.auth-heading {
  margin-bottom: 32px;
  position: relative;
}

.auth-heading .status-dot {
  left: -18px;
  position: absolute;
  top: 11px;
}

.auth-heading h2 {
  font-size: 34px;
  letter-spacing: -0.045em;
  margin: 0 0 10px;
}

.auth-heading p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.auth-tabs {
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 28px;
}

.auth-tabs button {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 13px 4px;
  position: relative;
}

.auth-tabs button.active {
  color: white;
}

.auth-tabs button.active::after {
  background: var(--accent);
  bottom: -1px;
  content: "";
  height: 2px;
  left: 20%;
  position: absolute;
  right: 20%;
}

.auth-form {
  display: none;
  gap: 18px;
}

.auth-form.active {
  display: grid;
}

.auth-form label {
  color: #d4d7df;
  display: grid;
  font-size: 13px;
  font-weight: 650;
  gap: 9px;
}

.auth-form input,
.code-generator input {
  background: #11141b;
  border: 1px solid var(--line);
  border-radius: 11px;
  min-height: 48px;
  outline: none;
  padding: 0 15px;
  transition: border 160ms ease, box-shadow 160ms ease;
}

.auth-form input:focus,
.code-generator input:focus {
  border-color: rgba(124, 92, 255, 0.75);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.11);
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), #9568ff);
  border: 0;
  border-radius: 11px;
  box-shadow: 0 12px 30px rgba(124, 92, 255, 0.22);
  font-size: 14px;
  font-weight: 700;
  margin-top: 5px;
  min-height: 50px;
}

.primary-button span {
  font-size: 18px;
  margin-left: 7px;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.redeem-intro {
  align-items: flex-start;
  background: rgba(124, 92, 255, 0.08);
  border: 1px solid rgba(124, 92, 255, 0.19);
  border-radius: 12px;
  display: flex;
  gap: 10px;
  padding: 13px;
}

.redeem-intro span {
  color: #b697ff;
}

.redeem-intro p {
  color: #aaa3c5;
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
}

.auth-note {
  color: #555c6b;
  font-size: 11px;
  margin: 28px 0 0;
  text-align: center;
}

.email-code-row {
  display: flex;
  gap: 10px;
  min-width: 0;
}

.email-code-row input {
  flex: 1;
  min-width: 0;
  width: 0;
}

.email-code-button {
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: #c6b5ff;
  padding: 0 12px;
  white-space: nowrap;
}

.email-code-button:disabled { opacity: 0.55; cursor: default; }
.email-code-note { color: #969eae; font-size: 12px; line-height: 1.6; margin: -8px 0 0; }

/* Workspace */

.workspace-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
}

.network-banner {
  background: #3a2410;
  border-bottom: 1px solid rgba(245, 185, 72, 0.35);
  color: #f5c266;
  font-size: 12px;
  left: 0;
  padding: 9px 16px;
  position: fixed;
  right: 0;
  text-align: center;
  top: 0;
  z-index: 80;
}

.network-banner[hidden] {
  display: none;
}

body.network-offline {
  padding-top: 34px;
}

.sidebar {
  background: #0b0e13;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 27px 18px 18px;
  position: sticky;
  top: 0;
}

.sidebar-brand {
  margin: 0 10px 33px;
}

.new-project {
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid rgba(124, 92, 255, 0.24);
  border-radius: 11px;
  color: #dcd5ff;
  display: block;
  font-size: 13px;
  font-weight: 680;
  padding: 12px 14px;
  text-align: left;
}

.new-project span {
  color: #9a7dff;
  font-size: 18px;
  margin-right: 7px;
}

.sidebar-link {
  align-items: center;
  border-radius: 10px;
  color: #c5cbd4;
  display: flex;
  font-size: 13px;
  gap: 10px;
  margin-top: 8px;
  padding: 10px 14px;
}

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

.sidebar-link.active,
.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.sidebar-label {
  color: #545c6b;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.12em;
  margin: 27px 11px 11px;
  text-transform: uppercase;
}

.job-list {
  display: grid;
  gap: 4px;
  overflow-y: auto;
}

.job-nav-item {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 7px;
  padding: 9px;
  text-align: left;
}

.job-nav-item:hover,
.job-nav-item.active {
  background: #141820;
  border-color: var(--line);
}

.job-icon {
  align-items: center;
  background: linear-gradient(145deg, #302858, #4a397c);
  border-radius: 7px;
  color: #c8baff;
  display: flex;
  font-size: 11px;
  font-weight: 800;
  height: 30px;
  justify-content: center;
  position: relative;
}

.job-icon-spinner {
  animation: activity-spin 1s linear infinite;
  border: 2px solid rgba(169, 148, 255, 0.18);
  border-radius: 50%;
  border-top-color: #c4b4ff;
  height: 30px;
  left: 0;
  position: absolute;
  top: 0;
  width: 30px;
}

.job-nav-item.is-running .job-nav-copy small {
  color: #a997f0;
}

.job-nav-copy {
  min-width: 0;
}

.job-nav-copy strong,
.job-nav-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-nav-copy strong {
  color: #b9bfca;
  font-size: 11px;
  font-weight: 450;
  transition: color 160ms ease;
}

.job-nav-item:hover .job-nav-copy strong {
  color: #e4e7ec;
}

.job-nav-item.active .job-nav-copy strong {
  color: #fff;
}

.job-nav-copy small {
  color: var(--muted-2);
  font-size: 10px;
  margin-top: 4px;
}

.status-pin {
  background: #555d6b;
  border-radius: 50%;
  height: 6px;
  width: 6px;
}

.status-pin.status-processing,
.status-pin.status-queued {
  background: #8e73ff;
  box-shadow: 0 0 8px rgba(142, 115, 255, 0.8);
}

.status-pin.status-paused {
  background: #f5c266;
  box-shadow: 0 0 8px rgba(245, 185, 72, 0.55);
}

.status-pin.status-completed {
  background: var(--success);
}

.status-pin.status-failed,
.status-pin.status-cancelled {
  background: var(--danger);
}

.empty-list {
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.6;
  padding: 6px 11px;
}

.sidebar-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding: 17px 8px 2px;
}

.profile-avatar {
  align-items: center;
  background: #252c3a;
  border-radius: 9px;
  display: flex;
  font-size: 13px;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.sidebar-footer strong,
.sidebar-footer small {
  display: block;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer strong {
  font-size: 12px;
}

.sidebar-footer small {
  color: var(--muted-2);
  font-size: 10px;
  margin-top: 3px;
}

.studio {
  min-height: 100vh;
  padding-bottom: 42px;
  position: relative;
}

.workspace-shell.has-active-job .studio {
  padding-bottom: 184px;
}

.studio-header {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(8, 10, 14, 0.82);
  border-bottom: 1px solid var(--line);
  display: flex;
  height: 70px;
  justify-content: space-between;
  padding: 0 34px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-title,
.header-actions {
  align-items: center;
  display: flex;
  gap: 12px;
}

.header-title {
  font-size: 13px;
  font-weight: 650;
}

.credit-pill {
  align-items: center;
  background: rgba(124, 92, 255, 0.1);
  border: 1px solid rgba(124, 92, 255, 0.2);
  border-radius: 99px;
  color: #b5a4ff;
  display: inline-flex;
  font-size: 11px;
  gap: 4px;
  padding: 6px 6px 6px 12px;
  transition: 160ms ease;
}

.credit-pill a,
.credit-pill button {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  display: inline-flex;
  font-size: inherit;
  gap: 4px;
  padding: 0;
}

.credit-pill b {
  color: white;
}

.credit-pill button {
  border-left: 1px solid rgba(181, 164, 255, 0.26);
  border-radius: 99px;
  font-size: 10px;
  margin-left: 4px;
  padding: 4px 8px 4px 10px;
}

.credit-pill a.active b,
.credit-pill a:hover b {
  color: white;
}

.credit-pill:hover,
.credit-pill:focus-visible {
  background: rgba(124, 92, 255, 0.18);
  border-color: rgba(148, 120, 255, 0.48);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.ghost-link,
.ghost-button {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 11px;
  padding: 8px;
}

.ghost-link:hover,
.ghost-button:hover {
  color: white;
}

.mobile-menu {
  background: transparent;
  border: 0;
  display: none;
  font-size: 20px;
}

.conversation {
  margin: 0 auto;
  max-width: 920px;
  padding: 62px 40px 70px;
}

.workspace-shell.has-active-job.is-read-only .studio {
  padding-bottom: 0;
}

.admin-view-banner {
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
}

.admin-view-banner a {
  color: #b5a4ff;
}

.quota-banner {
  align-items: center;
  background:
    radial-gradient(circle at 0 0, rgba(255, 107, 122, 0.18), transparent 42%),
    #1a1218;
  border: 1px solid rgba(255, 107, 122, 0.45);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 0 22px;
  padding: 16px 16px 16px 18px;
  position: sticky;
  top: 76px;
  z-index: 6;
}

.quota-banner strong {
  display: block;
  font-size: 16px;
  letter-spacing: -0.03em;
}

.quota-banner p {
  color: #f0c6cc;
  font-size: 13px;
  line-height: 1.6;
  margin: 4px 0 0;
}

.quota-banner button {
  background: white;
  border: 0;
  border-radius: 999px;
  color: #11141b;
  flex: 0 0 auto;
  font-weight: 700;
  min-height: 40px;
  padding: 0 16px;
}

@media (max-width: 720px) {
  .quota-banner {
    align-items: stretch;
    flex-direction: column;
  }
}

.skills-page {
  margin: 0 auto;
  max-width: 980px;
  padding: 28px 40px 80px;
}

.library-tabs {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 28px;
  margin: 0 0 28px;
}

.library-tabs a {
  color: #8d95a3;
  font-size: 16px;
  padding-bottom: 12px;
  position: relative;
}

.library-tabs a.active {
  color: white;
}

.library-tabs a.active::after {
  background: white;
  bottom: -1px;
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  right: 0;
}

.skills-page-head {
  align-items: flex-start;
  display: flex;
  gap: 24px;
  justify-content: space-between;
}

.skills-page h1 {
  font-size: 22px;
  font-weight: 650;
  margin: 0;
}

.skills-page-head p {
  color: #8d95a3;
  font-size: 13px;
  margin: 8px 0 0;
}

.skills-search {
  align-items: center;
  background: #161922;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: #8d95a3;
  display: flex;
  gap: 8px;
  min-width: 220px;
  padding: 8px 14px;
}

.skills-search svg {
  flex: 0 0 16px;
  height: 16px;
  width: 16px;
}

.skills-search input {
  background: transparent;
  border: 0;
  color: #f2f4f8;
  font-size: 13px;
  outline: none;
  width: 100%;
}

.skills-tabs {
  display: flex;
  gap: 8px;
  margin: 22px 0 18px;
}

.skills-tabs button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: #c5cbd4;
  font-size: 13px;
  padding: 7px 14px;
}

.skills-tabs button.active {
  background: #2a2e36;
  color: white;
}

.skills-page h2 {
  font-size: 14px;
  font-weight: 620;
  margin: 0 0 14px;
}

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

.skill-card {
  background: #191c22;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 16px;
}

.skill-card-top {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.skill-card-mark {
  align-items: center;
  background: #1f8a4c;
  border-radius: 12px;
  color: white;
  display: flex;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.plugin-mark {
  background: #6d4dff;
}

.skill-card-mark svg {
  height: 22px;
  width: 22px;
}

.skill-card-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.skill-card-copy strong {
  font-size: 15px;
  font-weight: 620;
}

.skill-card-copy small,
.skill-card-copy a {
  color: #8d95a3;
  font-size: 12px;
}

.skill-card-copy a:hover {
  color: #d7dbe3;
}

.skill-card-add {
  background: #2a2e36;
  border: 0;
  border-radius: 999px;
  color: #f4f6f8;
  font-size: 13px;
  padding: 6px 14px;
}

.skill-card-add:hover {
  background: #353a44;
}

.skill-card-add.is-added,
.skill-card-add.is-installed {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f4f6f8;
}

.skill-card > p {
  color: #c5cbd4;
  font-size: 13px;
  line-height: 1.6;
  margin: 12px 0 0;
}

.skills-empty {
  color: #8d95a3;
  font-size: 13px;
  margin: 8px 0 0;
}

.usage-balance {
  background: rgba(124, 92, 255, 0.1);
  border: 1px solid rgba(124, 92, 255, 0.22);
  border-radius: 14px;
  min-width: 140px;
  padding: 12px 16px;
}

.usage-balance small {
  color: #b5a4ff;
  display: block;
  font-size: 11px;
}

.usage-balance strong {
  color: white;
  display: block;
  font-size: 28px;
  font-weight: 650;
  margin-top: 2px;
}

.usage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.usage-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 14px 16px;
}

.usage-row strong {
  display: block;
  font-size: 14px;
}

.usage-row small {
  color: #8d95a3;
  display: block;
  font-size: 12px;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-row small a:hover {
  color: white;
}

.usage-row time {
  color: #8d95a3;
  font-size: 12px;
}

.usage-row b {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  min-width: 72px;
  text-align: right;
}

.usage-row b.is-debit {
  color: #f0f2f6;
}

.usage-row b.is-credit {
  color: #8d7dff;
}

.usage-note {
  color: #8d95a3;
  font-size: 12px;
  margin: 14px 0 0;
}

@media (max-width: 860px) {
  .skills-page-head {
    flex-direction: column;
  }

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

/* Credit redemption */

body.redeem-modal-open {
  overflow: hidden;
}

.redeem-modal {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 80;
}

.redeem-backdrop {
  backdrop-filter: blur(12px);
  background: rgba(2, 4, 8, 0.76);
  border: 0;
  inset: 0;
  position: absolute;
}

.redeem-dialog {
  background:
    radial-gradient(circle at 92% 5%, rgba(124, 92, 255, 0.16), transparent 36%),
    #11141b;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  box-shadow: 0 32px 110px rgba(0, 0, 0, 0.62);
  max-width: 520px;
  padding: 30px;
  position: relative;
  width: 100%;
}

.redeem-close {
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  display: flex;
  font-size: 20px;
  height: 34px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: 20px;
  top: 20px;
  width: 34px;
}

.redeem-close:hover {
  color: white;
}

.redeem-heading {
  align-items: center;
  display: flex;
  gap: 15px;
  padding-right: 40px;
}

.redeem-heading h2 {
  font-size: 25px;
  letter-spacing: -0.035em;
  margin: 6px 0 0;
}

.redeem-gem {
  align-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(124, 92, 255, 0.3);
  display: flex;
  font-size: 20px;
  height: 52px;
  justify-content: center;
  width: 52px;
}

.redeem-description {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin: 22px 0 16px;
}

.redeem-balance {
  align-items: center;
  background: rgba(124, 92, 255, 0.08);
  border: 1px solid rgba(124, 92, 255, 0.18);
  border-radius: 13px;
  display: flex;
  justify-content: space-between;
  padding: 13px 15px;
}

.redeem-balance span {
  color: var(--muted);
  font-size: 11px;
}

.redeem-balance strong {
  color: #c0b2ff;
  font-size: 14px;
}

.redeem-balance strong b {
  color: white;
  font-size: 18px;
}

.redeem-form {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.redeem-form label {
  color: #d4d7df;
  font-size: 12px;
  font-weight: 650;
}

.redeem-form input {
  background: #0a0d12;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  letter-spacing: 0.08em;
  min-height: 52px;
  outline: none;
  padding: 0 15px;
  text-transform: uppercase;
  transition: border 160ms ease, box-shadow 160ms ease;
}

.redeem-form input:focus {
  border-color: rgba(124, 92, 255, 0.75);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.11);
}

.redeem-form .primary-button {
  margin-top: 3px;
}

.redeem-message {
  border-radius: 9px;
  font-size: 11px;
  line-height: 1.5;
  margin: 0;
  padding: 9px 11px;
}

.redeem-message.error {
  background: rgba(255, 107, 122, 0.09);
  color: #ff98a3;
}

.redeem-message.success {
  background: rgba(75, 214, 154, 0.09);
  color: #78e7b6;
}

.redeem-footnote {
  color: var(--muted-2);
  font-size: 10px;
  margin: 17px 0 0;
  text-align: center;
}

.redeem-footnote span {
  color: var(--success);
  margin-right: 4px;
}

.redeem-tabs {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
  margin: 18px 0 14px;
}

.redeem-tabs button {
  background: #0a0d12;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  min-height: 38px;
}

.redeem-tabs button.active {
  background: rgba(124, 92, 255, 0.16);
  border-color: rgba(124, 92, 255, 0.42);
  color: white;
}

.pay-packages {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pay-package {
  background: #0a0d12;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: #d5d8e0;
  padding: 14px 10px;
  text-align: left;
}

.pay-package strong,
.pay-package small {
  display: block;
}

.pay-package small {
  color: var(--muted);
  margin-top: 6px;
}

.pay-package.selected {
  border-color: rgba(124, 92, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.12);
}

.pay-empty {
  color: var(--muted);
  font-size: 12px;
  grid-column: 1 / -1;
}

.pay-methods {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
}

.welcome-modal {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 90;
}

.welcome-dialog {
  background:
    radial-gradient(circle at 80% 0%, rgba(124, 92, 255, 0.22), transparent 42%),
    #11141b;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  box-shadow: 0 32px 110px rgba(0, 0, 0, 0.62);
  max-width: 440px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 14px 14px 18px;
  position: relative;
  width: 100%;
}

.welcome-art {
  aspect-ratio: 1024 / 985;
  background: #080a0e;
  border-radius: 14px;
  overflow: hidden;
}

.welcome-art img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.welcome-kicker {
  color: #c0b2ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin: 16px 8px 0;
}

.welcome-dialog h2 {
  font-size: 24px;
  letter-spacing: -0.04em;
  line-height: 1.25;
  margin: 8px 8px 0;
  padding-right: 28px;
}

.welcome-price {
  align-items: baseline;
  display: flex;
  gap: 10px;
  margin: 14px 8px 0;
}

.welcome-price strong {
  font-size: 36px;
  letter-spacing: -0.05em;
}

.welcome-price span {
  color: #c0b2ff;
  font-size: 14px;
}

.welcome-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin: 10px 8px 0;
}

.welcome-dialog .pay-methods {
  margin: 16px 8px 0;
}

.welcome-dialog .redeem-message,
.welcome-dialog .pay-result {
  margin: 12px 8px 0;
}

.welcome-later {
  background: transparent;
  border: 0;
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin: 12px auto 0;
  padding: 6px 10px;
}

.welcome-later:hover {
  color: white;
}

.ghost-pay {
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: #d5d8e0;
  min-height: 46px;
}

.pay-result {
  margin-top: 16px;
  text-align: center;
}

.pay-qr {
  background: white;
  border-radius: 12px;
  height: 180px;
  margin: 0 auto 12px;
  padding: 10px;
  width: 180px;
}

.pay-result p {
  color: var(--muted);
  font-size: 12px;
}

.admin-form {
  display: grid;
  gap: 14px;
  padding: 18px 19px 20px;
}

.admin-form button {
  background: var(--accent);
  border: 0;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  height: 39px;
  justify-self: start;
  padding: 0 18px;
}

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

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

.admin-form label,
.billing-card label {
  color: var(--muted);
  display: grid;
  font-size: 10px;
  gap: 6px;
}

.admin-form input:not([type="checkbox"]),
.admin-form select {
  background: #0a0d12;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #e9ebef;
  min-height: 40px;
  padding: 0 12px;
}

.billing-panel {
  display: grid;
  gap: 14px;
}

.billing-panel[hidden] {
  display: none;
}

.admin-check {
  align-items: center;
  color: #d5d8e0 !important;
  display: flex !important;
  font-size: 12px !important;
  gap: 8px;
  grid-template-columns: none;
}

.admin-methods {
  display: flex;
  gap: 18px;
}

.admin-methods label {
  align-items: center;
  color: #d5d8e0;
  display: flex;
  font-size: 12px;
  gap: 8px;
}

.admin-hint {
  color: var(--muted-2);
  font-size: 11px;
  margin: -6px 0 0;
}

.admin-skill-list {
  display: grid;
}

.admin-skill-row {
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 18px 19px;
}

.admin-skill-row:last-child {
  border-bottom: 0;
}

.admin-skill-copy {
  min-width: 0;
}

.admin-skill-title {
  align-items: center;
  display: flex;
  gap: 10px;
}

.admin-skill-title strong {
  color: #f2f4f8;
  font-size: 14px;
}

.admin-skill-title code {
  color: var(--muted-2);
  font-size: 10px;
}

.admin-skill-copy small {
  color: var(--muted-2);
  display: block;
  font-size: 11px;
  margin-top: 7px;
  max-width: 720px;
}

.admin-skill-switches {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 16px;
}

.admin-skill-switches .admin-check {
  white-space: nowrap;
}

.admin-skill-status {
  color: #79dfad;
  font-size: 10px;
  min-width: 45px;
  text-align: right;
}

.admin-skill-note {
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  margin: 0;
  padding: 14px 19px 17px;
}

.skill-card.is-disabled {
  opacity: 0.68;
}

.skill-card-add.is-disabled {
  cursor: not-allowed;
}

.price-legend {
  color: var(--muted);
  font-size: 11px;
}

.price-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.billing-card {
  background: transparent;
}

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

.new-presentation-mark {
  align-items: center;
  display: flex;
  gap: 15px;
  justify-content: center;
  margin: 5px auto 18px;
}

.workspace-shell.has-active-job .new-presentation-mark {
  display: none;
}

.new-presentation-mark .eyebrow {
  font-size: 12px;
}

.template-picker {
  margin: 26px auto 0;
  max-width: 900px;
  width: 100%;
}

.workspace-shell.has-active-job .template-picker {
  display: none;
}

.template-filters {
  display: flex;
  gap: 7px;
  margin-bottom: 17px;
  overflow-x: auto;
  padding: 2px 1px;
  scrollbar-width: none;
}

.template-filters::-webkit-scrollbar {
  display: none;
}

.template-filters button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 11px;
  padding: 8px 13px;
  transition: 160ms ease;
}

.template-filters button:hover {
  color: #d9dce4;
}

.template-filters button.active {
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.07);
  color: white;
}

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

.template-card {
  min-width: 0;
  position: relative;
}

.template-card-select {
  background: transparent;
  border: 0;
  display: block;
  min-width: 0;
  padding: 0;
  text-align: left;
  width: 100%;
}

.template-preview {
  aspect-ratio: 16 / 9;
  background: var(--template-surface);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 13px;
  box-shadow: 0 11px 24px rgba(0, 0, 0, 0.2);
  color: var(--template-ink);
  display: block;
  overflow: hidden;
  position: relative;
  transform: translateZ(0);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.template-card:hover .template-preview,
.template-card:hover .template-preview-button,
.template-card:focus-within .template-preview-button {
  transform: translateY(-3px);
}

.template-card:hover .template-preview-button,
.template-card:focus-within .template-preview-button {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: none) {
  .template-preview-button {
    opacity: 1;
    pointer-events: auto;
  }
}

.template-card:hover .template-preview {
  border-color: rgba(171, 147, 255, 0.5);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
}

.template-card-select:focus-visible {
  outline: none;
}

.template-card-select:focus-visible .template-preview {
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.23), 0 16px 34px rgba(0, 0, 0, 0.32);
}

.template-preview-button {
  align-items: center;
  backdrop-filter: blur(10px);
  background: rgba(10, 12, 16, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
  color: white;
  display: inline-flex;
  font-size: 10px;
  font-weight: 650;
  gap: 3px;
  height: 22px;
  letter-spacing: 0.02em;
  padding: 0 7px 0 6px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  right: 8px;
  top: 8px;
  transition: background 160ms ease, border-color 160ms ease, opacity 160ms ease, transform 160ms ease;
  z-index: 6;
}

.template-preview-button svg {
  display: block;
  height: 12px;
  width: 12px;
}

.template-preview-button:hover {
  background: rgba(18, 14, 28, 0.82);
  border-color: rgba(196, 182, 255, 0.85);
  transform: translateY(-3px);
}

.template-preview-button:focus-visible {
  outline: 2px solid #c4b6ff;
  outline-offset: 2px;
}

.template-card.selected .template-preview {
  border-color: #8d70ff;
  box-shadow: 0 0 0 2px #6e8fff, 0 16px 36px rgba(72, 52, 155, 0.28);
}

.template-preview-image {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.template-card.selected .template-preview-image {
  filter: brightness(0.52) blur(1px);
  opacity: 0.76;
}

.template-preview-copy {
  display: block;
  left: 8%;
  position: absolute;
  top: 18%;
  width: 61%;
  z-index: 2;
}

.template-preview-copy small,
.template-preview-copy strong,
.template-preview-copy i {
  display: block;
}

.template-preview-copy small {
  color: var(--template-accent);
  font-size: clamp(5px, 0.45vw, 7px);
  font-weight: 800;
  letter-spacing: 0.16em;
  margin-bottom: 8px;
}

.template-preview-copy strong {
  font-size: clamp(12px, 1.15vw, 18px);
  letter-spacing: -0.045em;
  line-height: 1.16;
  max-width: 190px;
}

.template-preview-copy i {
  background: currentColor;
  height: 2px;
  margin-top: 13px;
  opacity: 0.2;
  width: 56%;
}

.template-preview-copy i + i {
  margin-top: 5px;
  width: 38%;
}

.template-preview-visual {
  border: 1px solid color-mix(in srgb, var(--template-accent) 42%, transparent);
  border-radius: 50%;
  bottom: -21%;
  display: block;
  height: 92%;
  position: absolute;
  right: -10%;
  width: 54%;
}

.template-preview-visual i {
  border: 1px solid color-mix(in srgb, var(--template-accent) 38%, transparent);
  border-radius: 50%;
  display: block;
  inset: 15%;
  position: absolute;
}

.template-preview-visual i:nth-child(2) {
  inset: 30%;
}

.template-preview-visual i:nth-child(3) {
  background: var(--template-accent);
  border: 0;
  inset: 43%;
  opacity: 0.78;
}

.template-card-copy {
  align-items: baseline;
  display: flex;
  gap: 7px;
  justify-content: space-between;
  padding: 10px 3px 0;
}

.template-card-copy strong {
  color: #e4e7ed;
  font-size: 12px;
  line-height: 1.35;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-card-copy small {
  color: var(--muted-2);
  flex: 0 0 auto;
  font-size: 9px;
}

.template-selected-badge {
  align-items: center;
  backdrop-filter: blur(8px);
  background: rgba(8, 10, 14, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: white;
  display: none;
  font-size: 10px;
  font-weight: 700;
  gap: 5px;
  left: 50%;
  padding: 7px 10px;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  z-index: 5;
}

.template-selected-badge i {
  align-items: center;
  background: white;
  border-radius: 50%;
  color: #1a1d24;
  display: inline-flex;
  font-size: 7px;
  font-style: normal;
  height: 14px;
  justify-content: center;
  width: 14px;
}

.template-card.selected .template-selected-badge {
  display: inline-flex;
}

.template-card.selected .template-preview-copy,
.template-card.selected .template-preview-visual,
.template-card.selected .template-preview-mark {
  filter: blur(1px);
  opacity: 0.52;
}

.template-motif-free {
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 208, 177, 0.95), transparent 31%),
    radial-gradient(circle at 78% 74%, rgba(151, 194, 255, 0.9), transparent 42%),
    linear-gradient(135deg, #f1ebdf, #d8dbe8 54%, #9aa4b6);
}

.template-motif-free .template-preview-copy {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  text-align: center;
  width: auto;
}

.template-motif-free .template-preview-copy small,
.template-motif-free .template-preview-copy i,
.template-motif-free .template-preview-visual {
  display: none;
}

.template-motif-free .template-preview-copy strong {
  color: #343842;
  font-size: clamp(13px, 1.2vw, 19px);
  font-weight: 600;
}

.template-motif-editorial::before {
  background: var(--template-accent);
  content: "";
  height: 3px;
  left: 8%;
  position: absolute;
  top: 13%;
  width: 21%;
}

.template-motif-editorial .template-preview-visual {
  border-radius: 3px;
  bottom: 16%;
  height: 39%;
  right: 8%;
  transform: rotate(-7deg);
  width: 29%;
}

.template-motif-editorial .template-preview-visual i {
  border-radius: 2px;
}

.template-motif-corporate::before {
  background: var(--template-accent);
  content: "";
  inset: 0 auto 0 0;
  position: absolute;
  width: 23%;
}

.template-motif-corporate::after {
  border: 1px solid color-mix(in srgb, var(--template-accent) 38%, transparent);
  border-radius: 50%;
  content: "";
  height: 42%;
  position: absolute;
  right: 5%;
  top: 8%;
  width: 24%;
}

.template-motif-corporate .template-preview-copy {
  left: 31%;
  top: 24%;
  width: 55%;
}

.template-motif-corporate .template-preview-visual {
  border: 0;
  border-radius: 0;
  bottom: 9%;
  height: 9%;
  right: 8%;
  width: 61%;
}

.template-motif-corporate .template-preview-visual i {
  background: var(--template-accent);
  border: 0;
  border-radius: 0;
  bottom: 0;
  inset: auto auto 0 0;
  opacity: 0.16;
  position: absolute;
  width: 25%;
}

.template-motif-corporate .template-preview-visual i:nth-child(2) {
  height: 160%;
  left: 31%;
}

.template-motif-corporate .template-preview-visual i:nth-child(3) {
  height: 230%;
  left: 62%;
}

.template-motif-centered .template-preview-copy {
  left: 15%;
  text-align: center;
  top: 28%;
  width: 70%;
}

.template-motif-centered .template-preview-copy small {
  color: var(--template-accent-secondary);
}

.template-motif-centered .template-preview-copy strong {
  margin: 0 auto;
}

.template-motif-centered .template-preview-copy i {
  margin-inline: auto;
}

.template-motif-centered .template-preview-visual {
  border-color: rgba(255, 255, 255, 0.14);
  bottom: -78%;
  height: 126%;
  right: -4%;
  width: 108%;
}

.template-motif-brand::after,
.template-motif-engineering::after {
  background: linear-gradient(145deg, transparent 48%, var(--template-accent) 49%);
  bottom: 0;
  content: "";
  opacity: 0.13;
  position: absolute;
  right: 0;
  top: 0;
  width: 49%;
}

.template-motif-google .template-preview-visual {
  border: 0;
  border-radius: 0;
  display: grid;
  gap: 7%;
  grid-template-columns: repeat(2, 1fr);
  height: 46%;
  right: 9%;
  top: 26%;
  width: 25%;
}

.template-motif-google .template-preview-visual i {
  background: var(--template-accent);
  border: 0;
  border-radius: 50%;
  inset: auto;
  position: static;
}

.template-motif-google .template-preview-visual i:nth-child(2) {
  background: var(--template-accent-secondary);
}

.template-motif-google .template-preview-visual i:nth-child(3) {
  background: #34a853;
  grid-column: 1 / -1;
  margin: 0 auto;
  width: 46%;
}

body.template-lightbox-open {
  overflow: hidden;
}

.template-lightbox {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px 18px;
  position: fixed;
  z-index: 90;
}

.template-lightbox-backdrop {
  backdrop-filter: blur(14px);
  background: rgba(2, 4, 8, 0.78);
  border: 0;
  inset: 0;
  position: absolute;
}

.template-lightbox-dialog {
  background:
    radial-gradient(circle at 100% 0%, rgba(124, 92, 255, 0.16), transparent 34%),
    #10131a;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.58);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(880px, calc(100vh - 40px));
  max-width: 920px;
  padding: 16px 16px 14px;
  position: relative;
  width: min(920px, 100%);
}

.template-lightbox-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 36px;
  padding-right: 4px;
}

.template-lightbox-head small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.template-lightbox-head h2 {
  font-size: 18px;
  letter-spacing: -0.03em;
  margin: 2px 0 0;
}

.template-lightbox-close {
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  display: flex;
  flex: 0 0 auto;
  font-size: 20px;
  height: 32px;
  justify-content: center;
  line-height: 1;
  width: 32px;
}

.template-lightbox-close:hover {
  color: white;
}

.template-lightbox-stage {
  background: #07080c;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.template-lightbox-stage img {
  aspect-ratio: 16 / 9;
  background: #0b0d12;
  display: block;
  height: auto;
  object-fit: contain;
  width: 100%;
}

.template-lightbox-motif .template-preview {
  border-radius: 0;
  box-shadow: none;
  transform: none;
  width: 100%;
}

.template-lightbox-nav {
  align-items: center;
  background: rgba(8, 10, 14, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: white;
  display: flex;
  font-size: 22px;
  height: 34px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  z-index: 2;
}

.template-lightbox-nav.prev {
  left: 12px;
}

.template-lightbox-nav.next {
  right: 12px;
}

.template-lightbox-nav:hover {
  background: rgba(20, 16, 32, 0.88);
  border-color: rgba(196, 182, 255, 0.7);
}

.template-lightbox-meta {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 18px;
}

.template-lightbox-meta:not(:has(:not([hidden]))) {
  display: none;
}

.template-lightbox-meta p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

.template-lightbox-meta span {
  color: #c8ced8;
  flex: 0 0 auto;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

.template-lightbox-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.template-lightbox-strip button {
  background: #07080c;
  border: 1px solid transparent;
  border-radius: 8px;
  flex: 0 0 96px;
  overflow: hidden;
  padding: 0;
}

.template-lightbox-strip button[aria-current="true"] {
  border-color: #8d70ff;
  box-shadow: 0 0 0 1px #8d70ff;
}

.template-lightbox-strip img {
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  width: 100%;
}

.template-motif-engineering::before {
  border-left: 2px solid var(--template-accent);
  border-top: 2px solid var(--template-accent);
  content: "";
  height: 19%;
  position: absolute;
  right: 8%;
  top: 12%;
  width: 18%;
}

.composer-wrap {
  padding: 24px 0 0;
  position: relative;
  transition: padding 180ms ease;
  z-index: 8;
}

.workspace-shell:not(.has-active-job) .conversation {
  padding: 34px 40px 46px;
}

.composer-wrap.composer-pinned {
  background: linear-gradient(transparent, #080a0e 30%);
  bottom: 0;
  left: 272px;
  padding: 40px 28px 17px;
  position: fixed;
  right: 0;
  z-index: 9;
}

.composer {
  background: #11141a;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
  margin: 0 auto;
  max-width: 900px;
  overflow: visible;
  padding: 12px 15px 13px;
  position: relative;
}

.composer-editor,
.composer-editor .composer-prose {
  min-height: 54px;
}

.composer-editor .composer-prose {
  font-size: 14px;
  line-height: 1.65;
  outline: none;
  padding: 3px;
}

.composer-editor .composer-prose p {
  margin: 0;
}

.composer-editor .composer-prose p.is-editor-empty:first-child::before {
  color: #555c69;
  content: attr(data-placeholder);
  float: left;
  height: 0;
  pointer-events: none;
}

.skill-mention {
  background: rgba(124, 92, 255, 0.16);
  border: 1px solid rgba(171, 147, 255, 0.28);
  border-radius: 999px;
  color: #efe9ff;
  display: inline-block;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
  margin: 0 2px;
  padding: 1px 8px 2px;
  vertical-align: baseline;
}

.mention-popup {
  background: #161922;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  display: grid;
  min-width: 220px;
  padding: 6px;
  position: fixed;
  z-index: 80;
}

.mention-popup.mention-popup-empty {
  display: block;
  min-width: 220px;
  padding: 0;
}

.mention-empty {
  color: #8d95a3;
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
  padding: 12px 14px;
  white-space: nowrap;
}

.mention-option {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #f2f4f8;
  display: flex;
  font-size: 13px;
  gap: 6px;
  padding: 8px 10px;
  text-align: left;
}

.mention-option span {
  color: #b9a6ff;
  font-weight: 700;
}

.mention-option.active,
.mention-option:hover {
  background: rgba(255, 255, 255, 0.06);
}

.composer-toolbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
}

.attachment-group,
.composer-submit {
  align-items: center;
  display: flex;
  gap: 10px;
}

.attachment-group {
  position: relative;
}

.attach-button {
  align-items: center;
  background: #191d25;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #a9afbb;
  cursor: pointer;
  display: flex;
  font-size: 10px;
  padding: 5px 9px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.attach-button:hover {
  background: #202530;
  border-color: rgba(143, 112, 255, 0.35);
  color: #d8dbe2;
}

.attach-button input {
  display: none;
}

.attach-button span {
  color: white;
  font-size: 13px;
  margin-right: 4px;
}

.file-summary {
  color: var(--muted-2);
  font-size: 10px;
}

.composer-submit {
  justify-content: flex-end;
}

.composer-submit button[type="submit"] {
  align-items: center;
  background: linear-gradient(145deg, var(--accent), #9c68ff);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 7px 18px rgba(124, 92, 255, 0.24);
  display: flex;
  font-size: 16px;
  font-weight: 700;
  height: 32px;
  justify-content: center;
  transition: box-shadow 160ms ease, transform 160ms ease;
  width: 32px;
}

.composer-submit button[type="submit"]:hover:not(:disabled) {
  box-shadow: 0 9px 22px rgba(124, 92, 255, 0.36);
  transform: translateY(-1px);
}

.composer-submit button[type="submit"]:disabled {
  opacity: 0.45;
}

.job-controls {
  align-items: center;
  display: flex;
}

.stop-control {
  align-items: center;
  background: linear-gradient(145deg, var(--accent), #9c68ff);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 7px 18px rgba(124, 92, 255, 0.24);
  color: white;
  display: flex;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.stop-control svg {
  display: block;
  height: 16px;
  width: 16px;
}

.stop-control:hover:not(:disabled) {
  box-shadow: 0 9px 22px rgba(124, 92, 255, 0.36);
}

.stop-control:disabled {
  opacity: 0.45;
}

.table-status {
  background: #1c2130;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: #b2b8c5;
  font-size: 10px;
  padding: 7px 10px;
}

.table-status.status-completed {
  background: rgba(75, 214, 154, 0.12);
  border-color: rgba(75, 214, 154, 0.28);
  color: #8fe9c0;
}

.table-status.status-failed,
.table-status.status-cancelled {
  background: rgba(255, 107, 122, 0.12);
  border-color: rgba(255, 107, 122, 0.28);
  color: #ff9aa6;
}

.table-status.status-processing {
  background: rgba(124, 92, 255, 0.16);
  border-color: rgba(151, 126, 255, 0.3);
  color: #c3b2ff;
}

.table-status.status-queued,
.table-status.status-waiting_user {
  background: rgba(69, 214, 207, 0.12);
  border-color: rgba(69, 214, 207, 0.28);
  color: #8ee6e2;
}

.table-status.status-paused {
  background: rgba(255, 196, 84, 0.12);
  border-color: rgba(255, 196, 84, 0.28);
  color: #ffd79a;
}

.messages {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}

.request-card {
  align-items: flex-start;
  background:
    linear-gradient(135deg, rgba(124, 92, 255, 0.1), transparent 42%),
    #10131a;
  border: 1px solid rgba(138, 109, 255, 0.2);
  border-radius: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-self: end;
  max-width: min(85%, 720px);
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 10px 12px;
  width: fit-content;
}

.request-card p {
  color: #c6cad3;
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
  white-space: pre-wrap;
}

.reply-card {
  color: #d4d7de;
  font-size: 13px;
  justify-self: start;
  line-height: 1.75;
  max-width: min(92%, 760px);
  min-width: 0;
  overflow-wrap: anywhere;
}

.reply-card p {
  margin: 0;
  white-space: pre-wrap;
}

.request-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.request-attachment {
  align-items: center;
  background: #1b1d22;
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 8px;
  display: flex;
  max-width: min(100%, 260px);
  min-width: min(100%, 220px);
  padding: 8px 10px;
}

.attachment-copy {
  min-width: 0;
  overflow: hidden;
}

.attachment-copy strong,
.attachment-copy small {
  display: block;
}

.attachment-copy strong {
  color: #e1e2e6;
  font-size: 11px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-copy small {
  color: #696c73;
  font-size: 9px;
  margin-top: 5px;
  text-transform: uppercase;
}

.activity-panel {
  background: #0e1117;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.activity-panel-head {
  align-items: center;
  background: rgba(255, 255, 255, 0.018);
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  display: flex;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 17px;
}

.activity-panel-head > div {
  align-items: center;
  display: flex;
  gap: 9px;
}

.activity-panel-head strong {
  font-size: 12px;
}

.activity-panel-head small {
  color: var(--muted-2);
  font-size: 9px;
}

.activity-panel-head button {
  background: transparent;
  border: 0;
  color: #8f82c4;
  font-size: 10px;
  padding: 7px 0 7px 10px;
}

.activity-panel-head button:hover {
  color: #c0b2ff;
}

.activity-pulse {
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(124, 92, 255, 0.1);
  height: 7px;
  width: 7px;
}

.activity-stream {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 0;
}

.charge-line {
  align-items: baseline;
  color: var(--muted);
  display: flex;
  font-size: 11px;
  font-weight: 400;
  gap: 8px;
  justify-content: flex-end;
  line-height: 1.4;
  margin: 0;
}

.charge-line time {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.activity-item.progress-event {
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 4px 2px;
}

.activity-thinking {
  align-items: center;
  color: #b6a7f4;
  display: flex;
  font-size: 12px;
  gap: 8px;
  padding: 6px 2px 2px;
}

.thinking-sep {
  color: #6d657f;
}

.thinking-dots::after {
  animation: thinking-dots 1.4s steps(4, end) infinite;
  content: "";
}

@keyframes thinking-dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

.activity-stage {
  border-radius: 12px;
  position: relative;
}

.activity-stage:not(:last-child)::after {
  background: #2a2f3a;
  bottom: -12px;
  content: "";
  left: 21px;
  position: absolute;
  top: 42px;
  width: 1px;
  z-index: 0;
}

.activity-stage + .activity-stage {
  margin-top: 3px;
}

.activity-stage > summary {
  align-items: center;
  border-radius: 11px;
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: 22px minmax(0, 1fr) 22px;
  list-style: none;
  min-height: 54px;
  padding: 8px 10px;
  transition: background 150ms ease;
}

.activity-stage > summary::-webkit-details-marker,
.activity-event > summary::-webkit-details-marker {
  display: none;
}

.activity-stage > summary:hover,
.activity-stage[open] > summary {
  background: rgba(255, 255, 255, 0.026);
}

.stage-marker {
  align-items: center;
  background: #171b24;
  border: 1px solid #353b48;
  border-radius: 50%;
  display: flex;
  height: 22px;
  justify-content: center;
  position: relative;
  width: 22px;
  z-index: 1;
}

.stage-marker::after {
  color: #88909f;
  content: "✓";
  font-size: 10px;
  font-weight: 800;
}

.state-active .stage-marker {
  background: rgba(124, 92, 255, 0.12);
  border-color: rgba(142, 115, 255, 0.6);
  box-shadow: 0 0 16px rgba(124, 92, 255, 0.2);
}

.state-active .stage-marker::before {
  animation: activity-spin 1.1s linear infinite;
  border: 2px solid rgba(169, 148, 255, 0.2);
  border-radius: 50%;
  border-top-color: #a994ff;
  content: "";
  height: 12px;
  width: 12px;
}

.state-active .stage-marker::after {
  content: "";
}

.state-waiting .stage-marker {
  background: rgba(245, 185, 72, 0.1);
  border-color: rgba(245, 185, 72, 0.55);
}

.state-waiting .stage-marker::after {
  color: #f5c266;
  content: "?";
}

.state-error .stage-marker {
  background: rgba(255, 107, 122, 0.1);
  border-color: rgba(255, 107, 122, 0.52);
}

.state-error .stage-marker::after {
  color: #ff8793;
  content: "!";
}

.state-resolved .stage-marker {
  background: rgba(75, 214, 154, 0.08);
  border-color: rgba(75, 214, 154, 0.32);
}

.state-resolved .stage-marker::after {
  color: #71d9ad;
}

.stage-copy {
  min-width: 0;
}

.stage-copy strong,
.stage-copy small {
  display: block;
}

.stage-copy strong {
  color: #d7dae2;
  font-size: 11px;
  font-weight: 590;
  line-height: 1.45;
}

.stage-copy small {
  color: var(--muted-2);
  font-size: 9px;
  margin-top: 4px;
}

.state-active .stage-copy strong {
  color: #f4f1ff;
}

.state-active .stage-copy small {
  color: #a997f0;
}

.state-error .stage-copy strong,
.state-error .stage-copy small {
  color: #ff8e99;
}

.state-resolved .stage-copy strong {
  color: #89919f;
}

.state-resolved .stage-copy small {
  color: #6db996;
}

.stage-chevron,
.event-chevron {
  color: #555d6b;
  display: block;
  font-size: 16px;
  justify-self: end;
  transition: transform 150ms ease;
}

.activity-stage[open] > summary .stage-chevron,
.activity-event[open] > summary .event-chevron {
  transform: rotate(180deg);
}

.activity-stage-body {
  display: grid;
  gap: 8px;
  padding: 1px 10px 13px 44px;
}

.stage-status-copy {
  color: #727a89;
  font-size: 11px;
  line-height: 1.65;
  margin: 0;
}

.activity-event {
  background: #12161e;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 6px;
  min-width: 0;
  overflow: hidden;
}

.agent-event {
  background: rgba(124, 92, 255, 0.075);
  border-color: rgba(124, 92, 255, 0.16);
  padding: 8px 10px;
}

.event-heading {
  align-items: center;
  color: #ad9cff;
  display: flex;
  font-size: 10px;
  gap: 7px;
}

.agent-event p {
  color: #c4c2d2;
  font-size: 11px;
  line-height: 1.75;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.tool-event > summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 18px;
  list-style: none;
  padding: 6px 8px;
}

.tool-event > summary:hover {
  background: rgba(255, 255, 255, 0.022);
}

.event-copy {
  min-width: 0;
}

.event-copy strong,
.event-copy small {
  display: block;
}

.event-copy strong {
  color: #acb2bf;
  font-size: 10px;
}

.event-copy small {
  color: #5f6674;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-event pre {
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  color: #7e8694;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  line-height: 1.65;
  margin: 0;
  overflow-x: auto;
  padding: 6px 8px;
  white-space: pre-wrap;
  word-break: break-all;
}

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

.question-card {
  background: linear-gradient(145deg, #171427, #11141b);
  border: 1px solid rgba(151, 116, 255, 0.28);
  border-radius: 16px;
  margin-top: 22px;
  padding: 20px;
}

.question-card strong {
  display: block;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 13px;
  white-space: pre-wrap;
}

.question-sample {
  color: #cbb9ff;
  display: block;
  margin-bottom: 14px;
  max-width: 640px;
}

.question-sample img {
  border: 1px solid var(--line);
  border-radius: 10px;
  display: block;
  height: auto;
  width: 100%;
}

.question-sample span {
  display: block;
  margin-top: 7px;
}

.question-card textarea {
  background: #0d1015;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 76px;
  outline: none;
  padding: 11px;
  resize: vertical;
  width: 100%;
}

.question-card button {
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  margin-top: 10px;
  padding: 9px 15px;
}

.artifact-delivery {
  font-size: 13px;
  margin: 0;
  max-width: 640px;
  width: 100%;
}

.artifact-card {
  align-items: center;
  background: #11151b;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #d4d7de;
  display: flex;
  font-family: inherit;
  font-size: 13px;
  gap: 10px;
  margin: 0;
  min-width: 0;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
}

.artifact-card:hover {
  background: #151a22;
  border-color: var(--line-strong);
}

.artifact-card + .artifact-card {
  margin-top: 6px;
}

.artifact-icon {
  align-items: center;
  color: #aeb7c5;
  display: inline-flex;
  flex: 0 0 32px;
  height: 36px;
  justify-content: center;
  width: 32px;
}

.artifact-icon svg {
  fill: none;
  height: 25px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
  width: 25px;
}

.artifact-copy {
  display: block;
  flex: 1;
  min-width: 0;
}

.artifact-copy strong {
  display: block;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-copy small {
  color: var(--muted);
  display: block;
  font-size: 13px;
  line-height: 1.4;
  margin-top: 1px;
}

.artifact-actions {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}

.artifact-preview,
.artifact-download {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: #c7cdd6;
  display: inline-flex;
  flex-shrink: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  gap: 6px;
  justify-content: center;
  line-height: 18px;
  min-height: 32px;
  padding: 5px 8px;
  white-space: nowrap;
}

.artifact-preview:hover,
.artifact-download:hover {
  background: #222933;
  border-color: #505967;
}

.artifact-preview:focus-visible,
.artifact-download:focus-visible {
  outline: 2px solid #aeb7c5;
  outline-offset: 3px;
}

.artifact-preview svg,
.artifact-download svg {
  fill: none;
  height: 16px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  width: 16px;
}

.artifact-dialog {
  background: #121419;
  border: 1px solid #34363f;
  border-radius: 14px;
  color: var(--text);
  margin: auto;
  max-height: 88dvh;
  max-width: calc(100vw - 32px);
  overflow: auto;
  padding: 0;
  width: 760px;
}

.artifact-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
}

.artifact-dialog-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 14px 18px;
}

.artifact-dialog-header h2 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
  margin: 0;
  overflow-wrap: anywhere;
}

.artifact-dialog-close {
  background: #25272e;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  flex-shrink: 0;
  font-size: 24px;
  height: 34px;
  line-height: 1;
  width: 34px;
}

.artifact-dialog-body {
  padding: 16px 18px 20px;
}

.artifact-dialog-note {
  color: var(--muted-2);
  font-size: 12px;
  margin: 0 0 20px;
}

.artifact-preview-toolbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

.artifact-back {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 0;
}

.artifact-cover-preview {
  margin: 0;
}

.artifact-cover-preview img {
  border-radius: 10px;
  display: block;
  width: 100%;
}

.artifact-cover-preview figcaption {
  color: var(--muted-2);
  font-size: 12px;
  margin-top: 12px;
  text-align: center;
}

.artifact-preview-empty {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 56px 20px;
  text-align: center;
}

.artifact-preview-empty .artifact-icon {
  flex-basis: auto;
  height: 72px;
  width: 64px;
}

.artifact-preview-empty strong {
  font-size: 15px;
  font-weight: 500;
}

.artifact-preview-empty p {
  color: var(--muted-2);
  font-size: 12px;
  margin: 0;
}

/* Admin */

.admin-page {
  background: #090b0f;
}

.admin-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  background: #0b0e13;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: auto;
  padding: 24px 14px 18px;
  position: sticky;
  top: 0;
}

.admin-sidebar .sidebar-brand {
  margin: 0 8px 20px;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-nav-group {
  display: grid;
  gap: 2px;
}

.admin-nav-group p {
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.14em;
  margin: 0 12px 4px;
}

.admin-nav-group:has(a.active) p {
  color: #c8ceda;
}

.admin-nav a {
  align-items: center;
  border-radius: 9px;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  padding: 7px 12px;
}

.admin-nav a span {
  background: #1a1f29;
  border-radius: 999px;
  color: #b7bdd0;
  font-size: 10px;
  min-width: 18px;
  padding: 2px 6px;
  text-align: center;
}

.admin-nav a.active,
.admin-nav a:hover {
  background: #151921;
  color: #f2f4f8;
}

.admin-sidebar-footer {
  border-top: 1px solid var(--line);
  display: grid;
  flex: none;
  gap: 8px;
  margin-top: auto;
  padding: 14px 10px 0;
}

.admin-sidebar-footer a,
.admin-sidebar-footer button {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.admin-content {
  min-width: 0;
}

.admin-topbar {
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 28px 34px 22px;
}

.admin-topbar h1 {
  font-size: 28px;
  letter-spacing: -0.04em;
  margin: 8px 0 0;
}

.admin-main {
  max-width: 1180px;
  padding: 28px 34px 80px;
}

.admin-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 19px 20px;
}

.admin-quick-links a {
  background: #151921;
  border-radius: 8px;
  color: #d5d8e0;
  font-size: 12px;
  padding: 10px 12px;
}

.code-generator {
  align-items: flex-end;
  display: flex;
  gap: 9px;
}

.code-generator label {
  color: var(--muted);
  display: grid;
  font-size: 10px;
  gap: 6px;
}

.code-generator input {
  min-height: 39px;
  width: 150px;
}

.code-generator button {
  background: var(--accent);
  border: 0;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  height: 39px;
  padding: 0 18px;
}

.generated-code {
  background: rgba(75, 214, 154, 0.09);
  border: 1px solid rgba(75, 214, 154, 0.25);
  border-radius: 12px;
  color: #aaf0cd;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 15px;
  margin-top: 20px;
  padding: 15px 18px;
}

.metric-grid {
  display: grid;
  gap: 13px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin: 0 0 25px;
}

.metric-grid a,
.metric-grid div,
.admin-section {
  background: #0e1117;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.metric-grid a,
.metric-grid div {
  color: inherit;
  padding: 20px;
  text-decoration: none;
}

.metric-grid span,
.metric-grid strong {
  display: block;
}

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

.metric-grid strong {
  font-size: 29px;
  margin-top: 9px;
}

.admin-section {
  margin-top: 15px;
  overflow: hidden;
}

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

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

.section-head span {
  color: var(--muted-2);
  font-size: 10px;
}

.table-scroll {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  font-size: 11px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  padding: 13px 19px;
  text-align: left;
}

th {
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: #aeb4c0;
}

td strong,
td small {
  display: block;
}

td strong {
  color: #e9ebef;
}

td small {
  color: var(--muted-2);
  margin-top: 4px;
}

.admin-two-column {
  display: grid;
  gap: 15px;
  grid-template-columns: 1fr 1fr;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.admin-action {
  background: #151921;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #d5d8e0;
  font-size: 12px;
  font-weight: 600;
  padding: 9px 15px;
}

.admin-action:hover {
  border-color: var(--line-strong);
  color: #fff;
}

.admin-action.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
}

.metric-grid strong .table-status {
  display: inline-block;
  margin-top: 7px;
}

.table-link {
  color: #d9d2ff;
}

.table-link:hover {
  color: #fff;
}

.table-action {
  background: #151921;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #c9b8ff;
  font-size: 10px;
  padding: 7px 11px;
  white-space: nowrap;
}

.table-action:hover {
  border-color: var(--line-strong);
  color: #fff;
}

.detail-list {
  display: grid;
  padding: 6px 19px 12px;
}

.detail-list > div {
  align-items: baseline;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 11px 0;
}

.detail-list > div:last-child {
  border-bottom: 0;
}

.detail-list dt {
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.detail-list dd {
  color: #c9cdd6;
  font-size: 11px;
  margin: 0;
  max-width: 68%;
  overflow-wrap: anywhere;
  text-align: right;
  white-space: pre-wrap;
}

.detail-text {
  color: #c9cdd6;
  font-size: 12px;
  line-height: 1.75;
  margin: 0;
  overflow-wrap: anywhere;
  padding: 17px 19px;
  white-space: pre-wrap;
}

.detail-preview {
  display: block;
  padding: 16px 19px;
}

.detail-preview img {
  border: 1px solid var(--line);
  border-radius: 12px;
  display: block;
  max-width: 100%;
}

.message-list {
  display: grid;
  gap: 10px;
  padding: 16px 19px;
}

.message-item {
  background: #0b0e13;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 14px;
}

.message-item header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.message-item strong {
  font-size: 11px;
}

.message-item time {
  color: var(--muted-2);
  font-size: 10px;
}

.message-item p {
  color: #b6bcc8;
  font-size: 11px;
  line-height: 1.7;
  margin: 9px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.detail-tag {
  background: #1a1f29;
  border-radius: 99px;
  color: #b7bdd0;
  font-size: 9px;
  padding: 3px 8px;
}

.product-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, 1fr);
  padding: 16px;
}

.product-grid > div {
  background: #151921;
  border-radius: 10px;
  padding: 14px;
}

.product-grid span,
.product-grid strong,
.product-grid small {
  display: block;
}

.product-grid span {
  color: #987eff;
  font-size: 9px;
  margin-bottom: 7px;
}

.product-grid strong {
  font-size: 12px;
}

.product-grid small {
  color: var(--muted-2);
  font-size: 10px;
  margin-top: 7px;
}

@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    display: none;
  }

  .auth-panel {
    padding: 30px 22px;
  }

  .mobile-brand {
    display: flex;
  }

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

  .sidebar {
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.45);
    left: -290px;
    position: fixed;
    transition: left 180ms ease;
    width: 272px;
    z-index: 30;
  }

  .workspace-shell.sidebar-open .sidebar {
    left: 0;
  }

  .mobile-menu {
    display: block;
  }

  .studio-header {
    padding: 0 18px;
  }

  .header-title {
    margin-right: auto;
  }

  .ghost-link {
    display: none;
  }

  .composer-wrap.composer-pinned {
    left: 0;
    padding-inline: 12px;
  }

  .conversation {
    padding: 42px 18px 70px;
  }

  .workspace-shell:not(.has-active-job) .conversation {
    padding: 28px 18px 38px;
  }

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

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

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    height: auto;
    overflow: visible;
    position: static;
  }

  .admin-nav {
    display: grid;
  }

  .admin-nav-group p {
    grid-column: 1 / -1;
  }

  .admin-topbar,
  .admin-main {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 560px) {
  .studio {
    padding-bottom: 26px;
  }

  .workspace-shell.has-active-job .studio {
    padding-bottom: 290px;
  }

  .template-picker {
    margin-top: 27px;
  }

  .template-grid {
    gap: 17px;
    grid-template-columns: 1fr;
  }

  .template-preview-copy small {
    font-size: 7px;
  }

  .template-preview-copy strong,
  .template-motif-free .template-preview-copy strong {
    font-size: 20px;
  }

  .composer-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .attachment-group {
    justify-content: space-between;
  }

  .file-summary {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .composer-submit {
    justify-content: flex-end;
  }

  .composer-wrap {
    padding: 18px 0 0;
  }

  .request-card {
    max-width: 92%;
    padding: 8px 10px;
  }

  .activity-panel-head {
    padding: 0 13px;
  }

  .activity-stage > summary {
    gap: 9px;
    padding-inline: 7px;
  }

  .activity-stage-body {
    padding-left: 36px;
    padding-right: 7px;
  }

  .activity-stage:not(:last-child)::after {
    left: 18px;
  }

  .artifact-card {
    gap: 8px;
    padding: 9px 10px;
  }

  .artifact-actions {
    gap: 5px;
  }

  .artifact-actions > a,
  .artifact-actions > button {
    min-height: 30px;
    padding: 6px;
    width: 30px;
  }

  .artifact-actions span {
    display: none;
  }

  .artifact-dialog-body,
  .artifact-dialog-header {
    padding: 18px 14px;
  }

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

  .usage-row time {
    display: none;
  }

  .template-lightbox {
    align-items: flex-end;
    padding: 12px;
  }

  .template-lightbox-dialog {
    border-radius: 18px 18px 14px 14px;
    max-height: calc(100vh - 24px);
  }

  .template-lightbox-strip button {
    flex-basis: 72px;
  }

  .redeem-modal {
    align-items: flex-end;
    padding: 12px;
  }

  .redeem-dialog {
    border-radius: 22px 22px 16px 16px;
    padding: 26px 20px 22px;
  }

  .welcome-modal {
    align-items: flex-end;
    padding: 12px;
  }

  .welcome-dialog {
    border-radius: 22px 22px 16px 16px;
    max-height: calc(100vh - 24px);
    overflow: auto;
  }
}

.composer-input {
  position: relative;
}

.skill-chip {
  align-items: center;
  background: rgba(124, 92, 255, 0.16);
  border: 1px solid rgba(171, 147, 255, 0.28);
  border-radius: 999px;
  color: #efe9ff;
  display: inline-flex;
  font-size: 12px;
  gap: 7px;
  margin: 2px 3px 8px;
  padding: 4px 8px 4px 10px;
}

.skill-chip-mark {
  color: #b9a6ff;
  font-weight: 700;
}

.skill-chip strong {
  font-size: 12px;
  font-weight: 650;
}

.skill-chip-clear {
  background: transparent;
  border: 0;
  color: #c9c3de;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}

.skill-chip-clear:hover {
  color: white;
}

.composer.menu-open {
  border-bottom-color: transparent;
  border-radius: 18px 18px 0 0;
}

.composer-wrap.composer-pinned .composer.menu-open {
  border-bottom-color: var(--line-strong);
  border-radius: 0 0 18px 18px;
  border-top-color: transparent;
}

.composer-menu {
  background: #11141a;
  border: 1px solid var(--line-strong);
  border-radius: 0 0 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 28px 48px rgba(0, 0, 0, 0.38);
  left: -1px;
  padding: 6px 0 8px;
  position: absolute;
  right: -1px;
  top: calc(100% - 1px);
  z-index: 30;
}

.composer-wrap.composer-pinned .composer-menu {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px 18px 0 0;
  border-top: 1px solid var(--line-strong);
  bottom: calc(100% - 1px);
  box-shadow: 0 -22px 40px rgba(0, 0, 0, 0.38);
  top: auto;
}

.composer-menu-icon {
  color: #9aa3b2;
  fill: none;
  flex: 0 0 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.6;
  width: 18px;
}

.composer-menu-item {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #f2f4f8;
  display: flex;
  gap: 12px;
  padding: 13px 18px;
  text-align: left;
  width: 100%;
}

.composer-menu-copy {
  align-items: baseline;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.composer-menu-item strong {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 560;
}

.composer-menu-item small {
  color: #8d95a3;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-menu-item:hover,
.skill-option:hover,
.skill-option.active,
.skill-palette-head button:hover {
  background: rgba(255, 255, 255, 0.045);
}

.composer-menu .skill-palette {
  background: transparent;
  border: 0;
  box-shadow: none;
  position: static;
  width: auto;
}

.skill-palette-head {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  padding: 0;
}

.skill-palette-head button {
  align-items: center;
  background: transparent;
  border: 0;
  color: #d7dbe3;
  display: flex;
  font-size: 13px;
  gap: 8px;
  padding: 12px 18px;
  width: 100%;
}

.skill-palette-list {
  display: grid;
  gap: 0;
  max-height: 320px;
  overflow: auto;
  padding: 4px 0 2px;
}

.skill-option {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #f2f4f8;
  display: flex;
  gap: 12px;
  padding: 12px 18px;
  text-align: left;
  width: 100%;
}

.skill-option strong {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 560;
}

.skill-option small {
  color: #8d95a3;
  font-size: 13px;
}

.skill-palette-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 18px 14px;
}

.skill-market {
  padding: 16px 18px 18px;
}

.skill-market-intro h3 {
  font-size: 18px;
  font-weight: 620;
  margin: 0;
}

.skill-market-intro p {
  color: #8d95a3;
  font-size: 13px;
  line-height: 1.5;
  margin: 6px 0 14px;
}

.skill-market-card {
  background: #191c22;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 16px;
}

.skill-market-card-top {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.skill-market-mark {
  align-items: center;
  background: #1f8a4c;
  border-radius: 12px;
  color: white;
  display: flex;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.skill-market-mark svg {
  height: 22px;
  width: 22px;
}

.skill-market-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.skill-market-copy strong {
  font-size: 15px;
  font-weight: 620;
}

.skill-market-copy small,
.skill-market-copy a {
  color: #8d95a3;
  font-size: 12px;
}

.skill-market-copy a:hover {
  color: #d7dbe3;
}

.skill-market-add {
  background: #2a2e36;
  border: 0;
  border-radius: 999px;
  color: #f4f6f8;
  font-size: 13px;
  padding: 6px 14px;
}

.skill-market-add:hover {
  background: #353a44;
}

.skill-market-add.is-added {
  background: transparent;
  color: #8d95a3;
}

.skill-market-card > p {
  color: #c5cbd4;
  font-size: 13px;
  line-height: 1.6;
  margin: 12px 0 0;
}

.template-motif-swiss {
  background-image:
    linear-gradient(to right, rgba(17, 17, 17, 0.06) 1px, transparent 1px);
  background-size: 12.5% 100%;
}

.template-motif-swiss::after {
  background: var(--template-accent);
  content: "";
  height: 100%;
  position: absolute;
  right: 0;
  top: 0;
  width: 16%;
}

.hero-style-link {
  color: #b9c0cc;
  font-size: 14px;
}

.hero-style-link a {
  color: #cbb8ff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.public-shell {
  margin: 0 auto;
  max-width: 1120px;
  padding: 22px 24px 64px;
}

.public-nav,
.public-footer {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.public-links,
.public-footer nav {
  display: flex;
  gap: 18px;
}

.public-links a {
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.public-links a[aria-current="page"] {
  border-bottom-color: #8a6dff;
  color: #fff;
}

.public-cta,
.public-page .primary-button {
  background: linear-gradient(180deg, #8a6dff, #6d4dff);
  border-radius: 999px;
  color: white;
  font-size: 13px;
  padding: 9px 14px;
}

.public-main {
  padding: 42px 0 24px;
}

.public-hero h1,
.style-detail h1 {
  font-size: clamp(32px, 5vw, 52px);
  letter-spacing: -0.04em;
  line-height: 1.12;
  margin: 12px 0 16px;
}

.public-hero p,
.style-lead,
.style-copy p {
  color: #c5cad4;
  font-size: 16px;
  line-height: 1.7;
  max-width: 720px;
}

.public-hero-hint {
  color: var(--muted) !important;
}

.public-hero kbd,
.style-copy kbd {
  background: #1b2029;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #d7dbe3;
  font-size: 12px;
  padding: 1px 6px;
}

.style-group {
  margin-top: 42px;
}

.style-group-head {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.style-group-head h2 {
  margin: 0;
}

.style-group h2,
.style-copy h2,
.style-related h2 {
  font-size: 18px;
  margin-bottom: 16px;
}

.style-group-head h2 {
  margin-bottom: 0;
}

.style-group-count {
  background: #171b24;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  padding: 2px 9px;
}

.style-group-head p {
  color: var(--muted);
  flex-basis: 100%;
  font-size: 13px;
  line-height: 1.6;
  margin: 2px 0 12px;
  max-width: 640px;
}

/* ---------- template library tools ---------- */

.template-tools {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 14px;
  margin-top: 26px;
  padding-bottom: 18px;
}

.template-search {
  display: block;
  max-width: 460px;
}

.template-search span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.template-search input {
  background: #11141a;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  padding: 10px 13px;
  width: 100%;
}

.template-search input:focus-visible {
  border-color: var(--line-strong);
  outline: 2px solid rgba(124, 92, 255, 0.35);
  outline-offset: 1px;
}

.template-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.template-jump a {
  align-items: baseline;
  background: #141821;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  display: inline-flex;
  font-size: 13px;
  gap: 7px;
  padding: 6px 13px;
  transition: border-color 0.18s ease;
}

.template-jump a:hover {
  border-color: var(--line-strong);
}

.template-jump small {
  color: var(--muted);
  font-size: 11px;
}

.template-empty {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.style-grid {
  display: grid;
  gap: 18px 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.style-card {
  min-width: 0;
}

.style-card:hover .template-preview {
  border-color: rgba(171, 147, 255, 0.5);
  transform: translateY(-3px);
}

.style-card-copy {
  display: grid;
  gap: 4px;
  padding-top: 10px;
}

.style-card-copy em {
  color: var(--muted);
  display: -webkit-box;
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.style-detail-hero {
  max-width: 760px;
}

.style-kicker {
  color: #b9a6ff;
  font-size: 12px;
  letter-spacing: 0.12em;
  margin-bottom: 0;
}

.style-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 22px 0 28px;
}

.style-detail-preview {
  max-width: 560px;
}

.style-detail-preview .template-preview {
  aspect-ratio: 16 / 9;
  border-radius: 16px;
}

.style-copy {
  margin-top: 36px;
  max-width: 760px;
}

.style-steps {
  color: #c5cad4;
  line-height: 1.8;
  padding-left: 18px;
}

.style-copy details {
  background: #11141a;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 10px 0;
  padding: 12px 14px;
}

.style-copy summary {
  cursor: pointer;
  font-weight: 650;
}

.style-related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.style-related-list a {
  background: #141821;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  min-width: 180px;
  padding: 12px 14px;
}

.style-related-list small {
  color: var(--muted);
}

.public-footer {
  align-items: flex-start;
  border-top: 1px solid var(--line);
  color: var(--muted);
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-top: 48px;
  padding-top: 18px;
}

.public-footer nav {
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
  row-gap: 10px;
}

.public-footer nav a {
  white-space: nowrap;
}

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

  .public-nav {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
  }

  .public-links {
    flex-wrap: wrap;
    row-gap: 10px;
    width: 100%;
  }
}

/* ── Admin user management ─────────────────────────────────────────────── */

.impersonation-bar {
  align-items: center;
  background: linear-gradient(90deg, rgba(255, 107, 122, 0.17), rgba(124, 92, 255, 0.17));
  border-bottom: 1px solid var(--line-strong);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 60;
}

.impersonation-bar strong {
  color: #fff;
}

.impersonation-bar button {
  background: #151921;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: #f2f4f8;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 13px;
  white-space: nowrap;
}

.impersonation-bar button:hover {
  border-color: var(--accent);
  color: #fff;
}

.admin-toolbar {
  align-items: flex-end;
  background: #0e1117;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 15px;
  padding: 16px 19px;
}

.toolbar-field {
  color: var(--muted);
  display: grid;
  font-size: 10px;
  gap: 6px;
  min-width: 132px;
}

.toolbar-search {
  flex: 1 1 240px;
}

.toolbar-field input,
.toolbar-field select,
.dialog-field input {
  background: #0a0d12;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #e9ebef;
  min-height: 38px;
  outline: none;
  padding: 0 12px;
  width: 100%;
}

.toolbar-field input:focus,
.toolbar-field select:focus,
.dialog-field input:focus {
  border-color: rgba(124, 92, 255, 0.75);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.11);
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.bulk-bar {
  align-items: center;
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid rgba(124, 92, 255, 0.34);
  border-radius: 14px;
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 10px;
  margin-top: 15px;
  padding: 13px 18px;
}

.bulk-field {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 10px;
  gap: 8px;
}

.bulk-field input {
  background: #0a0d12;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #e9ebef;
  min-height: 32px;
  padding: 0 10px;
  width: 90px;
}

.badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 10px;
  line-height: 1;
  padding: 5px 9px;
  white-space: nowrap;
}

.badge-admin {
  background: rgba(124, 92, 255, 0.16);
  border: 1px solid rgba(124, 92, 255, 0.36);
  color: #c9b8ff;
}

.badge-user {
  background: #151921;
  border: 1px solid var(--line);
  color: #b7bdd0;
}

.badge-active {
  background: rgba(75, 214, 154, 0.12);
  border: 1px solid rgba(75, 214, 154, 0.3);
  color: #7fe0b4;
}

.badge-disabled {
  background: rgba(255, 107, 122, 0.14);
  border: 1px solid rgba(255, 107, 122, 0.32);
  color: #ffb0b8;
}

.metric-grid .badge {
  display: inline-block;
  font-size: 13px;
  padding: 6px 12px;
}

.col-check {
  width: 38px;
}

.admin-table {
  min-width: 900px;
}

.admin-table th {
  white-space: nowrap;
}

.col-actions {
  white-space: nowrap;
}

.col-actions .table-action + .table-action {
  margin-left: 6px;
}

.metric-grid small {
  color: var(--muted-2);
  display: block;
  font-size: 10px;
  margin-top: 6px;
}

.pagination {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-size: 11px;
  gap: 12px;
  justify-content: flex-end;
  padding: 14px 19px;
}

.pagination .disabled {
  color: var(--muted-2);
  opacity: 0.55;
  pointer-events: none;
}

.amount-up {
  color: #7fe0b4;
}

.amount-down {
  color: #ffb0b8;
}

.admin-dialog {
  background: #0e1117;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  color: var(--text);
  max-width: 460px;
  padding: 0;
  width: calc(100% - 32px);
}

.admin-dialog::backdrop {
  background: rgba(4, 6, 9, 0.72);
  backdrop-filter: blur(2px);
}

.admin-dialog-body {
  display: grid;
  gap: 14px;
  padding: 20px 22px 22px;
}

.admin-dialog-body header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.admin-dialog-body h3 {
  font-size: 15px;
  margin: 0;
}

.dialog-close {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  padding: 4px 6px;
}

.dialog-close:hover {
  color: #fff;
}

.dialog-field {
  color: var(--muted);
  display: grid;
  font-size: 10px;
  gap: 6px;
}

.admin-form textarea {
  background: #0a0d12;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #e9ebef;
  font-family: inherit;
  font-size: 12px;
  padding: 11px 12px;
  resize: vertical;
}

.credit-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.credit-presets button {
  background: #151921;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #d5d8e0;
  font-size: 11px;
  padding: 7px 12px;
}

.credit-presets button:hover {
  border-color: var(--accent);
  color: #fff;
}

.admin-menu-list {
  display: grid;
  gap: 4px;
}

.admin-menu-list button {
  background: #12161e;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #d5d8e0;
  font-size: 12px;
  padding: 11px 13px;
  text-align: left;
}

.admin-menu-list button:hover {
  border-color: var(--line-strong);
  color: #fff;
}

.admin-menu-list .row-menu-danger {
  color: #ff9aa5;
}

.admin-menu-list .row-menu-danger:hover {
  border-color: rgba(255, 107, 122, 0.5);
  color: #fff;
}

.row-menu {
  display: inline-block;
  position: relative;
}

.row-menu > summary {
  cursor: pointer;
  list-style: none;
}

.row-menu > summary::-webkit-details-marker {
  display: none;
}

.row-menu[open] > summary {
  border-color: var(--line-strong);
  color: #fff;
}

.row-menu-panel {
  background: #0e1117;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.5);
  display: grid;
  gap: 2px;
  min-width: 180px;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
}

.row-menu-panel button {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #d5d8e0;
  font-size: 11px;
  padding: 9px 10px;
  text-align: left;
  white-space: nowrap;
}

.row-menu-panel button:hover {
  background: #151921;
  color: #fff;
}

.row-menu-panel .row-menu-danger {
  color: #ff9aa5;
}

.row-menu-panel .row-menu-danger:hover {
  background: rgba(255, 107, 122, 0.12);
  color: #fff;
}

/* ── Audit log ─────────────────────────────────────────────────────────── */

.audit-scope {
  align-items: center;
  background: rgba(124, 92, 255, 0.1);
  border: 1px solid rgba(124, 92, 255, 0.3);
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 12px;
  justify-content: space-between;
  margin-top: 15px;
  padding: 12px 18px;
}

.badge-module {
  background: #151921;
  border: 1px solid var(--line);
  color: #b7bdd0;
}

.audit-table {
  min-width: 900px;
}

.audit-table td {
  vertical-align: top;
}

.audit-table td:last-child {
  max-width: 360px;
  white-space: normal;
}

.col-nowrap {
  white-space: nowrap;
}

.audit-flag {
  background: rgba(255, 107, 122, 0.14);
  border: 1px solid rgba(255, 107, 122, 0.3);
  border-radius: 999px;
  color: #ffb0b8;
  display: inline-block;
  margin-top: 4px;
  padding: 3px 7px;
}

.audit-detail {
  margin-top: 6px;
}

.audit-detail summary {
  color: #c9b8ff;
  cursor: pointer;
  font-size: 10px;
  list-style: none;
}

.audit-detail summary::-webkit-details-marker {
  display: none;
}

.audit-detail summary::before {
  content: "▸ ";
}

.audit-detail[open] summary::before {
  content: "▾ ";
}

.audit-detail pre {
  background: #0a0d12;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #9fb0c9;
  font-size: 10px;
  line-height: 1.6;
  margin: 8px 0 0;
  max-height: 260px;
  overflow: auto;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Keep the tier selector in scale with the composer toolbar. */
.tier-picker { position: relative; }
.composer-submit .tier-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  width: auto;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #191d25;
  box-shadow: none;
  color: #b8bdc9;
  font-size: 12px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.composer-submit .tier-trigger:hover,
.composer-submit .tier-trigger[aria-expanded="true"] {
  background: #202530;
  border-color: rgba(143, 112, 255, .35);
  color: #d8dbe2;
}
.tier-chevron { color: #818898; font-size: 11px; }
.tier-dots { flex-shrink: 0; font-size: 18px; line-height: 1; color: #6999ff; }
.tier-dots.standard { color: #a579ff; }
.tier-dots.max { color: #ec70c6; }
.tier-options {
  position: absolute;
  bottom: 40px;
  right: 0;
  width: 280px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #151920;
  box-shadow: 0 12px 36px #0006;
  z-index: 50;
}
.tier-options.opens-down { bottom: auto; top: 40px; }
.tier-options > strong {
  display: block;
  padding: 6px 10px 8px;
  color: #9299a8;
  font-size: 11px;
  font-weight: 500;
}
.composer-submit .tier-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  height: auto;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}
.composer-submit .tier-option:hover:not(:disabled) { background: #1d222c; }
.composer-submit .tier-option.selected {
  background: rgba(143, 112, 255, .09);
  border-color: rgba(143, 112, 255, .24);
}
.composer-submit .tier-trigger:focus,
.composer-submit .tier-option:focus { outline: none; }
.composer-submit .tier-trigger:focus-visible,
.composer-submit .tier-option:focus-visible {
  outline: 2px solid rgba(143, 112, 255, .5);
  outline-offset: 2px;
}
.tier-option .tier-dots { margin-top: 2px; }
.tier-option b { display: block; color: #e2e4ec; font-weight: 600; margin-bottom: 3px; }
.tier-option small { display: block; color: #969eae; font-size: 11px; line-height: 1.6; }
.tier-option:disabled { opacity: .45; cursor: not-allowed; }
.tier-options p {
  margin: 8px -8px -8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: #818a9b;
  font-size: 10px;
  line-height: 1.5;
}
@media (max-width: 640px) {
  .tier-options { width: min(280px, calc(100vw - 48px)); right: -40px; }
  .composer-submit { gap: 8px; }
  .file-summary { display: none; }
}

[data-model-catalog-form] .admin-section > .admin-hint { margin: 16px 20px; }
[data-model-catalog-form] .admin-section > .admin-grid { margin: 20px; }
[data-model-catalog-form] .billing-card { margin: 12px 20px; padding: 16px; background: #0a0d12; border: 1px solid var(--line); border-radius: 10px; }
[data-model-catalog-form] label { font-size: 11px; }
[data-model-catalog-form] .price-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 14px; }
[data-model-catalog-form] .billing-card .admin-hint { margin: 12px 0 0; }
@media (max-width: 640px) { [data-model-catalog-form] .admin-grid.three, [data-model-catalog-form] .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } [data-model-catalog-form] .billing-card { margin: 12px; } }
