:root {
    --ink: #10253f;
    --ink-2: #29445f;
    --muted: #6f7f8e;
    --paper: #f5f4ef;
    --white: #fff;
    --line: #dfe5e7;
    --cyan: #08a8ad;
    --cyan-soft: #dff6f4;
    --lime: #d9f469;
    --lime-soft: #f1f8cd;
    --coral: #ff826c;
    --coral-soft: #ffe6e0;
    --amber: #d58b16;
    --amber-soft: #fff1d2;
    --green: #31855e;
    --green-soft: #dcf4e7;
    --red: #bb4c3c;
    --red-soft: #ffe3df;
    --shadow: 0 18px 52px rgba(16, 37, 63, .09);
    --radius: 18px;
    --sidebar: 256px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 300; padding: 11px 16px; color: white; background: var(--ink); border-radius: 9px; }
.skip-link:focus { top: 16px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* App shell */
.app-page { min-height: 100vh; background: var(--paper); }
.app-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 60; width: var(--sidebar); display: flex; flex-direction: column; padding: 24px 18px 18px; color: white; background: linear-gradient(180deg, #102a45 0%, #0b2035 100%); }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 27px; }
.app-brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 850; letter-spacing: -.03em; }
.app-brand > span:last-child { display: flex; flex-direction: column; line-height: 1; }
.app-brand small { margin-top: 5px; color: rgba(255,255,255,.43); font-size: 8px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; }
.app-brand-mark { width: 35px; height: 35px; display: inline-flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 8px; border-radius: 10px; background: var(--lime); }
.app-brand-mark i { width: 4px; border-radius: 4px; background: var(--ink); }
.app-brand-mark i:nth-child(1) { height: 7px; opacity: .6; }
.app-brand-mark i:nth-child(2) { height: 13px; opacity: .8; }
.app-brand-mark i:nth-child(3) { height: 19px; }
.sidebar-close { display: none; color: white; border: 0; background: transparent; font-size: 25px; }
.app-nav { display: grid; gap: 5px; }
.app-nav a { min-height: 45px; display: flex; align-items: center; gap: 13px; padding: 0 12px; border-radius: 10px; color: rgba(255,255,255,.6); font-size: 12px; font-weight: 700; transition: .2s; }
.app-nav a:hover { color: white; background: rgba(255,255,255,.06); }
.app-nav a.active { color: var(--ink); background: var(--lime); box-shadow: 0 9px 25px rgba(217,244,105,.12); }
.app-nav a > span { width: 24px; height: 24px; display: grid; place-items: center; font-family: Georgia, serif; font-size: 13px; font-weight: 800; }
.sidebar-info { margin-top: auto; padding: 17px; border: 1px solid rgba(255,255,255,.09); border-radius: 14px; background: rgba(255,255,255,.045); }
.sidebar-info-icon { width: 36px; height: 36px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 10px; color: var(--ink); background: var(--lime); font-family: Georgia, serif; font-size: 16px; font-weight: 700; }
.sidebar-info strong { display: block; font-size: 11px; }
.sidebar-info p { margin: 6px 0 0; color: rgba(255,255,255,.45); font-size: 9px; line-height: 1.6; }
.sidebar-footer { display: grid; grid-template-columns: 35px 1fr auto; align-items: center; gap: 9px; margin-top: 14px; padding: 15px 8px 0; border-top: 1px solid rgba(255,255,255,.08); }
.user-avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; color: var(--ink); background: var(--cyan-soft); font-size: 12px; font-weight: 900; }
.sidebar-footer > div:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.sidebar-footer strong, .sidebar-footer small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer strong { font-size: 10px; }
.sidebar-footer small { margin-top: 2px; color: rgba(255,255,255,.38); font-size: 8px; }
.sidebar-footer form button { padding: 6px; color: rgba(255,255,255,.48); border: 0; background: transparent; }
.sidebar-scrim { display: none; }
.limit-note { padding: 9px 13px; border: 1px solid #ddc68b; border-radius: 9px; color: #78580e; background: var(--amber-soft); font-size: 10px; font-weight: 800; }
.app-frame { min-height: 100vh; margin-left: var(--sidebar); }
.app-topbar { position: sticky; top: 0; z-index: 40; height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(22px, 4vw, 52px); border-bottom: 1px solid rgba(16,37,63,.08); background: rgba(245,244,239,.9); backdrop-filter: blur(16px); }
.topbar-title { display: flex; flex-direction: column; }
.topbar-title small { color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.topbar-title strong { margin-top: 3px; font-size: 14px; }
.topbar-actions { display: flex; align-items: center; gap: 13px; }
.topbar-status, .topbar-warning { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 9px; font-weight: 800; }
.topbar-warning { color: #97600c; background: var(--amber-soft); }
.topbar-status i, .topbar-warning i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: white; font-size: 13px; }
.mobile-menu { display: none; padding: 8px; border: 0; background: transparent; }
.mobile-menu span { width: 22px; height: 2px; display: block; margin: 4px; background: var(--ink); }
.app-content { width: min(100%, 1500px); min-height: calc(100vh - 72px); margin: 0 auto; padding: 38px clamp(22px, 4vw, 52px) 70px; }

/* Shared app elements */
.app-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 35px; margin-bottom: 28px; }
.app-page-head h1 { margin: 5px 0 5px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(34px, 3.5vw, 47px); line-height: 1.07; letter-spacing: -.045em; font-weight: 500; }
.app-page-head p { max-width: 680px; margin: 0; color: var(--muted); font-size: 13px; }
.page-eyebrow, .section-kicker { display: block; color: var(--cyan); font-size: 9px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.primary-action, .secondary-action, .quiet-action, .danger-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 16px; border: 0; border-radius: 9px; font-size: 10px; font-weight: 850; white-space: nowrap; transition: .2s; }
.primary-action { color: var(--ink); background: var(--lime); box-shadow: 0 8px 22px rgba(166,192,55,.16); }
.primary-action:hover { transform: translateY(-1px); background: #e3fb84; }
.primary-action > span { font-size: 15px; }
.secondary-action { color: var(--ink); border: 1px solid var(--line); background: white; }
.secondary-action:hover { border-color: #b8c5ca; background: #fafbfb; }
.quiet-action { color: var(--ink-2); background: #edf1f2; }
.danger-button { color: white; background: var(--red); }
.text-danger { padding: 8px; color: var(--red); border: 0; background: transparent; font-size: 10px; font-weight: 800; }
.full { width: 100%; }
.panel { border: 1px solid rgba(16,37,63,.09); border-radius: var(--radius); background: white; box-shadow: 0 10px 35px rgba(16,37,63,.035); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.panel-head h2 { margin: 4px 0 0; font-size: 18px; letter-spacing: -.025em; }
.panel-head > a { color: var(--cyan); font-size: 10px; font-weight: 800; }
.app-flash { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; padding: 13px 15px; border: 1px solid; border-radius: 11px; font-size: 11px; }
.app-flash > span { width: 22px; height: 22px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; font-weight: 900; }
.app-flash p { flex: 1; margin: 3px 0; }
.app-flash button { padding: 2px 5px; border: 0; background: transparent; font-size: 17px; }
.app-flash ul { margin: 7px 0 0; padding-left: 18px; }
.flash-success { color: #275f48; border-color: #b8dfcb; background: #e7f7ee; }
.flash-success > span { background: #c9ebd7; }
.flash-error { color: #9b3e32; border-color: #f0c0b9; background: #fff0ed; }
.flash-error > span { background: #f7cfc8; }
.flash-warning, .flash-info { color: #82540d; border-color: #efd59e; background: #fff6e3; }
.flash-warning > span, .flash-info > span { background: #f7dfad; }
.attention-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 15px; margin-bottom: 22px; padding: 17px 20px; border: 1px solid; border-radius: 13px; }
.attention-card p { margin: 3px 0 0; font-size: 11px; }
.attention-card strong { font-size: 12px; }
.attention-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; font-weight: 900; }
.amber-card { color: #744c0f; border-color: #eed8a9; background: #fff7e8; }
.amber-card .attention-icon { background: #f8dda8; }
.danger-card { color: #8b3c32; border-color: #efc2bb; background: #fff0ed; }
.danger-card .attention-icon { background: #f5cfc8; }
.info-banner { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 22px; padding: 14px 17px; border-radius: 11px; color: #386178; background: #eaf5f9; }
.info-banner > span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #cce8f0; font-size: 11px; font-weight: 900; }
.info-banner p { margin: 2px 0; font-size: 10px; line-height: 1.6; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 999px; font-size: 8px; font-weight: 850; white-space: nowrap; }
.status-badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-active, .status-success { color: var(--green); background: var(--green-soft); }
.status-paused, .status-draft, .status-queued { color: #687985; background: #edf1f2; }
.status-running, .status-retry { color: #0c7e92; background: #daf2f5; }
.status-needs_reconnect, .status-failed, .status-disconnected { color: var(--red); background: var(--red-soft); }
.status-partial { color: #9c6714; background: var(--amber-soft); }
.count-pill { min-width: 30px; height: 30px; display: grid; place-items: center; padding: 0 9px; border-radius: 99px; color: var(--cyan); background: var(--cyan-soft); font-size: 11px; font-weight: 900; }

/* Dashboard */
.onboarding-card { display: grid; grid-template-columns: 1.1fr .9fr; gap: 50px; align-items: center; margin-bottom: 25px; padding: 38px 42px; overflow: hidden; color: white; border-radius: 20px; background: linear-gradient(125deg, #143754, #0c263f); box-shadow: var(--shadow); }
.onboarding-copy h2 { max-width: 630px; margin: 8px 0 12px; font-family: Georgia, serif; font-size: clamp(28px, 3vw, 39px); line-height: 1.08; font-weight: 500; letter-spacing: -.035em; }
.onboarding-copy p { max-width: 600px; margin: 0 0 24px; color: rgba(255,255,255,.6); font-size: 12px; line-height: 1.7; }
.onboarding-list { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.onboarding-list li { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; color: rgba(255,255,255,.4); }
.onboarding-list li.current { color: white; background: rgba(255,255,255,.07); }
.onboarding-list li.done { color: rgba(255,255,255,.62); }
.onboarding-list li > span { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.17); border-radius: 9px; font-size: 10px; font-weight: 900; }
.onboarding-list li.current > span { color: var(--ink); border-color: var(--lime); background: var(--lime); }
.onboarding-list li.done > span { color: var(--lime); }
.onboarding-list li div { display: flex; flex-direction: column; }
.onboarding-list strong { font-size: 10px; }
.onboarding-list small { margin-top: 2px; font-size: 8px; opacity: .68; }
.metric-cards { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 20px; }
.metric-cards article { min-width: 0; display: flex; align-items: center; gap: 13px; padding: 19px; border: 1px solid rgba(16,37,63,.08); border-radius: 15px; background: white; }
.metric-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; font-family: Georgia, serif; font-size: 15px; font-weight: 900; }
.metric-icon.cyan { color: #067b80; background: var(--cyan-soft); }
.metric-icon.lime { color: #576b12; background: var(--lime-soft); }
.metric-icon.coral { color: #a34d3d; background: var(--coral-soft); }
.metric-icon.navy { color: white; background: var(--ink); }
.metric-cards article > div { min-width: 0; display: flex; flex-direction: column; }
.metric-cards small { color: var(--muted); font-size: 8px; font-weight: 700; }
.metric-cards strong { margin: 2px 0; overflow: hidden; text-overflow: ellipsis; font-size: 21px; line-height: 1.2; }
.metric-cards .metric-date { font-size: 13px; line-height: 1.45; }
.metric-cards em { overflow: hidden; color: #89959f; font-size: 7px; font-style: normal; white-space: nowrap; text-overflow: ellipsis; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px,.65fr); gap: 18px; }
.dashboard-grid .panel { padding: 23px; }
.table-scroll { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.data-table th { padding: 10px 12px; color: #8a979f; border-bottom: 1px solid var(--line); text-align: left; font-size: 8px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 13px 12px; border-bottom: 1px solid #edf0f1; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td > small { display: block; margin-top: 3px; color: #89959f; font-size: 8px; }
.table-primary { min-width: 160px; display: flex; align-items: center; gap: 9px; }
.table-primary > div { display: flex; flex-direction: column; }
.table-primary strong { font-size: 10px; }
.table-primary small { max-width: 215px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.property-dot { width: 9px; height: 9px; flex: 0 0 auto; border: 2px solid white; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 2px var(--cyan-soft); }
.last-export { display: flex; flex-direction: column; align-items: center; text-align: center; }
.last-export-ring { width: 75px; height: 75px; display: grid; place-items: center; margin: 4px 0 13px; border-radius: 50%; background: conic-gradient(var(--lime) 0 82%, #edf1f2 82%); }
.last-export-ring span { width: 57px; height: 57px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: white; font-size: 21px; }
.last-export > strong { font-size: 13px; }
.last-export > small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.last-export dl { width: 100%; margin: 19px 0; }
.last-export dl div { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid #edf0f1; font-size: 9px; }
.last-export dt { color: var(--muted); }
.last-export dd { margin: 0; font-weight: 750; }
.api-limit-note { margin: 20px 0 0; padding: 12px 15px; color: #6f7f8e; border-left: 3px solid var(--cyan); background: rgba(255,255,255,.5); font-size: 9px; line-height: 1.6; }
.empty-state { display: flex; flex-direction: column; align-items: center; padding: 65px 25px; text-align: center; }
.empty-state > span { min-width: 50px; height: 50px; display: grid; place-items: center; margin-bottom: 14px; padding: 0 10px; border-radius: 14px; color: var(--cyan); background: var(--cyan-soft); font-size: 11px; font-weight: 900; }
.empty-state h2, .empty-state h3 { margin: 0 0 6px; }
.empty-state p { max-width: 460px; margin: 0 0 20px; color: var(--muted); font-size: 10px; }
.empty-state.compact { padding: 32px 20px; }

/* Connections, jobs, history */
.connection-grid, .job-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.connection-card, .job-card { padding: 22px; }
.connection-head, .job-card-head { display: flex; align-items: center; gap: 12px; }
.connection-head > div, .job-card-head > div { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.connection-head strong { font-size: 12px; }
.connection-head small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.bing-avatar, .property-symbol { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--ink); font-family: Georgia, serif; font-size: 16px; font-weight: 900; }
.connection-stats { display: grid; grid-template-columns: .6fr 1.4fr; margin: 22px 0; border: 1px solid #edf0f1; border-radius: 11px; }
.connection-stats div { display: flex; flex-direction: column; padding: 12px 15px; border-right: 1px solid #edf0f1; }
.connection-stats div:last-child { border-right: 0; }
.connection-stats strong { font-size: 12px; }
.connection-stats small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.connection-actions, .job-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.inline-warning { margin: 0 0 14px; padding: 10px 12px; color: #8d4b17; border-radius: 8px; background: var(--amber-soft); font-size: 9px; }
.properties-panel { margin-top: 18px; padding: 24px; }
.property-list { display: grid; }
.property-row { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 11px; padding: 12px 0; border-top: 1px solid #edf0f1; }
.property-row:first-child { border-top: 0; }
.property-row .property-symbol { width: 36px; height: 36px; border-radius: 9px; color: var(--cyan); background: var(--cyan-soft); font-size: 11px; }
.property-row div { min-width: 0; display: flex; flex-direction: column; }
.property-row strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.property-row small, .property-row > span:last-child { color: var(--muted); font-size: 8px; }
.usage-bar { display: flex; align-items: center; gap: 24px; margin-bottom: 18px; padding: 15px 20px; }
.usage-bar > div:first-child { display: flex; flex-direction: column; }
.usage-bar strong { font-size: 10px; }
.usage-bar small { color: var(--muted); font-size: 8px; }
.usage-track { height: 7px; flex: 1; overflow: hidden; border-radius: 999px; background: #edf0f1; }
.usage-track i { height: 100%; display: block; border-radius: inherit; background: var(--cyan); }
.job-card-head h2 { margin: 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.job-card-head p { margin: 2px 0 0; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.job-details { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 20px 0; border-top: 1px solid #edf0f1; }
.job-details div { min-width: 0; padding: 11px 10px 5px 0; }
.job-details dt { color: var(--muted); font-size: 8px; }
.job-details dd { margin: 3px 0 0; overflow: hidden; font-size: 9px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.history-panel { padding: 22px; }
.history-table { min-width: 940px; }
.delivery-status { font-size: 8px; font-weight: 750; }
.delivery-accepted { color: var(--green); }
.delivery-failed { color: var(--red); }
.download-button { width: max-content; min-width: 31px; height: 31px; padding: 0 10px; display: grid; place-items: center; border-radius: 9px; color: var(--cyan); background: var(--cyan-soft); font-size: 8px; font-weight: 900; white-space: nowrap; }
.download-button.disabled { color: #9aa5ad; background: #f0f2f3; cursor: default; }
.history-pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin: 14px 0; font-size: 9px; }
.history-pagination a { width: max-content; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--navy); background: #fff; font-weight: 800; }
.history-pagination a:last-child { justify-self: end; }
.history-pagination strong { color: var(--muted); font-size: 8px; }
.job-actions button:disabled { cursor: not-allowed; opacity: .48; filter: grayscale(.25); }

/* Forms */
.form-page-head { align-items: flex-start; }
.back-link { display: inline-block; margin-bottom: 15px; color: var(--cyan); font-size: 9px; font-weight: 800; }
.plan-form { display: grid; grid-template-columns: minmax(0,1fr) 300px; align-items: start; gap: 20px; }
.form-main { display: grid; gap: 16px; }
.form-section { padding: 25px; }
.form-section-head { display: grid; grid-template-columns: 40px 1fr; gap: 14px; margin-bottom: 23px; }
.form-section-head > span { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; color: var(--cyan); background: var(--cyan-soft); font-family: Georgia, serif; font-size: 13px; font-weight: 700; }
.form-section-head h2 { margin: 0; font-size: 16px; }
.form-section-head p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.field-grid, .schedule-grid, .filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.schedule-grid { grid-template-columns: repeat(3,1fr); }
.filter-grid { grid-template-columns: .8fr .8fr 1.4fr; }
.field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.field > span, .field-label { display: flex; justify-content: space-between; color: #526576; font-size: 8px; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.field > span a { color: var(--cyan); text-transform: none; }
.field input, .field select, .field textarea, .readonly-value { width: 100%; height: 42px; padding: 0 12px; border: 1px solid #d7dfe2; border-radius: 9px; outline: 0; background: white; font-size: 10px; transition: .2s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(8,168,173,.1); }
.field small, .helper { color: var(--muted); font-size: 8px; line-height: 1.55; }
.field small a { color: var(--cyan); font-weight: 800; }
.option-fieldset, .choice-cards, .stacked-options, .segment-options { min-width: 0; margin: 0; padding: 0; border: 0; }
.top-gap { margin-top: 17px; }
.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-card { position: relative; min-height: 130px; padding: 17px; border: 1px solid #d9e1e3; border-radius: 12px; cursor: pointer; }
.choice-card:has(input:checked) { border-color: var(--cyan); background: #f2fbfa; box-shadow: 0 0 0 2px rgba(8,168,173,.08); }
.choice-card:has(input:focus-visible), .stacked-options > label:has(input:focus-visible), .check-card:has(input:focus-visible) { outline: 3px solid rgba(8,168,173,.35); outline-offset: 2px; }
.choice-card input { position: absolute; opacity: 0; }
.choice-check { position: absolute; top: 14px; right: 14px; width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid #cbd5d8; border-radius: 50%; color: transparent; font-size: 9px; }
.choice-card input:checked + .choice-check { color: white; border-color: var(--cyan); background: var(--cyan); }
.choice-card strong { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding-right: 22px; font-size: 11px; }
.choice-card em, .stacked-options em { padding: 3px 6px; border-radius: 99px; color: #52680c; background: var(--lime); font-size: 6px; font-style: normal; text-transform: uppercase; }
.choice-card p { margin: 9px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.conditional-box { margin-top: 15px; padding: 15px; border-radius: 10px; background: #f5f7f7; }
.chip-options { display: flex; flex-wrap: wrap; gap: 7px; margin: 9px 0; }
.chip-options label input { position: absolute; opacity: 0; }
.chip-options label span { display: block; padding: 7px 9px; border: 1px solid #dbe2e4; border-radius: 7px; background: white; font-size: 8px; font-weight: 750; cursor: pointer; }
.chip-options label input:checked + span { color: var(--cyan); border-color: #9bd8d9; background: var(--cyan-soft); }
.chip-options label:has(input:focus-visible) span, .segment-options label:has(input:focus-visible) span { outline: 3px solid rgba(8,168,173,.35); outline-offset: 2px; }
.stacked-options { display: grid; gap: 8px; }
.stacked-options > label { display: flex; align-items: flex-start; gap: 11px; padding: 13px; border: 1px solid #dce3e5; border-radius: 10px; cursor: pointer; }
.stacked-options > label:has(input:checked) { border-color: var(--cyan); background: #f3fbfb; }
.stacked-options input { margin-top: 2px; accent-color: var(--cyan); }
.stacked-options label > span { display: flex; flex-direction: column; }
.stacked-options strong { display: flex; align-items: center; gap: 7px; font-size: 10px; }
.stacked-options small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.conditional-field { margin-top: 13px; }
.segment-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; padding: 5px; border-radius: 10px; background: #eef1f2; }
.segment-options label input { position: absolute; opacity: 0; }
.segment-options label span { display: block; padding: 9px; border-radius: 7px; color: var(--muted); text-align: center; font-size: 9px; font-weight: 800; cursor: pointer; }
.segment-options label input:checked + span { color: white; background: var(--ink); box-shadow: 0 4px 10px rgba(16,37,63,.15); }
.delay-field { margin-top: 16px; }
.check-card { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid #d7dfe2; border-radius: 9px; }
.check-card input { margin-top: 2px; accent-color: var(--cyan); }
.check-card span { display: flex; flex-direction: column; }
.check-card strong { font-size: 9px; }
.check-card small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.advanced-section { overflow: hidden; }
.advanced-section summary { display: flex; align-items: center; justify-content: space-between; padding: 19px 24px; cursor: pointer; list-style: none; }
.advanced-section summary::-webkit-details-marker { display: none; }
.advanced-section summary span { display: flex; flex-direction: column; }
.advanced-section summary strong { font-size: 11px; }
.advanced-section summary small { color: var(--muted); font-size: 8px; }
.advanced-section summary b { font-size: 18px; }
.advanced-section[open] summary b { transform: rotate(45deg); }
.advanced-body { padding: 0 24px 22px; border-top: 1px solid #edf0f1; }
.advanced-body > .field-grid { padding-top: 18px; }
.readonly-value { display: flex; align-items: center; color: var(--muted); background: #f4f6f6; }
.filter-grid { margin-top: 15px; }
.form-summary { position: sticky; top: 92px; padding: 23px; }
.form-summary h2 { margin: 4px 0 18px; font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.summary-visual { height: 86px; display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 16px; border-radius: 13px; background: linear-gradient(135deg, #e5f8f6, #f4fad8); }
.summary-visual > span, .summary-visual > b { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; color: var(--cyan); background: white; box-shadow: 0 7px 18px rgba(16,37,63,.1); font-size: 9px; }
.summary-visual > b { color: white; background: var(--ink); font-size: 14px; }
.summary-visual i { width: 42px; height: 2px; position: relative; background: rgba(16,37,63,.2); }
.summary-visual i::after { content: ''; position: absolute; right: -1px; top: -3px; width: 7px; height: 7px; border-top: 2px solid rgba(16,37,63,.35); border-right: 2px solid rgba(16,37,63,.35); transform: rotate(45deg); }
.form-summary dl { margin: 0 0 15px; }
.form-summary dl div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #edf0f1; font-size: 8px; }
.form-summary dt { color: var(--muted); }
.form-summary dd { max-width: 155px; margin: 0; overflow: hidden; font-weight: 800; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.summary-note { display: flex; gap: 8px; margin: 15px 0; padding: 10px; border-radius: 8px; color: #587181; background: #eef6f8; }
.summary-note span { font-weight: 900; }
.summary-note p { margin: 0; font-size: 7px; line-height: 1.55; }
.form-summary button + button { margin-top: 8px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-top: 20px; padding: 20px 24px; border-color: #edcbc5; }
.danger-zone strong { color: var(--red); font-size: 11px; }
.danger-zone p { margin: 3px 0 0; color: var(--muted); font-size: 8px; }

/* Settings */
.settings-jump { display: flex; gap: 5px; margin-bottom: 20px; padding: 5px; border-radius: 10px; background: #e9edee; }
.settings-jump a { padding: 8px 13px; border-radius: 7px; color: var(--muted); font-size: 9px; font-weight: 800; }
.settings-jump a:hover { color: var(--ink); background: white; }
.settings-grid { display: grid; gap: 17px; }
.settings-section { scroll-margin-top: 95px; padding: 25px; }
.settings-section-head { display: grid; grid-template-columns: 40px 1fr; gap: 13px; margin-bottom: 22px; }
.settings-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: white; background: var(--ink); font-size: 11px; font-weight: 900; }
.settings-icon.cyan { color: var(--cyan); background: var(--cyan-soft); }
.settings-icon.lime { color: #607713; background: var(--lime-soft); }
.settings-icon.coral { color: var(--red); background: var(--coral-soft); }
.settings-section-head h2 { margin: 0; font-size: 16px; }
.settings-section-head p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.settings-form { max-width: 760px; }
.settings-form > .field { margin-top: 14px; }
.api-token-secret { max-width: 760px; margin-bottom: 20px; padding: 15px; border: 1px solid #f0cb73; border-radius: 10px; background: var(--amber-soft); }
.api-token-secret > strong { font-size: 11px; }
.api-token-secret > p { margin: 5px 0 12px; color: #79501d; font-size: 9px; }
.api-token-secret input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; }
.api-token-list { max-width: 860px; margin-top: 24px; }
.api-token-list h3 { margin: 0 0 8px; font-size: 11px; }
.api-token-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #edf0f1; }
.api-token-row > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.api-token-row strong { font-size: 10px; }
.api-token-row code { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.api-token-row small { color: var(--muted); font-size: 8px; }
.account-email-change { max-width: 760px; margin-top: 23px; padding-top: 20px; border-top: 1px solid #edf0f1; scroll-margin-top: 95px; }
.account-email-change .settings-form { margin-top: 12px; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 17px; }
.address-list { display: grid; max-width: 760px; }
.address-row { display: grid; grid-template-columns: 35px 1fr auto; align-items: center; gap: 11px; padding: 11px 0; border-top: 1px solid #edf0f1; }
.address-row:first-child { border-top: 0; }
.address-symbol { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--cyan); background: var(--cyan-soft); font-size: 11px; font-weight: 900; }
.address-row div { display: flex; flex-direction: column; }
.address-row strong { font-size: 10px; }
.address-row small { color: var(--muted); font-size: 8px; }
.verified-badge, .pending-badge { padding: 5px 8px; border-radius: 99px; color: var(--green); background: var(--green-soft); font-size: 8px; font-weight: 800; }
.pending-badge { color: #94610f; background: var(--amber-soft); }
.inline-form { max-width: 760px; display: flex; align-items: flex-end; gap: 10px; margin-top: 14px; padding-top: 16px; border-top: 1px solid #edf0f1; }
.inline-form .grow { flex: 1; }
.test-mail-form { max-width: 760px; display: flex; align-items: flex-end; gap: 10px; margin-top: 12px; }
.test-mail-form .field { width: 320px; }
.security-facts { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; max-width: 760px; margin-top: 22px; }
.security-facts p { display: grid; grid-template-columns: 25px 1fr; margin: 0; padding: 12px; border-radius: 9px; background: #f5f7f7; }
.security-facts p span { grid-row: span 2; color: var(--green); font-weight: 900; }
.security-facts strong { font-size: 8px; }
.security-facts small { color: var(--muted); font-size: 7px; }
.data-action { max-width: 800px; display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 16px 0; border-top: 1px solid #edf0f1; }
.data-action:first-of-type { border-top: 0; }
.data-action strong { font-size: 10px; }
.data-action p { margin: 3px 0 0; color: var(--muted); font-size: 8px; }
.danger-data strong { color: var(--red); }
.confirm-dialog { width: min(92%, 510px); padding: 0; border: 0; border-radius: 17px; box-shadow: 0 28px 90px rgba(16,37,63,.25); }
.confirm-dialog::backdrop { background: rgba(9,26,44,.65); backdrop-filter: blur(3px); }
.confirm-dialog form { position: relative; padding: 29px; }
.dialog-close { position: absolute; top: 13px; right: 14px; padding: 5px 9px; border: 0; background: transparent; font-size: 20px; }
.dialog-icon { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 13px; color: var(--red); background: var(--red-soft); font-size: 18px; font-weight: 900; }
.confirm-dialog h2 { margin: 17px 0 6px; font-size: 19px; }
.confirm-dialog p { margin: 0 0 18px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.confirm-dialog .field { margin-top: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 15px; }
.inline-link { display: inline-block; margin-top: 5px; color: var(--cyan); font-size: 9px; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }

/* Auth, legal and setup */
.simple-page { min-height: 100vh; background: #fbfaf6; }
.simple-page .simple-nav { display: flex; align-items: center; gap: 22px; color: var(--ink-2); font-size: 12px; font-weight: 700; }
.top-flash { margin-top: 15px; padding: 12px 15px; border-radius: 10px; font-size: 11px; }
.compact-footer { margin-top: 80px; padding-top: 25px !important; }
.compact-footer .footer-bottom nav { display: flex; gap: 18px; }
.auth-shell { min-height: 690px; display: grid; grid-template-columns: .88fr 1.12fr; }
.auth-panel { min-width: 0; display: grid; place-items: center; padding: clamp(40px, 6vw, 85px); }
.auth-copy-panel { color: white; background: linear-gradient(145deg, #143955, #0b2035); }
.auth-copy-inner { max-width: 480px; }
.section-kicker.light { color: var(--lime); }
.auth-copy-inner h1 { margin: 15px 0 20px; font-family: Georgia, serif; font-size: clamp(40px, 4.5vw, 61px); line-height: 1.02; letter-spacing: -.05em; font-weight: 500; }
.auth-copy-inner > p { margin-bottom: 32px; color: rgba(255,255,255,.58); font-size: 14px; line-height: 1.7; }
.auth-proof { display: flex; gap: 11px; margin-top: 15px; }
.auth-proof > span { width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; color: var(--ink); background: var(--lime); font-size: 10px; font-weight: 900; }
.auth-proof > div { display: flex; flex-direction: column; }
.auth-proof strong { font-size: 10px; }
.auth-proof small { margin-top: 3px; color: rgba(255,255,255,.42); font-size: 8px; }
.auth-steps { display: grid; gap: 13px; margin: 35px 0 0; padding: 0; list-style: none; }
.auth-steps li { display: flex; align-items: center; gap: 12px; }
.auth-steps li > span { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.16); border-radius: 9px; color: var(--lime); font-size: 9px; font-weight: 900; }
.auth-steps div { display: flex; flex-direction: column; }
.auth-steps strong { font-size: 10px; }
.auth-steps small { color: rgba(255,255,255,.4); font-size: 8px; }
.auth-form-panel { background: #fbfaf6; }
.auth-form { width: min(100%, 420px); }
.auth-form-wide { width: min(100%, 600px); }
.form-heading { margin-bottom: 25px; }
.form-heading h2 { margin: 6px 0 5px; font-family: Georgia, serif; font-size: 38px; line-height: 1.1; font-weight: 500; letter-spacing: -.04em; }
.form-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.form-heading p a { color: var(--cyan); font-weight: 800; }
.auth-form > .field { margin-top: 14px; }
.form-submit { width: 100%; min-height: 47px; margin-top: 20px; }
.form-footnote { margin: 14px 0 0; color: var(--muted); text-align: center; font-size: 8px; }
.check-field { display: flex; align-items: flex-start; gap: 9px; margin-top: 16px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.check-field input { margin-top: 2px; accent-color: var(--cyan); }
.check-field a { color: var(--cyan); font-weight: 750; }
.form-errors { margin-bottom: 15px; padding: 12px 14px; color: #983f33; border: 1px solid #f0c1ba; border-radius: 9px; background: #fff0ed; font-size: 9px; }
.form-errors ul { margin: 6px 0 0; padding-left: 18px; }
.auth-single { min-height: 620px; display: grid; place-items: center; padding: 70px 20px; }
.auth-single .panel { padding: 32px; }
.auth-single .back-link { display: block; margin-top: 18px; text-align: center; }
.content-shell { width: min(calc(100% - 40px), 1040px); margin-inline: auto; }
.narrow-content { max-width: 760px; padding: 80px 0; }
.page-intro { margin-bottom: 35px; }
.page-intro.centered { text-align: center; }
.page-intro h1 { margin: 8px 0 10px; font-family: Georgia, serif; font-size: 47px; font-weight: 500; letter-spacing: -.045em; }
.page-intro p { color: var(--muted); font-size: 12px; }
.setup-page .panel { padding: 20px; }
.check-row { display: grid; grid-template-columns: 29px 1fr auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #edf0f1; font-size: 10px; }
.check-row:last-child { border-bottom: 0; }
.check-row > span:last-child { color: var(--muted); font-size: 8px; }
.check-symbol { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; font-weight: 900; }
.check-symbol.ok { color: var(--green); background: var(--green-soft); }
.check-symbol.missing { color: var(--red); background: var(--red-soft); }
.setup-actions { display: flex; justify-content: center; gap: 10px; margin-top: 25px; }
.button-quiet { border: 1px solid var(--line); background: white; }
.centered { text-align: center; }
.state-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; text-align: center; }
.state-page.embedded { min-height: 450px; }
.state-code { min-width: 80px; height: 80px; display: grid; place-items: center; padding: 0 12px; border-radius: 22px; color: var(--cyan); background: var(--cyan-soft); font-family: Georgia, serif; font-size: 28px; }
.state-page h1 { margin: 20px 0 8px; font-family: Georgia, serif; font-size: 38px; font-weight: 500; }
.state-page p { color: var(--muted); font-size: 12px; }
.file-list { padding: 18px; }
.file-download { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; padding: 12px; border-bottom: 1px solid #edf0f1; }
.file-download:last-child { border-bottom: 0; }
.file-download > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: var(--cyan); background: var(--cyan-soft); font-size: 8px; font-weight: 900; }
.file-download div { min-width: 0; display: flex; flex-direction: column; }
.file-download strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.file-download small { color: var(--muted); font-size: 8px; }
.file-download b { color: var(--cyan); font-size: 9px; }
.legal-page { padding: 80px 0 30px; }
.legal-page header { max-width: 780px; margin-bottom: 50px; }
.legal-page header h1 { margin: 9px 0 14px; font-family: Georgia, serif; font-size: clamp(45px, 6vw, 70px); line-height: 1; font-weight: 500; letter-spacing: -.05em; }
.legal-page header p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.legal-page section { max-width: 820px; padding: 23px 0; border-top: 1px solid var(--line); }
.legal-page h2 { margin: 0 0 9px; font-size: 17px; }
.legal-page p, .legal-page address { margin: 0 0 10px; color: #4f6475; font-size: 11px; line-height: 1.75; font-style: normal; }
.legal-page a { color: var(--cyan); text-decoration: underline; text-underline-offset: 2px; }
.legal-page code { padding: 2px 5px; border-radius: 4px; background: #edf1f2; font-size: 9px; }
.legal-warning { max-width: 820px; margin-top: 25px; padding: 18px 20px; border: 1px solid #efd19c; border-radius: 11px; background: #fff7e7; }
.legal-warning strong { color: #825510; font-size: 11px; }
.legal-warning p { margin: 4px 0 0; color: #826633; font-size: 9px; }

@media (max-width: 1180px) {
    .metric-cards { grid-template-columns: repeat(2,1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .plan-form { grid-template-columns: 1fr; }
    .form-summary { position: static; }
}

@media (max-width: 900px) {
    .app-sidebar { transform: translateX(-100%); transition: transform .25s; }
    .app-sidebar.is-open { transform: translateX(0); }
    .sidebar-close, .mobile-menu { display: block; }
    .sidebar-scrim { position: fixed; inset: 0; z-index: 50; background: rgba(9,26,44,.55); }
    .sidebar-scrim.is-open { display: block; }
    .app-frame { margin-left: 0; }
    .app-topbar { justify-content: flex-start; gap: 15px; }
    .topbar-actions { margin-left: auto; }
    .connection-grid, .job-grid { grid-template-columns: 1fr; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-copy-panel { min-height: 420px; }
    .auth-panel { padding: 55px 30px; }
}

@media (max-width: 650px) {
    .app-content { padding: 28px 14px 55px; }
    .app-topbar { height: 64px; padding: 0 14px; }
    .topbar-title small { display: none; }
    .topbar-status, .topbar-warning { display: none; }
    .app-page-head { align-items: flex-start; flex-direction: column; }
    .app-page-head .primary-action { width: 100%; }
    .attention-card { grid-template-columns: auto 1fr; }
    .attention-card > :last-child { grid-column: 1 / -1; }
    .onboarding-card { grid-template-columns: 1fr; gap: 30px; padding: 28px 22px; }
    .metric-cards { grid-template-columns: 1fr; }
    .metric-cards article { padding: 15px; }
    .field-grid, .schedule-grid, .filter-grid, .choice-cards { grid-template-columns: 1fr; }
    .form-section { padding: 19px 15px; }
    .form-section-head { grid-template-columns: 34px 1fr; }
    .segment-options { grid-template-columns: 1fr; }
    .security-facts { grid-template-columns: 1fr; }
    .inline-form, .test-mail-form, .data-action, .danger-zone { align-items: stretch; flex-direction: column; }
    .test-mail-form .field { width: 100%; }
    .settings-jump { overflow-x: auto; }
    .settings-jump a { white-space: nowrap; }
    .api-token-row { grid-template-columns: 1fr; align-items: start; }
    .field input, .field select, .field textarea, .readonly-value { min-height: 46px; font-size: 16px; }
    .field > span, .field-label { font-size: 12px; }
    .field small, .helper { font-size: 13px; }
    .choice-card strong, .stacked-options strong { font-size: 14px; }
    .choice-card p, .stacked-options small, .check-card small { font-size: 13px; }
    .chip-options label span, .segment-options label span { font-size: 14px; }
    .auth-form-panel { order: -1; }
    .auth-copy-panel { min-height: 0; padding-block: 34px; }
    .auth-copy-inner h1 { font-size: 34px; }
    .auth-copy-inner > p { margin-bottom: 18px; font-size: 14px; }
    .auth-steps, .auth-proof { display: none; }
    .auth-panel { padding: 45px 20px; }
    .simple-page .simple-nav > a:not(.button) { display: none; }
    .legal-page { padding-top: 55px; }
    .file-download { grid-template-columns: 38px 1fr; }
    .file-download b { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Bing connection key management */
.key-rotation{margin-top:20px;padding-top:16px;border-top:1px solid var(--line,#e6eaf0)}
.key-rotation summary{cursor:pointer;font-size:13px;font-weight:700;color:var(--navy,#10253f)}
.key-rotation form{padding-top:16px}
