:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --primary: #4338ca;
  --primary-soft: #eef2ff;
  --success: #16a34a;
  --success-soft: #ecfdf5;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Noto Sans CJK SC", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

.app-shell { min-height: 100vh; width: 100%; max-width: 100%; }
.app-main, .content, .view { max-width: 100%; }
.sidebar { width: 248px; position: fixed; inset: 0 auto 0 0; background: #fff; border-right: 1px solid var(--border); padding: 22px 14px; display: flex; flex-direction: column; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; border-bottom: 1px solid var(--border); }
.brand-mark { width: 40px; height: 40px; border-radius: 11px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; letter-spacing: .04em; }
.brand-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.brand-copy strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-copy span { font-size: 11px; color: var(--muted); }
.sidebar-nav { padding-top: 18px; overflow: auto; flex: 1; }
.nav-label { font-size: 10px; color: #9ca3af; letter-spacing: .08em; text-transform: uppercase; padding: 12px 10px 6px; }
.nav-item { width: 100%; border: 0; background: transparent; color: #4b5563; border-radius: 9px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; text-align: left; margin-bottom: 3px; }
.nav-item:hover { background: #f8fafc; color: var(--primary); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.sidebar-footer { border-top: 1px solid var(--border); padding-top: 14px; }
.sidebar-backdrop { display: none; }

.app-main { margin-left: 248px; min-width: 0; }
.topbar { min-height: 84px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); padding: 16px 28px; display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 20; }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 20px; line-height: 1.3; }
.topbar-title p { color: var(--muted); font-size: 12px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--border); background: #fff; border-radius: 9px; display: none; }
.menu-button { font-size: 18px; }
.workspace-menu-label { font-size: 10px; color: var(--muted); padding: 6px 8px; }
.credit-chip { border: 1px solid #bbf7d0; background: var(--success-soft); color: #166534; border-radius: 999px; padding: 8px 12px; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.locale-select { display: flex; flex-direction: row; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.locale-select select { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 7px 8px; color: var(--text); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #111827; color: #fff; display: grid; place-items: center; font-weight: 600; }

.content { padding: 20px 28px 48px; }
.view { display: none; }
.view.active { display: block; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.stat-card span { color: var(--muted); font-size: 12px; }
.stat-card strong { font-size: 24px; }
.stat-card small { color: var(--muted); font-size: 11px; }
.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; }
.two-column > .panel { margin-bottom: 0; }
.panel-head { min-height: 62px; padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h2 { font-size: 15px; }
.panel-head p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.currency-select { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.currency-select select { min-width: 78px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.panel-body { padding: 18px; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.7; }

.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-action { border: 1px solid var(--border); background: #fff; border-radius: 10px; padding: 14px; display: flex; align-items: center; gap: 10px; color: var(--text); text-align: left; }
.quick-action:hover { border-color: #c7d2fe; background: #fafaff; }
.quick-icon { width: 28px; height: 28px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 700; }
.arch-grid { display: grid; gap: 10px; }
.arch-item { border-left: 3px solid var(--primary); padding: 6px 0 6px 12px; display: flex; flex-direction: column; gap: 4px; }
.arch-item strong { font-size: 13px; }
.arch-item span { font-size: 12px; color: var(--muted); }

.data-list { display: flex; flex-direction: column; }
.data-row { display: grid; grid-template-columns: 1.2fr 1fr .8fr .7fr .8fr 1fr; gap: 12px; align-items: center; padding: 12px 6px; border-bottom: 1px solid var(--border); font-size: 12px; }
.data-row:last-child { border-bottom: 0; }
.data-row.header { color: var(--muted); font-size: 11px; font-weight: 600; background: #fafbfc; border-radius: 8px; }
.credit-delta.positive { color: var(--success); font-weight: 600; }
.credit-delta.negative { color: var(--danger); font-weight: 600; }
.order-id { font-weight: 600; color: var(--primary); }
.status-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; font-size: 11px; background: #f3f4f6; color: #374151; }
.status-pill.done, .status-pill.paid, .status-pill.active, .status-pill.configured { background: var(--success-soft); color: #166534; }
.status-pill.pending, .status-pill.invited { background: #fffbeb; color: #92400e; }
.status-pill.failed, .status-pill.suspended, .status-pill.missing { background: #fef2f2; color: #991b1b; }
.empty-state { color: var(--muted); text-align: center; padding: 28px; font-size: 12px; }
.filters { gap: 10px; }
.filters input, .filters select { border: 1px solid var(--border); background: #fff; border-radius: 9px; padding: 9px 11px; min-width: 220px; }
.ghost-button, .secondary-button, .primary-button { border-radius: 9px; padding: 9px 14px; font-size: 12px; }
.ghost-button { border: 1px solid var(--border); background: #fff; color: var(--primary); }
.secondary-button { border: 1px solid #c7d2fe; background: #fff; color: var(--primary); }
.primary-button { border: 1px solid var(--primary); background: var(--primary); color: #fff; }
button:disabled { opacity: .5; cursor: not-allowed; }

.balance-top { align-items: stretch; }
.balance-body { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.balance-body div { border: 1px solid var(--border); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.balance-body span { color: var(--muted); font-size: 12px; }
.balance-body strong { font-size: 26px; }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.pack-card { border: 1px solid var(--border); border-radius: 11px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.pack-card.highlight { border-color: #c7d2fe; background: #fafaff; }
.pack-card h3 { font-size: 14px; }
.pack-card .credit-number { font-size: 24px; color: var(--primary); }
.pack-card p { color: var(--muted); font-size: 11px; line-height: 1.6; flex: 1; }
.pack-card button { width: 100%; }
.billing-message { margin-top: 4px; border-radius: 9px; padding: 10px 12px; font-size: 12px; line-height: 1.5; }
.billing-message.info { background: #eef2ff; color: #3730a3; }
.billing-message.success { background: #ecfdf5; color: #047857; }
.billing-message.warn { background: #fffbeb; color: #b45309; }
.billing-message.error { background: #fef2f2; color: #b91c1c; }
.usage-summary { margin-bottom: 12px; padding: 10px 12px; border-radius: 9px; background: #eef2ff; color: #3730a3; font-size: 12px; font-weight: 600; }
.usage-row { grid-template-columns: 34px 1.8fr .8fr .8fr .9fr; cursor: pointer; }
.usage-entry > .usage-row { list-style: none; }
.usage-entry > .usage-row::-webkit-details-marker { display: none; }
.usage-entry > .usage-row:hover { background: #fafaff; }
.admin-order-row { grid-template-columns: minmax(86px, .9fr) minmax(130px, 1.5fr) minmax(90px, .8fr) minmax(90px, .8fr) minmax(96px, .8fr); cursor: default; }
.admin-credit-row { grid-template-columns: minmax(130px, 1.4fr) minmax(80px, .7fr) minmax(90px, .7fr) minmax(150px, 1.1fr); cursor: default; }
.admin-provider-row { grid-template-columns: minmax(110px, 1fr) minmax(150px, 1.2fr) minmax(180px, 1.6fr); cursor: default; }
.admin-order-row > div, .admin-credit-row > div, .admin-provider-row > div { min-width: 0; overflow-wrap: anywhere; }
.usage-expand { display: flex; align-items: center; }
.usage-chevron { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: #eef2ff; color: #4338ca; font-size: 11px; transition: transform .15s ease, background .15s ease, color .15s ease; }
.usage-entry[open] .usage-chevron { transform: rotate(90deg); background: #4f46e5; color: #fff; }
.pricing-row { grid-template-columns: 1.4fr .8fr .7fr .8fr 2fr; }
.usage-name { font-weight: 600; color: var(--text); }
.usage-details { margin-left: 44px; padding: 2px 0 12px 14px; border-left: 2px solid #c7d2fe; border-bottom: 1px solid var(--border); }
.usage-detail-line { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 12px; align-items: center; padding: 6px 0; color: var(--text); font-size: 11px; }
.usage-detail-meta { color: var(--muted); }
.usage-detail-empty { color: var(--muted); font-size: 11px; padding: 6px 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.form-grid input { border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; background: #f9fafb; color: var(--text); }
.form-grid .full-width { grid-column: 1 / -1; }
.member-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.member-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 9px; padding: 10px; }
.member-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.member-row .member-name { flex: 1; font-weight: 600; font-size: 12px; }
.member-row .member-email { color: var(--muted); font-size: 11px; }

.admin-notice { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px; padding: 12px 16px; font-size: 12px; margin-bottom: 18px; }
.flag-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.flag-item { border: 1px solid var(--border); border-radius: 9px; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; }
.audit-row { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 12px; display: flex; justify-content: space-between; gap: 10px; }
.audit-row:last-child { border-bottom: 0; }
.audit-row span:last-child { color: var(--muted); }

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-actions .credit-chip span { display: none; }
}

@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 25; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .sidebar-backdrop.open { opacity: 1; pointer-events: auto; }
  .app-main { margin-left: 0; }
  .menu-button { display: grid; place-items: center; }
  .two-column { grid-template-columns: 1fr; }
  .topbar { padding: 14px 18px; }
  .content { padding: 18px 18px 40px; }
}

@media (max-width: 680px) {
  .topbar { flex-wrap: wrap; }
  .topbar-title { flex-basis: calc(100% - 52px); }
  .topbar-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .credit-chip { order: 3; }
  .locale-select span { display: none; }
  .stat-grid { grid-template-columns: 1fr; }
  .quick-grid, .form-grid, .balance-body, .flag-grid, .guide-columns { grid-template-columns: 1fr; }
  .data-row { grid-template-columns: 1fr 1fr; gap: 8px 12px; }
  .data-row.header { display: none; }
  .data-row:not(.header) { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
  .data-row:not(.header) > * { display: flex; flex-direction: column; gap: 3px; }
  .data-row:not(.header) > *::before { content: attr(data-label); color: var(--muted); font-size: 10px; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters input, .filters select { width: 100%; min-width: 0; }
}

.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top, #eef2ff, var(--bg)); }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 20px 60px rgba(15, 23, 42, .12); padding: 28px; }
.auth-brand { display: flex; align-items: center; gap: 10px; color: var(--primary); font-weight: 700; font-size: 13px; margin-bottom: 22px; }
.auth-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 11px; }
.auth-card h1 { font-size: 22px; }
.auth-subtitle { color: var(--muted); font-size: 12px; margin-top: 6px; margin-bottom: 18px; }
.referral-banner { display: grid; gap: 3px; margin: -6px 0 16px; padding: 11px 12px; border: 1px solid #c7d2fe; border-radius: 10px; background: #f8faff; color: #3730a3; font-size: 12px; line-height: 1.5; }
.referral-banner strong { font-size: 12px; }
.referral-banner span:last-child { color: var(--muted); }
.auth-bonus { margin: -6px 0 16px; padding: 10px 12px; border: 1px solid #c7d2fe; border-radius: 10px; background: linear-gradient(135deg, #eef2ff, #f8faff); color: #3730a3; font-size: 12px; line-height: 1.5; }
.auth-locale { display: flex; flex-direction: row; align-items: center; justify-content: flex-end; gap: 8px; font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.auth-locale select { border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; background: #fff; color: var(--text); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: #f3f4f6; border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.auth-tab { border: 0; background: transparent; color: var(--muted); border-radius: 8px; padding: 9px; font-size: 13px; }
.auth-tab.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: var(--shadow); }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.auth-card form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.auth-card form input { border: 1px solid var(--border); border-radius: 9px; padding: 10px 11px; font-size: 13px; color: var(--text); }
.auth-card form button { width: 100%; margin-top: 4px; }
.code-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.code-row input { width: 100%; }
.code-row button { width: auto; margin-top: 0; white-space: nowrap; }
.link-button { align-self: flex-end; border: 0; background: none; color: var(--primary); cursor: pointer; font-size: 12px; padding: 0; text-decoration: none; }
.auth-message { margin-top: 12px; font-size: 12px; line-height: 1.6; color: var(--muted); min-height: 18px; }
.auth-message.error { color: var(--danger); }
.auth-message.success { color: var(--success); }
.signout-button { margin-left: 10px; }
.top-signout { white-space: nowrap; }
.referral-link-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.referral-link-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.referral-link-row input { flex: 1 1 260px; }
.referral-copy-message { color: var(--success); font-size: 12px; }
.referral-stats { margin-top: 10px; color: #4338ca; font-size: 12px; font-weight: 600; }
.profile-picker { position: relative; }
.profile-trigger { display: flex; align-items: center; gap: 8px; }
.profile-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.profile-picker .avatar { border: 0; cursor: pointer; }
.profile-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; min-width: 200px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(15, 23, 42, .14); padding: 8px; }
.profile-option { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 7px; color: var(--text); font-size: 12px; cursor: pointer; }
.profile-option-icon { width: 16px; height: 16px; flex: 0 0 16px; opacity: 0.7; }
.profile-option:hover { background: #f3f4f6; }
.profile-option:hover .profile-option-icon { opacity: 1; }
.profile-option.danger { margin-top: 8px; background: var(--danger); color: #fff; font-weight: 600; }
.profile-option.danger .profile-option-icon { opacity: 1; }
.profile-option.danger:hover { background: #b42318; }
.danger-panel { border-color: #fecaca; }
.danger-button { margin-top: 10px; border: 0; border-radius: 8px; background: var(--danger); color: #fff; padding: 10px 14px; font-size: 12px; font-weight: 600; cursor: pointer; }
.document-body { max-height: 60vh; overflow: auto; color: var(--muted); font-size: 13px; line-height: 1.8; white-space: pre-line; }
.guide-card { width: min(1120px, 100%); max-height: 86vh; overflow: auto; }
.guide-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.guide-column { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: #f9fafb; }
.guide-column h3 { margin-bottom: 12px; color: var(--text); font-size: 15px; }
.guide-column ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: 12px; line-height: 1.9; }
.guide-column li + li { margin-top: 10px; }
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); }
.modal-card { position: relative; width: min(680px, 100%); background: var(--surface); border-radius: 16px; padding: 24px; box-shadow: 0 24px 70px rgba(15, 23, 42, .25); }
.modal-card h2 { font-size: 18px; }
.modal-card > p { color: var(--muted); font-size: 12px; margin-top: 6px; margin-bottom: 18px; }
.industry-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.industry-card { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: #f9fafb; }
.industry-card:hover { border-color: var(--primary); background: #eef2ff; }
.industry-card strong { font-size: 14px; }
.industry-card span { font-size: 11px; color: var(--muted); line-height: 1.5; }
@media (max-width: 640px) { .industry-grid { grid-template-columns: 1fr; } }
.provider-config-panel { margin-bottom: 16px; }
.provider-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.provider-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.provider-form input { border: 1px solid var(--border); border-radius: 9px; padding: 9px 10px; font-size: 13px; color: var(--text); background: #fff; }
.provider-form small { color: var(--muted); font-size: 11px; }
.provider-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.file-button { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; color: var(--text); cursor: pointer; font-size: 13px; }
#providerConfigMessage { grid-column: 1 / -1; }
@media (max-width: 640px) { .provider-form { grid-template-columns: 1fr; } }

.industry-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.industry-heading h2 { margin: 8px 0 6px; font-size: 22px; }
.industry-heading p { font-size: 13px; color: var(--muted); }
.industry-badge { display: inline-block; padding: 5px 10px; border-radius: 999px; background: #eef2ff; color: #4338ca; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
#view-industry[data-industry="restaurant"] .industry-badge { background: #fff7ed; color: #c2410c; }
#view-industry[data-industry="beauty"] .industry-badge { background: #fdf2f8; color: #be185d; }
.industry-import { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.hint-inline { font-size: 11px; color: var(--muted); }
.industry-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.industry-table { width: 100%; min-width: 1560px; border-collapse: collapse; font-size: 12px; }
.industry-table th { position: sticky; top: 0; z-index: 1; padding: 10px 8px; background: #f8fafc; color: var(--muted); font-weight: 600; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); }
.industry-table td { padding: 8px; border-top: 1px solid var(--border); vertical-align: top; white-space: nowrap; }
.industry-table tr:first-child td { border-top: 0; }
.industry-table td:nth-child(3) { min-width: 300px; white-space: normal; }
.industry-table input, .industry-table select, .industry-table textarea { border: 1px solid var(--border); border-radius: 8px; padding: 8px 9px; font-size: 12px; color: var(--text); background: #fff; }
.industry-table input[type="text"], .industry-table input:not([type]) { min-width: 120px; }
.industry-table input[type="number"] { width: 74px; }
.industry-table input[type="checkbox"] { width: 16px; height: 16px; }
.industry-table textarea { width: 300px; min-height: 80px; max-height: 320px; resize: vertical; line-height: 1.5; }
.industry-table .industry-image-cell { min-width: 130px; }
.industry-thumb { display: block; width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 6px; }
.industry-image-cell input[type="file"] { width: 110px; font-size: 10px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-duplicate { border: 1px solid #c7d2fe; background: #eef2ff; color: #4338ca; border-radius: 8px; padding: 7px 10px; cursor: pointer; font-size: 12px; }
.row-delete { border: 1px solid #fecaca; background: #fee2e2; color: #b91c1c; border-radius: 8px; padding: 7px 10px; cursor: pointer; font-size: 12px; }
.industry-config { margin: 16px 0; padding: 18px; border: 1px solid #dbeafe; border-radius: 14px; background: linear-gradient(180deg, #f8fbff, #fff); }
.industry-config-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.industry-config-head h3 { margin: 0 0 4px; font-size: 15px; }
.industry-config-head > div > span { font-size: 12px; color: var(--muted); }
.industry-config-note { padding: 6px 10px; border-radius: 999px; background: #eef2ff; color: #4338ca; font-size: 11px; white-space: nowrap; }
.config-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.config-section { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .03); }
.config-section-wide { grid-column: 1 / -1; }
.config-section-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.config-section-index { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: #eef2ff; color: #4338ca; font-size: 11px; font-weight: 700; flex: 0 0 28px; }
#view-industry[data-industry="restaurant"] .config-section-index { background: #fff7ed; color: #c2410c; }
#view-industry[data-industry="beauty"] .config-section-index { background: #fdf2f8; color: #be185d; }
.config-section-head h4 { margin: 0 0 4px; font-size: 13px; }
.config-section-head p { margin: 0; font-size: 11px; color: var(--muted); line-height: 1.4; }
.config-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.config-section-wide .config-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.config-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.config-field > span:first-child { color: var(--text); font-weight: 600; }
.config-field input, .config-field select { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 9px; padding: 9px 10px; font-size: 13px; color: var(--text); background: #fff; }
.config-field small { min-height: 16px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.config-check { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 9px; background: #f9fafb; color: var(--text); font-size: 12px; }
.config-check input { width: 18px; height: 18px; flex: 0 0 18px; }
.industry-actions { display: flex; gap: 10px; margin-top: 14px; }
.industry-result { padding: 12px 14px; border-radius: 10px; background: #f8fafc; margin-top: 10px; font-size: 12px; }
.industry-result strong { display: block; margin-bottom: 6px; color: var(--text); }
.industry-result pre { white-space: pre-wrap; word-break: break-word; color: var(--muted); }
.task-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.task-table th, .task-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.task-table th { color: var(--muted); font-weight: 600; }
.task-table .status-badge { display: inline-block; padding: 3px 8px; border-radius: 999px; background: #eef2ff; color: #4338ca; font-size: 11px; }
.task-table .task-error { margin-top: 4px; max-width: 260px; color: #b42318; font-size: 11px; line-height: 1.4; }
.task-table .task-retention { color: var(--muted); font-size: 11px; }
.task-table .empty-row td { padding: 24px 12px; text-align: center; color: var(--muted); }
.snapshot-banner { padding: 14px; margin-bottom: 14px; border: 1px solid #c7d2fe; border-radius: 12px; background: #eef2ff; color: #3730a3; font-size: 12px; line-height: 1.7; }
.snapshot-banner strong { display: block; margin-bottom: 4px; color: #312e81; font-size: 13px; }
.snapshot-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.progress-bar { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: #4f46e5; width: 0; }
.download-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.result-card { padding: 16px; border: 1px solid var(--border); border-radius: 12px; margin-top: 14px; background: #fff; }
.result-card h3 { margin: 0; font-size: 14px; }
.result-card .badge { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: #eef2ff; color: #4338ca; font-size: 10px; }
.copy-bar, .main-image-actions, .variant-actions, .video-actions, .image-preview-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.copy-text { width: 100%; min-height: 96px; margin-top: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 9px; font-size: 12px; font-family: inherit; color: var(--text); background: #f8fafc; resize: vertical; }
.raw-copy { margin-top: 8px; font-size: 12px; color: var(--muted); }
.raw-copy pre { white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; }
.main-images, .variant-gallery, .merged-video, .videos { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.main-images h4, .variant-gallery h4, .merged-video h4 { margin: 0 0 10px; font-size: 13px; }
.main-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.main-image-item, .variant-item { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #fafcff; }
.main-image-item img, .variant-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.main-image-meta, .variant-label { margin-top: 6px; font-size: 11px; color: var(--muted); }
.variant-gallery { border-color: #c7d2fe; background: #f8faff; border-radius: 10px; padding: 12px; }
.variant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.variant-item.applied { border-color: #4f46e5; background: #eef2ff; }
.variant-copy { margin-top: 4px; min-height: 32px; font-size: 12px; color: var(--text); }
.variant-list { width: 100%; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); }
.variant-list summary { cursor: pointer; color: #4338ca; font-size: 11px; font-weight: 600; }
.variant-list .variant-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 9px; }
.variant-list .variant-item { padding: 8px; background: #fff; }
.variant-list .variant-actions { gap: 5px; }
.variant-list .variant-actions button, .variant-list .variant-actions a { padding: 6px 8px; font-size: 11px; }
.video-item { margin-top: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
.video-item video, .merged-video video { display: block; width: 100%; max-height: 360px; margin-top: 8px; border-radius: 10px; }
.merged-video .video-actions { margin-top: 8px; }
.button-link { display: inline-flex; align-items: center; padding: 8px 12px; border: 1px solid var(--border); border-radius: 9px; color: var(--text); text-decoration: none; font-size: 12px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.image-preview-card { width: min(880px, 100%); }
.image-preview-card h2 { margin: 0; font-size: 14px; }
#imagePreviewImg { display: block; width: 100%; max-height: 70vh; object-fit: contain; margin-top: 14px; border-radius: 10px; }
@media (max-width: 900px) {
  .config-sections { grid-template-columns: 1fr; }
  .config-section-wide { grid-column: auto; }
  .config-section-wide .config-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .industry-table-wrap { overflow: hidden; border: 0; width: 100%; max-width: 100%; }
  .industry-table, .industry-table tbody, .industry-table tr, .industry-table td { display: block; width: 100%; min-width: 0; max-width: 100%; }
  .industry-table thead { display: none; }
  .industry-table tr { border: 1px solid var(--border); border-radius: 12px; padding: 10px; margin-bottom: 12px; background: #fff; width: 100%; max-width: 100%; }
  .industry-table td { white-space: normal; border: 0; padding: 8px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; max-width: 100%; }
  .industry-table td::before { content: attr(data-label); flex: 0 0 90px; color: var(--muted); font-size: 11px; font-weight: 600; }
  .industry-table td input:not([type="checkbox"]):not([type="file"]), .industry-table td select, .industry-table td textarea { width: calc(100% - 100px); min-width: 0; max-width: calc(100% - 100px); }
  .industry-table td input[type="file"] { max-width: 100%; }
  .industry-table textarea { min-height: 72px; width: calc(100% - 100px); }
  .industry-table .industry-image-cell { min-width: 0; }
  .industry-table .row-actions { justify-content: flex-end; flex-wrap: wrap; max-width: 100%; }
  .task-table, .task-table tbody, .task-table tr, .task-table td { display: block; width: 100%; }
  .task-table thead { display: none; }
  .task-table tr:not(.empty-row) { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
  .task-table td { border: 0; padding: 6px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .task-table td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 600; }
  .task-table .empty-row td { display: block; text-align: center; }
  .task-table .empty-row td::before { content: none; }
}
@media (max-width: 640px) {
  .industry-heading { flex-direction: column; }
  .config-fields, .config-section-wide .config-fields { grid-template-columns: 1fr; }
  .industry-actions { flex-direction: column; }
  .industry-table td, .task-table td { align-items: stretch; flex-direction: column; gap: 5px; }
  .industry-table td::before, .task-table td::before { flex: 0 0 auto; }
  .industry-table td input:not([type="checkbox"]):not([type="file"]), .industry-table td select, .industry-table td textarea { width: 100%; max-width: 100%; }
  .industry-table .row-actions { justify-content: flex-start; }
  .industry-table .row-actions button { max-width: 100%; }
  .industry-import, .industry-config-head { align-items: stretch; flex-direction: column; }
  .snapshot-actions { flex-direction: column; }
  .snapshot-actions button { width: 100%; }
}
