/* --- CUSTOM STYLING (Vanilla CSS) --- */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121e;
  --bg-card: #181827;
  --border: rgba(255, 255, 255, 0.08);
  --text-main: #f3f3fb;
  --text-muted: #8b8ea9;
  
  --primary: #5856d6;
  --primary-hover: #4341b5;
  --success: #34c759;
  --success-hover: #248a3d;
  --danger: #ff3b30;
  --danger-hover: #c92a21;
  --info: #007aff;
  --warn: #ff9500;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  height: 100vh;
  width: 100%;
  overflow: hidden;
  position: fixed;
  font-size: 14px;
}

/* APP STRUCTURE */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  height: 60px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logo-icon {
  font-size: 20px;
}

.logo-image {
  height: 34px;
  width: 34px;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
}

.header-logo h1 {
  font-size: 18px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  height: 22px;
  min-width: 54px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  overflow: visible;
  white-space: nowrap;
}

.badge {
  background: linear-gradient(135deg, #7b2cbf, #5a189a);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 12px;
}

/* APP MAIN */
.app-main {
  display: flex;
  flex: 1 1 0%;
  min-height: 0;
}

/* SIDEBAR */
.app-sidebar {
  width: 250px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 0;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.nav-item.active {
  background-color: rgba(88, 86, 214, 0.15);
  color: #a8a6ff;
  font-weight: 600;
  border-left: 3px solid var(--primary);
  border-top-left-radius: 2px;
  border-bottom-left-radius: 2px;
}

.nav-icon {
  font-size: 16px;
}

.sidebar-footer {
  padding: 0 16px;
}

.license-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.hwid-info {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 10px;
  color: var(--text-muted);
}

.hwid-info .label {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hwid-info #hwid-val {
  min-width: 0;
  overflow: hidden;
  color: var(--text-main);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.license-rows {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-footer .account-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 6px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.3;
}

.sidebar-footer .account-summary .label {
  color: var(--text-muted);
  font-weight: 700;
  white-space: nowrap;
}

.sidebar-footer .license-row {
  display: grid;
  grid-template-columns: minmax(82px, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
  margin-top: 6px;
  padding: 8px 10px;
  min-height: 42px;
  border: 1px solid rgba(88, 86, 214, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.sidebar-footer .license-row .label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.sidebar-footer .license-row .trial-info-row {
  display: contents;
}

.sidebar-footer .license-row .time-val {
  grid-column: 1;
  color: var(--success);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
}

.sidebar-footer .license-row .btn-sidebar-upgrade {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
}

/* CONTENT CONTAINER */
.app-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: radial-gradient(circle at top right, rgba(88, 86, 214, 0.05), transparent 60%);
}

.content-tab-panel {
  display: none;
  height: 100%;
}

.content-tab-panel.active {
  display: block;
}

/* CARD UI */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.section-title-with-logo {
  align-items: center;
  display: inline-flex;
  gap: 10px;
}

.section-title-logo {
  border-radius: 7px;
  height: 28px;
  object-fit: contain;
  width: 28px;
}

.card-header p {
  color: var(--text-muted);
  font-size: 12px;
}

.flex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: rgba(0, 0, 0, 0.1);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

/* FORM FIELDS */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-picker-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.input-picker-group input {
  flex: 1;
  min-width: 240px;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.input-picker-group .btn {
  white-space: nowrap;
}

/* SELECTS */
select {
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  width: 100%;
}

select option {
  background-color: var(--bg-card);
  color: var(--text-main);
}

/* GRID LAYOUTS */
.pref-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 10px;
}

.full-width {
  grid-column: span 2;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 500;
  font-size: 13px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.btn-success {
  background-color: var(--success);
  color: white;
}

.btn-success:hover {
  background-color: var(--success-hover);
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn-danger:hover {
  background-color: var(--danger-hover);
}

.btn-large {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

/* STATUS BADGES */
.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
}

.status-badge.disconnected {
  background-color: rgba(255, 59, 48, 0.08);
  border-color: rgba(255, 59, 48, 0.15);
  color: #ff453a;
}

.status-badge.connected {
  background-color: rgba(52, 199, 89, 0.08);
  border-color: rgba(52, 199, 89, 0.15);
  color: #30d158;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
}

/* LISTINGS TABLE */
.listings-table-container {
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: calc(100vh - 320px);
  overflow-y: auto;
  background-color: rgba(0, 0, 0, 0.15);
}

.listings-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.listings-table th, 
.listings-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.listings-table th {
  background-color: rgba(255, 255, 255, 0.02);
  font-weight: 600;
  color: var(--text-muted);
  position: sticky;
  top: 0;
  z-index: 10;
}

.listings-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

.listings-table tr.selected td {
  background-color: rgba(88, 86, 214, 0.06);
  color: #a8a6ff;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 30px !important;
}

/* BOTTOM FOOTER SECTION */
.app-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: var(--footer-height, 200px);
  position: relative;
  flex-shrink: 0;
}

.footer-resizer {
  position: absolute;
  top: -3px;
  left: 0;
  right: 0;
  height: 6px;
  cursor: ns-resize;
  background: transparent;
  z-index: 100;
  transition: background-color 0.2s;
}

.footer-resizer:hover,
.footer-resizer.dragging {
  background-color: rgba(88, 86, 214, 0.5);
  box-shadow: 0 0 4px rgba(88, 86, 214, 0.8);
}

.collapsed-log-trigger {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  user-select: none;
  height: 100%;
  padding: 0 12px;
  border-radius: 4px;
  transition: all 0.2s;
}

.collapsed-log-trigger:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.05);
}

.app-footer.collapsed {
  height: 38px !important;
  padding: 0 24px !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  overflow: hidden !important;
}

.app-footer.collapsed .footer-resizer {
  display: none !important;
}

.app-footer.collapsed .console-box {
  display: none !important;
}

.app-footer.collapsed .collapsed-log-trigger {
  display: flex !important;
}

.app-footer.collapsed .progress-container {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex: 1 !important;
  gap: 16px !important;
}

.app-footer.collapsed .progress-container.hidden {
  display: none !important;
}

.app-footer.collapsed .progress-info {
  display: flex !important;
  flex-direction: row !important;
  gap: 8px !important;
  align-items: center !important;
  flex-shrink: 0 !important;
}

.app-footer.collapsed .progress-bar-bg {
  flex: 1 !important;
  margin-top: 0 !important;
}


/* PROGRESS BAR */
.progress-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.progress-bar-bg {
  height: 6px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #8e2de2);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* CONSOLE LOGGER */
.console-box {
  display: flex;
  flex-direction: column;
  flex: 1;
  background-color: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  overflow: hidden;
}

.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.console-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-log-action,
.btn-clear {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 10px;
  padding: 2px 0;
}

.btn-log-action:hover,
.btn-clear:hover {
  color: var(--text-main);
}

.console-output {
  flex: 1;
  overflow-y: auto;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.4;
  -webkit-user-select: text;
  user-select: text;
}

.log-line {
  cursor: text;
  -webkit-user-select: text;
  user-select: text;
  word-break: break-all;
}

.log-line.success {
  color: #30d158;
}

.log-line.error {
  color: #ff453a;
}

.log-line.warn {
  color: #ffd60a;
}

.log-line.info {
  color: #64d2ff;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Standalone generic inputs */
.text-input {
  width: 100%;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease;
}

.text-input:focus {
  border-color: var(--primary);
}

/* SERVICE MODE SWITCHER */
.service-dropdown {
  position: relative;
  display: inline-block;
  margin-right: 8px;
}

.service-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 12px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  min-width: 160px;
}

.service-dropdown-trigger:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.service-dropdown-trigger .dropdown-arrow {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.service-dropdown.open .service-dropdown-trigger .dropdown-arrow {
  transform: rotate(180deg);
}

.service-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6);
  padding: 6px;
  min-width: 180px;
  z-index: 1000;
  display: none;
  flex-direction: column;
  gap: 4px;
}

.service-dropdown.open .service-dropdown-menu {
  display: flex;
}

.service-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.service-dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.service-dropdown-item.active {
  background: linear-gradient(135deg, var(--primary), #8e2de2);
  color: white;
  box-shadow: 0 2px 8px rgba(88, 86, 214, 0.3);
}

.svc-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Visually balance the logo sizes due to different transparent paddings */
img[src*="fotelo-logo"] {
  transform: scale(1.15);
}
img[src*="autohdr-logo"] {
  transform: scale(1.05);
}
img[src*="autoenhance-logo"] {
  transform: scale(0.95);
}


/* CHECKBOX STYLE */
.checkbox-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.checkbox-group:hover {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(88, 86, 214, 0.3);
}

.checkbox-group label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-main);
  text-transform: none; /* Do not uppercase */
  font-weight: 500;
  letter-spacing: normal;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* LOG TABS */
.log-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex: 1;
}
.log-tabs::-webkit-scrollbar {
  height: 4px;
}
.log-tabs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}
.log-tab {
  background: var(--bg-tertiary, #2a2a35);
  color: var(--text-muted);
  border: none;
  padding: 4px 8px 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
}
.log-tab:hover {
  background: #333344;
}
.log-tab.active {
  background: var(--primary);
  color: #fff;
  font-weight: 500;
}
.log-tab .tab-title {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log-tab .close-btn {
  font-size: 10px;
  opacity: 0.6;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 16px;
  line-height: 1;
}
.log-tab .close-btn:hover {
  opacity: 1;
  background: rgba(0,0,0,0.2);
}
.console-outputs {
  flex: 1;
  display: flex;
  overflow: hidden;
}
.console-output {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}
.console-output.active {
  display: block;
}

/* --- LICENSE AND AUTHENTICATION STYLE --- */
.trial-info {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  font-size: 11px;
  padding: 4px 0;
}
.trial-info .label {
  color: var(--text-muted);
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trial-info-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.trial-info .time-val {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trial-info .time-val.license-active {
  color: var(--success);
}
.trial-info .time-val.license-expired {
  color: var(--danger);
}

/* --- SERVICE LOCK OVERLAY --- */
.service-lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 15, 21, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}
.lock-content {
  text-align: center;
  max-width: 400px;
  padding: 30px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: scaleUp 0.3s ease;
}
.lock-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
}
.lock-content h2 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text-main);
}
.lock-content p {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* --- GLOBAL LOCK OVERLAY --- */
.global-lock-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.global-lock-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  width: 480px;
  text-align: center;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.global-lock-icon {
  font-size: 64px;
  display: block;
  margin-bottom: 20px;
  animation: pulse 2s infinite;
}

.auth-loading-card {
  max-width: 420px;
}

.auth-loading-icon {
  align-items: center;
  animation: authSpin 1s linear infinite;
  border: 1px solid rgba(99, 102, 241, 0.26);
  border-radius: 999px;
  color: #818cf8;
  display: inline-flex;
  font-size: 48px;
  height: 76px;
  justify-content: center;
  margin-bottom: 20px;
  width: 76px;
}

@keyframes authSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.global-lock-card h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
}
.global-lock-card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
}
.hwid-display-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hwid-display-card .hwid-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.hwid-display-card .hwid-value {
  font-family: monospace;
  font-size: 13px;
  color: #a8a6ff;
  font-weight: 600;
  word-break: break-all;
}
.purchase-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.btn-purchase {
  width: 100%;
  padding: 14px;
  font-weight: 600;
  font-size: 15px;
}
.lock-footer {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

/* --- PAYMENT MODAL --- */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 440px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  animation: slideDown 0.3s ease;
}

/* --- FIRST-RUN ONBOARDING --- */
.onboarding-welcome-backdrop {
  z-index: 100001;
  background: rgba(7, 7, 14, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.onboarding-welcome-card {
  position: relative;
  width: min(460px, calc(100vw - 36px));
  overflow: hidden;
  border: 1px solid rgba(129, 140, 248, 0.25);
  border-radius: 20px;
  padding: 34px 34px 26px;
  background: linear-gradient(155deg, #202033 0%, #151521 72%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(255, 255, 255, 0.025) inset;
  text-align: center;
}

.onboarding-welcome-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.42);
  filter: blur(55px);
  pointer-events: none;
}

.onboarding-welcome-logo-wrap {
  position: relative;
  width: 68px;
  height: 68px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(129, 140, 248, 0.22), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(165, 180, 252, 0.28);
  box-shadow: 0 12px 30px rgba(49, 46, 129, 0.3);
}

.onboarding-welcome-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.onboarding-welcome-eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: #a5b4fc;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.onboarding-welcome-card h2 {
  margin: 0;
  color: #f8f8ff;
  font-size: 25px;
  line-height: 1.25;
}

.onboarding-welcome-description {
  max-width: 390px;
  margin: 12px auto 22px;
  color: #a9a9bd;
  font-size: 14px;
  line-height: 1.6;
}

.onboarding-welcome-benefits {
  display: grid;
  gap: 9px;
  margin-bottom: 24px;
  text-align: left;
}

.onboarding-benefit-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: #d7d7e4;
  font-size: 13px;
}

