/* ==========================================================================
   OBJECT SETTINGS  (assets/css/object-settings.css)  -  object-settings.php
   Settings > Objects > <object>: banner, object picker, tabs, setup links,
   views tables. Uses base.css tokens (light + dark). Prefix: .os-
   ========================================================================== */
.os { min-width: 0; max-width: 100%; }
.os [hidden] { display: none !important; }

.os-banner { display: flex; gap: var(--sp-4); padding: 16px 20px; margin-bottom: var(--sp-6); background: var(--accent-soft); border: 1px solid #f5b971; border-radius: var(--radius); }
.os-banner__title { margin: 0 0 4px; font-weight: 600; font-size: 16px; }
.os-banner__text { margin: 0; font-size: 14px; line-height: 1.8; }
.os-pill { display: inline-flex; align-items: center; margin-left: 6px; padding: 3px 12px; font-size: 12.5px; font-weight: 500; color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--text-subtle); border-radius: var(--radius-pill); white-space: nowrap; }
.os-pill:hover { border-color: var(--text); }

.os-title { margin: 0 0 var(--sp-5); font-size: 26px; font-weight: 400; }

/* object picker card */
.os-picker { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; padding: 16px 24px; margin-bottom: var(--sp-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.os-picker__label { font-weight: 600; font-size: 15px; }
.os-picker__side { display: inline-flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; margin-left: auto; }
.os-picker__count { font-size: 14px; color: var(--text-muted); }
.os-select { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 250px; max-width: 100%; height: 40px; padding: 0 12px; font: inherit; font-size: 15px; color: var(--text); background: var(--surface); border: 1px solid var(--text); border-radius: var(--radius-sm); cursor: pointer; }
.os-select__value { display: inline-flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-select__value .icon { color: var(--text-muted); flex: none; }
.os-dd { position: relative; display: inline-flex; }

/* popovers (position: fixed + clamped by JS) */
.os-pop { position: fixed; z-index: 1200; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.os-pop--objects { width: 260px; padding: 8px 0 6px; }
.os-pop__search { position: relative; display: block; margin: 0 10px 8px; }
.os-pop__search input { width: 100%; height: 36px; padding: 0 34px 0 12px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-pill); }
.os-pop__search input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus-ring); }
.os-pop__search .icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-subtle); pointer-events: none; }
.os-pop__list { max-height: 320px; overflow-y: auto; }
.os-pop__head { margin: 10px 14px 4px; font-size: 13px; font-weight: 700; }
.os-pop__link { display: block; padding: 6px 14px; font-size: 13.5px; font-weight: 600; color: var(--brand-ink); text-decoration: none; }
.os-pop__empty { margin: 8px 14px; font-size: 13px; color: var(--text-subtle); }
.os-opt { display: flex; align-items: center; gap: 10px; padding: 9px 14px; font-size: 14px; color: var(--text); text-decoration: none; }
.os-opt .icon { color: var(--text-muted); flex: none; }
.os-opt:hover, .os-opt:focus-visible { background: var(--surface-hover); outline: none; }
.os-opt.is-selected { background: var(--surface-3); font-weight: 500; }
.os-pop--menu { min-width: 200px; padding: 6px; }
.os-menu__item { display: flex; width: 100%; padding: 9px 12px; font: inherit; font-size: 14px; color: var(--text); text-align: left; text-decoration: none; background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer; }
.os-menu__item:hover, .os-menu__item:focus-visible { background: var(--surface-hover); outline: none; }
.os-menu__item--danger { color: var(--danger); }

