/* 
  Admin panel CSS v1.0 - LunePlay
  Date: 2026-11-11
 */
:root {
    font-family: Inter, "Segoe UI", sans-serif;
    color: #1e293b;
    background: #f8fafc;
    font-synthesis: none;
    --brand: #4f46e5;
    --line: #e2e8f0;
    --muted: #64748b;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 13px; }
[hidden] { display: none !important; }
::selection { background: #e0e7ff; color: #312e81; }
* { scrollbar-width: thin; scrollbar-color: #94a3b8 transparent; }
:focus-visible { outline: 3px solid #6366f1; outline-offset: 3px; }
a { color: var(--brand); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button, .button { display: inline-flex; gap: 7px; align-items: center; justify-content: center; padding: 10px 15px; border: 1px solid transparent; border-radius: 9px; background: var(--brand); color: #fff; font-weight: 650; cursor: pointer; line-height: 1.3; }
button:hover, .button:hover { background: #4338ca; text-decoration: none; }
button:disabled { opacity: .5; cursor: not-allowed; }
.secondary, .button.secondary { background: #eef2ff; color: #4338ca; border-color: #e0e7ff; }
.secondary:hover { background: #e0e7ff; }
.danger, button.danger { background: #fff1f2; color: #be123c; }
.text-button { color: var(--brand); background: transparent; padding: 5px 0; }
.text-button:hover { color: #312e81; background: transparent; text-decoration: underline; }
.icon { flex: 0 0 auto; vertical-align: middle; }
.icon-button { padding: 6px; background: transparent; color: #64748b; border-radius: 6px; }
.icon-button:hover { background: #eef2ff; color: #4338ca; }
.global-header { min-height: 65px; padding: 10px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #fff; border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #0f172a; font-size: 21px; font-weight: 850; letter-spacing: -.6px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--brand); color: white; box-shadow: 0 3px 8px #4f46e526; }
.brand-mark .icon { width: 24px; height: 24px; }
.global-nav { display: flex; align-items: center; gap: 4px; background: #f1f5f9; padding: 4px; border-radius: 10px; }
.global-nav a { display: flex; align-items: center; gap: 7px; color: #475569; font-size: 12px; font-weight: 650; border-radius: 7px; padding: 8px 13px; white-space: nowrap; }
.global-nav .icon { width: 16px; height: 16px; }
.global-nav a[aria-current], .global-nav a:hover { background: #fff; color: #4338ca; text-decoration: none; box-shadow: 0 1px 3px #0f172a12; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.profile-menu { position: relative; }
.profile-menu summary { list-style: none; display: flex; align-items: center; gap: 10px; border-radius: 24px; background: #f1f5f9; border: 1px solid var(--line); padding: 4px 11px 4px 5px; cursor: pointer; }
.profile-menu summary::-webkit-details-marker { display: none; }
.avatar { display: inline-grid; place-items: center; width: 33px; height: 33px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 14px; font-weight: 750; flex-shrink: 0; }
.profile-label { display: grid; gap: 2px; max-width: 180px; }
.profile-label strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-label small { color: #64748b; font-size: 10px; }
.profile-dropdown { position: absolute; top: calc(100% + 10px); right: 0; width: 290px; background: #fff; border: 1px solid var(--line); padding: 18px; border-radius: 14px; box-shadow: 0 12px 35px #0f172a20; }
.profile-email { display: block; overflow-wrap: anywhere; margin: 5px 0 15px; }
.credit-balance { display: flex; align-items: center; gap: 8px; padding: 12px 0; margin-bottom: 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.credit-balance strong { margin-left: auto; font-size: 18px; }
.credit-balance .icon { color: #a16207; }
.menu-action { width: 100%; justify-content: flex-start; background: transparent; color: #475569; margin-top: 4px; }
.menu-action:hover { background: #eef2ff; color: #4338ca; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 6px; background: #eef2ff; color: #4338ca; font-size: 10px; font-weight: 750; letter-spacing: .3px; }
.badge.amber { color: #92400e; background: #fffbeb; border: 1px solid #fde68a; letter-spacing: .4px; }
.banner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; background: #fffbeb; border-bottom: 1px solid #fde68a; color: #92400e; padding: 9px 24px; font-size: 12px; }
.banner > span { display: flex; align-items: center; gap: 7px; }
.page-content { max-width: 1440px; margin: 0 auto; padding: 30px 32px 50px; }
.page-heading, .bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
h1 { color: #0f172a; font-size: 25px; font-weight: 800; letter-spacing: -.65px; margin: 0 0 7px; }
h2 { color: #0f172a; font-size: 17px; font-weight: 750; margin: 0 0 12px; }
h3 { font-size: 13px; color: #0f172a; margin: 0; }
p { line-height: 1.6; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.6; }
.page-heading p { margin: 0; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin: 22px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); gap: 16px; }
.field { display: grid; gap: 6px; margin: 13px 0; }
.form-section { min-width: 0; margin: 20px 0 0; padding: 16px 0 0; border: 0; border-top: 1px solid var(--line); }
.form-section legend { padding: 0 10px 0 0; color: #0f172a; font-size: 13px; font-weight: 750; }
.form-section .grid { gap: 4px 16px; }
.form-section .field { margin: 8px 0; }
.field label, label.field { font-size: 12px; font-weight: 650; color: #475569; }
input, select, textarea { width: 100%; min-width: 0; border: 1px solid #cbd5e1; border-radius: 7px; padding: 9px 11px; color: #1e293b; background: #fff; caret-color: var(--brand); }
input::placeholder, textarea::placeholder { color: #64748b; }
input[type=color], .inspector input[type=color] { height: 44px; padding: 4px; cursor: pointer; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); }
textarea { resize: vertical; line-height: 1.5; }
.actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.flash { padding: 12px 18px; margin-bottom: 16px; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 8px; color: #065f46; line-height: 1.5; }
.flash.error { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.notice { padding: 12px; font-size: 12px; line-height: 1.6; color: #475569; background: #f1f5f9; border: 1px solid var(--line); border-radius: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.badge.success { color: #047857; background: #ecfdf5; }
.badge.neutral { color: #475569; background: #f1f5f9; }
.client-overview { display: flex; flex-wrap: wrap; gap: 8px 26px; align-items: center; padding: 13px 16px; margin: 20px 0 12px; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.client-overview div { display: flex; align-items: baseline; gap: 7px; }
.client-overview strong { color: #0f172a; font-size: 16px; font-variant-numeric: tabular-nums; }
.client-overview span { color: #64748b; font-size: 11px; }
.client-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px; margin-bottom: 14px; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.client-filters { display: flex; flex: 1; align-items: center; flex-wrap: wrap; gap: 9px; }
.client-search { flex: 1 1 260px; max-width: 420px; }
.client-toolbar select { width: auto; min-width: 160px; }
.client-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,300px),1fr)); gap: 14px; }
.client-card { min-width: 0; padding: 17px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.client-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.client-card-heading h2 { margin: 0 0 5px; font-size: 15px; overflow-wrap: anywhere; }
.client-card-heading .badge { flex: 0 0 auto; }
.client-owner { display: grid; gap: 4px; padding: 12px 0; margin: 12px 0; border-top: 1px solid #edf0f5; border-bottom: 1px solid #edf0f5; overflow-wrap: anywhere; }
.client-owner strong { color: #0f172a; font-size: 12px; }
.client-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 0; }
.client-metrics div { min-width: 0; padding: 9px 10px; background: #f8fafc; border-radius: 8px; }
.client-metrics dt { color: #64748b; font-size: 10px; }
.client-metrics dd { margin: 4px 0 0; color: #0f172a; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.client-usage { height: 5px; margin: 11px 1px 14px; overflow: hidden; background: #e2e8f0; border-radius: 5px; }
.client-usage span { display: block; height: 100%; background: #4f46e5; border-radius: inherit; }
.client-card-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.client-card-actions form { margin: 0; }
.client-card-actions button { min-height: 38px; }
.client-dialog { width: min(900px,calc(100% - 32px)); max-height: 90dvh; }
.client-dialog > form > .form-section:first-of-type { margin-top: 4px; }
.client-admin-tools { padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); }
.client-admin-tools h3 { margin-bottom: 12px; font-size: 14px; }
.client-admin-form { display: grid; grid-template-columns: minmax(150px,1fr) minmax(150px,1fr) auto; align-items: end; gap: 12px; padding: 12px 0; border-top: 1px solid #edf0f5; }
.client-admin-form .field { margin: 0; }
.client-admin-form button { min-height: 38px; margin-bottom: 13px; }
.client-danger-zone { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); }
.client-danger-zone h3 { margin: 0 0 5px; color: #9f1239; }
.client-danger-zone p { margin: 0; max-width: 560px; }
.client-danger-zone form { margin: 0; }
.client-dialog .danger { border: 1px solid #fecdd3; }
.campaign-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 24px; background: #0f172a; color: #e2e8f0; border-bottom: 1px solid #1e293b; }
.campaign-toolbar label { font-size: 11px; color: #cbd5e1; }
.campaign-toolbar select { width: 245px; color: #fff; background: #1e293b; border-color: #475569; font-size: 12px; font-weight: 650; }
.toolbar-status { color: #a7f3d0; font-size: 11px; }
.toolbar-status.unsaved { color: #fde68a; }
.toolbar-button, .button.toolbar-button { color: #e2e8f0; background: #1e293b; border: 1px solid #334155; font-size: 11px; padding: 8px 10px; }
.toolbar-button:hover { background: #334155; }
.campaign-toolbar button[type=submit] { font-size: 12px; padding: 9px 13px; }
.campaign-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(290px,1fr)); gap: 22px; margin-top: 22px; }
.campaign-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; display: flex; flex-direction: column; }
.campaign-art { min-height: 64px; padding: 16px 20px; background: var(--campaign-bg, #001233); color: var(--campaign-accent, #ffcc00); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.campaign-art > .icon { width: 28px; height: 28px; }
.campaign-art .badge { background: #fff; color: #334155; }
.campaign-cartridges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.campaign-card-body { padding: 20px; flex: 1; }
.campaign-card h2 { font-size: 16px; margin-bottom: 7px; overflow-wrap: anywhere; }
.campaign-meta { display: flex; gap: 20px; margin-top: 20px; font-size: 12px; color: #64748b; }
.campaign-meta span { display: flex; gap: 6px; align-items: center; }
.campaign-meta .icon { width: 16px; height: 16px; }
.campaign-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid #f1f5f9; }
.campaign-card-footer .button { font-size: 12px; padding: 8px 12px; }
.campaign-search { max-width: 350px; margin-top: 26px; }
.empty-state { text-align: center; padding: 55px 20px; border: 1px dashed #cbd5e1; border-radius: 14px; margin-top: 24px; }
.empty-state > .icon { color: #818cf8; width: 40px; height: 40px; margin-bottom: 15px; }
.empty-state p { margin-bottom: 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
th,td { text-align: left; padding: 15px 13px; border-bottom: 1px solid #f1f5f9; white-space: nowrap; }
th { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: #64748b; background: #f8fafc; }
td strong { color: #0f172a; }
td .actions { flex-wrap: nowrap; }
.client-limits { display: grid; grid-template-columns: repeat(2,minmax(130px,1fr)); align-items: end; gap: 10px; min-width: 300px; }
.client-limit-field, .client-credit-form { display: grid; gap: 5px; }
.client-limit-field label, .client-credit-form label { color: #334155; font-size: 11px; font-weight: 650; white-space: normal; }
.client-limit-field input, .client-credit-form input { width: 100%; }
.client-limit-field small { color: #64748b; font-size: 10px; line-height: 1.4; white-space: normal; }
.client-limits button { justify-self: start; }
.client-credit-form { min-width: 120px; }
.table-wrap button, .table-wrap .button { font-size: 11px; padding: 8px 11px; }
.search-form input { max-width: 380px; }
.lead-report { display: grid; gap: 20px; margin: 22px 0; }
.lead-report-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 0; }
.lead-metric { min-width: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.lead-metric dt { color: var(--muted); font-size: 11px; }
.lead-metric dd { margin: 7px 0 0; color: #0f172a; font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.lead-metric small, .lead-report-list small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.lead-report-panels { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 28px; }
.lead-report-panels h2 { margin: 0 0 8px; }
.lead-report-list { margin: 0; }
.lead-report-list > div { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.lead-report-list dt { min-width: 0; line-height: 1.5; }
.lead-report-list dd { flex: 0 0 auto; margin: 0; color: #0f172a; font-weight: 700; font-variant-numeric: tabular-nums; }
.lead-dialog { width: min(780px,calc(100% - 32px)); }
.lead-dialog .dialog-heading { align-items: flex-start; }
.lead-dialog .dialog-heading h2 { overflow-wrap: anywhere; min-width: 0; }
.lead-dialog .dialog-heading > div { min-width: 0; }
.lead-dialog .dialog-heading .icon-button { flex: 0 0 auto; min-width: 40px; min-height: 40px; background: #f1f5f9; }
.lead-dialog-contact { margin: 6px 0 0; overflow-wrap: anywhere; }
.lead-details-content { padding: 20px 0 0; white-space: normal; }
.lead-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.lead-tabs [role=tab] { flex: 0 0 auto; min-height: 42px; padding: 10px 14px; border-radius: 7px; color: #475569; background: transparent; font-size: 12px; white-space: nowrap; }
.lead-tabs [role=tab]:hover { color: #4338ca; background: #eef2ff; }
.lead-tabs [role=tab][aria-selected=true] { color: #4338ca; background: #fff; border-color: var(--line); box-shadow: 0 1px 3px #0f172a0a; }
.lead-tabs [role=tab]:focus-visible { outline-offset: -3px; }
.lead-detail-section { padding-top: 24px; }
.lead-detail-section h3 { margin: 0 0 14px; color: #0f172a; font-size: 16px; }
.lead-detail-section dl { margin: 0; font-size: 13px; line-height: 1.6; }
.lead-detail-section dl > div { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 10px 24px; padding: 13px 0; border-top: 1px solid var(--line); }
.lead-detail-section dd { min-width: 0; margin: 0; color: #1e293b; font-weight: 600; overflow-wrap: anywhere; white-space: pre-wrap; font-variant-numeric: tabular-nums; }
.lead-detail-section dt { color: #475569; overflow-wrap: anywhere; }
.report-heading { margin-bottom: 22px; }
.report-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; padding: 14px 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.report-filters .field { width: min(220px,100%); margin: 0; }
.report-filters button { min-height: 38px; }
.report-note { margin: 14px 0; }
.report-totals { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px; margin: 18px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.report-totals div { display: grid; gap: 6px; padding: 16px 18px; background: #fff; }
.report-totals span { color: var(--muted); font-size: 11px; }
.report-totals strong { color: #0f172a; font-size: 21px; font-variant-numeric: tabular-nums; }
.report-totals + .card { margin-top: 18px; }
@media(max-width:760px) { .report-totals { grid-template-columns: repeat(2,minmax(0,1fr)); } }
.login { max-width: 450px; padding: 0 20px; margin: 12vh auto; }
.login .card { padding: 30px; box-shadow: 0 12px 30px #0f172a0a; }
dialog { padding: 25px; border: 1px solid var(--line); border-radius: 16px; color: #1e293b; width: min(520px,calc(100% - 32px)); max-height: 85dvh; overflow-y: auto; box-shadow: 0 20px 70px #0f172a35; }
#company-dialog { width: min(720px,calc(100% - 32px)); }
dialog::backdrop { background: #0f172a70; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { margin: 0; }
.dialog-heading .icon-button { font-size: 23px; line-height: 1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.license-details { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; font-size: 12px; margin: 24px 0; }
.license-details dt { color: #64748b; }
.license-details dd { margin: 0; font-weight: 650; text-align: right; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 100; padding: 12px; background: white; border: 1px solid var(--brand); border-radius: 6px; }
.skip-link:focus { top: 8px; }
.builder-page { padding: 0; }
.builder-page > .flash { margin: 12px 20px; }
.builder-layout { display: grid; grid-template-columns: minmax(300px,420px) minmax(0,1fr); min-height: calc(100dvh - 128px); }
.library { background: white; border-right: 1px solid var(--line); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 18px; border-bottom: 1px solid #f1f5f9; }
.panel-heading h2 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 12px; }
.panel-heading .icon { color: #FFF; width: 17px; height: 17px; }
.panel-heading p { font-size: 10px; margin: 6px 0 0; color: #64748b; }
.library-group { padding: 18px 12px 0; }
.library-group h3 { font-size: 10px; text-transform: uppercase; color: #64748b; letter-spacing: .6px; margin: 0 5px 10px; }
.library-step { display: flex; gap: 10px; justify-content: flex-start; text-align: left; width: 100%; border: 1px solid var(--line); background: white; color: #334155; padding: 10px; margin-bottom: 8px; cursor: grab; }
.library-step:hover { background: #fafaff; border-color: #818cf8; }
.library-step:disabled { cursor: not-allowed; }
.library-step span:last-child { min-width: 0; display: grid; gap: 4px; }
.library-step strong { font-size: 11px; }
.library-step small { color: #64748b; font-size: 10px; font-weight: 400; }
.step-symbol { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 9px; color: #4338ca; background: #eef2ff; }
.step-symbol[data-type=lead_form] { color: #047857; background: #ecfdf5; }
.step-symbol[data-type=memory] { color: #0369a1; background: #f0f9ff; }
.step-symbol[data-type=roulette] { color: #a16207; background: #fefce8; }
.step-symbol[data-type=voucher] { color: #be123c; background: #fff1f2; }
.journey { min-width: 0; padding: 28px 24px; background: #f8fafc; }
.journey-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 20px; }
.journey-heading h1 { font-size: 18px; margin: 0 0 5px; letter-spacing: -.4px; }
.journey-heading p { margin: 0; }
.journey-heading .badge { white-space: nowrap; background: white; color: #475569; border: 1px solid var(--line); }
.step-list { padding: 20px 2px; margin: 0; list-style: none; display: flex; flex-direction: column; align-items: center; }
.step-card { width: 100%; max-width: 480px; position: relative; display: flex; align-items: center; gap: 10px; border: 1px solid #cbd5e1; border-radius: 12px; background: white; padding: 14px 12px; cursor: grab; box-shadow: 0 3px 9px #0f172a06; }
.step-card + .step-card { margin-top: 26px; }
.step-card + .step-card::before { content: ''; position: absolute; width: 1px; height: 26px; background: #cbd5e1; bottom: calc(100% + 1px); left: 50%; }
.step-card.selected { border-color: var(--brand); background: #f5f5ff; box-shadow: 0 4px 12px #4f46e512; }
.step-card.dragging { opacity: .4; }
.step-card.drag-over, .step-list.drag-over { border-color: #4f46e5; background-color: #eef2ff; }
.step-number { color: #64748b; font-size: 10px; font-weight: 750; min-width: 12px; }
.step-select { border: 0; padding: 0; border-radius: 3px; background: transparent; color: #334155; display: flex; gap: 10px; text-align: left; flex: 1; min-width: 0; justify-content: flex-start; }
.step-select:hover { background: transparent; color: var(--brand); }
.step-select > span:last-child { display: grid; gap: 5px; min-width: 0; }
.step-title { font-size: 12px; overflow-wrap: anywhere; }
.step-summary { display: block; color: #64748b; font-weight: 400; font-size: 12px; line-height: 1.5; }
.step-actions { display: flex; flex-direction: column; gap: 2px; }
.step-actions .icon-button { padding: 3px; }
.step-actions .icon { width: 13px; height: 13px; }
.journey-note { text-align: center; color: #64748b; font-size: 11px; line-height: 1.7; margin: 18px auto 0; max-width: 340px; }
.inspector { min-width: 0; background: white; border-left: 1px solid var(--line); }
.inspector-body { padding: 0 32px 28px; max-width: 1040px; margin: 0 auto; }
.orientation { display: flex; gap: 2px; padding: 3px; background: #f1f5f9; border: 1px solid var(--line); border-radius: 7px; }
.orientation button { color: #64748b; background: transparent; border-radius: 4px; padding: 4px; }
.orientation button[aria-pressed=true] { color: #4338ca; background: white; box-shadow: 0 1px 3px #0f172a15; }
#preview-dialog { width: min(560px,calc(100% - 32px)); max-height: 94dvh; padding: 20px; }
#preview-dialog.landscape { width: min(1120px,calc(100% - 32px)); }
#preview-dialog .orientation button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px; }
.preview-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-bottom: 12px; align-items: center; font-size: 12px; color: #475569; }
.preview-stage { display: flex; align-items: center; justify-content: center; background: #0f172a; border-radius: 12px; padding: 14px; overflow: hidden; }
.device-preview { position: relative; width: min(100%,calc((100dvh - 260px) * 9 / 16)); aspect-ratio: 9/16; border-radius: 12px; overflow: hidden; background: #e6f2fd; }
.device-preview.landscape { width: min(100%,calc((100dvh - 260px) * 16 / 9)); aspect-ratio: 16/9; }
#preview-body { position: absolute; inset: 0 auto auto 0; border: 0; transform-origin: top left; pointer-events: none; }
.asset-image-preview { display: block; max-width: 100%; max-height: 120px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; }
.asset-image-preview[hidden] { display: none; }
.editor-row { margin: 10px 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.editor-row .field { margin: 8px 0; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.badge-toggle { grid-template-columns: auto 1fr; align-items: center; }
.editor-actions .text-button { font-size: 10px; }
.inspector-tabs { display: flex; margin: 20px 0 16px; background: #f1f5f9; padding: 4px; border-radius: 9px; }
.inspector-tabs button { flex: 1; border-radius: 6px; padding: 8px; font-size: 11px; background: transparent; color: #475569; }
.inspector-tabs button[aria-selected=true] { background: white; color: #4338ca; box-shadow: 0 1px 3px #0f172a12; }
.inspector-tabs .icon { width: 14px; height: 14px; }
.inspector .field { font-size: 13px; margin: 16px 0; }
.inspector .field label { font-size: 12px; }
.inspector input, .inspector select, .inspector textarea { font-size: 13px; padding: 11px 12px; }
.inspector input[type=checkbox], .inspector input[type=radio] { padding: 0; }
.inspector .grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.inspector fieldset { border: 0; border-top: 1px solid var(--line); margin: 28px 0 0; padding: 16px 0 0; min-width: 0; }
.inspector legend { padding: 0 12px 0 0; margin-bottom: 5px; font-size: 14px; font-weight: 750; color: #334155; }
.inspector .notice { font-size: 12px; }
.slice-editor { background: #f8fafc; border: 1px solid var(--line); border-radius: 9px; padding: 12px; margin: 12px 0; }
.slice-editor .field { margin: 8px 0; }
.slice-flags { display: flex; gap: 12px; flex-wrap: wrap; font-size: 10px; color: #475569; margin: 10px 0; }
.slice-flags label { display: flex; align-items: center; gap: 4px; }
.builder-save { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.builder-save .muted { font-size: 12px; }
.builder-save button { font-size: 13px; }
.builder-feedback { margin: 12px 0; }
.cartridge-choice { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 10px; margin-top: 12px; }
.cartridge-choice label { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 9px; padding: 14px; cursor: pointer; }
.cartridge-choice label:has(input:checked) { border-color: var(--brand); background: #eef2ff; }
.cartridge-choice input { width: auto; }
.new-campaign { max-width: 860px; margin: 24px auto; }
.cartridge-choice small { display: block; margin-top: 5px; color: var(--muted); font-weight: 400; }
.review-journey { width: 100%; margin-bottom: 4px; }
.inspector .panel-heading { padding: 22px 32px; }
.inspector .panel-heading h2 { font-size: 16px; }
.inspector .panel-heading h2 .icon { color: var(--brand); }
.inspector .panel-heading p { font-size: 12px; }
.inspector-tabs { margin: 22px 0; }
.inspector-tabs button { font-size: 13px; padding: 12px; }
#selected-step-title { font-size: 21px; }
.inspector-help { margin: 8px 0 20px; }
.step-appearance { border-block: 1px solid var(--line); margin: 20px 0; padding: 14px 0; }
.step-appearance summary { color: #334155; font-size: 13px; font-weight: 650; cursor: pointer; }
.step-appearance summary span { display: inline-block; margin-left: 8px; font-weight: 400; }
.step-appearance[open] { padding-bottom: 20px; }
.content-summary { margin: 10px 0; color: #475569; font-size: 13px; overflow-wrap: anywhere; white-space: pre-line; }
.inspector .editor-row, .inspector .slice-editor { padding: 16px; background: #fff; margin: 12px 0; }
.editor-actions .text-button { font-size: 12px; }
.content-dialog { width: min(860px,calc(100% - 32px)); max-height: 90dvh; padding: 28px; }
.content-dialog .dialog-heading { position: sticky; top: -28px; background: #fff; padding: 12px 0; z-index: 1; }
.content-dialog .dialog-heading h2 { font-size: 20px; overflow-wrap: anywhere; }
.content-dialog .field { font-size: 13px; margin: 18px 0; }
.content-dialog .field label { font-size: 13px; }
.content-dialog .grid { gap: 20px; }
.content-editor-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 24px; }
.content-editor-fields > .field:has(textarea), .content-editor-fields > .slice-flags { grid-column: 1 / -1; }
.content-editor-fields > .memory-side-editor { min-width: 0; padding-top: 14px; }
.content-editor-fields:has(> .memory-side-editor:only-child) { grid-template-columns: minmax(0,1fr); }
.content-editor-fields > .quiz-option { grid-column: 1 / -1; border-top: 1px solid var(--line); padding: 8px 0 16px; }
.quiz-option .answer-choice { display: inline-flex; gap: 8px; align-items: center; margin-right: 20px; color: #475569; }
.content-editor-fields > button { justify-self: start; margin-top: 16px; }
.stage-library { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.stage-library .library-group { padding: 8px 0; }
.stage-library .library-step { cursor: pointer; }
.stage-library .library-step strong { font-size: 12px; }
.stage-library .library-step small { font-size: 11px; }
@media(min-width:1200px) {
    .builder-layout { grid-template-columns: minmax(320px,420px) minmax(0,1fr); }
    .library, .inspector, .journey { max-height: calc(100dvh - 128px); overflow-y: auto; }
}
@media(max-width:1000px) {
    .global-header { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
    .global-nav { order: 3; width: 100%; justify-content: center; }
    .campaign-toolbar { flex-wrap: wrap; padding: 12px 16px; }
    .builder-layout { grid-template-columns: minmax(260px,.8fr) minmax(0,1.4fr); }
    .journey { padding: 18px 12px; }
    .step-card { padding: 11px 8px; gap: 6px; }
    .step-select .step-symbol { display: none; }
    .profile-label { max-width: 150px; }
    .page-content { padding: 24px 20px; }
}
@media(max-width:760px) {
    .lead-report-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .lead-report-panels { grid-template-columns: 1fr; gap: 20px; }
    .builder-layout { grid-template-columns: minmax(0,1fr); }
    .inspector { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
    .inspector-tabs { margin-top: 0; }
    .builder-save { grid-column: 1 / -1; }
    .library-step { padding: 8px 6px; gap: 6px; }
    .library-step small { display: none; }
    .library-group { padding: 16px 8px 0; }
    .library-step .step-symbol { width: 25px; height: 28px; }
    .journey-heading { flex-wrap: wrap; }
    .step-list { padding: 18px 0; }
    .inspector-body { padding: 0 20px 24px; }
    .inspector .panel-heading { padding: 20px; }
    .stage-library { grid-template-columns: 1fr; gap: 4px; }
    .stage-library .library-step .step-symbol { display: grid; }
    .stage-library .library-step small { display: block; }
    .content-dialog { padding: 20px; }
    .content-dialog .dialog-heading { top: -20px; }
    .campaign-toolbar .toolbar-status { display: none; }
}
@media(max-width:480px) {
    .lead-dialog { padding: 20px; }
    .lead-detail-section dl > div { grid-template-columns: 1fr; gap: 4px; }
    .lead-report-metrics { grid-template-columns: 1fr; }
    .lead-metric { padding: 14px 16px; }
    .page-content { padding: 23px 16px; }
    .global-header { padding: 10px 12px; }
    .brand { font-size: 19px; }
    .profile-label { display: none; }
    .global-nav { gap: 0; }
    .global-nav a { padding: 8px 10px; font-size: 11px; }
    .campaign-toolbar select { max-width: 235px; width: auto; }
    .campaign-toolbar .actions { gap: 7px; }
    .toolbar-button span { display: none; }
    .campaign-toolbar { gap: 10px; }
    .builder-layout { grid-template-columns: minmax(0,1fr); }
    .panel-heading { padding: 16px 10px; }
    .panel-heading h2 { font-size: 11px; }
    .panel-heading p { font-size: 10px; }
    .library-step .step-symbol { display: none; }
    .library-step strong { font-size: 10px; }
    .step-card { flex-wrap: wrap; }
    .step-actions { flex-direction: row; width: 100%; justify-content: flex-end; }
    .journey-heading h1 { font-size: 16px; }
    .journey-heading .muted { font-size: 10px; }
    .step-summary { font-size: 12px; }
    .step-title { font-size: 13px; }
    .inspector .grid, .content-editor-fields { grid-template-columns: minmax(0,1fr); }
    .inspector-body { display: block; }
    .inspector-tabs { margin-top: 20px; }
    h1 { font-size: 23px; }
    .card { padding: 16px; }
    .banner { padding: 9px 14px; }
}
@media(prefers-reduced-motion:no-preference) {
    .step-card { transition: border-color .15s,box-shadow .15s,opacity .12s; }
    .step-card.drag-over, .step-list.drag-over { transition: border-color .15s,background-color .15s; }
    .inspector-tabs button { transition: background-color .15s,color .15s,box-shadow .15s; }
    .inspector [role=status] { opacity: 0; transition: opacity .15s; }
    .inspector [role=status]:not(:empty) { opacity: 1; }
    .inspector [role=tabpanel]:not([hidden]) { animation: admin-panel-enter .16s ease-out both; }
    .toolbar-status { transition: color .15s; }
    dialog[open] { animation: admin-dialog-enter .16s ease-out both; }
    dialog[open]::backdrop { animation: admin-backdrop-enter .16s ease-out both; }

    @keyframes admin-panel-enter {
        from { opacity: 0; transform: translateY(4px); }
        to { opacity: 1; transform: translateY(0); }
    }
    @media(max-width:760px) {
        .client-overview { gap: 8px 16px; }
        .client-overview div { flex-wrap: wrap; gap: 3px 6px; }
        .client-toolbar { align-items: stretch; }
        .client-filters { flex-direction: column; align-items: stretch; }
        .client-search { max-width: none; }
        .client-toolbar select { width: 100%; }
        .client-dialog { padding: 18px; }
        .client-admin-form { grid-template-columns: 1fr; gap: 6px; }
        .client-admin-form button { justify-self: start; margin-bottom: 8px; }
    }
    @keyframes admin-dialog-enter {
        from { opacity: 0; transform: scale(.98); }
        to { opacity: 1; transform: scale(1); }
    }
    @keyframes admin-backdrop-enter {
        from { opacity: 0; }
        to { opacity: 1; }
    }
}
