:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #111827;
  --muted: #6b7280;
  --line: #d1d5db;
  --primary: #374151;
  --primary-hover: #1f2937;
  --accent: #2563eb;
  --success: #047857;
  --danger: #b91c1c;
  --warning: #b45309;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(15, 23, 42, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: Arial, Helvetica, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
html.auth-pending body { visibility: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header { background: #111827; color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 12px rgba(0,0,0,.2); }
.header-row { min-height: 64px; display: flex; align-items: center; gap: 22px; }
.brand { color: #fff; font-weight: 800; font-size: 20px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.main-nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1; }
.main-nav a { color: #e5e7eb; padding: 8px 10px; border-radius: 7px; font-size: 14px; }
.main-nav a:hover, .main-nav a.active { background: #374151; color: #fff; text-decoration: none; }
.user-menu { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.page { padding: 28px 0 56px; }
.page-title { margin: 0 0 6px; font-size: 28px; line-height: 1.2; }
.page-subtitle { color: var(--muted); margin: 0 0 24px; }
.card { background: var(--surface); border: 1px solid #e5e7eb; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 18px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 18px; background: var(--surface); border: 1px solid #e5e7eb; border-radius: var(--radius); }
.stat-label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { margin-top: 5px; font-size: 26px; font-weight: 800; }
.dashboard-link { display: block; color: var(--text); padding: 22px; background: var(--surface); border: 1px solid #dbe1e8; border-radius: var(--radius); box-shadow: var(--shadow); }
.dashboard-link:hover { border-color: #9ca3af; text-decoration: none; transform: translateY(-1px); }
.dashboard-link h2 { margin: 0 0 6px; font-size: 20px; }
.dashboard-link p { margin: 0; color: var(--muted); }
.toolbar { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar-group { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.results-count { font-size: 18px; font-weight: 700; }
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: 4px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 15px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #fff; font-weight: 800; border-bottom: 2px solid #bfc4c9; }
.product-name { font-weight: 800; color: #050505; }
.price { font-weight: 800; white-space: nowrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 8px; padding: 9px 14px; font-weight: 700; line-height: 1.2; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #fff; border-color: #cbd5e1; color: #1f2937; }
.btn-secondary:hover { background: #f8fafc; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-sm { padding: 7px 11px; font-size: 13px; }
.input, input[type=text], input[type=email], input[type=password], input[type=number], input[type=file], select, textarea {
  width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 10px 12px; background: #fff; color: var(--text);
}
textarea { min-height: 110px; resize: vertical; }
.input:focus, input:focus, select:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: #2563eb; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 6px; }
.form-help { color: var(--muted); font-size: 13px; margin-top: 5px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.checkbox-row { display: flex; gap: 9px; align-items: flex-start; }
.checkbox-row input { width: auto; margin-top: 5px; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(460px, 100%); background: #fff; padding: 30px; border-radius: 14px; box-shadow: var(--shadow); border: 1px solid #e5e7eb; }
.auth-card h1 { margin-top: 0; }
.muted { color: var(--muted); }
.notice { border-radius: 8px; padding: 12px 14px; margin: 14px 0; border: 1px solid; }
.notice-info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.notice-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.notice-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.notice-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.badge { display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-gray { background: #e5e7eb; color: #374151; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; max-width: 420px; padding: 12px 16px; color: #fff; border-radius: 8px; box-shadow: var(--shadow); }
.toast-success { background: #047857; }
.toast-error { background: #b91c1c; }
.toast-info { background: #1d4ed8; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.pagination { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 18px; }
.product-detail { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 26px; }
.product-description { white-space: pre-wrap; }
.summary-row { display: flex; justify-content: space-between; gap: 18px; padding: 8px 0; border-bottom: 1px solid #e5e7eb; }
.summary-row:last-child { border-bottom: 0; }
.summary-total { font-size: 20px; font-weight: 800; }
.payment-layout { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: 24px; }
.qr-box { background: #fff; border: 1px solid #d1d5db; border-radius: 12px; padding: 18px; text-align: center; }
.qr-box img, .qr-box canvas, .qr-box svg { max-width: 100%; height: auto; }
.qr-render { display: grid; place-items: center; min-height: 280px; }
.countdown { font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 800; }
.copy-field { display: flex; gap: 8px; align-items: center; }
.copy-field code { flex: 1; background: #f1f5f9; padding: 10px; border-radius: 7px; font-size: 17px; overflow-wrap: anywhere; }
.file-list { display: grid; gap: 10px; }
.file-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; gap: 14px; align-items: center; padding: 13px; border: 1px solid #e5e7eb; border-radius: 8px; }
.tabs { display: flex; gap: 8px; border-bottom: 1px solid #d1d5db; margin-bottom: 18px; }
.tab { border: 0; background: none; padding: 10px 14px; font-weight: 700; border-bottom: 3px solid transparent; }
.tab.active { border-color: #111827; }
.asset-picker { border: 1px solid #d1d5db; border-radius: 8px; padding: 14px; }
.asset-list { display: grid; gap: 8px; margin-top: 10px; }
.asset-item { display: grid; grid-template-columns: minmax(0, 1fr) 100px auto; gap: 10px; align-items: center; border: 1px solid #e5e7eb; padding: 10px; border-radius: 7px; }
.folder-browser { border: 1px solid #d1d5db; border-radius: 8px; max-height: 420px; overflow: auto; }
.folder-entry { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #e5e7eb; }
.folder-entry:last-child { border-bottom: 0; }
.folder-entry button { margin-left: auto; }
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: grid; place-items: center; z-index: 80; padding: 20px; }
.modal[hidden] { display: none; }
.modal-card { width: min(760px, 100%); max-height: 90vh; overflow: auto; background: #fff; border-radius: 12px; padding: 22px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
pre.code { white-space: pre-wrap; overflow-wrap: anywhere; background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 14px; }

.version-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.version-grid > div { background: var(--surface-soft); border: 1px solid #e5e7eb; border-radius: 8px; padding: 14px; }
.version-grid span { display: block; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.version-grid strong { display: block; margin-top: 4px; font-size: 18px; }
.system-info-card { margin-top: 18px; }
@media (max-width: 900px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-detail, .payment-layout { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .container { width: min(100% - 20px, 1180px); }
  .header-row { align-items: flex-start; padding: 12px 0; flex-wrap: wrap; }
  .main-nav { order: 3; width: 100%; }
  .user-menu { margin-left: auto; }
  .grid-2, .grid-3, .grid-4, .form-row, .version-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 24px; }
  .store-table thead { display: none; }
  .store-table, .store-table tbody, .store-table tr, .store-table td { display: block; width: 100%; }
  .store-table tr { border-bottom: 1px solid #cbd5e1; padding: 12px 0; }
  .store-table td { border: 0; padding: 5px 10px; }
  .store-table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
  .file-row, .asset-item { grid-template-columns: 1fr; }
}

/* v0.2.0 interface refinements */
:root {
  --primary: #263246;
  --primary-hover: #111827;
  --accent-soft: #eff6ff;
}
.dashboard-link { position: relative; overflow: hidden; min-height: 150px; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.dashboard-link::after { content: ""; position: absolute; right: -30px; bottom: -42px; width: 110px; height: 110px; border-radius: 999px; background: #eef2f7; }
.dashboard-link > * { position: relative; z-index: 1; }
.dashboard-link:hover { transform: translateY(-3px); border-color: #94a3b8; box-shadow: 0 14px 30px rgba(15,23,42,.12); }
.dashboard-card-kicker { display: block; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }
.dashboard-count { display: inline-flex; margin-top: 16px; padding: 5px 10px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-size: 13px; font-weight: 800; }
.catalog-toolbar { display: grid; grid-template-columns: minmax(220px,1fr) minmax(180px,260px) minmax(170px,230px); gap: 12px; align-items: end; }
.catalog-toolbar .form-group { margin: 0; }
.category-inline { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.category-chip, .format-chip { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 9px; background: #eef2ff; color: #3730a3; font-size: 12px; font-weight: 700; text-decoration: none; }
.category-chip:hover { text-decoration: none; background: #e0e7ff; }
.format-chip { background: #ecfdf5; color: #065f46; margin: 0 5px 5px 0; }
.product-shell { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 24px; align-items: start; }
.product-main-card { padding: 0; overflow: hidden; }
.product-hero { padding: 30px; border-bottom: 1px solid #e5e7eb; background: linear-gradient(135deg,#fff 0%,#f8fafc 100%); }
.product-hero h1 { margin: 0 0 12px; font-size: clamp(28px,4vw,42px); line-height: 1.12; }
.product-meta-groups { display: grid; gap: 12px; margin-top: 18px; }
.product-meta-label { display: block; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 6px; }
.product-content-section { padding: 28px 30px; }
.product-content-section + .product-content-section { border-top: 1px solid #e5e7eb; }
.product-section-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 16px; }
.product-section-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 11px; background: #eff6ff; color: #1d4ed8; font-weight: 900; }
.product-section-heading h2 { margin: 0; font-size: 22px; }
.product-section-heading p { margin: 3px 0 0; color: var(--muted); }
.product-description { white-space: normal; color: #253047; }
.product-description > :first-child { margin-top: 0; }
.product-description > :last-child { margin-bottom: 0; }
.product-description h2, .product-description h3, .product-description h4 { color: #111827; }
.product-description a { text-decoration: underline; }
.product-buy-card { position: sticky; top: 88px; }
.product-price-label { color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.product-price-large { margin: 4px 0 18px; font-size: 30px; font-weight: 900; }
.file-primary { min-width: 0; display: flex; align-items: center; gap: 11px; }
.file-primary strong { overflow-wrap: anywhere; }
.file-icon { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 8px; background: #eef2ff; color: #3730a3; font-size: 12px; font-weight: 900; }
.file-size { color: var(--muted); white-space: nowrap; }
.sample-file-row { background: #fbfdff; }
.compact-empty { padding: 24px 16px; }
.payment-choice { display: block; border: 1px solid #dbe1e8; border-radius: 10px; padding: 16px; margin-bottom: 11px; background: #fff; }
.payment-choice:has(input:checked) { border-color: #2563eb; box-shadow: 0 0 0 2px #dbeafe; }
.admin-tabs { display: flex; gap: 7px; flex-wrap: wrap; border-bottom: 1px solid #d1d5db; margin-bottom: 20px; }
.admin-tab { border: 0; background: transparent; padding: 11px 16px; font-weight: 800; border-bottom: 3px solid transparent; color: #64748b; }
.admin-tab.active { border-color: #2563eb; color: #111827; }
.tab-panel[hidden], [data-tab-panel][hidden] { display: none !important; }
.provider-card { display: flex; justify-content: space-between; gap: 18px; align-items: start; padding: 16px; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; }
.provider-card p { margin: 5px 0 0; color: var(--muted); }
.rich-editor { border: 1px solid #cbd5e1; border-radius: 9px; overflow: hidden; background: #fff; }
.rich-editor-toolbar { display: flex; gap: 5px; flex-wrap: wrap; padding: 8px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.editor-tool { border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; min-width: 34px; padding: 5px 8px; font-weight: 700; }
.editor-tool.active { background: #1f2937; color: #fff; border-color: #1f2937; }
.rich-editor-visual { min-height: 240px; padding: 16px; outline: none; }
.rich-editor-source { min-height: 240px; border: 0; border-radius: 0; font-family: Consolas,Monaco,monospace; }
.rich-editor-visual:focus, .rich-editor-source:focus { outline: 2px solid #bfdbfe; outline-offset: -2px; }
.multi-select { min-height: 130px; }
.backup-modules { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.backup-module { display: flex; gap: 9px; align-items: start; padding: 13px; border: 1px solid #e5e7eb; border-radius: 9px; }
.backup-module input { width: auto; margin-top: 4px; }
.danger-zone { border: 2px solid #fecaca; background: #fffafa; }
@media (max-width: 900px) {
  .product-shell { grid-template-columns: 1fr; }
  .product-buy-card { position: static; }
  .catalog-toolbar { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .catalog-toolbar, .backup-modules { grid-template-columns: 1fr; }
  .product-hero, .product-content-section { padding: 22px 18px; }
}

/* v0.3.0 navigation, folder downloads, and maintenance */
[hidden] { display: none !important; }
.nav-dropdown { position: relative; }
.nav-dropdown-toggle { border: 0; background: transparent; color: #e5e7eb; padding: 8px 10px; border-radius: 7px; font-size: 14px; cursor: pointer; }
.nav-dropdown-toggle:hover, .nav-dropdown-toggle.active, .nav-dropdown:focus-within .nav-dropdown-toggle { background: #374151; color: #fff; }
.nav-dropdown-menu { display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 210px; padding: 7px; border: 1px solid #d1d5db; border-radius: 9px; background: #fff; box-shadow: 0 16px 34px rgba(15,23,42,.2); z-index: 40; }
.nav-dropdown:hover .nav-dropdown-menu, .nav-dropdown:focus-within .nav-dropdown-menu, .nav-dropdown.open .nav-dropdown-menu { display: grid; }
.nav-dropdown-menu a { color: #1f2937; display: block; padding: 9px 10px; }
.nav-dropdown-menu a:hover, .nav-dropdown-menu a.active { background: #eef2f7; color: #111827; }
.folder-download { border: 1px solid #dbe1e8; border-radius: 10px; background: #fbfdff; overflow: hidden; }
.folder-download-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; }
.folder-download-contents { border-top: 1px solid #e5e7eb; padding: 12px; display: grid; gap: 8px; }
.folder-breadcrumb { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; padding: 8px 0; color: var(--muted); font-size: 13px; }
.folder-child { display: grid; grid-template-columns: minmax(0,1fr) 110px auto; gap: 12px; align-items: center; padding: 11px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; }
.order-product-editor { display: grid; gap: 8px; max-height: 360px; overflow: auto; border: 1px solid #e5e7eb; border-radius: 9px; padding: 10px; }
.order-product-option { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 9px; border-radius: 7px; }
.order-product-option:hover { background: #f8fafc; }
.maintenance-summary { display: grid; gap: 8px; margin-top: 12px; }
.cleanup-table { max-height: 390px; overflow: auto; border: 1px solid #e5e7eb; border-radius: 9px; }
@media (max-width: 680px) {
  .nav-dropdown { width: 100%; }
  .nav-dropdown-toggle { width: 100%; text-align: left; }
  .nav-dropdown-menu { position: static; margin-top: 4px; box-shadow: none; }
  .folder-child { grid-template-columns: 1fr; }
}


/* v0.4.0 download handling and file-type icons */
.ui-icon, .section-svg-icon, .button-icon {
  display: block;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
}
.section-svg-icon { width: 24px; height: 24px; }
.button-icon { width: 16px; height: 16px; }
.product-section-icon-download { background: #eff6ff; color: #1d4ed8; }
.product-section-icon-sample { background: #f5f3ff; color: #6d28d9; }
.file-icon {
  overflow: hidden;
  border: 1px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.45);
}
.file-icon .ui-icon { width: 20px; height: 20px; }
.file-icon-file { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.file-icon-pdf { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.file-icon-video { background: #eef2ff; color: #4f46e5; border-color: #c7d2fe; }
.file-icon-archive { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.file-icon-image { background: #faf5ff; color: #9333ea; border-color: #e9d5ff; }
.file-icon-audio { background: #fdf2f8; color: #be185d; border-color: #fbcfe8; }
.file-icon-spreadsheet { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.file-icon-document { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.file-icon-presentation { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.file-icon-code { background: #f8fafc; color: #334155; border-color: #cbd5e1; }
.file-icon-folder { background: #fffbeb; color: #d97706; border-color: #fde68a; }
.folder-download-header .file-icon { width: 36px; height: 36px; flex-basis: 36px; }
.folder-download-header .file-icon .ui-icon { width: 22px; height: 22px; }

/* v0.6.0 email settings and destructive customer actions */
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form input { flex: 1 1 280px; }
.summary-list { display: grid; gap: 0; margin-bottom: 16px; }
@media (max-width: 720px) { .inline-form { align-items: stretch; } .inline-form .btn { width: 100%; } }

/* v0.6.0 modular email providers */
.email-provider-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.email-provider-card { display: flex; flex-direction: column; gap: 8px; min-height: 170px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); padding: 18px; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.email-provider-card:hover { border-color: #94a3b8; transform: translateY(-1px); }
.email-provider-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.10); }
.email-provider-card input { width: auto; margin: 0 0 2px; }
.provider-card-title { font-size: 17px; font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.provider-card-text { color: var(--muted); font-size: 14px; flex: 1; }
.provider-card-status { font-size: 13px; font-weight: 700; }
.email-provider-detail { margin-top: 18px; }
.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.section-heading h2 { margin-bottom: 4px; }
.badge-success { color: #065f46; background: #d1fae5; border-color: #a7f3d0; }
@media (max-width: 900px) { .email-provider-grid { grid-template-columns: 1fr; } .email-provider-card { min-height: 0; } }
@media (max-width: 640px) { .section-heading { flex-direction: column; } }
.badge-warning { color: #92400e; background: #fef3c7; border-color: #fde68a; }

/* v0.6.0 email event grouping */
.section-divider{border:0;border-top:1px solid var(--border,#e2e8f0);margin:22px 0}

/* v0.7.2 password recovery and editable email templates */
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 6px; }
.label-row label { margin: 0; }
.label-row a { font-size: 13px; font-weight: 700; }
.auth-secondary-link { margin: 20px 0 0; }
.email-settings-tabs { margin-top: 4px; }
.email-template-list { display: grid; gap: 18px; margin: 18px 0; }
.email-template-card { margin: 0; }
.email-template-card textarea { min-height: 250px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; line-height: 1.55; }
.template-variable-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.template-variable { border: 1px solid #cbd5e1; border-radius: 999px; background: #f8fafc; color: #334155; padding: 5px 9px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; cursor: pointer; }
.template-variable:hover { background: #e0e7ff; border-color: #a5b4fc; color: #3730a3; }
@media (max-width: 640px) {
  .label-row { align-items: flex-start; }
  .email-settings-tabs .admin-tab { flex: 1 1 auto; }
}

/* v0.7.3 modular restore and quota-safe recovery */
.backup-module.is-disabled { opacity: .55; background: #f8fafc; }
.backup-module.is-disabled input { cursor: not-allowed; }
#restore-write-estimate { margin-top: 14px; }

/* v1.0.0 admin viewers, product navigation, and D1 maintenance */
.product-page-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.viewer-controls { margin-bottom: 18px; }
.viewer-controls .form-row { align-items: end; }
.viewer-stage { min-height: 720px; padding: 14px; overflow: auto; border: 1px solid #cbd5e1; border-radius: 12px; background: #e2e8f0; }
.viewer-frame { display: block; width: 100%; min-height: 900px; margin: 0 auto; border: 0; border-radius: 9px; background: #fff; box-shadow: 0 10px 28px rgba(15,23,42,.16); transition: width .2s ease; }
.viewer-frame-mobile { width: min(100%, 430px); }
#viewer-product-status, #download-viewer-status { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 680px) {
  .product-page-actions { align-items: stretch; }
  .product-page-actions .btn { flex: 1 1 50%; text-align: center; }
  .viewer-stage { padding: 6px; min-height: 620px; }
  .viewer-frame { min-height: 760px; }
}


/* v1.1.0 viewer filters, sample access, and guest custom page */
.viewer-filter-grid { display: grid; grid-template-columns: minmax(180px,1.3fr) minmax(160px,1fr) minmax(150px,.8fr) minmax(180px,auto); gap: 12px; align-items: end; margin-bottom: 12px; }
.viewer-filter-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sample-login-option { margin: 14px 0 18px; padding: 12px 14px; border: 1px solid #dbe4ee; border-radius: 9px; background: #f8fafc; }
.sample-login-option .form-help { display: block; margin-top: 3px; }
.sample-login-notice .actions { margin-top: 10px; }
.guest-custom-content { min-height: 240px; overflow-wrap: anywhere; }
.guest-custom-content img { display: block; max-width: 100%; height: auto; margin: 16px auto; border-radius: 10px; }
.guest-custom-content h1 { margin-top: 0; font-size: clamp(2rem,5vw,3.4rem); line-height: 1.08; }
@media (max-width: 900px) { .viewer-filter-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .viewer-filter-grid { grid-template-columns: 1fr; } }


/* v1.2.0 login-only catalog protection, custom landing page, and download filters */
.guest-landing-body { background: #eef2f7; }
.guest-custom-page-main { min-height: calc(100vh - 64px); display: grid; align-items: center; padding: clamp(36px,7vw,88px) 0; background: radial-gradient(circle at top right, rgba(37,99,235,.13), transparent 35%), linear-gradient(180deg,#f8fafc 0%,#eef2f7 100%); }
.guest-custom-page-container { width: min(980px, calc(100% - 32px)); }
.guest-custom-content { min-height: 360px; padding: clamp(32px,6vw,72px); overflow-wrap: anywhere; text-align: center; background: rgba(255,255,255,.96); border: 1px solid #dbe4ee; border-radius: 22px; box-shadow: 0 24px 70px rgba(15,23,42,.13); }
.guest-custom-content h1 { max-width: 850px; margin: 0 auto 20px; font-size: clamp(2.35rem,6vw,4.5rem); line-height: 1.02; letter-spacing: -.035em; color: #0f172a; }
.guest-custom-content h2 { max-width: 760px; margin: 0 auto 16px; font-size: clamp(1.25rem,2.8vw,2rem); color: #334155; }
.guest-custom-content p { max-width: 760px; margin: 0 auto 18px; font-size: clamp(1rem,1.7vw,1.15rem); color: #526071; }
.guest-custom-content ul, .guest-custom-content ol { width: min(680px,100%); margin: 20px auto; text-align: left; }
.guest-custom-content img { display: block; max-width: min(100%,760px); height: auto; margin: 26px auto; border-radius: 16px; box-shadow: 0 14px 38px rgba(15,23,42,.12); }
.guest-custom-content a { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; margin: 8px 5px 0; padding: 11px 20px; border-radius: 10px; background: var(--primary); color: #fff; font-weight: 800; box-shadow: 0 8px 20px rgba(15,23,42,.16); }
.guest-custom-content a:hover { background: var(--primary-hover); text-decoration: none; transform: translateY(-1px); }
.guest-custom-content blockquote { max-width: 720px; margin: 24px auto; padding: 18px 22px; border-left: 4px solid var(--accent); background: #f8fafc; text-align: left; color: #475569; }
.downloads-empty-wide { grid-column: 1 / -1; }
#restore-guest-landing-default { margin-top: 10px; }
@media (max-width: 680px) {
  .guest-custom-page-main { padding: 24px 0 42px; align-items: start; }
  .guest-custom-content { min-height: 0; padding: 28px 20px; border-radius: 16px; }
  .guest-custom-content h1 { font-size: clamp(2rem,11vw,3rem); }
}

/* v1.4.5 discount administration and cart pricing */
.discount-admin-section { margin-bottom: 22px; }
.discount-admin-section h2 { margin-top: 0; }
.discount-form { display: grid; gap: 12px; margin: 18px 0 24px; padding: 18px; border: 1px solid #dbe4ee; border-radius: 10px; background: #f8fafc; }
.discount-form select[multiple] { min-height: 190px; }
.discount-table-wrap { margin-top: 20px; }
.discount-code-input-group { flex: 1 1 260px; margin: 0; }
.cart-bottom-grid { align-items: start; }
.cart-summary-card { grid-column: 2; align-self: start; }
.cart-bottom-grid-single { grid-template-columns: minmax(0, 1fr); }
.cart-bottom-grid-single .cart-summary-card { grid-column: 1; max-width: 660px; margin-left: auto; width: 100%; }
.discount-summary-row span { display: grid; gap: 2px; }
.discount-summary-row small { color: var(--muted); font-size: 12px; font-weight: 400; max-width: 620px; }
.discount-summary-row strong { color: var(--success); white-space: nowrap; }
#automatic-discount-info .notice { margin-top: 0; }
#discount-code-result .actions { margin-top: 10px; }
@media (max-width: 760px) {
  .cart-bottom-grid { grid-template-columns: 1fr; }
  .cart-summary-card, .cart-bottom-grid-single .cart-summary-card { grid-column: 1; max-width: none; }
  .discount-form { padding: 14px; }
  .discount-table-wrap table { min-width: 920px; }
}
