/* Demo 04 layout: v1 concept (onboarding, ¥50k two-channel store, three-step funnel).
   Forked from demo3.css; the d3- class prefix is kept so both demos stay diffable.
   Visual language comes from anyboost-ui.css; keep page-specific rules here. */

* { box-sizing: border-box; }
body.d3-body { margin: 0; background: var(--ab-canvas); color: var(--ab-ink); font-family: var(--ab-font); font-size: var(--ab-text-body); line-height: 1.6; }
/* :where keeps this reset at element specificity so component classes can set color. */
:where(.d3-body) button, :where(.d3-body) input { font: inherit; color: inherit; }
.d3-body button { cursor: pointer; }
.d3-body :focus-visible { outline: none; box-shadow: var(--ab-focus); }
.d3-body [hidden] { display: none !important; }
.d3-body small { display: block; }
.d3-body .ab-stat-value small, .d3-band b small { display: inline; }
.d3-skip { position: fixed; top: -100px; left: 16px; z-index: 50; padding: 10px 16px; border-radius: var(--ab-radius-xs); background: var(--ab-ink); color: #fff; }
.d3-skip:focus { top: 12px; }

.d3-shell { --sidebar-w: 216px; --chat-w: 380px; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--chat-w); height: 100dvh; min-height: 620px; }
.d3-shell.is-collapsed { --sidebar-w: 64px; }
.d3-shell.is-chat-closed, .d3-shell.is-chat-unavailable { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.is-chat-closed .d3-chat, .is-chat-unavailable .d3-chat, .is-chat-unavailable .d3-chat-toggle { display: none; }
.d3-shell.is-resizing { cursor: col-resize; user-select: none; }

/* Sidebar */
.d3-sidebar { display: flex; flex-direction: column; min-width: 0; padding: 16px 12px; border-right: 1px solid var(--ab-border); background: var(--ab-field); overflow: hidden; }
.d3-brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 40px; padding-left: 4px; }
.d3-brand-logo { display: block; width: auto; height: 38px; }
.d3-icon-button { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--ab-subtle); }
.d3-icon-button:hover { background: #eef2f7; color: var(--ab-ink); }
.d3-icon-button svg, .d3-nav-item svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.d3-sidebar-bottom small { margin-top: 1px; color: var(--ab-faint); font-size: 10.5px; font-weight: 500; }
.d3-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 26px; height: 26px; border-radius: 7px; background: var(--ab-ink); color: #fff; font-size: 11.5px; font-weight: 750; }
.d3-nav { display: grid; gap: 4px; margin-top: 16px; }
.d3-nav-item { position: relative; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #5f6a79; font-size: 13px; font-weight: 500; text-align: left; white-space: nowrap; }
.d3-nav-item svg { flex: 0 0 auto; }
.d3-nav-item:hover { background: #eef2f7; color: #2f3742; }
.d3-nav-item.is-active { border-color: var(--ab-border); background: var(--ab-surface); color: var(--ab-ink); font-weight: 600; box-shadow: var(--ab-shadow-xs); }
.d3-sidebar-footer { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--ab-border); }
.d3-nav-ai { width: 100%; }
.d3-nav-divider { display: block; height: 1px; margin: 7px 4px; background: var(--ab-border); }
.d3-count { margin-left: auto; padding: 0 6px; border-radius: var(--ab-radius-pill); background: var(--ab-primary-soft); color: var(--ab-primary); font-size: 10px; font-weight: 700; line-height: 1.7; }
.d3-store { position: relative; margin-top: 18px; }
.d3-sidebar-bottom { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px; text-align: left; transition: border-color var(--ab-ease); border: 1px solid var(--ab-border); border-radius: 10px; background: transparent; color: #2f3742; font-size: 12px; font-weight: 600; white-space: nowrap; }

.is-collapsed .d3-sidebar { padding-inline: 10px; }
.is-collapsed .d3-label, .is-collapsed .d3-brand-logo { display: none; }
.is-collapsed .d3-brand { justify-content: center; }
.is-collapsed .d3-nav { margin-top: 16px; }
.is-collapsed .d3-nav-item { justify-content: center; padding: 0; }
.is-collapsed .d3-sidebar { position: relative; z-index: 5; overflow: visible; }
.is-collapsed .d3-nav-item::before { content: attr(aria-label); position: absolute; top: 50%; left: calc(100% + 12px); padding: 5px 10px; border-radius: 8px; background: var(--ab-ink); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; box-shadow: var(--ab-shadow-sm); opacity: 0; pointer-events: none; transform: translate(-4px, -50%); transition: opacity .15s ease, transform .15s ease; }
.is-collapsed .d3-nav-item:hover::before, .is-collapsed .d3-nav-item:focus-visible::before { opacity: 1; transform: translate(0, -50%); }
.is-collapsed .d3-sidebar-bottom { justify-content: center; padding: 0; border: 0; background: transparent; box-shadow: none; }

/* Chat */
.d3-chat { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid var(--ab-border); background: var(--ab-surface); }
.d3-resizer { position: absolute; top: 0; bottom: 0; left: -5px; z-index: 6; width: 9px; cursor: col-resize; touch-action: none; }
.d3-resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 1px; background: transparent; transition: background var(--ab-ease), width var(--ab-ease); }
.d3-resizer:hover::after, .d3-resizer:focus-visible::after, .is-resizing .d3-resizer::after { left: 3px; width: 3px; background: var(--ab-primary); }
.d3-resizer:focus-visible { box-shadow: none; }
.d3-header-actions { display: flex; flex-shrink: 0; align-items: center; gap: 10px; white-space: nowrap; }
.d3-chat-toggle { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px 0 12px; border: 0; border-radius: var(--ab-radius-pill); background: var(--ab-ink); color: #fff; font-size: 12.5px; font-weight: 700; transition: background var(--ab-ease); }
.d3-chat-toggle:hover { background: #2f3742; }
.d3-chat-toggle svg, .d3-period-button svg { width: 15px; height: 15px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.d3-period { position: relative; }
.d3-period-button { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px 0 12px; border: 1px solid var(--ab-border-strong); border-radius: var(--ab-radius-pill); background: var(--ab-surface); color: var(--ab-ink); font-size: 12.5px; font-weight: 650; box-shadow: var(--ab-shadow-xs); transition: border-color var(--ab-ease); }
.d3-period-button:hover, .d3-period-button[aria-expanded="true"] { border-color: var(--ab-subtle); }
.d3-period-button > svg:first-child { color: var(--ab-subtle); }
.d3-period-chevron { color: var(--ab-subtle); transition: transform var(--ab-ease); }
.d3-period-button[aria-expanded="true"] .d3-period-chevron { transform: rotate(180deg); }
.d3-period-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 10; min-width: 220px; margin: 0; padding: 6px; border: 1px solid var(--ab-border); border-radius: var(--ab-radius-sm); background: var(--ab-surface); box-shadow: var(--ab-shadow-hover); list-style: none; }
.d3-period-menu li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 10px; border-radius: 8px; color: var(--ab-ink); font-size: 12.5px; font-weight: 650; cursor: pointer; outline: none; }
.d3-period-menu li span { color: var(--ab-subtle); font-size: 11.5px; font-weight: 500; }
.d3-period-menu li:hover, .d3-period-menu li:focus { background: var(--ab-panel); }
.d3-period-menu li[aria-selected="true"] { color: var(--ab-primary); }
.d3-panel-header { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; height: 48px; padding: 0 12px; border-bottom: 1px solid var(--ab-border); }
.d3-chat-content { flex: 1; padding: 20px 20px 12px; overflow-y: auto; background: var(--ab-canvas); scroll-behavior: smooth; }
.d3-chat-date { margin: 0 0 20px; color: var(--ab-faint); font-size: 11px; font-weight: 700; text-align: center; }
.d3-user-message { width: fit-content; max-width: 86%; margin: 0 0 18px auto; border-radius: 16px 16px 4px 16px; }
.d3-assistant { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
.d3-assistant-body { min-width: 0; padding: 12px 14px; border: 1px solid var(--ab-border); border-radius: 4px 16px 16px 16px; background: var(--ab-surface); font-size: 13px; line-height: 1.85; box-shadow: var(--ab-shadow-xs); overflow-wrap: anywhere; }
.d3-assistant-body p { margin: 0 0 10px; }
.d3-assistant-body p:last-child { margin-bottom: 0; }
.d3-assistant-body strong { font-weight: 800; }
.d3-insight { display: flex; align-items: center; gap: 10px; width: 100%; margin: 4px 0 12px; padding: 10px 12px; border: 1px solid var(--ab-border); text-align: left; font-size: 12.5px; font-weight: 750; transition: border-color var(--ab-ease); }
.d3-insight:hover { border-color: var(--ab-primary); }
.d3-insight small { margin-top: 1px; color: var(--ab-subtle); font-size: 11px; font-weight: 600; }
.d3-insight-icon { display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: var(--ab-surface); color: var(--ab-primary); }
.d3-insight-icon { width: 30px; height: 30px; box-shadow: var(--ab-shadow-xs); }
.d3-insight-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.d3-reply-action { margin-top: 10px; min-height: 30px; font-size: 12px; }
.d3-insight-arrow { margin-left: auto; color: var(--ab-subtle); }
.d3-composer-area { flex: 0 0 auto; padding: 14px 18px 12px; border-top: 1px solid var(--ab-border); background: var(--ab-surface); }
.d3-demo-note { margin: 9px 0 0; color: var(--ab-faint); font-size: 10px; text-align: center; }

/* Workspace */
.d3-workspace { position: relative; min-width: 0; overflow-y: auto; background: var(--ab-canvas); }
.d3-view { max-width: 1040px; margin: 0 auto; padding: 32px 36px 28px; }
.d3-page-heading { display: flex; margin-bottom: 22px; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 16px; }
.d3-page-title { margin: 0 0 4px; font-size: var(--ab-text-heading); font-weight: 800; letter-spacing: -.035em; line-height: 1.25; }
.d3-page-heading p:last-child { margin: 0; color: var(--ab-muted); font-size: 14px; }

.d3-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0 8px 14px; padding: 2px 0 14px; border-bottom: 1px solid var(--ab-border); }
.d3-kpi { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 4px 16px; border-left: 1px solid var(--ab-border); }
.d3-kpi:first-child { padding-left: 0; border-left: 0; }
.d3-kpi dd { margin: 0; }
.d3-delta { margin-left: 8px; color: #3fae86; font-size: 11.5px; font-weight: 700; letter-spacing: 0; vertical-align: 3px; }

/* Home: weekly notice, tabs and bento dashboard */
.d3-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-bottom: 16px; padding: 14px 16px 14px 18px; border: 1px solid var(--ab-border); border-radius: var(--ab-radius-lg); background: var(--ab-surface); box-shadow: var(--ab-shadow-xs); }
.d3-notice:empty { display: none; }
.d3-notice.is-question { border-color: rgba(31, 99, 233, .22); background: linear-gradient(100deg, var(--ab-primary-soft), #f7fbff 70%); }
.d3-notice-body { display: grid; flex: 1 1 260px; gap: 2px; min-width: 0; }
.d3-notice p { margin: 0; }
.d3-notice-label { color: var(--ab-primary); font-size: 11px; font-weight: 850; letter-spacing: .12em; }
.d3-notice-text { color: var(--ab-ink); font-size: 14.5px; font-weight: 800; line-height: 1.5; }
.d3-notice-meta { color: var(--ab-muted); font-size: 12px; }
.d3-notice-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.d3-notice-check { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: #e8f8f1 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23078a65' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat; }
.d3-home-tabs { margin-bottom: 16px; }
.d3-budget-chip { gap: 8px; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.d3-budget-chip span { color: var(--ab-muted); font-size: 10.5px; font-weight: 700; }
.d3-segmented button[aria-selected="true"] { background: var(--ab-surface); color: var(--ab-ink); box-shadow: var(--ab-shadow-xs); }
.d3-home-panel { container-type: inline-size; }
.d3-bento { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.d3-bento-wide { grid-column: 1 / -1; }
.d3-bento-card { display: flex; flex-direction: column; gap: 14px; min-width: 0; margin: 0; padding: 18px 20px; }
.d3-bento-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.d3-bento-head h2 { margin: 0; font-size: 14px; font-weight: 800; }
.d3-bento-sub { margin: -8px 0 0; color: var(--ab-muted); font-size: 12px; }
.d3-hero-figure { display: flex; align-items: baseline; gap: 6px; margin: 0; color: var(--ab-muted); font-size: 14px; font-weight: 700; }
.d3-hero-figure strong { color: var(--ab-ink); font-size: 46px; font-weight: 850; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.d3-hero-bar { height: 8px; }
.d3-hero-note { margin: 0; color: var(--ab-muted); font-size: 13px; line-height: 1.7; }
.d3-verdict { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; font-weight: 800; }
.d3-verdict.is-good { color: var(--ab-positive); }
.d3-verdict-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(8, 169, 120, .14); }
.d3-simple-facts { display: grid; gap: 0; margin: 0; }
.d3-simple-facts > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 0 12px; padding: 10px 0; border-top: 1px solid var(--ab-border); }
.d3-simple-facts dt { color: var(--ab-muted); font-size: 12.5px; font-weight: 650; }
.d3-simple-facts dd { margin: 0; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.d3-simple-facts small { grid-column: 2; color: var(--ab-subtle); font-size: 11px; text-align: right; }
.d3-pro-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; padding: 16px 4px; }
.d3-pro-kpi { display: grid; align-content: start; gap: 3px; min-width: 0; padding: 0 16px; border-left: 1px solid var(--ab-border); }
.d3-pro-kpi:first-child { border-left: 0; }
.d3-pro-kpi dd { margin: 0; font-size: 24px; }
.d3-pro-kpi small { color: var(--ab-subtle); font-size: 11px; line-height: 1.5; }
.d3-landing { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; }
.d3-landing-chart { display: grid; gap: 12px; min-width: 0; }
.d3-landing-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin: 0; }
.d3-landing-stats > div { display: grid; gap: 2px; min-width: 0; }
.d3-landing-stats dt { color: var(--ab-muted); font-size: 11.5px; font-weight: 700; }
.d3-landing-stats dd { margin: 0; font-size: 21px; font-weight: 850; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.d3-landing-stats small { color: var(--ab-subtle); font-size: 11px; line-height: 1.5; }
.d3-landing-stats .is-gap dd { color: #b86b00; }
.d3-chart { display: block; width: 100%; height: auto; overflow: visible; }
.d3-chart-grid { stroke: var(--ab-border); stroke-width: 1; }
.d3-chart-axis { fill: var(--ab-subtle); font-size: 10px; font-weight: 600; }
.d3-chart-note { fill: var(--ab-muted); font-size: 10.5px; font-weight: 700; }
.d3-chart-note.is-strong { fill: var(--ab-primary); font-weight: 800; }
.d3-chart-target { stroke: var(--ab-subtle); stroke-width: 1.2; stroke-dasharray: 3 4; }
.d3-chart-today { stroke: var(--ab-border-strong); stroke-width: 1; stroke-dasharray: 2 3; }
.d3-chart-line { fill: none; stroke: var(--ab-primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.d3-chart-line.is-forecast { stroke-dasharray: 5 5; opacity: .75; }
.d3-chart-dot { fill: var(--ab-primary); stroke: #fff; stroke-width: 2; }
.d3-chart-dot.is-forecast { fill: #fff; stroke: var(--ab-primary); }
.d3-chart-hit { fill: transparent; cursor: crosshair; }
.d3-chart-hit:hover { fill: rgba(31, 99, 233, .14); }
.d3-chart-event { stroke: var(--ab-connector); stroke-width: 1.2; stroke-dasharray: 3 3; }
.d3-chart-badge circle { fill: #fff; stroke: var(--ab-primary); stroke-width: 1.5; }
.d3-chart-badge text { fill: var(--ab-primary); font-size: 10px; font-weight: 850; }
.d3-scenario { display: grid; align-content: start; gap: 10px; padding: 16px; border-radius: var(--ab-radius-md); background: var(--ab-panel); }
.d3-scenario h3 { margin: 0; font-size: 13px; font-weight: 800; }
.d3-scenario-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.d3-scenario-table th { padding: 0 0 6px; color: var(--ab-subtle); font-size: 11px; font-weight: 700; text-align: left; }
.d3-scenario-table th:nth-child(2), .d3-scenario-table th:last-child { text-align: right; }
.d3-scenario-table td { padding: 8px 0; border-top: 1px solid var(--ab-border-strong); font-weight: 650; }
.d3-scenario-table td:last-child { padding-left: 12px; text-align: right; }
.d3-scenario-table tr.is-pick td { color: var(--ab-primary); font-weight: 800; }
.d3-scenario-note { margin: 0; color: var(--ab-muted); font-size: 11.5px; line-height: 1.7; }
.d3-scenario .ab-btn { justify-self: start; }
.d3-meter { display: grid; grid-template-columns: 76px minmax(0, 1fr) 40px; align-items: center; gap: 2px 12px; }
.d3-meter-label { color: var(--ab-muted); font-size: 12.5px; font-weight: 650; }
.d3-meter b { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.d3-meter small { grid-column: 2 / -1; color: var(--ab-subtle); font-size: 11px; font-variant-numeric: tabular-nums; }
.d3-meter-bar { height: 8px; }
.d3-meter-bar.is-time::after { background: #a9b6c6; }
.d3-meter-bar.is-spend::after { background: var(--ab-ink); }
.d3-meter-bar.is-kpi::after { background: var(--ab-primary); }
.d3-insight-note { margin: auto 0 0; padding: 10px 12px; border-radius: var(--ab-radius-sm); background: var(--ab-panel); color: var(--ab-muted); font-size: 12px; line-height: 1.75; }
.d3-insight-note b { display: block; color: var(--ab-ink); font-weight: 800; }
.d3-channel-list { display: grid; }
.d3-channel-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, .5fr) minmax(0, .8fr); align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--ab-border); font-size: 12.5px; }
.d3-channel-row.is-head { padding-top: 0; border-top: 0; color: var(--ab-subtle); font-size: 11px; font-weight: 700; }
.d3-channel-row.is-head span:not(:first-child) { text-align: right; }
.d3-channel-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 750; white-space: nowrap; }
.d3-channel-cpa { font-weight: 800; }
.d3-channel-cpa.is-under { color: var(--ab-positive); }
.d3-channel-cpa.is-over { color: var(--ab-negative); }
.d3-outcome-list { display: grid; margin: 0; padding: 0; list-style: none; }
.d3-outcome { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto auto; align-items: center; gap: 4px 14px; padding: 11px 8px; border-top: 1px solid var(--ab-border); border-radius: 0; }
.d3-outcome.is-link { cursor: pointer; }
.d3-outcome.is-link:hover { background: var(--ab-field); }
.d3-outcome-index { display: grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid var(--ab-primary); border-radius: 50%; color: var(--ab-primary); font-size: 10.5px; font-weight: 850; }
.d3-outcome-index.is-skip { border-color: var(--ab-border-strong); color: var(--ab-subtle); }
.d3-outcome-main { display: grid; min-width: 0; }
.d3-outcome-main strong { font-size: 13.5px; font-weight: 750; }
.d3-outcome-main small { color: var(--ab-subtle); font-size: 11.5px; }
.d3-outcome-delta { margin: 0; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.d3-outcome-delta span { color: var(--ab-muted); }
.d3-outcome-delta s { color: var(--ab-subtle); }
.d3-outcome-delta b { font-weight: 800; }
@container (max-width: 700px) {
  .d3-landing { grid-template-columns: 1fr; }
  .d3-outcome { grid-template-columns: 24px minmax(0, 1fr); }
  .d3-outcome > .d3-outcome-delta, .d3-outcome > .d3-status { grid-column: 2; justify-self: start; }
}
@container (max-width: 600px) {
  .d3-bento { grid-template-columns: 1fr; }
  .d3-landing-stats dd { font-size: 18px; }
  .d3-pro-kpis { grid-template-columns: 1fr; row-gap: 14px; }
  .d3-pro-kpi { padding: 0 12px; border-left: 0; }
  .d3-pro-kpi dd { font-size: 20px; }
  .d3-outcome .d3-status { white-space: normal; }
}

/* Funnel */
.d3-funnel-card { padding: 12px 12px 16px; }
.d3-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 4px 8px 14px; }
.d3-card-head .ab-card__title { margin: 0; }
.d3-funnel-wrap { position: relative; padding: 24px 24px 24px 28px; overflow: hidden; }
.d3-funnel-glow { top: 50%; left: 30%; width: 520px; aspect-ratio: 1; transform: translate(-50%, -50%); }
.d3-funnel { position: relative; display: grid; gap: 4px; }
.d3-stage { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: stretch; min-height: 74px; padding: 0; border: 0; border-radius: 14px; background: transparent; text-align: left; }
.d3-step-1 { min-height: 86px; --t: 0%; --b: 6%; }
.d3-step-2 { --t: 6%; --b: 12%; }
.d3-step-3 { --t: 12%; --b: 18%; }
.d3-step-4 { --t: 18%; --b: 24%; }
.d3-step-5 { --t: 24%; --b: 30%; }
.d3-band { gap: 2px; transition: filter var(--ab-ease); }
.d3-band > span { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; opacity: .82; }
.d3-band b { display: flex; align-items: baseline; gap: 3px; font-size: 20px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.d3-band b small { font-size: 11px; font-weight: 700; opacity: .8; }
.d3-stage:hover .d3-band { filter: brightness(.97) saturate(1.1); }
.d3-annotation { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; margin: 6px 0 6px 24px; padding: 8px 14px; border: 1px solid transparent; border-radius: var(--ab-radius-sm); transition: background var(--ab-ease), border-color var(--ab-ease), box-shadow var(--ab-ease); }
.d3-annotation::before { content: ""; position: absolute; top: 50%; left: -24px; width: 20px; border-top: 1.2px dashed var(--ab-connector); }
.d3-annotation::after { content: ""; position: absolute; top: calc(50% - 3px); left: -7px; width: 6px; height: 6px; border: 1.2px solid var(--ab-connector); border-radius: 50%; background: var(--ab-canvas); }
.d3-stage:hover .d3-annotation { background: rgba(255, 255, 255, .7); }
.d3-stage.is-selected .d3-annotation { border-color: rgba(31, 99, 233, .35); background: var(--ab-surface); box-shadow: var(--ab-shadow-sm); }
.d3-stage.is-selected .d3-annotation::before { border-top-style: solid; border-top-color: var(--ab-primary); }
.d3-stage.is-selected .d3-annotation::after { border-color: var(--ab-primary); background: var(--ab-primary); }
.d3-rate { color: var(--ab-muted); font-size: 12.5px; font-weight: 650; }
.d3-rate b { color: var(--ab-ink); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.d3-channels { display: flex; flex-wrap: wrap; gap: 8px; }
.d3-opportunity { display: inline-flex; white-space: nowrap; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--ab-radius-pill); background: #fff4e5; color: #9a5b00; font-size: 10.5px; font-weight: 800; }
.d3-opportunity::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ab-accent); }
.d3-caption { margin: 12px 0 0; color: var(--ab-faint); font-size: 11px; text-align: center; }

/* Stage detail */
.d3-detail { margin: 16px -12px -16px; padding: 18px 20px 20px; border-top: 1px solid var(--ab-border); container-type: inline-size; }
@container (max-width: 620px) {
  .d3-proposal-card { grid-template-columns: 1fr; }
  .d3-proposal-card > .d3-actions { flex-wrap: wrap; }
}
.d3-detail-subhead { margin: 0; color: var(--ab-ink); font-size: 13px; font-weight: 800; }
.d3-detail-proposals { display: grid; gap: 10px; }
.d3-allocation + .d3-detail-proposals { margin-top: 18px; }
.d3-proposal-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 20px; padding: 16px 18px; border: 1px solid var(--ab-border-strong); border-radius: var(--ab-radius-md); background: var(--ab-surface); box-shadow: 0 1px 2px rgba(23, 25, 29, .04), 0 8px 20px rgba(23, 53, 95, .07); transition: border-color var(--ab-ease), box-shadow var(--ab-ease), transform var(--ab-ease); }
.d3-proposal-card:hover { border-color: #cfd9e6; box-shadow: 0 2px 4px rgba(23, 25, 29, .05), 0 14px 30px rgba(23, 53, 95, .10); transform: translateY(-1px); }
.d3-proposal-main { min-width: 0; }
.d3-proposal-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.d3-proposal-top h4 { flex: 1 1 200px; margin: 0; font-size: 14.5px; font-weight: 800; line-height: 1.5; }
.d3-proposal-evidence { margin: 8px 0 0; color: var(--ab-muted); font-size: 12.5px; line-height: 1.7; }
.d3-proposal-card > .d3-actions { flex-wrap: nowrap; margin-top: 0; }
.d3-issue-id { margin-right: 6px; color: var(--ab-subtle); font-weight: 600; }
.d3-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.d3-facts div { display: inline-flex; gap: 5px; padding: 3px 9px; border-radius: var(--ab-radius-pill); background: var(--ab-panel); font-size: 11.5px; }
.d3-facts dt { color: var(--ab-subtle); font-weight: 600; }
.d3-facts dd { margin: 0; color: var(--ab-ink); font-weight: 750; }
.d3-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.d3-btn-text { min-height: 36px; padding: 0 8px; background: transparent; color: var(--ab-muted); }
.d3-btn-text:hover { color: var(--ab-ink); }
.d3-allocation { padding: 14px 16px; }
.d3-allocation-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 10px; }
.d3-allocation-head h4 { margin: 0; font-size: 13px; font-weight: 800; }
.d3-allocation-head span { color: var(--ab-subtle); font-size: 11.5px; font-weight: 600; }
.d3-allocation-list { display: grid; gap: 9px; }
.d3-allocation-row { display: grid; grid-template-columns: 16px 88px minmax(0, 1fr) 76px 112px; align-items: center; gap: 10px; font-size: 12.5px; }
.d3-allocation-name { font-weight: 700; }
.d3-allocation-row b { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.d3-allocation-meta { color: var(--ab-subtle); font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* Status */
.d3-status { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--ab-radius-pill); font-size: 11px; font-weight: 750; white-space: nowrap; }
.d3-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.d3-status.is-pending { background: #fff4e5; color: #9a5b00; }
.d3-status.is-testing { background: var(--ab-primary-soft); color: var(--ab-primary); }
.d3-status.is-done { background: #e6f6ef; color: var(--ab-positive); }
.d3-status.is-rolledback, .d3-status.is-dismissed { background: var(--ab-panel); color: var(--ab-muted); }

/* Proposals: toolbar, issue list, board, detail */
.d3-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.d3-segmented { display: inline-flex; padding: 3px; border-radius: var(--ab-radius-pill); background: var(--ab-panel); }
.d3-segmented button { height: 28px; padding: 0 14px; border: 0; border-radius: var(--ab-radius-pill); background: transparent; color: var(--ab-muted); font-size: 12.5px; font-weight: 700; }
.d3-segmented button[aria-pressed="true"] { background: var(--ab-surface); color: var(--ab-ink); box-shadow: var(--ab-shadow-xs); }
.d3-select { height: 32px; padding: 0 30px 0 12px; border: 1px solid var(--ab-border-strong); border-radius: var(--ab-radius-pill); background: var(--ab-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4.5 6.5 3.5 3.5 3.5-3.5' fill='none' stroke='%238a97a8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 10px center / 14px no-repeat; color: var(--ab-ink); font: inherit; font-size: 12.5px; font-weight: 650; appearance: none; }
.d3-issues { padding: 0; overflow: hidden; }
.d3-issue-tabs { display: flex; gap: 4px; padding: 10px 16px; border-bottom: 1px solid var(--ab-border); background: var(--ab-field); }
.d3-issue-tabs button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ab-muted); font-size: 13px; font-weight: 650; }
.d3-issue-tabs button[aria-pressed="true"] { color: var(--ab-ink); font-weight: 800; }
.d3-count-pill { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: var(--ab-radius-pill); background: var(--ab-track); color: var(--ab-muted); font-size: 11px; font-weight: 750; line-height: 1.7; text-align: center; }
.d3-issue-row { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 14px 20px; border: 0; border-bottom: 1px solid var(--ab-border); background: var(--ab-surface); text-align: left; }
.d3-issue-row:last-child { border-bottom: 0; }
.d3-issue-row:hover { background: var(--ab-field); }
.d3-issue-row > .ab-impact, .d3-issue-row > .d3-issue-id { margin-left: auto; }
.d3-issue-row > .ab-impact { margin-top: 1px; }
.d3-issue-icon { flex: 0 0 auto; width: 14px; height: 14px; margin-top: 3px; border: 2px solid currentColor; border-radius: 50%; }
.d3-issue-icon.is-pending { color: #e09a1a; }
.d3-issue-icon.is-testing { color: var(--ab-primary); border-style: dashed; }
.d3-issue-icon.is-done { color: var(--ab-positive); background: var(--ab-positive); box-shadow: inset 0 0 0 2px #fff; }
.d3-issue-icon.is-rolledback, .d3-issue-icon.is-dismissed { color: var(--ab-faint); }
.d3-issue-body { display: grid; gap: 3px; min-width: 0; }
.d3-issue-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--ab-ink); font-size: 14px; font-weight: 750; }
.d3-tag { padding: 0 8px; border: 1px solid var(--ab-border-strong); border-radius: var(--ab-radius-pill); color: var(--ab-muted); font-size: 10.5px; font-weight: 700; line-height: 1.8; }
.d3-issue-meta { color: var(--ab-subtle); font-size: 12px; }

/* Proposals — おすすめ: one card at a time, answered with yes / no */
.d3-focus { display: grid; justify-items: center; gap: 14px; padding: 6px 0 24px; }
.d3-focus-meter { display: grid; gap: 8px; width: min(560px, 100%); }
.d3-focus-meter p { display: flex; justify-content: space-between; margin: 0; color: var(--ab-subtle); font-size: 12px; font-weight: 650; }
.d3-focus-meter b { color: var(--ab-ink); font-variant-numeric: tabular-nums; }
.d3-focus-meter .ab-bar { height: 4px; }
.d3-focus-stack { position: relative; display: grid; width: min(560px, 100%); }
.d3-focus-peek { position: absolute; inset: 14px 16px -10px; border-radius: var(--ab-radius-xl); background: #b9dcfb; }
.d3-focus-card { position: relative; z-index: 1; display: grid; gap: 16px; padding: 24px 24px 16px; border: 0; border-radius: var(--ab-radius-xl); background: linear-gradient(165deg, #45aaf5 0%, #3793f1 40%, #1c5fe0 100%); box-shadow: 0 24px 48px rgba(38, 118, 220, .24), 0 2px 6px rgba(38, 118, 220, .12); color: #fff; text-align: left; transform: translateX(var(--dx, 0px)) rotate(var(--rot, 0deg)); transition: transform .28s ease, opacity .28s ease; animation: d3-focus-in .32s ease-out; touch-action: pan-y; cursor: grab; user-select: none; }
.d3-focus-card.is-dragging { transition: none; cursor: grabbing; }
.d3-focus-card.is-leaving { opacity: 0; pointer-events: none; }
@keyframes d3-focus-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.d3-focus-stamp { position: absolute; top: 18px; right: 18px; z-index: 2; padding: 3px 12px; border: 2px solid currentColor; border-radius: 8px; background: #fff; font-size: 15px; font-weight: 850; letter-spacing: .04em; pointer-events: none; }
.d3-focus-stamp.is-yes { color: var(--ab-positive); opacity: var(--yes, 0); transform: rotate(8deg); }
.d3-focus-stamp.is-no { color: var(--ab-muted); opacity: var(--no, 0); transform: rotate(-8deg); }
.d3-focus-top { display: flex; align-items: center; gap: 8px; margin-bottom: -8px; font-size: 12px; }
.d3-focus-top .d3-issue-id { color: rgba(255, 255, 255, .85); }
.d3-focus-top .ab-impact { border-color: transparent; }
.d3-focus-goal { margin: 0 0 -12px; color: rgba(255, 255, 255, .88); font-size: 14px; font-weight: 700; }
.d3-focus-title { margin: 0; text-wrap: balance; font-size: 23px; font-weight: 800; letter-spacing: -.02em; line-height: 1.4; }
.d3-focus-facts { display: grid; margin: 0; border-radius: var(--ab-radius-md); background: var(--ab-surface); color: var(--ab-ink); box-shadow: 0 8px 20px rgba(20, 80, 180, .14); overflow: hidden; }
.d3-focus-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 14px; padding: 14px 18px; }
.d3-focus-row dt { justify-self: start; padding: 3px 9px; border-radius: var(--ab-radius-pill); font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.d3-focus-row dd { display: grid; gap: 1px; margin: 0; line-height: 1.5; }
.d3-focus-row.is-now dt { background: #fff1e8; color: #b5480f; }
.d3-focus-row.is-now dd span { color: var(--ab-muted); font-size: 13px; font-weight: 600; }
.d3-focus-row.is-now dd strong { font-size: 16px; font-weight: 800; }
.d3-focus-row.is-result { border-top: 1px solid var(--ab-border); background: #f5f9ff; }
.d3-focus-row.is-result dt { background: var(--ab-primary-soft); color: var(--ab-primary); }
.d3-focus-row.is-result dd { color: var(--ab-primary); font-size: 19px; font-weight: 850; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.d3-focus-question { margin: 2px 0 -6px; color: #fff; font-size: 13.5px; font-weight: 750; text-align: center; }
.d3-focus-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.d3-choice { display: grid; justify-items: center; align-content: center; gap: 1px; min-height: 58px; padding: 10px; border: 1.5px solid rgba(255, 255, 255, .9); border-radius: var(--ab-radius-md); background: transparent; color: #fff; font-size: 15px; font-weight: 800; transition: transform var(--ab-ease), background var(--ab-ease), border-color var(--ab-ease), box-shadow var(--ab-ease); }
.d3-choice small { color: #fff; font-size: 11px; font-weight: 700; }
.d3-choice:hover { border-color: #fff; transform: translateY(-1px); }
.d3-choice--yes { border-color: #fff; background: #fff; color: var(--ab-ink); box-shadow: 0 10px 22px rgba(20, 80, 180, .22); }
.d3-choice--yes small { color: var(--ab-primary); }
.d3-choice--yes:hover { background: #f4f9ff; }
.d3-choice:disabled { cursor: default; transform: none; }
.d3-focus-more { justify-self: center; height: 30px; padding: 0 10px; border: 0; background: transparent; color: rgba(255, 255, 255, .9); font-size: 12.5px; font-weight: 700; }
.d3-focus-more::after { content: " →"; }
.d3-focus-more:hover { color: #fff; }
.d3-choice:focus-visible, .d3-focus-more:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: none; }
.d3-focus-hint { margin: 0; color: var(--ab-faint); font-size: 11px; }
.d3-focus-done { display: grid; justify-items: center; gap: 10px; width: min(560px, 100%); padding: 48px 24px 40px; border-radius: var(--ab-radius-xl); text-align: center; animation: d3-focus-in .32s ease-out; }
.d3-focus-done h2 { margin: 6px 0 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.d3-focus-done > p { margin: 0; color: var(--ab-muted); font-size: 13.5px; }
.d3-focus-done-icon { width: 60px; height: 60px; border-radius: 50%; background: #e8f8f1 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23078a65' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 30px no-repeat; }
.d3-focus-summary { display: flex; gap: 8px; margin: 4px 0 0; }
.d3-focus-done .d3-actions { justify-content: center; margin-top: 8px; }
.d3-board { display: grid; grid-template-columns: repeat(4, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.d3-lane { display: grid; align-content: start; gap: 8px; min-height: 240px; padding: 10px; border-radius: var(--ab-radius-md); background: var(--ab-panel); }
.d3-lane-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; }
.d3-lane-head h2 { margin: 0; font-size: 13px; font-weight: 800; }
.d3-lane-head .d3-issue-icon { margin-top: 0; }
.d3-lane-head .d3-count-pill { margin-left: auto; background: var(--ab-surface); }
.d3-board-card { display: grid; justify-items: start; gap: 6px; width: 100%; padding: 12px 14px; text-align: left; }
.d3-board-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.d3-board-card strong { font-size: 13.5px; font-weight: 750; line-height: 1.5; }
.d3-board-impact { color: var(--ab-positive); font-size: 12px; font-weight: 700; }
.d3-lane-empty { margin: 0; padding: 10px; color: var(--ab-faint); font-size: 12px; text-align: center; }
.d3-back { margin: 0 0 12px; padding: 0; border: 0; background: transparent; color: var(--ab-muted); font-size: 13px; font-weight: 650; }
.d3-back:hover { color: var(--ab-ink); }
.d3-issue-header { margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--ab-border); }
.d3-issue-heading { margin: 0 0 8px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.4; }
.d3-issue-heading .d3-issue-id { font-weight: 500; }
.d3-issue-header .d3-issue-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; }
.d3-issue-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: start; gap: 16px; }
.d3-issue-main { display: grid; gap: 12px; }
.d3-issue-section { padding: 16px 18px; }
.d3-issue-section h3 { margin: 0 0 8px; font-size: 13px; font-weight: 800; }
.d3-issue-section > p { margin: 0; color: var(--ab-muted); font-size: 13px; line-height: 1.8; }
.d3-issue-aside { position: sticky; top: 16px; padding: 16px 18px; }
.d3-side-facts { display: grid; gap: 10px; margin: 0; }
.d3-side-facts div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--ab-border); font-size: 12.5px; }
.d3-side-facts dt { color: var(--ab-subtle); font-weight: 600; }
.d3-side-facts dd { margin: 0; font-weight: 750; text-align: right; }
.d3-issue-aside .d3-actions { display: grid; }
.d3-change-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.d3-change-table th { padding: 6px 8px; border-bottom: 1px solid var(--ab-border); color: var(--ab-subtle); font-size: 11px; font-weight: 700; text-align: left; }
.d3-change-table td { padding: 8px; border-bottom: 1px solid var(--ab-border); vertical-align: top; }
.d3-change-table tr:last-child td { border-bottom: 0; }
.d3-before { color: var(--ab-muted); text-decoration: line-through; text-decoration-color: var(--ab-faint); }
.d3-after { color: var(--ab-ink); font-weight: 750; }
.d3-timeline { display: grid; gap: 10px; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--ab-border); list-style: none; }
.d3-timeline li { position: relative; color: var(--ab-muted); font-size: 12.5px; }
.d3-timeline li::before { content: ""; position: absolute; top: 6px; left: -21px; width: 8px; height: 8px; border-radius: 50%; background: var(--ab-surface); box-shadow: 0 0 0 2px var(--ab-connector); }
.d3-timeline strong { color: var(--ab-ink); font-weight: 750; }
.d3-timeline span { margin-left: 8px; color: var(--ab-faint); font-size: 11.5px; }

/* Confirmation dialog */
.d3-dialog { width: min(520px, calc(100vw - 32px)); padding: 22px; border: 1px solid var(--ab-border); border-radius: var(--ab-radius-lg); background: var(--ab-surface); color: var(--ab-ink); box-shadow: var(--ab-shadow-float); }
.d3-dialog::backdrop { background: rgba(23, 25, 29, .32); }
.d3-dialog h2 { margin: 0 0 6px; font-size: 18px; font-weight: 800; }
.d3-dialog-proposal { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--ab-muted); font-size: 13.5px; font-weight: 650; }
.d3-dialog-facts { display: grid; gap: 10px; margin: 14px 0 0; }
.d3-dialog-facts dt { color: var(--ab-subtle); font-size: 11.5px; font-weight: 700; }
.d3-dialog-facts dd { margin: 2px 0 0; font-size: 13px; line-height: 1.7; }
.d3-dialog-note { margin: 14px 0 0; padding: 10px 12px; border-radius: var(--ab-radius-sm); background: var(--ab-panel); color: var(--ab-muted); font-size: 12px; }
.d3-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
/* Store switcher */
.d3-sidebar-bottom:hover, .d3-sidebar-bottom[aria-expanded="true"] { border-color: var(--ab-border-strong); }
.d3-store-name { display: grid; flex: 1; min-width: 0; }
.d3-store-name > span { overflow: hidden; text-overflow: ellipsis; }
.d3-store-chevron { flex: 0 0 auto; width: 14px; height: 14px; fill: none; stroke: var(--ab-subtle); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.d3-store-menu { position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 20; margin: 0; padding: 6px; border: 1px solid var(--ab-border); border-radius: var(--ab-radius-sm); background: var(--ab-surface); box-shadow: var(--ab-shadow-hover); list-style: none; }
.is-collapsed .d3-store-menu { top: 0; right: auto; left: calc(100% + 10px); width: 240px; }
.d3-store-menu li { display: grid; padding: 8px 10px; border-radius: 8px; color: var(--ab-ink); font-size: 12.5px; font-weight: 650; cursor: pointer; outline: none; }
.d3-store-menu li span { color: var(--ab-subtle); font-size: 11px; font-weight: 500; }
.d3-store-menu li:hover, .d3-store-menu li:focus { background: var(--ab-panel); }
.d3-store-menu li[aria-selected="true"] { color: var(--ab-primary); }
.d3-store-menu .d3-store-add { margin-top: 4px; border-top: 1px solid var(--ab-border); border-radius: 0 0 8px 8px; color: var(--ab-muted); }

/* Toast */
.d3-toast { position: fixed; top: 20px; left: 50%; z-index: 60; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: var(--ab-radius-pill); background: var(--ab-ink); color: #fff; font-size: 13px; font-weight: 600; box-shadow: var(--ab-shadow-hover); transform: translateX(-50%); }

/* Content pages */
#secondary-view:not(.d3-view--chat) { display: grid; align-content: start; gap: 16px; }
#secondary-view > * { min-width: 0; }
#secondary-view > .d3-page-title { margin: 0; }
#secondary-view > .d3-secondary-lead { margin: -12px 0 4px; }
#secondary-view > .d3-toolbar, #secondary-view > .d3-back, #secondary-view > .d3-issue-header { margin-bottom: 0; }
#secondary-view > .d3-back { justify-self: start; }
.d3-page-card { padding: 18px 20px; }
.d3-page-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.d3-page-card-head h2 { margin: 0; font-size: 14px; font-weight: 800; }
.d3-page-card .d3-kpis { margin: 0; padding: 0; border-bottom: 0; }
.d3-page-card .d3-progress + .d3-kpis { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--ab-border); }
.d3-progress { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: 12.5px; }
.d3-progress .ab-bar { height: 8px; }
.d3-progress-label { color: var(--ab-muted); font-weight: 650; font-variant-numeric: tabular-nums; }
.d3-progress b { font-weight: 800; font-variant-numeric: tabular-nums; }
.d3-table-card { padding-bottom: 8px; }
.d3-table-wrap { margin: 0 -8px; overflow-x: auto; }
.d3-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 13px; }
.d3-table th { padding: 8px; color: var(--ab-subtle); font-size: 11px; font-weight: 700; text-align: left; white-space: nowrap; }
.d3-table td { padding: 12px 8px; border-top: 1px solid var(--ab-border); vertical-align: middle; }
.d3-num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.d3-table th:nth-child(n+3):not(:last-child) { text-align: right; }
.d3-table-name { display: flex; align-items: center; gap: 10px; }
.d3-table-name strong { display: block; font-size: 13px; font-weight: 750; }
.d3-table-name small { color: var(--ab-subtle); font-size: 11.5px; }
.d3-table code, .d3-page-card code { padding: 2px 7px; border-radius: 6px; background: var(--ab-panel); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.d3-link { padding: 0; border: 0; background: transparent; color: var(--ab-primary); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.d3-link:hover { text-decoration: underline; }
.d3-muted { color: var(--ab-faint); }
.d3-card-note { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--ab-radius-sm); background: #fff8ec; color: #7a4a00; font-size: 12.5px; line-height: 1.7; }
.d3-asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.d3-asset-card { padding: 12px 12px 16px; }
.d3-asset-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 6px 0; }
.d3-asset-head h3 { margin: 0; font-size: 14px; font-weight: 800; }
.d3-asset-meta { margin: 4px 6px 0; color: var(--ab-muted); font-size: 12px; }
.d3-asset-four { background: linear-gradient(160deg, #b6532c, #e8a15c); color: #fff; }
.d3-asset-video { position: relative; background: linear-gradient(160deg, #1e293b, #0f172a); color: #dbe7ff; }
.d3-asset-photo { background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .55), transparent 40%), linear-gradient(160deg, #e9dccb, #b89c7d); }
.d3-play { position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .92); transform: translate(-50%, -50%); }
.d3-play::after { content: ""; position: absolute; top: 9px; left: 12px; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 9px solid var(--ab-ink); }
.d3-map-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.d3-review-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 12px 14px; border-radius: var(--ab-radius-sm); background: var(--ab-panel); }
.d3-review-score { display: flex; align-items: baseline; gap: 6px; margin: 0; }
.d3-review-score b { color: #c27d00; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.d3-review-score span { color: var(--ab-subtle); font-size: 12px; font-weight: 600; }
.d3-review-facts { display: flex; gap: 20px; margin: 0; }
.d3-review-facts dt { color: var(--ab-subtle); font-size: 11px; font-weight: 700; }
.d3-review-facts dd { margin: 0; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.d3-subhead { margin: 16px 0 2px; font-size: 12.5px; font-weight: 800; }
.d3-keyword-row { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) 48px; align-items: center; gap: 12px; padding: 9px 0; font-size: 13px; }
.d3-keyword { overflow: hidden; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.d3-keyword-row b { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.d3-card-foot { margin: 10px 0 0; color: var(--ab-subtle); font-size: 11.5px; line-height: 1.6; }
.d3-review-row { display: flex; align-items: flex-start; gap: 14px; padding: 12px 0; border-top: 1px solid var(--ab-border); }
.d3-review-row p { margin: 0; font-size: 13px; line-height: 1.7; }
.d3-review-row small { color: var(--ab-subtle); font-size: 11.5px; }
.d3-stars { flex: 0 0 auto; color: #f2a516; font-size: 12px; letter-spacing: 1px; }
.d3-connection-list { display: grid; }
.d3-connection { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--ab-border); }
.d3-connection:first-child { border-top: 0; padding-top: 0; }
.d3-connection strong, .d3-setting-row strong { display: block; font-size: 13px; font-weight: 750; }
.d3-connection small, .d3-setting-row small { display: block; margin-top: 1px; color: var(--ab-subtle); font-size: 11.5px; }
.d3-logo-anybase { background: var(--ab-gradient-ai); color: #fff; font-size: 9.5px; font-weight: 850; }
.d3-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--ab-border); }
.d3-page-card-head + .d3-setting-row { border-top: 0; padding-top: 0; }
.d3-setting-value { color: var(--ab-ink); font-size: 13px; font-weight: 700; text-align: right; }
.d3-mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.d3-mode { display: grid; align-content: start; gap: 4px; padding: 14px; border: 1px solid var(--ab-border); border-radius: var(--ab-radius-md); background: var(--ab-surface); text-align: left; transition: border-color var(--ab-ease), background var(--ab-ease); }
.d3-mode strong { font-size: 13.5px; font-weight: 800; }
.d3-mode small { color: var(--ab-muted); font-size: 12px; line-height: 1.6; }
.d3-mode:hover { border-color: var(--ab-border-strong); }
.d3-mode[aria-pressed="true"] { border-color: rgba(31, 99, 233, .45); background: var(--ab-primary-soft); }
.d3-mode[aria-pressed="true"] strong { color: var(--ab-primary); }
.d3-danger-card { border-color: #f6d4d0; }
.d3-btn-danger { border-color: #f1c6c6; background: #fff; color: #b42318; }
.d3-btn-danger:hover { background: #fff5f4; }

/* AI chat page */
.d3-view--chat { display: flex; flex-direction: column; max-width: 1040px; min-height: 100%; padding-top: 0; padding-bottom: 0; }
.d3-chatpage { display: flex; flex: 1; flex-direction: column; }
.d3-chatpage:not(.has-thread) { justify-content: center; padding: 48px 0 32px; }
.d3-chatpage-hero { margin-bottom: 22px; text-align: center; }
.d3-chatpage-logo { display: block; width: auto; height: 64px; margin: 0 auto; }
.d3-chatpage-title { margin: 14px 0 0; font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.d3-mention-boards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.d3-mention-board { padding: 16px 12px 10px; }
.d3-mention-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px 10px; }
.d3-mention-head h2 { margin: 0; font-size: 14px; font-weight: 800; }
.d3-mention-list { display: grid; gap: 2px; }
.d3-mention-row { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; padding: 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.d3-mention-row:hover, .d3-mention-row:focus-visible { background: var(--ab-panel); }
.d3-mention-row .d3-issue-icon { margin-top: 0; }
.d3-mention-text { display: grid; flex: 1; gap: 2px; min-width: 0; }
.d3-mention-title, .d3-mention-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d3-mention-title { color: var(--ab-ink); font-size: 13.5px; font-weight: 700; }
.d3-mention-text small { color: var(--ab-subtle); font-size: 12px; }
.d3-mention-row .d3-status { padding: 2px 9px; font-size: 11px; }
.d3-mention-when { flex: 0 0 auto; color: var(--ab-faint); font-size: 12px; font-weight: 600; }
.d3-mention-at { display: grid; place-items: center; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 7px; background: var(--ab-surface); color: var(--ab-primary); font-size: 12px; font-weight: 800; opacity: 0; box-shadow: var(--ab-shadow-xs); transition: opacity var(--ab-ease); }
.d3-mention-row:hover .d3-mention-at, .d3-mention-row:focus-visible .d3-mention-at { opacity: 1; }
.d3-chatpage-composer { padding: 14px 12px 10px 16px; border: 1px solid var(--ab-border-strong); border-radius: 24px; background: var(--ab-surface); box-shadow: var(--ab-shadow-sm); transition: border-color var(--ab-ease), box-shadow var(--ab-ease); }
.d3-chatpage-composer:focus-within { border-color: rgba(31, 99, 233, .5); box-shadow: 0 0 0 4px rgba(31, 99, 233, .08), var(--ab-shadow-sm); }
.d3-chatpage-composer textarea { display: block; width: 100%; min-height: 26px; padding: 0; border: 0; background: transparent; color: var(--ab-ink); font: inherit; font-size: 15px; line-height: 1.7; resize: none; outline: none; }
.d3-chatpage-composer.is-large textarea { min-height: 76px; }
.d3-chatpage-composer textarea:focus-visible { box-shadow: none; }
.d3-chatpage-composer textarea::placeholder { color: var(--ab-faint); }
.d3-chatpage-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.d3-suggest-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.d3-suggest { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--ab-border); border-radius: 16px; background: var(--ab-surface); text-align: left; transition: border-color var(--ab-ease), box-shadow var(--ab-ease), transform var(--ab-ease); }
.d3-suggest:hover { border-color: var(--ab-border-strong); box-shadow: var(--ab-shadow-sm); transform: translateY(-1px); }
.d3-suggest-icon { display: grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 10px; background: var(--ab-primary-soft); color: var(--ab-primary); }
.d3-suggest-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.d3-suggest-copy { display: grid; gap: 2px; min-width: 0; }
.d3-suggest-copy strong { font-size: 13.5px; font-weight: 750; }
.d3-suggest-copy small { color: var(--ab-subtle); font-size: 12px; line-height: 1.5; }
.d3-chatpage .d3-demo-note { margin-top: 14px; }
.d3-chatpage.has-thread .d3-thread, .d3-chatpage.has-thread .d3-chatpage-dock { width: 100%; max-width: 800px; margin-inline: auto; }
.d3-chatpage:not(.has-thread) > .d3-chatpage-composer, .d3-chatpage:not(.has-thread) > .d3-suggest-grid { width: 100%; max-width: 800px; margin-inline: auto; }
.d3-thread { display: grid; flex: 1; align-content: start; gap: 22px; padding: 32px 0 24px; }
.d3-thread-user { justify-self: end; max-width: 80%; margin: 0; border-radius: 18px 18px 4px 18px; font-size: 14px; }
.d3-thread-ai { display: flex; align-items: flex-start; gap: 12px; }
.d3-thread-body { flex: 1; min-width: 0; padding-top: 2px; font-size: 14px; line-height: 1.85; }
.d3-thread-body > p { margin: 0 0 10px; }
.d3-thread-body .d3-actions { margin-top: 4px; }
.d3-reply-panel { margin: 4px 0 12px; padding: 14px 16px; }
.d3-reply-panel .d3-kpis { margin: 0 0 14px; padding: 0 0 12px; }
.d3-reply-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 18px; }
.d3-reply-list { margin: 0 0 12px; padding-left: 20px; }
.d3-reply-list li { margin-bottom: 4px; }
.d3-review-source { margin: 0 0 6px; color: var(--ab-muted); font-size: 12.5px; }
.d3-review-draft { margin: 0; font-size: 13px; }
.d3-typing { display: inline-flex; gap: 4px; padding: 10px 0; }
.d3-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ab-faint); animation: d3-typing 1s infinite ease-in-out; }
.d3-typing i:nth-child(2) { animation-delay: .15s; }
.d3-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes d3-typing { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.d3-chatpage-dock { position: sticky; bottom: 0; padding: 14px 0 16px; background: linear-gradient(rgba(251, 252, 254, 0), var(--ab-canvas) 28%); }
.d3-chatpage-dock .d3-demo-note { margin-top: 8px; }
.d3-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; color: var(--ab-faint); font-size: 11.5px; font-weight: 600; }

/* Secondary views */
.d3-secondary-lead { margin: 0 0 24px; color: var(--ab-muted); font-size: 14px; }
.d3-proposals { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.d3-list { display: grid; gap: 10px; }
.d3-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; }
.d3-row strong { font-size: 13.5px; font-weight: 800; }
.d3-row span { color: var(--ab-muted); font-size: 13px; }
.d3-row-sub { display: block; margin-top: 2px; }
.d3-row .d3-row-value { color: var(--ab-ink); font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.d3-row .d3-row-value small { display: inline; margin-left: 4px; color: var(--ab-subtle); font-size: 12px; font-weight: 700; }
.d3-asset-visual { display: flex; align-items: center; justify-content: center; height: 150px; }
.d3-asset-tile { display: flex; flex-direction: column; justify-content: space-between; width: 104px; height: 124px; padding: 10px; border-radius: 13px; box-shadow: 0 8px 18px rgba(23, 25, 29, .14); white-space: pre-line; }
.d3-asset-tile small { font-size: 9.5px; font-weight: 800; letter-spacing: .04em; opacity: .8; }
.d3-asset-tile b { font-size: 13px; line-height: 1.3; letter-spacing: -.02em; }
.d3-asset-one { background: linear-gradient(160deg, #1f63e9, #69cef2); color: #fff; }
.d3-asset-two { background: linear-gradient(165deg, #23262c, #17191d); color: #ffcf6e; }
.d3-asset-three { background: linear-gradient(165deg, #f8ece0, #e9c7a2); color: #5a3a1c; }
.d3-report-row { justify-content: flex-start; }
.d3-report-row > div { flex: 1; min-width: 0; }
.d3-report-icon { flex: 0 0 auto; width: 40px; height: 40px; border-radius: var(--ab-radius-sm); background: var(--ab-primary-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6.5 14.5v-3M10 14.5v-6M13.5 14.5v-4.5' fill='none' stroke='%231f63e9' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center / 22px no-repeat; }
.d3-empty { padding: 28px; color: var(--ab-muted); font-size: 13px; text-align: center; }

/* Demo 04: funnel stays inside ad-measurable stages; 来店 is a locked preview. */
.d3-band--locked { background: repeating-linear-gradient(135deg, #f3f6fa 0 8px, #eaeef4 8px 16px); color: var(--ab-subtle); }
.d3-stage.is-locked .d3-rate { color: var(--ab-subtle); font-size: 12px; }
.d3-stage.is-locked .d3-annotation::after { border-style: dashed; }
.d3-detail-lead { margin: 0 0 14px; color: var(--ab-muted); font-size: 13px; line-height: 1.8; }
.d3-detail-lead b { display: block; color: var(--ab-ink); font-weight: 800; }
.d3-locked { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px 16px; padding: 16px 18px; }
.d3-locked h4 { margin: 0 0 4px; font-size: 13.5px; font-weight: 800; }
.d3-locked p { margin: 0; color: var(--ab-muted); font-size: 12.5px; line-height: 1.75; }
.d3-locked-icon { width: 36px; height: 36px; border-radius: 12px; background: var(--ab-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='4.5' y='9' width='11' height='8' rx='2' fill='none' stroke='%238a97a8' stroke-width='1.5'/%3E%3Cpath d='M7 9V6.5a3 3 0 0 1 6 0V9' fill='none' stroke='%238a97a8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center / 18px no-repeat; box-shadow: var(--ab-shadow-xs); }

/* Proposal confidence */
.d3-focus-row.is-basis { padding-block: 10px; border-top: 1px solid var(--ab-border); }
.d3-focus-row.is-basis dt { background: var(--ab-panel); color: var(--ab-muted); }
.d3-focus-row.is-basis dd { color: var(--ab-muted); font-size: 12.5px; font-weight: 650; }
.d3-focus-row.is-basis dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.d3-focus-row.is-basis b { color: var(--ab-ink); font-size: 13.5px; font-weight: 850; }
.d3-reply-check { padding-left: 22px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23078a65' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") left 4px / 15px no-repeat; color: var(--ab-muted); font-size: 12.5px; }

/* Home: 今週のAIから */
.d3-weekly-lead { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; font-weight: 800; }
.d3-weekly-lead .d3-notice-check { width: 26px; height: 26px; background-size: 15px; }
.d3-weekly-list { display: grid; margin: 0; padding: 0; list-style: none; }
.d3-weekly-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; padding: 12px 0; border-top: 1px solid var(--ab-border); }
.d3-weekly-row > .d3-status { justify-self: start; }
.d3-weekly-row strong { display: block; font-size: 13.5px; font-weight: 750; }
.d3-weekly-row small { color: var(--ab-subtle); font-size: 12px; line-height: 1.6; }
.d3-weekly-row > .ab-btn { min-height: 32px; }
.d3-weekly-meter { display: grid; justify-items: end; gap: 4px; width: 120px; }
.d3-weekly-meter .ab-bar { width: 100%; }
.d3-weekly-meter small { font-variant-numeric: tabular-nums; }

/* Charts and readiness */
.d3-asset-tile { width: 118px; }
.d3-chart-range { fill: rgba(31, 99, 233, .12); stroke: none; }
.d3-chart-bar { fill: var(--ab-primary); opacity: .8; }
.d3-chart-bar:hover { opacity: 1; }
.d3-readiness-list { display: grid; gap: 12px; }
.d3-readiness-row { display: grid; gap: 6px; }
.d3-readiness-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.d3-readiness-head strong { font-size: 12.5px; font-weight: 750; }
.d3-readiness-row small { color: var(--ab-subtle); font-size: 11px; font-variant-numeric: tabular-nums; }
.d3-channel-cpa.is-hold { color: var(--ab-muted); }
.d3-cell-note { color: var(--ab-subtle); font-size: 10.5px; font-weight: 700; }
.d3-status.is-rejected { background: #fdeceb; color: #b42318; }
.d3-logo-mono { background: var(--ab-panel); color: var(--ab-muted); font-size: 8.5px; font-weight: 850; letter-spacing: .02em; }
.d3-table-strong { font-weight: 750; white-space: nowrap; }
.d3-card-note--action { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.d3-card-note--action span { flex: 1 1 280px; }
.d3-mode-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Reports: weekly notification preview */
.d3-notify { max-width: 340px; padding: 14px; border-radius: 18px; background: var(--ab-panel); }
.d3-notify-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.d3-notify-top strong { font-size: 12.5px; font-weight: 800; }
.d3-notify-top small { margin-left: auto; color: var(--ab-subtle); font-size: 11px; }
.d3-notify-body { padding: 12px 14px; border-radius: 4px 16px 16px 16px; background: var(--ab-surface); box-shadow: var(--ab-shadow-xs); font-size: 12.5px; line-height: 1.75; }
.d3-notify-body p { margin: 0; }
.d3-notify-body ul { margin: 6px 0; padding-left: 18px; }
.d3-notify-link { color: var(--ab-primary); font-weight: 750; }

/* Onboarding: full-width guided conversation; sidebar and chat panel step aside. */
/* Extra specificity: the responsive shell rules below must not bring the sidebar column back. */
.d3-body .d3-shell.is-setup { grid-template-columns: minmax(0, 1fr); }
.is-setup .d3-sidebar, .is-setup .d3-chat { display: none; }
.d3-setup { display: flex; flex-direction: column; gap: 18px; max-width: 760px; min-height: 100%; margin: 0 auto; padding: 24px 24px 32px; }
.d3-setup-top { display: flex; align-items: center; gap: 14px; }
.d3-setup-logo { display: block; width: auto; height: 34px; }
.d3-setup-titles { flex: 1; min-width: 0; padding-left: 14px; border-left: 1px solid var(--ab-border); }
.d3-setup-titles h1 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.d3-setup-titles p { margin: 0; color: var(--ab-muted); font-size: 12.5px; }
.d3-setup-skip { white-space: nowrap; }
.d3-setup-steps { display: flex; gap: 6px; margin: 0; padding: 0 0 2px; list-style: none; overflow-x: auto; scrollbar-width: none; }
.d3-setup-steps li { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; height: 28px; padding: 0 12px 0 10px; border-radius: var(--ab-radius-pill); background: var(--ab-panel); color: var(--ab-subtle); font-size: 12px; font-weight: 700; }
.d3-setup-steps li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ab-track); }
.d3-setup-steps li.is-done { background: var(--ab-primary-soft); color: var(--ab-primary); }
.d3-setup-steps li.is-done::before { width: 10px; height: 10px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%231f63e9' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.d3-setup-steps li.is-current { background: var(--ab-ink); color: #fff; }
.d3-setup-steps li.is-current::before { background: var(--ab-cyan); }
.d3-setup-thread { display: grid; flex: 1; align-content: start; gap: 18px; padding-top: 6px; }
.d3-setup-thread .d3-thread-body .ab-panel { margin: 4px 0 4px; }
.d3-setup-answer { display: grid; gap: 14px; margin-left: 38px; padding: 18px 20px; animation: d3-focus-in .32s ease-out; }
.d3-setup-answer > .d3-actions { margin-top: 0; }
.d3-setup-answer > .d3-btn-text { justify-self: start; min-height: 28px; padding: 0; font-size: 12.5px; }
.d3-setup-label { margin: 0 0 8px; color: var(--ab-muted); font-size: 12px; font-weight: 750; }
.d3-setup-hint { margin: 0; color: var(--ab-subtle); font-size: 12px; line-height: 1.7; }
.d3-thread-body .d3-setup-hint { margin-bottom: 0; }
.d3-setup-url-row { display: flex; gap: 8px; }
.d3-setup-url-row input { flex: 1; min-width: 0; height: 42px; padding: 0 14px; border: 1px solid var(--ab-border-strong); border-radius: var(--ab-radius-pill); background: var(--ab-field); color: var(--ab-ink); font: inherit; font-size: 14px; }
.d3-setup-url-row input:focus-visible { border-color: rgba(31, 99, 233, .5); background: var(--ab-surface); }
.d3-setup-url-row .ab-btn { min-height: 42px; padding: 0 20px; }
.d3-choice-group { display: flex; flex-wrap: wrap; gap: 8px; }
.d3-choice-chip { display: grid; align-content: center; justify-items: start; gap: 1px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--ab-border-strong); border-radius: 14px; background: var(--ab-surface); color: var(--ab-ink); font-size: 13.5px; font-weight: 750; text-align: left; transition: border-color var(--ab-ease), background var(--ab-ease), box-shadow var(--ab-ease); }
.d3-choice-chip small { color: var(--ab-subtle); font-size: 10.5px; font-weight: 700; }
.d3-choice-chip:hover { border-color: var(--ab-subtle); }
.d3-choice-chip[aria-pressed="true"] { border-color: var(--ab-primary); background: var(--ab-primary-soft); color: var(--ab-primary); box-shadow: 0 0 0 3px rgba(31, 99, 233, .08); }
.d3-choice-chip[aria-pressed="true"] small { color: var(--ab-primary); }
.d3-setup-facts { display: grid; margin: 0; }
.d3-setup-facts > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-top: 1px solid var(--ab-border); font-size: 13px; }
.d3-setup-facts > div:first-child { border-top: 0; padding-top: 0; }
.d3-setup-facts dt { color: var(--ab-subtle); font-weight: 700; }
.d3-setup-facts dd { margin: 0; font-weight: 750; }
.d3-reply-panel .d3-setup-facts > div { border-top-color: var(--ab-border-strong); }
.d3-setup-source { margin: 10px 0 0; color: var(--ab-subtle); font-size: 11.5px; }
.d3-plan { display: grid; gap: 14px; padding: 16px 18px; }
.d3-plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.d3-plan-head h4 { margin: 0; font-size: 13.5px; font-weight: 800; }
.d3-plan-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 14px; border-radius: var(--ab-radius-sm); background: var(--ab-surface); box-shadow: var(--ab-shadow-xs); }
.d3-plan-text { display: grid; gap: 6px; }
.d3-plan-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0; }
.d3-plan-line strong { font-size: 14px; font-weight: 800; }
.d3-plan-line b { font-size: 16px; font-weight: 850; font-variant-numeric: tabular-nums; }
.d3-plan-text small { color: var(--ab-muted); font-size: 12.5px; line-height: 1.7; }
.d3-plan-estimate { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 12px; padding: 12px 14px; border: 1px dashed rgba(31, 99, 233, .35); border-radius: var(--ab-radius-sm); background: #f7faff; }
.d3-plan-estimate span { color: var(--ab-muted); font-size: 12px; font-weight: 700; }
.d3-plan-estimate strong { color: var(--ab-primary); font-size: 18px; font-weight: 850; font-variant-numeric: tabular-nums; white-space: nowrap; }
.d3-plan-estimate small { grid-column: 1 / -1; color: var(--ab-subtle); font-size: 11.5px; line-height: 1.6; }
.d3-plan-skip .d3-setup-label { margin-bottom: 4px; }
.d3-plan-skip-row { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 12px; margin: 0; padding: 6px 0; font-size: 12.5px; }
.d3-plan-skip-row strong { color: var(--ab-muted); font-weight: 750; text-decoration: line-through; text-decoration-color: var(--ab-faint); }
.d3-plan-skip-row span { color: var(--ab-subtle); }
.d3-setup-creatives { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.d3-creative { position: relative; display: grid; gap: 8px; padding: 8px 8px 12px; border: 1.5px solid var(--ab-border); border-radius: var(--ab-radius-md); background: var(--ab-surface); text-align: left; transition: border-color var(--ab-ease), box-shadow var(--ab-ease); }
.d3-creative:hover { border-color: var(--ab-border-strong); }
.d3-creative::after { content: ""; position: absolute; top: 14px; right: 14px; width: 20px; height: 20px; border: 1.5px solid var(--ab-border-strong); border-radius: 50%; background: var(--ab-surface); }
.d3-creative[aria-pressed="true"] { border-color: var(--ab-primary); box-shadow: 0 0 0 3px rgba(31, 99, 233, .08); }
.d3-creative[aria-pressed="true"]::after { border-color: var(--ab-primary); background: var(--ab-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px no-repeat; }
.d3-creative-visual { display: flex; align-items: center; justify-content: center; height: 150px; padding: 12px; }
.d3-creative-label { padding: 0 4px; font-size: 12.5px; font-weight: 750; }
.d3-search-ad { display: grid; gap: 3px; width: 100%; padding: 12px; border-radius: 10px; background: var(--ab-surface); box-shadow: var(--ab-shadow-xs); }
.d3-search-ad small { color: var(--ab-ink); font-size: 10px; font-weight: 700; }
.d3-search-ad b { color: #1a0dab; font-size: 13px; font-weight: 700; line-height: 1.4; }
.d3-search-ad span { color: var(--ab-muted); font-size: 11px; line-height: 1.5; }
.d3-setup-checks { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.d3-setup-checks li { padding-left: 22px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23078a65' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") left 3px / 15px no-repeat; color: var(--ab-muted); font-size: 12.5px; }
.d3-setup-consent { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--ab-radius-sm); background: #fff8ec; color: #7a4a00; font-size: 12.5px; font-weight: 700; line-height: 1.6; cursor: pointer; }
.d3-setup-consent input { flex: 0 0 auto; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--ab-primary); }
.d3-setup-reading, .d3-setup-timeline { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.d3-setup-reading li { display: flex; align-items: center; gap: 10px; color: var(--ab-faint); font-size: 13px; font-weight: 650; }
.d3-setup-reading li::before, .d3-setup-dot { content: ""; flex: 0 0 auto; width: 16px; height: 16px; border: 1.5px solid var(--ab-border-strong); border-radius: 50%; background: var(--ab-surface); }
.d3-setup-reading li.is-active { color: var(--ab-ink); }
.d3-setup-reading li.is-active::before, .d3-setup-timeline .is-active .d3-setup-dot { border-color: var(--ab-primary); box-shadow: 0 0 0 4px rgba(31, 99, 233, .12); animation: d3-pulse 1.1s ease-in-out infinite; }
.d3-setup-reading li.is-done { color: var(--ab-muted); }
.d3-setup-reading li.is-done::before, .d3-setup-timeline .is-done .d3-setup-dot { border-color: var(--ab-positive); background: var(--ab-positive) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat; }
@keyframes d3-pulse { 50% { box-shadow: 0 0 0 7px rgba(31, 99, 233, .06); } }
.d3-setup-timeline { gap: 0; margin: 4px 0; padding: 12px 14px; border: 1px solid var(--ab-border); border-radius: var(--ab-radius-md); background: var(--ab-surface); }
.d3-setup-timeline li { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 6px 0; }
.d3-setup-timeline li:not(:last-child)::after { content: ""; position: absolute; top: 26px; bottom: -6px; left: 7.5px; width: 1px; background: var(--ab-border-strong); }
.d3-setup-timeline strong { display: block; font-size: 13px; font-weight: 750; line-height: 1.4; }
.d3-setup-timeline small { color: var(--ab-subtle); font-size: 11.5px; }
.d3-setup-timeline .is-done small { color: var(--ab-positive); font-weight: 700; }
.d3-setup-done { margin: 0; font-size: 14px; font-weight: 800; }
.d3-setup > .d3-demo-note { margin: 0; }
@media (max-width: 760px) {
  .d3-setup { gap: 14px; padding: 16px 14px 24px; }
  .d3-setup-logo { height: 28px; }
  .d3-setup-titles { padding-left: 10px; }
  .d3-setup-titles h1 { font-size: 16px; }
  .d3-setup-titles p { display: none; }
  .d3-setup-skip { padding: 0 4px; font-size: 12px; }
  .d3-setup-answer { margin-left: 0; padding: 16px; }
  .d3-setup-url-row { flex-direction: column; }
  .d3-setup-url-row input { font-size: 16px; }
  .d3-setup-facts > div { grid-template-columns: 84px minmax(0, 1fr); }
  .d3-plan { padding: 14px; }
  .d3-plan-skip-row { grid-template-columns: 1fr; gap: 0; }
  .d3-plan-estimate { grid-template-columns: 1fr; }
  .d3-weekly-row { grid-template-columns: minmax(0, 1fr) auto; }
  .d3-weekly-row > .d3-status { grid-column: 1 / -1; }
  .d3-weekly-meter { width: 88px; }
  .d3-locked { grid-template-columns: auto minmax(0, 1fr); }
  .d3-locked > .ab-btn { grid-column: 1 / -1; justify-self: start; }
  .d3-hero-figure { flex-wrap: wrap; }
  .d3-hero-figure strong { font-size: 40px; }
  .d3-simple-facts dt { white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  .d3-setup-answer { animation: none; }
  .d3-setup-reading li.is-active::before, .d3-setup-timeline .is-active .d3-setup-dot { animation: none; }
}

@media (max-width: 1250px) {
  .d3-shell { --sidebar-w: 200px; }
  .d3-view { padding-inline: 24px; }
}

@media (max-width: 1000px) {
  .d3-map-grid { grid-template-columns: 1fr; }
  .d3-issue-layout { grid-template-columns: 1fr; }
  .d3-issue-aside { position: static; }
  .d3-shell, .d3-shell.is-chat-closed, .d3-shell.is-chat-unavailable { --sidebar-w: 64px; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .d3-chat { position: fixed; top: 0; right: 0; bottom: 0; z-index: 20; width: min(400px, calc(100vw - 64px)); box-shadow: var(--ab-shadow-float); }
  .d3-resizer { display: none; }
  .d3-funnel-wrap { padding: 18px 14px 18px 18px; }
  .d3-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .d3-suggest-grid, .d3-mode-grid, .d3-mention-boards { grid-template-columns: 1fr; }
  .d3-chatpage-title { font-size: 22px; }
  .d3-page-card { padding: 16px; }
  .d3-shell, .d3-shell.is-collapsed, .d3-shell.is-chat-closed, .d3-shell.is-chat-unavailable { --sidebar-w: 60px; height: auto; min-height: 100dvh; }
  .d3-sidebar { position: sticky; top: 0; height: 100dvh; padding-inline: 10px; }
  .d3-sidebar .d3-label, .d3-brand-logo, .d3-sidebar .d3-icon-button { display: none; }
  .d3-nav { margin-top: 16px; }
  .d3-store { margin-top: 44px; }
  .d3-nav-item { justify-content: center; padding: 0; }
  .d3-sidebar-bottom { justify-content: center; padding: 0; border: 0; background: transparent; box-shadow: none; }
  .d3-chat { width: calc(100vw - 60px); }
  .d3-chat-toggle > span:last-child { display: none; }
  .d3-chat-toggle { padding: 0 10px; }
  .d3-workspace { overflow: visible; }
  .d3-view { padding: 24px 14px; }
  .d3-page-heading { flex-direction: column; align-items: flex-start; }
  .d3-page-title { font-size: 24px; }
  .d3-kpi { padding: 8px 0; border-left: 0; }
  .d3-kpis { grid-template-columns: 1fr; gap: 4px; }
  .ab-stat-value { font-size: 24px; }
  .d3-funnel-wrap { padding: 14px 8px 14px 10px; }
  .d3-stage { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 70px; }
  .d3-step-1 { min-height: 104px; }
  .d3-band b { font-size: 16px; }
  .d3-band > span { font-size: 10.5px; }
  .d3-annotation { margin-left: 14px; padding: 6px 8px; }
  .d3-annotation::before { left: -14px; width: 12px; }
  .d3-rate { font-size: 11px; }
  .d3-rate b { font-size: 12.5px; }
  .d3-channels { gap: 6px; }
  .d3-channels .ab-logo--sm { width: 26px; height: 26px; }
  .d3-channels .ab-logo--sm::before { inset: 6px; }
  .d3-proposal-card { grid-template-columns: 1fr; }
  .d3-proposal-card > .d3-actions { flex-wrap: wrap; }
  .d3-allocation-row { grid-template-columns: 16px minmax(0, 1fr) auto; }
  .d3-allocation-row .ab-bar, .d3-allocation-meta { grid-column: 2 / -1; }
  .d3-issue-tabs, .d3-issue-row { padding-inline: 14px; }
  .d3-issue-row > .d3-status { display: none; }
  .d3-footer { flex-direction: column; }
  .d3-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .d3-report-icon { display: none; }
  .ab-composer input { font-size: 16px; }
  .d3-focus-card { gap: 14px; padding: 20px 16px 12px; }
  .d3-focus-title { font-size: 20px; }
  .d3-focus-row { grid-template-columns: 1fr; gap: 6px; padding: 12px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .d3-typing i { animation: none; }
  .d3-chat-content { scroll-behavior: auto; }
  .d3-band, .d3-annotation, .d3-insight, .d3-proposal-card { transition: none; }
  .d3-proposal-card:hover { transform: none; }
  .d3-focus-card, .d3-focus-done { transition: none; animation: none; }
}
