@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Rajdhani:wght@500;600;700&display=swap');

:root {
  --ts-bg: #f5f7fb;
  --ts-surface: #ffffff;
  --ts-surface-2: #eef2f7;
  --ts-line: #d8e0ea;
  --ts-line-strong: #b8c5d6;
  --ts-text: #101827;
  --ts-muted: #5c6a7f;
  --ts-soft: #e8eef6;
  --ts-primary: #1267d7;
  --ts-primary-strong: #0d4fa8;
  --ts-green: #16845b;
  --ts-red: #c43f45;
  --ts-yellow: #9d6b14;
  --ts-focus: rgba(18, 103, 215, 0.22);
  --ts-radius: 8px;
  --ts-shadow: 0 14px 42px rgba(20, 31, 48, 0.12);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ts-text);
  background: var(--ts-bg);
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--ts-bg);
  color: var(--ts-text);
  overflow-x: hidden;
}

body::before,
body::after {
  content: none !important;
  display: none !important;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

* {
  scrollbar-color: rgba(103, 232, 249, 0.5) rgba(2, 8, 18, 0.6);
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(2, 8, 18, 0.62);
}

*::-webkit-scrollbar-thumb {
  background: rgba(103, 232, 249, 0.44);
  border: 2px solid rgba(2, 8, 18, 0.62);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(103, 232, 249, 0.7);
}

input,
textarea,
select {
  -webkit-user-select: text;
  user-select: text;
  width: 100%;
  border: 1px solid var(--ts-line);
  border-radius: var(--ts-radius);
  background: #ffffff;
  color: var(--ts-text);
  outline: none;
  padding: 11px 12px;
  min-height: 44px;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--ts-primary);
  box-shadow: 0 0 0 4px var(--ts-focus);
}

strong {
  font-weight: 750;
}

.ts-app h1,
.ts-app h2,
.ts-app h3,
.ts-app h4,
.ts-app h5,
.ts-app h6 {
  font-family: inherit;
  text-transform: none;
  letter-spacing: 0;
}

.ts-app {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(245, 247, 251, 0.96)),
    repeating-linear-gradient(90deg, rgba(16, 24, 39, 0.035) 0, rgba(16, 24, 39, 0.035) 1px, transparent 1px, transparent 28px),
    repeating-linear-gradient(0deg, rgba(16, 24, 39, 0.028) 0, rgba(16, 24, 39, 0.028) 1px, transparent 1px, transparent 28px);
}

.ts-login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(245, 247, 251, 0.97)),
    repeating-linear-gradient(90deg, rgba(16, 24, 39, 0.04) 0, rgba(16, 24, 39, 0.04) 1px, transparent 1px, transparent 30px),
    repeating-linear-gradient(0deg, rgba(16, 24, 39, 0.032) 0, rgba(16, 24, 39, 0.032) 1px, transparent 1px, transparent 30px);
}

.ts-login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  background: var(--ts-surface);
  border: 1px solid var(--ts-line);
  border-radius: var(--ts-radius);
  box-shadow: var(--ts-shadow);
  padding: 22px;
}

.ts-login-panel h1 {
  margin: -6px 0 4px;
  font-size: clamp(28px, 7vw, 38px);
  line-height: 1;
  letter-spacing: 0;
}

.ts-login-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--ts-primary);
  border-radius: var(--ts-radius);
}

.ts-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.ts-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 247, 251, 0.92);
  backdrop-filter: blur(10px);
  padding: 10px 0;
}

.ts-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.ts-brand > span {
  width: 42px;
  height: 42px;
  border-radius: var(--ts-radius);
  background: var(--ts-primary);
  color: #ffffff;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.ts-brand p,
.ts-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--ts-muted);
  font-weight: 750;
}

.ts-brand h1,
.ts-screen-head h2,
.ts-detail-title h2,
.ts-panel-head h3,
.ts-hero h2 {
  margin: 0;
  letter-spacing: 0;
}

.ts-brand h1 {
  font-size: clamp(20px, 4vw, 28px);
}