.onboarding-benefit-icon {
  flex: 0 0 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  font-size: 12px;
  font-weight: 700;
}

.onboarding-welcome-actions {
  display: grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 10px;
}

.onboarding-welcome-actions .btn {
  min-height: 44px;
  justify-content: center;
  font-weight: 600;
}

.onboarding-skip-btn {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
  color: #b8b8c9;
}

.onboarding-skip-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.onboarding-start-btn {
  gap: 9px;
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.3);
}

.onboarding-start-btn span {
  font-size: 20px;
  line-height: 1;
}

.onboarding-welcome-note {
  margin: 15px 0 0;
  color: #77778b;
  font-size: 11px;
}

@media (max-width: 520px) {
  .onboarding-welcome-card {
    padding: 28px 22px 22px;
  }

  .onboarding-welcome-actions {
    grid-template-columns: 1fr;
  }
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
}
.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.btn-close-modal:hover {
  color: var(--text-main);
}
.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.login-success-card {
  max-width: 380px;
}

.login-success-body {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: visible;
  padding: 28px;
  text-align: center;
}

.login-success-icon {
  align-items: center;
  background: rgba(52, 199, 89, 0.14);
  border: 1px solid rgba(52, 199, 89, 0.35);
  border-radius: 999px;
  color: var(--success);
  display: inline-flex;
  font-size: 36px;
  font-weight: 700;
  height: 72px;
  justify-content: center;
  width: 72px;
}

.login-success-body h3 {
  color: var(--text-main);
  font-size: 20px;
  margin: 4px 0 0;
}

.login-success-body p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 8px;
}

.payment-instructions {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}
.qr-container {
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 220px;
  height: 220px;
  margin: 0 auto 20px auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.qr-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.payment-details-table {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.detail-label {
  color: var(--text-muted);
}
.detail-value {
  color: var(--text-main);
  font-weight: 500;
}
.detail-value-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}
.detail-value.highlight {
  color: #ff9f43;
  font-weight: bold;
  font-family: monospace;
  background: rgba(255, 159, 67, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  word-break: break-all;
}
.btn-copy {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--text-main);
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-copy:hover {
  background: rgba(255, 255, 255, 0.1);
}
.payment-warning {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  background: rgba(245, 158, 11, 0.05);
  border-left: 3px solid var(--warning);
  padding: 10px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 0;
}
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

/* Animations */
@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

/* Plan Selector for Payment Modal */
.plan-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.plan-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-muted);
}
.plan-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}
.plan-btn.active {
  background: rgba(33, 150, 243, 0.1);
  border-color: #2196f3;
  color: var(--text-main);
  box-shadow: 0 0 10px rgba(33, 150, 243, 0.2);
}
.plan-name {
  font-size: 13px;
  font-weight: 600;
}
.plan-price {
  font-size: 11px;
  opacity: 0.8;
}

.cloud-credit-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.06);
}

.cloud-credit-card > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cloud-credit-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.cloud-credit-card strong {
  color: #86efac;
  font-size: 20px;
  line-height: 1;
}

.btn-folder-select {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-folder-select:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-folder-select:active {
  transform: scale(0.98);
}

.contact-link-container {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  display: flex;
  justify-content: center;
}
.sidebar-footer .contact-link-container {
  justify-content: flex-start;
  margin-top: 12px;
  padding-top: 8px;
}
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}
.contact-link:hover {
  color: var(--text-main);
  transform: translateY(-1px);
}
.contact-link .icon {
  font-size: 14px;
}

.btn-sidebar-upgrade {
  background: var(--primary);
  color: white;
  border: none;
  min-width: 34px;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-sidebar-upgrade:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(88, 86, 214, 0.3);
}
.btn-sidebar-upgrade:active {
  transform: translateY(0);
}

.sidebar-footer .license-row {
  display: grid;
  grid-template-columns: minmax(82px, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
  margin-top: 6px;
  padding: 8px 10px;
  min-height: 42px;
  border: 1px solid rgba(88, 86, 214, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.sidebar-footer .license-row.hidden {
  display: none;
}

.sidebar-footer .license-row .label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.sidebar-footer .license-row .trial-info-row {
  display: contents;
}

.sidebar-footer .license-row .time-val {
  grid-column: 1;
  color: var(--success);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
}

.sidebar-footer .license-row .btn-sidebar-upgrade {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  min-width: 46px;
  height: 28px;
  border-radius: 7px;
  font-size: 11px;
}

/* Update Modal styles */
.update-notes-container {
  text-align: left;
  background: #181824;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 20px;
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid #27273a;
}
.update-notes-container strong {
  font-size: 13px;
  display: block;
  margin-bottom: 8px;
  color: #e4e4e7;
}
.update-notes-container div {
  font-size: 13px;
  color: #a0a0ab;
  line-height: 1.6;
  white-space: pre-wrap;
}
.update-ver-tag {
  color: #a0a0ab;
  font-size: 14px;
  margin-bottom: 16px;
  text-align: center;
}
.update-ver-tag span {
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #27273a;
}

/* ADVANCED SETTINGS TOGGLE */
.advanced-settings-toggle:hover {
  background-color: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(88, 86, 214, 0.3) !important;
}

/* ═══ BRACKET REVIEW - DRAG & DROP ═══ */
.bracket-mode-bar {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.bracket-mode-select {
  margin-bottom: 0;
  width: 220px;
}

@media (max-width: 640px) {
  .bracket-mode-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .bracket-mode-select {
    width: 100%;
  }
}

.bracket-container {
  display: flex;
  gap: 16px;
}

.bracket-view-carousel {
  align-items: flex-start;
  flex-wrap: wrap;
  overflow-x: hidden;
  padding-bottom: 8px;
}

.bracket-view-filmstrip {
  flex-direction: column;
  overflow-x: hidden;
}

.bracket-group {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  contain: content; /* Isolate layout & paint calculations for massive performance boost */
}

.bracket-view-carousel .bracket-group {
  flex: 1 1 280px;
  min-width: 260px;
}

.bracket-view-filmstrip .bracket-group {
  width: 100%;
}

.bracket-header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.bracket-group h4 {
  color: #6366f1;
  font-size: 14px;
  margin: 0;
}

.bracket-carousel-controls {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.bracket-view-filmstrip .bracket-carousel-controls {
  display: none;
}

.bracket-carousel-btn {
  align-items: center;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 6px;
  color: #c4b5fd;
  cursor: pointer;
  display: inline-flex;
  font-size: 18px;
  height: 28px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 28px;
}

.bracket-carousel-btn:hover {
  background: rgba(99, 102, 241, 0.24);
  color: #ffffff;
}

.bracket-carousel-count {
  color: var(--text-muted);
  font-size: 12px;
  min-width: 34px;
  text-align: center;
}

.bracket-list {
  min-height: 58px;
}

.bracket-list.drag-over-external {
  outline: 2px dashed var(--accent) !important;
  background: rgba(99, 102, 241, 0.08) !important;
  border-radius: 8px;
}

.bracket-view-carousel .bracket-list {
  min-height: 136px;
}

.bracket-view-filmstrip .bracket-list {
  align-items: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bracket-view-carousel .bracket-item {
  min-height: 118px;
}

.bracket-view-carousel .bracket-item:not(.active) {
  display: none;
}

.bracket-view-carousel .bracket-thumb {
  height: 96px;
  width: 96px;
}

.bracket-view-carousel .bracket-filename {
  font-size: 15px;
  font-weight: 600;
}

.bracket-item {
  position: relative;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px;
  margin-bottom: 8px;
  border-radius: 6px;
  font-size: 13px;
  cursor: grab;
  user-select: none;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  contain: content; /* Isolate layout & paint calculations for massive performance boost */
  will-change: transform; /* Promote to GPU layer for butter-smooth dragging */
}

.bracket-item-delete {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, transform 0.2s;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bracket-item:hover .bracket-item-delete {
  opacity: 1;
}

.bracket-item-delete:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.bracket-view-filmstrip .bracket-item {
  flex: 0 0 132px;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0;
  min-height: 104px;
}

.bracket-item:hover {
  border-color: #6366f1;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3);
}
.bracket-item:active {
  cursor: grabbing;
}

.bracket-thumb {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  background: #1a1a2e;
  flex-shrink: 0;
  pointer-events: none;
}

.bracket-view-filmstrip .bracket-thumb {
  height: 66px;
  width: 100%;
}

.bracket-filename {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  max-width: 100%;
}

.bracket-view-filmstrip .bracket-filename {
  font-size: 11px;
  text-align: center;
  width: 100%;
}

/* SortableJS states */
.sortable-ghost {
  opacity: 0.3;
  border: 1px dashed #6366f1 !important;
  background: rgba(99, 102, 241, 0.1) !important;
}
.sortable-chosen {
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.28);
  border-color: #6366f1 !important;
  z-index: 999;
}
.sortable-drag {
  opacity: 0;
}
.sortable-fallback {
  opacity: 0.95 !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  border: 1px solid #6366f1 !important;
  border-radius: 6px;
  background: #181827 !important;
}

.bracket-dragging .bracket-item,
.bracket-dragging .bracket-thumb {
  transition: none !important;
}

/* Bracket Actions and Delete Button Styles */
.bracket-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bracket-delete-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 20px;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bracket-delete-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Step-by-step Upload Wizard Styles */
.upload-dropzone-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 10px;
}

.upload-dropzone {
  width: 100%;
  max-width: 650px;
  border: 2px dashed rgba(99, 102, 241, 0.35);
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.02);
  padding: 50px 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.upload-dropzone:hover {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
}

.dropzone-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
}

.upload-dropzone .dropzone-icon svg {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
}

.upload-dropzone:hover .dropzone-icon svg {
  transform: translateY(-4px) scale(1.08);
  filter: drop-shadow(0 6px 12px rgba(99, 102, 241, 0.45)) !important;
}

.upload-dropzone h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
  margin: 8px 0 0 0;
}

.upload-dropzone p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.dropzone-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.upload-dropzone .dropzone-actions .btn {
  margin-top: 0;
}

/* DTE compact dropzone override */
.dte-dropzone {
  flex-direction: row !important;
  padding: 16px 20px !important;
  max-width: 100% !important;
  text-align: left !important;
  gap: 16px !important;
  align-items: center !important;
  border-color: rgba(168, 85, 247, 0.4) !important;
  background: rgba(168, 85, 247, 0.04) !important;
  border-radius: 10px !important;
  min-height: unset !important;
}
.dte-dropzone:hover {
  border-color: rgba(168, 85, 247, 0.7) !important;
  background: rgba(168, 85, 247, 0.09) !important;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.15) !important;
  transform: none !important;
}
.dte-dropzone .dte-drop-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: rgba(168, 85, 247, 0.12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.dte-dropzone:hover .dte-drop-icon {
  background: rgba(168, 85, 247, 0.22);
}

.upscale-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(260px, 0.8fr);
  gap: 20px;
  align-items: stretch;
}

.upscale-dropzone {
  border-color: rgba(52, 199, 89, 0.35);
  background: rgba(52, 199, 89, 0.025);
}

.upscale-dropzone:hover {
  border-color: rgba(52, 199, 89, 0.6);
  background: rgba(52, 199, 89, 0.06);
  box-shadow: 0 8px 24px rgba(52, 199, 89, 0.1);
}

.upscale-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.range-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.range-label-row span {
  color: #86efac;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.upscale-strength {
  width: 100%;
  height: 24px;
  accent-color: #22c55e;
  cursor: pointer;
}

.upscale-strength:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.upscale-summary {
  margin: 12px 0 8px;
  text-align: left;
  color: var(--text-muted);
  font-size: 13px;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.file-list-item {
  font-size: 13px;
  color: var(--text-color);
  line-height: 1.4;
}

.local-engine-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(52, 199, 89, 0.18);
  border-radius: 8px;
  background: rgba(52, 199, 89, 0.035);
}

.local-engine-status {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .upscale-grid {
    grid-template-columns: 1fr;
  }
}

.selected-summary-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 20px;
}

.selected-summary-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.selected-summary-icon {
  font-size: 28px;
  line-height: 1;
}

.selected-summary-info h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
}

