/* FORGEO Design System · 0.9.9.8.4
   Visual-only layer. Baseline app.css retains all module/interaction styles.
   Layouts remain independent for desktop and mobile. No calculation styling hooks changed. */
:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --card: #ffffff;
  --text: #17233a;
  --muted: #718096;
  --line: #e2e8f1;
  --primary: #2457d6;
  --primary-soft: #ecf2ff;
  --soft: #f7f9fd;
  --radius: 16px;
  --sidebar-w: 248px;
  --topbar-h: 72px;
  --shadow: 0 2px 8px rgba(30, 49, 86, .025), 0 13px 32px rgba(30, 49, 86, .028);
  --design-ring: 0 0 0 3px rgba(36, 87, 214, .12);
}
html { scrollbar-gutter: stable; }
body { background: var(--bg); color: var(--text); font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif; font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { transition: color .16s ease; }
button { touch-action: manipulation; }
:where(a,button,input,select,textarea,summary):focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
::selection { background: #cbd9ff; color: #152b60; }

/* Navigation: a stable product identity, strong hierarchy, unobtrusive account entry. */
.app-topbar {
  height: var(--topbar-h); min-height: var(--topbar-h); padding: 0 30px 0 24px;
  border-bottom: 1px solid #e1e8f3; background: rgba(255,255,255,.96);
  backdrop-filter: blur(14px) saturate(140%); box-shadow: 0 2px 12px rgba(24,46,92,.025);
  z-index: 22;
}
.app-topbar .topbar-left { flex-direction: row; align-items: center; min-width: 0; gap: 0; }
.app-topbar .brand { display: inline-flex; align-items: center; min-height: 50px; gap: 10px; font-size: 18px; font-weight: 800; letter-spacing: -.045em; color: #17233a; }
.app-topbar .brand img { height: 36px; width: 36px; max-width: none; border-radius: 9px; object-fit: contain; }
.app-topbar .brand span { line-height: 1; }
.app-topbar .org {
  display: flex; align-items: center; min-width: 0; max-width: 390px; gap: 9px;
  margin: 0 0 0 23px; padding: 5px 0 5px 23px; border-left: 1px solid #e2e8f1;
  font-weight: 580; font-size: 12px; letter-spacing: .005em; color: #697990;
}
.org-status { display: inline-block; width: 7px; height: 7px; flex: 0 0 auto; background: #20a47a; border-radius: 50%; box-shadow: 0 0 0 3px #e5f6ee; }
.app-topbar .userbox { display: flex; gap: 0; min-width: 0; }
.app-topbar .profile-link {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  color: #364661; font-size: 12px; font-weight: 690; border: 1px solid #e4eaf3;
  background: #fff; border-radius: 99px; min-height: 43px; padding: 4px 11px 4px 5px;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.app-topbar .profile-link:hover { border-color: #bdcef3; background: #f8faff; box-shadow: 0 2px 7px rgba(36,87,214,.05); }
.profile-avatar { display: grid; place-items: center; border-radius: 50%; width: 32px; height: 32px; flex: 0 0 auto; background: #e9f0ff; color: #2457d6; font-size: 13px; font-weight: 800; }
.profile-caption { overflow: hidden; max-width: 160px; white-space: nowrap; text-overflow: ellipsis; }
.app-topbar .profile-link>svg { width: 15px; height: 15px; flex: 0 0 auto; color: #8b99ae; }

.app-sidebar { top: var(--topbar-h); width: var(--sidebar-w); display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid #e0e8f3; background: linear-gradient(180deg,#fff 0%,#fcfdff 100%); box-shadow: 2px 0 16px rgba(23,47,83,.018); }
.sidebar-scroll { flex: 1 1 auto; height: auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #d9e2f1 transparent; padding: 25px 13px 18px; }
.sidebar-group { margin: 0 0 12px; padding: 0 0 11px; border: 0; }
.sidebar-group + .sidebar-group { border-top: 1px solid #edf1f7; padding-top: 17px; }
.sidebar-label { display: block; padding: 0 12px 10px; color: #97a4b7; font-size: 10px; letter-spacing: .13em; font-weight: 760; }
.app-sidebar a { display: flex; align-items: center; gap: 11px; min-height: 42px; margin: 3px 0; padding: 9px 12px; border-radius: 11px; font-weight: 580; font-size: 13px; color: #53627a; line-height: 1.35; transition: background .15s, color .15s, box-shadow .15s; }
.app-sidebar a:hover { background: #f2f5fc; color: #203d7e; }
.app-sidebar a.active { background: #edf3ff; color: #1d4bb8; font-weight: 760; box-shadow: inset 3px 0 0 #2457d6; }
.nav-item-title { min-width: 0; }
.nav-item-icon { display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px; flex: 0 0 19px; color: #8492a8; }
.nav-item-icon svg { width: 18px; height: 18px; }
.app-sidebar a.active .nav-item-icon, .app-sidebar a:hover .nav-item-icon { color: #2457d6; }
.sidebar-ui-actions { padding: 5px 5px 0; }
.sidebar-ui-actions .sidebar-icon-button { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; height: auto; min-height: 40px; border: 1px dashed #d7e1f1; border-radius: 10px; background: #f8faff; color: #4866a0; padding: 9px 11px; font-size: 12px; font-weight: 690; line-height: 1.25; }
.sidebar-icon-button svg { width: 17px; height: 17px; }
.sidebar-ui-actions .sidebar-icon-button:hover { border-color: #aac2f1; background: #edf3ff; color: #2457d6; }
.sidebar-footer { flex: 0 0 auto; padding: 11px 14px 15px; border-top: 1px solid #edf0f6; background: rgba(250,252,255,.95); }
.sidebar-footer a { display: flex; padding: 9px 12px; font-size: 12px; }
.sidebar-footer-arrow { width: 15px; height: 15px; margin-left: auto; opacity: .6; }

/* Consistent page rhythm and surfaces. No structural re-ordering of personal layouts. */
.page-with-sidebar { margin-left: var(--sidebar-w); margin-right: 0; width: auto; max-width: 1700px; padding: 32px clamp(20px, 3.2vw, 54px) 88px; }
.page-with-sidebar > * { min-width: 0; }
h1, h2, h3 { color: #1b2b47; }
h1 { letter-spacing: -.045em; }
.heading, .page-heading { margin: 0 0 23px; align-items: center; gap: 18px; }
.heading h1 { margin: 0 0 5px; font-size: clamp(25px, 2.15vw, 32px); font-weight: 775; line-height: 1.2; letter-spacing: -.045em; }
.heading p { color: #8290a3; font-size: 13px; line-height: 1.5; max-width: 920px; }
.page-kicker, .eyebrow { margin: 0 0 7px; color: #7689aa; letter-spacing: .125em; font-size: 10px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 760; margin-bottom: 14px; letter-spacing: -.025em; }
h3 { font-size: 14px; font-weight: 740; }
.sectionhead { align-items: flex-start; min-width: 0; gap: 12px; margin-bottom: 8px; }
.sectionhead h2 { margin: 0 0 4px; }
.sectionhead p { color: #8793a6; line-height: 1.5; }
.muted { color: #7c899d; }
.card, .page-block { background: #fff; border: 1px solid #e1e8f2; border-radius: var(--radius); box-shadow: var(--shadow); }
.card { padding: 22px 24px; margin-bottom: 17px; }
.card > :last-child:not(.sectionhead) { margin-bottom: 0; }
.page-block { margin-bottom: 13px; }
.page-block>summary { min-height: 55px; padding: 17px 22px; }
.page-block>summary:hover { background: #f8faff; }
.page-block-body { padding: 20px 22px; }
.section-subblock + .section-subblock { border-color: #e9eef6; }
.stats { gap: 14px; margin-bottom: 18px; }
.stat { padding: 19px 20px; border: 1px solid #e2e9f3; border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.stat strong { margin-top: 10px; color: #193458; font-size: 27px; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.stat span { color: #7a899f; font-size: 12px; }
.twocol, .threecol, .inventory-actions, .integrations-top-grid { gap: 16px; }

/* Buttons and inputs: adequate touch targets, spacing, visual hierarchy. */
.button, .primary, .ghost, button.buttonlike, a.buttonlike { min-height: 41px; display: inline-flex; justify-content: center; align-items: center; gap: 7px; padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: 12px; line-height: 1.3; white-space: normal; text-align: center; transition: background .16s, border-color .16s, box-shadow .16s, transform .16s; }
.primary { background: #2457d6; border: 1px solid #2457d6; color: #fff; box-shadow: 0 3px 7px rgba(36,87,214,.13); }
.primary:hover { background: #1b48b8; border-color: #1b48b8; box-shadow: 0 5px 13px rgba(36,87,214,.2); }
.ghost { background: #fff; color: #3d526c; border: 1px solid #dce4f0; box-shadow: 0 1px 2px rgba(20,42,75,.02); }
.ghost:hover { background: #f5f8ff; border-color: #c6d4ed; }
.danger-outline { border-color: #f0d1cd; color: #b42318; }
input, select, textarea { width: 100%; max-width: 100%; border: 1px solid #dbe3ee; border-radius: 10px; padding: 10px 12px; min-height: 43px; background-color: #fff; color: var(--text); font-size: 13px; transition: border-color .16s, box-shadow .16s; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; min-height: 0; padding: 0; flex: 0 0 auto; accent-color: #2457d6; }
input[type="file"] { height: auto; min-height: 43px; padding: 9px; }
input:focus, select:focus, textarea:focus { border-color: #90adf0; box-shadow: var(--design-ring); outline: 0; }
input::placeholder, textarea::placeholder { color: #abb5c3; }
label { color: #53637b; font-size: 12px; font-weight: 680; line-height: 1.35; }
label:has(input[type="checkbox"]), label:has(input[type="radio"]) { display: inline-flex; align-items: center; gap: 8px; }
.stack { gap: 17px; }
.gridform { gap: 18px; }
.inlineform, .integrations-actions, .analytics-upload-form, .analytics-period-form { gap: 10px 12px; }
.inlineform > *, .integrations-actions > *, .analytics-upload-form > * { min-width: 0; }
.tablewrap { max-width: 100%; border: 1px solid #e1e8f1; border-radius: 12px; background: #fff; overflow-x: auto; scrollbar-color: #d3def1 transparent; }
table { border-collapse: separate; border-spacing: 0; }
th { background: #f8faff; color: #7b8ba3; font-size: 10px; font-weight: 760; letter-spacing: .07em; border-bottom: 1px solid #e7edf6; }
th, td { padding: 13px 14px; text-align: left; vertical-align: middle; }
td { color: #35445d; border-color: #edf1f7; font-size: 12px; }
tbody tr:hover { background: #fafcff; }
td strong { color: #1e304c; }
.badge { border-radius: 7px; font-size: 11px!important; font-weight: 740; padding: 5px 8px; }
.alert, .success { border-radius: 11px; line-height: 1.5; }
.empty-state { min-height: 145px; border-radius: 12px; background: #f9fbff; }

/* Dashboard: large numbers, functional color, and distinct compact actions. */
.dashboard-heading { margin-bottom: 21px; }
.dashboard-heading-actions { gap: 9px; }
.icon-button, .sidebar-icon-button { border-color: #d9e3f0; }
.dashboard-heading-actions .icon-button { width: 41px; height: 41px; background: white; border-radius: 11px; }
.dashboard-heading-actions .icon-button:hover { box-shadow: var(--design-ring); }
.dashboard-layout { gap: 16px; }
.dashboard-widget > .card { border: 1px solid #e1e8f2; box-shadow: var(--shadow); }
.dashboard-widget .sectionhead { margin-bottom: 13px; }
.dashboard-widget .sectionhead a { font-size: 12px; font-weight: 700; white-space: nowrap; }
.dashboard-attention { position: relative; min-height: 0; overflow: hidden; padding: 21px 24px 20px; }
.dashboard-attention.has-attention { background: #fff; border-color: #e6eaf2; }
.dashboard-attention.has-attention:before { content: ""; position: absolute; top: 20px; bottom: 20px; left: 0; width: 3px; background: #d99b4d; border-radius: 0 4px 4px 0; }
.dashboard-attention.is-calm { background: linear-gradient(110deg, #fff 0%, #fbfffd 100%); border-color: #d9eae2; }
.dashboard-focus-title { align-items: center; }
.dashboard-focus-title strong { color: #1d3859; font-size: 21px; line-height: 1.2; letter-spacing: -.035em; }
.dashboard-focus-title .eyebrow { color: #8b9aab; font-size: 10px; }
.dashboard-calm-copy { margin-top: 13px; }
.compact-attention-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.compact-attention-list .attention-row { padding: 11px 13px; border: 1px solid #eef0f5; border-radius: 10px; background: #fdfdfe; }
.compact-attention-list .attention-row:hover { background: #f8faff; border-color: #dbe4f4; }
.dashboard-widget .dashboard-metrics.compact-metrics { gap: 11px; margin-top: 18px; }
.metric-card { min-height: 108px; padding: 18px; border-radius: 12px; background: #f9fbff; border-color: #e3eaf4; box-shadow: none; }
.metric-card:hover { background: #f5f8ff; border-color: #cbd9f5; transform: translateY(-2px); box-shadow: 0 8px 16px rgba(32,67,130,.06); }
.metric-card > span { color: #71819b; font-size: 11px; font-weight: 740; }
.metric-card > strong { color: #1d3658; font-size: 28px; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.metric-card small { color: #8d9cb0; }
.metric-card[data-tone="blue"] { background: #f0f5ff; border-color: #dae6ff; }
.metric-card[data-tone="blue"] > strong { color: #2859bf; }
.quick-actions-card { padding: 21px 24px; }
.quick-action-grid { gap: 11px; }
.quick-action-grid a { position: relative; min-height: 84px; gap: 6px; padding: 16px 17px; border: 1px solid #e2e9f3; border-radius: 12px; background: #f8faff; transition: transform .18s, background .18s, border-color .18s, box-shadow .18s; }
.quick-action-grid a:hover { transform: translateY(-2px); background: #f1f6ff; border-color: #c5d5f6; box-shadow: 0 9px 20px rgba(32,67,130,.055); }
.quick-action-grid strong { color: #243a5b; font-size: 13px; }
.quick-action-grid span { color: #8795a9; font-size: 11px; }
.dashboard-order-row, .mini-row { border-color: #ebeff5; }
.dashboard-order-row:hover, .mini-row:hover { background: #f9fbff; }
.dashboard-add-widget { margin-top: 17px; width: 41px; height: 41px; border: 1px dashed #c6d4e8; background: white; color: #5d7bb3; }
.dashboard-add-widget:hover { border-color: #87a6e9; box-shadow: 0 3px 10px rgba(36,87,214,.06); }

/* Integration/status cards: product-like cards, not a wall of controls. */
.integration-modules { padding: 21px 23px 24px; margin: 0 0 17px; background: white; border: 1px solid #e1e8f2; border-radius: var(--radius); box-shadow: var(--shadow); }
.integration-modules .sectionhead { margin: 0 0 16px; }
.integration-module-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.integration-module-card { position: relative; min-height: 119px; padding: 17px; border: 1px solid #e0e7f1; border-radius: 12px; background: #f9fbff; display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; transition: border-color .16s, background .16s; }
.integration-module-card > div:first-child { flex: 1; min-width: 0; }
.integration-module-card strong { display: block; margin: 0 0 5px; font-size: 14px; font-weight: 765; color: #263c60; }
.integration-module-card span:not(.badge) { display: block; color: #8794a8; font-size: 11px; line-height: 1.5; }
.integration-module-card.is-ready { background: linear-gradient(135deg,#f6f9ff,#fff); border-color: #cbd9f4; }
.integration-module-card.is-disabled { background: #fbfcfe; border-color: #e9eef5; }
.integration-module-card.is-disabled .badge { background: #f0f3f8!important; color: #7b899a!important; white-space: nowrap; }
.module-switch-form { flex: 0 0 auto; }
.integrations-top-grid > .card, #ozon-performance { min-width: 0; }
.integrations-top-grid .card .sectionhead { margin-bottom: 17px; }
.integrations-details { margin: 4px 0; }
.integrations-details > div { gap: 20px; }
.integrations-products-head { align-items: center; flex-wrap: wrap; }
.integrations-counts { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.integrations-product-tools { margin: 15px 0; }
.integrations-products-table table { width: 100%; }
.integrations-product-tools input { max-width: 480px; }
.ozon-product-link-cell form { gap: 8px; }

.integration-onboarding { margin-top: 15px; padding: 14px 15px; background: #f7faff; border: 1px solid #e3ebf8; border-radius: 11px; }
.integration-onboarding p { margin: 9px 0 0; color: #4d617f; font-size: 12px; line-height: 1.55; }
.integration-onboarding p.small { color: #8997ac; }
.onboarding-step { display: inline-flex; color: #2d60bf; background: #eaf1ff; border-radius: 6px; font-weight: 750; font-size: 10px; padding: 4px 7px; }

/* Analytics/Ozon: visual organization only; all calculations and form hooks preserved. */
.analytics-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 13px; align-items: end; }
.analytics-period-form { display: flex; align-items: end; flex-wrap: wrap; }
.analytics-period-form label { min-width: 125px; }
.analytics-upload-form { display: flex; align-items: center; flex-wrap: wrap; }
.analytics-kpis { gap: 13px; }
.kpi-card { border: 1px solid #e1e8f2; border-radius: 14px; background: #fff; }
.kpi-card > span { color: #73849b; font-size: 11px; }
.kpi-card > strong { color: #1f3757; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.kpi-card.profit { background: #f1f8f5; border-color: #cfe9dc; }
.kpi-card.profit > strong { color: #136a4d; }
.analytics-settings-card { overflow: hidden; }
.analytics-settings-card > summary { font-weight: 735; }
.analytics-bottom-grid { gap: 16px; }

/* Forms across the whole app, and profile exit located with session settings. */
.formcard { min-width: 0; }
.profile-grid { align-items: stretch; }
.profile-grid > .card { height: 100%; }
.profile-grid .details > div { padding: 11px 0; border-color: #eef1f7; }
.profile-grid .details dd { overflow-wrap: anywhere; }
.profile-session-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 18px; border-style: dashed; background: #fbfcff; }
.profile-session-card h2 { margin: 0 0 3px; font-size: 14px; }
.profile-session-card p { margin: 0; }
.profile-session-card form { margin: 0; }
.profile-session-card button { white-space: nowrap; }

/* Personalization drawer: keep all existing data-ui-* gestures/handlers intact. */
.ui-customizer-backdrop { background: rgba(17,30,53,.45); backdrop-filter: blur(2px); }
.ui-customizer-sheet { width: min(460px,96vw); border-left: 1px solid #e0e8f1; box-shadow: -22px 0 55px rgba(18,36,72,.16); }
.ui-customizer-head { padding: 26px 25px 21px; background: linear-gradient(180deg,#fafcff 0%,#fff 100%); }
.ui-customizer-head strong { color: #243956; font-size: 19px; }
.ui-customizer-head span { color: #8898ad; line-height: 1.5; }
.ui-customizer-list { padding: 16px 20px 28px; }
.ui-editor-row { border-color: #e4eaf3; border-radius: 12px; box-shadow: none; }
.ui-editor-row.is-hidden-item { background: #f9fafc; }
.ui-customizer-actions { padding: 17px 21px; box-shadow: 0 -6px 18px rgba(27,45,78,.035); }
.ui-visibility-button { border-color: #dbe4f1; }
.ui-sort-placeholder { border-color: #a4bbec; }

/* Scroll to top appears only after user scrolls upwards on a long page. */
.back-to-top { position: fixed; right: 24px; bottom: 22px; z-index: 60; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 1px solid #d6e0ef; border-radius: 13px; color: #355ca8; background: rgba(255,255,255,.96); box-shadow: 0 7px 22px rgba(21,42,84,.11); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(11px); pointer-events: none; transition: opacity .2s, transform .2s, visibility .2s, background .2s; }
.back-to-top svg { width: 22px; height: 22px; }
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { background: #edf3ff; }

/* Tablet and mobile are intentionally distinct from the desktop shell. */
@media (max-width: 1180px) {
  :root { --sidebar-w: 222px; }
  .page-with-sidebar { padding: 25px 22px 78px; }
  .integration-module-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .compact-attention-list { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  html { scrollbar-gutter: auto; }
  :root { --topbar-h: 62px; --sidebar-w: 248px; }
  .app-topbar { height: var(--topbar-h); min-height: var(--topbar-h); padding: 0 17px; }
  .app-topbar .brand { min-height: 43px; font-size: 17px; }
  .app-topbar .brand img { height: 33px; width: 33px; }
  .app-topbar .org { max-width: 37vw; font-size: 11px; margin-left: 17px; padding-left: 17px; }
  .sidebar-toggle { width: 38px; height: 38px; display: block; margin-right: 7px; }
  .app-sidebar { top: var(--topbar-h); width: min(84vw,310px); box-shadow: 16px 0 42px rgba(17,34,63,.16); }
  .sidebar-backdrop { inset: var(--topbar-h) 0 0 0; }
  .page.page-with-sidebar { margin-left: 0; margin-right: 0; width: 100%; max-width: 100%; padding: 22px 18px 104px; }
  .dashboard-layout { grid-template-columns: 1fr; gap: 13px; }
  .dashboard-widget { grid-column: auto!important; }
  .dashboard-widget .dashboard-metrics.compact-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .quick-action-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .profile-caption { display: none; }
  .app-topbar .profile-link { padding: 4px 7px 4px 4px; }
  .profile-avatar { width: 32px; height: 32px; }
  .app-topbar .profile-link>svg { width: 14px; }
  .app-mobile-bottom-nav { border: 1px solid #e1e7f1; border-radius: 16px; box-shadow: 0 7px 28px rgba(24,46,83,.13); background: rgba(255,255,255,.97); backdrop-filter: blur(12px); }
  .app-mobile-bottom-nav a, .app-mobile-bottom-nav button { border-radius: 11px; color: #8090a5; font-weight: 650; }
  .app-mobile-bottom-nav .active { color: #2457d6; background: #f0f5ff; }
  .mobile-menu-sheet { background: #fff; border: 1px solid #e2e8f2; border-radius: 21px 21px 0 0; }
  .mobile-menu-grid a { border-color: #e5ecf5; background: #fbfcff; }
  .ui-customizer-sheet { width: 100%; height: min(88dvh,780px); border-radius: 22px 22px 0 0; }
  .ui-customizer-list { padding: 12px 14px 20px; }
  .back-to-top { right: 15px; bottom: 96px; width: 42px; height: 42px; }
}
@media (max-width: 640px) {
  body { font-size: 13px; }
  .app-topbar { padding: 0 12px; justify-content: space-between; align-items: center; }
  .app-topbar .topbar-left { flex: 0 1 auto; align-items: center; }
  .app-topbar .brand span { display: inline-block; }
  .app-topbar .userbox { display: flex; flex: 0 0 auto; }
  .app-topbar .userbox .profile-link { display: inline-flex; max-width: none; }
  .dashboard-widget .dashboard-metrics.compact-metrics { grid-template-columns: repeat(2,minmax(0,1fr))!important; }
  .app-topbar .org { display: none; }
  .app-topbar .brand { font-size: 17px; }
  .app-topbar .profile-link > svg { display: none; }
  .app-topbar .profile-link { padding: 4px; min-width: 42px; }
  .page.page-with-sidebar { padding: 18px 12px 112px; }
  .heading, .page-heading { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
  .heading h1 { font-size: 25px; }
  .heading p { font-size: 12px; }
  .dashboard-heading-actions { width: 100%; }
  .dashboard-heading-actions .primary { flex: 1; }
  .card { padding: 17px; margin-bottom: 12px; border-radius: 13px; }
  .page-block { border-radius: 13px; }
  .page-block>summary { padding: 15px 16px; }
  .page-block-body { padding: 16px; }
  .stat { padding: 15px; }
  .stat strong { font-size: 23px; }
  .sectionhead { flex-wrap: wrap; }
  .dashboard-attention, .quick-actions-card { padding: 18px; }
  .dashboard-widget .dashboard-metrics.compact-metrics { gap: 9px; }
  .metric-card { min-height: 94px; padding: 14px 12px; }
  .metric-card > strong { font-size: 24px; }
  .quick-action-grid { gap: 8px; }
  .quick-action-grid a { padding: 13px; min-height: 80px; }
  .quick-action-grid strong { font-size: 12px; }
  .quick-action-grid span { font-size: 10px; }
  .integration-modules { padding: 17px; border-radius: 13px; }
  .integration-module-grid { grid-template-columns: 1fr; gap: 9px; }
  .integration-module-card { min-height: 88px; padding: 14px; }
  .profile-session-card { flex-wrap: wrap; }
  .profile-session-card button { width: 100%; }
  .profile-session-card form { width: 100%; }
  .analytics-toolbar { align-items: stretch; }
  .analytics-period-form { width: 100%; }
  .analytics-period-form label { flex: 1 1 125px; }
  .analytics-upload-form input[type=file] { flex: 1 1 100%; }
  .analytics-upload-form button { width: 100%; }
  .analytics-kpis { gap: 10px; }
  .ui-customizer-head { padding: 18px 16px; }
  .ui-customizer-head strong { font-size: 17px; }
  .ui-customizer-actions { padding: 14px 16px max(16px, env(safe-area-inset-bottom)); }
  .mobile-menu-grid { gap: 10px; }
  .back-to-top { right: 12px; bottom: 102px; }
}
@media (max-width: 420px) {
  .page.page-with-sidebar { padding-left: 9px; padding-right: 9px; }
  .app-topbar { padding: 0 9px; }
  .app-topbar .brand img { width: 30px; height: 30px; }
  .app-topbar .brand { font-size: 16px; }
  .card { padding: 15px; }
  .quick-action-grid a { padding: 12px 10px; }
  th,td { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto!important; transition-duration: .01ms!important; animation-duration: .01ms!important; }
}


.analytics-product-card { box-shadow: 0 10px 26px rgba(31,45,74,.035); }
.analytics-product-metrics > div { box-shadow: 0 1px 0 rgba(18,31,55,.02); }
.tech-create-card summary { align-items: flex-start; }
.tech-create-button { min-width: 132px; }
@media (max-width: 760px) { .analytics-product-card { padding: 14px; } .tech-create-grid { gap: 10px; } }

/* FORGEO 0.9.9.8.4-r3: targeted view fixes. */
.tech-create-card .tech-create-content { padding: 19px 22px 22px; border-top: 1px solid #e9eef6; }
.tech-create-card .tech-create-grid { margin: 0; display: grid; grid-template-columns: minmax(125px,.8fr) minmax(200px,1.35fr) minmax(155px,1fr) minmax(155px,1fr) auto; gap: 12px; align-items: end; }
.tech-create-card .tech-create-grid > label { min-width: 0; }
.tech-create-card .tech-create-button { align-self: end; white-space: nowrap; }
.analytics-tax-form { display:flex; align-items:end; gap: 12px; flex-wrap: wrap; max-width: 440px; }
.analytics-tax-form .analytics-tax-field { display:flex; flex-direction:column; gap: 7px; flex: 1 1 160px; max-width: 240px; }
.analytics-tax-control { display:flex; align-items:center; position:relative; max-width:240px; }
.analytics-tax-control input { width:100%; padding-right:37px; min-width:0; }
.analytics-tax-control .analytics-tax-unit { position:absolute; right:14px; top:50%; transform:translateY(-50%); color:#65768e; font-size:13px; pointer-events:none; }
.analytics-tax-form > button { height:43px; flex: 0 0 auto; }
.analytics-product-tools { display:flex; align-items:end; flex-wrap:wrap; gap:10px 14px; margin-bottom:16px; }
.analytics-product-tools > label { flex: 1 1 100%; }
.analytics-product-search { display:flex; align-items:center; position:relative; flex:1 1 300px; max-width: 490px; }
.analytics-product-search input { padding-right:43px; }
.analytics-product-search button { position:absolute; right:4px; top:4px; bottom:4px; width:35px; background:transparent; border:0; color:#7e8ba2; font-size:23px; border-radius:8px; cursor:pointer; }
.analytics-product-search button:hover { color:#2457d6; background:#f2f6fd; }
.analytics-product-tools [data-analytics-search-count] { padding-bottom:12px; }
.analytics-products-empty[hidden] { display:none!important; }
.analytics-missing-list { display:grid; gap:10px; }
.analytics-missing-card { display:flex; justify-content:space-between; align-items:center; gap:15px; padding:14px; background:#fafcff; border:1px solid #e3eaf4; border-radius:12px; }
.analytics-missing-info { display:flex; flex-direction:column; gap:5px; flex:1 1 auto; min-width:0; }
.analytics-missing-form { display:flex; gap:9px; align-items:end; flex-wrap:wrap; flex:0 1 360px; }
.analytics-missing-form label { min-width:120px; flex:1; }
.analytics-missing-form button { flex:0 0 auto; height:43px; }
/* Support button is intentionally offset from "back to top" and bottom phone nav. */
.support-fab { position:fixed; z-index:60; bottom:24px; left:calc(var(--sidebar-w) + 25px); display:flex; gap:9px; align-items:center; justify-content:center; min-height:44px; padding:10px 16px; border:1px solid #d9e3f2; border-radius:13px; background:rgba(255,255,255,.98); box-shadow:0 5px 20px rgba(20,38,73,.09); color:#2d4b77; font-size:12px; font-weight:730; cursor:pointer; }
.support-fab svg { width:18px; height:18px; }
.support-fab:hover { background:#f1f6ff; color:#2457d6; }
.support-overlay[hidden] { display:none!important; }
.support-overlay { position:fixed; inset:0; z-index:150; display:grid; place-items:center; padding:15px; }
.support-backdrop { position:absolute; inset:0; background:rgba(16,30,54,.42); }
.support-dialog { position:relative; width:min(420px,96vw); max-height: min(80dvh,650px); overflow:auto; border:1px solid #dce5f3; border-radius:19px; background:#fff; box-shadow:0 22px 70px rgba(20,40,77,.18); padding:22px; }
.support-dialog-head { display:flex; justify-content:space-between; gap:12px; align-items:start; margin-bottom:16px; }
.support-dialog-head strong { font-size:19px; color:#1d304c; }
.support-dialog-head p { margin:5px 0 0; color:#8190a7; font-size:12px; }
.support-dialog-close { width:34px; height:34px; border:0; border-radius:9px; background:#f1f4f8; color:#627087; font-size:22px; cursor:pointer; }
.support-contacts { display:grid; gap:9px; }
.support-contacts > a { display:grid; grid-template-columns:75px minmax(0,1fr) 16px; align-items:center; gap:9px; padding:14px; border:1px solid #e3eaf4; border-radius:12px; color:#596d87; font-size:12px; }
.support-contacts > a:hover { border-color:#b8c9eb; background:#f7faff; }
.support-contacts strong { color:#2a456d; overflow-wrap:anywhere; font-size:12px; }
.support-body-modal-open { overflow:hidden; }
.support-admin-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-top:16px; }
.support-admin-form > label { display:grid; gap:7px; min-width:0; }
.support-admin-form > .support-admin-actions { grid-column:1/-1; }
@media(max-width:1150px) { .tech-create-card .tech-create-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .tech-create-card .tech-create-button { grid-column: 1/-1; justify-self: start; } }
@media(max-width:900px) {
  .support-fab { left:12px; bottom:96px; padding:11px; width:44px; height:44px; min-height:44px; }
  .support-fab span { display:none; }
  .ui-customizer-list { overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; touch-action:pan-y; }
  .ui-editor-row:not(.is-fixed) { touch-action:pan-y; }
  .ui-editor-row .drag-handle { touch-action:none; pointer-events:auto; min-width:26px; min-height:32px; display:flex; align-items:center; justify-content:center; }
}
@media(max-width:660px) {
 .tech-create-card .tech-create-content { padding:14px; }
 .tech-create-card .tech-create-grid { grid-template-columns:minmax(0,1fr); }
 .tech-create-card .tech-create-button { grid-column:auto; justify-self:stretch; }
 .analytics-tax-form { flex-wrap:nowrap; max-width:100%; }
 .analytics-tax-form .analytics-tax-field { min-width:0; flex:1 1 0; }
 .analytics-missing-card { flex-direction:column; align-items:stretch; }
 .analytics-missing-form { flex:1 1 auto; }
 .support-admin-form { grid-template-columns:minmax(0,1fr); }
}

.analytics-filter-line { margin: 10px 0 14px; max-width:420px; }
.analytics-filter-line input { width:100%; }
.analytics-product-card[hidden], .analytics-missing-card[hidden], tr[data-analytics-search-item][hidden] { display:none!important; }

/* Documentation is available in the desktop sidebar footer; keep its editor on mobile. */
@media (min-width: 901px) { .ui-customizer[data-ui-panel="nav"] .ui-editor-row[data-ui-editor-item="docs"] { display: none !important; } }

/* Employee membership archive, preserving production history. */
.team-archive-action { margin: 13px 0 0; border-top: 1px solid #e5ebf4; padding-top: 12px; }
.team-archive-action button { color: #9b4d32; border-color: #e9d7cf; }
.team-archived-card { margin-top: 18px; }
.team-archived-list { display: grid; gap: 10px; margin-top: 14px; }
.team-archived-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #ebf0f6; }
.team-archived-row > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
@media(max-width: 500px) { .team-archived-row { flex-wrap: wrap; } }
