[hidden] {
  display: none !important;
}

﻿/* ==========================================================================
   Lumiere AI Studio - Design System & Stylesheet
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #10b981;
  --success-hover: #059669;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-elevated: #f1f5f9;
  --border: #e2e8f0;
  --border-focus: #93c5fd;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft JhengHei", sans-serif;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Header --- */
.app-header {
  height: 64px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--primary);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-icon {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.nav-tabs {
  display: flex;
  gap: 6px;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 18px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-tab:hover {
  color: var(--primary);
}

.nav-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.gallery-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
}

.user-line-id {
  font-size: 11px;
  color: var(--text-light);
  font-family: monospace;
}

.quota-pill-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.quota-pill-header.empty {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

/* --- Guest Banner --- */
.guest-banner {
  background: linear-gradient(90deg, #eff6ff, #f0fdf4);
  border-bottom: 1px solid #dbeafe;
  padding: 10px 24px;
}

.banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: #1e3a8a;
  flex-wrap: wrap;
}

.banner-badge {
  background: #2563eb;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-main);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn:hover:not(:disabled) {
  background: var(--bg-elevated);
  border-color: #cbd5e1;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-success {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.btn-success:hover:not(:disabled) {
  background: var(--success-hover);
  border-color: var(--success-hover);
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border);
  color: var(--text-main);
}

.btn-line {
  background: #06c755;
  border-color: #06c755;
  color: #fff;
  font-weight: 600;
}

.btn-line:hover {
  background: #05b04b;
  border-color: #05b04b;
}

.btn-icon {
  padding: 8px;
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
}

.btn-text:hover {
  background: var(--primary-light);
}

.btn-block {
  width: 100%;
}

/* --- Main Layout --- */
.app-main {
  flex: 1;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

/* --- Workspace Grid --- */
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.25fr) minmax(360px, 0.95fr);
  gap: 20px;
  align-items: start;
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.panel-header h2 {
  font-size: 17px;
  font-weight: 700;
}

.quota-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.quota-pill.exhausted {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

/* --- Form Elements --- */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-group .required {
  color: var(--danger);
  font-style: normal;
}

.form-control {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-main);
  background: var(--bg-surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.char-count {
  font-size: 11px;
  color: var(--text-light);
}

.prompt-textarea {
  height: 120px;
  resize: vertical;
  line-height: 1.5;
}

/* --- Prompt Presets Bar --- */
.presets-section {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
}

.presets-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.presets-header label {
  margin-bottom: 0;
  font-size: 12px;
}

.presets-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  align-items: center;
}

.presets-empty {
  font-size: 12px;
  color: var(--text-light);
  font-style: italic;
}

.preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface);
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 3px 8px 3px 10px;
  font-size: 12px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.preset-chip .chip-label {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-chip .chip-del {
  border: none;
  background: transparent;
  color: var(--text-light);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.preset-chip .chip-del:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

/* --- Reference Uploads --- */
.upload-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 14px;
  background: var(--bg-main);
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.upload-box:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.ref-previews {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.ref-card {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.ref-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ref-card .btn-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border: none;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Generate Action Area --- */
.gen-action-area {
  margin-top: 20px;
}

.btn-generate {
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.15s ease;
}

.btn-generate:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-generate:disabled {
  background: #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
}

.cost-estimate-box {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-top: 10px;
  text-align: center;
}

.estimate-cost {
  font-size: 13px;
  color: var(--text-main);
}

.estimate-cost strong {
  color: var(--primary);
  font-size: 15px;
}

.estimate-tip {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* --- Results Panel --- */
.status-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.status-idle {
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.status-working {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.status-done {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.status-fail {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.canvas-container {
  min-height: 360px;
  background: var(--bg-main);
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.canvas-placeholder {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
}

.canvas-placeholder p {
  font-size: 13px;
  margin-top: 8px;
  max-width: 260px;
}

.result-image {
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
  display: block;
}

.canvas-spinner {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #dbeafe;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.task-info-card {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.info-label {
  color: var(--text-muted);
}

.info-value {
  font-weight: 600;
}

.info-value.mono {
  font-family: monospace;
  font-size: 12px;
  color: var(--text-muted);
}

/* --- VIEW 2: Cropper Tool --- */
.cropper-container {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cropper-toolbar {
  padding: 14px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.segmented-control {
  display: inline-flex;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2px;
}

.segment-btn {
  background: transparent;
  border: none;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.segment-btn.active {
  background: var(--bg-surface);
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.tool-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.crop-dimension-display {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.badge-ratio {
  font-size: 11px;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
}

.cropper-stage {
  min-height: 520px;
  background: #0f172a;
  background-image: 
    linear-gradient(45deg, #1e293b 25%, transparent 25%), 
    linear-gradient(-45deg, #1e293b 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #1e293b 75%), 
    linear-gradient(-45deg, transparent 75%, #1e293b 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  padding: 20px;
  user-select: none;
}

.crop-stage-empty {
  text-align: center;
  color: #94a3b8;
}

.crop-stage-empty h3 {
  font-size: 16px;
  margin: 12px 0 4px;
  color: #e2e8f0;
}

.crop-stage-empty p {
  font-size: 13px;
}

.crop-canvas-wrapper {
  position: relative;
  display: inline-block;
  line-height: 0;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.crop-target-image {
  display: block;
  max-width: 100%;
  max-height: 580px;
  pointer-events: none;
}

/* Crop Mask and Box */
.crop-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: none;
  z-index: 2;
}

.crop-selection-box {
  position: absolute;
  border: 2px solid #38bdf8;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  cursor: move;
  z-index: 5;
  touch-action: none;
}

/* Rule of Thirds Grid */
.crop-grid-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.grid-line {
  position: absolute;
  background: rgba(255, 255, 255, 0.35);
}

.grid-line.h1 { top: 33.333%; left: 0; right: 0; height: 1px; }
.grid-line.h2 { top: 66.666%; left: 0; right: 0; height: 1px; }
.grid-line.v1 { left: 33.333%; top: 0; bottom: 0; width: 1px; }
.grid-line.v2 { left: 66.666%; top: 0; bottom: 0; width: 1px; }

/* 8 Resize Handles */
.c-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #38bdf8;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.c-handle.nw { left: -7px; top: -7px; cursor: nwse-resize; }
.c-handle.n  { left: 50%; top: -7px; transform: translateX(-50%); cursor: ns-resize; }
.c-handle.ne { right: -7px; top: -7px; cursor: nesw-resize; }
.c-handle.e  { right: -7px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.c-handle.se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.c-handle.s  { left: 50%; bottom: -7px; transform: translateX(-50%); cursor: ns-resize; }
.c-handle.sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.c-handle.w  { left: -7px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }

/* --- VIEW 3: Gallery --- */
.gallery-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.gallery-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.gallery-header-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.gallery-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
}

.gallery-filter span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.gallery-filter .form-control {
  min-height: 36px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.gallery-results-bar {
  color: var(--text-muted);
  font-size: 12px;
  min-height: 18px;
}

.gallery-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.gallery-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-media {
  height: 200px;
  background: #0f172a;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.media-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 12px;
  background: #0f172a;
}

.card-media.is-error .media-loading {
  color: #fca5a5;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.card-media:hover img {
  transform: scale(1.04);
}

.card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.card-model-badge {
  font-size: 11px;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
}

.card-cost-badge {
  font-size: 11px;
  font-weight: 600;
  background: #ecfdf5;
  color: #065f46;
  padding: 2px 6px;
  border-radius: 4px;
}

.card-date {
  font-size: 11px;
  color: var(--text-light);
}

.card-prompt {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.card-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.card-btn {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.card-btn:hover {
  background: var(--bg-elevated);
  color: var(--primary);
  border-color: #cbd5e1;
}

.card-btn.btn-del:hover {
  color: var(--danger);
  background: #fef2f2;
}

.gallery-empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.gallery-empty h3 {
  font-size: 17px;
  margin: 12px 0 6px;
}

.gallery-empty p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .gallery-header {
    align-items: stretch;
    flex-direction: column;
  }

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

  .gallery-filter {
    min-width: 0;
  }

  .gallery-header-actions .btn {
    justify-content: center;
  }
}

/* --- Modals --- */
.modal-overlay[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-width: 460px;
  width: 100%;
  overflow: hidden;
  animation: modalIn 0.15s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 12px 20px;
  background: var(--bg-main);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Login Modal */
.login-modal-body {
  text-align: center;
}

.login-badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.login-modal-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.point-rate-card {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: left;
  font-size: 12px;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 20px;
}

.btn-line-large {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  background: #06c755;
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background 0.15s ease;
}

.btn-line-large:hover {
  background: #05b04b;
}

/* Lightbox Modal */
.lightbox-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  max-width: 960px;
  width: 100%;
  max-height: 85vh;
  display: grid;
  grid-template-columns: 1fr 340px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  font-size: 18px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-media-wrapper {
  background: #090d16;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
}

.lightbox-media-wrapper img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
}

.lightbox-sidebar {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  border-left: 1px solid var(--border);
}

.lightbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.date-badge {
  font-size: 11px;
  color: var(--text-muted);
}

.lightbox-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.prompt-box {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 13px;
  max-height: 150px;
  overflow-y: auto;
  line-height: 1.5;
}

.spec-text, .mono-text {
  font-size: 13px;
  font-weight: 500;
}

.mono-text {
  font-family: monospace;
  font-size: 11px;
  color: var(--text-muted);
}

.lightbox-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
}

.toast {
  background: #1e293b;
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.2s ease;
}

.toast.success { background: #065f46; }
.toast.error   { background: #991b1b; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive Adjustments --- */
@media (max-width: 900px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .lightbox-card {
    grid-template-columns: 1fr;
    max-height: 90vh;
    overflow-y: auto;
  }
  .lightbox-media-wrapper {
    height: 320px;
  }
  .cropper-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 600px) {
  .app-header {
    padding: 0 12px;
  }
  .header-left {
    gap: 12px;
  }
  .nav-tab {
    padding: 16px 8px;
    font-size: 13px;
  }
  .result-actions {
    grid-template-columns: 1fr;
  }
}

/* Multimodal generator controls */
.creation-type-switch {
  width: fit-content;
}

.creation-type-switch .segment-btn {
  min-width: 76px;
}

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

.video-frame-grid .form-group {
  margin-bottom: 0;
}

.compact-upload {
  min-height: 42px;
  padding: 9px 12px;
}

.compact-upload.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.check-row {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  cursor: pointer;
}

.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.result-video,
.result-audio {
  max-width: 100%;
  width: 100%;
  max-height: 480px;
}

.result-video {
  background: #0b1f33;
}

.gallery-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-media[data-media-type="music"] {
  display: grid;
  place-items: center;
  padding: 18px;
  background: #102a43;
}

.card-media[data-media-type="music"] .gallery-media {
  height: auto;
}

.lightbox-media-wrapper video {
  max-width: 100%;
  max-height: 75vh;
}

.lightbox-media-wrapper audio {
  width: min(100%, 460px);
}

@media (max-width: 640px) {
  .form-grid-2,
  .video-frame-grid {
    grid-template-columns: 1fr;
  }

  .creation-type-switch {
    width: 100%;
  }

  .creation-type-switch .segment-btn {
    flex: 1;
  }
}

/* --- Visual refresh --- */
body {
  background: var(--bg-main);
}

.app-header {
  height: 70px;
  padding: 0 clamp(16px, 3vw, 36px);
  box-shadow: 0 1px 0 rgba(148, 163, 184, 0.25), 0 8px 24px rgba(15, 23, 42, 0.04);
}

.header-left {
  gap: clamp(16px, 3vw, 38px);
  min-width: 0;
}

.brand {
  flex: 0 0 auto;
  letter-spacing: 0;
}

.nav-tabs {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  border-bottom: 0;
  border-radius: 8px;
  padding: 10px 12px;
  white-space: nowrap;
}

.nav-tab:hover {
  background: #f1f5f9;
}

.nav-tab.active {
  background: var(--primary-light);
}

.guest-banner {
  background: #eef6ff;
  border-bottom-color: #d7e7fb;
}

.app-main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 32px) clamp(14px, 3vw, 36px);
}

.workspace-grid {
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
  gap: 24px;
}

.panel {
  border-color: #d8e2ee;
  border-radius: 10px;
  padding: clamp(18px, 2.4vw, 28px);
  box-shadow: 0 12px 30px rgba(30, 64, 175, 0.06);
}

.panel-header {
  margin-bottom: 22px;
  padding-bottom: 14px;
}

.panel-header h2 {
  letter-spacing: 0;
}

.form-control {
  border-color: #d4deea;
  min-height: 42px;
}

.form-control:hover {
  border-color: #b8c7d9;
}

.presets-section,
.cost-estimate-box,
.task-info-card {
  background: #f6f9fc;
}

.btn {
  min-height: 38px;
  border-radius: 8px;
}

.btn-primary,
.btn-success,
.btn-generate {
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.16);
}

/* Cropper workspace */
.cropper-container {
  border-color: #d8e2ee;
  border-radius: 12px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07);
}

.cropper-toolbar {
  padding: 16px clamp(16px, 2.5vw, 24px);
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.96);
}

.toolbar-left,
.toolbar-right {
  align-items: center;
}

.cropper-toolbar-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 150px;
  margin-right: 4px;
}

.toolbar-eyebrow,
.crop-empty-kicker {
  color: #0f766e;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.cropper-toolbar-title strong {
  color: var(--text-main);
  font-size: 15px;
  font-weight: 750;
}

.btn-upload-crop {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding-inline: 15px;
  color: #fff !important;
  font-size: 14px !important;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
}

.btn-upload-crop svg,
#btn-crop-confirm-download svg {
  display: block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: currentColor;
  stroke: currentColor;
}

#btn-crop-confirm-download {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  color: #fff !important;
  font-size: 14px !important;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
}

.ratio-preset-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.segmented-control {
  background: #f3f7fb;
  border-color: #d5e0eb;
}

#cropper-ratio-group {
  max-width: min(100%, 640px);
  flex-wrap: wrap;
}

.segment-btn {
  min-height: 29px;
  white-space: nowrap;
}

.crop-dimension-display {
  padding: 7px 10px;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background: #f8fafc;
  white-space: nowrap;
}

.cropper-stage {
  min-height: clamp(540px, calc(100vh - 260px), 760px);
  padding: clamp(18px, 4vw, 42px);
  background-color: #101c2d;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.035) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

.crop-stage-empty {
  width: min(100%, 460px);
  padding: 38px 34px 32px;
  border: 1px solid rgba(191, 219, 254, 0.2);
  border-radius: 14px;
  background: rgba(15, 31, 52, 0.86);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.crop-empty-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(125, 211, 252, 0.34);
  border-radius: 18px;
  color: #7dd3fc;
  background: rgba(14, 116, 144, 0.18);
}

.crop-empty-kicker {
  display: block;
  margin-bottom: 7px;
}

.crop-stage-empty h3 {
  margin: 0 0 8px;
  color: #f8fafc;
  font-size: clamp(19px, 2vw, 23px);
}

.crop-stage-empty p {
  max-width: 320px;
  margin: 0 auto 20px;
  color: #b9c7d8;
  line-height: 1.6;
}

.crop-upload-dropzone {
  min-height: 136px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px dashed rgba(125, 211, 252, 0.72);
  border-radius: 12px;
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.09);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.crop-upload-dropzone:hover,
.crop-upload-dropzone.is-dragging {
  border-color: #38bdf8;
  background: rgba(14, 165, 233, 0.2);
  transform: translateY(-2px);
}

.crop-upload-dropzone strong {
  color: #f8fafc;
  font-size: 14px;
}

.crop-upload-dropzone span {
  color: #9fb2c8;
  font-size: 12px;
}

.crop-upload-note {
  display: block;
  margin-top: 14px;
  color: #8295aa;
  font-size: 11px;
}

.crop-canvas-wrapper {
  max-width: 100%;
  border: 1px solid rgba(226, 232, 240, 0.2);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.42);
}

.crop-target-image {
  max-width: 100%;
  max-height: min(620px, calc(100vh - 330px));
}

.crop-selection-box {
  border-color: #67e8f9;
  box-shadow: 0 0 0 9999px rgba(3, 10, 20, 0.62);
}

.c-handle {
  background: #67e8f9;
}

@media (max-width: 1100px) {
  .cropper-toolbar {
    align-items: stretch;
  }

  .toolbar-left,
  .toolbar-right {
    width: 100%;
  }

  .toolbar-right {
    justify-content: space-between;
  }

  .cropper-toolbar-title {
    margin-right: auto;
  }
}

@media (max-width: 900px) {
  .app-header {
    height: auto;
    min-height: 64px;
    padding-block: 8px;
  }

  .header-left {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .nav-tab {
    padding: 8px 10px;
  }

  .cropper-stage {
    min-height: 500px;
  }

  .cropper-toolbar-title {
    min-width: 130px;
  }
}

@media (max-width: 600px) {
  .header-right {
    gap: 6px;
  }

  .guest-banner {
    padding-inline: 14px;
  }

  .banner-content {
    align-items: flex-start;
  }

  .cropper-toolbar {
    padding: 14px;
  }

  .toolbar-left,
  .toolbar-right,
  .ratio-preset-group {
    align-items: stretch;
  }

  .cropper-toolbar-title,
  .btn-upload-crop,
  .ratio-preset-group,
  .tool-btn-group,
  .toolbar-right,
  .crop-dimension-display,
  #btn-crop-confirm-download {
    width: 100%;
  }

  .toolbar-left,
  .toolbar-right {
    flex-direction: column;
  }

  .ratio-preset-group {
    flex-direction: column;
  }

  .segmented-control {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }

  .tool-btn-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .toolbar-right {
    gap: 10px;
  }

  .crop-dimension-display {
    justify-content: space-between;
  }

  .crop-stage-empty {
    padding: 30px 18px 24px;
  }

  .cropper-stage {
    min-height: 460px;
    padding: 16px;
  }
}

/* --- Final contrast and polish pass --- */
:root {
  --primary: #075985;
  --primary-hover: #0c4a6e;
  --primary-light: #e0f2fe;
  --bg-main: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-elevated: #e8eef5;
  --border: #d5e0ea;
  --border-focus: #38bdf8;
  --text-main: #102a43;
  --text-muted: #52677d;
  --text-light: #8295a8;
}

body {
  color: var(--text-main);
  background: #f1f5f9;
}

.app-header {
  background: rgba(255, 255, 255, 0.98);
  border-bottom-color: #cbd8e5;
}

.brand,
.brand-icon {
  color: #075985;
}

.nav-tab {
  color: #52677d;
}

.nav-tab:hover {
  color: #075985;
  background: #e0f2fe;
}

.nav-tab.active {
  color: #075985;
  background: #e0f2fe;
}

.guest-banner {
  background: #e0f2fe;
  border-bottom-color: #bae6fd;
}

.banner-content {
  color: #164e63;
}

.panel,
.cropper-container,
.gallery-card {
  border-color: #d5e0ea;
  box-shadow: 0 10px 28px rgba(30, 64, 91, 0.08);
}

.panel-header {
  border-bottom-color: #e2eaf1;
}

.form-control {
  background: #ffffff;
  border-color: #cbd8e5;
}

.form-control:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.16);
}

.btn {
  border-color: #cbd8e5;
  background: #ffffff;
  color: #183b56;
}

.btn:hover:not(:disabled) {
  background: #f0f7fb;
  border-color: #94aabd;
}

.btn-primary {
  background: #075985;
  border-color: #075985;
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: #0c4a6e;
  border-color: #0c4a6e;
}

.btn-success {
  background: #047857;
  border-color: #047857;
  color: #ffffff;
}

.btn-success:hover:not(:disabled) {
  background: #065f46;
  border-color: #065f46;
}

.btn-generate {
  background: #075985;
  box-shadow: 0 8px 18px rgba(7, 89, 133, 0.22);
}

.btn-generate:hover:not(:disabled) {
  background: #0c4a6e;
  box-shadow: 0 10px 22px rgba(7, 89, 133, 0.28);
}

.btn-upload-crop,
#btn-crop-confirm-download {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px !important;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
}

.btn-upload-crop {
  background: #075985 !important;
  border: 1px solid #075985 !important;
  color: #ffffff !important;
  cursor: pointer;
}

.btn-upload-crop:hover {
  background: #0c4a6e !important;
  border-color: #0c4a6e !important;
}

#btn-crop-confirm-download {
  background: #047857 !important;
  border: 1px solid #047857 !important;
  color: #ffffff !important;
}

#btn-crop-confirm-download:hover:not(:disabled) {
  background: #065f46 !important;
  border-color: #065f46 !important;
}

#btn-crop-confirm-download:disabled {
  background: #94a3b8 !important;
  border-color: #94a3b8 !important;
  color: #f8fafc !important;
  opacity: 0.9;
}

.btn-upload-crop > span,
#btn-crop-confirm-download > span {
  display: inline-block;
  color: inherit !important;
  visibility: visible !important;
}

.btn-upload-crop svg,
#btn-crop-confirm-download svg {
  display: block !important;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: currentColor !important;
  stroke: currentColor !important;
  visibility: visible !important;
}

.cropper-toolbar {
  background: #ffffff;
  border-bottom-color: #d5e0ea;
}

.cropper-toolbar-title strong {
  color: #102a43;
}

.toolbar-eyebrow,
.crop-empty-kicker {
  color: #0f766e;
}

.segmented-control {
  background: #f1f5f9;
  border-color: #cbd8e5;
}

.segment-btn {
  color: #52677d;
}

.segment-btn:hover {
  color: #075985;
  background: #e0f2fe;
}

.segment-btn.active {
  color: #075985;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(30, 64, 91, 0.16);
}

.crop-dimension-display {
  color: #183b56;
  background: #f8fafc;
  border-color: #cbd8e5;
}

.badge-ratio {
  color: #52677d;
  background: #e8eef5;
}

.cropper-stage {
  background-color: #0b1f33;
}

.crop-stage-empty {
  background: #102a43;
  border-color: rgba(125, 211, 252, 0.32);
}

.crop-upload-dropzone {
  color: #bae6fd;
  background: rgba(2, 132, 199, 0.16);
  border-color: #38bdf8;
}

.crop-upload-dropzone:hover,
.crop-upload-dropzone.is-dragging {
  background: rgba(2, 132, 199, 0.28);
  border-color: #7dd3fc;
}

.crop-selection-box {
  border-color: #67e8f9;
}

.toast {
  border: 1px solid rgba(255, 255, 255, 0.14);
}

@media (max-width: 600px) {
  .btn-upload-crop,
  #btn-crop-confirm-download {
    width: 100%;
  }
}

/* Updated visual language */
:root {
  --primary: #5b3cc4;
  --primary-hover: #43249e;
  --primary-light: #f1edff;
  --success: #087f5b;
  --success-hover: #06634a;
  --warning: #d97706;
  --danger: #d64545;
  --bg-main: #f8f5f0;
  --bg-surface: #fffdf9;
  --bg-elevated: #f0ebe4;
  --border: #ded5ca;
  --border-focus: #a78bfa;
  --text-main: #29243b;
  --text-muted: #756c7d;
  --text-light: #a69bab;
}

body {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.7), transparent 42%),
    var(--bg-main);
}

.app-header {
  background: rgba(255, 253, 249, 0.97);
  border-bottom-color: #e5ddd4;
}

.brand,
.brand-icon,
.nav-tab:hover,
.nav-tab.active {
  color: var(--primary);
}

.nav-tab:hover,
.nav-tab.active {
  background: var(--primary-light);
}

.guest-banner {
  background: #fff1e7;
  border-bottom-color: #f6d0b7;
}

.banner-content {
  color: #7c3f21;
}

.btn-primary,
.btn-generate {
  background: #5b3cc4;
  border-color: #5b3cc4;
}

.btn-primary:hover:not(:disabled),
.btn-generate:hover:not(:disabled) {
  background: #43249e;
  border-color: #43249e;
}

.btn-generate {
  box-shadow: 0 8px 18px rgba(91, 60, 196, 0.22);
}

.btn-success {
  background: #087f5b;
  border-color: #087f5b;
}

.panel,
.cropper-container,
.gallery-card {
  box-shadow: 0 12px 30px rgba(69, 48, 34, 0.08);
}

.form-control:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.segment-btn.active {
  color: var(--primary);
}

.frame-preview {
  margin-top: 8px;
  width: 100%;
  height: 88px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #efe9e2;
}

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

.music-mode .prompt-textarea {
  min-height: 240px;
  height: 240px;
}

.lyrics-panel {
  margin-top: 14px;
  border: 1px solid #e3d6f5;
  border-radius: 8px;
  background: #fbf8ff;
  padding: 14px;
}

.lyrics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #43249e;
  font-size: 13px;
  font-weight: 700;
}

.lyrics-panel pre,
.lyrics-box {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 240px;
  overflow-y: auto;
  color: var(--text-main);
  font: inherit;
  font-size: 13px;
  line-height: 1.65;
}

.lightbox-media-wrapper audio {
  background: #f5efe8;
  border-radius: 8px;
}

.quota-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: -8px 0 20px;
}