.selected-summary-info p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 0 0;
  word-break: break-all;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.wizard-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .wizard-row {
    grid-template-columns: 1fr;
  }
}

/* Custom Modal Dialog Wizard (Name Your Project) */
.wizard-modal-card {
  width: 520px;
  max-width: 95vw;
  background: #18181b !important; /* Extremely clean dark background */
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5) !important;
  padding: 24px !important;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.wizard-modal-card .modal-header.no-border {
  border-bottom: none;
  padding: 0;
  margin-bottom: 4px;
}

.wizard-modal-card .modal-header h3 {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.wizard-modal-body {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wizard-input {
  width: 100%;
  background: #27272a !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 10px !important;
  color: #ffffff !important;
  font-size: 16px !important;
  padding: 14px 16px !important;
  outline: none;
  transition: all 0.2s ease;
}

.wizard-input:focus {
  border-color: rgba(99, 102, 241, 0.6) !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2) !important;
}

.wizard-dest-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #a1a1aa;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.dest-label {
  font-weight: 600;
  white-space: nowrap;
}

.dest-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  max-width: 320px;
}

.dest-path.placeholder-path {
  color: #71717a;
  font-style: italic;
}

.btn-link-edit {
  background: none;
  border: none;
  color: #6366f1;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: 12px;
  margin-left: auto;
  text-decoration: underline;
}

.btn-link-edit:hover {
  color: #818cf8;
}

.wizard-advanced-panel {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 16px;
  margin-top: 8px;
  animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.vertical-pref-list {
  display: flex;
  flex-direction: column;
}

#wizard-autohdr-prefs {
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

#wizard-autoenhance-prefs {
  position: relative;
  overflow: hidden;
  height: 240px;
  transition: height 0.25s ease;
  padding: 0 !important;
}

.check-menu-item {
  padding: 12px 16px;
  color: #a1a1aa;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
  border-radius: 6px;
  margin: 2px 8px;
}

.check-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.check-menu-item .check-icon {
  opacity: 0;
  color: #a1a1aa;
  transition: opacity 0.15s ease, transform 0.15s ease;
  transform: scale(0.8);
}

.check-menu-item input[type="checkbox"]:checked + .check-icon,
.check-menu-item.active .check-icon {
  opacity: 1;
  color: #ffffff;
  transform: scale(1);
}

.check-menu-item:has(input[type="checkbox"]:checked),
.check-menu-item.active {
  color: #ffffff;
}

.menu-item-group {
  padding: 12px 16px;
  margin: 2px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item-group .menu-item-label {
  color: #a1a1aa;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.menu-item-group .menu-item-select {
  padding: 8px 12px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}

.menu-item-group .menu-item-select:focus {
  border-color: #6366f1;
}

.menu-item-group .menu-item-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  outline: none;
  accent-color: #6366f1;
  margin-top: 8px;
  cursor: pointer;
}

.menu-item-group .menu-item-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.2);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.1s ease;
}

.menu-item-group .menu-item-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.menu-item-group .menu-item-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.2);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.1s ease;
}

.menu-item-group .menu-item-range::-moz-range-thumb:hover {
  transform: scale(1.15);
}


.wizard-modal-footer {
  border-top: none !important;
  padding: 0 !important;
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wizard-footer-left {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  transition: opacity 0.2s ease;
  user-select: none;
}

.wizard-footer-left:hover {
  opacity: 0.8;
}

.wizard-footer-left .arrow-indicator {
  font-size: 10px;
  color: #a1a1aa;
  margin-left: 2px;
  line-height: 1;
}

/* Floating Model Selection Dropdown */
.wizard-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #18181b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  padding: 6px 0;
  min-width: 200px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.wizard-dropdown-menu.hidden {
  display: none !important;
}

.wizard-dropdown-item {
  padding: 8px 16px;
  color: #e4e4e7;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.wizard-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.wizard-dropdown-item.active {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  font-weight: 600;
}

.wizard-footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.btn-icon-gear {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  color: #a1a1aa;
  transition: all 0.2s ease;
  line-height: 1;
}

.btn-icon-gear:hover {
  color: #ffffff;
  transform: rotate(30deg);
}

.btn-wizard-continue {
  background: none !important;
  border: 2px solid #0d9488 !important; /* Teal border matching screenshot */
  border-radius: 24px !important;
  padding: 10px 24px !important;
  color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.btn-wizard-continue:hover {
  background: rgba(13, 148, 136, 0.1) !important;
  box-shadow: 0 0 12px rgba(13, 148, 136, 0.3);
}

.btn-wizard-continue .btn-arrow {
  font-size: 18px;
  line-height: 1;
}

/* ==================================================
   INTRO.JS DARK THEME OVERRIDES
================================================== */
.introjs-overlay {
  background-color: rgba(0, 0, 0, 0.75) !important;
}

.introjs-helperLayer {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.8), 0 4px 20px rgba(0,0,0,0.5) !important;
}

.introjs-showElement {
  background-color: transparent !important;
}

.introjs-tooltip {
  z-index: 99999999 !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
  background-color: var(--bg-card, #181827) !important;
  color: var(--text-main, #f3f3fb) !important;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08)) !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5) !important;
  max-width: 320px;
}

.introjs-arrow.top { border-bottom-color: var(--border, rgba(255, 255, 255, 0.08)) !important; }
.introjs-arrow.top:after { border-bottom-color: var(--bg-card, #181827) !important; top: 1px; }

.introjs-arrow.bottom { border-top-color: var(--border, rgba(255, 255, 255, 0.08)) !important; }
.introjs-arrow.bottom:after { border-top-color: var(--bg-card, #181827) !important; bottom: 1px; }

.introjs-arrow.left { border-right-color: var(--border, rgba(255, 255, 255, 0.08)) !important; }
.introjs-arrow.left:after { border-right-color: var(--bg-card, #181827) !important; right: 1px; }

.introjs-arrow.right { border-left-color: var(--border, rgba(255, 255, 255, 0.08)) !important; }
.introjs-arrow.right:after { border-left-color: var(--bg-card, #181827) !important; left: 1px; }

.introjs-tooltiptext {
  font-family: 'Outfit', sans-serif !important;
  font-size: 14px !important;
  line-height: 1.5;
  padding: 16px !important;
}

.introjs-tooltip-title {
  color: #a5b4fc !important;
  font-weight: 600 !important;
  font-size: 16px !important;
  margin-bottom: 8px;
}

.introjs-tooltipbuttons {
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08)) !important;
  padding: 12px 16px !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.introjs-button {
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-main, #f3f3fb) !important;
  text-shadow: none !important;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08)) !important;
  border-radius: 6px !important;
  font-family: 'Outfit', sans-serif !important;
  font-size: 12px !important;
  font-weight: 500;
  box-shadow: none !important;
  padding: 8px 12px !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.introjs-button:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
}

.introjs-button.introjs-primaryButton {
  background-color: var(--primary, #5856d6) !important;
  color: white !important;
  border-color: var(--primary, #5856d6) !important;
  font-weight: 600;
}

.introjs-button.introjs-primaryButton:hover {
  background-color: var(--primary-hover, #4341b5) !important;
  box-shadow: 0 2px 8px rgba(88, 86, 214, 0.4) !important;
}

.introjs-button.introjs-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.introjs-progress {
  background-color: rgba(255,255,255,0.1) !important;
}

.introjs-progressbar {
  background-color: var(--primary, #5856d6) !important;
}

/* GALLERY ITEMS FOR MODAL */
.gallery-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-tertiary);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  border-color: var(--primary);
}
.gallery-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}
.gallery-item .gallery-caption {
  padding: 10px;
  font-size: 13px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  text-align: center;
  color: var(--text-secondary);
  font-weight: 500;
}
.gallery-item {
  position: relative;
}
.gallery-item.selected {
  border-color: var(--primary, #5856d6);
  box-shadow: 0 0 0 2px var(--primary, #5856d6);
  background: rgba(88, 86, 214, 0.08);
}
.gallery-item.selected .gallery-caption {
  color: var(--primary, #5856d6);
  font-weight: 600;
}
.gallery-select-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--primary, #5856d6);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  border: 1.5px solid #fff;
}
.gallery-item.selected .gallery-select-badge {
  opacity: 1;
  transform: scale(1);
}

/* Autoenhance Sky and Window Pull Button Groups */
.menu-item-group-sky {
  padding: 10px 16px;
  margin: 2px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item-label-sky {
  color: #a1a1aa;
  font-size: 14px;
  font-weight: 500;
}

.sky-replace-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sky-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a1a1aa;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
  outline: none;
}

.sky-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.sky-btn.active {
  background: rgba(52, 199, 89, 0.15); /* Màu xanh lá (success) nhạt */
  color: #34c759;
  border-color: #34c759;
}

/* Switch toggle styles for Style Settings */
.sp-switch-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}
.sp-switch-label {
  font-size: 13px;
  color: #d4d4d8;
  font-weight: 500;
}
.sp-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}
.sp-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.sp-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #27272a;
  transition: .2s ease;
  border-radius: 20px;
  border: 1px solid #3f3f46;
}
.sp-slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: #a1a1aa;
  transition: .2s ease;
  border-radius: 50%;
}
.sp-switch input:checked + .sp-slider {
  background-color: #3b82f6;
  border-color: #3b82f6;
}
.sp-switch input:checked + .sp-slider:before {
  transform: translateX(16px);
  background-color: #ffffff;
}

/* ========================================================================== 
   AUTO3IN1 CREATIVE STUDIO — LIGHT EDITORIAL INTERFACE
   This final layer intentionally replaces the legacy dark/purple shell while
   keeping the existing DOM hooks used by the desktop application.
   ========================================================================== */

:root {
  --bg-primary: #e9e6dc;
  --bg-secondary: #132238;
  --bg-card: #fffdf8;
  --border: #ded9cd;
  --text-main: #152238;
  --text-color: #152238;
  --text-muted: #697387;
  --primary: #ff6846;
  --primary-hover: #e65031;
  --accent-color: #0d9d9a;
  --success: #159870;
  --success-hover: #0d7958;
  --danger: #df4050;
  --danger-hover: #bd2f3d;
  --info: #2563eb;
  --warn: #e89b24;
}

body {
  color: var(--text-main);
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 171, 121, 0.35), transparent 28%),
    radial-gradient(circle at 100% 72%, rgba(43, 190, 184, 0.18), transparent 27%),
    #e9e6dc;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #aeb4bd;
  background-clip: padding-box;
}

.app-container {
  gap: 14px;
  padding: 14px;
}

.app-header {
  z-index: 20;
  height: 74px;
  flex: 0 0 74px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: 0 12px 35px rgba(24, 34, 52, 0.08);
  backdrop-filter: blur(18px);
}

.header-logo {
  gap: 13px;
}

.logo-image {
  width: 46px;
  height: 46px;
  object-fit: cover;
  object-position: center;
  transform: scale(1.22);
  border: 1px solid rgba(21, 34, 56, 0.1);
  border-radius: 15px;
  box-shadow: 0 8px 18px rgba(21, 34, 56, 0.17);
}

.app-title-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.brand-kicker {
  color: #ef5c3c;
  font-family: "Space Grotesk", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1;
}

.brand-service-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.header-logo h1 {
  color: #152238;
  font-family: "Space Grotesk", sans-serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.active-service-badge {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 7px;
  border: 1px solid #cce7e4;
  border-radius: 999px;
  color: #137f7b;
  background: #e7f7f4;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.version-badge {
  height: 19px;
  min-width: auto;
  padding: 0 7px;
  border: 0;
  border-radius: 999px;
  color: #627087;
  background: #ebe8df;
  font-size: 9px;
  font-weight: 800;
}

.header-actions {
  gap: 8px;
}

.header-actions .btn,
.service-dropdown-trigger {
  min-height: 40px;
  border-radius: 13px;
}

.header-actions #btn-tour {
  margin-right: 2px !important;
  color: #152238;
  background: #d9f4f0;
  box-shadow: none;
}

.service-dropdown {
  margin-right: 2px;
}

.service-dropdown-trigger {
  min-width: 150px;
  padding: 8px 13px;
  color: #152238;
  border: 1px solid #ded9cd;
  background: #f5f2ea;
}

.service-dropdown-trigger:hover {
  color: #152238;
  border-color: #b8b0a1;
  background: #ffffff;
}

.service-dropdown-menu {
  overflow: hidden;
  padding: 7px;
  border: 1px solid #ddd6c8;
  border-radius: 16px;
  background: #fffdf8;
  box-shadow: 0 18px 45px rgba(21, 34, 56, 0.18);
}

.service-dropdown-item {
  border-radius: 11px;
  color: #687387;
}

.service-dropdown-item:hover {
  color: #152238;
  background: #f1eee6;
}

.service-dropdown-item.active {
  color: #ffffff;
  background: #152238;
  box-shadow: none;
}

#btn-check-email {
  color: #152238 !important;
  border-color: #ded9cd !important;
  background: #f5f2ea !important;
}

#btn-connect {
  padding-inline: 18px;
}

.app-main {
  gap: 14px;
}

.app-sidebar {
  width: 236px;
  padding: 22px 14px 14px;
  border: 0;
  border-radius: 24px;
  color: #ffffff;
  background:
    radial-gradient(circle at 20% 0%, rgba(40, 184, 178, 0.2), transparent 35%),
    #132238;
  box-shadow: 0 18px 42px rgba(19, 34, 56, 0.18);
}

.nav-section-label {
  margin: 0 12px 11px;
  color: #7890aa;
  font-family: "Space Grotesk", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.side-nav {
  gap: 7px;
  padding: 0;
}

.nav-item {
  position: relative;
  width: 100%;
  min-height: 48px;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #aeb9c9;
  font-size: 12px;
  font-weight: 700;
}

.nav-item .nav-icon {
  width: 19px;
  height: 19px;
  padding: 0;
}

.nav-item:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  color: #152238;
  border: 0;
  border-left: 0;
  border-radius: 14px;
  background: #fffdf8;
  box-shadow: 0 9px 20px rgba(0, 0, 0, 0.2);
}

.nav-item.active::after {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff6846;
  content: "";
  transform: translateY(-50%);
}

.sidebar-footer {
  padding: 0;
}

.license-summary {
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.055);
}

.hwid-info,
.hwid-info .label,
.sidebar-footer .trial-info .label,
.sidebar-footer .license-row .label {
  color: #91a0b3;
}

.hwid-info #hwid-val {
  color: #eef4fb;
}

.license-rows {
  border-color: rgba(255, 255, 255, 0.09);
}

.sidebar-footer .trial-info {
  color: #ffffff;
}

.sidebar-footer .time-val,
.sidebar-footer .trial-info-row .time-val {
  color: #4ee0b7;
}

.btn-sidebar-upgrade {
  color: #152238;
  background: #ffd06a;
}

.contact-link-container {
  border-color: rgba(255, 255, 255, 0.09) !important;
}

.contact-link {
  color: #aeb9c9;
}

.app-content {
  position: relative;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.42)),
    repeating-linear-gradient(0deg, transparent, transparent 27px, rgba(21, 34, 56, 0.025) 28px),
    repeating-linear-gradient(90deg, transparent, transparent 27px, rgba(21, 34, 56, 0.025) 28px),
    #ebe8df;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.content-tab-panel {
  padding: 15px;
}