/* tabs (folder style like the reference) */
.os-tabbar { display: flex; align-items: flex-end; gap: var(--sp-4); border-bottom: 1px solid var(--border-strong); }
.os-tabs { display: flex; align-items: flex-end; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.os-tabs::-webkit-scrollbar { display: none; }
.os-tab { display: inline-flex; align-items: center; gap: 4px; padding: 14px 24px; margin-bottom: -1px; font: inherit; font-size: 15px; color: var(--text); text-decoration: none; white-space: nowrap; background: var(--surface-2); border: 1px solid var(--border-strong); border-left-width: 0; cursor: pointer; }
.os-tabs > .os-tab:first-child { border-left-width: 1px; border-top-left-radius: var(--radius-sm); }
.os-tab-more .os-tab { border-top-right-radius: var(--radius-sm); }
.os-tab:hover { background: var(--surface-hover); }
.os-tab.is-active { font-weight: 600; background: var(--surface); border-bottom-color: var(--surface); }
.os-tab--index { display: none; }
.os-tab--index.is-active { display: inline-flex; }
.os-viewlink { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 0 0 12px; font-size: 14.5px; font-weight: 600; color: var(--brand-ink); text-decoration: none; white-space: nowrap; min-width: 0; max-width: 220px; }
.os-viewlink span { overflow: hidden; text-overflow: ellipsis; }
.os-viewlink:hover span { text-decoration: underline; }

/* panels */
.os-panel { padding: var(--sp-5) var(--sp-4) var(--sp-8); }
.os-setup-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); padding-bottom: var(--sp-5); margin-bottom: var(--sp-6); border-bottom: 1px solid var(--border-strong); }
.os-desc { flex: 1; min-width: 0; max-width: 640px; }
.os-desc__text { margin: 0 0 6px; line-height: 1.6; overflow-wrap: anywhere; }
.os-desc__input { width: 100%; height: auto; padding: 10px 12px; resize: vertical; }
.os-desc__btns { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); }
.os-actions { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 14px; font: inherit; font-size: 13.5px; color: var(--text); background: var(--surface); border: 1px solid var(--text-subtle); border-radius: var(--radius-pill); cursor: pointer; }
.os-actions:hover, .os-actions[aria-expanded="true"] { border-color: var(--text); }
.os-link { padding: 0; font: inherit; font-weight: 600; color: var(--brand-ink); text-decoration: none; background: none; border: 0; cursor: pointer; }
.os-link:hover { text-decoration: underline; }
.os-block { margin-bottom: var(--sp-6); }
.os-block--tight { margin-bottom: var(--sp-4); }
.os-block__title { margin: 0 0 var(--sp-4); font-size: 21px; font-weight: 500; }
.os-block__text { margin: 4px 0 0; font-size: 13.5px; color: var(--text-muted); }
.os-intro { padding-bottom: var(--sp-4); margin: 0 0 var(--sp-5); font-size: 14px; border-bottom: 1px solid var(--border); }
.os-index__title { margin: 0 0 var(--sp-4); font-size: 20px; font-weight: 500; }
.os-tip { display: inline-grid; place-items: center; color: var(--text-muted); vertical-align: middle; cursor: help; }
.os-tooltip { position: fixed; z-index: 1300; max-width: 260px; padding: 8px 12px; font-size: 12.5px; color: #fff; background: #1d2939; border-radius: var(--radius-sm); pointer-events: none; }

/* pipelines */
.os-subtabs { display: flex; gap: var(--sp-5); margin-bottom: var(--sp-8); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.os-subtab { position: relative; padding: 10px 16px 12px; font-size: 14.5px; color: var(--text); text-decoration: none; white-space: nowrap; }
.os-subtab.is-active { font-weight: 600; }
.os-subtab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--text); }
.os-empty { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); padding: var(--sp-6) var(--sp-4); text-align: center; }
.os-empty__art { width: 180px; max-width: 60%; margin-bottom: var(--sp-3); }
.os-empty__art .g { fill: #f5dfa8; }
.os-empty__art .c { fill: #dfe7f2; stroke: #48566a; stroke-width: 1.5; }
.os-empty__art .a { fill: none; stroke: #20a39e; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.os-empty__art .b { fill: #c87a3a; stroke: #48566a; stroke-width: 1.5; }
.os-empty__art .h { fill: none; stroke: #48566a; stroke-width: 2; }
.os-empty__title { margin: 0; font-size: 18px; font-weight: 600; }
.os-empty__text { margin: 0 0 var(--sp-3); font-size: 14px; color: var(--text-muted); }

/* views table */
.os-toolbar { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.os-search { position: relative; display: block; width: 260px; max-width: 100%; }
.os-search input { width: 100%; height: 38px; padding: 0 38px 0 14px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-pill); }
.os-search input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus-ring); }
.os-search .icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.os-table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.os-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 14px; }
.os-table th { padding: 12px 16px; text-align: left; font-weight: 500; white-space: nowrap; border-bottom: 1px solid var(--text-subtle); }
.os-table td { padding: 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
/* A tag's condition reads as written ("Pitch Deck Link is known"), not in the settings tables' capitals. */
.settings table td.os-tag-condition { text-transform: none; }
.os-table tbody tr:hover td { background: var(--surface-2); }
.os-table__check { width: 44px; }
.os-table__actions { width: 80px; text-align: center !important; }
.os-sort { display: inline-flex; align-items: center; gap: 6px; padding: 0; font: inherit; font-weight: 500; color: inherit; background: none; border: 0; cursor: pointer; }
.os-sort .icon { color: var(--text-muted); }
.os-viewname { display: inline-flex; align-items: center; gap: 10px; }
.os-viewname__icon { display: grid; place-items: center; width: 22px; height: 22px; color: var(--surface); background: var(--text-muted); border-radius: 50%; flex: none; }
.os-viewname__icon .icon { width: 12px; height: 12px; }
.os-dots { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--text-subtle); border-radius: 50%; cursor: pointer; }
.os-dots[disabled] { opacity: .5; cursor: not-allowed; }
.os-noresults { padding: var(--sp-5); text-align: center; color: var(--text-muted); }
.os-pager { display: flex; align-items: center; justify-content: center; gap: 10px; padding: var(--sp-4) 0; font-size: 14px; }
.os-pager__step { display: inline-flex; align-items: center; gap: 4px; }
.os-pager__step.is-off { color: var(--text-subtle); }
.os-pager__num { display: inline-grid; place-items: center; min-width: 24px; height: 26px; border: 1px solid var(--text-subtle); border-radius: 6px; }

/* modal */
.os-modal { position: fixed; inset: 0; z-index: 1250; display: grid; place-items: center; padding: var(--sp-4); background: rgba(16, 24, 40, .45); }
.os-modal__box { width: min(460px, 100%); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.os-modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.os-modal__head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.os-x { display: grid; place-items: center; width: 32px; height: 32px; color: var(--text-muted); background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer; }
.os-x:hover { background: var(--surface-hover); }
.os-modal__body { display: flex; flex-direction: column; gap: var(--sp-4); padding: 20px 24px; }
.os-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.os-field .input { font-weight: 400; }
.os-modal__foot { display: flex; gap: var(--sp-2); padding: 16px 24px; border-top: 1px solid var(--border); }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .os-tab { padding: 12px 16px; font-size: 14px; }
}
@media (max-width: 767.98px) {
  .os-banner { padding: 14px 16px; }
  .os-title { font-size: 22px; margin-bottom: var(--sp-4); }
  .os-picker { padding: 14px 16px; gap: var(--sp-3); }
  .os-picker__label { width: 100%; }
  .os-picker .os-dd { flex: 1 1 100%; }
  .os-select { width: 100%; }
  .os-picker__side { margin-left: 0; width: 100%; justify-content: space-between; }
  .os-tabbar { flex-direction: column; align-items: stretch; gap: 0; }
  .os-viewlink { order: -1; margin: 0 0 var(--sp-3); padding: 0; max-width: 100%; }
  .os-panel { padding: var(--sp-4) 0 var(--sp-6); }
  .os-block__title { font-size: 18px; }
  .os-setup-top { flex-direction: column; }
  .os-search { width: 100%; }
}
@media (max-width: 420px) {
  .os-picker__create { width: 100%; }
  .os-tab { padding: 10px 12px; }
}

/* text areas never show the resize handle */
.os textarea, .os-desc__input, .os-modal textarea { resize: none; }

/* ==========================================================================
   Activities settings: Email Log & Track | Email Frequency Controls | Associations
   ========================================================================== */
.os-act { max-width: 960px; }
.os-intro--rule { padding-bottom: var(--sp-4); }
.os-h2 { margin: 0 0 4px; font-size: 20px; font-weight: 600; }
.os-h2--gap { margin-top: var(--sp-8); padding-top: var(--sp-6); border-top: 1px solid var(--border); }
.os-sub { margin: 0 0 var(--sp-4); font-size: 14.5px; line-height: 1.5; }
.os-opt-row, .os-radio-row { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 var(--sp-4); max-width: 640px; cursor: pointer; }
.os-opt-row .check { flex: none; margin-top: 1px; }
.os-opt-row b, .os-radio-row b { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; }
.os-opt-row small, .os-radio-row small { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.5; color: var(--text-muted); }
.os-opt-row small .os-link, .os-radio-row small .os-link { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; }
.os-opt-row--indent { margin-left: 32px; max-width: 608px; }
.os-opt-row.is-off { opacity: .55; cursor: not-allowed; }
.os-radio-row input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--text); }
.os-radio-row b { font-weight: 500; font-size: 15.5px; }
.os-new { padding: 1px 7px; font-size: 10.5px; font-weight: 800; letter-spacing: .03em; color: #fff; background: #12805c; border-radius: var(--radius-pill); }
.os-sub-opt { margin: -6px 0 var(--sp-4) 32px; }
.os-sub-opt__label { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 8px; font-weight: 600; font-size: 14.5px; }
.os-switch { position: relative; display: inline-flex; cursor: pointer; }
.os-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.os-switch__ui { position: relative; width: 52px; height: 26px; background: var(--border-strong); border-radius: 6px; transition: background var(--fast, .15s); }
.os-switch__ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 4px; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform var(--fast, .15s); }
.os-switch input:checked + .os-switch__ui { background: var(--text); }
.os-switch input:checked + .os-switch__ui::after { transform: translateX(26px); }
.os-switch input:focus-visible + .os-switch__ui { box-shadow: var(--focus-ring); }
.os-alert { position: relative; margin: var(--sp-2) 0 var(--sp-5); padding: 16px 48px 16px 20px; font-size: 14.5px; line-height: 1.6; background: #fff8e6; border: 1px solid #f2c94c; border-radius: var(--radius-lg); }
.os-alert p { margin: 0 0 4px; }
.os-alert__title { font-weight: 700; font-size: 16px; }
.os-alert .os-link { display: inline-flex; align-items: center; gap: 4px; }
.os-alert__x { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 28px; height: 28px; color: var(--text-muted); background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer; }
.os-alert__x:hover { background: rgba(0, 0, 0, .06); }
.os-acc { margin-top: var(--sp-5); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.os-acc__btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 16px 0; font: inherit; font-size: 15.5px; font-weight: 600; color: var(--text); text-align: left; background: none; border: 0; cursor: pointer; }
.os-acc__btn .icon { transition: transform var(--fast, .15s); }
.os-acc__btn.is-open .icon { transform: rotate(90deg); }
.os-acc__body { padding: 0 0 var(--sp-4) 22px; }
.os-acc__body .os-block__text { margin-bottom: var(--sp-4); max-width: 560px; }
.os-link--strong { font-size: 14px; }
.os-nl-bar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3) var(--sp-5); margin-bottom: var(--sp-2); }
.os-nl-bar .os-search { width: 300px; }
.os-nl-view { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.os-nl-view__btn, .os-nl-type { display: inline-flex; align-items: center; gap: 4px; padding: 0; font: inherit; font-size: 14px; font-weight: 600; color: var(--text); background: none; border: 0; cursor: pointer; }
.os-nl-view__btn[disabled] { color: var(--text-muted); cursor: default; }
.os-nl-add { margin-bottom: var(--sp-4); }
.os-nl-table { min-width: 0; }
.os-nl-table__by { width: 1%; white-space: nowrap; text-align: right; }
.os-nl-table__by .btn-crm { margin-right: var(--sp-6); }
.os-nl-tag { display: inline-block; padding: 2px 8px; font-size: 12px; font-weight: 700; background: var(--surface-3); border: 1px solid var(--text-subtle); border-radius: 4px; }
.os-copy-field { max-width: 450px; margin-bottom: var(--sp-5); }
.os-copy-field__label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14.5px; }
.os-copy { display: flex; }
.os-copy .input { flex: 1 1 auto; min-width: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.os-copy__btn { flex: none; padding: 0 22px; font: inherit; font-weight: 700; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; cursor: pointer; }
.os-copy__btn:hover { background: var(--surface-hover); }
.os-copy-field__help { margin: 6px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--text-muted); }
.os-num-field { display: flex; flex-direction: column; gap: 4px; max-width: 460px; margin-bottom: var(--sp-5); }
.os-num-field__label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14.5px; }
.os-num-field__help { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.os-num-field .input.is-invalid { border-color: var(--danger); }
.os-num-field__err { margin: 0; font-size: 12.5px; color: var(--danger); }
.os-assoc-pick { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-6); padding: 24px 20px; margin-bottom: var(--sp-6); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); }
.os-assoc-pick__col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.os-assoc-pick__label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 16px; }
.os-select--sm { width: auto; min-width: 150px; }
.os-log-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-5); }
.os-log-head .os-sub { max-width: 700px; }
.os-reset { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.os-log-row { margin-bottom: var(--sp-5); }
.os-log-row__label { margin: 0 0 6px; font-weight: 600; font-size: 14.5px; }
.os-log-row__help { margin: -4px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.os-log-row__btn { width: 340px; }
.os-pop--log { width: 340px; max-width: calc(100vw - 16px); }
.os-log-opt { flex-direction: column; align-items: flex-start; gap: 3px; }
.os-log-opt__l { display: inline-flex; align-items: center; gap: 8px; }
.os-log-opt small { font-size: 12px; line-height: 1.45; color: var(--text-muted); }
.os-log-opt.is-selected, .os-menu__item.is-selected { background: var(--surface-3); }
.os-default { display: inline-block; padding: 1px 6px; font-size: 10.5px; font-weight: 700; color: #fff; background: #c4321d; border-radius: 4px; }
.os-picker--plain { padding: 20px 28px; }
.os-savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; padding: 12px clamp(16px, 3vw, 40px); background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(16, 24, 40, .08); }
.os-savebar__text { font-weight: 600; font-size: 14px; }
.os-savebar__btns { display: inline-flex; gap: var(--sp-2); }
body.os-has-savebar .settings__main { padding-bottom: 90px; }
.os-modal__text { margin: 0; font-size: 14px; line-height: 1.55; }
.os-nl-text { resize: none; }
@media (max-width: 767.98px) {
  .os-log-head { flex-direction: column; gap: 0; }
  .os-reset { margin-bottom: var(--sp-5); }
  .os-assoc-pick { padding: 16px; }
  .os-opt-row--indent, .os-sub-opt { margin-left: 0; }
  .os-nl-table__by .btn-crm { margin-right: var(--sp-2); }
  .os-savebar { bottom: var(--mobile-nav-h, 0px); }
}
@media (max-width: 420px) {
  .os-log-row__btn, .os-select--sm, .os-nl-bar .os-search { width: 100%; }
  .os-assoc-pick__col { width: 100%; }
  .os-assoc-pick__col .os-dd { width: 100%; }
  .os-copy__btn { padding: 0 14px; }
  .os-alert { padding: 14px 40px 14px 14px; font-size: 13.5px; }
  .os-nl-table td, .os-nl-table th { padding: 12px 10px; }
  .os-nl-table td:first-child { word-break: break-all; }
}
.os-act ~ .os-viewlink, .os-tabbar .os-viewlink { max-width: 300px; }
.os-panel.os-act .icon.iconSize-14 { width: 14px; height: 14px; }
.os-log-row__btn, .os-pop--log { width: 380px; }
.os-intro .os-link, .os-sub .os-link { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
@media (min-width: 768px) { .os-tabbar .os-viewlink { max-width: none; } }
@media (max-width: 420px) { .os-log-row__btn { width: 100%; } }
.os-nl-table__by .btn-crm { height: 28px; min-height: 0; padding: 0 12px; font-size: 12.5px; font-weight: 500; border-radius: 999px; }
.os-log-row .os-dd { display: block; max-width: 100%; }
.os-log-row__btn { max-width: 100%; }
/* tab bar: tabs never get clipped; when the link doesn't fit beside them it moves above, right-aligned */
@media (min-width: 768px) {
  .os-tabbar { flex-wrap: wrap-reverse; row-gap: 4px; }
  .os-tabs { flex: 0 1 auto; max-width: 100%; }
  .os-tabbar .os-viewlink { flex: none; max-width: 100%; margin-left: auto; }
  .os-tabbar .os-viewlink span { overflow: visible; }
}
.os-tabs > .os-tab:last-child { border-top-right-radius: var(--radius-sm); }
/* tabs wrap onto a second row instead of being cut off on narrow screens */
.os-tabs { flex-wrap: wrap; overflow: visible; padding-left: 1px; }
.os-tabs > .os-tab, .os-tabs > .os-tab-more > .os-tab { border-left-width: 1px; margin-left: -1px; }
@media (max-width: 1100px) { .os-tabs > .os-tab, .os-tabs > .os-tab-more > .os-tab { flex: 1 0 auto; justify-content: center; } }
@media (max-width: 767.98px) { .os-tabbar .os-viewlink { white-space: normal; } .os-tabbar .os-viewlink span { overflow: visible; } }

/* ==========================================================================
   Round 19 - every object in "Select an object" has its own tabs + setup
   ========================================================================== */
/* tabs: one row; what doesn't fit goes into "More" (object-settings.js) */
.os-tabs { flex: 1 1 auto; flex-wrap: nowrap; overflow: hidden; padding-left: 0; }
.os-tabs > .os-tab, .os-tabs > .os-tab-more > .os-tab { flex: none; justify-content: flex-start; border-left-width: 0; margin-left: 0; }
.os-tabs > .os-tab:first-child { border-left-width: 1px; }
.os-tab-more { flex: none; }
.os-tab-more > .os-tab { border-top-right-radius: var(--radius-sm); }
.os-tabs > .os-tab:last-of-type { border-top-right-radius: 0; }
.os-tabs > .os-tab:last-of-type:nth-last-child(2) { border-top-right-radius: var(--radius-sm); }
.os-tab .os-new { margin-left: 6px; }
@media (min-width: 768px) {
  .os-tabbar { flex-wrap: nowrap; }
  .os-tabs { max-width: none; }
  .os-tabbar .os-viewlink { flex: none; }
}
@media (max-width: 767.98px) { .os-tabs { overflow: hidden; } }
.os-pop [data-os-tab].os-menu__item { display: flex; }

.os-setup { max-width: 920px; }
.os-lead { margin: 0 0 var(--sp-6); padding: 0 0 var(--sp-6); font-size: 15px; border-bottom: 1px solid var(--border-strong); }
.os-setup .os-block { margin-bottom: var(--sp-6); }
.os-setup .os-block__title, .os-panel .os-block__title { margin: 0 0 var(--sp-4); font-size: 19px; font-weight: 600; }
.os-block__text--dark { color: var(--text); font-size: 14px; }
.os-field-label { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-weight: 700; font-size: 14.5px; }
.os-gap { margin-top: var(--sp-5); }
.os-gap-sm { margin-top: var(--sp-3); }
.os-gap-lg { margin-top: var(--sp-8); }
.os-gap-b { margin-bottom: var(--sp-4); }
.os-indent { margin-left: 32px; }
.os-muted { color: var(--text-muted); }
.os-grow { flex: 1 1 auto; }
.os-link--sm { font-size: 13px; }
.os-link--ext { display: inline-flex; align-items: center; gap: 3px; }
.os-block--field .os-dd { margin-top: var(--sp-3); }
.os-select--field { width: 400px; font-size: 15px; }
.os-select--wide { width: 400px; }
.os-select--mid { width: 200px; }
.os-select--narrow { width: 150px; }
.os-formlink { display: flex; align-items: flex-start; gap: var(--sp-4); }
.os-formlink > span { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.os-thumb { flex: none; display: flex; gap: 4px; width: 92px; height: 58px; padding: 6px; background: #8a96a8; border: 1px solid #b7c2d2; border-radius: 4px; overflow: hidden; }
.os-thumb__grid { flex: 1; display: flex; gap: 3px; }
.os-thumb__grid i { flex: 1; background: #dfe5ee; border-radius: 2px; }
.os-thumb__side { width: 26px; display: flex; flex-direction: column; gap: 4px; padding: 3px; background: #fff; border-left: 2px solid #20b2aa; }
.os-thumb__side i { height: 4px; background: #c9d3e0; border-radius: 2px; }
.os-opt-row small:empty { display: none; }
.os-opt-row .os-link--sm { margin-top: 4px; }
.os-sub-radios { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.os-sub-radios__field { margin: 2px 0 6px 32px; }
.os-inline-fields { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.os-num-input { width: 90px; height: 40px; }
.os-radio-row--sm { margin-bottom: 6px; align-items: center; }
.os-radio-row--sm span { font-size: 15px; }
.os-sub-fields { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: var(--sp-3); }
.os-sub-fields .os-dd { margin-top: 8px; }
.os-switch-row { display: flex; align-items: flex-start; gap: 14px; max-width: 720px; margin-bottom: var(--sp-5); }
.os-switch-row .os-switch { flex: none; margin-top: 2px; }
.os-switch-row b { display: block; font-size: 14.5px; font-weight: 600; }
.os-switch-row small { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.5; color: var(--text-muted); }
.os-switch input:disabled + .os-switch__ui { opacity: .55; cursor: not-allowed; }
.os-bullets { margin: 4px 0 0; padding-left: 22px; font-size: 14px; }
.os-off { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); max-width: 560px; margin: var(--sp-8) auto; text-align: center; }
.os-off__art { width: 160px; height: 120px; }
.os-off__art .a { fill: var(--surface); stroke: var(--border-strong); stroke-width: 2; }
.os-off__art .b { stroke: var(--border-strong); stroke-width: 2; }
.os-off__art .c { fill: var(--surface-3); }
.os-off__art .d { fill: #fdecea; stroke: #e5484d; stroke-width: 2; }
.os-off__art .e { stroke: #e5484d; stroke-width: 3; stroke-linecap: round; }
.os-off__title { margin: 0; font-size: 20px; font-weight: 600; }
.os-off__text { margin: 0 0 var(--sp-2); font-size: 14.5px; line-height: 1.6; color: var(--text-muted); }
.os-card { margin-top: var(--sp-5); padding: var(--sp-2) var(--sp-5) var(--sp-6); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); }
.os-card { min-width: 0; } /* lets a wide stage table scroll inside it */
.os-card .os-subtabs { margin-bottom: var(--sp-5); }
.os-subtabs--flat { margin-bottom: var(--sp-6); }
.os-alert--info { background: #e5f5f8; border-color: #7fd1de; }
.os-alert--warn { background: #fff8e6; border-color: #f2c94c; margin-bottom: var(--sp-5); }
.os-styles { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.os-style { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 8px 14px; font: inherit; font-size: 13.5px; color: var(--text); background: var(--surface); border: 1px solid var(--text-subtle); border-radius: var(--radius-sm); cursor: pointer; }
.os-style.is-active { background: var(--surface-3); border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.os-style__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.os-style__badge { padding: 3px 8px; font-size: 12px; font-weight: 700; color: #fff; background: var(--brand); border-radius: 4px; }
.os-lc-table { min-width: 960px; }
.os-lc-table th, .os-lc-table td { white-space: nowrap; }
.os-cell-input { height: 36px; min-width: 170px; }
.os-code { font-family: inherit; font-size: 13.5px; color: var(--text-muted); }
.os-icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; color: var(--text-muted); background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer; }
.os-icon-btn:hover { color: var(--danger); background: var(--surface-hover); }
button.os-link[disabled] { opacity: .5; cursor: not-allowed; text-decoration: none; }
.os-pl-bar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3); margin: var(--sp-6) 0 var(--sp-3); }
.os-pl-count { font-size: 14px; }
.os-pl-create { display: inline-flex; align-items: center; gap: 4px; }
.os-pl-table { min-width: 860px; }
.os-pl-name { display: inline-flex; align-items: center; gap: 6px; }
.os-grip { display: inline-flex; color: var(--text-subtle); cursor: grab; }
.os-actions--sm { height: 30px; padding: 0 12px; font-size: 13px; }
.os-tag { display: inline-block; margin: 2px 6px 2px 0; padding: 2px 8px; font-size: 12.5px; background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: 4px; }
.os-table--compact { min-width: 0; }
.os-table--compact td, .os-table--compact th { padding: 12px 14px; }
.os-usage { display: flex; flex-direction: column; gap: 6px; max-width: 420px; margin: var(--sp-3) 0; }
.os-usage__n { font-size: 20px; font-weight: 700; }
.os-usage__bar { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.os-usage__bar i { display: block; height: 100%; background: var(--brand); }
.os-promo { margin: var(--sp-2) 0 var(--sp-5); padding: 18px 20px; background: var(--surface-2, #f7f8fa); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); }
.os-promo p { margin: 0 0 8px; font-size: 14px; }
.os-inv { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--sp-6); align-items: start; }
.os-inv__view { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: var(--sp-3) 0 var(--sp-4); font-size: 14px; }
.os-h3 { margin: var(--sp-6) 0 var(--sp-3); font-size: 16px; font-weight: 700; }
.os-textarea { width: 100%; max-width: 560px; resize: none; }
.os-inv__preview { position: sticky; top: 80px; }
.os-invdoc { display: flex; flex-direction: column; gap: 10px; padding: 20px; min-height: 340px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow); }
.os-invdoc__title { margin: 0; font-size: 20px; font-weight: 700; }
.os-invdoc__muted { margin: 0; font-size: 12px; color: var(--text-muted); }
.os-invdoc__line { height: 8px; background: var(--surface-3); border-radius: 4px; }
.os-invdoc__line--s { width: 60%; }
.os-invdoc__table { height: 110px; background: repeating-linear-gradient(var(--surface-2, #f7f8fa) 0 22px, var(--surface) 22px 26px); border: 1px solid var(--border); border-radius: 4px; }
.os-tpl-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.os-tpl-table { min-width: 560px; }
.os-check-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; cursor: pointer; }
.os-rte { max-width: 640px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.os-rte__bar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 6px; border-bottom: 1px solid var(--border); background: var(--surface-2, #f7f8fa); }
.os-rte__bar .os-select { height: 32px; font-size: 13px; }
.os-rte__btn { display: inline-grid; place-items: center; min-width: 32px; height: 32px; font: inherit; font-size: 14px; color: var(--text); background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer; }
.os-rte__btn:hover { background: var(--surface-hover); }
.os-rte__body { min-height: 90px; padding: 12px 14px; font-size: 14px; outline: none; }
.os-rte__body:focus { box-shadow: inset 0 0 0 2px var(--brand); }
.os-url-input { width: 100%; max-width: 420px; margin-top: 6px; }
@media (max-width: 1100px) { .os-inv { grid-template-columns: minmax(0, 1fr); } .os-inv__preview { position: static; } }
@media (max-width: 767.98px) {
  .os-select--field, .os-select--wide { width: 100%; }
  .os-block--field .os-dd { width: 100%; }
  .os-indent, .os-sub-radios__field { margin-left: 0; }
  .os-pl-bar .os-search { width: 100%; }
  .os-card { padding: var(--sp-2) var(--sp-3) var(--sp-5); }
  .os-off { margin: var(--sp-5) auto; }
}
@media (max-width: 420px) {
  .os-select--mid, .os-select--narrow { width: 100%; }
  .os-sub-fields .os-dd, .os-sub-fields { width: 100%; }
  .os-formlink { flex-direction: column; gap: var(--sp-2); }
  .os-styles .os-style { flex: 1 1 100%; }
}
/* tabs take the room they need (up to all but 140px); the data-model link shortens with "…" like the reference */
@media (min-width: 768px) {
  .os-tabs { flex: 0 1 auto; max-width: calc(100% - 140px); }
  .os-tabbar .os-viewlink { flex: 1 1 0; min-width: 0; max-width: none; justify-content: flex-end; }
  .os-tabbar .os-viewlink span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 767.98px) { .os-tabs { max-width: 100%; } }
@media (max-width: 420px) {
  .os .os-dd { max-width: 100%; }
  .os .os-select { max-width: 100%; }
  .os-picker .os-dd, .os-picker .os-select { width: 100%; }
  .os-off .btn-crm { white-space: normal; height: auto; min-height: 36px; padding-top: 8px; padding-bottom: 8px; text-align: center; }
}

/* ==========================================================================
   React port (ObjectsSettingsView): menus are portalled AnchoredPopovers,
   settings without an API yet are disabled and tagged "Coming soon".
   ========================================================================== */
.crm-anchored-popover.os-pop { overflow-y: auto; }
.os-pop .os-menu__item:disabled { color: var(--text-subtle); cursor: not-allowed; background: none; }
.os-soon { display: inline-block; padding: 1px 8px; font-size: 11px; font-weight: 600; line-height: 1.6; color: var(--text-muted); white-space: nowrap; vertical-align: middle; background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-pill); }
.os-opt-row.is-off .os-soon { opacity: 1; }
.os-style:disabled, .os-select:disabled, .os-actions:disabled, .os-nl-view__btn:disabled { opacity: .6; cursor: not-allowed; }
.os-icon-btn:disabled { opacity: .4; cursor: not-allowed; background: none; color: var(--text-muted); }
.os-tab-more > .os-dd > .os-tab { border-top-right-radius: var(--radius-sm); }
.os-tab[hidden] { display: none; }
.os .alert { margin-bottom: var(--sp-5); }
[data-theme="dark"] .os-alert, [data-theme="dark"] .os-alert--warn { background: rgba(242, 201, 76, .1); border-color: rgba(242, 201, 76, .45); }
[data-theme="dark"] .os-alert--info { background: rgba(127, 209, 222, .1); border-color: rgba(127, 209, 222, .45); }
[data-theme="dark"] .os-alert__x:hover { background: rgba(255, 255, 255, .08); }

/* Record tags (Pipelines > Tags) */
.os-tagchip { display: inline-flex; align-items: center; padding: 2px 10px; font-size: 13px; font-weight: 600; border-radius: var(--radius-pill); border: 1px solid transparent; }
.os-tagchip--gray { color: #344054; background: #f2f4f7; border-color: #d0d5dd; }
.os-tagchip--blue { color: #1849a9; background: #eff8ff; border-color: #b2ddff; }
.os-tagchip--green { color: #05603a; background: #ecfdf3; border-color: #abefc6; }
.os-tagchip--yellow { color: #854a0e; background: #fefbe8; border-color: #fde272; }
.os-tagchip--orange { color: #93370d; background: #fff6ed; border-color: #fdba74; }
.os-tagchip--red { color: #912018; background: #fef3f2; border-color: #fecdca; }
.os-tagchip--pink { color: #9e165f; background: #fdf2fa; border-color: #fcceee; }
.os-tagchip--purple { color: #5925dc; background: #f4f3ff; border-color: #d9d6fe; }
[data-theme="dark"] .os-tagchip { filter: saturate(.9); border-color: transparent; }

/* General (HubSpot): every tab stays in the row, no More menu; a narrow row scrolls sideways. */
.os-tabs.os-tabs--scroll { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.os-tabs.os-tabs--scroll::-webkit-scrollbar { display: none; }
.os-tabs.os-tabs--scroll > .os-tab:last-of-type { border-top-right-radius: var(--radius-sm); }
/* SQ-15: the scrolling row clips outside outlines, so draw the focus ring inside the tab. */
.os-tabs.os-tabs--scroll > .os-tab:focus-visible { outline-offset: -2px; }
/* SQ-15: tighter tabs when the row is narrow, so all seven fit at 1280 like HubSpot. */
.os-tabbar:has(> .os-tabs--scroll) { container-type: inline-size; }
@container (max-width: 760px) { .os-tabs.os-tabs--scroll > .os-tab { padding-left: 16px; padding-right: 16px; } }
/* SQ-15: when it still doesn't fit, fade the edge that has more tabs past it, so a cut-off row reads as scrollable. */
.os-tabs.os-tabs--more-end { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
.os-tabs.os-tabs--more-start { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); }
.os-tabs.os-tabs--more-start.os-tabs--more-end { -webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
