/* Autorules presentation preview. Existing application actions remain in place. */
body.crm-interface-v2 #page-rules.crm-autorules {
  --accent:var(--ui-blue);--card-bg:var(--ui-card);--text-main:var(--ui-text);--text-muted:var(--ui-muted);--border-light:var(--ui-line);
  padding:26px 28px 80px;background:var(--ui-bg);color:var(--ui-text);gap:0;min-width:0;
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:13px;line-height:1.45;
}
#page-rules.crm-autorules * {box-sizing:border-box}
#page-rules.crm-autorules>*,#page-rules.crm-autorules .crm-rules-navigation>* {flex-shrink:0}
#page-rules.crm-autorules .top-header {display:flex;align-items:center;justify-content:space-between;gap:20px;margin:0 0 22px;padding:0;border:0;background:none;min-height:44px}
#page-rules.crm-autorules .page-title {margin:0;font-size:25px;font-weight:750;letter-spacing:-.65px;line-height:1.25;color:var(--ui-text)}
#page-rules.crm-autorules .header-controls {display:flex;gap:10px;align-items:center;flex-wrap:wrap}
#page-rules.crm-autorules button {font-family:inherit;cursor:pointer;transition:background-color 120ms,border-color 120ms,color 120ms;transform:none!important}
#page-rules.crm-autorules button:active {transform:none!important}
#page-rules.crm-autorules :is(button,input):focus {outline:none}
#page-rules.crm-autorules :is(button,input):focus-visible {outline:2px solid var(--ui-blue);outline-offset:3px}
#page-rules.crm-autorules button:disabled {opacity:.5;cursor:default}
#page-rules.crm-autorules .top-action-btn {display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:42px;padding:10px 16px;border:1px solid var(--ui-line);border-radius:10px;box-shadow:none;font-size:13px;font-weight:600;line-height:20px;white-space:nowrap;background:var(--ui-card);color:var(--ui-text)}
#page-rules.crm-autorules :is(#runNowBtn,.crm-rules-add) {background:var(--ui-blue)!important;color:#fff!important;border:1px solid transparent!important;font-weight:600!important}
body.crm-interface-v2.dark-theme #page-rules.crm-autorules :is(#runNowBtn,.crm-rules-add) {color:#10213b!important}
body.crm-interface-v2.dark-theme #page-rules.crm-autorules #runNowBtn {background:var(--ui-blue)!important;color:#10213b!important}
body.crm-interface-v2.dark-theme #page-rules.crm-autorules #runNowBtn:hover:not(:disabled) {background:color-mix(in srgb,var(--ui-blue) 88%,#fff)!important;color:#10213b!important}
#page-rules.crm-autorules .crm-rules-interval {position:relative;padding:0!important;border:0!important;background:none!important;gap:0!important}
#page-rules.crm-autorules .crm-rules-interval>span {display:none}
#page-rules.crm-autorules .crm-rules-interval>select {display:none!important}
#page-rules.crm-autorules .crm-rules-interval-button {min-width:191px;justify-content:space-between;padding:10px 13px}
#page-rules.crm-autorules .crm-rules-interval-button>svg {width:17px;height:17px;color:var(--ui-muted);flex:none}
#page-rules.crm-autorules .crm-rules-interval-button>span {flex:1;text-align:left}
#page-rules.crm-autorules .crm-rules-menu {position:absolute;top:calc(100% + 7px);right:0;z-index:1000;width:100%;min-width:190px;padding:5px;border:1px solid var(--ui-line);border-radius:12px;background:var(--ui-card);box-shadow:var(--ui-pop-shadow,0 12px 36px #16203620)}
#page-rules.crm-autorules .crm-rules-menu[hidden] {display:none}
#page-rules.crm-autorules .crm-rules-menu button {display:flex;align-items:center;justify-content:space-between;width:100%;padding:10px 11px;min-height:38px;border:0;border-radius:8px;background:transparent;color:var(--ui-text);font-size:13px;text-align:left}
#page-rules.crm-autorules .crm-rules-menu button[aria-selected=true] {color:var(--ui-blue);background:var(--ui-tint);font-weight:600}
#page-rules.crm-autorules .crm-rules-menu button[aria-selected=true]::after {content:'✓';font-size:16px}
#page-rules.crm-autorules .crm-rules-navigation {display:flex;align-items:center;justify-content:space-between;margin:0 0 20px;gap:16px;min-height:44px}
#page-rules.crm-autorules .filters {display:inline-flex;gap:4px;padding:4px;border:1px solid var(--ui-line);border-radius:11px;background:var(--ui-card)}
#page-rules.crm-autorules .filters button {display:block;min-height:34px;min-width:96px;padding:7px 20px;border:0;border-radius:7px;color:var(--ui-muted);font-weight:600;font-size:13px;line-height:20px;background:transparent;box-shadow:none}
#page-rules.crm-autorules .filters button.active {background:var(--ui-tint);color:var(--ui-blue)}
#page-rules.crm-autorules .filters #budgetDropTab {min-width:155px}
#page-rules.crm-autorules .crm-rules-status {display:flex;align-items:center;gap:8px;color:var(--ui-muted);max-width:450px;line-height:1.4}
#page-rules.crm-autorules .crm-rules-status::before {content:'';flex:none;width:6px;height:6px;background:var(--ui-muted);border-radius:50%}
#page-rules.crm-autorules .crm-rules-status[data-tone=ok]::before {background:var(--ui-blue)}
#page-rules.crm-autorules .crm-rules-status[data-tone=error] {color:#bb6600}
#page-rules.crm-autorules .crm-rules-status[data-tone=error]::before {background:#d98816}
#page-rules.crm-autorules #automationStatus {display:none;margin:0 0 20px!important;padding:14px 16px;border:1px solid color-mix(in srgb,#d98816 25%,var(--ui-line));border-radius:11px;background:color-mix(in srgb,#d98816 7%,var(--ui-card));color:var(--ui-text)!important;font-size:12px;line-height:1.75;overflow-wrap:anywhere}
#page-rules.crm-autorules #automationStatus[data-visible=true] {display:block}
#page-rules.crm-autorules .crm-rules-create {display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:16px!important;border:1px solid var(--ui-line)!important;border-radius:14px!important;background:var(--ui-card)!important;margin:0 0 18px!important}
#page-rules.crm-autorules .crm-rules-create>div:first-child {width:190px!important}
#page-rules.crm-autorules .crm-rules-create>span {font-size:12px;line-height:1.6;color:var(--ui-muted)!important;margin-left:auto!important;max-width:470px;text-align:right}
#page-rules.crm-autorules .rule-input {height:38px!important;width:77px!important;min-width:0;padding:8px 9px!important;border:1px solid var(--ui-line)!important;border-radius:8px!important;background:var(--ui-bg)!important;color:var(--ui-text)!important;font-family:inherit;font-size:13px;font-weight:500;line-height:20px;text-align:center;box-shadow:none;appearance:textfield;font-variant-numeric:tabular-nums}
#page-rules.crm-autorules .rule-input::-webkit-inner-spin-button,#page-rules.crm-autorules .rule-input::-webkit-outer-spin-button {appearance:none;margin:0}
#page-rules.crm-autorules .rule-input::placeholder {color:var(--ui-muted);opacity:1}
#page-rules.crm-autorules #newRuleGeo {width:100%!important;height:42px!important;text-align:left;text-transform:uppercase;padding:10px 12px!important}
#page-rules.crm-autorules .rule-input:focus {border-color:var(--ui-blue)!important;outline:none;box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-blue) 15%,transparent)}
#page-rules.crm-autorules #ruleLevelContainer>.top-action-btn {min-width:143px!important;justify-content:space-between;font-weight:500!important;background:var(--ui-bg)}
#page-rules.crm-autorules #ruleLevelContainer>.top-action-btn>svg {width:16px!important;height:16px!important;fill:none!important;stroke:currentColor;stroke-width:1.7;color:var(--ui-muted)}
#page-rules.crm-autorules :is(#ruleLevelDropdown,#ruleGeoSuggestions) {position:absolute;top:calc(100% + 6px);left:0;right:auto;width:100%;min-width:145px!important;z-index:1100;padding:5px!important;border:1px solid var(--ui-line);border-radius:11px;background:var(--ui-card);box-shadow:var(--ui-pop-shadow);font-size:13px;max-height:260px;overflow:auto}
#page-rules.crm-autorules :is(.sort-item,.geo-suggestion-item) {padding:10px 11px;min-height:36px;border-radius:7px;color:var(--ui-text);font-size:13px;cursor:pointer}
#page-rules.crm-autorules .table-container {background:var(--ui-card);border:1px solid var(--ui-line);border-radius:14px;box-shadow:none;overflow:auto;margin:0}
#page-rules.crm-autorules table {border-collapse:collapse;width:100%;background:var(--ui-card);table-layout:auto}
#page-rules.crm-autorules thead {background:color-mix(in srgb,var(--ui-bg) 70%,var(--ui-card))}
#page-rules.crm-autorules th {padding:15px 14px;border-bottom:1px solid var(--ui-line);color:var(--ui-muted);font-size:11px;line-height:1.4;font-weight:600;text-transform:none;letter-spacing:0;text-align:left;white-space:nowrap}
#page-rules.crm-autorules th .crm-rule-unit {display:block;font-size:10px;font-weight:450;opacity:.9;margin-top:3px}
#page-rules.crm-autorules td {padding:14px;border-bottom:1px solid var(--ui-line);color:var(--ui-text);font-size:13px;line-height:1.5;vertical-align:middle;white-space:normal}
#page-rules.crm-autorules tbody tr:last-child td {border-bottom:0}
#page-rules.crm-autorules tbody tr {background:var(--ui-card)}
#page-rules.crm-autorules #rules-tab-content table {min-width:1200px}
#page-rules.crm-autorules #rules-tab-content :is(th,td):nth-child(n+3):nth-child(-n+10) {text-align:center}
#page-rules.crm-autorules #rules-tab-content :is(th,td):first-child {padding-left:20px;width:70px}
#page-rules.crm-autorules #rules-tab-content :is(th,td):last-child {padding-right:18px;text-align:right;white-space:nowrap}
#page-rules.crm-autorules #rules-tab-content td:first-child {font-weight:700;font-size:13px}
#page-rules.crm-autorules .acc-meta-chip {display:inline-block;padding:3px 7px;border:1px solid var(--ui-line);border-radius:6px;background:var(--ui-bg);font-size:11px;font-weight:500;line-height:16px;color:var(--ui-muted)}
#page-rules.crm-autorules .switch {position:relative;display:inline-block;width:34px!important;height:20px!important;vertical-align:middle;border-radius:99px;cursor:pointer;overflow:visible}
#page-rules.crm-autorules .switch input {position:absolute;inset:-4px;width:42px!important;height:28px!important;margin:0;opacity:0;cursor:pointer;z-index:2}
#page-rules.crm-autorules .switch .slider {position:absolute;inset:0;border:0;border-radius:99px;background:var(--ui-line);transition:background-color 120ms;pointer-events:none}
#page-rules.crm-autorules .switch .slider::before {position:absolute;content:'';left:3px!important;bottom:3px!important;top:auto;width:14px!important;height:14px!important;border-radius:50%;background:#fff;transform:none;transition:transform 120ms;box-shadow:0 1px 2px #0002}
#page-rules.crm-autorules .switch input:checked+.slider {background:var(--ui-blue)!important}
#page-rules.crm-autorules .switch input:checked+.slider::before {transform:translateX(14px)!important}
#page-rules.crm-autorules .switch input:focus-visible+.slider {outline:2px solid var(--ui-blue);outline-offset:4px}
#page-rules.crm-autorules .switch input:disabled+.slider {opacity:.45}
#page-rules.crm-autorules #rules-table-body .top-action-btn {padding:7px 11px!important;min-height:34px;font-size:12px;font-weight:600;background:transparent!important;border:1px solid var(--ui-line)!important;color:var(--ui-blue)!important;border-radius:8px;box-shadow:none}
#page-rules.crm-autorules .btn-delete {padding:7px 10px!important;min-height:34px;border:1px solid transparent!important;border-radius:8px;background:transparent!important;color:#e25460!important;font-size:12px;font-weight:500;box-shadow:none;white-space:nowrap}
#page-rules.crm-autorules #rules-table-body .btn-delete {margin-left:5px}
#page-rules.crm-autorules #history-tab-content table {min-width:1000px}
#page-rules.crm-autorules #history-table-body td:first-child {white-space:nowrap;color:var(--ui-muted);font-size:12px;font-variant-numeric:tabular-nums}
#page-rules.crm-autorules #history-table-body td:nth-child(4) {font-weight:550;min-width:230px}
#page-rules.crm-autorules #history-table-body td:last-child {min-width:250px;max-width:390px;font-size:12px;line-height:1.7}
#page-rules.crm-autorules #history-table-body td:last-child b {display:inline-block;padding:2px 7px;margin:0 0 5px;border-radius:5px;font-size:11px;font-weight:600;background:var(--ui-tint);color:var(--ui-blue)}
#page-rules.crm-autorules #history-table-body tr[data-outcome=error] td:last-child b {color:#d64a57;background:color-mix(in srgb,#e25460 10%,var(--ui-card))}
#page-rules.crm-autorules #history-table-body td:last-child {color:var(--ui-muted)!important}
#page-rules.crm-autorules .crm-rules-card-heading {display:flex;align-items:center;justify-content:space-between!important;gap:16px;min-height:65px;padding:14px 20px;margin:0!important;border:1px solid var(--ui-line);border-bottom:0;border-radius:14px 14px 0 0;background:var(--ui-card)}
#page-rules.crm-autorules .crm-rules-card-heading p {margin:0;color:var(--ui-text);font-size:14px;font-weight:600}
#page-rules.crm-autorules .crm-rules-card-heading p span {color:var(--ui-muted);font-size:12px;font-weight:400;margin-left:8px}
#page-rules.crm-autorules .crm-rules-card-heading+.table-container {border-radius:0 0 14px 14px}
#page-rules.crm-autorules #clearWhitelistButton {border-color:var(--ui-line)!important;padding:8px 12px!important}
#page-rules.crm-autorules #whitelist-tab-content table {min-width:1000px}
#page-rules.crm-autorules #whitelist-table-body td:nth-child(2) {font-weight:550;min-width:220px}
#page-rules.crm-autorules #whitelist-table-body :is(td:nth-child(3),td:nth-child(4),td:nth-child(5)) {color:var(--ui-muted);font-size:12px;font-variant-numeric:tabular-nums}
#page-rules.crm-autorules #whitelist-table-body td:nth-child(6) {font-variant-numeric:tabular-nums;color:var(--ui-blue);font-size:12px}
#page-rules.crm-autorules #whitelist-table-body .badge {display:inline-block;padding:3px 7px;border:1px solid var(--ui-line);border-radius:6px;background:var(--ui-bg)!important;color:var(--ui-muted)!important;font-size:11px;font-weight:500;line-height:16px;letter-spacing:0}
#page-rules.crm-autorules #whitelist-table-body .badge-wl {display:inline-block;padding:3px 7px;border:0;border-radius:6px;background:var(--ui-tint)!important;color:var(--ui-blue)!important;font-size:12px;font-weight:500;line-height:18px}
#page-rules.crm-autorules #history-table-body .agent-chip {padding:3px 7px;border-radius:6px;background:var(--ui-tint);color:var(--ui-blue);font-size:11px;line-height:17px;font-weight:500;letter-spacing:0}
@media(hover:hover) {
 #page-rules.crm-autorules :is(.crm-rules-menu button,.filters button,.sort-item,.geo-suggestion-item):hover {background:var(--ui-tint);color:var(--ui-blue)}
 #page-rules.crm-autorules .top-action-btn:hover {border-color:var(--ui-blue);background:var(--ui-tint)}
 #page-rules.crm-autorules :is(#runNowBtn,.crm-rules-add):hover {background:color-mix(in srgb,var(--ui-blue) 90%,#172138)!important}
 #page-rules.crm-autorules .btn-delete:hover {background:color-mix(in srgb,#e25460 9%,var(--ui-card))!important}
 #page-rules.crm-autorules tbody tr:hover {background:color-mix(in srgb,var(--ui-tint) 40%,var(--ui-card))}
}
@media(max-width:1100px) {#page-rules.crm-autorules .crm-rules-create>span {max-width:100%;text-align:left;margin-left:0!important;flex-basis:100%}}
@media(max-width:700px) {
 body.crm-interface-v2 #page-rules.crm-autorules {padding:20px 16px 80px}
 #page-rules.crm-autorules .top-header {align-items:flex-start;flex-direction:column;gap:18px}
 #page-rules.crm-autorules .page-title {font-size:23px}
 #page-rules.crm-autorules .header-controls {width:100%;gap:8px;flex-wrap:nowrap}
 #page-rules.crm-autorules .crm-rules-interval {flex:1;min-width:0}
 #page-rules.crm-autorules .crm-rules-interval-button {min-width:0;width:100%;padding:10px 8px;font-size:12px;gap:5px}
 #page-rules.crm-autorules .crm-rules-interval-button>svg {width:14px;height:14px}
 #page-rules.crm-autorules .crm-rules-interval-button>span {min-width:0;overflow:hidden;text-overflow:ellipsis}
 #page-rules.crm-autorules .crm-rules-interval-button>span {font-size:0}
 #page-rules.crm-autorules .crm-rules-interval-button>span::after {content:attr(data-short);font-size:12px}
 #page-rules.crm-autorules #runNowBtn {padding:10px;font-size:12px}
 #page-rules.crm-autorules .crm-rules-navigation {align-items:stretch;flex-direction:column;gap:12px}
 #page-rules.crm-autorules .filters {width:100%}
 #page-rules.crm-autorules .filters button {min-width:0!important;flex:1;padding:7px 6px;font-size:12px;white-space:normal}
 #page-rules.crm-autorules .filters #budgetDropTab {flex:1.4;line-height:15px}
 #page-rules.crm-autorules .crm-rules-status {font-size:12px}
 #page-rules.crm-autorules .crm-rules-create {padding:12px!important;gap:8px}
 #page-rules.crm-autorules .crm-rules-create>div:first-child {width:calc(50% - 4px)!important;flex:1;min-width:140px}
 #page-rules.crm-autorules #ruleLevelContainer {flex:1}
 #page-rules.crm-autorules #ruleLevelContainer>.top-action-btn {width:100%;min-width:0!important}
 #page-rules.crm-autorules .crm-rules-add {width:100%}
 #page-rules.crm-autorules .crm-rules-card-heading {padding:14px}
 #page-rules.crm-autorules .crm-rules-card-heading p span {display:block;margin:4px 0 0}
}
@media(prefers-reduced-motion:reduce) {#page-rules.crm-autorules *,#page-rules.crm-autorules *::before {transition:none!important}}

/* Return the original compact table rhythm without shrinking its text. */
#page-rules.crm-autorules :is(.crm-rules-card-heading,.budget-drop-journal-heading) {position:relative;flex-wrap:wrap}
#page-rules.crm-autorules .crm-rules-read-status {flex:0 0 100%;order:3;color:var(--ui-orange);font-family:inherit;font-size:12px;font-weight:400;line-height:1.5;overflow-wrap:anywhere}
#page-rules.crm-autorules .crm-rules-read-status[data-state=loading] {position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

#page-rules.crm-autorules .top-header {margin-bottom:16px}
#page-rules.crm-autorules .crm-rules-navigation {margin-bottom:14px}
#page-rules.crm-autorules #automationStatus {margin-bottom:14px!important;padding:10px 14px}
#page-rules.crm-autorules .crm-rules-create {padding:12px 14px!important;margin-bottom:14px!important}
#page-rules.crm-autorules th {padding:10px 14px}
#page-rules.crm-autorules td {padding:8px 14px}
#page-rules.crm-autorules #rules-table-body .rule-input {height:32px!important;padding:5px 8px!important}
#page-rules.crm-autorules #rules-table-body .top-action-btn,#page-rules.crm-autorules .btn-delete {min-height:32px;padding:5px 10px!important}
#page-rules.crm-autorules .switch .slider::before {left:2px!important;bottom:2px!important;width:16px!important;height:16px!important}
#page-rules.crm-autorules .crm-rules-card-heading {min-height:50px;padding:10px 16px}
#page-rules.crm-autorules #history-table-body td:last-child {line-height:1.5}
#page-rules.crm-autorules #history-table-body td:last-child b {margin-bottom:3px}
@media(hover:hover) and (pointer:fine) {
 #page-rules.crm-autorules #rules-table-body .top-action-btn:hover:not(:disabled) {background:var(--ui-tint)!important;border-color:color-mix(in srgb,var(--ui-blue) 28%,var(--ui-line))!important}
}
#page-rules.crm-autorules #rules-table-body .top-action-btn:focus-visible {background:var(--ui-tint)!important;border-color:var(--ui-blue)!important}
@media(pointer:coarse) {
 #page-rules.crm-autorules #rules-table-body .rule-input {height:36px!important}
 #page-rules.crm-autorules #rules-table-body .top-action-btn,#page-rules.crm-autorules .btn-delete {min-height:36px}
}

/* Keep the native Autorules tabs beside the title; preserve the live status below. */
#page-rules.crm-autorules .top-header {
  display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:flex-start;
  gap:12px 18px;margin-bottom:8px;min-width:0;
}
#page-rules.crm-autorules .top-header>.page-title {flex:0 0 auto}
#page-rules.crm-autorules .top-header>.filters {flex:0 1 auto;min-width:0}
#page-rules.crm-autorules .top-header>.header-controls {flex:0 0 auto;margin-left:auto;min-width:0}
#page-rules.crm-autorules .crm-rules-navigation {
  flex-direction:row;align-items:center;justify-content:flex-start;gap:0;
  min-height:0;margin:0 0 12px;
}
#page-rules.crm-autorules .crm-rules-navigation>.crm-rules-status {flex:0 1 auto;min-width:0;max-width:100%;overflow-wrap:anywhere}
@media(max-width:700px) {
  #page-rules.crm-autorules .top-header {gap:12px}
  #page-rules.crm-autorules .top-header>.filters {flex-basis:100%;width:100%}
  #page-rules.crm-autorules .top-header>.header-controls {flex-basis:100%;width:100%;margin-left:0}
}