.card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.95);
  box-shadow: 0 18px 45px rgba(35, 46, 62, 0.1);
}

.card-header {
  position: relative;
  padding: 25px 29px;
  border-bottom: 1px solid #ebe6db;
  background: rgba(255, 253, 248, 0.84);
}

.card-header::before {
  position: absolute;
  top: 28px;
  left: 0;
  width: 5px;
  height: 31px;
  border-radius: 0 8px 8px 0;
  background: #ff6846;
  content: "";
}

.card-header h2 {
  color: #152238;
  font-family: "Space Grotesk", sans-serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.card-header p {
  margin-top: 6px;
  color: #737c8c;
  font-size: 12px;
}

.section-title-with-logo {
  gap: 11px;
}

.section-title-logo {
  width: 32px;
  height: 32px;
  padding: 3px;
  border: 1px solid #e2ddd2;
  border-radius: 10px;
  background: #ffffff;
}

.card-body {
  padding: 28px;
}

.card-footer {
  padding: 16px 28px;
  border-top: 1px solid #ebe6db;
  border-radius: 0;
  background: #f7f4ed;
}

.upload-dropzone-container {
  min-height: 100%;
  padding: 18px;
  /* Column: the dropzone has siblings (selection summary, file list) that must
     stack under it, not sit beside it and overflow the card. */
  flex-direction: column;
}

.upload-dropzone {
  position: relative;
  max-width: 740px;
  min-height: 320px;
  justify-content: center;
  overflow: hidden;
  padding: 44px 36px;
  border: 2px dashed #72b7b0;
  border-radius: 26px;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.9), transparent 28%),
    linear-gradient(135deg, #eefaf6 0%, #e7f5f3 55%, #fef6e8 100%);
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.45);
}

.upload-dropzone::before,
.upload-dropzone::after {
  position: absolute;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.upload-dropzone::before {
  top: -44px;
  right: -20px;
  width: 145px;
  height: 145px;
  border: 28px solid rgba(255, 104, 70, 0.09);
}

.upload-dropzone::after {
  bottom: -45px;
  left: -34px;
  width: 120px;
  height: 120px;
  background: rgba(20, 157, 154, 0.08);
}

.upload-dropzone > * {
  position: relative;
  z-index: 1;
}

.upload-dropzone:hover {
  border-color: #ff6846;
  background:
    radial-gradient(circle at 20% 15%, #ffffff, transparent 30%),
    linear-gradient(135deg, #f5fffb 0%, #ebfaf7 50%, #fff0df 100%);
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.6), 0 17px 35px rgba(40, 83, 86, 0.13);
  transform: translateY(-3px);
}

.dropzone-icon {
  width: 76px;
  height: 76px;
  margin-bottom: 3px;
  border: 1px solid rgba(21, 34, 56, 0.08);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 13px 28px rgba(34, 75, 78, 0.14);
}

.upload-dropzone .dropzone-icon svg {
  width: 46px;
  height: 46px;
}

.upload-dropzone h3 {
  color: #152238;
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.upload-dropzone p {
  max-width: 520px;
  color: #687387;
  line-height: 1.6;
}

.dropzone-actions {
  margin-top: 13px;
}

.btn {
  border-radius: 11px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.btn-primary {
  color: #ffffff;
  border-color: transparent;
  background: #ff6846;
  box-shadow: 0 8px 18px rgba(255, 104, 70, 0.22);
}

.btn-primary:hover {
  border-color: transparent;
  background: #e65031;
  box-shadow: 0 10px 22px rgba(255, 104, 70, 0.28);
  transform: translateY(-1px);
}

.btn-secondary,
.btn-folder-select {
  color: #152238;
  border: 1px solid #d9d3c7;
  background: #ffffff;
}

.btn-secondary:hover,
.btn-folder-select:hover {
  color: #152238;
  border-color: #9ba7b6;
  background: #f4f1e9;
}

.btn-danger {
  color: #ffffff;
}

.text-input,
.form-input,
select,
textarea {
  color: #152238;
  border-color: #d9d3c7;
  background: #ffffff;
}

.text-input:focus,
.form-input:focus,
select:focus,
textarea:focus {
  border-color: #0d9d9a;
  box-shadow: 0 0 0 3px rgba(13, 157, 154, 0.12);
}

#voucher-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  color: #152238;
  caret-color: #152238;
  border: 1px solid #d9d3c7;
  border-radius: 10px;
  outline: none;
  background: #ffffff;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#voucher-input::placeholder {
  color: #8a94a6;
  opacity: 1;
}

#voucher-input:focus {
  border-color: #0d9d9a;
  box-shadow: 0 0 0 3px rgba(13, 157, 154, 0.12);
}

.listings-table-container {
  overflow: hidden;
  border: 1px solid #e0dbd0;
  border-radius: 16px;
  background: #ffffff;
}

.listings-table th {
  color: #697387;
  border-color: #e8e3d9;
  background: #f3f0e8;
}

.listings-table td {
  color: #263449;
  border-color: #eee9df;
}

.listings-table tr:hover td {
  background: #f1faf7;
}

.cloud-credit-card,
.checkbox-group,
.setting-card,
.option-card {
  color: #152238;
  border-color: #dfd9cd;
  background: #f7f4ed;
}

.dte-dropzone {
  min-height: 78px !important;
  border-color: #7c91c9 !important;
  border-radius: 17px !important;
  background: linear-gradient(135deg, #f2f5ff, #edf8f8) !important;
}

.dte-dropzone:hover {
  border-color: #ff6846 !important;
  background: linear-gradient(135deg, #f7f8ff, #eefaf7) !important;
}

.dte-dropzone .dte-drop-icon {
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(44, 60, 91, 0.1);
}

#btn-start-dte {
  background: #152238 !important;
  box-shadow: 0 9px 20px rgba(21, 34, 56, 0.22) !important;
}

.upscale-dropzone {
  border-color: #72b7b0;
  background: linear-gradient(135deg, #ecfaf5, #f3f9e9);
}

.modal-overlay,
.payment-modal,
.confirm-modal-overlay {
  background: rgba(15, 27, 45, 0.58);
  backdrop-filter: blur(9px);
}

.modal-content,
.payment-modal-content,
.confirm-modal,
.wizard-modal-content,
.bracket-modal-content {
  color: #152238;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 22px;
  background: #fffdf8;
  box-shadow: 0 28px 70px rgba(12, 24, 42, 0.28);
}

.modal-header,
.modal-footer,
.wizard-modal-header,
.wizard-modal-footer {
  border-color: #e8e2d7;
  background: #f8f5ee;
}

.app-footer {
  height: var(--footer-height, 180px);
  padding: 12px 16px;
  border: 0;
  border-radius: 20px;
  color: #dce6f2;
  background: #132238;
  box-shadow: 0 15px 35px rgba(19, 34, 56, 0.18);
}

.app-footer.collapsed {
  height: 42px !important;
  padding: 0 16px !important;
}

.console-box {
  border-color: rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(6, 14, 26, 0.45);
}

.console-header {
  border-color: rgba(255, 255, 255, 0.08);
}

.progress-bar-bg {
  background: rgba(255, 255, 255, 0.1);
}

.progress-bar-fill {
  background: linear-gradient(90deg, #ff6846, #ffd06a, #42cfbf);
}

.log-tab.active {
  color: #152238;
  background: #ffd06a;
}

.service-lock-overlay {
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(12px);
}

.lock-content h2 {
  color: #152238;
}

@media (max-width: 980px) {
  .app-container {
    gap: 9px;
    padding: 9px;
  }

  .app-sidebar {
    width: 205px;
  }

  .brand-kicker {
    display: none;
  }

  .header-actions {
    gap: 5px;
  }

  .service-dropdown-trigger {
    min-width: 126px;
  }

  .content-tab-panel {
    padding: 10px;
  }
}

/* Horizontal workspace bar */
.app-main {
  flex-direction: column;
  gap: 12px;
}

.app-sidebar {
  width: 100%;
  min-height: 68px;
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 19px;
}

.nav-section-label {
  display: none;
}

.side-nav {
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.nav-item {
  width: auto;
  min-height: 48px;
  flex: 0 1 190px;
  justify-content: center;
  padding: 10px 14px;
  white-space: nowrap;
}

.nav-item.active::after {
  top: auto;
  right: 50%;
  bottom: 4px;
  width: 18px;
  height: 3px;
  border-radius: 999px;
  transform: translateX(50%);
}

.sidebar-footer {
  min-width: 0;
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  gap: 7px;
}

.license-summary {
  min-width: 0;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 12px;
}

.hwid-info {
  max-width: 145px;
  flex: 0 1 145px;
}

.license-rows {
  min-width: 0;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  padding-top: 0;
  padding-left: 9px;
  border-top: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.09);
}

.sidebar-footer .trial-info {
  min-height: 32px;
  grid-template-columns: auto auto;
  gap: 6px;
  padding: 0;
}

.sidebar-footer .trial-info-row {
  gap: 5px;
}

.sidebar-footer .trial-info .time-val {
  max-width: 74px;
}

.sidebar-footer .btn-sidebar-upgrade {
  min-width: 34px;
  height: 27px;
  padding-inline: 7px;
}

.sidebar-footer .contact-link-container {
  min-height: 40px;
  margin: 0;
  padding: 0 2px 0 8px;
  border-top: 0 !important;
  border-left: 1px solid rgba(255, 255, 255, 0.09) !important;
  white-space: nowrap;
}

.app-content {
  min-height: 0;
  flex: 1 1 0%;
}

@media (max-width: 1450px) {
  .nav-item {
    /* flex-basis is cross-axis-free only in a row nav. The nav is a column now,
       so a 155px basis became the item HEIGHT and tore the rail apart. */
    padding-inline: 10px;
  }

  .hwid-info,
  .sidebar-footer .contact-link-container {
    display: none;
  }

  .license-rows {
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 1120px) {
  .app-sidebar {
    overflow-x: auto;
  }

  .side-nav {
    flex: 0 0 auto;
  }

  .nav-item {
    flex: 0 0 auto;
  }

  .sidebar-footer .trial-info:not(#cloud-credit-info) {
    display: none;
  }
}

/* Account and license information lives in a dedicated right sidebar. */
.app-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 252px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.app-sidebar {
  grid-column: 1 / -1;
  grid-row: 1;
}

.app-sidebar .side-nav {
  justify-content: center;
}

.app-content {
  grid-column: 1;
  grid-row: 2;
}

.account-sidebar {
  min-height: 0;
  grid-column: 2;
  grid-row: 2;
  overflow: hidden auto;
  padding: 14px;
  border-radius: 20px;
  color: #ffffff;
  background:
    radial-gradient(circle at 100% 0%, rgba(40, 184, 178, 0.18), transparent 40%),
    #132238;
  box-shadow: 0 18px 42px rgba(19, 34, 56, 0.18);
}

.account-sidebar .sidebar-footer {
  width: 100%;
  min-height: 100%;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.account-sidebar .license-summary {
  width: 100%;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
  padding: 12px;
  border-radius: 15px;
}

.account-sidebar .hwid-info {
  display: grid;
  max-width: none;
  flex: none;
}

.account-sidebar .license-rows {
  flex-direction: column;
  align-items: stretch;
  gap: 1px;
  padding-top: 8px;
  padding-left: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  border-left: 0;
}

.account-sidebar .sidebar-footer .trial-info,
.account-sidebar .sidebar-footer .trial-info:not(#cloud-credit-info) {
  display: grid;
  width: 100%;
  min-height: 28px;
  grid-template-columns: minmax(76px, 1fr) auto;
  gap: 7px;
  padding: 3px 0;
}

.account-sidebar .sidebar-footer .trial-info.hidden {
  display: none;
}

.account-sidebar .sidebar-footer .trial-info .time-val {
  max-width: 92px;
}

.account-sidebar .sidebar-footer .contact-link-container {
  min-height: 40px;
  justify-content: flex-start;
  margin-top: auto;
  padding: 10px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-left: 0 !important;
}

@media (max-width: 1100px) {
  .app-main {
    grid-template-columns: minmax(0, 1fr) 218px;
  }

  .account-sidebar {
    padding: 10px;
  }
}

/* The project wizard intentionally stays dark. Keep the later light-theme
   modal rules from painting white strips behind its header and footer. */
#project-wizard-modal .wizard-modal-card > .modal-header,
#project-wizard-modal .wizard-modal-card > .wizard-modal-footer {
  background: transparent !important;
  border-color: transparent !important;
}

/* Windows WebView2 needs an explicit, non-clipped grid scroll viewport. */
.app-content {
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.content-tab-panel.active {
  min-height: 100%;
  height: auto;
}

.listings-table-container {
  max-height: calc(100vh - 320px);
  overflow-x: auto !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

/* Keep the download action visible when the account has many old listings. */
#sec-download.content-tab-panel.active,
#sec-download > .card,
#sec-download .card-body {
  min-height: 0;
}

#sec-download.content-tab-panel.active {
  height: 100%;
  overflow: hidden;
}

#sec-download > .card {
  height: 100%;
  overflow: hidden;
}

#sec-download .card-header,
#sec-download .card-footer {
  flex: 0 0 auto;
}

#sec-download .card-body {
  overflow: hidden;
}

#sec-download .listings-table-container {
  flex: 1 1 auto;
  min-height: 120px;
  max-height: none;
}

.nav-badge:empty {
  display: none;
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #34d399;
  color: #052e1a;
  font-size: 11px;
  font-weight: 700;
}

.results-grid {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.result-folder h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--text-muted);
}

.result-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.result-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.result-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #111;
}

