:root {
  color-scheme: light;
  --bg: #e9eef6;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #65758b;
  --line: #d8e0ed;
  --accent: #2f6df6;
  --accent-dark: #1f55d8;
  --accent-cyan: #22d3ee;
  --navy: #081527;
  --navy-2: #10233d;
  --soft: #f5f8fc;
  --success: #089981;
  --danger: #b42318;
  --code: #07111f;
  --code-text: #dbeafe;
  --shadow: 0 18px 44px rgba(8, 21, 39, 0.1);
  --sidebar-width: 320px;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #081527 0 74px, transparent 74px),
    linear-gradient(135deg, rgba(47, 109, 246, 0.08), rgba(34, 211, 238, 0.06) 34%, transparent 68%),
    var(--bg);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(8, 21, 39, 0.03);
}

button:hover:not(:disabled) {
  border-color: #9fb4d5;
  box-shadow: 0 8px 18px rgba(8, 21, 39, 0.08);
}

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

button.primary {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), #16a7dc);
  color: #fff;
  box-shadow: 0 10px 22px rgba(47, 109, 246, 0.22);
}

button.primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

button.ghost {
  background: rgba(245, 248, 252, 0.86);
}

.hidden {
  display: none !important;
}

.login-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 32px;
  align-items: center;
  width: min(1180px, calc(100vw - 40px));
  min-height: 100vh;
  margin: 0 auto;
}

.login-copy {
  border-radius: 18px;
  padding: 36px;
  background:
    linear-gradient(135deg, rgba(8, 21, 39, 0.96), rgba(16, 35, 61, 0.92)),
    var(--navy);
  color: #fff;
  box-shadow: var(--shadow);
}

.login-copy h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(38px, 5vw, 72px);
  line-height: 1.02;
  letter-spacing: 0;
}

.login-copy p:not(.eyebrow) {
  max-width: 640px;
  color: #c8d6ea;
  font-size: 18px;
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-cyan);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-card,
.panel,
.sidebar {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card {
  display: grid;
  gap: 12px;
  padding: 26px;
}

.auth-card-title {
  display: grid;
  gap: 3px;
  margin-bottom: 4px;
}

.auth-card-title h2 {
  margin: 0;
  font-size: 22px;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  background: var(--soft);
}

.auth-mode-tabs button {
  min-height: 36px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-weight: 700;
}

.auth-mode-tabs button.active {
  border-color: #c9d6ea;
  background: #fff;
  color: var(--accent-dark);
  box-shadow: 0 5px 14px rgba(8, 21, 39, 0.08);
}

.auth-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

label {
  display: grid;
  gap: 8px;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 11px 12px;
}

textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.55;
}