.ts-header-actions,
.ts-action-row,
.ts-card-actions,
.ts-detail-head-actions,
.ts-modal-foot {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ts-main {
  padding: 8px 0 40px;
}

.ts-loading {
  position: sticky;
  top: 74px;
  z-index: 15;
  padding: 10px 12px;
  border: 1px solid #aacaf1;
  background: #e9f3ff;
  color: #164878;
  border-radius: var(--ts-radius);
  font-weight: 700;
  margin: 4px 0 12px;
}

.ts-button,
.ts-icon-button {
  min-height: 40px;
  border-radius: var(--ts-radius);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  font-weight: 750;
  color: var(--ts-text);
  background: var(--ts-soft);
  text-decoration: none;
  white-space: nowrap;
}

.ts-button.small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.ts-button.large {
  min-height: 50px;
  padding: 0 18px;
  font-size: 15px;
}

.ts-button.primary {
  background: var(--ts-primary);
  border-color: var(--ts-primary);
  color: #ffffff;
}

.ts-button.primary:hover {
  background: var(--ts-primary-strong);
}

.ts-button.soft {
  background: #ffffff;
  border-color: var(--ts-line);
}

.ts-button.danger,
.ts-button.danger-soft {
  color: #ffffff;
  background: var(--ts-red);
  border-color: var(--ts-red);
}

.ts-button.danger-soft {
  color: #9c252d;
  background: #fff0f0;
  border-color: #f2c7ca;
}

.ts-icon-button {
  width: 40px;
  padding: 0;
}

.ts-icon {
  width: var(--ts-icon-size);
  height: var(--ts-icon-size);
  flex: 0 0 var(--ts-icon-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  position: relative;
  --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 4h16v16H4z'/%3E%3Cpath d='M8 8h8M8 12h8M8 16h5'/%3E%3C/svg%3E");
}

.ts-icon::before {
  content: '';
  width: 100%;
  height: 100%;
  display: block;
  background: currentColor;
  mask: var(--ts-mask);
  -webkit-mask: var(--ts-mask);
  mask-size: contain;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-position: center;
}

.ts-icon[data-icon='template'] { --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 4h16v16H4z'/%3E%3Cpath d='M8 8h8M8 12h8M8 16h5'/%3E%3C/svg%3E"); }
.ts-icon[data-icon='lock'] { --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='11' x='3' y='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E"); }
.ts-icon[data-icon='upload'] { --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 16V4'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3Cpath d='M4 20h16'/%3E%3C/svg%3E"); }
.ts-icon[data-icon='sync'] { --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 11a8 8 0 0 0-14-5l-2 2'/%3E%3Cpath d='M4 4v4h4'/%3E%3Cpath d='M4 13a8 8 0 0 0 14 5l2-2'/%3E%3Cpath d='M20 20v-4h-4'/%3E%3C/svg%3E"); }
.ts-icon[data-icon='check'] { --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m5 12 4.5 4.5L19 7'/%3E%3C/svg%3E"); }
.ts-icon[data-icon='edit'] { --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E"); }
.ts-icon[data-icon='hide'] { --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m3 3 18 18'/%3E%3Cpath d='M10.6 10.6A2 2 0 0 0 13.4 13.4'/%3E%3Cpath d='M9.9 4.2A10.5 10.5 0 0 1 12 4c5 0 9 5 10 8a13 13 0 0 1-2.2 3.6'/%3E%3Cpath d='M6.1 6.1A13 13 0 0 0 2 12c1 3 5 8 10 8a10.5 10.5 0 0 0 4.1-.8'/%3E%3C/svg%3E"); }
.ts-icon[data-icon='trash'] { --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4h8v2'/%3E%3Cpath d='M19 6l-1 14H6L5 6'/%3E%3Cpath d='M10 11v5M14 11v5'/%3E%3C/svg%3E"); }
.ts-icon[data-icon='restore'] { --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 12a9 9 0 1 0 3-6.7'/%3E%3Cpath d='M3 4v6h6'/%3E%3C/svg%3E"); }
.ts-icon[data-icon='back'] { --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E"); }
.ts-icon[data-icon='replace'] { --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21 12a9 9 0 0 1-15 6.7'/%3E%3Cpath d='M3 12a9 9 0 0 1 15-6.7'/%3E%3Cpath d='M18 3v5h-5'/%3E%3Cpath d='M6 21v-5h5'/%3E%3C/svg%3E"); }
.ts-icon[data-icon='layers'] { --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12 2 9 5-9 5-9-5Z'/%3E%3Cpath d='m3 12 9 5 9-5'/%3E%3Cpath d='m3 17 9 5 9-5'/%3E%3C/svg%3E"); }
.ts-icon[data-icon='file'] { --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E"); }
.ts-icon[data-icon='box'] { --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m21 8-9-5-9 5 9 5 9-5Z'/%3E%3Cpath d='M3 8v8l9 5 9-5V8'/%3E%3Cpath d='M12 13v8'/%3E%3C/svg%3E"); }
.ts-icon[data-icon='help'] { --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M9.1 9a3 3 0 1 1 5.2 2c-.8.8-1.3 1.2-1.8 2.4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E"); }
.ts-icon[data-icon='arrow-up'] { --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12 19V5'/%3E%3Cpath d='m5 12 7-7 7 7'/%3E%3C/svg%3E"); }
.ts-icon[data-icon='arrow-down'] { --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 5v14'/%3E%3Cpath d='m19 12-7 7-7-7'/%3E%3C/svg%3E"); }
.ts-icon[data-icon='arrow-left'] { --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19 12H5'/%3E%3Cpath d='m12 19-7-7 7-7'/%3E%3C/svg%3E"); }
.ts-icon[data-icon='arrow-right'] { --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m12 5 7 7-7 7'/%3E%3C/svg%3E"); }
.ts-icon[data-icon='plus'] { --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 5v14'/%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E"); }
.ts-icon[data-icon='minus'] { --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E"); }
.ts-icon[data-icon='rotate-left'] { --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 7v6h6'/%3E%3Cpath d='M20 17a8 8 0 0 0-14-5.3L4 13'/%3E%3C/svg%3E"); }
.ts-icon[data-icon='rotate-right'] { --ts-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 7v6h-6'/%3E%3Cpath d='M4 17a8 8 0 0 1 14-5.3l2 1.3'/%3E%3C/svg%3E"); }

.ts-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: end;
  background: var(--ts-surface);
  border: 1px solid var(--ts-line);
  border-radius: var(--ts-radius);
  box-shadow: var(--ts-shadow);
  padding: clamp(18px, 4vw, 28px);
}

.ts-hero h2 {
  font-size: clamp(28px, 6vw, 52px);
  line-height: 1;
  max-width: 760px;
}

.ts-hero p:last-child {
  margin: 12px 0 0;
  color: var(--ts-muted);
  line-height: 1.55;
  max-width: 760px;
}

.ts-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.ts-stat {
  min-height: 84px;
  border: 1px solid var(--ts-line);
  background: var(--ts-surface);
  border-radius: var(--ts-radius);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.ts-stat span {
  color: var(--ts-muted);
  font-weight: 700;
}

.ts-stat strong {
  font-size: 28px;
}

.ts-home-grid,
.ts-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 12px;
  margin-top: 12px;
}

.ts-detail-grid {
  grid-template-columns: 330px minmax(0, 1fr);
  align-items: start;
}

.ts-panel,
.ts-template-card,
.ts-empty,
.ts-modal-panel {
  border: 1px solid var(--ts-line);
  background: var(--ts-surface);
  border-radius: var(--ts-radius);
}

.ts-panel {
  padding: 16px;
}

.ts-panel-head,
.ts-screen-head,
.ts-detail-head,
.ts-card-title-row,
.ts-component-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ts-panel-head {
  margin-bottom: 14px;
}

.ts-home-steps {
  display: grid;
  gap: 8px;
}

.ts-home-step {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--ts-line);
  background: #fbfcfe;
  border-radius: var(--ts-radius);
  min-height: 48px;
  padding: 8px 10px;
}

.ts-home-step span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ts-primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.ts-mini-list {
  display: grid;
  gap: 8px;
}

.ts-mini-list button {
  min-height: 52px;
  border: 1px solid var(--ts-line);
  border-radius: var(--ts-radius);
  background: #fbfcfe;
  padding: 10px;
  text-align: left;
  display: grid;
  gap: 4px;
}

.ts-mini-list small,
.ts-card-meta,
.ts-muted,
.ts-note,
.ts-field small,
.ts-component-title span,
.ts-variant span,
.ts-layout-item span {
  color: var(--ts-muted);
}

.ts-screen-head {
  align-items: center;
  margin-bottom: 12px;
}

.ts-screen-head h2,
.ts-detail-title h2 {
  font-size: clamp(26px, 6vw, 44px);
  line-height: 1;
}

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

.ts-tabs button,
.ts-segment button,
.ts-flow-switcher button {
  border: 1px solid var(--ts-line);
  background: #ffffff;
  color: var(--ts-text);
  border-radius: var(--ts-radius);
  min-height: 42px;
  font-weight: 750;
}

.ts-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ts-tabs button.is-active,
.ts-segment button.is-active,
.ts-flow-switcher button.is-active {
  background: #eaf3ff;
  border-color: var(--ts-primary);
  color: var(--ts-primary-strong);
}

.ts-tabs span {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--ts-soft);
  display: inline-grid;
  place-items: center;
  font-size: 12px;
}

.ts-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 12px;
}

.ts-template-card {
  padding: 10px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
}

.ts-template-card.is-live {
  border-color: rgba(22, 132, 91, 0.45);
}

.ts-template-card.is-trash {
  border-color: rgba(196, 63, 69, 0.45);
}

.ts-card-preview-button {
  border: 0;
  background: transparent;
  padding: 0;
}

.ts-template-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ts-card-title-row button {
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  font-weight: 800;
  color: var(--ts-text);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ts-card-meta {
  display: grid;
  gap: 3px;
  font-size: 13px;
  line-height: 1.35;
}

.ts-card-actions {
  margin-top: auto;
}

.ts-chip {
  min-height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  font-size: 12px;
  line-height: 1;
  border: 1px solid var(--ts-line);
  color: var(--ts-muted);
  background: #ffffff;
  font-weight: 750;
  white-space: nowrap;
}

.ts-chip.good {
  color: #0d5f40;
  border-color: #b7e0cf;
  background: #ecfbf5;
}

.ts-chip.bad {
  color: #a2252d;
  border-color: #f1c4c8;
  background: #fff0f1;
}

.ts-chip.warn {
  color: #7a520f;
  border-color: #ecd6a8;
  background: #fff8e8;
}

.ts-detail-head {
  align-items: center;
  margin-bottom: 12px;
}

.ts-detail-title {
  min-width: 0;
  flex: 1;
}

.ts-detail-title h2 {
  overflow-wrap: anywhere;
}

.ts-detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ts-studio-topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.ts-workflow-shell {
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr) minmax(260px, 330px);
  gap: 12px;
  align-items: start;
}

.ts-workflow-rail {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 8px;
}

.ts-workflow-rail-item {
  min-height: 74px;
  border: 1px solid var(--ts-line);
  border-radius: var(--ts-radius);
  background: #ffffff;
  color: var(--ts-text);
  padding: 10px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-areas:
    "num label"
    "num state";
  gap: 3px 8px;
  align-items: center;
  text-align: left;
}

.ts-workflow-rail-item span {
  grid-area: num;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ts-soft);
  color: var(--ts-muted);
  font-size: 12px;
  font-weight: 900;
}

.ts-workflow-rail-item strong {
  grid-area: label;
  font-size: 13px;
  line-height: 1.1;
}

.ts-workflow-rail-item small {
  grid-area: state;
  color: var(--ts-muted);
  font-size: 11px;
  font-weight: 800;
}

.ts-workflow-rail-item.is-done span {
  color: #ffffff;
  background: var(--ts-green);
}

.ts-workflow-rail-item.is-active {
  border-color: var(--ts-primary);
  background: #eaf3ff;
  box-shadow: inset 4px 0 0 var(--ts-primary);
}

.ts-workflow-stage,
.ts-workflow-dock {
  border: 1px solid var(--ts-line);
  border-radius: var(--ts-radius);
  background: #ffffff;
}

.ts-workflow-stage {
  min-height: 640px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.ts-workflow-stage-head,
.ts-workflow-footer,
.ts-dock-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ts-workflow-stage-head {
  padding: 14px;
  border-bottom: 1px solid var(--ts-line);
  background: #fbfcfe;
}

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

.ts-workflow-stage-head h3 {
  margin: 0;
  font-size: 26px;
}

.ts-workflow-stage-body {
  padding: 14px;
  min-width: 0;
}

.ts-workflow-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--ts-line);
  background: #fbfcfe;
}

.ts-workflow-footer .ts-button {
  width: auto;
}

.ts-workflow-dock {
  position: sticky;
  top: 86px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.ts-dock-preview-head strong {
  display: block;
  font-size: 16px;
}

.ts-progress {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(94px, 1fr));
  gap: 6px;
}

.ts-progress-step {
  min-height: 70px;
  border-radius: var(--ts-radius);
  border: 1px solid var(--ts-line);
  background: #ffffff;
  padding: 8px 6px;
  display: grid;
  place-items: center;
  gap: 5px;
  text-align: center;
}

.ts-progress-step span {
  min-width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ts-soft);
  color: var(--ts-muted);
  font-size: 12px;
  font-weight: 800;
}

.ts-progress-step strong {
  font-size: 12px;
  line-height: 1.15;
}

.ts-progress-step.is-done span {
  color: #ffffff;
  background: var(--ts-green);
}

.ts-progress-step.is-active {
  border-color: var(--ts-primary);
  background: #eaf3ff;
}

.ts-sidebar {
  position: sticky;
  top: 86px;
}

.ts-preview {
  aspect-ratio: 1;
  width: 100%;
  border: 1px solid var(--ts-line);
  border-radius: var(--ts-radius);
  background:
    linear-gradient(45deg, #eef3f9 25%, transparent 25%),
    linear-gradient(-45deg, #eef3f9 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef3f9 75%),
    linear-gradient(-45deg, transparent 75%, #eef3f9 75%),
    #ffffff;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.ts-lottie-stage,
.ts-lottie-host,
.ts-preview lottie-player {
  width: 100%;
  height: 100%;
}

.ts-lottie-stage {
  position: relative;
  display: grid;
  place-items: center;
}

.ts-preview-sync-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  min-height: 26px;
  max-width: calc(100% - 20px);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(18, 103, 215, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ts-primary-strong);
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ts-preview-sync-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
  animation: tsSyncPulse 0.9s ease-in-out infinite;
}

.ts-preview-sync-badge.is-adjusted {
  border-color: rgba(157, 107, 20, 0.28);
  color: var(--ts-yellow);
}

.ts-preview-sync-badge.is-fallback {
  border-color: rgba(92, 106, 127, 0.28);
  color: var(--ts-muted);
}

.ts-preview-sync-badge.is-error {
  border-color: rgba(196, 63, 69, 0.32);
  color: var(--ts-red);
}

.ts-preview-safe-frame {
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 1px solid rgba(22, 132, 91, 0.38);
  pointer-events: none;
}

.ts-preview-safe-frame::before,
.ts-preview-safe-frame::after {
  content: '';
  position: absolute;
  inset: 9px;
  border: 1px dashed rgba(22, 132, 91, 0.34);
}

.ts-preview-safe-frame::after {
  inset: 18px;
  border-color: rgba(22, 132, 91, 0.18);
}

.ts-preview-safe-frame.is-danger {
  border-color: rgba(196, 63, 69, 0.82);
  background: rgba(196, 63, 69, 0.08);
}

.ts-preview-safe-frame.is-danger::before,
.ts-preview-safe-frame.is-danger::after {
  border-color: rgba(196, 63, 69, 0.72);
}

.ts-layout-live-preview .ts-preview-safe-frame,
.ts-layer-live-preview .ts-preview-safe-frame {
  inset: 12px;
}

.ts-preview-bounds-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 4;
  min-height: 28px;
  max-width: calc(100% - 20px);
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(22, 132, 91, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ts-green);
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0.02em;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ts-preview-bounds-badge.is-danger {
  border-color: rgba(196, 63, 69, 0.36);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ts-red);
}

@keyframes tsSyncPulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.75);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.ts-lottie-host {
  position: absolute;
  inset: 0;
}

.ts-lottie-host svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
  overflow: visible !important;
}

.ts-layout-live-preview .ts-lottie-host,
.ts-layer-live-preview .ts-lottie-host {
  inset: 12px;
}

.ts-preview-empty {
  color: var(--ts-muted);
  display: grid;
  place-items: center;
  gap: 8px;
  font-weight: 700;
}

.ts-preview-meta {
  border: 1px solid var(--ts-line);
  background: #fbfcfe;
  border-radius: var(--ts-radius);
  padding: 12px;
  margin-top: 10px;
}

.ts-preview-meta p {
  margin: 6px 0 0;
  color: var(--ts-muted);
  white-space: pre-line;
}

.ts-flow-switcher,
.ts-segment {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.ts-segment {
  margin-top: 0;
}

.ts-segment.bucket {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

.ts-segment.bucket span {
  display: inline-block;
  margin-left: 4px;
  color: var(--ts-muted);
}

.ts-segment.layout button,
.ts-segment.line button {
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 6px;
}

.ts-segment.layout span {
  color: var(--ts-muted);
  font-size: 11px;
  font-weight: 750;
}

.ts-variant-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.ts-variant,
.ts-layout-item {
  border: 1px solid var(--ts-line);
  border-radius: var(--ts-radius);
  background: #fbfcfe;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ts-variant.is-active {
  border-color: var(--ts-primary);
  background: #eaf3ff;
}

.ts-variant div,
.ts-layout-item div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ts-work-panel {
  min-height: 530px;
}

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

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

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

.ts-field {
  display: grid;
  gap: 7px;
}

.ts-field > span,
.ts-section-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--ts-text);
  margin: 0 0 8px;
}

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

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

.ts-option,
.ts-info-button,
.ts-setting-card {
  min-height: 90px;
  border: 1px solid var(--ts-line);
  background: #fbfcfe;
  border-radius: var(--ts-radius);
  padding: 12px;
  text-align: left;
  display: grid;
  align-content: center;
  gap: 6px;
}

.ts-option.is-active,
.ts-info-button:hover {
  border-color: var(--ts-primary);
  background: #eaf3ff;
}

.ts-option span,
.ts-info-button span,
.ts-setting-card span {
  color: var(--ts-muted);
  font-size: 13px;
}

.ts-info-button strong,
.ts-setting-card strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.ts-setting-card .ts-button {
  justify-self: start;
}

.ts-preview-text-box,
.ts-issue-box,
.ts-good-box,
.ts-note {
  border-radius: var(--ts-radius);
  border: 1px solid var(--ts-line);
  background: #fbfcfe;
  padding: 14px;
}

.ts-preview-text-box {
  display: grid;
  gap: 8px;
}

.ts-preview-text-box span {
  color: var(--ts-muted);
  font-size: 13px;
  font-weight: 800;
}

.ts-preview-text-box strong {
  font-size: 22px;
  line-height: 1.2;
  white-space: pre-line;
}

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

.ts-preset-card {
  min-height: 128px;
  border: 1px solid var(--ts-line);
  border-radius: var(--ts-radius);
  background: #fbfcfe;
  padding: 14px;
  display: grid;
  gap: 8px;
  align-content: center;
}

.ts-preset-card.is-active {
  border-color: var(--ts-primary);
  background: #eaf3ff;
}

.ts-preset-card span,
.ts-preset-card small {
  color: var(--ts-muted);
  font-size: 13px;
  font-weight: 750;
}

.ts-preset-card strong {
  font-size: 24px;
  line-height: 1.12;
  white-space: pre-line;
}

.ts-issue-box {
  border-color: #f1c4c8;
  background: #fff5f5;
  color: #8d2028;
}

.ts-issue-box strong {
  display: block;
  margin-bottom: 8px;
}

.ts-issue-box p {
  margin: 5px 0;
}

.ts-good-box {
  border-color: #b7e0cf;
  background: #eefbf6;
  color: #0d5f40;
  font-weight: 750;
}

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

.ts-color-button {
  min-height: 40px;
  border: 1px solid var(--ts-line);
  background: #ffffff;
  border-radius: var(--ts-radius);
  font-weight: 750;
  text-transform: capitalize;
}

.ts-color-button.is-active {
  border-color: var(--ts-primary);
  background: #eaf3ff;
  color: var(--ts-primary-strong);
}

.ts-stroke-color-control {
  border: 1px solid var(--ts-line);
  background: #ffffff;
  border-radius: var(--ts-radius);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.ts-stroke-color-control.compact {
  border: 0;
  background: transparent;
  padding: 0;
}

.ts-stroke-color-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ts-stroke-color-head span,
.ts-stroke-color-custom span {
  color: var(--ts-muted);
  font-size: 12px;
  font-weight: 800;
}

.ts-stroke-color-head strong {
  color: var(--ts-text);
  font-size: 13px;
}

.ts-stroke-color-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.ts-stroke-swatch {
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--ts-line);
  background: #ffffff;
  border-radius: var(--ts-radius);
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  font-weight: 800;
}

.ts-stroke-swatch span {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(14, 31, 52, 0.18);
  border-radius: 50%;
  background:
    linear-gradient(45deg, #d8e2ef 25%, transparent 25%),
    linear-gradient(-45deg, #d8e2ef 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d8e2ef 75%),
    linear-gradient(-45deg, transparent 75%, #d8e2ef 75%);
  background-color: #ffffff;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  background-size: 18px 18px;
}

.ts-stroke-swatch small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ts-stroke-swatch.is-active {
  border-color: var(--ts-primary);
  background: #eaf3ff;
  color: var(--ts-primary-strong);
}

.ts-stroke-color-custom {
  min-height: 38px;
  border: 1px solid var(--ts-line);
  background: #ffffff;
  border-radius: var(--ts-radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
}

.ts-stroke-color-custom input {
  width: 44px;
  height: 28px;
  border: 0;
  background: transparent;
  padding: 0;
}

.ts-component-list,
.ts-layout-list {
  display: grid;
  gap: 10px;
}

.ts-layer-preview-card {
  border: 1px solid var(--ts-line);
  background: #fbfcfe;
  border-radius: var(--ts-radius);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.ts-layer-live-preview {
  min-height: 220px;
  max-height: 280px;
}

.ts-layer-preview-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 20px;
  line-height: 1.2;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.ts-layer-preview-card span {
  color: var(--ts-muted);
  line-height: 1.45;
}

.ts-component {
  border: 1px solid var(--ts-line);
  background: #fbfcfe;
  border-radius: var(--ts-radius);
  padding: 12px;
}

.ts-component-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.ts-component-field-card {
  border: 1px solid var(--ts-line);
  background: #ffffff;
  border-radius: var(--ts-radius);
  padding: 10px;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.ts-component-field-card.position {
  grid-row: span 2;
}

.ts-component-field-card.color {
  align-content: start;
}

.ts-component-field-card > span {
  color: var(--ts-muted);
  font-size: 12px;
  font-weight: 850;
}

.ts-component-field-card > strong {
  font-size: 16px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.ts-component-actions {
  display: grid;
  gap: 6px;
}

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

.ts-component-actions button,
.ts-component-nudge button {
  min-height: 38px;
  border: 1px solid var(--ts-line);
  background: var(--ts-soft);
  color: var(--ts-text);
  border-radius: var(--ts-radius);
  font-weight: 800;
}

.ts-component-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
  min-width: 0;
}

.ts-component-nudge {
  width: min(184px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-auto-rows: 38px;
  justify-content: start;
  gap: 5px;
}

.ts-component-nudge button {
  display: grid;
  place-items: center;
}

.ts-component-actions button:hover,
.ts-component-nudge button:hover {
  border-color: var(--ts-primary);
  background: #eaf3ff;
}

.ts-layout-item.is-ready {
  border-color: #b7e0cf;
}

.ts-layout-item.is-required:not(.is-ready) {
  border-color: #f1c4c8;
}

.ts-layout-editor {
  border: 1px solid var(--ts-line);
  background: #fbfcfe;
  border-radius: var(--ts-radius);
  padding: 14px;
  display: grid;
  gap: 14px;
}

.ts-layout-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ts-layout-editor-head .ts-section-label {
  margin-bottom: 4px;
}

.ts-layout-editor-head span:not(.ts-chip) {
  color: var(--ts-muted);
  white-space: pre-line;
}

.ts-layout-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ts-layout-control {
  border: 1px solid var(--ts-line);
  background: #ffffff;
  border-radius: var(--ts-radius);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.ts-layout-control label {
  font-size: 12px;
  color: var(--ts-muted);
  font-weight: 800;
}

.ts-stepper {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  gap: 6px;
  align-items: center;
}

.ts-stepper button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--ts-line);
  border-radius: var(--ts-radius);
  background: var(--ts-soft);
  color: var(--ts-text);
  font-size: 18px;
  font-weight: 800;
}

.ts-stepper input {
  min-height: 38px;
  padding: 8px;
  text-align: center;
}

.ts-layout-current {
  border: 1px solid var(--ts-line);
  border-radius: var(--ts-radius);
  background: #ffffff;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.ts-layout-current span {
  color: var(--ts-muted);
  font-size: 12px;
  font-weight: 800;
}

.ts-layout-current strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.ts-layout-workflow {
  gap: 12px;
}

.ts-layout-modebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.58fr);
  gap: 8px;
}

.ts-layout-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(280px, 0.95fr);
  gap: 12px;
  align-items: start;
}

.ts-layout-preview-card,
.ts-layout-control-panel {
  border: 1px solid var(--ts-line);
  background: #fbfcfe;
  border-radius: var(--ts-radius);
  padding: 12px;
  display: grid;
  gap: 12px;
}

.ts-layout-preview-head,
.ts-layout-control-head,
.ts-layout-actionbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ts-layout-preview-head .ts-section-label {
  margin-bottom: 5px;
}

.ts-layout-preview-head strong {
  display: block;
  font-size: 17px;
  line-height: 1.25;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.ts-layout-live-preview {
  min-height: 280px;
  background-size: 18px 18px;
}

.ts-metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.ts-metric-strip span {
  min-height: 52px;
  border: 1px solid var(--ts-line);
  background: #ffffff;
  border-radius: var(--ts-radius);
  display: grid;
  place-items: center;
  gap: 2px;
  color: var(--ts-muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.ts-metric-strip b {
  color: var(--ts-text);
  font-size: 15px;
}

.ts-layout-control-head h4 {
  margin: 0;
  font-size: 20px;
}

.ts-nudge-pad {
  width: min(260px, 100%);
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(3, 64px);
  grid-auto-rows: 56px;
  justify-content: center;
  gap: 7px;
}

.ts-nudge-pad span {
  min-height: 56px;
}

.ts-nudge-pad button,
.ts-quick-controls button {
  min-height: 44px;
  border: 1px solid var(--ts-line);
  background: #ffffff;
  color: var(--ts-text);
  border-radius: var(--ts-radius);
  font-weight: 800;
}

.ts-nudge-pad button {
  display: grid;
  place-items: center;
}

.ts-nudge-pad button:hover,
.ts-quick-controls button:hover {
  border-color: var(--ts-primary);
  background: #eaf3ff;
}

.ts-quick-controls {
  display: grid;
  gap: 8px;
}

.ts-quick-controls > div {
  display: grid;
  grid-template-columns: 72px repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
}

.ts-quick-controls > div:last-child {
  grid-template-columns: 72px repeat(4, minmax(0, 1fr));
}

.ts-quick-controls span {
  color: var(--ts-muted);
  font-size: 12px;
  font-weight: 800;
}

.ts-quick-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px;
  min-width: 0;
  white-space: nowrap;
}

.ts-layout-actionbar {
  align-items: center;
}

.ts-layout-actionbar .ts-button {
  flex: 1;
}

.ts-link {
  color: var(--ts-primary);
  font-weight: 800;
}

.ts-empty {
  padding: 24px;
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 12px;
}

.ts-empty h3 {
  margin: 0;
  font-size: 22px;
}

.ts-empty p {
  margin: 6px 0 0;
  color: var(--ts-muted);
  max-width: 460px;
}

.ts-empty-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: var(--ts-radius);
  color: var(--ts-primary);
  background: #eaf3ff;
}

.ts-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(16, 24, 39, 0.62);
  display: grid;
  place-items: center;
  padding: 14px;
}

.ts-modal-panel {
  width: min(760px, 100%);
  max-height: min(88vh, 900px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  box-shadow: var(--ts-shadow);
  overflow: hidden;
}

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

.ts-modal-head p,
.ts-modal-head h2 {
  margin: 0;
}

.ts-modal-head p {
  color: var(--ts-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.ts-modal-head h2 {
  font-size: 24px;
}

.ts-modal-body {
  padding: 16px;
  overflow-y: auto;
}

.ts-modal-foot {
  justify-content: flex-end;
  padding: 14px 16px;
  border-top: 1px solid var(--ts-line);
  background: #fbfcfe;
}

.ts-upload-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
}

.ts-upload-zone {
  min-height: 260px;
  border: 1px dashed var(--ts-line-strong);
  border-radius: var(--ts-radius);
  background: #fbfcfe;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--ts-muted);
  font-weight: 800;
  position: relative;
  overflow: hidden;
}

.ts-upload-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.ts-toggle {
  min-height: 44px;
  border: 1px solid var(--ts-line);
  border-radius: var(--ts-radius);
  background: #ffffff;
  color: var(--ts-text);
  font-weight: 800;
}

.ts-toggle.is-active {
  border-color: #9fd7c2;
  background: #eefbf6;
  color: #0d5f40;
}

.ts-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 120;
  width: min(520px, calc(100vw - 24px));
  border: 1px solid #b7e0cf;
  background: #eefbf6;
  color: #0d5f40;
  border-radius: var(--ts-radius);
  padding: 12px 12px 12px 14px;
  box-shadow: var(--ts-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 750;
}

.ts-toast.is-error {
  border-color: #f1c4c8;
  background: #fff2f2;
  color: #9c252d;
}

.ts-toast button {
  width: 32px;
  height: 32px;
  border-radius: var(--ts-radius);
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
}

@media (max-width: 900px) {
  .ts-home-grid,
  .ts-detail-grid,
  .ts-workflow-shell,
  .ts-layout-workspace,
  .ts-layout-modebar,
  .ts-upload-grid {
    grid-template-columns: 1fr;
  }

  .ts-workflow-rail,
  .ts-workflow-dock {
    position: static;
  }

  .ts-workflow-rail {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ts-workflow-rail-item {
    min-height: 64px;
  }

  .ts-sidebar {
    position: static;
    order: 2;
  }

  .ts-work-panel {
    order: 1;
  }

  .ts-preview {
    max-height: 320px;
  }

  .ts-layout-live-preview {
    max-height: none;
  }

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

@media (max-width: 680px) {
  .ts-shell {
    padding: 10px;
  }

  .ts-header {
    align-items: stretch;
    flex-direction: column;
  }

  .ts-header-actions,
  .ts-detail-head-actions,
  .ts-card-actions,
  .ts-action-row {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ts-studio-topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .ts-workflow-stage {
    min-height: 0;
  }

  .ts-workflow-stage-head {
    display: grid;
    align-items: start;
  }

  .ts-workflow-stage-head h3 {
    font-size: 22px;
  }

  .ts-workflow-stage-body {
    padding: 12px;
  }

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

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

  .ts-workflow-rail-item {
    min-height: 58px;
    padding: 8px;
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 2px 7px;
  }

  .ts-workflow-rail-item span {
    width: 26px;
    height: 26px;
  }

  .ts-workflow-rail-item strong {
    font-size: 12px;
  }

  .ts-button {
    width: 100%;
  }

  .ts-hero {
    grid-template-columns: 1fr;
  }

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

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

  .ts-card-grid,
  .ts-form-grid.two,
  .ts-option-grid,
  .ts-preset-grid,
  .ts-component-fields,
  .ts-layer-preview-card,
  .ts-metric-strip,
  .ts-layout-control-grid,
  .ts-color-grid,
  .ts-segment.bucket {
    grid-template-columns: 1fr;
  }

  .ts-component-field-card.position {
    grid-row: auto;
  }

  .ts-layout-editor-head {
    display: grid;
  }

  .ts-layout-preview-head,
  .ts-layout-control-head,
  .ts-layout-actionbar {
    display: grid;
  }

  .ts-nudge-pad {
    grid-template-columns: repeat(3, minmax(54px, 64px));
    grid-auto-rows: 52px;
  }

  .ts-quick-controls > div,
  .ts-quick-controls > div:last-child {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ts-quick-controls span {
    grid-column: 1 / -1;
  }

  .ts-template-card {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .ts-detail-head,
  .ts-screen-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .ts-modal {
    align-items: end;
    padding: 0;
  }

  .ts-modal-panel {
    width: 100%;
    max-height: 92vh;
    border-radius: var(--ts-radius) var(--ts-radius) 0 0;
  }
}

/* Blueprint workbench theme */
:root {
  --ts-bg: #040b16;
  --ts-surface: rgba(8, 20, 36, 0.92);
  --ts-surface-2: rgba(11, 30, 52, 0.92);
  --ts-line: rgba(103, 232, 249, 0.18);
  --ts-line-strong: rgba(125, 211, 252, 0.42);
  --ts-text: #e8f7ff;
  --ts-muted: #91a7bd;
  --ts-soft: rgba(15, 35, 59, 0.94);
  --ts-primary: #2f8cff;
  --ts-primary-strong: #67e8f9;
  --ts-green: #22c55e;
  --ts-red: #fb7185;
  --ts-yellow: #fbbf24;
  --ts-focus: rgba(103, 232, 249, 0.18);
  --ts-radius: 6px;
  --ts-shadow: 0 22px 70px rgba(0, 0, 0, 0.36);
  color-scheme: dark;
}

html {
  background: #040b16;
}

body {
  background:
    linear-gradient(180deg, rgba(4, 11, 22, 0.92), rgba(5, 14, 28, 0.98)),
    repeating-linear-gradient(90deg, rgba(103, 232, 249, 0.07) 0, rgba(103, 232, 249, 0.07) 1px, transparent 1px, transparent 40px),
    repeating-linear-gradient(0deg, rgba(103, 232, 249, 0.055) 0, rgba(103, 232, 249, 0.055) 1px, transparent 1px, transparent 40px),
    #040b16;
  color: var(--ts-text);
}

input,
textarea,
select {
  border-color: var(--ts-line);
  background: rgba(2, 8, 18, 0.76);
  color: var(--ts-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

input::placeholder,
textarea::placeholder {
  color: rgba(145, 167, 189, 0.78);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--ts-primary-strong);
  box-shadow: 0 0 0 3px var(--ts-focus), 0 0 24px rgba(47, 140, 255, 0.16);
}

.ts-app {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(4, 11, 22, 0.68), rgba(4, 11, 22, 0.96)),
    linear-gradient(90deg, rgba(47, 140, 255, 0.11) 0 1px, transparent 1px 100%),
    linear-gradient(0deg, rgba(47, 140, 255, 0.09) 0 1px, transparent 1px 100%),
    linear-gradient(90deg, rgba(103, 232, 249, 0.11) 0 1px, transparent 1px 100%),
    linear-gradient(0deg, rgba(103, 232, 249, 0.09) 0 1px, transparent 1px 100%);
  background-size: auto, 44px 44px, 44px 44px, 176px 176px, 176px 176px;
  color: var(--ts-text);
}

.ts-shell {
  width: min(1480px, 100%);
  padding: 16px 22px 44px;
}

.ts-header {
  top: 0;
  min-height: 70px;
  padding: 10px 0 12px;
  background: linear-gradient(180deg, rgba(4, 11, 22, 0.98), rgba(4, 11, 22, 0.76));
  border-bottom: 1px solid rgba(103, 232, 249, 0.18);
  backdrop-filter: blur(14px);
}

.ts-brand {
  color: var(--ts-text);
}

.ts-brand > span,
.ts-login-mark,
.ts-empty-icon {
  background:
    linear-gradient(135deg, rgba(47, 140, 255, 0.95), rgba(103, 232, 249, 0.72));
  border: 1px solid rgba(125, 211, 252, 0.72);
  box-shadow: 0 0 24px rgba(47, 140, 255, 0.28);
  color: #ffffff;
}

.ts-brand h1,
.ts-screen-head h2,
.ts-detail-title h2,
.ts-hero h2,
.ts-workflow-stage-head h3,
.ts-panel-head h3 {
  font-family: Rajdhani, Inter, system-ui, sans-serif;
  font-weight: 700;
}

.ts-brand h1 {
  font-size: clamp(22px, 2.2vw, 34px);
}

.ts-kicker,
.ts-brand p,
.ts-modal-head p {
  color: #67e8f9;
  letter-spacing: 0.08em;
}

.ts-loading {
  border-color: rgba(103, 232, 249, 0.38);
  background: rgba(8, 20, 36, 0.96);
  color: #dff8ff;
  box-shadow: var(--ts-shadow);
}

.ts-button,
.ts-icon-button,
.ts-tabs button,
.ts-segment button,
.ts-flow-switcher button,
.ts-component-actions button,
.ts-component-nudge button,
.ts-nudge-pad button,
.ts-quick-controls button,
.ts-stepper button,
.ts-toggle {
  border-color: rgba(125, 211, 252, 0.2);
  background: linear-gradient(180deg, rgba(15, 35, 59, 0.96), rgba(7, 18, 32, 0.96));
  color: var(--ts-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ts-button:hover,
.ts-icon-button:hover,
.ts-tabs button:hover,
.ts-segment button:hover,
.ts-flow-switcher button:hover,
.ts-component-actions button:hover,
.ts-component-nudge button:hover,
.ts-nudge-pad button:hover,
.ts-quick-controls button:hover {
  border-color: rgba(103, 232, 249, 0.62);
  background: linear-gradient(180deg, rgba(19, 51, 86, 0.98), rgba(8, 28, 50, 0.98));
  color: #f8fdff;
}

.ts-button.primary {
  border-color: rgba(125, 211, 252, 0.72);
  background: linear-gradient(180deg, #1f83ff, #1654d8);
  color: #ffffff;
  box-shadow: 0 0 22px rgba(47, 140, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.ts-button.primary:hover {
  background: linear-gradient(180deg, #44c2ff, #1f6ff2);
}

.ts-button.soft {
  background: rgba(8, 20, 36, 0.86);
  border-color: rgba(125, 211, 252, 0.24);
}

.ts-button.danger,
.ts-button.danger-soft {
  border-color: rgba(251, 113, 133, 0.56);
  background: linear-gradient(180deg, rgba(225, 29, 72, 0.95), rgba(127, 29, 29, 0.92));
  color: #fff5f6;
}

.ts-button.danger-soft {
  background: rgba(61, 17, 31, 0.84);
  color: #fecdd3;
}

.ts-hero,
.ts-panel,
.ts-template-card,
.ts-empty,
.ts-modal-panel,
.ts-workflow-stage,
.ts-workflow-dock,
.ts-layout-preview-card,
.ts-layout-control-panel,
.ts-layout-editor,
.ts-layer-preview-card,
.ts-component,
.ts-option,
.ts-info-button,
.ts-setting-card,
.ts-preview-text-box,
.ts-stroke-color-control,
.ts-note,
.ts-preset-card,
.ts-layout-control,
.ts-layout-current,
.ts-preview-meta,
.ts-login-panel {
  border-color: var(--ts-line);
  background:
    linear-gradient(180deg, rgba(10, 25, 43, 0.94), rgba(5, 14, 27, 0.92)),
    linear-gradient(90deg, rgba(103, 232, 249, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(103, 232, 249, 0.035) 1px, transparent 1px);
  background-size: auto, 24px 24px, 24px 24px;
  box-shadow: var(--ts-shadow);
}

.ts-hero {
  align-items: center;
  min-height: 220px;
  border-color: rgba(103, 232, 249, 0.26);
  background:
    linear-gradient(135deg, rgba(12, 34, 59, 0.96), rgba(4, 12, 24, 0.96)),
    linear-gradient(90deg, rgba(103, 232, 249, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(103, 232, 249, 0.05) 1px, transparent 1px);
  background-size: auto, 32px 32px, 32px 32px;
}

.ts-hero h2 {
  max-width: 880px;
  font-size: clamp(42px, 5.2vw, 72px);
}

.ts-hero p:last-child,
.ts-empty p,
.ts-preview-meta p,
.ts-muted,
.ts-note,
.ts-field small,
.ts-card-meta,
.ts-mini-list small,
.ts-option span,
.ts-info-button span,
.ts-setting-card span,
.ts-preset-card span,
.ts-preset-card small,
.ts-component-title span,
.ts-layout-item span,
.ts-variant span,
.ts-layout-control label,
.ts-layout-editor-head span:not(.ts-chip),
.ts-layout-current span,
.ts-layout-preview-head .ts-section-label,
.ts-quick-controls span,
.ts-metric-strip span,
.ts-preview-empty {
  color: var(--ts-muted);
}

.ts-stat {
  border-color: rgba(125, 211, 252, 0.18);
  background: linear-gradient(180deg, rgba(10, 25, 43, 0.92), rgba(5, 14, 27, 0.92));
  box-shadow: var(--ts-shadow);
}

.ts-stat:hover,
.ts-mini-list button:hover,
.ts-template-card:hover,
.ts-option:hover,
.ts-preset-card:hover,
.ts-layout-item:hover {
  border-color: rgba(103, 232, 249, 0.5);
}

.ts-stat span,
.ts-tabs span {
  color: var(--ts-muted);
}

.ts-stat strong {
  color: #e8f7ff;
  font-family: Rajdhani, Inter, system-ui, sans-serif;
  font-size: 36px;
}

.ts-home-step,
.ts-mini-list button,
.ts-tabs button,
.ts-variant,
.ts-layout-item,
.ts-progress-step,
.ts-component-field-card,
.ts-metric-strip span,
.ts-upload-zone,
.ts-color-button {
  border-color: rgba(125, 211, 252, 0.18);
  background: rgba(3, 11, 22, 0.54);
  color: var(--ts-text);
}

.ts-stroke-color-control.compact {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.ts-stroke-swatch,
.ts-stroke-color-custom {
  border-color: rgba(125, 211, 252, 0.18);
  background: rgba(3, 11, 22, 0.54);
  color: var(--ts-text);
}

.ts-stroke-swatch span {
  border-color: rgba(226, 244, 255, 0.34);
}

.ts-home-step span,
.ts-progress-step span,
.ts-workflow-rail-item span {
  background: rgba(47, 140, 255, 0.18);
  border: 1px solid rgba(103, 232, 249, 0.32);
  color: #b9f4ff;
}

.ts-tabs button.is-active,
.ts-segment button.is-active,
.ts-flow-switcher button.is-active,
.ts-option.is-active,
.ts-info-button:hover,
.ts-preset-card.is-active,
.ts-color-button.is-active,
.ts-stroke-swatch.is-active,
.ts-variant.is-active {
  border-color: rgba(103, 232, 249, 0.72);
  background: linear-gradient(180deg, rgba(23, 76, 126, 0.94), rgba(7, 29, 54, 0.94));
  color: #e8f7ff;
  box-shadow: inset 0 0 0 1px rgba(103, 232, 249, 0.14), 0 0 22px rgba(47, 140, 255, 0.14);
}

.ts-tabs button.is-active span {
  background: rgba(103, 232, 249, 0.18);
  color: #e8f7ff;
}

.ts-chip {
  border-color: rgba(125, 211, 252, 0.26);
  background: rgba(7, 18, 32, 0.88);
  color: #b9d8eb;
}

.ts-chip.good,
.ts-toggle.is-active,
.ts-good-box {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(20, 83, 45, 0.38);
  color: #bbf7d0;
}

.ts-chip.bad,
.ts-issue-box {
  border-color: rgba(251, 113, 133, 0.54);
  background: rgba(76, 5, 25, 0.56);
  color: #fecdd3;
}

.ts-chip.warn {
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(113, 63, 18, 0.38);
  color: #fde68a;
}

.ts-studio-topbar {
  position: relative;
  padding: 14px;
  border: 1px solid rgba(103, 232, 249, 0.2);
  border-radius: var(--ts-radius);
  background:
    linear-gradient(180deg, rgba(8, 20, 36, 0.88), rgba(5, 14, 27, 0.8)),
    linear-gradient(90deg, rgba(103, 232, 249, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(103, 232, 249, 0.04) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
}

.ts-detail-title h2,
.ts-screen-head h2 {
  font-size: clamp(34px, 3.8vw, 58px);
}

.ts-workflow-screen {
  display: grid;
  gap: 14px;
}

.ts-workflow-shell {
  grid-template-columns: 210px minmax(0, 1fr) minmax(320px, 390px);
  gap: 14px;
}

.ts-workflow-rail {
  top: 92px;
  padding: 10px;
  border: 1px solid rgba(103, 232, 249, 0.18);
  border-radius: var(--ts-radius);
  background: rgba(4, 12, 24, 0.76);
  box-shadow: var(--ts-shadow);
}

.ts-workflow-rail-item {
  min-height: 78px;
  border-color: rgba(125, 211, 252, 0.16);
  background: rgba(8, 20, 36, 0.74);
  color: var(--ts-text);
}

.ts-workflow-rail-item strong {
  color: #e8f7ff;
  font-size: 14px;
}

.ts-workflow-rail-item small {
  color: var(--ts-muted);
}

.ts-workflow-rail-item.is-done span {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(34, 197, 94, 0.55);
  color: #bbf7d0;
}

.ts-workflow-rail-item.is-active {
  border-color: rgba(103, 232, 249, 0.72);
  background: linear-gradient(90deg, rgba(47, 140, 255, 0.26), rgba(7, 18, 32, 0.92));
  box-shadow: inset 4px 0 0 #67e8f9, 0 0 24px rgba(47, 140, 255, 0.18);
}

.ts-workflow-stage {
  min-height: calc(100vh - 146px);
  overflow: hidden;
}

.ts-workflow-stage-head,
.ts-workflow-footer,
.ts-dock-preview-head,
.ts-modal-head,
.ts-modal-foot {
  border-color: rgba(125, 211, 252, 0.16);
  background: rgba(3, 11, 22, 0.58);
}

.ts-workflow-stage-head {
  padding: 16px 18px;
}

.ts-workflow-stage-head h3 {
  font-size: clamp(30px, 2.8vw, 44px);
}

.ts-workflow-stage-body {
  padding: 18px;
}

.ts-workflow-footer {
  padding: 14px 18px;
}

.ts-workflow-dock {
  top: 92px;
  padding: 14px;
}

.ts-dock-preview-head strong {
  color: #f8fdff;
  font-family: Rajdhani, Inter, system-ui, sans-serif;
  font-size: 22px;
}

.ts-preview {
  border-color: rgba(103, 232, 249, 0.3);
  background:
    linear-gradient(90deg, rgba(103, 232, 249, 0.11) 1px, transparent 1px),
    linear-gradient(0deg, rgba(103, 232, 249, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 140, 255, 0.12) 1px, transparent 1px),
    linear-gradient(0deg, rgba(47, 140, 255, 0.1) 1px, transparent 1px),
    rgba(1, 7, 15, 0.9);
  background-size: 20px 20px, 20px 20px, 100px 100px, 100px 100px, auto;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035), inset 0 0 55px rgba(47, 140, 255, 0.12);
}

.ts-lottie-host svg {
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.34));
}

.ts-preview-empty {
  color: #9edfed;
}

.ts-preview-sync-badge {
  border-color: rgba(103, 232, 249, 0.32);
  background: rgba(4, 14, 28, 0.86);
  color: #9edfed;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.ts-preview-sync-badge.is-adjusted {
  border-color: rgba(251, 191, 36, 0.38);
  color: #fde68a;
}

.ts-preview-sync-badge.is-fallback {
  border-color: rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
}

.ts-preview-sync-badge.is-error {
  border-color: rgba(251, 113, 133, 0.44);
  color: #fecdd3;
}

.ts-preview-safe-frame {
  border-color: rgba(34, 197, 94, 0.38);
}

.ts-preview-safe-frame::before,
.ts-preview-safe-frame::after {
  border-color: rgba(34, 197, 94, 0.34);
}

.ts-preview-safe-frame.is-danger {
  border-color: rgba(251, 113, 133, 0.88);
  background: rgba(127, 29, 29, 0.16);
}

.ts-preview-safe-frame.is-danger::before,
.ts-preview-safe-frame.is-danger::after {
  border-color: rgba(251, 113, 133, 0.82);
}

.ts-preview-bounds-badge {
  border-color: rgba(34, 197, 94, 0.36);
  background: rgba(4, 14, 28, 0.86);
  color: #bbf7d0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.ts-preview-bounds-badge.is-danger {
  border-color: rgba(251, 113, 133, 0.48);
  background: rgba(76, 5, 25, 0.76);
  color: #fecdd3;
}

.ts-preview-meta strong,
.ts-preview-text-box strong,
.ts-setting-card strong,
.ts-preset-card strong,
.ts-layer-preview-card strong,
.ts-component-title strong,
.ts-component-field-card > strong,
.ts-layout-preview-head strong,
.ts-layout-control-head h4,
.ts-layout-current strong,
.ts-metric-strip b,
.ts-card-title-row button,
.ts-mini-list button span {
  color: #f5fbff;
}

.ts-preview-text-box strong,
.ts-preset-card strong {
  font-family: Rajdhani, Inter, system-ui, sans-serif;
  letter-spacing: 0;
}

.ts-segment.layout,
.ts-segment.line,
.ts-flow-switcher {
  padding: 5px;
  border: 1px solid rgba(103, 232, 249, 0.14);
  border-radius: var(--ts-radius);
  background: rgba(2, 8, 18, 0.62);
}

.ts-segment.bucket {
  grid-template-columns: repeat(5, minmax(84px, 1fr));
  padding: 5px;
  border: 1px solid rgba(103, 232, 249, 0.14);
  border-radius: var(--ts-radius);
  background: rgba(2, 8, 18, 0.62);
}

.ts-segment.layout span,
.ts-segment.bucket span {
  color: #9edfed;
}

.ts-step-stack {
  gap: 16px;
}

.ts-work-panel {
  min-height: 580px;
}

.ts-option,
.ts-setting-card,
.ts-preview-text-box,
.ts-preset-card,
.ts-note {
  box-shadow: none;
}

.ts-form-grid.two,
.ts-preset-grid {
  gap: 12px;
}

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

.ts-color-button {
  min-height: 44px;
  min-width: 0;
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: capitalize;
}

.ts-layer-preview-card {
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  align-items: stretch;
}

.ts-layer-live-preview {
  min-height: 260px;
  max-height: 320px;
}

.ts-component {
  padding: 14px;
}

.ts-component-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ts-component-field-card.position {
  grid-row: span 2;
}

.ts-component-field-card {
  background: rgba(2, 8, 18, 0.54);
}

.ts-component-actions button,
.ts-component-nudge button,
.ts-nudge-pad button,
.ts-quick-controls button {
  min-height: 40px;
}

.ts-component-nudge {
  width: min(190px, 100%);
  grid-template-columns: repeat(3, 46px);
  grid-auto-rows: 40px;
}

.ts-layout-workflow {
  gap: 14px;
}

.ts-layout-modebar {
  grid-template-columns: minmax(0, 1fr) minmax(210px, 0.46fr);
}

.ts-layout-workspace {
  grid-template-columns: minmax(420px, 1.08fr) minmax(320px, 0.92fr);
  gap: 14px;
}

.ts-layout-preview-card,
.ts-layout-control-panel {
  padding: 14px;
  box-shadow: none;
}

.ts-layout-live-preview {
  min-height: 420px;
}

.ts-nudge-pad {
  width: min(300px, 100%);
  grid-template-columns: repeat(3, 72px);
  grid-auto-rows: 62px;
}

.ts-quick-controls > div {
  grid-template-columns: 78px repeat(2, minmax(0, 1fr));
}

.ts-quick-controls > div:last-child {
  grid-template-columns: 78px repeat(4, minmax(0, 1fr));
}

.ts-layout-actionbar .ts-button {
  min-height: 46px;
}

.ts-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}

.ts-template-card {
  grid-template-columns: 112px minmax(0, 1fr);
}

.ts-template-card .ts-preview {
  min-height: 112px;
}

.ts-template-card.is-live {
  border-color: rgba(34, 197, 94, 0.48);
}

.ts-template-card.is-trash {
  border-color: rgba(251, 113, 133, 0.48);
}

.ts-card-actions .ts-button {
  min-width: 104px;
}

.ts-modal {
  background: rgba(1, 7, 15, 0.76);
  backdrop-filter: blur(10px);
}

.ts-modal-panel {
  border-color: rgba(103, 232, 249, 0.28);
}

.ts-modal-body {
  background: rgba(3, 11, 22, 0.38);
}

.ts-upload-zone {
  border-color: rgba(103, 232, 249, 0.34);
  background:
    linear-gradient(90deg, rgba(103, 232, 249, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(103, 232, 249, 0.06) 1px, transparent 1px),
    rgba(1, 7, 15, 0.74);
  background-size: 24px 24px;
}

.ts-login-screen {
  background:
    linear-gradient(180deg, rgba(4, 11, 22, 0.82), rgba(4, 11, 22, 0.98)),
    repeating-linear-gradient(90deg, rgba(103, 232, 249, 0.07) 0, rgba(103, 232, 249, 0.07) 1px, transparent 1px, transparent 40px),
    repeating-linear-gradient(0deg, rgba(103, 232, 249, 0.055) 0, rgba(103, 232, 249, 0.055) 1px, transparent 1px, transparent 40px);
}

.ts-login-panel h1 {
  font-family: Rajdhani, Inter, system-ui, sans-serif;
  color: #f5fbff;
}

.ts-toast {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(20, 83, 45, 0.94);
  color: #dcfce7;
}

.ts-toast.is-error {
  border-color: rgba(251, 113, 133, 0.56);
  background: rgba(76, 5, 25, 0.96);
  color: #ffe4e6;
}

@media (min-width: 1180px) {
  .ts-main {
    padding-top: 12px;
  }

  .ts-home-grid {
    grid-template-columns: minmax(360px, 0.72fr) minmax(520px, 1.28fr);
  }

  .ts-panel {
    padding: 18px;
  }

  .ts-workflow-stage-body {
    overflow: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 302px);
  }

  .ts-workflow-dock {
    max-height: calc(100vh - 106px);
    overflow: auto;
  }

  .ts-workflow-rail {
    max-height: calc(100vh - 106px);
    overflow: auto;
  }
}

@media (min-width: 1440px) {
  .ts-workflow-shell {
    grid-template-columns: 230px minmax(0, 1fr) minmax(360px, 430px);
    gap: 16px;
  }

  .ts-layout-workspace {
    grid-template-columns: minmax(520px, 1.12fr) minmax(360px, 0.88fr);
  }

  .ts-layout-live-preview {
    min-height: 500px;
  }
}

@media (max-width: 1100px) {
  .ts-shell {
    padding: 12px;
  }

  .ts-workflow-shell,
  .ts-layout-workspace,
  .ts-layout-modebar {
    grid-template-columns: 1fr;
  }

  .ts-workflow-rail,
  .ts-workflow-dock {
    position: static;
  }

  .ts-workflow-rail {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

@media (max-width: 680px) {
  .ts-shell {
    padding: 10px;
  }

  .ts-hero {
    min-height: 0;
  }

  .ts-hero h2 {
    font-size: clamp(34px, 11vw, 46px);
  }

  .ts-workflow-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px;
  }

  .ts-detail-title h2,
  .ts-screen-head h2 {
    font-size: clamp(30px, 10vw, 42px);
  }

  .ts-component-fields,
  .ts-layer-preview-card,
  .ts-card-grid,
  .ts-color-grid,
  .ts-segment.bucket {
    grid-template-columns: 1fr;
  }

  .ts-layout-live-preview {
    min-height: 300px;
  }

  .ts-template-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .ts-pack-test-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1699px) {
  .ts-layout-modebar,
  .ts-layout-workspace {
    grid-template-columns: 1fr;
  }

  .ts-layout-live-preview {
    min-height: 360px;
  }
}

@media (min-width: 1700px) {
  .ts-layout-modebar {
    grid-template-columns: minmax(0, 1fr) minmax(210px, 0.46fr);
  }

  .ts-layout-workspace {
    grid-template-columns: minmax(520px, 1.12fr) minmax(360px, 0.88fr);
  }
}

/* Full desktop work area: preview left, controls right */
@media (min-width: 1110px) {
  .ts-shell {
    width: 100%;
    max-width: none;
    padding: 6px 14px 8px;
  }

  .ts-main {
    padding: 4px 0 0;
  }

  .ts-header {
    min-height: 44px;
    padding: 4px 0 5px;
  }

  .ts-brand {
    gap: 8px;
  }

  .ts-brand > span {
    width: 34px;
    height: 34px;
  }

  .ts-brand p {
    display: none;
  }

  .ts-brand h1 {
    font-size: 24px;
    line-height: 1;
  }

  .ts-header-actions .ts-button {
    min-height: 34px;
    padding: 0 10px;
  }

  .ts-detail-screen.ts-workflow-screen {
    height: calc(100vh - 62px);
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 6px;
    overflow: hidden;
  }

  .ts-detail-screen .ts-studio-topbar {
    margin-bottom: 0;
    min-height: 42px;
    padding: 4px 8px;
    gap: 8px;
  }

  .ts-detail-screen .ts-studio-topbar .ts-kicker {
    display: none;
  }

  .ts-detail-title h2 {
    font-size: clamp(22px, 1.9vw, 30px);
    line-height: 0.95;
  }

  .ts-detail-chips {
    display: none;
  }

  .ts-chip {
    min-height: 22px;
    padding: 0 7px;
    font-size: 10px;
  }

  .ts-detail-head-actions .ts-button,
  .ts-studio-topbar > .ts-button {
    min-height: 30px;
    padding: 0 8px;
  }

  .ts-workflow-shell {
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 6px;
    overflow: hidden;
  }

  .ts-workflow-dock {
    display: none;
  }

  .ts-workflow-rail {
    position: relative;
    top: auto;
    z-index: 5;
    max-height: none;
    overflow: visible;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    padding: 4px;
  }

  .ts-workflow-rail-item {
    min-height: 34px;
    padding: 4px 7px;
    grid-template-columns: 22px minmax(0, 1fr);
    grid-template-areas: "num label";
    gap: 2px 8px;
    box-shadow: none;
  }

  .ts-workflow-rail-item span {
    width: 22px;
    height: 22px;
    font-size: 10px;
  }

  .ts-workflow-rail-item strong {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ts-workflow-rail-item small {
    display: none;
  }

  .ts-workflow-rail-item.is-active {
    box-shadow: inset 0 -3px 0 #67e8f9, 0 0 18px rgba(47, 140, 255, 0.18);
  }

  .ts-workflow-stage {
    min-height: 0;
    height: 100%;
  }

  .ts-workflow-stage-head {
    padding: 5px 10px;
    align-items: center;
  }

  .ts-workflow-stage-head .ts-kicker {
    display: none;
  }

  .ts-workflow-stage-head h3 {
    font-size: clamp(20px, 1.4vw, 24px);
    line-height: 1;
  }

  .ts-workflow-stage-actions .ts-button {
    min-height: 30px;
    padding: 0 8px;
  }

  .ts-workflow-stage-body {
    padding: 10px;
  }

  .ts-layout-preview-card,
  .ts-layout-control-panel,
  .ts-layer-preview-card,
  .ts-layer-control-panel {
    padding: 10px;
  }

  .ts-workflow-stage-body {
    overflow: auto;
    overflow-x: hidden;
    max-height: none;
    min-height: 0;
  }

  .ts-workflow-stage.is-split-step .ts-workflow-stage-body {
    overflow: hidden;
  }

  .ts-workflow-stage.is-split-step .ts-workflow-stage-body > .ts-step-stack,
  .ts-workflow-stage.is-split-step .ts-workflow-stage-body > .ts-split-editor {
    min-height: 0;
    height: 100%;
  }

  .ts-workflow-stage.is-split-step .ts-workflow-stage-body > .ts-step-stack {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .ts-workflow-stage.is-split-step .ts-split-editor {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .ts-layout-modebar {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.34fr);
  }

  .ts-layout-workspace {
    grid-template-columns: minmax(460px, 0.9fr) minmax(420px, 0.72fr);
    gap: 14px;
    align-items: stretch;
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  .ts-layout-preview-card,
  .ts-layer-preview-card {
    position: relative;
    top: auto;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    align-content: start;
  }

  .ts-layout-live-preview {
    min-height: 0;
    height: min(58vh, 620px);
  }

  .ts-layout-control-panel {
    min-height: 0;
    height: 100%;
    overflow: auto;
    align-content: start;
    gap: 10px;
  }

  .ts-layout-extra-controls {
    display: grid;
    gap: 12px;
  }

  .ts-layout-extra-controls .ts-form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ts-layer-workbench {
    display: grid;
    grid-template-columns: minmax(420px, 0.82fr) minmax(520px, 1fr);
    gap: 14px;
    align-items: stretch;
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  .ts-layer-preview-card {
    grid-template-columns: 1fr;
  }

  .ts-layer-live-preview {
    min-height: 0;
    height: min(58vh, 640px);
    max-height: none;
  }

  .ts-layer-control-panel {
    display: grid;
    gap: 12px;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: auto;
    align-content: start;
  }

  .ts-layer-control-panel .ts-component-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .ts-nudge-pad {
    width: min(260px, 100%);
    grid-template-columns: repeat(3, 62px);
    grid-auto-rows: 52px;
  }

  .ts-quick-controls > div {
    min-height: 40px;
  }
}

.ts-test-grid {
  display: grid;
  gap: 10px;
}

.ts-pack-test-panel {
  border: 1px solid rgba(103, 232, 249, 0.26);
  border-radius: var(--ts-radius);
  background: rgba(2, 8, 18, 0.54);
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  min-height: 260px;
  align-content: center;
}

.ts-pack-test-panel > div:first-child {
  display: grid;
  gap: 8px;
}

.ts-pack-test-panel > div:first-child span {
  width: max-content;
  border: 1px solid rgba(103, 232, 249, 0.38);
  border-radius: 999px;
  color: #a5f3fc;
  background: rgba(8, 47, 73, 0.42);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.ts-pack-test-panel strong {
  color: #f5fbff;
  font-size: 24px;
  line-height: 1.1;
}

.ts-pack-test-panel p {
  margin: 0;
  color: var(--ts-muted);
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ts-pack-test-status {
  min-height: 44px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--ts-radius);
  background: rgba(15, 23, 42, 0.64);
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: #e2e8f0;
  font-weight: 850;
}

.ts-pack-test-panel.is-ready .ts-pack-test-status {
  border-color: rgba(34, 197, 94, 0.45);
  color: #bbf7d0;
  background: rgba(20, 83, 45, 0.34);
}

.ts-pack-test-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ts-pack-test-actions .ts-button {
  min-height: 48px;
}

.ts-test-card {
  min-height: 96px;
  border: 1px solid var(--ts-line);
  border-radius: var(--ts-radius);
  background: rgba(2, 8, 18, 0.54);
  padding: 12px;
  display: grid;
  align-content: center;
  gap: 5px;
}

.ts-test-card span {
  width: max-content;
  border: 1px solid rgba(251, 191, 36, 0.45);
  border-radius: 999px;
  padding: 3px 8px;
  color: #fde68a;
  background: rgba(113, 63, 18, 0.36);
  font-size: 11px;
  font-weight: 850;
}

.ts-test-card.is-ok span {
  border-color: rgba(34, 197, 94, 0.5);
  color: #bbf7d0;
  background: rgba(20, 83, 45, 0.42);
}

.ts-test-card strong {
  color: #f5fbff;
}

.ts-test-card small {
  color: var(--ts-muted);
  font-weight: 750;
}

.ts-recolor-control {
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: var(--ts-radius);
  background:
    linear-gradient(180deg, rgba(10, 25, 43, 0.92), rgba(5, 14, 27, 0.9)),
    linear-gradient(90deg, rgba(103, 232, 249, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(103, 232, 249, 0.035) 1px, transparent 1px);
  background-size: auto, 22px 22px, 22px 22px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.ts-recolor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ts-recolor-head .ts-section-label {
  margin: 0;
}

.ts-recolor-head span {
  border: 1px solid rgba(103, 232, 249, 0.3);
  border-radius: 999px;
  background: rgba(8, 47, 73, 0.38);
  color: #a5f3fc;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.ts-recolor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 8px;
}

.ts-recolor-button {
  min-height: 58px;
  min-width: 0;
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: var(--ts-radius);
  background: rgba(2, 8, 18, 0.52);
  color: var(--ts-text);
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 3px 8px;
  padding: 9px;
  text-align: left;
}

.ts-recolor-button:hover {
  border-color: rgba(103, 232, 249, 0.62);
  background: rgba(8, 28, 50, 0.78);
}

.ts-recolor-button.is-active {
  border-color: rgba(168, 85, 247, 0.82);
  background: linear-gradient(180deg, rgba(91, 33, 182, 0.78), rgba(49, 46, 129, 0.72));
  color: #ffffff;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.22), inset 0 0 0 1px rgba(216, 180, 254, 0.18);
}

.ts-recolor-swatch {
  grid-row: 1 / span 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(2, 8, 18, 0.42);
}

.ts-recolor-button strong,
.ts-recolor-button small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ts-recolor-button strong {
  font-size: 12px;
  font-weight: 900;
}

.ts-recolor-button small {
  color: var(--ts-muted);
  font-size: 11px;
  font-weight: 800;
}

.ts-recolor-button.is-active small {
  color: #e9d5ff;
}

.ts-recolor-empty {
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: var(--ts-radius);
  color: var(--ts-muted);
  padding: 12px;
  font-weight: 750;
}

@media (min-width: 1700px) {
  .ts-layout-workspace {
    grid-template-columns: minmax(620px, 1fr) minmax(500px, 0.72fr);
  }

  .ts-layer-workbench {
    grid-template-columns: minmax(560px, 0.86fr) minmax(650px, 1fr);
  }

  .ts-layout-live-preview,
  .ts-layer-live-preview {
    min-height: 0;
    height: min(60vh, 700px);
  }
}

.buyer-app {
  min-height: 100vh;
  color: #e9f7ff;
  background:
    linear-gradient(180deg, rgba(4, 11, 22, 0.74), rgba(4, 11, 22, 0.97)),
    linear-gradient(90deg, rgba(55, 199, 255, 0.1) 1px, transparent 1px),
    linear-gradient(0deg, rgba(85, 255, 184, 0.06) 1px, transparent 1px),
    #040b16;
  background-size: auto, 38px 38px, 38px 38px, auto;
  padding: 14px;
}

.buyer-topbar {
  width: min(1180px, 100%);
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.buyer-topbar > div:first-child {
  min-width: 0;
}

.buyer-topbar p,
.buyer-preview-head p,
.buyer-field span,
.buyer-color-head > span,
.buyer-balance span,
.buyer-template-picker span {
  margin: 0;
  color: #8fb1c8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.buyer-topbar h1,
.buyer-preview-head h2 {
  margin: 0;
  letter-spacing: 0;
}

.buyer-topbar h1 {
  font-size: clamp(24px, 7vw, 42px);
  line-height: 1;
}

.buyer-balance {
  min-width: 128px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 8px;
  background: rgba(5, 14, 27, 0.78);
  padding: 10px 12px;
  text-align: right;
}

.buyer-balance strong {
  display: block;
  margin-top: 2px;
  color: #bbf7d0;
  font-size: 16px;
}

.buyer-topbar-actions {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 8px;
}

.buyer-help-trigger {
  min-height: 56px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 8px;
  background: rgba(5, 14, 27, 0.78);
  color: #e9f7ff;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.buyer-help-trigger:hover {
  border-color: rgba(85, 255, 184, 0.45);
  background: rgba(8, 47, 73, 0.86);
}

.buyer-help-trigger .ts-icon {
  color: #7dd3fc;
}

.buyer-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(340px, 1.08fr);
  gap: 14px;
  align-items: start;
}

.buyer-preview-pane,
.buyer-editor-pane {
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 8px;
  background: rgba(5, 14, 27, 0.84);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

.buyer-preview-pane {
  position: sticky;
  top: 12px;
  overflow: hidden;
}

.buyer-preview-head {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid rgba(125, 211, 252, 0.16);
}

.buyer-preview-head h2 {
  font-size: clamp(17px, 5vw, 24px);
  line-height: 1.12;
}

.buyer-preview-head > span {
  flex: 0 0 auto;
  border: 1px solid rgba(34, 197, 94, 0.34);
  border-radius: 999px;
  color: #bbf7d0;
  background: rgba(22, 101, 52, 0.18);
  padding: 6px 9px;
  font-weight: 800;
  font-size: 12px;
}

.buyer-live-preview {
  height: min(62vh, 560px);
  min-height: 320px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(125, 211, 252, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(125, 211, 252, 0.06) 1px, transparent 1px),
    rgba(2, 8, 18, 0.7);
  background-size: 28px 28px;
}

.buyer-live-preview .ts-lottie-stage,
.buyer-live-preview .ts-lottie-host {
  height: 100%;
}

.buyer-live-preview .ts-lottie-host svg {
  max-width: 100%;
  max-height: 100%;
}

.buyer-insight-panel {
  border-top: 1px solid rgba(125, 211, 252, 0.16);
  background: rgba(3, 10, 21, 0.62);
  padding: 12px;
}

.buyer-insight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.buyer-insight-head p {
  margin: 0 0 2px;
  color: #8fb1c8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.buyer-insight-head h3 {
  margin: 0;
  color: #f5fbff;
  font-size: 15px;
  line-height: 1.15;
  letter-spacing: 0;
}

.buyer-insight-head > span {
  flex: 0 0 auto;
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 999px;
  color: #b6d6e8;
  background: rgba(10, 25, 43, 0.86);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 800;
}

.buyer-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.38), rgba(22, 163, 74, 0.18));
  color: #e0f2fe;
  font-size: 13px;
  font-weight: 900;
}

.buyer-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.buyer-avatar--small {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  border-radius: 7px;
  font-size: 11px;
}

.buyer-rank-list,
.buyer-review-list {
  display: grid;
  gap: 8px;
}

.buyer-rank-row {
  display: grid;
  grid-template-columns: 26px 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  border: 1px solid rgba(125, 211, 252, 0.13);
  border-radius: 8px;
  background: rgba(2, 8, 18, 0.54);
  padding: 6px 8px;
}

.buyer-rank-row.is-top {
  border-color: rgba(250, 204, 21, 0.26);
  background: linear-gradient(135deg, rgba(113, 63, 18, 0.26), rgba(2, 8, 18, 0.62));
}

.buyer-rank-number {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(125, 211, 252, 0.1);
  color: #e0f2fe;
  font-size: 12px;
  font-weight: 900;
}

.buyer-rank-row.is-top .buyer-rank-number {
  background: rgba(250, 204, 21, 0.18);
  color: #fde68a;
}

.buyer-rank-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.buyer-rank-copy strong,
.buyer-review-meta strong {
  min-width: 0;
  overflow: hidden;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buyer-rank-copy span,
.buyer-review-meta span,
.buyer-review-stats span {
  color: #8fb1c8;
  font-size: 11px;
  font-weight: 750;
}

.buyer-rank-total {
  color: #bbf7d0;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.buyer-review-panel {
  border: 1px solid rgba(125, 211, 252, 0.16);
  border-radius: 8px;
  background: rgba(2, 8, 18, 0.44);
}

.buyer-review-card {
  border: 1px solid rgba(125, 211, 252, 0.13);
  border-radius: 8px;
  background: rgba(5, 14, 27, 0.68);
  padding: 9px;
}

.buyer-review-card.is-pinned {
  border-color: rgba(85, 255, 184, 0.22);
  background: linear-gradient(135deg, rgba(20, 83, 45, 0.2), rgba(5, 14, 27, 0.72));
}

.buyer-review-main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.buyer-review-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.buyer-review-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.buyer-review-meta span {
  flex: 0 0 auto;
}

.buyer-review-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #dcebf5;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.buyer-review-stats {
  display: flex;
  gap: 8px;
  margin-top: 7px;
  padding-left: 38px;
}

.buyer-insight-empty,
.buyer-rank-skeleton,
.buyer-review-skeleton {
  border: 1px dashed rgba(125, 211, 252, 0.18);
  border-radius: 8px;
  color: #8fb1c8;
  background: rgba(2, 8, 18, 0.36);
}

.buyer-insight-empty {
  padding: 12px;
  font-size: 12px;
  font-weight: 750;
}

.buyer-rank-skeleton {
  height: 48px;
}

.buyer-review-skeleton {
  height: 76px;
}

.buyer-empty-preview {
  min-height: 320px;
  display: grid;
  place-items: center;
  color: #8fb1c8;
}

.buyer-editor-pane {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.buyer-flow-tabs,
.buyer-color-mode,
.buyer-pack-tabs {
  display: grid;
  grid-auto-flow: column;
  gap: 6px;
}

.buyer-flow-tabs {
  grid-template-columns: repeat(3, 1fr);
}

.buyer-flow-tabs button,
.buyer-color-mode button,
.buyer-pack-tabs button,
.buyer-template-picker button,
.buyer-status button,
.buyer-submit {
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 8px;
  background: rgba(10, 25, 43, 0.92);
  color: #e9f7ff;
  min-height: 42px;
  font-weight: 800;
}

.buyer-flow-tabs button.is-active,
.buyer-color-mode button.is-active,
.buyer-pack-tabs button.is-active {
  border-color: rgba(85, 255, 184, 0.48);
  background: rgba(21, 94, 117, 0.62);
  color: #ccfbf1;
}

.buyer-template-picker {
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(125, 211, 252, 0.16);
  border-radius: 8px;
  background: rgba(2, 8, 18, 0.5);
  padding: 8px;
}

.buyer-template-picker > div {
  min-width: 0;
  text-align: center;
}

.buyer-template-picker strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.buyer-field,
.buyer-color-panel,
.buyer-layout-panel,
.buyer-pack-panel {
  display: grid;
  gap: 7px;
}

.buyer-field.compact {
  margin-top: 2px;
}

.buyer-field input,
.buyer-field textarea,
.buyer-field select,
.buyer-color-row input:not([type='color']) {
  width: 100%;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 8px;
  background: rgba(2, 8, 18, 0.72);
  color: #f5fbff;
  outline: none;
  padding: 11px 12px;
  min-height: 44px;
}

.buyer-field textarea {
  resize: vertical;
}

.buyer-color-panel,
.buyer-layout-panel,
.buyer-pack-panel {
  border: 1px solid rgba(125, 211, 252, 0.16);
  border-radius: 8px;
  background: rgba(2, 8, 18, 0.44);
  padding: 10px;
}

.buyer-color-head,
.buyer-layout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.buyer-layout-head > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.buyer-layout-head > div:first-child strong {
  color: #d7f4ff;
  font-size: 13px;
  line-height: 1.2;
}

.buyer-color-mode,
.buyer-layout-mode,
.buyer-pack-tabs {
  grid-auto-columns: minmax(86px, 1fr);
}

.buyer-color-mode button,
.buyer-layout-mode button,
.buyer-pack-tabs button {
  min-height: 34px;
  font-size: 12px;
}

.buyer-layout-mode,
.buyer-layout-line-tabs,
.buyer-layout-chip-row {
  display: grid;
  grid-auto-flow: column;
  gap: 6px;
}

.buyer-layout-mode button,
.buyer-layout-line-tabs button,
.buyer-layout-chip-row button,
.buyer-layout-preview-meta button,
.buyer-layout-nudge-pad button,
.buyer-layout-quick-controls button {
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 8px;
  background: rgba(10, 25, 43, 0.92);
  color: #e9f7ff;
  font-weight: 800;
}

.buyer-layout-mode button {
  min-width: 94px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.buyer-layout-mode button.is-active,
.buyer-layout-line-tabs button.is-active,
.buyer-layout-chip-row button.is-active {
  border-color: rgba(85, 255, 184, 0.48);
  background: rgba(21, 94, 117, 0.62);
  color: #ccfbf1;
}

.buyer-layout-mode button:disabled,
.buyer-layout-preview-meta button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.buyer-layout-note {
  border: 1px solid rgba(125, 211, 252, 0.13);
  border-radius: 8px;
  background: rgba(2, 8, 18, 0.46);
  color: #b6d6e8;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.buyer-layout-simple,
.buyer-layout-advanced {
  display: grid;
  gap: 8px;
}

.buyer-layout-flow {
  display: grid;
  gap: 6px;
}

.buyer-layout-flow-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid rgba(125, 211, 252, 0.12);
  border-radius: 8px;
  background: rgba(2, 8, 18, 0.34);
  padding: 8px;
}

.buyer-layout-flow-step span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(21, 94, 117, 0.72);
  color: #dcfdf7;
  font-size: 12px;
  font-weight: 900;
}

.buyer-layout-flow-step strong,
.buyer-layout-flow-step p,
.buyer-layout-subtitle,
.buyer-layout-simple-head span,
.buyer-layout-simple-head strong {
  overflow-wrap: anywhere;
}

.buyer-layout-flow-step strong {
  display: block;
  color: #ecfeff;
  font-size: 12px;
  line-height: 1.2;
}

.buyer-layout-flow-step p {
  margin: 2px 0 0;
  color: #9bc0d2;
  font-size: 11px;
  line-height: 1.35;
}

.buyer-layout-simple-head,
.buyer-layout-subtitle {
  border: 1px solid rgba(125, 211, 252, 0.12);
  border-radius: 8px;
  background: rgba(2, 8, 18, 0.34);
  padding: 8px 10px;
}

.buyer-layout-simple-head {
  display: grid;
  gap: 2px;
}

.buyer-layout-simple-head span,
.buyer-layout-subtitle {
  color: #8fb1c8;
  font-size: 11px;
  font-weight: 800;
}

.buyer-layout-simple-head strong {
  color: #ecfeff;
  font-size: 12px;
  line-height: 1.3;
}

.buyer-layout-subtitle {
  line-height: 1.35;
}

.buyer-layout-preview-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.buyer-layout-preview-meta > div,
.buyer-layout-metrics span {
  border: 1px solid rgba(125, 211, 252, 0.13);
  border-radius: 8px;
  background: rgba(2, 8, 18, 0.56);
  padding: 8px;
}

.buyer-layout-preview-meta span,
.buyer-layout-metrics span {
  color: #8fb1c8;
  font-size: 11px;
  font-weight: 800;
}

.buyer-layout-preview-meta strong,
.buyer-layout-metrics b {
  display: block;
  color: #f8fafc;
  font-size: 13px;
  line-height: 1.15;
}

.buyer-layout-preview-meta strong {
  overflow-wrap: anywhere;
}

.buyer-layout-preview-meta button {
  min-width: 92px;
  padding: 0 10px;
}

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

.buyer-layout-line-tabs button,
.buyer-layout-chip-row button {
  min-height: 36px;
}

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

.buyer-layout-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.buyer-layout-metrics span {
  min-width: 0;
  text-align: center;
}

.buyer-layout-nudge-pad {
  width: min(236px, 100%);
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(3, 56px);
  grid-auto-rows: 46px;
  justify-content: center;
  gap: 6px;
}

.buyer-layout-nudge-pad span {
  min-height: 46px;
}

.buyer-layout-nudge-pad button {
  display: grid;
  place-items: center;
}

.buyer-layout-quick-controls {
  display: grid;
  gap: 7px;
}

.buyer-layout-quick-controls > div {
  display: grid;
  grid-template-columns: 64px repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
}

.buyer-layout-quick-controls > div:last-child {
  grid-template-columns: 64px repeat(4, minmax(0, 1fr));
}

.buyer-layout-quick-controls span {
  color: #8fb1c8;
  font-size: 11px;
  font-weight: 800;
}

.buyer-layout-quick-controls button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 7px;
  font-size: 12px;
}

@media (max-width: 720px) {
  .buyer-layout-head,
  .buyer-layout-preview-meta {
    grid-template-columns: minmax(0, 1fr);
  }

  .buyer-layout-head {
    display: grid;
  }

  .buyer-layout-mode,
  .buyer-layout-chip-row,
  .buyer-layout-line-tabs {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .buyer-layout-mode button {
    min-width: 0;
  }

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

  .buyer-layout-quick-controls > div,
  .buyer-layout-quick-controls > div:last-child {
    grid-template-columns: 64px repeat(2, minmax(0, 1fr));
  }
}

.buyer-color-row {
  display: grid;
  grid-template-columns: 28px 46px 1fr;
  gap: 8px;
  align-items: center;
}

.buyer-color-row input[type='color'] {
  width: 46px;
  height: 42px;
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 8px;
  padding: 4px;
  background: rgba(2, 8, 18, 0.86);
}

.buyer-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 18px rgba(103, 232, 249, 0.2);
}

.buyer-gradient-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: stretch;
}

.buyer-gradient-strip {
  grid-column: 1 / -1;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
}

.buyer-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: 8px;
  background: rgba(22, 101, 52, 0.2);
  color: #dcfce7;
  padding: 10px;
  font-size: 13px;
}

.buyer-status.is-error {
  border-color: rgba(251, 113, 133, 0.44);
  background: rgba(127, 29, 29, 0.22);
  color: #ffe4e6;
}

.buyer-status span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.buyer-status button {
  min-height: 34px;
  padding: 0 10px;
}

.buyer-pack-progress {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(103, 232, 249, 0.3);
  border-radius: 8px;
  background: rgba(5, 22, 37, 0.92);
  padding: 13px;
  box-shadow: 0 12px 28px rgba(3, 18, 31, 0.24);
}

.buyer-pack-progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.buyer-pack-progress-copy {
  min-width: 0;
}

.buyer-pack-progress-kicker {
  display: block;
  color: #7dd3fc;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.buyer-pack-progress-copy h3 {
  margin: 3px 0 0;
  color: #f0fdff;
  font-size: 16px;
  line-height: 1.15;
}

.buyer-pack-progress-copy p {
  margin: 4px 0 0;
  color: #a9c6d8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.buyer-pack-progress-spinner {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid rgba(103, 232, 249, 0.32);
  border-radius: 50%;
  color: #67e8f9;
  background: rgba(8, 47, 73, 0.68);
  animation: buyer-pack-pulse 1.4s ease-in-out infinite;
}

.buyer-pack-progress-spinner .ts-icon {
  animation: buyer-pack-spin 1.1s linear infinite;
}

.buyer-pack-progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.12);
}

.buyer-pack-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #67e8f9;
  box-shadow: 0 0 14px rgba(103, 232, 249, 0.64);
  transition: width 0.35s ease;
}

.buyer-pack-progress-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.buyer-pack-progress-steps li {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #6f91a5;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.buyer-pack-progress-steps li.is-active,
.buyer-pack-progress-steps li.is-done {
  color: #d9fbff;
}

.buyer-pack-progress-step-icon {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 50%;
  background: rgba(2, 8, 18, 0.7);
  color: #7898aa;
  font-size: 10px;
  font-weight: 900;
}

.buyer-pack-progress-steps li.is-active .buyer-pack-progress-step-icon {
  border-color: rgba(103, 232, 249, 0.72);
  background: rgba(8, 145, 178, 0.3);
  color: #dffcff;
  box-shadow: 0 0 12px rgba(103, 232, 249, 0.24);
}

.buyer-pack-progress-steps li.is-done .buyer-pack-progress-step-icon {
  border-color: rgba(85, 255, 184, 0.5);
  background: rgba(22, 101, 52, 0.32);
  color: #bbf7d0;
}

.buyer-pack-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 2px;
  color: #8fb1c8;
  font-size: 11px;
  font-weight: 800;
}

.buyer-pack-progress-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.buyer-pack-progress-meta i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #67e8f9;
  box-shadow: 0 0 9px rgba(103, 232, 249, 0.7);
  animation: buyer-pack-pulse 1.2s ease-in-out infinite;
}

.buyer-pack-progress-meta strong {
  color: #d9fbff;
  white-space: nowrap;
}

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

@keyframes buyer-pack-pulse {
  0%, 100% { opacity: 0.65; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1); }
}

.buyer-submit {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-color: rgba(85, 255, 184, 0.46);
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.9), rgba(22, 163, 74, 0.82));
  color: #ffffff;
  box-shadow: 0 14px 34px rgba(8, 145, 178, 0.26);
}

@media (max-width: 860px) {
  .buyer-app {
    padding: 10px;
  }

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

  .buyer-preview-pane {
    position: relative;
    top: auto;
  }

  .buyer-live-preview {
    height: 42vh;
    min-height: 260px;
  }

  .buyer-gradient-control {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .buyer-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .buyer-topbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(112px, 0.85fr);
    width: 100%;
  }

  .buyer-help-trigger {
    width: 100%;
    min-height: 54px;
    padding: 0 10px;
    font-size: 11px;
  }

  .buyer-balance {
    min-width: 112px;
  }

  .buyer-color-head {
    align-items: stretch;
    flex-direction: column;
  }

  .buyer-flow-tabs button,
  .buyer-submit {
    min-height: 46px;
  }

  .buyer-pack-progress-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 10px;
  }
}

/* ── Buyer Balance Button ───────────────────────────── */
.buyer-balance--btn {
  cursor: pointer;
  background: rgba(5, 14, 27, 0.78);
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: right;
  transition: border-color 0.15s, background 0.15s;
  min-width: 128px;
}
.buyer-balance--btn:hover {
  border-color: rgba(125, 211, 252, 0.5);
  background: rgba(5, 14, 27, 0.95);
}
.buyer-balance-topup-hint {
  display: block;
  font-size: 10px;
  color: #7dd3fc;
  margin-top: 2px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Buyer Help Modal ───────────────────────────────── */
.buyer-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: rgba(0, 0, 0, 0.64);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 14px;
}

.buyer-help-sheet {
  width: min(760px, 100%);
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(8, 22, 38, 0.98), rgba(4, 11, 22, 0.98)),
    #040b16;
  color: #e9f7ff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.buyer-help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid rgba(125, 211, 252, 0.16);
}

.buyer-help-head p {
  margin: 0 0 4px;
  color: #8fb1c8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.buyer-help-head h2 {
  margin: 0;
  color: #f5fbff;
  font-size: clamp(20px, 6vw, 30px);
  line-height: 1.05;
  letter-spacing: 0;
}

.buyer-help-close {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 8px;
  background: rgba(2, 8, 18, 0.72);
  color: #cfefff;
  font-size: 18px;
  font-weight: 900;
}

.buyer-help-body {
  overflow: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.buyer-help-card {
  border: 1px solid rgba(125, 211, 252, 0.16);
  border-radius: 8px;
  background: rgba(2, 8, 18, 0.54);
  padding: 12px;
}

.buyer-help-card h3 {
  margin: 0 0 6px;
  color: #f5fbff;
  font-size: 15px;
  line-height: 1.15;
  letter-spacing: 0;
}

.buyer-help-card p {
  margin: 0 0 9px;
  color: #c8d9e8;
  font-size: 13px;
  line-height: 1.45;
}

.buyer-help-card ul {
  margin: 0;
  padding-left: 18px;
  color: #9fb9cc;
  font-size: 12px;
  line-height: 1.45;
}

.buyer-help-card li + li {
  margin-top: 5px;
}

.buyer-help-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 0.8fr;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(125, 211, 252, 0.16);
}

.buyer-help-action {
  min-height: 44px;
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 8px;
  background: rgba(10, 25, 43, 0.92);
  color: #e9f7ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.buyer-help-action.primary {
  border-color: rgba(85, 255, 184, 0.46);
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.9), rgba(22, 163, 74, 0.82));
}

.buyer-help-action.soft {
  color: #b6d6e8;
}

@media (max-width: 620px) {
  .buyer-help-overlay {
    padding: 8px;
  }

  .buyer-help-sheet {
    max-height: 88vh;
  }

  .buyer-help-body {
    grid-template-columns: 1fr;
  }

  .buyer-help-actions {
    grid-template-columns: 1fr;
  }
}

/* ── Top Up Modal ───────────────────────────────────── */
.topup-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.topup-sheet {
  width: min(480px, 100%);
  background: #0a1628;
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  max-height: 86vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.topup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(125, 211, 252, 0.14);
}
.topup-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: #e2e8f0;
}
.topup-close {
  background: rgba(125, 211, 252, 0.08);
  border: 1px solid rgba(125, 211, 252, 0.18);
  color: #94a3b8;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topup-tabs {
  display: flex;
  gap: 0;
  padding: 12px 18px 0;
}
.topup-tabs button {
  flex: 1;
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  border: 1px solid rgba(125, 211, 252, 0.16);
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}
.topup-tabs button:first-child { border-radius: 6px 0 0 6px; }
.topup-tabs button:last-child  { border-radius: 0 6px 6px 0; }
.topup-tabs button.is-active {
  background: rgba(125, 211, 252, 0.12);
  border-color: rgba(125, 211, 252, 0.4);
  color: #7dd3fc;
}
.topup-body {
  padding: 16px 18px 24px;
}
.topup-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.topup-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.topup-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 8px;
  background: rgba(5, 14, 27, 0.8);
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.topup-chip strong {
  color: #e2e8f0;
  font-size: 14px;
}
.topup-chip.is-active {
  border-color: #7dd3fc;
  background: rgba(125, 211, 252, 0.1);
}
.topup-chip:disabled {
  cursor: progress;
  opacity: 0.72;
}
.topup-chip.is-active strong { color: #7dd3fc; }
.topup-bonus {
  font-size: 10px;
  color: #bbf7d0;
  font-weight: 600;
}
.topup-token {
  font-size: 10px;
  color: #94a3b8;
}
.topup-submit {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  border: 1px solid rgba(125, 211, 252, 0.3);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-top: 4px;
}
.topup-submit:hover { opacity: 0.88; }
.topup-submit:disabled {
  cursor: progress;
  opacity: 0.62;
}
.topup-submit--secondary {
  background: rgba(5, 14, 27, 0.86);
  border-color: rgba(148, 163, 184, 0.22);
  color: #cbd5e1;
}
.topup-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.topup-error {
  font-size: 12px;
  color: #fca5a5;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: rgba(239, 68, 68, 0.08);
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.topup-waiting {
  text-align: center;
}
.topup-handoff {
  display: grid;
  gap: 14px;
  text-align: left;
}
.topup-notice-card {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.36);
  border-radius: 8px;
  box-shadow: inset 0 0 24px rgba(14, 165, 233, 0.06);
}
.topup-notice-badge {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fde68a;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}
.topup-notice-kicker {
  margin: 0 0 4px;
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topup-notice-card h3 {
  margin: 0 0 6px;
  color: #f8fafc;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}
.topup-notice-card p {
  margin: 0;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.5;
}
.topup-step-list {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: rgba(5, 14, 27, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
}
.topup-step-list div {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: start;
}
.topup-step-list span {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.36);
  color: #bbf7d0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}
.topup-step-list p {
  margin: 2px 0 0;
  color: #dbeafe;
  font-size: 13px;
  line-height: 1.45;
}
.topup-qr {
  display: block;
  width: 200px;
  height: 200px;
  margin: 12px auto;
  border-radius: 8px;
  background: white;
}
.topup-qr--placeholder {
  color: #0f172a;
  font-size: 20px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topup-amount-label {
  font-size: 20px;
  font-weight: 700;
  color: #bbf7d0;
  margin: 8px 0 4px;
}
.topup-bonus-note {
  font-size: 12px;
  color: #bbf7d0;
  margin-bottom: 6px;
}
.topup-hint {
  font-size: 12px;
  color: #64748b;
  margin: 6px 0;
}
.topup-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.08);
  border: 1px solid rgba(125, 211, 252, 0.2);
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 700;
  margin: 8px 0;
}
.topup-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  color: #7dd3fc;
  text-decoration: underline;
}
.topup-done {
  text-align: center;
  padding-top: 24px;
}
.topup-done-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.topup-done-title {
  font-size: 16px;
  font-weight: 700;
  color: #bbf7d0;
  margin-bottom: 6px;
}