.result-card span {
  padding: 0 10px 2px;
  font-size: 12px;
  word-break: break-all;
}

.result-card small {
  padding: 0 10px 10px;
  color: var(--text-muted);
  font-size: 11px;
}

.results-toast {
  position: fixed;
  right: 20px;
  top: 78px;
  z-index: 80;
  padding: 10px 14px;
  border-radius: 10px;
  background: #14532d;
  color: #ecfdf3;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.results-lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(6, 8, 12, 0.88);
  padding: 24px;
}

.results-lightbox.hidden,
.results-toast.hidden {
  display: none;
}

.results-lightbox figure {
  margin: 0;
  max-width: min(92vw, 1100px);
  text-align: center;
}

.results-lightbox img {
  max-width: 92vw;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 12px;
}

.results-lightbox figcaption {
  margin: 10px 0;
  color: #e5e7eb;
}

.results-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.results-lightbox-nav {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  font-size: 28px;
  line-height: 1;
  border: 0;
  cursor: pointer;
}

.app-footer {
  display: none !important;
}

.upload-inline-progress {
  margin: 16px 0 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.upload-results-wrap {
  display: none;
}

.upload-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.upload-results-head h3 {
  margin: 0;
  font-size: 16px;
}

.upload-results-actions {
  display: flex;
  gap: 8px;
}

.photo-api-status {
  min-height: 18px;
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-muted);
}

#sec-upload .card-body {
  display: flex;
  flex-direction: column;
  overflow: auto;
}

#sec-upload .upload-dropzone-container {
  flex: 1 1 auto;
}

#sec-upload .upload-dropzone {
  flex: 1 1 auto;
  height: 100%;
}

.results-toast {
  display: none !important;
}

/* ==========================================================================
   AUTOHDR — DARKROOM CONSOLE
   One continuous instrument surface under an amber safelight.
   Replaces the previous ink-shell/ivory-bench mashup. DOM hooks unchanged.

   Colour is semantic here, not decorative:
     amber  = brand + the thing you act on (primary, in-progress, active rail)
     cyan   = state that is already good (ready, done, licence alive)
     clay   = destructive only
   ========================================================================== */

:root {
  /* --- ground: warm blacks, never neutral grey --- */
  --ink-900: #0b0908;
  --ink-850: #100d0b;
  --ink-800: #15110e;
  --ink-780: #191410;
  --ink-750: #1e1813;
  --ink-700: #251e17;

  /* --- hairlines --- */
  --line: rgba(255, 238, 214, 0.085);
  --line-soft: rgba(255, 238, 214, 0.05);
  --line-strong: rgba(255, 238, 214, 0.17);

  /* --- type --- */
  --paper: #f8f2e7;
  --paper-dim: #b9ab98;
  --paper-mute: #82766a;

  /* --- safelight amber --- */
  --amber: #ff8f42;
  --amber-hot: #ffa863;
  --amber-deep: #c0561d;
  --amber-glow: rgba(255, 143, 66, 0.22);

  /* --- signal cyan --- */
  --cyan: #63d6d0;
  --cyan-deep: #2b8f8c;

  --clay: #ef5f4a;
  --clay-deep: #b83d2b;

  /* --- legacy aliases the base sheet still reads --- */
  --bg-primary: var(--ink-900);
  --bg-secondary: var(--ink-800);
  --bg-card: var(--ink-780);
  --border: var(--line);
  --text-main: var(--paper);
  --text-color: var(--paper);
  --text-muted: var(--paper-dim);
  --primary: var(--amber);
  --primary-hover: var(--amber-hot);
  --accent-color: var(--cyan);
  --success: var(--cyan);
  --success-hover: var(--cyan-deep);
  --danger: var(--clay);
  --danger-hover: var(--clay-deep);
  --info: var(--cyan);
  --warn: var(--amber);
  --ink: var(--ink-900);
  --ivory: var(--paper);

  /* --- system --- */
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow-panel: 0 24px 60px -18px rgba(0, 0, 0, 0.8), 0 2px 0 rgba(255, 238, 214, 0.045) inset;
  --shadow-raise: 0 10px 26px -12px rgba(0, 0, 0, 0.75);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 140ms;
  --slow: 420ms;

  /* Lets the UA draw checkboxes, scrollbars and select popups dark natively,
     instead of stamping white boxes onto the console. */
  color-scheme: dark;

  --font-display: 'Bricolage Grotesque', 'Be Vietnam Pro', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Be Vietnam Pro', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* ==========================================================================
   1. ATMOSPHERE
   ========================================================================== */

body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--paper);
  background: var(--ink-900);
  -webkit-font-smoothing: antialiased;
}

/* Safelight wash + vignette. Fixed so it never scrolls with content. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(70% 55% at 6% -8%, rgba(255, 143, 66, 0.17), transparent 62%),
    radial-gradient(55% 50% at 104% 106%, rgba(99, 214, 208, 0.085), transparent 58%),
    radial-gradient(120% 90% at 50% 50%, transparent 42%, rgba(0, 0, 0, 0.55) 100%);
}

/* Film grain. Low opacity, overlay blend — reads as emulsion, not noise. */
body::after {
  content: '';
  position: fixed;
  inset: -50%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-drift 7s steps(6) infinite;
}

@keyframes grain-drift {
  0%   { transform: translate(0, 0); }
  16%  { transform: translate(-3%, 2%); }
  33%  { transform: translate(2%, -3%); }
  50%  { transform: translate(-2%, -2%); }
  66%  { transform: translate(3%, 1%); }
  83%  { transform: translate(-1%, 3%); }
  100% { transform: translate(0, 0); }
}

.app-container {
  position: relative;
  z-index: 2;
  gap: 12px;
  padding: 12px;
}

/* ==========================================================================
   2. HEADER — instrument bar
   ========================================================================== */

.app-header {
  position: relative;
  flex: 0 0 auto;
  height: auto;
  min-height: 70px;
  gap: 16px;
  padding: 12px 16px 12px 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    linear-gradient(180deg, rgba(255, 238, 214, 0.045), transparent 60%),
    var(--ink-800);
  box-shadow: var(--shadow-panel);
}

/* Safelight strip down the left edge of the bar. */
.app-header::before {
  content: '';
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--amber), var(--amber-deep));
  box-shadow: 0 0 18px var(--amber-glow);
}