.quota-card {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffaf4;
}

.quota-card-label,
.quota-card small {
  display: block;
}

.quota-card-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.quota-card strong {
  display: block;
  margin: 3px 0;
  color: var(--text-main);
  font-size: 16px;
}

.quota-card small {
  color: var(--text-light);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quota-card-image {
  border-top: 3px solid #e76f51;
}

.quota-card-video {
  border-top: 3px solid #457b9d;
}

.quota-card-music {
  border-top: 3px solid #3f7d5b;
}

.music-result-preview {
  width: min(100%, 440px);
  padding: 28px 24px 22px;
  border: 1px solid #ead0b5;
  border-radius: 14px;
  background:
    radial-gradient(circle at 20% 10%, rgba(231, 111, 81, 0.22), transparent 30%),
    linear-gradient(145deg, #fff4e8, #f6e4d4);
  box-shadow: 0 18px 38px rgba(130, 72, 42, 0.12);
}

.music-artwork {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #9b2c4d;
  color: #fff7ef;
  font-size: 42px;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(155, 44, 77, 0.25);
}

.music-preview-copy {
  display: grid;
  gap: 3px;
  margin-bottom: 15px;
  text-align: center;
}

.music-preview-copy strong {
  color: #6d2139;
  font-size: 17px;
}

.music-preview-copy span {
  color: #8c6a5b;
  font-size: 12px;
}

.music-result-preview .result-audio {
  width: 100%;
}

.canvas-container.music-preview-mode {
  min-height: 360px;
  background: #fff8f0;
  border-style: solid;
  border-color: #ead0b5;
}

/* Second palette pass: berry, apricot, sage and ink */
:root {
  --primary: #9b2c4d;
  --primary-hover: #741f38;
  --primary-light: #fff0f3;
  --success: #3f7d5b;
  --success-hover: #2f6548;
  --warning: #c66a12;
  --danger: #bf3f4d;
  --bg-main: #f7f1e8;
  --bg-surface: #fffdf9;
  --bg-elevated: #eee6dc;
  --border: #dfd1c2;
  --border-focus: #e6a27b;
  --text-main: #263238;
  --text-muted: #6e6870;
  --text-light: #a19597;
}

body {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.75), transparent 48%),
    var(--bg-main);
}

