:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --line: #dbe4f0;
  --surface: #ffffff;
  --surface-soft: #f7faff;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-warm: #f59e0b;
  --nav: #ffffff;
  --nav-soft: #f8fbff;
  --warn: #b42318;
  --shadow: 0 16px 36px rgba(37, 99, 235, 0.1);
}

* {
  box-sizing: border-box;
}

html.app-loading body {
  visibility: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f5f8ff;
}

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

button {
  border: 0;
  cursor: default;
}

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

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.appLayout {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr) 260px;
  min-height: 100vh;
  background: #f5f8ff;
}

.sideNav {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 20px;
  min-height: 100vh;
  padding: 22px 14px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.brandBlock {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 2px 10px;
  color: #0f172a;
}

.brandMark,
.menuIcon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.brandMark {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.copyrightDisplay,
.loginCopyrightDisplay {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.copyrightDisplay {
  margin: 0;
  padding: 16px 42px 22px;
  border-top: 1px solid #edf2f7;
  background: #fff;
  color: #98a2b3;
  text-align: center;
}

.sideNav #copyrightDisplay,
.sideNav .copyrightDisplay {
  display: none !important;
}

.loginCopyrightDisplay {
  margin-top: 4px;
  text-align: center;
}

.sideMenu {
  display: grid;
  gap: 6px;
  padding: 0;
}

.sideSection {
  display: grid;
  align-content: start;
  gap: 10px;
  margin-top: 4px;
  padding: 14px 12px;
  border: 1px solid #e7eef8;
  border-radius: 8px;
  color: var(--muted);
  background: #fbfdff;
  font-size: 0.86rem;
}

.sideSection p {
  margin: 0;
  color: #0f172a;
  font-weight: 800;
}

.sideSection span {
  display: block;
}

.teamRail {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 100vh;
  padding: 30px 22px;
  border-left: 1px solid var(--line);
  background: #fff;
}

.teamRail h2 {
  margin: 0;
  font-size: 1.08rem;
}

.railIntro {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.railCard {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #e7eef8;
  border-radius: 8px;
  background: #fbfdff;
}

.railCard span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.railCard strong {
  color: #0f172a;
  font-size: 0.95rem;
  line-height: 1.4;
}

.chatButton {
  min-height: 40px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-weight: 800;
}

.shell {
  min-width: 0;
  margin: 0;
  padding: 0;
}

.workspace {
  background: #f5f8ff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 34px 42px 24px;
  border-bottom: 1px solid #e7eef8;
  background: #fff;
}

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

.topNavPills {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fafc;
}

.topNavButton {
  min-height: 34px;
  border-radius: 999px;
  border-color: transparent;
  color: #111827;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.topNavButton:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.topNavButton.active {
  color: #fff;
  background: #111827;
}

.languageToggle {
  min-width: 64px;
  padding-inline: 12px;
  font-weight: 800;
}

.accountBadge {
  display: grid;
  gap: 2px;
  min-width: 116px;
  padding: 7px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  text-align: left;
}

.accountBadge strong {
  color: #0f172a;
  font-size: 0.9rem;
}

.accountBadge span {
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2vw, 2.05rem);
  font-weight: 850;
  letter-spacing: 0;
}

.status {
  min-width: 72px;
  padding: 8px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

.status.error {
  color: var(--warn);
  border-color: rgba(180, 35, 24, 0.28);
  background: rgba(180, 35, 24, 0.06);
}

.grid {
  display: grid;
  grid-template-columns: minmax(320px, 388px) minmax(0, 1fr);
  gap: 20px;
  min-height: 0;
  padding: 24px 42px 42px;
}

.moduleNav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 247, 250, 0.82);
}

.moduleButton {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  color: #475467;
  background: transparent;
  font-weight: 800;
  text-align: left;
}

.moduleButton span:not(.menuIcon) {
  white-space: nowrap;
}

.moduleButton:hover {
  border-color: transparent;
  color: var(--accent-dark);
  background: #f8fbff;
}

.moduleButton.active {
  border-color: transparent;
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.moduleButton.active .menuIcon {
  color: #fff;
  background: var(--accent);
}

.panel {
  padding: 18px;
  border: 1px solid #e7eef8;
  border-radius: 8px;
  background: #fff;
}

.controls {
  border-right: 0;
  background: #fff;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 172px;
  padding: 20px;
  border: 1.5px dashed #adc8f7;
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted);
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.uploadIcon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.dropTitle {
  margin-top: 12px;
  color: var(--ink);
  font-weight: 700;
}

.dropHint {
  margin-top: 4px;
  font-size: 0.9rem;
}

.previewWrap {
  position: relative;
  margin-top: 16px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.previewWrap img,
.resultStage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.resultStage video,
.historyVideoPlayer {
  width: 100%;
  max-width: 100%;
  border-radius: 14px;
  background: #0f172a;
}

.modeSwitch {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #f8fbff;
}

.modeChip {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.modeChip.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.18);
}

.batchPanel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

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

.referenceThumb {
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border: 1px solid #d7ded9;
  border-radius: 8px;
  background: #ffffff;
}

.referenceThumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.batchHeader,
.batchItem {
  display: flex;
  align-items: center;
  gap: 10px;
}

.batchHeader {
  justify-content: space-between;
}

.batchHeader div {
  display: grid;
  gap: 2px;
}

.batchHeader span,
.batchItem span,
.batchItem small {
  color: var(--muted);
  font-size: 0.82rem;
}

.batchList {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.batchItem {
  align-items: flex-start;
  padding: 8px;
  border: 1px solid #e7eef8;
  border-radius: 8px;
  background: #fff;
}

.batchItem.running {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.batchItem.success {
  border-color: rgba(37, 99, 235, 0.28);
}

.batchItem.error,
.batchItem.partial {
  border-color: rgba(180, 35, 24, 0.22);
}

.batchItem img,
.batchItem video {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-soft);
}

.batchItemBody {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.batchItemBody strong,
.batchItemBody span,
.batchItemBody small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batchInfoInput {
  min-height: 92px;
  margin-top: 6px;
  padding: 9px 10px;
  font-size: 0.86rem;
  line-height: 1.45;
  resize: vertical;
}

.batchItemActions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#textImageBatchList .batchItem {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

#textImageBatchList .batchItem img,
#textImageBatchList .batchItem .galleryPending {
  width: 64px;
  height: 64px;
  min-width: 64px;
  border-radius: 8px;
}

#textImageBatchList .batchItem img {
  display: block;
  object-fit: contain;
  background: var(--surface-soft);
}

#textImageBatchList .batchItemBody {
  min-width: 0;
  gap: 6px;
}

#textImageBatchList .batchItemBody strong,
#textImageBatchList .batchItemBody span,
#textImageBatchList .batchItemBody small {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

#textImageBatchList .textImageBatchPrompt {
  width: 100%;
  min-height: 84px;
  box-sizing: border-box;
}

#textImageBatchList .batchItemActions {
  justify-content: flex-start;
  gap: 8px;
}