.header-logo {
  gap: 13px;
  min-width: 0;
}

.logo-image {
  width: 40px;
  height: 40px;
  padding: 5px;
  object-fit: contain;
  border-radius: 11px;
  background: #fffdf9;
  box-shadow:
    0 0 0 1px rgba(255, 238, 214, 0.16),
    0 6px 14px -6px rgba(0, 0, 0, 0.8);
}

.app-title-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}

.brand-kicker {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--amber);
}

.brand-service-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.header-logo h1 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--paper);
}

.active-service-badge {
  height: 21px;
  min-width: 0;
  padding: 0 9px;
  border: 1px solid rgba(99, 214, 208, 0.3);
  border-radius: 6px;
  background: rgba(99, 214, 208, 0.1);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.version-badge {
  height: 21px;
  min-width: 0;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 238, 214, 0.035);
  color: var(--paper-mute);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.header-actions {
  gap: 10px;
}

/* ==========================================================================
   3. ENGINE SWITCHER — segmented control, all three always visible
   ========================================================================== */

.service-dropdown.engine-switch {
  position: relative;
  margin: 0;
}

.service-dropdown-trigger[hidden] {
  display: none !important;
}

.engine-switch .service-dropdown-menu {
  display: flex !important;
  flex-direction: row !important;
  position: static;
  gap: 3px;
  min-width: 0;
  padding: 4px;
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.32);
  box-shadow: 0 1px 0 rgba(255, 238, 214, 0.04) inset;
}

.engine-switch .service-dropdown-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 5px 13px 5px 6px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--paper-dim);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}

.engine-switch .service-dropdown-item .svc-logo {
  width: 26px;
  height: 26px;
  padding: 3px;
  object-fit: contain;
  border-radius: 8px;
  background: #fffdf9;
  opacity: 0.62;
  transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease);
}

.engine-switch .service-dropdown-item:hover {
  color: var(--paper);
  background: rgba(255, 238, 214, 0.05);
}

.engine-switch .service-dropdown-item:hover .svc-logo {
  opacity: 1;
}

.engine-switch .service-dropdown-item.active {
  color: var(--paper);
  border-color: rgba(255, 143, 66, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 143, 66, 0.2), rgba(255, 143, 66, 0.07));
  box-shadow:
    0 1px 0 rgba(255, 238, 214, 0.1) inset,
    0 6px 16px -8px rgba(255, 143, 66, 0.55);
}

.engine-switch .service-dropdown-item.active .svc-logo {
  opacity: 1;
  transform: scale(1.04);
}

/* ==========================================================================
   4. BUTTONS
   ========================================================================== */

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.005em;
  border-radius: var(--r-sm);
  transition:
    transform var(--fast) var(--ease),
    background var(--fast) var(--ease),
    border-color var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.btn-primary,
.btn.btn-primary,
.header-actions .btn-primary,
#btn-connect {
  color: #1a0f07;
  border-color: transparent;
  background: linear-gradient(180deg, var(--amber-hot), var(--amber-deep));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28) inset,
    0 8px 20px -10px rgba(255, 143, 66, 0.8);
}

.btn-primary:hover,
.header-actions .btn-primary:hover,
#btn-connect:hover {
  background: linear-gradient(180deg, #ffbc85, var(--amber));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.34) inset,
    0 12px 26px -10px rgba(255, 143, 66, 0.9);
}

.btn-secondary,
.btn-folder-select,
.header-actions .btn-secondary,
#btn-check-email {
  color: var(--paper-dim);
  border-color: var(--line-strong);
  background: rgba(255, 238, 214, 0.045);
  box-shadow: none;
}

.btn-secondary:hover,
.btn-folder-select:hover,
.header-actions .btn-secondary:hover,
#btn-check-email:hover {
  color: var(--paper);
  border-color: rgba(255, 238, 214, 0.3);
  background: rgba(255, 238, 214, 0.09);
}

.header-actions #btn-tour {
  color: var(--cyan);
  border-color: rgba(99, 214, 208, 0.32);
  background: rgba(99, 214, 208, 0.08);
  box-shadow: none;
}

.header-actions #btn-tour:hover {
  color: #0c0908;
  border-color: transparent;
  background: var(--cyan);
}

.btn-danger {
  color: #fff6f3;
  border-color: transparent;
  background: linear-gradient(180deg, var(--clay), var(--clay-deep));
  box-shadow: 0 8px 20px -12px rgba(239, 95, 74, 0.9);
}

.btn-large {
  padding: 12px 22px;
  font-size: 14px;
}

.btn-sidebar-upgrade {
  display: none !important;
}

/* ==========================================================================
   5. SHELL GRID
   ========================================================================== */

.app-main {
  display: grid !important;
  grid-template-columns: 236px minmax(0, 1fr) 258px !important;
  grid-template-rows: minmax(0, 1fr) !important;
  gap: 12px;
  min-height: 0;
}

.app-sidebar {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: auto;
  min-height: 0;
  padding: 16px 12px;
  overflow: hidden auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start !important;
  gap: 8px;
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    linear-gradient(180deg, rgba(255, 238, 214, 0.04), transparent 42%),
    var(--ink-800);
  box-shadow: var(--shadow-panel);
}

.app-content {
  grid-column: 2 !important;
  grid-row: 1 !important;
  min-width: 0;
  min-height: 0;
  /* The panel itself is the only chrome now — the shell behind it is bare, so
     the old ivory "bench" plate and its border/shadow have to go. */
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.content-tab-panel {
  padding: 0;
}

/* `min-height:100%` on an auto-height parent gives children nothing to resolve
   a percentage against, so the card used to stop short of the shell. Make the
   active panel a definite-height flex column and let the card claim the rest. */
.content-tab-panel.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.content-tab-panel.active > .card {
  flex: 1 1 auto;
  min-height: 0;
}

.account-sidebar {
  grid-column: 3 !important;
  grid-row: 1 !important;
  min-height: 0;
  padding: 0;
  overflow: hidden auto;
  background: transparent;
}

/* ==========================================================================
   6. LEFT RAIL — nav
   ========================================================================== */

.nav-section-label {
  margin: 2px 0 10px 8px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper-mute);
}

.app-sidebar .side-nav {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: flex-start !important;
  gap: 4px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  width: 100%;
  min-height: 44px;
  height: auto;
  padding: 8px 12px 8px 10px;
  border: 1px solid transparent;
  border-left: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--paper-dim);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition:
    color var(--fast) var(--ease),
    background var(--fast) var(--ease),
    border-color var(--fast) var(--ease);
}

.nav-item > span:not(.nav-badge) {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Icon sits in its own tinted plate — gives the rail a rhythm a flat list lacks. */
.nav-item .nav-icon {
  flex: 0 0 auto;
  box-sizing: content-box;
  width: 18px;
  height: 18px;
  padding: 6px;
  border-radius: 9px;
  background: rgba(255, 238, 214, 0.05);
  color: var(--paper-dim);
  transition:
    background var(--fast) var(--ease),
    color var(--fast) var(--ease),
    transform var(--slow) var(--ease);
}

.nav-item:hover {
  color: var(--paper);
  background: rgba(255, 238, 214, 0.045);
}

.nav-item:hover .nav-icon {
  background: rgba(255, 238, 214, 0.1);
  color: var(--paper);
  transform: translateX(1px);
}

.nav-item.active {
  color: var(--paper);
  border-color: rgba(255, 143, 66, 0.22);
  background:
    linear-gradient(90deg, rgba(255, 143, 66, 0.15), rgba(255, 143, 66, 0.03) 68%, transparent);
  box-shadow: 0 1px 0 rgba(255, 238, 214, 0.06) inset;
}

.nav-item.active .nav-icon {
  color: var(--amber);
  background: rgba(255, 143, 66, 0.16);
}

/* Replace the legacy underline marker with a safelight bar on the left edge. */
.nav-item.active::after {
  content: '';
  position: absolute;
  top: 11px;
  bottom: 11px;
  left: -12px;
  right: auto;
  width: 3px;
  height: auto;
  border-radius: 0 3px 3px 0;
  background: var(--amber);
  box-shadow: 0 0 14px var(--amber-glow);
}

.nav-badge {
  flex: 0 0 auto;
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(99, 214, 208, 0.16);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-align: center;
}

/* ==========================================================================
   7. RIGHT RAIL — licence readout
   ========================================================================== */

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.license-summary {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    linear-gradient(180deg, rgba(255, 238, 214, 0.04), transparent 38%),
    var(--ink-800);
  box-shadow: var(--shadow-panel);
}

.hwid-info,
.hwid-display-card,
.velora-license-hwid,
#auth-loading-overlay {
  display: none !important;
}

#update-modal.is-force {
  pointer-events: auto;
}

#update-modal.is-force .btn-close-modal,
#update-modal.is-force #btn-update-later {
  display: none !important;
}

.hwid-info .label,
.sidebar-footer .license-row .label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper-mute);
}

.hwid-info #hwid-val {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.45;
  color: var(--paper-dim);
  word-break: break-all;
}

.license-rows {
  display: flex;
  flex-direction: column;
  padding: 6px;
  border-left: 0;
}

.sidebar-footer .trial-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: var(--r-sm);
  background: transparent;
  transition: background var(--fast) var(--ease);
}

.sidebar-footer .trial-info:hover {
  background: rgba(255, 238, 214, 0.04);
}

.sidebar-footer .trial-info .label {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--paper-dim);
}

.trial-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-footer .trial-info-row .time-val {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--cyan);
}

.contact-link-container {
  padding: 0 2px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--paper-mute);
  font-size: 12px;
  text-decoration: none;
  transition: color var(--fast) var(--ease);
}

.contact-link:hover {
  color: var(--amber);
}

/* ==========================================================================
   8. CONTENT PANEL
   ========================================================================== */

.content-tab-panel {
  height: 100%;
  min-height: 0;
}

.app-content .card,
#sec-upload .card,
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    linear-gradient(180deg, rgba(255, 238, 214, 0.045), transparent 30%),
    var(--ink-780);
  box-shadow: var(--shadow-panel);
}

.card-header {
  position: relative;
  flex: 0 0 auto;
  padding: 22px 26px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}

/* Measurement ticks along the header baseline — film-edge reference. */
.card-header::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  width: auto;
  height: 6px;
  border-radius: 0;
  /* The legacy rule painted a solid coral bar here via the `background`
     shorthand — an image-only override leaves that colour behind. */
  background-color: transparent;
  background-image: repeating-linear-gradient(
    90deg,
    var(--line-strong) 0 1px,
    transparent 1px 14px
  );
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 38%);
  mask-image: linear-gradient(90deg, #000, transparent 38%);
  opacity: 0.85;
}

.card-header h2,
.section-title-with-logo,
.section-title-with-logo span,
#sec-upload h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.032em;
  line-height: 1.2;
  color: var(--paper);
}

.section-title-with-logo {
  display: flex;
  align-items: center;
  gap: 11px;
}

.section-title-logo {
  width: 30px;
  height: 30px;
  padding: 4px;
  object-fit: contain;
  border-radius: 9px;
  background: #fffdf9;
  box-shadow: 0 0 0 1px rgba(255, 238, 214, 0.14);
}

.card-header p,
#sec-upload p {
  margin-top: 7px;
  max-width: 64ch;
  font-size: 13px;
  line-height: 1.55;
  color: var(--paper-dim);
}

.card-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 22px 26px;
  overflow: auto;
}

.card-footer {
  flex: 0 0 auto;
  padding: 14px 26px;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.24);
}

.empty-state {
  padding: 26px 0;
  color: var(--paper-mute);
  font-size: 13px;
  text-align: center;
}

.upload-results-head h3,
.card-body h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--paper);
}

/* ==========================================================================
   9. DROPZONE — focus-frame plate
   ========================================================================== */

.upload-dropzone-container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 14px;
  min-height: 0;
  padding: 4px;
}

