:root {
  --teal-950: #053f3d;
  --teal-800: #0f766e;
  --teal-500: #14b8a6;
  --teal-100: #ccfbf1;
  --bg: #f4fbfa;
  --panel: #ffffff;
  --line: #d5e8e6;
  --text: #102f2e;
  --muted: #6b7f7e;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
body.auth-locked { overflow: hidden; }
body.auth-locked .app-shell, body.auth-locked .drawer-backdrop, body.auth-locked .detail-drawer, body.auth-locked .material-player-modal { display: none; }
.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, .95fr) minmax(460px, 1.05fr); background: #f3fbfa; }
body:not(.auth-locked) .login-screen { display: none; }
.login-brand-panel { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; padding: 44px 52px; color: #e7fffc; background: linear-gradient(145deg, #053f3d 0%, #075f59 58%, #0f766e 100%); overflow: hidden; }
.login-brand-panel::after { content: ""; position: absolute; right: -90px; bottom: -120px; width: 340px; height: 340px; border: 54px solid rgba(45, 212, 191, .2); border-radius: 50%; }
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 800; font-size: 20px; }
.login-copy { position: relative; z-index: 1; max-width: 560px; }
.login-copy p { margin: 0 0 14px; color: #8ff3e8; font-size: 14px; font-weight: 700; }
.login-copy h1 { margin: 0 0 18px; color: #fff; font-size: 42px; line-height: 1.14; letter-spacing: 0; }
.login-copy span { display: block; max-width: 500px; color: rgba(231, 255, 252, .78); font-size: 15px; line-height: 1.8; }
.login-proof-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.login-proof-grid div { min-height: 98px; padding: 14px; border: 1px solid rgba(204, 251, 241, .2); border-radius: 8px; background: rgba(255, 255, 255, .08); backdrop-filter: blur(10px); }
.login-proof-grid b, .login-proof-grid span { display: block; color: rgba(231, 255, 252, .72); font-size: 12px; }
.login-proof-grid strong { display: block; margin: 10px 0 8px; color: #fff; font-size: 22px; }
.login-form-panel { display: grid; place-items: center; padding: 40px; }
.login-card { width: min(420px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 24px 60px rgba(15, 118, 110, .12); }
.login-kicker { color: var(--teal-800); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.login-card h2 { margin: 10px 0 8px; color: #092f2d; font-size: 26px; }
.login-card p { margin: 0 0 24px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.login-card label { display: grid; gap: 7px; margin-bottom: 14px; color: #315654; font-size: 13px; font-weight: 700; }
.login-card input[type="text"], .login-card input[type="password"] { width: 100%; height: 42px; border: 1px solid #bfe3df; border-radius: 7px; padding: 0 12px; color: var(--text); background: #f8fffe; outline: none; }
.login-card input:focus { border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(20, 184, 166, .14); }
.login-options { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 2px 0 18px; color: var(--muted); font-size: 12px; }
.login-options label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; }
.login-options input { accent-color: var(--teal-500); }
.login-options a { color: var(--teal-800); text-decoration: none; font-weight: 700; }
.login-card button { width: 100%; height: 42px; border-color: var(--teal-500); background: var(--teal-500); color: #043331; font-weight: 800; cursor: pointer; }
.login-card button:disabled { opacity: .6; cursor: wait; }
.login-message { min-height: 20px; margin-top: 10px; color: #c2410c; font-size: 12px; }
.login-card small { display: block; margin-top: 12px; color: var(--muted); text-align: center; font-size: 12px; }
.app-shell { min-height: 100vh; min-width: 1008px; display: grid; grid-template-columns: 248px minmax(760px, 1fr); }
.sidebar { background: var(--teal-950); color: #d8fffb; padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 17px; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, #2dd4bf, #22d3ee); color: #073635; }
.nav-label { margin: 14px 10px 6px; color: rgba(216,255,251,.54); font-size: 11px; }
.nav-item { height: 38px; border-radius: 7px; display: flex; align-items: center; gap: 10px; padding: 0 10px; color: rgba(255,255,255,.78); text-decoration: none; font-size: 13px; }
.nav-item.active, .nav-item:hover { background: rgba(45, 212, 191, .22); color: #fff; }
.nav-icon { width: 18px; height: 18px; position: relative; flex: 0 0 18px; }
.nav-icon::before, .nav-icon::after { content: ""; position: absolute; box-sizing: border-box; }
.icon-dashboard::before { inset: 4px 2px; border: 1.8px solid currentColor; border-radius: 3px; }
.icon-dashboard::after { width: 6px; height: 1.8px; left: 6px; bottom: 2px; background: currentColor; border-radius: 999px; }
.icon-ad::before { inset: 3px 2px; border: 1.8px solid currentColor; border-radius: 3px; }
.icon-ad::after { width: 6px; height: 6px; left: 6px; top: 6px; border-top: 1.8px solid currentColor; border-right: 1.8px solid currentColor; transform: rotate(45deg); }
.icon-creative::before { inset: 3px 2px; border: 1.8px solid currentColor; border-radius: 3px; }
.icon-creative::after { left: 7px; top: 6px; width: 0; height: 0; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 6px solid currentColor; }
.icon-board::before { inset: 3px 2px 5px; border: 1.8px solid currentColor; border-radius: 3px; }
.icon-board::after { left: 4px; bottom: 2px; width: 10px; height: 8px; border-left: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; box-shadow: 4px -3px 0 -2px currentColor, 8px -6px 0 -2px currentColor; }
.icon-user-flow::before { left: 2px; top: 2px; width: 6px; height: 6px; border: 1.8px solid currentColor; border-radius: 50%; box-shadow: 8px 0 0 -1.8px currentColor, 8px 8px 0 -1.8px currentColor; }
.icon-user-flow::after { left: 6px; top: 6px; width: 8px; height: 8px; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: rotate(-45deg); }
.icon-platform::before { inset: 2px; border: 1.8px solid currentColor; border-radius: 50%; }
.icon-platform::after { width: 16px; height: 1.8px; left: 1px; top: 8px; background: currentColor; }
.icon-funnel::before { left: 2px; top: 3px; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 12px solid currentColor; }
.icon-library::before { inset: 3px 2px; border: 1.8px solid currentColor; border-radius: 3px; }
.icon-library::after { left: 5px; top: 8px; width: 8px; height: 1.8px; background: currentColor; }
.icon-source::before { inset: 4px 2px; border: 1.8px solid currentColor; border-radius: 9px; }
.icon-source::after { left: 7px; top: 7px; width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.icon-rules::before { inset: 2px; border: 1.8px solid currentColor; border-radius: 50%; }
.icon-rules::after { left: 6px; top: 4px; width: 7px; height: 7px; border-top: 1.8px solid currentColor; border-left: 1.8px solid currentColor; transform: rotate(45deg); }
.icon-review::before { inset: 2px 3px; border: 1.8px solid currentColor; border-radius: 3px; }
.icon-review::after { left: 6px; top: 5px; width: 7px; height: 4px; border-left: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: rotate(-45deg); }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px; color: rgba(255,255,255,.66); font-size: 12px; }
.site-filing { min-width: 1008px; padding: 12px 20px; border-top: 1px solid var(--line); background: #fff; text-align: center; font-size: 12px; }
.site-filing a { color: var(--muted); text-decoration: none; }
.site-filing a:hover { color: var(--teal-800); text-decoration: underline; }
body.auth-locked .site-filing { position: fixed; z-index: 10; right: 0; bottom: 0; left: 0; min-width: 0; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); }
.logout-button { width: 100%; height: 30px; margin-top: 10px; border: 1px solid rgba(204,251,241,.24); border-radius: 7px; background: rgba(255,255,255,.06); color: #d8fffb; cursor: pointer; }
.logout-button:hover { background: rgba(45,212,191,.18); }
.workspace { min-width: 0; overflow: auto; }
.topbar { height: 66px; position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 18px; background: rgba(255,255,255,.9); border-bottom: 1px solid var(--line); }
.topbar.is-hidden { display: none; }
h1 { margin: 0; font-size: 20px; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
select, button, input[type="date"] { height: 34px; border: 1px solid #bfe3df; background: #f8fffe; border-radius: 7px; color: var(--teal-800); padding: 0 10px; }
.control-static { height: 34px; border: 1px solid #bfe3df; background: #f8fffe; border-radius: 7px; color: var(--teal-800); padding: 0 10px; display: inline-flex; align-items: center; font-size: 12px; }
.content { padding: 12px 18px 16px; }
.recommendation, .kpi-card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.recommendation { padding: 10px 12px; margin-bottom: 10px; display: flex; justify-content: space-between; gap: 12px; background: linear-gradient(90deg, #e6fffb, #f8fffe); color: #164e4b; font-size: 13px; }
.recommendation b { color: var(--teal-800); }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi-card { padding: 14px; min-height: 104px; }
.kpi-card small { display: block; color: var(--muted); margin-bottom: 10px; }
.kpi-card strong { display: block; font-size: 26px; color: #092f2d; }
.kpi-card span { display: inline-flex; margin-top: 10px; color: #0d9488; font-size: 12px; }
.dashboard-grid { display: grid; grid-template-columns: 1.05fr 1.5fr; gap: 14px; margin-bottom: 14px; }
.lower-grid { display: grid; grid-template-columns: 1.4fr .9fr; gap: 14px; }
.panel { padding: 14px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.panel h2 { margin: 0; font-size: 15px; }
.panel-head span { color: var(--muted); font-size: 12px; }
.segment-row { display: grid; grid-template-columns: 68px 1fr 58px; gap: 10px; align-items: center; margin: 10px 0; color: #345b59; font-size: 12px; }
.track { height: 12px; background: #e1f3f0; border-radius: 999px; overflow: hidden; }
.track i { display: block; height: 100%; background: var(--teal-500); }
.table-row { display: grid; grid-template-columns: 1.2fr .7fr .7fr .7fr .75fr; gap: 8px; padding: 9px 10px; border-radius: 7px; background: #f7fbfb; color: #315654; align-items: center; font-size: 12px; cursor: pointer; }
.table-row + .table-row { margin-top: 6px; }
.table-row.header { background: #e7f7f5; color: var(--teal-800); font-weight: 700; cursor: default; }
.badge { border-radius: 999px; padding: 4px 8px; text-align: center; background: var(--teal-100); color: var(--teal-800); font-size: 11px; }
.badge.warn { background: #fff7ed; color: #c2410c; }
.funnel-chart { height: 190px; display: flex; align-items: end; gap: 10px; padding: 18px 0 28px; }
.funnel-bar { flex: 1; min-width: 28px; background: linear-gradient(180deg, #2dd4bf, #99f6e4); border-radius: 6px 6px 0 0; position: relative; }
.funnel-bar span { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 11px; white-space: nowrap; }
.diagnosis-item { border: 1px solid var(--line); border-radius: 7px; padding: 10px; color: #315654; background: #fbfefe; font-size: 12px; }
.diagnosis-item + .diagnosis-item { margin-top: 10px; }
.diagnosis-item b { color: var(--teal-800); }
.view-grid { display: grid; gap: 12px; margin-bottom: 14px; }
.view-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.view-table { display: grid; gap: 6px; }
.view-row { display: grid; gap: 8px; align-items: center; padding: 9px 10px; border-radius: 7px; background: #f7fbfb; color: #315654; font-size: 12px; }
.view-head { background: #e7f7f5; color: var(--teal-800); font-weight: 700; }
.plan-table-wrap { overflow-x: auto; padding-bottom: 2px; }
.plan-view-table { min-width: max-content; }
.plan-view-row { min-width: max-content; }
.plan-view-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sortable-head { display: inline-flex; align-items: center; justify-content: space-between; gap: 4px; min-width: 0; }
.sort-button { width: 20px; height: 20px; display: inline-grid; place-items: center; border: 1px solid #bfe3df; border-radius: 5px; background: #f8fffe; color: var(--muted); padding: 0; font-size: 11px; cursor: pointer; }
.sort-button.active { background: var(--teal-100); color: var(--teal-800); border-color: #5eead4; }
.plan-total-row { position: sticky; bottom: 0; z-index: 1; background: #e8fbf8; color: var(--teal-800); font-weight: 700; border: 1px solid #bfe3df; box-shadow: 0 -6px 14px rgba(15, 118, 110, .08); }
.local-filters { display: flex; gap: 10px; flex-wrap: wrap; }
.local-filters label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.local-filters select, .local-filters input { min-width: 170px; }
.plan-filter-panel { margin-bottom: 14px; }
.active-filter { position: relative; align-self: end; display: inline-flex; align-items: center; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.filter-chip { height: 32px; display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: #315654; padding: 0 8px; cursor: pointer; }
.filter-chip span { color: var(--muted); font-size: 12px; }
.filter-chip b { color: var(--text); font-size: 13px; font-weight: 700; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remove-filter { width: 26px; height: 26px; border: 0; border-left: 1px solid #edf4f3; border-radius: 0 7px 7px 0; background: transparent; color: var(--muted); cursor: pointer; }
.filter-value-menu { display: none; position: absolute; top: 38px; left: 0; z-index: 7; width: 360px; max-height: 520px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 14px 36px rgba(15, 118, 110, .16); }
.filter-value-menu.open { display: block; }
.filter-tip { display: flex; justify-content: space-between; align-items: center; color: #315654; font-size: 13px; margin-bottom: 8px; }
.filter-tip button { width: 24px; height: 24px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.filter-option-search { width: 100%; height: 34px; margin-bottom: 8px; border: 1px solid #d8e3e1; border-radius: 7px; color: var(--text); }
.filter-selected-count { text-align: right; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.filter-option-list { display: grid; max-height: 360px; overflow: auto; gap: 2px; }
.filter-option { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 10px !important; min-height: 34px; padding: 0 8px; border-radius: 7px; color: #315654 !important; font-size: 13px !important; cursor: pointer; }
.filter-option:hover { background: #f3f7f6; }
.filter-option input { min-width: auto !important; accent-color: #4f6df5; }
.add-filter-wrap { position: relative; align-self: end; }
.add-filter-button { height: 34px; border: 0; background: transparent; color: #2563eb; font-weight: 700; cursor: pointer; padding: 0 10px; }
.filter-menu { display: none; position: absolute; top: 38px; left: 0; z-index: 6; width: 280px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 14px 36px rgba(15, 118, 110, .16); }
.filter-menu.open { display: block; }
.filter-menu input { width: 100%; height: 34px; margin-bottom: 8px; border: 1px solid #d8e3e1; border-radius: 7px; color: var(--text); }
.filter-menu-list { display: grid; max-height: 280px; overflow: auto; gap: 2px; }
.filter-menu-list button, .filter-menu-list span { min-height: 34px; border: 0; border-radius: 7px; background: #fff; color: #315654; text-align: left; padding: 0 10px; font-size: 13px; }
.filter-menu-list button:hover { background: #f3f7f6; }
.metric-picker { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: stretch; margin: -2px 0 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fbfefe; }
.metric-fields { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; min-width: 0; }
.metric-picker-title { height: 22px; line-height: 22px; color: var(--teal-800); font-weight: 700; font-size: 12px; white-space: nowrap; }
.metric-group { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding-right: 6px; border-right: 1px solid #d7eeeb; }
.metric-group:last-child { border-right: 0; }
.metric-group strong { color: var(--teal-800); font-size: 12px; margin-right: 2px; white-space: nowrap; }
.metric-group label { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 6px; border: 1px solid #bfe3df; border-radius: 999px; color: #315654; background: #fff; font-size: 11px; cursor: pointer; }
.metric-group input { accent-color: var(--teal-500); }
.plan-table-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 328px; border-left: 1px solid #d7eeeb; padding-left: 10px; }
.plan-table-tools label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.plan-table-tools select { min-width: 76px; height: 28px; }
.plan-table-tools button, .plan-pagination button { height: 28px; border: 1px solid #bfe3df; border-radius: 7px; background: #f8fffe; color: var(--teal-800); padding: 0 10px; cursor: pointer; }
.plan-table-tools button { background: var(--teal-100); font-weight: 700; }
.plan-table-tools .ghost-tool { background: #ffffff; color: var(--muted); font-weight: 600; }
.plan-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.plan-pagination div { display: flex; align-items: center; gap: 8px; }
.plan-pagination button:disabled { opacity: .45; cursor: not-allowed; }
.breakdown-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
.breakdown-panel .plan-table-wrap { max-height: 320px; overflow: auto; }
.behavior-page { display: grid; gap: 14px; margin: -2px -6px 0; background: #f3f5f8; padding: 8px; min-width: 0; max-width: 100%; overflow: hidden; }
.behavior-panel { min-width: 0; max-width: 100%; min-height: 230px; background: #fff; border: 1px solid #edf0f4; border-radius: 4px; padding: 14px 18px 22px; box-shadow: 0 1px 2px rgba(16, 47, 46, .03); overflow: hidden; }
.behavior-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.behavior-panel-head h2 { margin: 0 0 10px; color: #1f2937; font-size: 15px; font-weight: 700; }
.behavior-panel-head p { margin: 0; color: #1f2937; font-size: 13px; word-spacing: 8px; }
.behavior-actions { display: inline-flex; align-items: center; gap: 10px; color: #4b5563; font-size: 12px; white-space: nowrap; }
.behavior-actions span { color: #6b7280; font-size: 16px; line-height: 1; }
.behavior-actions b { color: #374151; font-weight: 600; }
.behavior-table-wrap { width: 100%; max-width: 100%; min-width: 0; overflow: auto; border: 1px solid #e1e5ea; max-height: 268px; }
.behavior-table { width: max-content; min-width: 100%; border-collapse: collapse; color: #1f2937; font-size: 12px; table-layout: fixed; }
.behavior-table th, .behavior-table td { min-width: 108px; height: 24px; padding: 4px 8px; border-right: 1px solid #dfe3e8; border-bottom: 1px solid #dfe3e8; text-align: center; vertical-align: middle; white-space: pre-line; }
.behavior-table th { background: #f7f8fb; color: #263241; font-weight: 700; position: sticky; top: 0; z-index: 1; }
.behavior-table th::after { content: "↕"; margin-left: 4px; color: #b8c0cc; font-size: 10px; }
.behavior-table td:first-child, .behavior-table th:first-child { min-width: 150px; }
.behavior-table td.negative { color: #d93025; }
.behavior-table a, .behavior-table td:nth-child(3), .behavior-table td:nth-child(4) { text-decoration: underline; text-underline-offset: 2px; }
.campaign-pivot .behavior-table td:first-child { min-width: 260px; }
.retention-table .behavior-table td:nth-child(3) { background: #2f80ed; color: #fff; font-weight: 700; text-decoration: none; }
.retention-table .behavior-table td:nth-child(4) { background: #cfe2ff; text-decoration: none; }
.retention-table .behavior-table td:nth-child(5), .retention-table .behavior-table td:nth-child(6), .retention-table .behavior-table td:nth-child(7) { background: #e8f1ff; }
.platform-view-row { grid-template-columns: .8fr .75fr .65fr .65fr .65fr .65fr .8fr .55fr; }
.platform-card p, .connection-card p { margin: 8px 0 0; color: #315654; font-size: 13px; }
.funnel-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.funnel-step { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fbfefe; }
.funnel-step b, .funnel-step span, .funnel-step small { display: block; }
.funnel-step strong { display: block; margin: 8px 0; font-size: 22px; color: #092f2d; }
.funnel-step span, .funnel-step small { color: var(--muted); font-size: 12px; line-height: 1.6; }
.creative-library { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.creative-card { border: 1px solid var(--line); border-radius: 8px; background: #fbfefe; padding: 12px; cursor: pointer; }
.creative-card:hover { border-color: var(--teal-500); box-shadow: 0 8px 24px rgba(15, 118, 110, .1); }
.creative-card h3 { margin: 0 0 8px; font-size: 15px; color: var(--text); }
.creative-card p { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.creative-card div { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: #315654; font-size: 12px; }
.creative-code { position: relative; color: #076b66; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; font-weight: 800; cursor: pointer; }
.creative-preview { display: none !important; position: fixed; z-index: 1000; width: 240px; height: 150px; padding: 5px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: 0 14px 34px rgba(5, 63, 61, .22); pointer-events: none; }
.creative-code:hover .creative-preview { display: block !important; }
.creative-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.material-player-modal { display: none; position: fixed; inset: 0; z-index: 1200; align-items: center; justify-content: center; padding: 28px; background: rgba(3, 31, 30, .82); }
.material-player-modal.open { display: flex; }
.material-player-shell { width: min(1100px, 94vw); max-height: 92vh; overflow: auto; border: 1px solid rgba(255,255,255,.22); border-radius: 8px; background: #062f2d; box-shadow: 0 26px 70px rgba(0,0,0,.38); }
.material-player-shell header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; color: #fff; }
.material-player-shell header small { color: #8de4dc; font-size: 12px; }
.material-player-shell header h2 { margin: 3px 0 0; font-size: 18px; }
.material-player-shell header button { border: 1px solid rgba(255,255,255,.35); border-radius: 6px; background: transparent; color: #fff; padding: 7px 12px; cursor: pointer; }
.material-player-shell video { display: block; width: 100%; max-height: calc(92vh - 70px); background: #000; }
.material-upload-panel { margin-bottom: 12px; }
.material-upload-form { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(180px, 1fr) minmax(220px, 1.4fr) 110px; gap: 10px; align-items: end; }
.material-upload-form label { display: grid; gap: 6px; min-width: 0; }
.material-upload-form label > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.material-upload-form select, .material-upload-form input { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 0 10px; color: var(--text); }
.material-file-field input { padding: 6px; }
.material-asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.material-asset-card { display: grid; grid-template-columns: 92px 1fr auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 9px; background: #fbfefe; }
.material-thumb { width: 92px; height: 58px; border-radius: 6px; overflow: hidden; display: grid; place-items: center; background: #e7f7f5; color: var(--muted); font-size: 11px; }
.material-thumb img { width: 100%; height: 100%; object-fit: cover; }
.material-asset-card h3, .material-asset-card p { margin: 0; }
.material-asset-card p { margin-top: 7px; color: var(--muted); font-size: 12px; }
.settings-list { display: grid; gap: 10px; }
.settings-list div { display: grid; grid-template-columns: 160px 120px 1fr; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fbfefe; }
.settings-list b { color: var(--text); }
.settings-list strong { color: var(--teal-800); font-size: 18px; }
.settings-list span { color: var(--muted); font-size: 12px; }

.knowledge-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.knowledge-form-panel { margin-bottom: 14px; }
.panel-head > div > p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.knowledge-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.knowledge-form label { display: grid; gap: 6px; color: #315654; font-size: 12px; font-weight: 700; }
.knowledge-form label > span { min-height: 16px; }
.knowledge-form input:not([type="checkbox"]), .knowledge-form select, .knowledge-form textarea,
.review-complete-form input, .review-complete-form select, .review-complete-form textarea { width: 100%; border: 1px solid #bfe3df; border-radius: 7px; background: #f8fffe; color: var(--text); padding: 9px 10px; outline: none; }
.knowledge-form input:not([type="checkbox"]), .knowledge-form select { height: 38px; }
.knowledge-form textarea { min-height: 78px; resize: vertical; font: inherit; }
.knowledge-form input:focus, .knowledge-form select:focus, .knowledge-form textarea:focus,
.review-complete-form input:focus, .review-complete-form select:focus, .review-complete-form textarea:focus { border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(20, 184, 166, .12); }
.knowledge-form .span-2 { grid-column: span 2; }
.check-field { display: flex !important; align-items: center; align-self: end; gap: 8px !important; min-height: 38px; }
.check-field input { accent-color: var(--teal-500); }
.check-field span { min-height: auto !important; }
.primary-action { align-self: end; height: 38px; border-color: var(--teal-500); background: var(--teal-500); color: #043331; font-weight: 800; cursor: pointer; }
.knowledge-list { display: grid; gap: 10px; }
.rule-card, .review-card { padding: 14px; border: 1px solid var(--line); border-left: 4px solid #94a3b8; border-radius: 8px; background: #fbfefe; }
.rule-card.status-active { border-left-color: #14b8a6; }
.rule-card.status-draft, .review-card.status-open { border-left-color: #f59e0b; }
.review-card.status-reviewed { border-left-color: #0ea5e9; }
.knowledge-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.knowledge-card-head > div { display: flex; align-items: center; gap: 9px; }
.knowledge-card-head h3 { margin: 0; color: #123f3c; font-size: 14px; }
.knowledge-card-head small { color: var(--muted); text-align: right; }
.status-pill { display: inline-flex; padding: 3px 7px; border-radius: 999px; background: #e2e8f0; color: #475569; font-size: 10px; white-space: nowrap; }
.status-pill.active, .status-pill.reviewed { background: #ccfbf1; color: #0f766e; }
.status-pill.draft, .status-pill.open, .status-pill.pending { background: #fef3c7; color: #b45309; }
.rule-expression { display: flex; align-items: center; gap: 14px; margin: 12px 0; padding: 11px 12px; border-radius: 7px; background: #eaf8f6; color: #315654; }
.rule-expression code { color: #0f766e; font-weight: 800; }
.rule-expression strong { color: #123f3c; }
.knowledge-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.knowledge-meta span { padding: 3px 7px; border-radius: 5px; background: #f1f5f4; color: #52706e; font-size: 11px; }
.knowledge-note { margin: 10px 0 0; color: #52706e; font-size: 12px; line-height: 1.6; white-space: pre-wrap; }
.knowledge-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 10px; }
.knowledge-actions button, .review-complete-form button { height: 30px; cursor: pointer; font-size: 11px; }
.knowledge-actions .danger-link { border-color: #fecaca; background: #fff7f7; color: #b91c1c; }
.review-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.review-columns > div { padding: 10px; border-radius: 7px; background: #f4faf9; }
.review-columns b { color: #0f766e; font-size: 11px; }
.review-columns p { margin: 5px 0 0; color: #345b59; font-size: 12px; line-height: 1.6; white-space: pre-wrap; }
.review-complete-form { display: grid; grid-template-columns: 1fr 2fr 130px 150px 90px; gap: 8px; align-items: center; margin-top: 12px; padding: 10px; border-radius: 7px; background: #fffaf0; }
.review-complete-form textarea { min-height: 56px; resize: vertical; font: inherit; }
.review-complete-form .check-field { align-self: center; }
.review-complete-form button { height: 38px; border-color: var(--teal-500); background: var(--teal-500); color: #043331; font-weight: 800; }
.source-import-box { min-height: 72px; border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: #fbfefe; }
.source-import-box b { display: block; margin-bottom: 6px; color: var(--text); }
.source-import-box span { color: var(--muted); font-size: 12px; line-height: 1.6; }
.import-button { height: 34px; min-width: 104px; border: 1px solid #5eead4; border-radius: 7px; background: var(--teal-100); color: var(--teal-800); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; cursor: pointer; }
.import-message { margin-top: 10px; border: 1px solid #bfe3df; border-radius: 7px; background: #ecfffb; color: var(--teal-800); padding: 9px 12px; font-size: 12px; }
.source-import-list { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.source-import-head, .source-import-row { display: grid; grid-template-columns: minmax(160px, 1.4fr) .45fr 1fr .8fr 52px; gap: 10px; align-items: center; padding: 9px 12px; border-bottom: 1px solid #e7f0ef; font-size: 12px; }
.source-import-head { background: #e7f7f5; color: var(--teal-800); font-weight: 700; }
.source-import-head span { color: var(--muted); font-weight: 500; }
.source-import-row span:first-child { color: var(--text); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-import-row span { color: #315654; }
.source-delete-button { height: 28px; border: 1px solid #f3b6b2; border-radius: 6px; background: #fff7f6; color: #a33b34; font-size: 12px; cursor: pointer; }
.source-delete-button:hover { background: #ffebe8; }
.source-empty { padding: 14px; color: var(--muted); font-size: 12px; }
.source-mapping-note { margin-top: 12px; }
.period-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.period-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: center; }
.period-card .panel-head { margin-bottom: 0; display: block; }
.period-card .panel-head h2 { font-size: 18px; margin-bottom: 8px; }
.period-card .panel-head span { font-size: 12px; }
.metric-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.metric-pair .kpi-card { min-height: 66px; padding: 9px 10px; }
.metric-pair .kpi-card small { margin-bottom: 5px; font-size: 11px; }
.metric-pair .kpi-card strong { font-size: 20px; }
.metric-pair .kpi-card span { margin-top: 5px; font-size: 11px; }
.rank-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.rank-table { display: grid; gap: 7px; }
.rank-row { display: grid; grid-template-columns: 42px 1.25fr .7fr .7fr .7fr; gap: 8px; align-items: center; padding: 7px 9px; border-radius: 7px; background: #f7fbfb; color: #315654; font-size: 12px; }
.rank-row.head { background: #e7f7f5; color: var(--teal-800); font-weight: 700; }
.rank-no { width: 24px; height: 24px; border-radius: 7px; background: var(--teal-100); color: var(--teal-800); display: grid; place-items: center; font-weight: 700; }
.trend-band { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 10px; }
.chart-legend { display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: 12px; }
.chart-legend i { display: inline-block; width: 18px; height: 8px; border-radius: 999px; margin-right: 6px; background: #2dd4bf; vertical-align: middle; }
.chart-legend .line-key { height: 3px; background: var(--teal-800); }
.combo-chart { height: 154px; position: relative; padding: 28px 10px 24px; }
.combo-plot { height: 102px; display: flex; align-items: end; gap: 11px; position: relative; z-index: 1; }
.combo-bar { flex: 1; min-width: 18px; border-radius: 7px 7px 0 0; background: linear-gradient(180deg,#2dd4bf,#99f6e4); position: relative; }
.combo-bar b { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); color: #064744; font-size: 11px; white-space: nowrap; background: rgba(255,255,255,.72); border: 1px solid rgba(255,255,255,.75); border-radius: 999px; padding: 2px 6px; }
.combo-bar span { position: absolute; bottom: -21px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 11px; white-space: nowrap; }
.roas-line { position: absolute; inset: 28px 10px 24px; z-index: 2; pointer-events: none; }
.roas-line svg { width: 100%; height: 102px; overflow: visible; }
.dense-30 { padding-inline: 8px; }
.dense-30 .combo-plot { gap: 4px; }
.dense-30 .combo-bar { min-width: 8px; border-radius: 5px 5px 0 0; }
.dense-30 .combo-bar b { bottom: 6px; font-size: 9px; padding: 1px 4px; }
.dense-30 .combo-bar span { bottom: -20px; font-size: 10px; }
.dense-30 .roas-line { inset-inline: 8px; }
.dense-30 .roas-line text { font-size: 10px; stroke-width: 3px; }
.dense-30 .roas-line circle { r: 4px; }
.home-summary-bar { align-items: center; }
.inline-select { height: 26px; border: 1px solid #bfe3df; background: #f8fffe; border-radius: 6px; color: var(--teal-800); padding: 0 7px; margin: 0 3px; }
.roas-line path { fill: none; stroke: var(--teal-800); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.roas-line circle { fill: #fff; stroke: var(--teal-800); stroke-width: 3; }
.roas-line text { fill: var(--teal-800); font-size: 12px; font-weight: 800; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.roas-label-bg { fill: #fff; stroke: #99f6e4; stroke-width: 1.5px; rx: 9px; }
.todo-list { display: grid; gap: 10px; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(5, 63, 61, .08); opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 4; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.detail-drawer { position: fixed; top: 0; right: 0; width: 560px; max-width: 92vw; height: 100vh; background: white; border-left: 1px solid var(--line); box-shadow: -18px 0 40px rgba(15, 118, 110, .16); transform: translateX(105%); transition: transform .2s ease; z-index: 5; padding: 18px; overflow: auto; }
.detail-drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; }
.drawer-head h2 { margin: 0; font-size: 18px; }
.drawer-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.drawer-close { cursor: pointer; }
.drawer-section { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 12px; background: #fff; }
.drawer-section h3 { margin: 0 0 10px; font-size: 14px; color: var(--text); }
.conclusion-card { background: linear-gradient(90deg, #e6fffb, #f8fffe); }
.conclusion-card p { margin: 0; color: #164e4b; line-height: 1.6; font-size: 13px; }
.drawer-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.drawer-metrics div { border: 1px solid var(--line); border-radius: 7px; padding: 9px; background: #fbfefe; }
.drawer-metrics small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.drawer-metrics b { font-size: 17px; color: #092f2d; }
.drawer-table { display: grid; gap: 6px; }
.drawer-table-row { display: grid; grid-template-columns: 1fr .8fr .8fr .55fr .7fr; gap: 8px; align-items: center; padding: 8px; border-radius: 7px; background: #f7fbfb; color: #315654; font-size: 12px; }
@media (max-width: 1100px) { .material-upload-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.drawer-header { background: #e7f7f5; color: var(--teal-800); font-weight: 700; }
.plan-row { grid-template-columns: 1fr .8fr .75fr .55fr .55fr .55fr .5fr; }
@media (max-width: 920px) {
  body { overflow-x: auto; }
  .app-shell { grid-template-columns: 248px minmax(760px, 1fr); }
  .dashboard-grid, .lower-grid { grid-template-columns: 1fr; }
}