.libraryFilters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.libraryFilters .active {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.libraryModule {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 28px 40px;
}

.libraryPage {
  display: grid;
  gap: 18px;
}

.libraryPageHeader,
.libraryToolbar,
.librarySearchRow {
  display: flex;
  align-items: end;
  gap: 12px;
}

.libraryPageHeader {
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.libraryToolbar {
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.librarySearchRow {
  flex: 1 1 420px;
  align-items: end;
}

.librarySearchField {
  flex: 1 1 280px;
  margin: 0;
}

.libraryGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.libraryGrid.empty {
  display: block;
  padding: 28px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: var(--surface-soft);
}

.libraryItem {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.libraryItem:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.1);
}

.libraryThumb {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  padding: 0;
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-soft);
  border: 0;
  border-bottom: 1px solid var(--border);
}

button.libraryThumb {
  text-align: inherit;
}

.libraryThumb img,
.libraryThumb video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.libraryBadge {
  position: absolute;
  left: 10px;
  top: 10px;
  max-width: calc(100% - 20px);
  padding: 5px 8px;
  border-radius: 999px;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.libraryBody {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 14px;
}

.libraryTitleRow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.libraryTitleRow strong {
  display: block;
  min-height: 0;
  overflow: visible;
  color: #0f172a;
  font-size: 0.98rem;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}

.libraryStatus {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  color: #166534;
  background: #dcfce7;
  font-size: 0.72rem;
  font-weight: 800;
}

.libraryStatus.failed {
  color: #991b1b;
  background: #fee2e2;
}

.libraryStatus.running,
.libraryStatus.pending,
.libraryStatus.partial {
  color: #92400e;
  background: #fef3c7;
}

.libraryBody p {
  display: -webkit-box;
  min-height: 2.7em;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

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

.libraryMetaGrid span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 0.78rem;
}

.libraryMetaGrid b {
  min-width: 0;
  color: #111827;
  font-size: 0.82rem;
  text-align: right;
  overflow-wrap: anywhere;
}

.libraryUpdated {
  color: #94a3b8;
}

.libraryBody strong,
.libraryBody span,
.libraryBody small {
  overflow-wrap: anywhere;
}

.libraryItem.failed {
  border-color: #fecaca;
}

.libraryItem .cardActions {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.libraryPagerTop {
  display: flex;
  justify-content: flex-end;
  margin-top: -6px;
}

.libraryPageSizeField {
  width: 150px;
  margin: 0;
}

.libraryPagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 2px;
}

.libraryPagination span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

@media (max-width: 720px) {
  .libraryPageHeader,
  .libraryToolbar,
  .librarySearchRow {
    align-items: stretch;
    flex-direction: column;
  }

  .librarySearchRow,
  .librarySearchField {
    flex-basis: auto;
    width: 100%;
  }

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

.iconButton {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 20px rgba(20, 33, 48, 0.14);
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.field span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: 0;
}

textarea {
  resize: vertical;
  min-height: 170px;
  padding: 12px;
  line-height: 1.55;
}

.compactText {
  min-height: 116px;
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

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

.compact {
  margin-top: 12px;
}

.disabledField {
  opacity: 0.68;
}

.checkField {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.checkField input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 8px;
  font-weight: 800;
}

.primary {
  width: 100%;
  margin-top: 18px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

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

.slimPrimary {
  width: auto;
  margin-top: 0;
  padding: 0 16px;
}

.secondary {
  padding: 0 16px;
  color: #344054;
  border: 1px solid var(--line);
  background: var(--surface);
}

.full {
  width: 100%;
  margin-top: 10px;
}

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

.promptModule,
.configModule {
  min-height: 680px;
  padding: 24px 42px 42px;
}

.promptManager,
.configManager {
  display: grid;
  gap: 16px;
  max-width: 1100px;
}

.promptHeader {
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}

.promptHeader p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.promptActions,
.promptEditorActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

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

.promptEditorWrap {
  margin-top: 0;
}

.promptEditorWrap textarea {
  min-height: 420px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}

.secondary:hover:not(:disabled) {
  color: var(--accent-dark);
  border-color: #bfdbfe;
  background: #f8fbff;
}

.message {
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.message.success {
  border-color: rgba(37, 99, 235, 0.26);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.message.error {
  border-color: rgba(180, 35, 24, 0.28);
  background: rgba(180, 35, 24, 0.07);
  color: var(--warn);
}

.result {
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  align-content: start;
  gap: 12px;
}

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

.imageTab {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  color: #475467;
  background: #f8fbff;
  font-size: 0.86rem;
  font-weight: 800;
}

.imageTab.active {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.resultStage {
  display: grid;
  place-items: center;
  width: min(100%, var(--stage-width, 620px));
  height: var(--stage-height, 520px);
  min-height: 360px;
  max-height: 76vh;
  justify-self: center;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background:
    linear-gradient(45deg, #eef6ff 25%, transparent 25%) 0 0 / 24px 24px,
    linear-gradient(45deg, transparent 75%, #eef6ff 75%) 0 0 / 24px 24px,
    #fff;
  overflow: visible;
}

.emptyState {
  display: grid;
  place-items: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}

.emptyState svg {
  width: 48px;
  height: 48px;
  color: #93b9f6;
}

.emptyState p {
  margin: 0;
}

.resultActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.downloadPanel,
.drawerDownloadPanel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 8px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 0.9rem;
}

.downloadPanel a,
.drawerDownloadPanel a {
  color: var(--accent-dark);
  font-weight: 800;
}

.timingPanel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid #e7eef8;
  border-radius: 8px;
  color: var(--muted);
  background: #fbfdff;
  font-size: 0.9rem;
  line-height: 1.45;
}

.timingPanel strong {
  color: var(--accent-dark);
}

.timingPanel span {
  color: #344054;
  font-weight: 700;
}

.drawerDownloadPanel {
  justify-content: flex-start;
  margin: 12px 14px 0;
  overflow-wrap: anywhere;
}

.outputBlock {
  border: 1px solid #e7eef8;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.blockHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #e7eef8;
  background: #fbfdff;
}

.blockControls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.blockHeader h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.blockHeader span {
  color: var(--muted);
  font-size: 0.88rem;
}

.miniButton {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #344054;
  background: var(--surface);
  font-size: 0.88rem;
  font-weight: 700;
}

.miniButton:hover:not(:disabled) {
  color: var(--accent-dark);
  border-color: #bfdbfe;
  background: #f8fbff;
}

.miniButton.dangerButton {
  color: #b42318;
  border-color: #f3b8b3;
  background: #fff8f7;
}

.miniButton.dangerButton:hover:not(:disabled) {
  color: #8a1f17;
  border-color: #ea8f87;
  background: #fff1ef;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  padding: 14px;
}

.gallery.empty {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.printGallery {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.printGallery.empty {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.printCard {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e7eef8;
  border-radius: 8px;
  background: var(--surface);
}

.printCard img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 6px;
  background: var(--surface-soft);
}

.printCard strong {
  display: block;
  margin-bottom: 4px;
}

.printCard p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.galleryItem {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e7eef8;
  border-radius: 8px;
  background: var(--surface);
}

.galleryItem img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 6px;
  background: var(--surface-soft);
}

.thumbButton {
  display: block;
  width: 100%;
  padding: 0;
  border-radius: 6px;
  background: transparent;
}

.galleryItem p,
.galleryItem small {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.galleryItem .timingText {
  color: var(--accent-dark);
  font-weight: 700;
}

.galleryItem strong {
  font-size: 0.92rem;
}

.cardActions {
  display: grid;
  gap: 6px;
}

.galleryItem.failed {
  border-color: rgba(180, 35, 24, 0.24);
  background: rgba(180, 35, 24, 0.05);
}

.galleryError {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  color: var(--warn);
  background: rgba(180, 35, 24, 0.07);
  font-weight: 800;
}

.galleryPending {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 800;
}

.listing {
  display: grid;
  gap: 10px;
  padding: 14px;
  color: var(--ink);
}

.listingBody {
  border-top: 0;
}

.listingSection {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e7eef8;
  border-radius: 8px;
  background: #fbfdff;
}

.listingSection h3 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 0.92rem;
  letter-spacing: 0;
}

.listing p,
.listing li {
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.listing p {
  margin: 0;
}

.listing ol {
  margin: 0;
  padding-left: 20px;
}

.listingError {
  color: var(--warn) !important;
}

.historyList {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.historyList.empty {
  color: var(--muted);
  font-size: 0.92rem;
}

.historyRecord {
  border: 1px solid #e7eef8;
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.historySummary {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
}

.historySummary:hover {
  background: #f8fbff;
}

.historySummary span,
.historySummary small {
  color: var(--muted);
  font-size: 0.82rem;
}

.historyDetail {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: #fbfdff;
}

.historyTiming {
  padding: 8px 10px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 8px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 0.86rem;
  font-weight: 800;
}

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

.historyListing {
  border: 1px solid #e7eef8;
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.historySubHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
}

.historyListingBody {
  padding: 10px;
  border-top: 1px solid #e7eef8;
}

.historyListingBody h3 {
  margin: 12px 0 5px;
  font-size: 0.88rem;
}

.historyListingBody h3:first-child {
  margin-top: 0;
}

.historyListingBody p,
.historyListingBody li {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.historyListingBody ol {
  margin: 0;
  padding-left: 18px;
}

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

.historyPrintImage {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border: 1px solid #e7eef8;
  border-radius: 8px;
  background: var(--surface);
}

.historyImageCard {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #e7eef8;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.historyImagePreview {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 6px;
  background: var(--surface-soft);
  cursor: zoom-in;
  overflow: hidden;
  padding: 0;
}

.historyImagePreview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.historyImageMeta {
  display: grid;
  gap: 2px;
  min-height: 38px;
}

.historyImageCard.mutedCard div {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.historyImageCard strong {
  font-size: 0.82rem;
}

.historyImageCard span {
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 800;
}

.mutedCard {
  cursor: default;
}

.historyDrawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 45;
  width: min(380px, 92vw);
  height: 100vh;
  border-left: 1px solid #dbeafe;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: -18px 0 42px rgba(37, 99, 235, 0.12);
  overflow: auto;
}

.adminDrawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 46;
  width: min(520px, 94vw);
  height: 100vh;
  border-left: 1px solid #dbeafe;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: -18px 0 42px rgba(37, 99, 235, 0.12);
  overflow: auto;
}

.adminForm {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #e7eef8;
}

.adminForm .primary {
  align-self: end;
}

.adminConfigForm {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: #f8fbff;
  border: 1px solid #e7eef8;
  border-radius: 8px;
}

.adminConfigForm .field {
  min-width: 0;
}

.adminConfigForm input,
.adminConfigForm select {
  width: 100%;
}

.secretField {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.secretField input {
  min-width: 0;
  flex: 1 1 auto;
}

.secretRevealButton {
  flex: 0 0 auto;
  min-width: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0 10px;
}

.secretRevealButton:hover:not(:disabled) {
  border-color: #93c5fd;
  background: #eff6ff;
}

.adminUsers {
  display: grid;
  gap: 10px;
  padding: 14px 18px 24px;
}

.adminUserCard {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e7eef8;
  border-radius: 8px;
  background: #fbfdff;
}

.adminUserTop,
.adminUserActions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.adminUserTop strong,
.adminUserTop span {
  display: block;
}

.adminUserTop span,
.adminUserMeta {
  color: var(--muted);
  font-size: 0.84rem;
}

.adminUserActions input {
  width: 94px;
}

.loginOverlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f5f8ff;
}

.loginCard {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.loginCard h1 {
  font-size: 1.55rem;
}

.loginHint {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.drawerHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid #e7eef8;
  background: #fbfdff;
}

.drawerHeader h2 {
  margin: 0;
  font-size: 1.15rem;
}

.drawerMeta {
  padding: 12px 18px 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.previewModal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.62);
}

.previewPanel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1100px, 100%);
  height: min(760px, calc(100vh - 48px));
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.previewTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #e7eef8;
  background: #fbfdff;
}

.previewActions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.previewCounter {
  min-width: 54px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

.previewStage {
  position: relative;
  display: grid;
  min-height: 0;
  place-items: center;
  background: #f8fafc;
  overflow: hidden;
}

.previewStage.isLibraryPreview {
  cursor: pointer;
}

.previewPanel img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--surface-soft);
}

.previewVideoLarge {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .appLayout {
    grid-template-columns: 216px minmax(0, 1fr);
  }

  .teamRail {
    display: none;
  }
}

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

  .sideNav {
    min-height: 0;
    padding: 16px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sideMenu {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .sideMenu::-webkit-scrollbar {
    display: none;
  }

  .moduleButton {
    flex: 0 0 auto;
  }

  .sideSection {
    display: none;
  }

  .shell {
    width: 100%;
    padding: 0;
  }

  .topbar {
    align-items: flex-start;
    padding: 24px 18px;
  }

  .topActions {
    width: 100%;
    justify-content: stretch;
  }

  .topActions .secondary,
  .topActions .status {
    flex: 1;
  }

  .grid {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 18px 18px 28px;
  }

  .promptModule,
  .configModule {
    min-height: 0;
    padding: 18px 18px 28px;
  }

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

  .controls {
    border-right: 0;
  }

  .panel {
    padding: 18px;
  }

  .resultStage {
    width: min(100%, var(--stage-width, 100%));
    height: var(--stage-height, 420px);
    min-height: 320px;
    max-height: 72vh;
  }
}

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

  .status {
    width: 100%;
  }

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

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

  .resultActions {
    display: grid;
    grid-template-columns: 1fr;
  }

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

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

/* YUNYIDA blue interface */
body {
  background: #eef2ee;
}

.appLayout {
  grid-template-columns: 236px minmax(0, 1fr) 284px;
  background: #eef2ee;
}

.sideNav {
  gap: 24px;
  padding: 24px 16px;
  border-right: 0;
  background: var(--nav);
  color: #eef5ef;
}

.brandBlock {
  min-height: 54px;
  padding: 8px 8px 16px;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brandBlock strong {
  font-size: 0.98rem;
  letter-spacing: 0.06em;
}

.brandMark {
  width: 36px;
  height: 36px;
  color: #18211f;
  background: #d8b46a;
  box-shadow: none;
}

.menuIcon {
  color: #d8b46a;
  background: rgba(216, 180, 106, 0.12);
}

.moduleButton {
  min-height: 46px;
  padding: 0 12px;
  color: #cdd8d3;
  border: 1px solid transparent;
  border-radius: 8px;
}

.moduleButton:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.moduleButton.active {
  color: #ffffff;
  border-color: rgba(216, 180, 106, 0.34);
  background: #24302c;
}

.moduleButton.active .menuIcon {
  color: #18211f;
  background: #d8b46a;
}

.sideSection {
  padding: 14px;
  border-color: rgba(255, 255, 255, 0.1);
  color: #b5c3bd;
  background: rgba(255, 255, 255, 0.045);
}

.sideSection p {
  color: #ffffff;
}

.workspace {
  background: #eef2ee;
}

.topbar {
  align-items: center;
  padding: 26px 34px 22px;
  border-bottom: 1px solid #d7ded9;
  background: #fbfcfa;
}

.topbar > div:first-child {
  display: grid;
  gap: 4px;
}

.eyebrow {
  color: var(--accent-dark);
  letter-spacing: 0.08em;
}

h1 {
  color: #18211f;
  font-size: clamp(1.45rem, 1.8vw, 1.95rem);
}

.topActions {
  gap: 8px;
}

.accountBadge,
.status,
.downloadPanel,
.drawerDownloadPanel,
.timingPanel,
.historyTiming {
  border-color: #c7d7d1;
  color: var(--accent-dark);
  background: #eef8f5;
}

.accountBadge {
  min-width: 128px;
}

.grid {
  grid-template-columns: minmax(330px, 408px) minmax(0, 1fr);
  gap: 18px;
  padding: 22px 34px 34px;
}

.panel,
.outputBlock,
.historyRecord,
.historyListing,
.galleryItem,
.historyImageCard,
.printCard,
.listingSection,
.adminUserCard,
.railCard {
  border-color: #d7ded9;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(24, 33, 31, 0.03);
}

.controls {
  background: #fbfcfa;
}

.dropzone {
  min-height: 184px;
  border-color: #9bb9af;
  background: #f3f8f5;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: var(--accent);
  background: #e7f4ef;
}

.uploadIcon {
  color: var(--accent-dark);
  background: #dceee8;
}

textarea,
input,
select {
  border-color: #cfd8d3;
  background: #ffffff;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.primary {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.18);
}

.primary:hover {
  background: #0d5f59;
}

.secondary,
.miniButton {
  color: #24302c;
  border-color: #cfd8d3;
  background: #ffffff;
}

.secondary:hover:not(:disabled),
.miniButton:hover:not(:disabled) {
  color: var(--accent-dark);
  border-color: #9bb9af;
  background: #f2f8f5;
}

.message {
  border-color: #d7ded9;
  background: #fbfcfa;
}

.message.success,
.imageTab.active {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

.imageTab {
  border-color: #d7ded9;
  background: #f6f8f5;
}

.resultStage {
  border-color: #ccd8d1;
  background:
    linear-gradient(45deg, #edf3ef 25%, transparent 25%) 0 0 / 24px 24px,
    linear-gradient(45deg, transparent 75%, #edf3ef 75%) 0 0 / 24px 24px,
    #ffffff;
}

.blockHeader,
.drawerHeader,
.historyDetail,
.adminConfigForm {
  border-color: #d7ded9;
  background: #f6f8f5;
}

.teamRail {
  gap: 14px;
  padding: 26px 20px;
  border-left: 1px solid #d7ded9;
  background: #fbfcfa;
}

.teamRail h2 {
  color: #18211f;
}

.railCard span {
  color: #69756f;
}

.railCard strong {
  color: #18211f;
}

.chatButton {
  color: #18211f;
  border-color: #d8b46a;
  background: #f8efd8;
}

.historyDrawer,
.adminDrawer {
  border-left-color: #cfd8d3;
  background: rgba(251, 252, 250, 0.98);
  box-shadow: -18px 0 42px rgba(24, 33, 31, 0.16);
}

.loginOverlay {
  background:
    linear-gradient(90deg, #18211f 0 38%, #eef2ee 38% 100%);
}

.loginCard {
  border-color: rgba(255, 255, 255, 0.22);
  background: #fbfcfa;
  box-shadow: 0 22px 60px rgba(24, 33, 31, 0.22);
}

.previewModal {
  background: rgba(24, 33, 31, 0.72);
}

@media (max-width: 1180px) {
  .appLayout {
    grid-template-columns: 236px minmax(0, 1fr);
  }
}

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

  .sideNav {
    padding: 14px 16px;
    border-bottom: 0;
  }

  .brandBlock {
    min-height: 0;
    padding: 4px 2px 10px;
  }

  .topbar {
    padding: 22px 18px;
  }

  .grid {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .loginOverlay {
    background: #eef2ee;
  }
}

/* YUNYIDA blue restore */
body {
  background: #f5f8ff;
}

.appLayout {
  grid-template-columns: 216px minmax(0, 1fr) 260px;
  background: #f5f8ff;
}

.sideNav {
  gap: 20px;
  padding: 22px 14px;
  border-right: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.brandBlock {
  min-height: 0;
  padding: 0 2px 10px;
  color: #0f172a;
  border-bottom: 0;
}

.brandBlock strong {
  font-size: 1rem;
  letter-spacing: 0;
}

.brandMark,
.menuIcon {
  width: 30px;
  height: 30px;
  color: var(--accent);
  background: var(--accent-soft);
}

.brandMark {
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.moduleButton {
  min-height: 42px;
  padding: 0 10px;
  color: #475467;
  border: 0;
  background: transparent;
}

.moduleButton:hover {
  color: var(--accent-dark);
  background: #f8fbff;
}

.moduleButton.active {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.moduleButton.active .menuIcon {
  color: #ffffff;
  background: var(--accent);
}

.sideSection {
  border-color: #e7eef8;
  color: var(--muted);
  background: #fbfdff;
}

.sideSection p {
  color: #0f172a;
}

.workspace {
  background: #f5f8ff;
}

.topbar {
  align-items: flex-start;
  padding: 34px 42px 24px;
  border-bottom: 1px solid #e7eef8;
  background: #ffffff;
}

.eyebrow {
  color: var(--accent-dark);
  letter-spacing: 0;
}

h1 {
  color: var(--ink);
  font-size: clamp(1.55rem, 2vw, 2.05rem);
}

.accountBadge,
.status,
.downloadPanel,
.drawerDownloadPanel,
.historyTiming {
  border-color: #bfdbfe;
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.grid {
  grid-template-columns: minmax(320px, 388px) minmax(0, 1fr);
  gap: 20px;
  padding: 24px 42px 42px;
}

.panel,
.outputBlock,
.historyRecord,
.historyListing,
.galleryItem,
.historyImageCard,
.printCard,
.listingSection,
.adminUserCard,
.railCard {
  border-color: #e7eef8;
  background: #ffffff;
  box-shadow: none;
}

.controls {
  background: #ffffff;
}

.dropzone {
  border-color: #adc8f7;
  background: #f8fbff;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.uploadIcon {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

textarea,
input,
select {
  border-color: var(--line);
  background: #ffffff;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.primary {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

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

.secondary,
.miniButton {
  color: #344054;
  border-color: var(--line);
  background: var(--surface);
}

.secondary:hover:not(:disabled),
.miniButton:hover:not(:disabled) {
  color: var(--accent-dark);
  border-color: #bfdbfe;
  background: #f8fbff;
}

.message,
.blockHeader,
.drawerHeader,
.historyDetail,
.adminConfigForm {
  border-color: #e7eef8;
  background: #fbfdff;
}

.message.success,
.imageTab.active {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

.imageTab {
  border-color: #dbeafe;
  background: #f8fbff;
}

.resultStage {
  border-color: #dbeafe;
  background:
    linear-gradient(45deg, #eef6ff 25%, transparent 25%) 0 0 / 24px 24px,
    linear-gradient(45deg, transparent 75%, #eef6ff 75%) 0 0 / 24px 24px,
    #ffffff;
}

.teamRail {
  gap: 14px;
  padding: 30px 22px;
  border-left: 1px solid var(--line);
  background: #ffffff;
}

.chatButton {
  color: var(--accent-dark);
  border-color: #bfdbfe;
  background: var(--accent-soft);
}

.historyDrawer,
.adminDrawer {
  border-left-color: #dbeafe;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: -18px 0 42px rgba(37, 99, 235, 0.12);
}

.loginOverlay {
  background: #f5f8ff;
}

.loginCard {
  border-color: #dbeafe;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.previewModal {
  background: rgba(15, 23, 42, 0.62);
}

@media (max-width: 1180px) {
  .appLayout {
    grid-template-columns: 216px minmax(0, 1fr);
  }
}

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

  .sideNav {
    padding: 16px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .topbar {
    padding: 24px 18px;
  }

  .grid {
    grid-template-columns: 1fr;
    padding: 18px 18px 28px;
  }
}

/* Minimal white top navigation */
:root {
  --ink: #111827;
  --muted: #667085;
  --line: #e5e7eb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #eff6ff;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

body {
  background: #f7f9fc;
}

.appLayout {
  display: block;
  min-height: 100vh;
  padding-top: 88px;
  background: #f7f9fc;
}

.sideNav {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 40;
  display: block;
  width: min(1320px, calc(100vw - 32px));
  min-height: 0;
  padding: 8px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.08);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.brandBlock,
.sideSection,
.teamRail,
.topbar > div:first-child {
  display: none !important;
}

.sideMenu {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  padding: 0;
  scrollbar-width: none;
}

.sideMenu::-webkit-scrollbar {
  display: none;
}

.moduleButton {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #475467;
  background: transparent;
  font-size: 0.92rem;
}

.moduleButton .menuIcon {
  display: none;
}

.moduleButton:hover {
  color: var(--accent-dark);
  border-color: #dbeafe;
  background: #f8fbff;
}

.moduleButton.active {
  color: var(--accent-dark);
  border-color: #bfdbfe;
  background: var(--accent-soft);
}

.shell,
.workspace {
  min-width: 0;
  background: #f7f9fc;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  max-width: 1260px;
  margin: 0 auto;
  padding: 14px 28px 0;
  border: 0;
  background: transparent;
}

.topActions {
  gap: 8px;
}

.accountBadge,
.status,
.secondary,
.miniButton,
.panel,
.outputBlock,
.historyRecord,
.historyListing,
.galleryItem,
.historyImageCard,
.printCard,
.listingSection,
.adminUserCard,
.railCard {
  border-color: var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.grid,
.promptModule,
.configModule {
  max-width: 1260px;
  margin: 0 auto;
  padding: 20px 28px 42px;
}

.panel {
  border: 1px solid var(--line);
}

.controls,
.message,
.blockHeader,
.drawerHeader,
.historyDetail,
.adminConfigForm {
  background: #ffffff;
}

.dropzone,
.imageTab {
  border-color: #dbe3ef;
  background: #fbfdff;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: var(--accent);
  background: #f0f6ff;
}

.primary {
  background: var(--accent);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.14);
}

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

.loginOverlay {
  background: #f7f9fc;
}

.loginCard {
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

@media (max-width: 760px) {
  .appLayout {
    padding-top: 78px;
  }

  .sideNav {
    top: 10px;
    width: calc(100vw - 20px);
    border-radius: 18px;
  }

  .moduleButton {
    padding: 0 12px;
  }

  .topbar {
    padding: 10px 14px 0;
  }

  .grid,
  .promptModule,
  .configModule {
    padding: 16px 14px 28px;
  }
}

/* Keep generated media locked inside its own frame. */
.resultStage,
.previewWrap,
.galleryItem,
.historyImagePreview,
.referenceThumb,
.printCard {
  min-width: 0;
}

.resultStage {
  position: relative;
  overflow: hidden !important;
  padding: 12px;
  isolation: isolate;
}

.resultStage > img,
.resultStage > video,
.videoStage > video,
#videoResultPlayer {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 6px;
}

#resultImage,
#textImageResultImage,
#customResultImage,
#printResultImage {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
}

.previewWrap img,
.referenceThumb img,
.historyImagePreview img,
.galleryItem img,
.printCard img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.thumbButton,
.galleryItem > img,
.galleryItem > video,
.galleryItem .historyVideoPlayer,
.galleryError,
.galleryPending {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 6px;
}

.thumbButton {
  display: grid;
  place-items: center;
  background: var(--surface-soft);
}

.thumbButton img {
  grid-area: 1 / 1;
  height: 100%;
}

#textImageGallery .thumbButton,
#textImageGallery .thumbButton img {
  width: 100%;
  height: 100%;
}

#textImageGallery .thumbButton {
  min-height: 0;
}

#textImageGallery .galleryItem {
  grid-template-rows: auto auto auto;
  min-width: 0;
}

#textImageGallery .galleryItem .thumbButton {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  overflow: hidden;
  background: var(--surface-soft);
}

#textImageGallery .galleryItem img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  background: var(--surface-soft);
}

#textImageBatchList .batchItem {
  grid-template-columns: 72px minmax(0, 1fr);
}

#textImageBatchList .batchItem > img,
#textImageBatchList .batchItem > .galleryPending {
  display: block;
  width: 72px;
  height: 72px;
  min-width: 72px;
  max-width: 72px;
  max-height: 72px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  object-position: center;
  background: var(--surface-soft);
  overflow: hidden;
}

.galleryItem > img {
  height: auto;
  aspect-ratio: 1 / 1;
}

.historyVideoPlayer,
.galleryItem > video {
  display: block;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center;
  background: #0f172a;
}

.videoStage {
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 360px;
}

.galleryItem {
  align-content: start;
  overflow: hidden;
}

/* Neutral minimal left navigation */
:root {
  --ink: #18181b;
  --muted: #71717a;
  --line: #e4e4e7;
  --surface: #ffffff;
  --surface-soft: #f7f7f8;
  --accent: #18181b;
  --accent-dark: #09090b;
  --accent-soft: #f4f4f5;
  --shadow: 0 18px 45px rgba(24, 24, 27, 0.06);
}

body {
  color: var(--ink);
  background: #f7f7f8;
}

.appLayout {
  display: block;
  min-height: 100vh;
  padding-top: 0;
  padding-left: 224px;
  background: #f7f7f8;
}

.sideNav {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: grid;
  grid-template-rows: auto 1fr;
  width: 224px;
  min-height: 100vh;
  padding: 18px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  transform: none;
  backdrop-filter: none;
}

.sideMenu {
  display: grid;
  align-content: start;
  gap: 6px;
  overflow: visible;
  padding: 0;
}

.moduleButton {
  justify-content: flex-start;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #52525b;
  background: transparent;
  font-size: 0.92rem;
  font-weight: 750;
}

.moduleButton .menuIcon {
  display: inline-grid;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: #71717a;
  background: #f4f4f5;
}

.moduleButton:hover {
  color: #18181b;
  border-color: #e4e4e7;
  background: #fafafa;
}

.moduleButton.active {
  color: #18181b;
  border-color: #d4d4d8;
  background: #f4f4f5;
}

.moduleButton.active .menuIcon {
  color: #18181b;
  background: #e4e4e7;
}

.shell,
.workspace {
  min-width: 0;
  background: #f7f7f8;
}

.topbar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 28px 0;
  background: transparent;
}

.grid,
.promptModule,
.configModule {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 28px 40px;
}

.panel,
.outputBlock,
.historyRecord,
.historyListing,
.galleryItem,
.historyImageCard,
.printCard,
.listingSection,
.adminUserCard,
.railCard,
.loginCard,
.accountBadge,
.status,
.message,
.downloadPanel,
.drawerDownloadPanel,
.timingPanel,
.historyTiming,
.adminConfigForm {
  border-color: var(--line);
  background: #ffffff;
  box-shadow: none;
}

.blockHeader,
.drawerHeader,
.historyDetail {
  border-color: var(--line);
  background: #fafafa;
}

.primary {
  color: #ffffff;
  background: #18181b;
  box-shadow: none;
}

.primary:hover {
  background: #09090b;
}

.secondary,
.miniButton,
.imageTab,
.chatButton {
  color: #3f3f46;
  border-color: var(--line);
  background: #ffffff;
}

.secondary:hover:not(:disabled),
.miniButton:hover:not(:disabled),
.imageTab:hover {
  color: #18181b;
  border-color: #d4d4d8;
  background: #fafafa;
}

.imageTab.active,
.modeChip.active,
.message.success {
  color: #18181b;
  border-color: #d4d4d8;
  background: #f4f4f5;
  box-shadow: none;
}

.message.error,
.status.error {
  color: #b42318;
  border-color: rgba(180, 35, 24, 0.28);
  background: rgba(180, 35, 24, 0.06);
}

.accountBadge,
.status,
.downloadPanel,
.drawerDownloadPanel,
.historyTiming {
  color: #18181b;
  border-color: var(--line);
  background: #ffffff;
}

.accountBadge span,
.accountBadge strong,
.eyebrow,
.listingSection h3,
.historyImageCard span,
.timingPanel strong {
  color: #18181b;
}

.dropzone {
  border-color: #d4d4d8;
  background: #fbfbfc;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: #a1a1aa;
  background: #f4f4f5;
  color: #18181b;
}

.uploadIcon,
.brandMark,
.menuIcon {
  color: #18181b;
  background: #f4f4f5;
  box-shadow: none;
}

textarea,
input,
select {
  border-color: #d4d4d8;
  background: #ffffff;
}

textarea:focus,
input:focus,
select:focus {
  border-color: #a1a1aa;
  box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.08);
}

.resultStage {
  border-color: var(--line);
  background:
    linear-gradient(45deg, #f1f1f3 25%, transparent 25%) 0 0 / 24px 24px,
    linear-gradient(45deg, transparent 75%, #f1f1f3 75%) 0 0 / 24px 24px,
    #ffffff;
}

.loginOverlay {
  background: #f7f7f8;
}

.historyDrawer,
.adminDrawer {
  border-left-color: var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: -18px 0 42px rgba(24, 24, 27, 0.08);
}

@media (max-width: 900px) {
  .appLayout {
    padding-left: 0;
    padding-top: 72px;
  }

  .sideNav {
    inset: 10px 10px auto 10px;
    display: block;
    width: auto;
    min-height: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
  }

  .sideMenu {
    display: flex;
    gap: 6px;
    overflow-x: auto;
  }

  .moduleButton {
    width: auto;
    flex: 0 0 auto;
  }

  .moduleButton .menuIcon {
    display: none;
  }

  .grid,
  .promptModule,
  .configModule {
    padding: 16px 14px 28px;
  }
}

/* Floating neutral top navigation */
.appLayout {
  padding-left: 0;
  padding-top: 84px;
}

.sideNav {
  position: fixed;
  top: 14px;
  left: 50%;
  right: auto;
  bottom: auto;
  z-index: 60;
  display: block;
  width: min(1320px, calc(100vw - 32px));
  min-height: 0;
  padding: 6px;
  border: 1px solid rgba(228, 228, 231, 0.9);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(24, 24, 27, 0.06);
  transform: translateX(-50%);
}

.sideMenu {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0;
  scrollbar-width: none;
}

.sideMenu::-webkit-scrollbar {
  display: none;
}

.moduleButton {
  flex: 0 0 auto;
  justify-content: center;
  width: auto;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 4px;
}

.moduleButton span:not(.menuIcon) {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.moduleButton .menuIcon {
  display: none;
}

.topbar {
  padding-top: 12px;
}

@media (max-width: 900px) {
  .appLayout {
    padding-top: 76px;
  }

  .sideNav {
    inset: 10px 10px auto 10px;
    left: 10px;
    width: auto;
    border-radius: 16px;
    transform: none;
  }

  .moduleButton {
    padding: 0 12px;
  }
}

.collectionPage {
  max-width: 1320px;
  margin: 0 auto;
}

/* Compact top navigation: keep long labels such as Prompt Manager visible. */
.appLayout {
  padding-top: 72px;
}

.sideNav {
  top: 10px;
  width: min(1500px, calc(100vw - 16px));
  padding: 4px;
  border-radius: 6px;
}

.sideMenu {
  gap: 3px;
}

.moduleButton {
  min-height: 34px;
  padding: 0 9px;
  border-radius: 4px;
  font-size: 0.82rem;
  line-height: 1;
}

.moduleButton span:not(.menuIcon) {
  max-width: none;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.collectionTable {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.collectionTable.empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
}

.collectionTableHeader,
.collectionItem {
  display: grid;
  grid-template-columns: 28px 64px minmax(150px, 1.35fr) minmax(72px, .42fr) minmax(150px, .95fr) minmax(88px, .5fr) minmax(74px, .38fr) minmax(116px, .58fr) minmax(72px, .38fr) minmax(188px, .9fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.collectionBatchBar {
  display: grid;
  grid-template-columns: repeat(6, minmax(112px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.collectionBatchActions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.collectionSelectCell {
  display: grid;
  place-items: center;
}

.collectionSelectCell input,
.collectionTableHeader input {
  width: 16px;
  height: 16px;
  accent-color: #18181b;
}

.collectionTableHeader {
  padding: 0 12px;
  color: #71717a;
  font-size: 12px;
  font-weight: 800;
}

.collectionItem {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.collectionThumb {
  position: relative;
  display: grid;
  width: 64px;
  height: 64px;
  aspect-ratio: 1 / 1;
  padding: 4px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: #f8fafc;
  cursor: pointer;
  overflow: hidden;
}

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

.collectionBody {
  display: contents;
}

.collectionBody p,
.collectionBody strong {
  margin: 0;
  overflow-wrap: anywhere;
}

.collectionTitleCell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.collectionTitleCell strong {
  display: block;
  overflow: visible;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.collectionTitleCell small {
  overflow: hidden;
  color: #71717a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collectionLinkCell {
  min-width: 0;
  overflow: hidden;
  color: #52525b;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.collectionLinkCell a:hover {
  color: #18181b;
  text-decoration: underline;
}

.collectionPlatform,
.collectionOwner {
  overflow: hidden;
  color: #27272a;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collectionPrice {
  font-weight: 800;
}

.collectionStatusCell {
  display: grid;
  gap: 5px;
  min-width: 0;
  align-content: center;
}

.collectionSuiteProgress {
  display: block;
  overflow: hidden;
  color: #71717a;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collectionCounts {
  display: flex;
  gap: 8px;
  color: #52525b;
  font-size: 12px;
  font-weight: 750;
}

.collectionActions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
  white-space: normal;
}

.collectionActions .miniButton {
  flex: 0 0 auto;
}

.collectionThumb {
  cursor: default;
}

.collectionThumb .libraryBadge {
  display: none !important;
}

button:not(:disabled),
.miniButton:not(:disabled),
.moduleButton:not(:disabled),
.primary:not(:disabled),
.secondary:not(:disabled),
.iconButton:not(:disabled) {
  cursor: pointer;
}

.collectionThumb {
  cursor: default;
}

@media (max-width: 760px) {
  .collectionTableHeader {
    display: none;
  }

  .collectionItem {
    grid-template-columns: 28px 76px 1fr;
    min-width: 0;
  }

  .collectionBody {
    display: grid;
    grid-column: 3;
    gap: 8px;
  }

  .collectionActions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

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

  .collectionBatchActions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .collectionBatchActions button {
    flex: 1 1 0;
  }
}

/* Final thumbnail normalization: keep every small preview visible and stable. */
.galleryItem .thumbButton,
#textImageGallery .galleryItem .thumbButton,
.historyImagePreview,
.libraryThumb,
.batchItem > img,
.batchItem > video,
.batchItem > .galleryPending {
  display: grid !important;
  place-items: center !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  line-height: 0 !important;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
  background: #f8fafc !important;
}

.libraryThumb {
  aspect-ratio: 1 / 1 !important;
  min-height: 220px !important;
  padding: 10px !important;
}

.galleryItem .thumbButton img,
#textImageGallery .galleryItem .thumbButton img,
.historyImagePreview img,
.libraryThumb img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  background: #f8fafc !important;
}

.libraryThumb video,
.batchItem > img,
.batchItem > video {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  background: #f8fafc !important;
}

.previewStage #previewImageLarge {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

.libraryThumb img,
.libraryThumb video {
  border-radius: 6px !important;
}

#textImageBatchList .batchItem > img,
#textImageBatchList .batchItem > .galleryPending,
#videoBatchList .batchItem > img,
#videoBatchList .batchItem > video,
#videoBatchList .batchItem > .galleryPending {
  width: 72px !important;
  height: 72px !important;
  min-width: 72px !important;
  aspect-ratio: 1 / 1 !important;
}

.billingPage {
  max-width: 1180px;
  margin: 0 auto;
}

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

.billingSummary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.billingSummary span,
.billingItem span,
.billingItem small {
  color: var(--muted);
}

.billingSummary strong {
  display: block;
  margin-top: 8px;
  font-size: 1.25rem;
  color: var(--ink);
}

.billingList {
  display: grid;
  gap: 10px;
}

.billingList.empty {
  min-height: 180px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
}

.billingItem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: #fff;
}

.billingItem div:first-child {
  display: grid;
  gap: 4px;
}

.billingAmount {
  font-weight: 800;
  font-size: 1.05rem;
}

.billingAmount.positive {
  color: #047857;
}

.billingAmount.negative {
  color: #b91c1c;
}

.billingBalanceAfter {
  white-space: nowrap;
  font-size: 0.9rem;
}

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

  .billingItem {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

/* Infinity-inspired ecommerce studio shell. Keep this final so it wins over older theme layers. */
:root {
  --studio-bg: #05070d;
  --studio-panel: rgba(255, 255, 255, 0.94);
  --studio-glass: rgba(10, 15, 26, 0.72);
  --studio-line: rgba(255, 255, 255, 0.14);
  --studio-text: #f8fafc;
  --studio-muted: #a8b3c7;
  --studio-accent: #7dd3fc;
  --studio-green: #34d399;
}

body {
  background:
    radial-gradient(circle at 78% 0%, rgba(34, 211, 238, 0.18), transparent 32rem),
    radial-gradient(circle at 18% 24%, rgba(59, 130, 246, 0.18), transparent 30rem),
    linear-gradient(180deg, #05070d 0%, #0a1020 48%, #f4f7fb 48%);
}

.appLayout {
  display: block !important;
  min-height: 100vh;
  padding-top: 94px;
  background:
    linear-gradient(180deg, rgba(3, 7, 18, 0.92) 0%, rgba(6, 11, 22, 0.88) 24%, rgba(244, 247, 251, 1) 44%),
    url("/media/workbench-hero.png") center top / cover no-repeat;
}

.sideNav {
  position: fixed;
  inset: 14px clamp(14px, 3vw, 42px) auto;
  z-index: 80;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 0 !important;
  padding: 10px 12px;
  border: 1px solid var(--studio-line);
  border-radius: 10px;
  background: rgba(7, 11, 20, 0.82) !important;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(20px);
}

.brandBlock {
  padding: 0;
  color: var(--studio-text);
  white-space: nowrap;
}

.brandBlock strong {
  max-width: 13ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brandMark {
  color: #07111f;
  background: linear-gradient(135deg, #e0f2fe, #34d399);
  box-shadow: none;
}

.sideMenu {
  display: flex !important;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding: 0 2px 2px;
  scrollbar-width: none;
}

.sideMenu::-webkit-scrollbar {
  display: none;
}

.sideSection,
.teamRail {
  display: none !important;
}

.moduleButton {
  flex: 0 0 auto;
  min-height: 38px;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(248, 250, 252, 0.72);
  background: transparent;
  font-size: 0.82rem;
  letter-spacing: 0;
}

.moduleButton .menuIcon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  color: rgba(248, 250, 252, 0.76);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.68rem;
}

.moduleButton:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.moduleButton.active {
  color: #07111f;
  background: #f8fafc;
}

.moduleButton.active .menuIcon {
  color: #062033;
  background: linear-gradient(135deg, #7dd3fc, #34d399);
}

.languageToggle {
  min-width: 0;
}

.shell {
  max-width: 1460px;
  margin: 0 auto;
  padding: 0 clamp(14px, 3vw, 42px) 42px;
}

.workspace {
  overflow: visible;
  background: transparent;
}

.topbar {
  align-items: center;
  padding: 26px 0 18px;
  border: 0;
  color: var(--studio-text);
  background: transparent;
}

.topbar .eyebrow {
  color: var(--studio-accent);
}

.topbar h1 {
  color: #fff;
  font-size: clamp(1.45rem, 2.4vw, 2.35rem);
}

.topActions {
  color: var(--studio-text);
}

.accountBadge,
.status {
  border-color: rgba(255, 255, 255, 0.14);
  color: #e0f2fe;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.accountBadge strong,
.accountBadge span {
  color: #fff;
}

.topbar .secondary {
  color: #07111f;
  border-color: transparent;
  background: #f8fafc;
}

.homeHero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(320px, 0.72fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
  min-height: clamp(360px, 48vw, 590px);
  margin: 0 0 26px;
  padding: clamp(26px, 5vw, 64px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.98) 0%, rgba(2, 6, 23, 0.86) 46%, rgba(2, 6, 23, 0.42) 100%),
    url("/media/workbench-hero.png") center / cover no-repeat;
  box-shadow: 0 28px 86px rgba(0, 0, 0, 0.38);
}

.homeHero::before,
.loginMotionLayer::before {
  content: "";
  position: absolute;
  inset: -30%;
  background:
    linear-gradient(115deg, transparent 0 42%, rgba(125, 211, 252, 0.13) 46%, transparent 52%),
    linear-gradient(65deg, transparent 0 56%, rgba(52, 211, 153, 0.1) 60%, transparent 66%);
  animation: studioSweep 12s linear infinite;
}

.homeHeroCopy {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.homeHero .eyebrow,
.loginStory .eyebrow {
  color: var(--studio-accent);
}

.homeHero h2 {
  margin: 0;
  max-width: 760px;
  color: #fff;
  font-size: clamp(2.4rem, 6vw, 5.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.homeHero p,
.loginStory p {
  max-width: 650px;
  color: rgba(248, 250, 252, 0.76);
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  line-height: 1.65;
}

.homeHeroStats,
.loginStoryActions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.homeHeroStats span,
.loginStoryActions span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  font-weight: 800;
}

.homeHeroStats strong {
  margin-right: 6px;
  color: var(--studio-green);
}

.homeHeroVisual {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.38);
}

.homeHeroVisual img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.grid,
.modulePanel:not(.hidden) {
  border-radius: 12px;
}

.grid {
  padding: 0 0 42px;
}

.panel {
  border-color: rgba(15, 23, 42, 0.08);
  background: var(--studio-panel);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
}

.loginOverlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  gap: clamp(24px, 5vw, 80px);
  align-items: center;
  min-height: 100vh;
  padding: clamp(24px, 6vw, 82px);
  overflow: hidden;
  color: #fff;
  background: #020617;
}

.loginOverlay.hidden {
  display: none !important;
}

.loginBackdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.loginBackdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.98) 0%, rgba(2, 6, 23, 0.84) 43%, rgba(2, 6, 23, 0.52) 100%),
    radial-gradient(circle at 74% 40%, rgba(125, 211, 252, 0.18), transparent 30rem);
}

.loginMotionLayer {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(2, 6, 23, 0.2), rgba(2, 6, 23, 0.72)),
    url("/media/workbench-hero.png") center / cover no-repeat;
  transform: scale(1.04);
  animation: studioDrift 18s ease-in-out infinite alternate;
}

.loginBackdropImage {
  position: absolute;
  right: 6vw;
  bottom: 6vh;
  width: min(46vw, 720px);
  aspect-ratio: 16 / 10;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  background: url("/media/workbench-hero.png") center / cover no-repeat;
  box-shadow: 0 32px 92px rgba(0, 0, 0, 0.42);
  opacity: 0.84;
}

.loginStory,
.loginCard {
  position: relative;
  z-index: 1;
}

.loginStory h1 {
  max-width: 780px;
  color: #fff;
  font-size: clamp(3rem, 7.8vw, 7.8rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.loginCard {
  width: 100%;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: #fff;
  background: rgba(7, 11, 20, 0.76);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(22px);
}

.loginCard h1 {
  color: #fff;
}

.loginCard .field span {
  color: rgba(248, 250, 252, 0.8);
}

.loginCard input {
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.loginCard input::placeholder {
  color: rgba(248, 250, 252, 0.52);
}

.loginCard .primary {
  color: #06121f;
  background: linear-gradient(135deg, #e0f2fe, #34d399);
}

.loginCard .message {
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(248, 250, 252, 0.86);
  background: rgba(255, 255, 255, 0.08);
}

@keyframes studioDrift {
  from {
    transform: scale(1.03) translate3d(-1.5%, -1%, 0);
  }
  to {
    transform: scale(1.09) translate3d(1.2%, 1%, 0);
  }
}

@keyframes studioSweep {
  from {
    transform: translate3d(-16%, -8%, 0) rotate(0deg);
  }
  to {
    transform: translate3d(16%, 8%, 0) rotate(8deg);
  }
}

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

  .homeHeroVisual {
    max-width: 720px;
  }

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

  .loginBackdropImage {
    opacity: 0.34;
  }
}

@media (max-width: 900px) {
  .appLayout {
    padding-top: 116px;
  }

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

  .brandBlock {
    justify-content: center;
  }

  .topbar {
    align-items: flex-start;
  }

  .homeHero {
    padding: 26px;
  }
}

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

  .topbar {
    flex-direction: column;
  }

  .homeHero h2,
  .loginStory h1 {
    font-size: clamp(2.4rem, 14vw, 4.6rem);
  }

  .loginOverlay {
    padding: 18px;
  }

  .loginStory {
    align-self: end;
  }
}

/* Minimal white correction: keep the new structure, remove the dark hero treatment. */
body {
  color: var(--ink);
  background: #f6f7f9 !important;
}

.appLayout {
  display: block !important;
  min-height: 100vh;
  padding-top: 132px !important;
  background: #f6f7f9 !important;
}

.sideNav {
  position: fixed !important;
  inset: 14px 18px auto 18px !important;
  left: 18px !important;
  right: 18px !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  transform: none !important;
  z-index: 80;
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  min-height: 0 !important;
  padding: 10px 12px !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08) !important;
  backdrop-filter: blur(16px);
}

.brandBlock {
  flex: 0 0 auto;
  color: #111827 !important;
}

.brandMark {
  color: #111827 !important;
  background: #f3f4f6 !important;
  box-shadow: none !important;
}

.sideMenu {
  display: flex !important;
  flex: 1 1 720px;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  overflow: visible !important;
  padding: 0 !important;
}

.moduleButton {
  flex: 0 0 auto;
  min-height: 34px !important;
  padding: 0 9px !important;
  border: 1px solid transparent !important;
  border-radius: 7px !important;
  color: #4b5563 !important;
  background: transparent !important;
  font-size: 0.8rem !important;
}

.moduleButton .menuIcon {
  width: 22px !important;
  height: 22px !important;
  border-radius: 6px !important;
  color: #4b5563 !important;
  background: #f3f4f6 !important;
  font-size: 0.64rem !important;
}

.moduleButton:hover {
  color: #111827 !important;
  background: #f3f4f6 !important;
}

.moduleButton.active {
  color: #111827 !important;
  border-color: #d1d5db !important;
  background: #f9fafb !important;
}

.moduleButton.active .menuIcon {
  color: #fff !important;
  background: #111827 !important;
}

.shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px 42px !important;
}

.workspace {
  background: transparent !important;
}

.topbar {
  padding: 0 0 18px !important;
  border: 0 !important;
  color: #111827 !important;
  background: transparent !important;
}

.topbar .eyebrow {
  color: #6b7280 !important;
}

.topbar h1 {
  color: #111827 !important;
}

.accountBadge,
.status {
  border-color: #e5e7eb !important;
  color: #374151 !important;
  background: #fff !important;
  box-shadow: none !important;
}

.accountBadge strong,
.accountBadge span {
  color: #111827 !important;
}

.topbar .secondary {
  color: #111827 !important;
  border-color: #e5e7eb !important;
  background: #fff !important;
}

.homeHero {
  display: none !important;
}

.panel {
  border-color: #e5e7eb !important;
  background: #fff !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06) !important;
}

.loginOverlay {
  display: grid !important;
  grid-template-columns: minmax(320px, 440px) !important;
  place-content: center !important;
  min-height: 100vh;
  padding: 24px !important;
  color: #111827 !important;
  background: #f6f7f9 !important;
}

.loginOverlay.hidden {
  display: none !important;
}

.loginBackdrop,
.loginStory,
.loginBackdropImage,
.loginMotionLayer {
  display: none !important;
}

.loginCard {
  width: min(100%, 420px) !important;
  padding: 28px !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  color: #111827 !important;
  background: #fff !important;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08) !important;
  backdrop-filter: none !important;
}

.loginCard h1 {
  color: #111827 !important;
}

.loginCard .eyebrow,
.loginCard .field span {
  color: #6b7280 !important;
}

.loginCard input {
  border-color: #d1d5db !important;
  color: #111827 !important;
  background: #fff !important;
}

.loginCard input::placeholder {
  color: #9ca3af !important;
}

.loginCard .primary {
  color: #fff !important;
  background: #111827 !important;
}

.loginCard .message {
  border-color: #e5e7eb !important;
  color: #374151 !important;
  background: #f9fafb !important;
}

.loginCard .loginHint {
  display: none !important;
}

@media (max-width: 900px) {
  .appLayout {
    padding-top: 176px !important;
  }

  .sideNav {
    inset: 10px 10px auto !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    transform: none !important;
  }

  .brandBlock {
    flex-basis: 100%;
    justify-content: center;
  }

  .sideMenu {
    flex-basis: 100%;
  }

  .shell {
    padding-inline: 12px !important;
  }
}

/* Final compact header pass: narrower nav, separate language icon. */
.appLayout {
  padding-top: 112px !important;
}

.sideNav {
  left: 50% !important;
  right: auto !important;
  width: min(1420px, calc(100vw - 48px)) !important;
  max-width: 1420px !important;
  transform: translateX(-50%) !important;
  justify-content: center !important;
  gap: 8px 12px !important;
  padding: 8px 10px !important;
}

.brandBlock {
  flex: 0 0 auto !important;
}

.sideMenu {
  flex: 0 1 auto !important;
  flex-wrap: nowrap !important;
  justify-content: flex-start !important;
  overflow-x: auto !important;
  max-width: calc(100% - 156px);
  gap: 4px !important;
  scrollbar-width: none;
}

.sideMenu::-webkit-scrollbar {
  display: none;
}

.moduleButton {
  min-height: 35px !important;
  gap: 5px !important;
  padding: 0 9px !important;
  font-size: 0.86rem !important;
}

.moduleButton .menuIcon {
  width: 22px !important;
  height: 22px !important;
  border-radius: 5px !important;
  font-size: 0.66rem !important;
}

.topLanguageToggle {
  position: fixed;
  top: 16px;
  right: 18px;
  z-index: 95;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #111827;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
}

.topLanguageToggle .menuIcon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: #111827;
  background: #f3f4f6;
  font-size: 0.68rem;
  font-weight: 850;
}

.topLanguageToggle .languageLabel {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.topLanguageToggle:hover {
  border-color: #d1d5db;
  background: #fff;
}

.topActions {
  padding-right: 44px;
}

@media (max-width: 900px) {
  .appLayout {
    padding-top: 136px !important;
  }

  .sideNav {
    left: 12px !important;
    right: 56px !important;
    width: auto !important;
    max-width: none !important;
    transform: none !important;
    justify-content: flex-start !important;
  }

  .brandBlock {
    flex-basis: auto !important;
  }

  .sideMenu {
    flex: 1 1 360px !important;
    max-width: 100%;
  }

  .topLanguageToggle {
    top: 12px;
    right: 12px;
  }

  .topActions {
    padding-right: 0;
  }
}