.upload-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: none;
  min-height: 300px;
  padding: 44px 28px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--line) !important;
  border-radius: 18px !important;
  /* Four corner brackets drawn as gradient layers — a camera focus frame. */
  background-image:
    linear-gradient(var(--line-strong), var(--line-strong)),
    linear-gradient(var(--line-strong), var(--line-strong)),
    linear-gradient(var(--line-strong), var(--line-strong)),
    linear-gradient(var(--line-strong), var(--line-strong)),
    linear-gradient(var(--line-strong), var(--line-strong)),
    linear-gradient(var(--line-strong), var(--line-strong)),
    linear-gradient(var(--line-strong), var(--line-strong)),
    linear-gradient(var(--line-strong), var(--line-strong)),
    radial-gradient(90% 70% at 50% 0%, rgba(255, 143, 66, 0.07), transparent 70%) !important;
  background-repeat: no-repeat !important;
  background-position:
    18px 18px, 18px 18px,
    calc(100% - 18px) 18px, calc(100% - 18px) 18px,
    18px calc(100% - 18px), 18px calc(100% - 18px),
    calc(100% - 18px) calc(100% - 18px), calc(100% - 18px) calc(100% - 18px),
    50% 0 !important;
  background-size:
    26px 1.5px, 1.5px 26px,
    26px 1.5px, 1.5px 26px,
    26px 1.5px, 1.5px 26px,
    26px 1.5px, 1.5px 26px,
    100% 100% !important;
  background-color: rgba(0, 0, 0, 0.2) !important;
  transition:
    border-color var(--slow) var(--ease),
    background-color var(--slow) var(--ease),
    transform var(--slow) var(--ease);
}

/* Slow scan sweep — the one ambient motion on this screen. */
.upload-dropzone::before {
  content: '';
  position: absolute;
  inset: 0;
  /* Legacy gave this pseudo a fixed 145px decorative blob size; inset alone
     cannot undo an explicit width/height. */
  width: auto;
  height: auto;
  z-index: 0;
  border: 0;
  border-radius: inherit;
  background: linear-gradient(
    100deg,
    transparent 38%,
    rgba(255, 143, 66, 0.07) 50%,
    transparent 62%
  );
  background-size: 260% 100%;
  animation: plate-scan 6.5s var(--ease) infinite;
  pointer-events: none;
}

.upload-dropzone::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  top: auto;
  z-index: 0;
  width: auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--amber-glow), transparent);
  opacity: 0;
  transition: opacity var(--slow) var(--ease);
  pointer-events: none;
}

@keyframes plate-scan {
  0%, 12%   { background-position: 160% 0; }
  70%, 100% { background-position: -60% 0; }
}

.upload-dropzone > * {
  position: relative;
  z-index: 1;
}

.upload-dropzone:hover {
  border-color: rgba(255, 143, 66, 0.5) !important;
  background-color: rgba(255, 143, 66, 0.045) !important;
  transform: translateY(-2px);
}

.upload-dropzone:hover::after {
  opacity: 1;
}

.dropzone-icon {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  margin-bottom: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 238, 214, 0.07), transparent),
    rgba(0, 0, 0, 0.3);
  box-shadow: var(--shadow-raise);
}

/* Kill the inline indigo/green gradient paint the markup hardcodes. */
.upload-dropzone .dropzone-icon svg {
  width: 34px;
  height: 34px;
  stroke: var(--amber) !important;
  filter: drop-shadow(0 4px 12px rgba(255, 143, 66, 0.4)) !important;
}

.upscale-dropzone .dropzone-icon svg,
.dte-dropzone .dte-drop-icon svg {
  stroke: var(--cyan) !important;
  filter: drop-shadow(0 4px 12px rgba(99, 214, 208, 0.36)) !important;
}

.upscale-dropzone:hover,
.dte-dropzone:hover {
  border-color: rgba(99, 214, 208, 0.5) !important;
  background-color: rgba(99, 214, 208, 0.045) !important;
}

.upload-dropzone h3 {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--paper);
}

.upload-dropzone p {
  max-width: 46ch;
  margin-top: 9px;
  color: var(--paper-mute);
  font-size: 12.5px;
  line-height: 1.55;
  text-align: center;
}

.dropzone-actions {
  margin-top: 20px;
}

.upscale-summary {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, 0.22);
  color: var(--paper-dim);
  font-family: var(--font-mono);
  font-size: 12px;
}

.dte-dropzone {
  border: 1px solid var(--line) !important;
  border-radius: 18px !important;
  background: rgba(0, 0, 0, 0.2) !important;
}

/* ==========================================================================
   10. FORMS, TABLES, SURFACES
   ========================================================================== */

.text-input,
.form-input,
.form-control,
input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
select,
textarea {
  color: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.3);
  font-family: var(--font-body);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

.text-input::placeholder,
.form-input::placeholder,
.form-control::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--paper-mute);
}

.text-input:focus,
.form-input:focus,
.form-control:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(255, 143, 66, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 143, 66, 0.14);
}

.cloud-credit-card,
.checkbox-group,
.setting-card,
.option-card,
.console-box,
.upload-inline-progress {
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, 0.22);
}

.option-card:hover,
.setting-card:hover {
  border-color: var(--line-strong);
}

.listings-table-container {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, 0.18);
}

.listings-table th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
  color: var(--paper-mute);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.listings-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--paper-dim);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.45;
}

.listings-table tr:hover td {
  background: rgba(255, 238, 214, 0.04);
  color: var(--paper);
}

.progress-bar-bg {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
}

.progress-bar-fill {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--amber-deep), var(--amber-hot));
  box-shadow: 0 0 14px var(--amber-glow);
}

.progress-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--paper-dim);
}

.custom-scrollbar::-webkit-scrollbar,
.card-body::-webkit-scrollbar,
.app-sidebar::-webkit-scrollbar,
.account-sidebar::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.custom-scrollbar::-webkit-scrollbar-thumb,
.card-body::-webkit-scrollbar-thumb,
.app-sidebar::-webkit-scrollbar-thumb,
.account-sidebar::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(255, 238, 214, 0.16);
  background-clip: content-box;
}

.custom-scrollbar::-webkit-scrollbar-track,
.card-body::-webkit-scrollbar-track {
  background: transparent;
}

/* ==========================================================================
   11. MODALS + OVERLAYS
   ========================================================================== */

.modal-overlay,
.payment-modal,
.confirm-modal-overlay,
.modal-backdrop {
  background: rgba(8, 6, 5, 0.78);
  backdrop-filter: blur(8px) saturate(0.8);
}

.modal-content,
.modal-card,
.payment-modal-content,
.confirm-modal,
.wizard-modal-content,
.bracket-modal-content,
.global-lock-card {
  color: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background:
    linear-gradient(180deg, rgba(255, 238, 214, 0.05), transparent 26%),
    var(--ink-750);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.9);
}

.modal-header,
.wizard-modal-header {
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}

.modal-footer,
.wizard-modal-footer {
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.24);
}

.modal-header h2,
.modal-header h3,
.wizard-modal-header h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.028em;
  color: var(--paper);
}

.btn-close-modal {
  border: 0;
  background: transparent;
  color: var(--paper-mute);
  cursor: pointer;
  transition: color var(--fast) var(--ease);
}

.btn-close-modal:hover {
  color: var(--paper);
}

.service-lock-overlay,
.global-lock-overlay {
  background: rgba(8, 6, 5, 0.86);
  backdrop-filter: blur(10px);
}

.lock-content h2,
.global-lock-card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--paper);
}

/* intro.js tour — match the console instead of its stock white sheet. */
.introjs-tooltip {
  color: var(--paper) !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: var(--r-md) !important;
  background: var(--ink-750) !important;
  box-shadow: 0 30px 70px -26px rgba(0, 0, 0, 0.9) !important;
}

.introjs-tooltiptext,
.introjs-tooltip-title {
  color: var(--paper) !important;
}

.introjs-tooltip-title {
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
}

.introjs-arrow.top { border-bottom-color: var(--ink-750) !important; }
.introjs-arrow.bottom { border-top-color: var(--ink-750) !important; }
.introjs-arrow.left { border-right-color: var(--ink-750) !important; }
.introjs-arrow.right { border-left-color: var(--ink-750) !important; }

.introjs-button {
  color: var(--paper) !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 9px !important;
  background: rgba(255, 238, 214, 0.06) !important;
  text-shadow: none !important;
}

.introjs-button:hover {
  background: rgba(255, 238, 214, 0.12) !important;
}

.introjs-nextbutton {
  color: #1a0f07 !important;
  border-color: transparent !important;
  background: linear-gradient(180deg, var(--amber-hot), var(--amber-deep)) !important;
}

.introjs-progress { background: rgba(0, 0, 0, 0.5) !important; }
.introjs-progressbar { background: var(--amber) !important; }

.introjs-helperLayer {
  border-radius: var(--r-md) !important;
  box-shadow: 0 0 0 5000px rgba(8, 6, 5, 0.78), 0 0 0 2px var(--amber) !important;
}

/* ==========================================================================
   12. LICENCE GATE
   ========================================================================== */

.velora-license-gate {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(70% 55% at 12% -6%, rgba(255, 143, 66, 0.2), transparent 60%),
    radial-gradient(55% 45% at 100% 100%, rgba(99, 214, 208, 0.1), transparent 58%),
    var(--ink-900);
}

.velora-license-gate.hidden {
  display: none;
}

.velora-boot-loading {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100010;
  place-items: center;
  align-content: center;
  gap: 16px;
  color: var(--paper-dim);
  font-size: 14px;
  background:
    radial-gradient(70% 55% at 12% -6%, rgba(255, 143, 66, 0.2), transparent 60%),
    var(--ink-900);
}

html.velora-booting .velora-boot-loading {
  display: grid;
}

html.velora-booting .velora-license-gate,
html.velora-booting #onboarding-welcome-modal {
  visibility: hidden;
}

.velora-boot-spinner {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255, 238, 214, 0.12);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: velora-spin 0.7s linear infinite;
}

@keyframes velora-spin {
  to { transform: rotate(360deg); }
}

.token-connect-card {
  max-width: 560px;
  width: min(560px, calc(100vw - 32px));
  text-align: left;
}
.token-connect-help {
  font-size: 13px;
  color: var(--text-muted);
  margin: 8px 0 12px;
  line-height: 1.45;
}
#token-connect-input {
  width: 100%;
  min-height: 120px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
}
.token-connect-status {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
}
.token-connect-status-ok {
  background: rgba(52, 199, 89, 0.12);
  color: #8dffb3;
}
.token-connect-status-err {
  background: rgba(255, 59, 48, 0.12);
  color: #ffb4ae;
}
.token-connect-status-info {
  background: rgba(255, 143, 66, 0.12);
  color: var(--paper-dim, #d8cfc4);
}
.token-connect-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  justify-content: flex-end;
}

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100020;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--ink-780);
  color: var(--paper);
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.toast-ok { border-color: rgba(99, 214, 208, 0.4); }
.toast-err { border-color: rgba(239, 95, 74, 0.45); }
.toast-info { border-color: rgba(255, 143, 66, 0.4); }
.results-loading {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 143, 66, 0.08);
  color: var(--paper-dim);
  font-size: 13px;
}

.velora-license-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  width: min(920px, 100%);
  padding: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 238, 214, 0.06), transparent 28%),
    var(--ink-780);
  box-shadow: 0 50px 100px -34px rgba(0, 0, 0, 0.95);
}

@media (min-width: 840px) {
  .velora-license-card {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
  }
  .license-card-brand {
    padding: 42px 36px 40px;
    border-right: 1px solid var(--line);
    background:
      radial-gradient(80% 70% at 0% 0%, rgba(255, 143, 66, 0.16), transparent 55%),
      var(--ink-800);
  }
  .license-card-form {
    display: grid;
    align-content: center;
    gap: 13px;
    padding: 42px 36px 40px;
  }
}

.license-card-brand,
.license-card-form {
  display: grid;
  gap: 13px;
}

.license-lede {
  max-width: 36ch;
}

.velora-license-card h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--paper);
}

/* Narrow at the source: a descendant selector (0,1,1) would otherwise beat the
   .brand-kicker / .velora-license-error classes sitting on these same <p>s. */