.brand,
.brand-icon,
.nav-tab:hover,
.nav-tab.active {
  color: #9b2c4d;
}

.nav-tab:hover,
.nav-tab.active {
  background: #fff0f3;
}

.guest-banner {
  background: #fff1e7;
  border-bottom-color: #f2c9ab;
}

.banner-content {
  color: #7d4024;
}

.btn-primary,
.btn-generate {
  background: #9b2c4d;
  border-color: #9b2c4d;
}

.btn-primary:hover:not(:disabled),
.btn-generate:hover:not(:disabled) {
  background: #741f38;
  border-color: #741f38;
}

.btn-generate {
  box-shadow: 0 8px 18px rgba(155, 44, 77, 0.2);
}

.btn-success {
  background: #3f7d5b;
  border-color: #3f7d5b;
}

.form-control:focus {
  border-color: #e6a27b;
  box-shadow: 0 0 0 3px rgba(230, 162, 123, 0.2);
}

.quota-pill,
.quota-pill-header {
  background: #eef7ee;
  border-color: #c9e2ca;
  color: #356447;
}

.quota-pill.exhausted,
.quota-pill-header.empty {
  background: #fff0f0;
  border-color: #efc5c9;
  color: #9b2c4d;
}

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

  .quota-card {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 4px 10px;
  }

  .quota-card-label {
    grid-row: span 2;
    align-self: center;
  }

  .quota-card strong,
  .quota-card small {
    text-align: right;
  }
}
.chat-shell { display:grid; grid-template-columns:280px minmax(0,1fr); height:calc(100dvh - 128px); min-height:480px; max-height:calc(100dvh - 128px); background:var(--surface, #fff); border:1px solid var(--border, #e2e8f0); border-radius:16px; overflow:hidden; }
.chat-sidebar { display:flex; flex-direction:column; gap:12px; padding:16px; border-right:1px solid var(--border, #e2e8f0); background:#f8fafc; min-width:0; min-height:0; overflow:hidden; }
.chat-sidebar-head,.chat-header,.chat-header-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.chat-sidebar-head,#chat-manage-characters { flex:0 0 auto; }
.chat-conversation-list { display:flex; flex-direction:column; gap:6px; min-height:0; overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; flex:1 1 0; }
.chat-conversation-item { border:0; background:transparent; border-radius:10px; padding:11px; text-align:left; cursor:pointer; color:#334155; }
.chat-conversation-item:hover,.chat-conversation-item.active { background:#e8efff; color:#1d4ed8; }
.chat-conversation-item strong,.chat-conversation-item small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-conversation-item small { margin-top:4px; color:#64748b; }
.chat-pool-card { flex:0 0 auto; padding:12px; border-radius:12px; background:#fff; border:1px solid #e2e8f0; }
.chat-pool-card span,.chat-pool-card strong,.chat-pool-card small { display:block; }
.chat-pool-card strong { margin:5px 0; color:#2563eb; }
.chat-main { display:flex; min-width:0; min-height:0; height:100%; overflow:hidden; flex-direction:column; }
.chat-header { padding:14px 18px; border-bottom:1px solid #e2e8f0; }
.chat-header h2 { margin:0 0 3px; font-size:18px; }
.chat-title-row { display:flex; align-items:center; gap:10px; }
.chat-title-row h2 { overflow-wrap:anywhere; }
.chat-header-actions .form-control { min-width:220px; }
.chat-parameter { display:flex; flex-direction:column; gap:3px; color:#64748b; font-size:11px; }
.chat-header-actions .chat-parameter .form-control { min-width:0; width:112px; padding:7px 9px; }
.chat-messages { flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; padding:24px max(20px,8%); background:#fff; }
.chat-message { max-width:82%; margin:0 0 18px; }
.chat-message small { display:block; margin:0 0 5px; color:#64748b; }
.chat-message > div { padding:12px 15px; border-radius:14px; white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.65; background:#f1f5f9; }
.chat-message-cost { display:block; margin-top:7px; color:#64748b; font-size:11px; line-height:1.2; text-align:right; white-space:nowrap; }
.chat-message.user { margin-left:auto; }
.chat-message.user small { text-align:right; }
.chat-message.user > div { background:#2563eb; color:#fff; }
.chat-composer { display:flex; flex:0 0 auto; gap:10px; align-items:flex-end; padding:14px 18px; border-top:1px solid #e2e8f0; background:#fff; }
.chat-composer textarea { resize:none; min-height:52px; }
.chat-empty,.chat-empty-small { color:#94a3b8; text-align:center; padding:32px 10px; }
.chat-empty-small { padding:14px 4px; font-size:13px; }
.chat-character-card { width:min(620px, calc(100vw - 32px)); max-height:calc(100dvh - 32px); display:flex; flex-direction:column; overflow:hidden; }
.chat-character-card .modal-header { flex:0 0 auto; position:relative; z-index:2; background:#fff; }
.chat-character-card .modal-body { min-height:0; overflow-y:auto; overscroll-behavior:contain; }
.chat-character-list { max-height:210px; overflow:auto; }
.chat-character-row { display:flex; align-items:center; gap:10px; border-bottom:1px solid #e2e8f0; }
.chat-character-edit { flex:1; border:0; background:transparent; text-align:left; padding:10px 0; cursor:pointer; }
.chat-character-edit strong,.chat-character-edit small { display:block; }
.chat-character-edit small { color:#64748b; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.club-role-section { margin-top:22px; padding-top:18px; border-top:1px solid #e2e8f0; }
.club-role-section h4 { margin-bottom:10px; }
.chat-club-role-list { display:flex; flex-direction:column; max-height:280px; overflow-y:auto; }
.club-role-row { border-bottom:1px solid #e2e8f0; }
.club-role-select { display:block; width:100%; padding:11px 4px; border:0; background:transparent; text-align:left; cursor:pointer; }
.club-role-select:hover { background:#eff6ff; }
.club-role-select strong,.club-role-select small { display:block; }
.club-role-select small { margin-top:4px; color:#64748b; white-space:normal; line-height:1.5; }
.chat-message.assistant > div p { margin:0 0 .65em; }
.chat-message.assistant > div p:last-child { margin-bottom:0; }
.chat-message.assistant > div h1,.chat-message.assistant > div h2,.chat-message.assistant > div h3,.chat-message.assistant > div h4 { margin:.8em 0 .4em; line-height:1.3; }
.chat-message.assistant > div h1:first-child,.chat-message.assistant > div h2:first-child,.chat-message.assistant > div h3:first-child { margin-top:0; }
.chat-message.assistant > div ul,.chat-message.assistant > div ol { padding-left:1.5em; margin:.5em 0; }
.chat-message.assistant > div pre { overflow-x:auto; padding:12px; border-radius:8px; background:#0f172a; color:#e2e8f0; white-space:pre; }
.chat-message.assistant > div code { padding:.1em .35em; border-radius:4px; background:#e2e8f0; font-family:ui-monospace,Consolas,monospace; }
.chat-message.assistant > div pre code { padding:0; background:transparent; color:inherit; }
.chat-message.assistant > div blockquote { margin:.6em 0; padding-left:12px; border-left:3px solid #94a3b8; color:#475569; }
.chat-math { display:inline; font-family:"Cambria Math","STIX Two Math","Noto Sans Math","Times New Roman",serif; font-size:1.08em; letter-spacing:.01em; white-space:normal; }
.chat-message.assistant .katex-display { display:block; max-width:100%; margin:.8em 0; padding:10px 12px; overflow-x:auto; overflow-y:hidden; border-radius:8px; background:#f8fafc; white-space:normal; overflow-wrap:normal; word-break:normal; line-height:normal; }
.chat-message.assistant .katex { white-space:normal; overflow-wrap:normal; word-break:normal; line-height:1.2; text-indent:0; }
.chat-message.assistant .katex,
.chat-message.assistant .katex *,
.chat-message.assistant .katex::before,
.chat-message.assistant .katex::after,
.chat-message.assistant .katex *::before,
.chat-message.assistant .katex *::after { box-sizing:content-box; }
.chat-message.assistant .katex * { overflow-wrap:normal; word-break:normal; }
.chat-math.block { display:block; max-width:100%; margin:.8em 0; padding:10px 12px; overflow-x:auto; border-radius:8px; background:#f8fafc; text-align:center; white-space:nowrap; }
.chat-math sup,.chat-math sub { font-size:.72em; line-height:0; }
.math-frac { display:inline-flex; flex-direction:column; align-items:stretch; vertical-align:middle; margin:0 .18em; text-align:center; line-height:1.15; }
.math-frac > span:first-child { padding:0 .2em .08em; border-bottom:1px solid currentColor; }
.math-frac > span:last-child { padding:.08em .2em 0; }
.math-root { text-decoration:overline; }
.math-binom { display:inline-flex; flex-direction:column; vertical-align:middle; line-height:1.05; text-align:center; }
.math-overline { text-decoration:overline; }
.math-underline { text-decoration:underline; }
.math-vector { position:relative; display:inline-block; padding-top:.15em; }
.math-vector::before { content:"→"; position:absolute; top:-.72em; left:50%; font-size:.72em; transform:translateX(-50%); }
.math-environment { display:inline-flex; align-items:stretch; vertical-align:middle; }
.math-env-rows { display:inline-flex; flex-direction:column; justify-content:center; gap:.3em; padding:.1em .35em; }
.math-env-row { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(max-content,1fr); gap:.75em; text-align:left; }
.math-env-bracket { display:flex; align-items:center; font-family:"Times New Roman",serif; font-size:3.2em; font-weight:300; line-height:.85; transform:scaleY(1.18); }
.math-env-cases .math-env-bracket { margin-right:.04em; }
.public-chat-mode .app-header .nav-tabs,.public-chat-mode #account-bar,.public-chat-mode #guest-banner { display:none; }
.public-chat-mode .chat-shell { grid-template-columns:1fr; max-width:1000px; margin:auto; }
@media (max-width: 800px) {
  .chat-shell { grid-template-columns:1fr; height:auto; min-height:calc(100vh - 90px); max-height:none; }
  .chat-sidebar { height:min(420px,45dvh); min-height:280px; max-height:420px; border-right:0; border-bottom:1px solid #e2e8f0; }
  .chat-header { align-items:flex-start; flex-direction:column; }
  .chat-header-actions { width:100%; flex-wrap:wrap; }
  .chat-header-actions .form-control { min-width:0; flex:1; }
  .chat-messages { min-height:420px; padding:18px 12px; }
  .chat-message { max-width:92%; }
}
.account-login-divider { display:flex; align-items:center; gap:12px; margin:18px 0; color:#64748b; font-size:13px; }
.account-login-divider::before,.account-login-divider::after { content:""; flex:1; height:1px; background:#e2e8f0; }
.point-transfer-card { max-width:500px; }
.point-transfer-balance { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:14px; padding:16px; border:1px solid #bfdbfe; border-radius:12px; background:#eff6ff; color:#1e3a8a; }
.point-transfer-balance > div { min-width:0; }
.point-transfer-balance span,.point-transfer-balance strong { display:block; }
.point-transfer-balance strong { margin-top:5px; font-size:22px; white-space:nowrap; }
.point-transfer-description { margin:0 0 18px; color:#475569; line-height:1.65; }
.point-transfer-confirm { margin:15px 0; align-items:flex-start; }
.point-transfer-result { margin:14px 0; padding:12px 14px; border-radius:9px; line-height:1.55; }
.point-transfer-result.success { border:1px solid #86efac; background:#f0fdf4; color:#166534; }
.point-transfer-result.error { border:1px solid #fca5a5; background:#fef2f2; color:#991b1b; }
.admin-panel { max-width:1000px; margin:0 auto; }
.admin-account-create { display:grid; grid-template-columns:1fr 1fr 180px auto; align-items:end; gap:12px; }
.admin-created-credential { margin:18px 0; padding:16px; border:1px solid #86efac; border-radius:10px; background:#f0fdf4; line-height:1.8; }
.admin-created-credential code { user-select:all; font-size:14px; }
.admin-account-list { margin-top:20px; }
.admin-account-row { display:grid; grid-template-columns:minmax(180px,1fr) 220px auto; align-items:center; gap:14px; padding:14px 0; border-bottom:1px solid #e2e8f0; }
.admin-account-row strong,.admin-account-row small { display:block; }
.admin-account-row small { color:#64748b; }
.admin-account-row label { font-size:13px; color:#64748b; }
@media (max-width:800px) { .admin-account-create,.admin-account-row { grid-template-columns:1fr; } }
.advanced-video-shell { display:grid; grid-template-columns:minmax(0,2.25fr) minmax(330px,.95fr); background:#fff; border:1px solid #dbe3ef; border-radius:12px; overflow:hidden; min-height:720px; }
.advanced-video-form { padding:22px; border-right:1px solid #dbe3ef; }
.advanced-video-form > h2,.advanced-result-head h2 { margin:0 0 18px; font-size:14px; color:#526b91; letter-spacing:.04em; }
.advanced-upload-group { margin-bottom:15px; }
.advanced-upload-group > label:first-child { display:block; margin-bottom:6px; color:#3d5578; font-size:13px; }
.advanced-upload-group > small { display:block; margin-top:9px; color:#8397ba; }
.advanced-upload-tile { display:flex; flex-direction:column; align-items:center; justify-content:center; width:108px; height:108px; border:1px dashed #d5deeb; border-radius:13px; background:#fafbfe; color:#7f96bd; cursor:pointer; }
.advanced-upload-tile strong { color:#00a8d8; font-size:25px; font-weight:400; }
.advanced-file-list { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.advanced-file-list figure { width:150px; margin:0; padding:7px; border:1px solid #dbe3ef; border-radius:9px; background:#f8fafc; }
.advanced-file-list img,.advanced-file-list video { display:block; width:100%; height:92px; border-radius:6px; background:#0f172a; object-fit:cover; }
.advanced-file-list figure { position:relative; }
.advanced-file-remove,.frame-preview .btn-remove { position:absolute; top:5px; right:5px; z-index:2; display:flex; align-items:center; justify-content:center; width:24px; height:24px; padding:0; border:0; border-radius:50%; background:rgba(15,23,42,.82); color:#fff; font-size:17px; line-height:1; cursor:pointer; }
.advanced-file-remove:hover,.frame-preview .btn-remove:hover { background:#dc2626; }
.frame-preview { position:relative; }
.advanced-file-list audio { display:block; width:100%; height:38px; }
.advanced-file-list figcaption { margin-top:6px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#526b91; font-size:11px; }
.advanced-prompt-tools { margin:-4px 0 18px; padding:12px; border:1px solid #e2e8f0; border-radius:9px; background:#fafcff; }
.advanced-prompt-tools > div:first-child { display:flex; justify-content:space-between; gap:12px; margin-bottom:8px; color:#526b91; font-size:13px; }
.preset-chip { display:inline-flex; align-items:center; border:1px solid #bfdbfe; border-radius:999px; background:#eff6ff; overflow:hidden; }
.preset-chip button { border:0; background:transparent; padding:5px 8px; color:#1d4ed8; cursor:pointer; }
.preset-chip .advanced-delete-prompt { padding-left:2px; color:#64748b; }
.advanced-video-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.advanced-video-checks { display:flex; gap:28px; margin:2px 0 18px; color:#526b91; }
.advanced-video-checks label { display:flex; align-items:center; gap:7px; }
.advanced-video-submit { min-height:44px; }
.advanced-video-result { padding:22px; background:#fdfefe; }
.advanced-result-head { display:flex; justify-content:space-between; align-items:flex-start; }
.advanced-video-preview { display:flex; align-items:center; justify-content:center; aspect-ratio:16/9; border:1px solid #dbe3ef; border-radius:14px; background:#f1f4f8; color:#8ba0c2; overflow:hidden; }
.advanced-video-preview video { width:100%; height:100%; object-fit:contain; background:#000; }
.advanced-result-actions { display:flex; flex-wrap:wrap; gap:9px; margin:30px 0 18px; }
.advanced-task-label { display:block; color:#526b91; font-size:13px; }
.advanced-task-label input { margin-top:7px; }
.advanced-task-details { margin-top:17px; padding-top:15px; border-top:1px solid #dbe3ef; }
.advanced-task-details h3 { margin-bottom:15px; color:#526b91; font-size:13px; }
.advanced-task-details dl { padding:14px 18px; border:1px solid #dbe3ef; border-radius:14px; background:#fafcff; }
.advanced-task-details dl div { display:flex; justify-content:space-between; gap:15px; padding:5px 0; }
.advanced-task-details dt { color:#879abd; }
.advanced-task-details dd { margin:0; color:#0f172a; font-family:ui-monospace,Consolas,monospace; font-weight:700; text-align:right; overflow-wrap:anywhere; }
@media (max-width:1000px) { .advanced-video-shell { grid-template-columns:1fr; } .advanced-video-form { border-right:0; border-bottom:1px solid #dbe3ef; } }
@media (max-width:600px) { .advanced-video-grid { grid-template-columns:1fr; } .advanced-video-form,.advanced-video-result { padding:15px; } }
.info-page { max-width:1080px; margin:0 auto; color:#1e293b; }
.info-hero { padding:34px; border:1px solid #dbe5f1; border-radius:16px; background:linear-gradient(135deg,#f8fbff,#eef5ff); }
.info-hero > span { color:#2563eb; font-size:12px; font-weight:800; letter-spacing:.12em; }
.info-hero h1 { margin:8px 0; font-size:clamp(28px,4vw,42px); }
.info-hero p { max-width:760px; color:#64748b; font-size:16px; }
.purchase-hero { position:relative; overflow:hidden; padding-right:min(42%,390px); background:radial-gradient(circle at 85% 15%,rgba(96,165,250,.22),transparent 28%),linear-gradient(135deg,#f8fbff,#e9f2ff); }
.purchase-hero::after { content:""; position:absolute; right:-70px; bottom:-115px; width:280px; height:280px; border-radius:50%; border:48px solid rgba(37,99,235,.055); pointer-events:none; }
.rate-card { position:absolute; z-index:1; top:50%; right:34px; width:290px; padding:20px 22px; border:1px solid rgba(255,255,255,.75); border-radius:18px; background:linear-gradient(145deg,#1d4ed8,#2563eb 55%,#3b82f6); box-shadow:0 18px 40px rgba(30,64,175,.22); color:#fff; transform:translateY(-50%); }
.rate-card > span { color:#bfdbfe; font-size:12px; font-weight:800; letter-spacing:.08em; }
.rate-card strong { display:flex; align-items:baseline; gap:8px; margin:5px 0; font-size:35px; }
.rate-card strong small { font-size:15px; }
.rate-card strong i { color:#93c5fd; font-size:20px; font-style:normal; }
.rate-card p { margin:0; color:#dbeafe; font-size:13px; }
.tutorial-steps { display:grid; gap:12px; margin:24px 0; }
.tutorial-steps section { display:flex; gap:18px; padding:20px; border:1px solid #e2e8f0; border-radius:12px; background:#fff; }
.tutorial-steps section > b { display:grid; place-items:center; flex:0 0 38px; width:38px; height:38px; border-radius:50%; background:#2563eb; color:#fff; }
.tutorial-steps h2,.info-card h2,.info-section h2 { margin:0 0 7px; font-size:18px; }
.tutorial-steps p,.info-card p,.info-section p { color:#475569; line-height:1.75; }
.info-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin:22px 0; }
.info-card,.info-section { padding:22px; border:1px solid #e2e8f0; border-radius:12px; background:#fff; }
.info-card ul,.info-section ul,.info-section ol { padding-left:22px; color:#475569; line-height:1.8; }
.info-card a,.info-section a,.contact-hero a,.app-footer a { color:#2563eb; text-decoration:none; }
.info-card a:not(.btn),.info-section a:not(.btn),.app-footer a:not(.social-link) { transition:color .18s ease,background-color .18s ease; }
.info-card a:not(.btn):hover,.info-section a:not(.btn):hover,.app-footer a:not(.social-link):hover { color:#1d4ed8; }
.info-card a:focus-visible,.info-section a:focus-visible,.contact-hero a:focus-visible,.app-footer a:focus-visible { outline:3px solid rgba(59,130,246,.28); outline-offset:3px; border-radius:5px; }
.notice-banner { display:flex; flex-direction:column; gap:5px; margin:22px 0; padding:18px 20px; border:1px solid #f6c453; border-radius:12px; background:#fffbeb; color:#854d0e; }
.trial-reminder { display:flex; flex-direction:column; gap:4px; margin:14px 0 18px; padding:15px 17px; border-left:4px solid #22c55e; border-radius:8px; background:#f0fdf4; }
.trial-reminder strong { color:#166534; }
.trial-reminder span { color:#47705a; }
.refund-section { display:flex; gap:16px; border-color:#bfdbfe; background:linear-gradient(135deg,#fff,#f7fbff); box-shadow:0 10px 30px rgba(15,45,89,.06); }
.refund-section .section-icon { display:grid; place-items:center; flex:0 0 42px; width:42px; height:42px; border-radius:12px; background:#dbeafe; color:#1d4ed8; font-size:22px; font-weight:800; }
.refund-tags { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.refund-tags span { padding:7px 10px; border:1px solid #dbeafe; border-radius:999px; background:#eff6ff; color:#1e40af; font-size:12px; font-weight:700; }
.purchase-page .info-section { margin:14px 0; }
.contact-list { display:grid; gap:10px; }
.contact-list div { display:grid; grid-template-columns:120px 1fr; }
.contact-list dt { color:#64748b; }
.contact-list dd { margin:0; }
.delivery-flow { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:18px 0; overflow-x:auto; }
.delivery-flow div { display:flex; align-items:center; gap:8px; min-width:max-content; }
.delivery-flow b { display:grid; place-items:center; width:28px; height:28px; border-radius:50%; background:#dbeafe; color:#1d4ed8; }
.delivery-flow i { color:#94a3b8; font-style:normal; }
.info-updated { margin:20px 0; color:#64748b; font-size:13px; }
.contact-hero { display:flex; justify-content:space-between; align-items:center; gap:24px; margin:24px 0; padding:28px; border-radius:14px; background:#0f2d59; color:#fff; }
.contact-hero small { color:#bfdbfe; }
.contact-hero h2 { margin:5px 0 8px; }
.contact-hero p { color:#dbeafe; }
.contact-actions { display:flex; flex-wrap:wrap; gap:10px; }
.btn-line-contact { border-color:#06c755; background:#06c755; color:#fff; }
.btn-line-contact:hover { border-color:#05b84e; background:#05b84e; color:#fff; }
#view-about .info-page { color:#17324d; }
#view-about .info-hero { position:relative; overflow:hidden; border-color:#bfe4e8; background:radial-gradient(circle at 88% 18%,rgba(45,212,191,.2),transparent 28%),linear-gradient(135deg,#f4f9ff 0%,#eefbf9 58%,#e8f7f8 100%); box-shadow:0 16px 44px rgba(20,83,111,.08); }
#view-about .info-hero::after { content:""; position:absolute; right:-72px; bottom:-105px; width:240px; height:240px; border:42px solid rgba(14,116,144,.055); border-radius:50%; pointer-events:none; }
#view-about .info-hero > span { color:#0f766e; }
#view-about .info-hero h1 { color:#123251; }
#view-about .info-hero p { color:#536f82; }
#view-about .contact-hero { background:radial-gradient(circle at 85% 10%,rgba(45,212,191,.2),transparent 30%),linear-gradient(135deg,#102e50 0%,#124a62 62%,#0f6670 100%); box-shadow:0 18px 42px rgba(15,54,82,.16); }
#view-about .contact-hero small { color:#9fe3dc; }
#view-about .contact-hero p { color:#d4edf0; }
#view-about .contact-actions .btn-secondary { border-color:rgba(255,255,255,.55); background:rgba(255,255,255,.1); color:#fff; }
#view-about .contact-actions .btn-secondary:hover { border-color:#fff; background:rgba(255,255,255,.18); }
#view-about .info-grid { gap:20px; }
#view-about .info-card { position:relative; overflow:hidden; border-color:#d5e7ea; background:linear-gradient(145deg,#fff,#f5fbfb); box-shadow:0 10px 28px rgba(30,82,105,.07); }
#view-about .info-card::before { content:""; position:absolute; inset:0 auto 0 0; width:4px; background:linear-gradient(#2563eb,#14b8a6); }
#view-about .info-card h2 { color:#173f5f; }
#view-about .info-card small { color:#718697; }
#view-about .info-card a:not(.btn) { display:inline-flex; align-items:center; min-height:32px; padding:4px 10px; border-radius:8px; background:#e8f5f5; color:#0f6b70; font-weight:700; }
#view-about .info-card a:not(.btn):hover { background:#d7eeee; color:#0b5960; }
.app-footer { position:relative; overflow:hidden; margin-top:36px; border-top:1px solid #dbeafe; background:linear-gradient(145deg,#f8fbff 0%,#fff 52%,#f2f7ff 100%); color:#475569; font-size:13px; }
.app-footer::before { content:""; position:absolute; top:-130px; left:-90px; width:300px; height:300px; border-radius:50%; background:rgba(37,99,235,.055); pointer-events:none; }
.footer-inner { position:relative; display:grid; grid-template-columns:minmax(260px,1.25fr) minmax(220px,.85fr) minmax(280px,1fr); gap:clamp(28px,5vw,70px); max-width:1280px; margin:0 auto; padding:42px clamp(20px,5vw,64px) 32px; }
.footer-brand { display:flex; align-items:flex-start; gap:14px; }
.footer-brand-icon { display:grid; place-items:center; flex:0 0 44px; width:44px; height:44px; border-radius:14px; background:linear-gradient(145deg,#1d4ed8,#3b82f6); box-shadow:0 10px 24px rgba(37,99,235,.22); color:#fff; }
.footer-brand-icon svg { width:24px; height:24px; }
.footer-brand strong,.footer-brand span { display:block; }
.footer-brand strong { margin:2px 0 7px; color:#0f2d59; font-size:15px; }
.footer-brand div > span { color:#7890ad; line-height:1.6; }
.footer-nav > span,.footer-connect > span { display:block; margin-bottom:10px; color:#0f2d59; font-size:12px; font-weight:800; letter-spacing:.08em; }
.footer-nav div { display:flex; flex-direction:column; align-items:flex-start; gap:2px; }
.footer-nav button { border:0; background:transparent; padding:6px 0; color:#526b91; cursor:pointer; transition:color .2s,transform .2s; }
.footer-nav button:hover,.footer-nav button:focus-visible { color:#2563eb; transform:translateX(3px); }
.footer-contact { display:flex; flex-wrap:wrap; gap:5px 14px; margin-bottom:14px; }
.footer-contact a { color:#526b91; text-decoration:none; }
.footer-contact a:hover { color:#2563eb; }
.footer-socials { display:flex; flex-wrap:wrap; gap:9px; }
.social-link { display:inline-flex; align-items:center; gap:7px; padding:8px 11px; border:1px solid #dbe5f1; border-radius:10px; background:rgba(255,255,255,.8); color:#475569; font-weight:700; text-decoration:none; box-shadow:0 3px 10px rgba(15,45,89,.04); transition:transform .2s,box-shadow .2s,border-color .2s,color .2s; }
.social-link svg { width:18px; height:18px; }
.social-link:hover,.social-link:focus-visible { transform:translateY(-2px); box-shadow:0 8px 18px rgba(15,45,89,.12); }
.social-link.line:hover,.social-link.line:focus-visible { border-color:#06c755; color:#06a846; }
.social-link.instagram:hover,.social-link.instagram:focus-visible { border-color:#e879a7; color:#c13584; }
.social-link.facebook:hover,.social-link.facebook:focus-visible { border-color:#60a5fa; color:#1877f2; }
.footer-bottom { position:relative; display:flex; justify-content:space-between; gap:16px; max-width:1280px; margin:0 auto; padding:16px clamp(20px,5vw,64px); border-top:1px solid #e3ebf5; color:#8a9bb2; font-size:12px; }
@media (max-width:900px) { .footer-inner { grid-template-columns:1fr 1fr; } .footer-brand { grid-column:1/-1; } }
@media (max-width:800px) { .info-grid { grid-template-columns:1fr; } .purchase-hero { padding-right:34px; } .rate-card { position:relative; top:auto; right:auto; width:auto; margin-top:22px; transform:none; } .contact-hero { align-items:flex-start; flex-direction:column; } }
@media (max-width:600px) { .footer-inner { grid-template-columns:1fr; padding-top:32px; } .footer-brand { grid-column:auto; } .footer-bottom { flex-direction:column; gap:4px; } }
@media (max-width:520px) { .info-hero { padding:24px 20px; } .rate-card strong { font-size:29px; } .refund-section { padding:18px; } .refund-section .section-icon { display:none; } .contact-list div { grid-template-columns:1fr; gap:2px; } }

/* Bundled KaTeX 0.18.5 - https://katex.org/ */
@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_AMS-Regular.woff2) format("woff2"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_AMS-Regular.woff) format("woff"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_AMS-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Caligraphic-Bold.woff) format("woff"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Caligraphic-Bold.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Caligraphic-Regular.woff) format("woff"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Caligraphic-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Fraktur-Bold.woff) format("woff"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Fraktur-Bold.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Fraktur-Regular.woff) format("woff"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Fraktur-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Main-Bold.woff2) format("woff2"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Main-Bold.woff) format("woff"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Main-Bold.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Main-BoldItalic.woff) format("woff"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Main-BoldItalic.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Main-Italic.woff2) format("woff2"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Main-Italic.woff) format("woff"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Main-Italic.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Main-Regular.woff) format("woff"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Main-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Math-BoldItalic.woff) format("woff"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Math-BoldItalic.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Math-Italic.woff2) format("woff2"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Math-Italic.woff) format("woff"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Math-Italic.ttf) format("truetype")}@font-face{font-display:block;font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_SansSerif-Bold.woff) format("woff"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_SansSerif-Bold.ttf) format("truetype")}@font-face{font-display:block;font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_SansSerif-Italic.woff2) format("woff2"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_SansSerif-Italic.woff) format("woff"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_SansSerif-Italic.ttf) format("truetype")}@font-face{font-display:block;font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_SansSerif-Regular.woff2) format("woff2"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_SansSerif-Regular.woff) format("woff"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_SansSerif-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Script-Regular.woff2) format("woff2"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Script-Regular.woff) format("woff"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Script-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Size1-Regular.woff2) format("woff2"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Size1-Regular.woff) format("woff"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Size1-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Size2-Regular.woff2) format("woff2"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Size2-Regular.woff) format("woff"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Size2-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Size3-Regular.woff2) format("woff2"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Size3-Regular.woff) format("woff"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Size3-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Size4-Regular.woff2) format("woff2"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Size4-Regular.woff) format("woff"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Size4-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Typewriter-Regular.woff2) format("woff2"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Typewriter-Regular.woff) format("woff"),url(https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Typewriter-Regular.ttf) format("truetype")}.katex{font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;position:relative;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.18.5"}.katex .katex-mathml{border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.katex-newline{display:block}.katex .katex-base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .katex-base,.katex .katex-strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .katex-vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .katex-thinbox{display:inline-flex;flex-direction:row;max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .katex-hdashline,.katex .katex-hline,.katex .katex-overline .overline-line,.katex .katex-rule,.katex .katex-underline .underline-line,.katex .mfrac .frac-line{min-height:1px}.katex .mspace{display:inline-block}.katex .katex-smash{display:inline;line-height:0}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.katex-inner,.katex .llap>.katex-inner,.katex .rlap>.katex-inner{position:absolute}.katex .clap>.katex-fix,.katex .llap>.katex-fix,.katex .rlap>.katex-fix{display:inline-block}.katex .llap>.katex-inner{right:0}.katex .clap>.katex-inner,.katex .rlap>.katex-inner{left:0}.katex .clap>.katex-inner>span{margin-left:-50%;margin-right:50%}.katex .katex-rule{border:0 solid;display:inline-block;position:relative}.katex .katex-hline,.katex .katex-overline .overline-line,.katex .katex-underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .katex-hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.katex-root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .katex-sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .katex-sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .katex-sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .katex-sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .katex-sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .katex-sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .katex-sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .katex-sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .katex-sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .katex-sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .katex-sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .katex-sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .katex-sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .katex-sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .katex-sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .katex-sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .katex-sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .katex-sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .katex-sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .katex-sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .katex-sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .katex-sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .katex-sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .katex-sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .katex-sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .katex-sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .katex-sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .katex-sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .katex-sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .katex-sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .katex-sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .katex-sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .katex-sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .katex-sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .katex-sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .katex-sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .katex-sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .katex-sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .katex-sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .katex-sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .katex-sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .katex-sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .katex-sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .katex-sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .katex-sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .katex-sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .katex-sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .katex-sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .katex-sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .katex-sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .katex-sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .katex-sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .katex-sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .katex-sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .katex-sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .katex-sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .katex-sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .katex-sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .katex-sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .katex-sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .katex-sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .katex-sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .katex-sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .katex-sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .katex-sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .katex-sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .katex-sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .katex-sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .katex-sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .katex-sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .katex-sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .katex-sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .katex-sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .katex-sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .katex-sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .katex-sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .katex-sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .katex-sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .katex-sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .katex-sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .katex-sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .katex-sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .katex-sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .katex-sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .katex-sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .katex-sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .katex-sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .katex-sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .katex-sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .katex-sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .katex-sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .katex-sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .katex-sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .katex-sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .katex-sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .katex-sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .katex-sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .katex-sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .katex-sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .katex-sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .katex-sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .katex-sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .katex-sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .katex-sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .katex-sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .katex-sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .katex-sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .katex-sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .katex-sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .katex-sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .katex-sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .katex-sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .katex-sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .katex-sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .katex-sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .katex-sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .katex-sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .katex-sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .katex-sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .katex-sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .katex-sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .katex-accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .katex-accent .accent-body{position:relative}.katex .katex-accent .accent-body:not(.accent-full){width:0}.katex .katex-overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex svg{fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .katex-stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .katex-stretchy:after,.katex .katex-stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .katex-sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.katex-tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.katex-tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}