textarea.short {
  min-height: 90px;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(47, 109, 246, 0.15);
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.global-error {
  min-height: 0;
  font-weight: 600;
}

.app-view {
  display: grid;
  grid-template-columns: var(--sidebar-width, 320px) 18px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  border-width: 0 1px 0 0;
  border-radius: 0;
  padding: 22px 18px 18px;
  background:
    linear-gradient(180deg, rgba(8, 21, 39, 0.98), rgba(10, 24, 44, 0.96) 134px, #ffffff 134px),
    #fff;
  box-shadow: 12px 0 34px rgba(8, 21, 39, 0.08);
}

.sidebar h1 {
  margin: 0;
  color: #ffffff;
  font-size: 25px;
  line-height: 1.1;
}

.sidebar-brand,
.history-header,
.topbar,
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand,
.history-header,
.topbar {
  justify-content: space-between;
}

.sidebar-brand {
  min-height: 116px;
  align-items: flex-start;
  padding-top: 4px;
}

.sidebar-brand .eyebrow {
  color: var(--accent-cyan);
}

.history-header {
  border-radius: 14px;
  padding: 14px;
  background: #f6f9fd;
}

.history-header h2 {
  margin: 0;
  font-size: 18px;
}

.sidebar-toggle {
  display: inline-grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  padding: 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.sidebar-resizer {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  height: 100vh;
  cursor: col-resize;
}

.sidebar-resizer::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(47, 109, 246, 0.28), transparent);
  content: "";
}

.sidebar-handle {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto auto;
  place-items: center;
  gap: 7px;
  width: 34px;
  min-width: 34px;
  height: 82px;
  min-height: 82px;
  border: 1px solid rgba(145, 164, 194, 0.42);
  border-radius: 999px;
  padding: 0;
  background: rgba(255, 255, 255, 0.96);
  color: var(--navy);
  box-shadow: 0 14px 34px rgba(8, 21, 39, 0.18);
  cursor: pointer;
}

.sidebar-handle:hover {
  border-color: rgba(47, 109, 246, 0.48);
  color: var(--accent);
}

.handle-grip {
  display: block;
  width: 4px;
  height: 24px;
  border-radius: 999px;
  background:
    linear-gradient(#c2cde0, #c2cde0) center 0 / 4px 4px no-repeat,
    linear-gradient(#c2cde0, #c2cde0) center 10px / 4px 4px no-repeat,
    linear-gradient(#c2cde0, #c2cde0) center 20px / 4px 4px no-repeat;
}

.handle-arrow {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.resizing-sidebar,
.resizing-sidebar * {
  cursor: col-resize !important;
  user-select: none;
}

.history-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.billing-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #d9e5f7;
  border-radius: 14px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(47, 109, 246, 0.1), rgba(34, 211, 238, 0.08)),
    #f8fbff;
}

.billing-card h2 {
  margin: 0;
  font-size: 17px;
}

.billing-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.history-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.history-item {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 64px;
  border-color: transparent;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  text-align: left;
}

.history-item strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item span {
  color: var(--muted);
  font-size: 12px;
}

.history-item.active {
  border-color: var(--accent);
  background:
    linear-gradient(135deg, rgba(47, 109, 246, 0.1), rgba(34, 211, 238, 0.08)),
    #f8fbff;
  box-shadow: 0 12px 22px rgba(47, 109, 246, 0.12);
}

.main-area {
  min-width: 0;
  background:
    linear-gradient(180deg, var(--navy) 0 74px, transparent 74px),
    transparent;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 74px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 21, 39, 0.92);
  padding: 14px 22px;
  backdrop-filter: blur(12px);
}

.breadcrumb {
  flex: 1;
  justify-content: center;
  min-width: 0;
  overflow-x: auto;
}

.crumb {
  position: relative;
  min-height: 36px;
  border-color: transparent;
  background: transparent;
  color: #a9bdd8;
  white-space: nowrap;
}

.crumb:not(:last-child)::after {
  position: absolute;
  right: -9px;
  color: rgba(255, 255, 255, 0.32);
  content: ">";
}

.crumb.active {
  border-color: rgba(34, 211, 238, 0.34);
  background: rgba(47, 109, 246, 0.16);
  color: #ffffff;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.sidebar #logoutButton {
  margin-top: auto;
}

.app-view.sidebar-collapsed {
  grid-template-columns: 0 18px minmax(0, 1fr);
}

.app-view.sidebar-collapsed .sidebar {
  display: none;
}

.app-view.sidebar-collapsed .sidebar-resizer::before {
  background: linear-gradient(180deg, transparent, rgba(34, 211, 238, 0.44), transparent);
}

.app-view.sidebar-collapsed .workspace {
  width: min(1600px, calc(100vw - 60px));
}

.workspace {
  display: grid;
  gap: 16px;
  width: min(1500px, calc(100vw - var(--sidebar-width, 320px) - 62px));
  margin: 0 auto;
  padding: 28px 22px;
}

.panel {
  border-color: rgba(182, 197, 219, 0.76);
  padding: 22px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.panel-header,
.candidate-header,
.files-list li,
.uploaded-files-list li,
.file-actions,
.actions,
.header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header h2,
.selector-block h3 {
  margin: 0;
}

.panel-header h2 {
  font-size: 24px;
  letter-spacing: 0;
}

.panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.selector-block {
  margin-top: 18px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.choice-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.choice-grid.styles {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.choice-card {
  display: grid;
  gap: 6px;
  height: 100%;
  min-height: 92px;
  padding: 12px;
  text-align: left;
}

.choice-card strong {
  font-size: 15px;
}

.choice-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.choice-card.selected {
  border-color: var(--accent);
  background: #eef5ff;
}

.template-filter-bar {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.filter-group {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.filter-group > span {
  color: #334155;
  font-size: 14px;
  font-weight: 700;
  line-height: 34px;
}

.filter-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 13px;
  background: #f8fafc;
  color: #334155;
  white-space: nowrap;
}

.filter-chip.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(47, 109, 246, 0.12), rgba(34, 211, 238, 0.12));
  color: var(--accent);
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 12px;
  margin-top: 14px;
}

.panel > label {
  margin-top: 14px;
}

.actions {
  justify-content: flex-start;
  margin-top: 14px;
}

.header-actions {
  justify-content: flex-end;
}

.status-pill {
  border-radius: 999px;
  background: rgba(47, 109, 246, 0.1);
  color: var(--accent-dark);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.template-upload-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.template-upload-panel.featured {
  border-color: rgba(47, 109, 246, 0.28);
  background:
    linear-gradient(135deg, rgba(47, 109, 246, 0.13), rgba(34, 211, 238, 0.1)),
    #f8fbff;
  box-shadow: 0 16px 34px rgba(47, 109, 246, 0.1);
}

.template-upload-panel.featured strong {
  color: #0f172a;
  font-size: 18px;
}

.uploaded-template-preview {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(47, 109, 246, 0.28);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(8, 21, 39, 0.09);
}

.uploaded-template-cover {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  aspect-ratio: 16 / 9;
}

.uploaded-template-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
}

.uploaded-template-unavailable {
  display: grid;
  align-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.uploaded-template-unavailable strong {
  color: var(--text);
  font-size: 16px;
}

.uploaded-template-unavailable span {
  font-size: 13px;
}

.uploaded-template-copy {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.uploaded-template-copy strong {
  font-size: 22px;
}

.uploaded-template-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.template-upload-panel strong,
.template-upload-panel span {
  display: block;
}

.template-upload-panel span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.template-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.template-card {
  display: grid;
  position: relative;
  overflow: hidden;
  min-height: 292px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.template-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(8, 21, 39, 0.11);
}

.template-card.selected {
  z-index: 2;
  border-color: var(--accent);
  transform: scale(1.035);
  box-shadow: 0 22px 42px rgba(8, 21, 39, 0.18), 0 0 0 3px rgba(47, 109, 246, 0.16);
}

.template-card:focus-visible {
  outline: 3px solid rgba(47, 109, 246, 0.2);
  outline-offset: 3px;
}

.template-preview {
  position: relative;
  aspect-ratio: 16 / 9;
  padding: 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--thumb-accent) 22%, transparent), transparent 48%),
    #f8fafc;
}

.template-preview.image-template {
  padding: 0;
  background: #f8fafc;
}

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

.template-preview.studio-template img {
  object-fit: contain;
}

.source-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.mini-slide {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 7px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.mini-bar,
.mini-title,
.mini-subtitle,
.mini-footer,
.mini-visual span {
  display: block;
  border-radius: 999px;
}

.mini-bar {
  width: 34px;
  height: 5px;
  background: var(--thumb-accent);
}

.mini-title {
  width: 62%;
  height: 14px;
  margin-top: 16px;
  background: #111827;
}

.mini-subtitle {
  width: 42%;
  height: 8px;
  margin-top: 9px;
  background: #94a3b8;
}

.mini-visual {
  position: absolute;
  right: 14px;
  bottom: 22px;
  left: 14px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr;
  gap: 8px;
  align-items: end;
  height: 46%;
}

.mini-visual span {
  background: color-mix(in srgb, var(--thumb-accent) 72%, white);
}

.mini-visual span:nth-child(1) {
  height: 54%;
}

.mini-visual span:nth-child(2) {
  height: 88%;
  background: color-mix(in srgb, var(--thumb-secondary) 72%, white);
}

.mini-visual span:nth-child(3) {
  height: 68%;
}

.mini-footer {
  position: absolute;
  right: 14px;
  bottom: 10px;
  left: 14px;
  height: 4px;
  background: #cbd5e1;
}

.theme-tech-dark,
.theme-gradient-product,
.theme-health-tech {
  background:
    radial-gradient(circle at 80% 16%, color-mix(in srgb, var(--thumb-secondary) 60%, transparent), transparent 30%),
    linear-gradient(135deg, #0f172a, #111827 56%, #020617);
}

.theme-tech-dark .mini-slide,
.theme-gradient-product .mini-slide,
.theme-health-tech .mini-slide {
  background: rgba(15, 23, 42, 0.92);
}

.theme-tech-dark .mini-title,
.theme-gradient-product .mini-title,
.theme-health-tech .mini-title {
  background: #f8fafc;
}

.theme-dashboard-light,
.theme-executive-clean,
.theme-blueprint,
.theme-finance-paper,
.theme-universal {
  background: linear-gradient(135deg, #f8fafc, #e0f2fe);
}

.theme-classroom,
.theme-academic {
  background: linear-gradient(135deg, #eef2ff, #fff7ed);
}

.theme-medical {
  background: linear-gradient(135deg, #e0f2fe, #dcfce7);
}

.theme-gov {
  background: linear-gradient(135deg, #fff1f2, #dbeafe);
}

.theme-editorial-city {
  background: linear-gradient(135deg, #fef3c7, #ccfbf1);
}

.theme-brand-vivid {
  background: linear-gradient(135deg, #ffe4e6, #fef3c7 48%, #dbeafe);
}

.layout-matrix .mini-visual,
.layout-summary-table .mini-visual,
.layout-section-cards .mini-visual,
.layout-clinical-cards .mini-visual,
.layout-balanced .mini-visual {
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
}

.layout-photo-story .mini-visual {
  grid-template-columns: 1.5fr 0.7fr 0.7fr;
}

.layout-number-led .mini-visual span:nth-child(1) {
  height: 90%;
}

.template-copy {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.template-copy strong {
  font-size: 16px;
}

.template-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.template-copy small {
  color: #475569;
  font-size: 12px;
}

.template-popover {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(47, 109, 246, 0.24);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 30px rgba(8, 21, 39, 0.16);
}

.template-card.selected .template-popover {
  display: flex;
  animation: popIn 160ms ease-out;
}

.template-popover strong {
  color: var(--accent);
  font-size: 14px;
}

.template-popover div {
  display: flex;
  gap: 8px;
}

.candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.candidate-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.candidate-card.selected {
  border-color: var(--success);
  transform: scale(1.018);
  box-shadow: 0 18px 34px rgba(8, 21, 39, 0.14), 0 0 0 3px rgba(8, 153, 129, 0.16);
}

.candidate-card:focus-visible {
  outline: 3px solid rgba(4, 120, 87, 0.2);
  outline-offset: 3px;
}

.candidate-header,
.candidate-actions {
  padding: 10px;
}

.candidate-actions {
  display: flex;
  justify-content: flex-end;
}

iframe {
  width: 100%;
  height: 360px;
  border: 0;
  background: #fff;
}

.html-preview-frame {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.preview-select-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 34px;
  border-color: rgba(15, 23, 42, 0.18);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 18px rgba(8, 21, 39, 0.12);
}

.candidate-card.selected .preview-select-overlay {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.candidate-card.selected iframe {
  height: 430px;
}

.preview-action-bar {
  position: sticky;
  bottom: 14px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
  border: 1px solid rgba(47, 109, 246, 0.18);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px rgba(8, 21, 39, 0.1);
}

.preview-action-bar span {
  color: var(--muted);
  font-weight: 700;
}

.progress-screen {
  min-height: calc(100vh - 112px);
}

.progress-only {
  display: grid;
  align-content: center;
  gap: 18px;
  width: min(720px, 100%);
  min-height: calc(100vh - 180px);
  margin: 0 auto;
  text-align: center;
}

.progress-only h2 {
  margin: 0;
  font-size: 30px;
}

.progress-only p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
}

.progress-track {
  overflow: hidden;
  height: 14px;
  border-radius: 999px;
  background: #dbe3ef;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-cyan));
  transition: width 360ms ease;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.subpanel {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

pre {
  min-height: 120px;
  max-height: 220px;
  margin: 14px 0 0;
  overflow: auto;
  border-radius: 12px;
  padding: 16px;
  background: var(--code);
  color: var(--code-text);
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.status-line {
  margin: 12px 0 0;
  color: var(--muted);
}

.files-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.uploaded-files-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.files-list li,
.uploaded-files-list li {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(8, 21, 39, 0.05);
}

.files-list strong,
.files-list span,
.uploaded-files-list strong,
.uploaded-files-list span {
  display: block;
}

.files-list strong,
.uploaded-files-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.files-list span,
.uploaded-files-list span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.file-actions {
  justify-content: flex-end;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(8, 21, 39, 0.56);
  backdrop-filter: blur(8px);
}

.billing-modal {
  display: grid;
  gap: 18px;
  width: min(920px, calc(100vw - 36px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid rgba(216, 224, 237, 0.9);
  border-radius: 18px;
  padding: 22px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(8, 21, 39, 0.28);
}

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

.billing-plan {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #f8fbff;
}

.billing-plan strong {
  display: block;
  margin-bottom: 6px;
  font-size: 17px;
}

.billing-plan span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.billing-plan-price {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.billing-plan-price b {
  color: var(--accent);
  font-size: 28px;
  line-height: 1;
}

.payjs-order-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 18px;
  align-items: center;
  border: 1px solid #c8d8f2;
  border-radius: 16px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(8, 21, 39, 0.04), rgba(34, 211, 238, 0.08)),
    #fff;
}

.payjs-order-panel strong {
  display: block;
  font-size: 18px;
}

.payjs-order-panel p {
  margin: 8px 0 14px;
  color: var(--muted);
}

.payjs-order-panel img {
  width: 180px;
  height: 180px;
  border: 1px solid var(--line);
  border-radius: 12px;
  object-fit: contain;
  background: #fff;
}

.payjs-order-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .login-view,
  .app-view {
    grid-template-columns: 1fr;
  }

  .login-view {
    align-content: center;
    width: min(100vw - 24px, 680px);
  }

  .sidebar {
    position: static;
    height: auto;
    border-width: 0 0 1px;
    background: #fff;
  }

  .sidebar h1 {
    color: var(--text);
  }

  .sidebar-resizer {
    display: none;
  }

  .app-view.sidebar-collapsed .sidebar {
    display: flex;
  }

  .app-view.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .workspace {
    width: 100%;
    padding: 12px;
  }

  .main-area,
  .topbar {
    background: var(--navy);
  }

  .topbar,
  .breadcrumb {
    justify-content: flex-start;
  }

  .form-grid,
  .candidate-grid,
  .template-grid,
  .billing-plan-grid,
  .payjs-order-panel {
    grid-template-columns: 1fr;
  }

  .panel-header,
  .files-list li,
  .uploaded-files-list li,
  .header-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}