.velora-license-card p.license-lede,
.velora-license-card > p:not(.brand-kicker):not(.velora-license-error):not(.velora-license-hwid) {
  color: var(--paper-dim);
  font-size: 13px;
  line-height: 1.55;
}

.velora-license-mark,
.onboarding-welcome-logo {
  width: 54px;
  height: 54px;
  padding: 7px;
  object-fit: contain;
  border-radius: 15px;
  background: #fffdf9;
  box-shadow: 0 0 0 1px rgba(255, 238, 214, 0.16), 0 12px 26px -12px rgba(0, 0, 0, 0.9);
}

.license-engines {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 2px 0 4px;
}

.license-engines span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 238, 214, 0.045);
  color: var(--paper-dim);
  font-size: 12px;
  font-weight: 500;
}

.license-engines img {
  width: 20px;
  height: 20px;
  padding: 2px;
  object-fit: contain;
  border-radius: 6px;
  background: #fffdf9;
}

.velora-license-card label {
  display: grid;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-mute);
}

.velora-license-card input {
  padding: 13px 14px;
  color: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, 0.36);
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.velora-license-card input::placeholder {
  letter-spacing: 0.02em;
  text-transform: none;
}

.velora-license-card .btn-primary {
  padding: 13px;
  font-size: 14px;
}

.license-remember-row {
  display: flex !important;
  grid-template-columns: none;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--font-body) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: var(--paper-dim) !important;
  cursor: pointer;
}

.license-remember-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--amber);
  text-transform: none;
  letter-spacing: 0;
}

.license-remembered {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(99, 214, 208, 0.28);
  border-radius: 16px;
  background: rgba(99, 214, 208, 0.08);
}

.license-remembered.hidden {
  display: none !important;
}

.license-remembered-label {
  margin: 0;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.license-remembered code {
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.08em;
}

.license-remembered-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.license-remembered-actions .btn {
  flex: 1 1 auto;
  min-height: 40px;
}

.velora-license-error {
  min-height: 1.2em;
  color: var(--clay);
  font-size: 12.5px;
}

.velora-license-hwid {
  margin-top: 2px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--paper-mute);
  font-family: var(--font-mono);
  font-size: 10.5px;
  word-break: break-all;
}

/* ==========================================================================
   13. ENTRANCE MOTION
   ========================================================================== */

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.app-header,
.app-sidebar,
.app-content,
.account-sidebar {
  animation: rise-in var(--slow) var(--ease) both;
}

.app-header      { animation-delay: 0ms; }
.app-sidebar     { animation-delay: 60ms; }
.app-content     { animation-delay: 110ms; }
.account-sidebar { animation-delay: 160ms; }

.side-nav .nav-item {
  animation: rise-in 360ms var(--ease) both;
}

.side-nav .nav-item:nth-child(1) { animation-delay: 150ms; }
.side-nav .nav-item:nth-child(2) { animation-delay: 190ms; }
.side-nav .nav-item:nth-child(3) { animation-delay: 230ms; }
.side-nav .nav-item:nth-child(4) { animation-delay: 270ms; }
.side-nav .nav-item:nth-child(5) { animation-delay: 310ms; }

@media (prefers-reduced-motion: reduce) {
  body::after,
  .upload-dropzone::before,
  .app-header,
  .app-sidebar,
  .app-content,
  .account-sidebar,
  .side-nav .nav-item {
    animation: none !important;
  }

  * {
    transition-duration: 1ms !important;
  }
}

/* ==========================================================================
   14. RESPONSIVE
   ========================================================================== */

@media (max-width: 1320px) {
  .app-main {
    grid-template-columns: 212px minmax(0, 1fr) 230px !important;
  }

  .engine-switch .service-dropdown-item {
    padding-right: 9px;
  }
}

@media (max-width: 1150px) {
  .app-main {
    grid-template-columns: 196px minmax(0, 1fr) !important;
  }

  .account-sidebar {
    display: none;
  }

  .engine-switch .service-dropdown-item span {
    display: none;
  }

  .engine-switch .service-dropdown-item {
    padding: 5px 6px;
  }
}

@media (max-width: 900px) {
  body {
    position: static;
    height: auto;
    overflow: auto;
  }

  .app-container {
    height: auto;
    min-height: 100vh;
    padding: 10px;
  }

  .app-header {
    flex-wrap: wrap;
    gap: 12px;
  }

  .header-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .app-main {
    display: flex !important;
    flex-direction: column;
  }

  .app-sidebar {
    width: 100%;
    overflow: visible;
  }

  .app-sidebar .side-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .nav-item {
    width: auto;
    flex: 1 1 140px;
  }

  .nav-item.active::after {
    top: auto;
    right: 12px;
    bottom: -8px;
    left: 12px;
    width: auto;
    height: 3px;
    border-radius: 3px 3px 0 0;
  }

  .app-content {
    min-height: 62vh;
  }

  .card-header h2,
  .section-title-with-logo,
  .section-title-with-logo span {
    font-size: 19px;
  }

  .upload-dropzone {
    min-height: 240px;
    padding: 32px 18px;
  }

  .upload-dropzone h3 {
    font-size: 19px;
  }
}

@media (max-width: 520px) {
  .app-container,
  .card-body,
  .card-header,
  .card-footer {
    padding-inline: 16px;
  }

  .header-logo h1 {
    font-size: 18px;
  }

  /* The version/expiry chips otherwise run under the header's overflow clip. */
  .brand-service-line {
    flex-wrap: wrap;
  }

  /* The upload header lays its title and action out with an inline flex style.
     Wrapping is not part of that inline rule, so it can still be relaxed here
     and the action dropped to its own line instead of squeezing the heading. */
  .card-header {
    flex-wrap: wrap;
  }

  .card-header > div:first-child {
    flex: 1 1 100%;
  }

  .dropzone-icon {
    width: 64px;
    height: 64px;
  }
}

/* ==========================================================================
   15. LATE CORRECTIONS
   Surfaces the first pass could not see until each tab was actually opened.
   ========================================================================== */

/* The DTE start button carried a hardcoded navy from the old light bench and
   read as a disabled bar on this ground. It is a primary action. */
#btn-start-dte {
  color: #1a0f07 !important;
  border-color: transparent !important;
  background: linear-gradient(180deg, var(--amber-hot), var(--amber-deep)) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28) inset,
    0 8px 20px -10px rgba(255, 143, 66, 0.8) !important;
}

/* Native controls still rendered in the UA light palette. */
input[type='checkbox'],
input[type='radio'] {
  width: 15px;
  height: 15px;
  accent-color: var(--amber);
  cursor: pointer;
}

select option {
  color: var(--paper);
  background: var(--ink-750);
}

/* The clickable listing name is a <td class="listing-name"> carrying an inline
   `color: var(--primary)` — it already tracks the accent, it just never had a
   hover state to prove it is clickable. */
.listings-table a,
.listings-table .listing-name {
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 143, 66, 0.45);
  transition: color var(--fast) var(--ease), text-decoration-color var(--fast) var(--ease);
}

.listings-table a:hover,
.listings-table tr:hover .listing-name {
  color: var(--amber-hot) !important;
  text-decoration-color: var(--amber-hot);
}

#sec-results .card {
  min-width: 0;
}

#sec-results .card-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#sec-results .results-listing-wrap {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

#sec-results .results-listing {
  width: 100%;
}

#sec-results .results-open-btn {
  font-size: 12.5px;
  padding: 6px 12px;
  white-space: nowrap;
}

.dte-options-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

@media (max-width: 720px) {
  .dte-options-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  #sec-results .results-listing th:nth-child(3),
  #sec-results .results-listing td:nth-child(3) {
    display: none;
  }

  #sec-results .results-listing th,
  #sec-results .results-listing td {
    padding: 10px 10px;
  }

  #sec-results .results-open-extra {
    display: none;
  }
}

/* Both rails run the full height of the chassis. Rather than leave the space
   below the content simply blank, mark it like a film edge so the emptiness
   reads as part of the instrument. */
.app-sidebar,
.license-summary {
  position: relative;
}

.app-sidebar::after {
  content: '';
  position: absolute;
  right: 10px;
  bottom: 14px;
  width: 3px;
  height: min(46%, 320px);
  border-radius: 3px;
  background-image: repeating-linear-gradient(
    180deg,
    var(--line-strong) 0 1px,
    transparent 1px 11px
  );
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 55%);
  mask-image: linear-gradient(180deg, transparent, #000 55%);
  pointer-events: none;
}

@media (max-width: 900px) {
  .app-sidebar::after {
    display: none;
  }
}

/* ==========================================================================
   16. STYLE PROFILES MODAL
   This sub-system paints itself with inline zinc/blue attributes, so the
   overrides are scoped to its id and have to out-rank inline styles.
   ========================================================================== */

#style-profiles-modal .modal {
  border: 1px solid var(--line-strong) !important;
  border-radius: var(--r-lg) !important;
  background:
    linear-gradient(180deg, rgba(255, 238, 214, 0.05), transparent 22%),
    var(--ink-750) !important;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.9) !important;
}

#style-profiles-modal [style*='border-bottom'],
#style-profiles-modal [style*='border-right'],
#style-profiles-modal [style*='border-top'] {
  border-color: var(--line) !important;
}

#style-profiles-modal .modal-header {
  background: rgba(0, 0, 0, 0.2) !important;
}

#style-profiles-modal .modal-header h3 {
  color: var(--paper) !important;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Only the tracked all-caps kicker ("COLOR MIXER") becomes a mono label — the
   other h4 is a real Vietnamese heading and must stay in the body face. */
#style-profiles-modal h4[style*='letter-spacing'] {
  color: var(--paper-mute) !important;
  font-family: var(--font-mono);
}

#style-profiles-modal h4:not([style*='letter-spacing']) {
  color: var(--paper) !important;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

#style-profiles-modal select,
#style-profiles-modal .form-control {
  color: var(--paper) !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: var(--r-sm) !important;
  background-color: rgba(0, 0, 0, 0.32) !important;
}

/* Segmented Interior / Exterior tabs — colours owned here, not in the JS. */
#style-profiles-modal .sp-tab {
  background-color: transparent !important;
  color: var(--paper-dim) !important;
  transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}

#style-profiles-modal .sp-tab:hover {
  color: var(--paper) !important;
  background-color: rgba(255, 238, 214, 0.06) !important;
}

#style-profiles-modal .sp-tab.is-active {
  color: #1a0f07 !important;
  background-color: var(--amber) !important;
}

/* Slider troughs, mixer wells and the tab rail all used zinc #27272a. */
#style-profiles-modal [style*='background-color: #27272a'],
#style-profiles-modal [style*='background-color:#27272a'],
#style-profiles-modal [style*='background-color: #141416'] {
  background-color: rgba(0, 0, 0, 0.3) !important;
}

#style-profiles-modal input[type='range'] {
  accent-color: var(--amber);
}

/* The two save actions are primary; the blue fill predates this theme. */
#style-profiles-modal [style*='background-color: #3b82f6'],
#style-profiles-modal [style*='background-color:#3b82f6'] {
  color: #1a0f07 !important;
  border-color: transparent !important;
  background-color: var(--amber) !important;
  background-image: linear-gradient(180deg, var(--amber-hot), var(--amber-deep)) !important;
}

#style-profiles-modal .btn-close-modal {
  color: var(--paper-mute) !important;
}

#style-profiles-modal .btn-close-modal:hover {
  color: var(--paper) !important;
}

/* Two surfaces stay light because the old sheet nailed them down; both only
   appear on states the first sweep did not have open (AutoHDR lookup button,
   Virtual Twilight upload row), so they are corrected at the same weight. */
#btn-check-email {
  color: var(--paper-dim) !important;
  border-color: var(--line-strong) !important;
  background: rgba(255, 238, 214, 0.045) !important;
}

#btn-check-email:hover {
  color: var(--paper) !important;
  background: rgba(255, 238, 214, 0.09) !important;
}

.dte-dropzone .dte-drop-icon {
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, rgba(255, 238, 214, 0.07), transparent),
    rgba(0, 0, 0, 0.3);
  box-shadow: var(--shadow-raise);
}
