/* Hosted application chrome. Loaded after the legacy module stylesheet. */
:root {
  color-scheme: dark;
  --cg-bg: var(--bg, #10151d);
  --cg-sidebar: color-mix(in srgb, var(--panel, #171f2b) 65%, var(--bg, #10151d));
  --cg-panel: var(--panel, #171f2b);
  --cg-panel-raised: color-mix(in srgb, var(--panel, #171f2b) 88%, var(--text, #edf3fa));
  --cg-border: var(--border, #2a3545);
  --cg-text: var(--text, #edf3fa);
  --cg-muted: var(--muted, #94a4b7);
  --cg-input: var(--input, #111923);
  --cg-accent: var(--selected, #48d7bd);
  --cg-accent-soft: color-mix(in srgb, var(--cg-accent) 10%, transparent);
}

html { background: var(--cg-bg); scroll-behavior: smooth; }
body { background: var(--cg-bg); color: var(--cg-text); font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif; font-size: 14px; line-height: 1.5; }
body::before { display: none; }
[hidden] { display: none !important; }
a { color: var(--cg-accent); }
a:hover { color: color-mix(in srgb, var(--cg-accent) 80%, var(--cg-text)); }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--cg-accent); outline-offset: 4px; }
.cg-icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }
.cg-hosted-shell { --panel-2: var(--cg-panel-raised); --accent: var(--cg-accent); --gold: var(--cg-accent); --gold-bright: var(--cg-text); min-height: 100vh; }
.cg-skip-link { position: fixed; top: -100px; left: 20px; z-index: 110; padding: 10px 16px; border-radius: 7px; background: var(--cg-accent); color: var(--cg-bg); }
.cg-skip-link:focus { top: 12px; }
.cg-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 60; display: flex; flex-direction: column; width: 248px; border-right: 1px solid var(--cg-border); background: var(--cg-sidebar); }
.cg-brand { display: flex; align-items: center; gap: 12px; min-height: 93px; padding: 22px 24px; color: var(--cg-text); }
.cg-brand:hover { color: #fff; }
.cg-brand-mark { position: relative; display: grid; flex: 0 0 auto; place-items: center; width: 41px; height: 41px; border: 1px solid color-mix(in srgb, var(--cg-accent) 23%, var(--cg-border)); border-radius: 12px; background: linear-gradient(145deg, color-mix(in srgb, var(--cg-accent) 12%, var(--cg-panel)), color-mix(in srgb, var(--cg-accent) 12%, var(--cg-panel))); color: color-mix(in srgb, var(--cg-accent) 80%, var(--cg-text)); font-size: 16px; font-weight: 800; letter-spacing: -.7px; }
.cg-brand-mark span { position: absolute; width: 5px; height: 5px; right: -3px; top: 6px; border-radius: 50%; background: var(--cg-accent); box-shadow: 0 0 0 4px var(--cg-sidebar); }
.cg-brand-type { font-size: 17px; font-weight: 750; letter-spacing: -.4px; white-space: nowrap; }
.cg-brand-type small { display: block; margin-top: 3px; color: var(--cg-muted); font-size: 9px; font-weight: 650; letter-spacing: 2px; }
.cg-navigation { flex: 1; min-height: 0; overflow-y: auto; padding: 7px 15px 24px; scrollbar-width: thin; scrollbar-color: #344352 transparent; }
.cg-nav-heading { margin: 25px 12px 7px; color: var(--cg-muted); font-size: 10px; font-weight: 750; letter-spacing: 1.4px; text-transform: uppercase; }
.cg-nav-link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; margin: 3px 0; padding: 9px 13px; border: 1px solid transparent; border-radius: 7px; color: var(--cg-muted); font-size: 13px; font-weight: 550; line-height: 1.4; }
.cg-nav-link .cg-icon { width: 17px; height: 17px; color: var(--cg-muted); }
.cg-nav-link:hover { border-color: var(--cg-border); background: var(--cg-panel-raised); color: var(--cg-text); }
.cg-nav-link.is-active { border-color: color-mix(in srgb, var(--cg-accent) 23%, var(--cg-border)); background: linear-gradient(90deg, color-mix(in srgb, var(--cg-accent) 12%, var(--cg-panel)), color-mix(in srgb, var(--cg-accent) 12%, var(--cg-panel))); color: color-mix(in srgb, var(--cg-accent) 80%, var(--cg-text)); }
.cg-nav-link.is-active .cg-icon { color: var(--cg-accent); }
.cg-nav-link.is-active::before { position: absolute; left: -16px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 4px 4px 0; background: var(--cg-accent); content: ""; }
.cg-sidebar-footer { display: flex; align-items: center; gap: 10px; padding: 18px; border-top: 1px solid var(--cg-border); }
.cg-avatar { display: grid; flex: 0 0 auto; place-items: center; width: 35px; height: 35px; border: 1px solid var(--cg-border); border-radius: 10px; background: var(--cg-panel-raised); color: var(--cg-text); font-size: 13px; font-weight: 700; }
.cg-user-details { flex: 1; min-width: 0; }
.cg-user-details strong, .cg-user-details small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-user-details strong { color: var(--cg-text); font-size: 12px; font-weight: 650; }
.cg-user-details small { margin-top: 2px; color: var(--cg-muted); font-size: 10px; }
.cg-sidebar-footer form { margin: 0; }
.cg-icon-button { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; min-height: 34px; padding: 6px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--cg-muted); box-shadow: none; cursor: pointer; }
.cg-icon-button:hover { border-color: var(--cg-border); background: var(--cg-panel-raised); color: var(--cg-text); transform: none; }
.cg-signout .cg-icon { width: 16px; height: 16px; }
.cg-workspace { min-width: 0; margin-left: 248px; }
.cg-topbar { display: flex; align-items: center; justify-content: space-between; min-height: 73px; gap: 15px; padding: 14px 36px; border-bottom: 1px solid var(--cg-border); background: color-mix(in srgb, var(--cg-panel) 90%, transparent); }
.cg-topbar-start, .cg-topbar-actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cg-topbar-actions { justify-content: flex-end; flex-wrap: wrap; }
.cg-mobile-actions { display: none; }
.cg-topbar-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.cg-topbar-context { min-width: 0; }
.cg-app-title { display: block; max-width: min(45vw, 620px); overflow: hidden; color: var(--cg-text); font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.cg-app-subtitle { max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--cg-muted); font-size: 11px; }
.cg-breadcrumb .cg-icon { width: 12px; height: 12px; color: var(--cg-muted); }
.cg-breadcrumb strong { color: var(--cg-text); font-weight: 550; }
.cg-account-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border: 1px solid color-mix(in srgb, var(--cg-accent) 23%, var(--cg-border)); border-radius: 6px; color: color-mix(in srgb, var(--cg-accent) 80%, var(--cg-text)); font-size: 10px; white-space: nowrap; }
.cg-account-badge .cg-icon { width: 12px; height: 12px; }
.cg-topbar .restart-bot-form { margin: 0; }
.cg-topbar .restart-bot-button { min-height: 30px; padding: 5px 10px; border: 1px solid var(--cg-border); border-radius: 6px; background: var(--cg-panel-raised); color: var(--cg-muted); box-shadow: none; font-size: 10px; }
.cg-content.desktop-tab-body { min-height: calc(100vh - 133px); max-width: 1800px; margin: 0 auto; padding: 31px 36px 40px; outline: none; }
.cg-workspace-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 17px 36px; border-top: 1px solid var(--cg-border); color: var(--cg-muted); font-size: 10px; }
.cg-workspace-footer span span { margin: 0 8px; color: var(--cg-muted); }
.cg-menu-button, .cg-sidebar-backdrop { display: none; }

/* Overview */
.cg-dashboard { max-width: 1380px; margin: 0 auto; }
.cg-dashboard-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 0 0 28px; }
.cg-eyebrow { margin: 0 0 8px; color: var(--cg-muted); font-size: 9px; font-weight: 750; letter-spacing: 1.8px; }
.cg-dashboard-heading h1 { margin: 0 0 7px; color: var(--cg-text); font-size: clamp(24px, 2.3vw, 32px); font-weight: 650; line-height: 1.25; letter-spacing: -.9px; }
.cg-dashboard-heading h1 span { color: var(--cg-accent); }
.cg-dashboard-heading p:last-child { margin: 0; color: var(--cg-muted); font-size: 12px; }
.cg-workspace-tag { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--cg-border); border-radius: 6px; background: var(--cg-panel); color: var(--cg-muted); font-size: 10px; white-space: nowrap; }
.cg-workspace-tag .cg-icon { width: 13px; height: 13px; }
.cg-hero { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 268px; gap: 25px; overflow: hidden; padding: 31px 35px; border: 1px solid color-mix(in srgb, var(--cg-accent) 23%, var(--cg-border)); border-radius: 13px; background: radial-gradient(ellipse at 87% 10%, rgba(56, 140, 126, .17), transparent 60%), linear-gradient(112deg, #182a2f, #192632 75%); }
.cg-hero::after { position: absolute; inset: 0; background-image: linear-gradient(rgba(105, 193, 174, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(105, 193, 174, .025) 1px, transparent 1px); background-size: 25px 25px; pointer-events: none; content: ""; }
.cg-hero-copy { position: relative; z-index: 1; max-width: 550px; }
.cg-hero-kicker { display: flex; align-items: center; gap: 7px; margin-bottom: 15px; color: var(--cg-accent); font-size: 9px; font-weight: 700; letter-spacing: 1.6px; }
.cg-hero-kicker > span { width: 5px; height: 5px; border-radius: 50%; background: var(--cg-accent); }
.cg-hero h2 { margin: 0 0 13px; color: #eef8f8; font-size: clamp(25px, 2.4vw, 35px); font-weight: 650; letter-spacing: -.9px; line-height: 1.18; }
.cg-hero h2 > span { color: #9cbbb9; }
.cg-hero p { max-width: 465px; margin: 0; color: #92a9b5; font-size: 11px; line-height: 1.8; }
.cg-hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 22px; margin-top: 23px; }
.cg-primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 37px; padding: 10px 15px; border: 1px solid var(--cg-accent); border-radius: 6px; background: var(--cg-accent); color: var(--cg-bg); box-shadow: 0 4px 14px rgba(6, 12, 17, .12); font-size: 11px; font-weight: 750; line-height: 1.4; }
.cg-primary-button .cg-icon { width: 15px; height: 15px; }
.cg-primary-button:hover { border-color: color-mix(in srgb, var(--cg-accent) 80%, var(--cg-text)); background: color-mix(in srgb, var(--cg-accent) 80%, var(--cg-text)); color: var(--cg-bg); transform: translateY(-1px); }
.cg-text-link { display: inline-flex; align-items: center; gap: 8px; color: color-mix(in srgb, var(--cg-accent) 80%, var(--cg-text)); font-size: 10px; font-weight: 550; }
.cg-text-link .cg-icon { width: 13px; height: 13px; }
.cg-hero-art { position: relative; flex: 0 0 290px; width: 290px; height: 220px; margin-right: 28px; }
.cg-art-orbit { position: absolute; top: 50%; left: 50%; border: 1px solid rgba(96, 176, 160, .21); border-radius: 50%; transform: translate(-50%, -50%); }
.cg-art-orbit-outer { width: 238px; height: 238px; }
.cg-art-orbit-inner { width: 158px; height: 158px; border-style: dashed; border-color: rgba(96, 176, 160, .19); }
.cg-art-core { position: absolute; top: 50%; left: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 99px; height: 99px; border: 1px solid color-mix(in srgb, var(--cg-accent) 23%, var(--cg-border)); border-radius: 25px; background: linear-gradient(145deg, #2d514c, #1a3037); box-shadow: 0 0 0 9px rgba(68, 130, 118, .06), 0 0 46px rgba(61, 181, 151, .15); transform: translate(-50%, -50%) rotate(-8deg); }
.cg-art-core span { color: color-mix(in srgb, var(--cg-accent) 80%, var(--cg-text)); font-size: 34px; font-weight: 800; letter-spacing: -2px; }
.cg-art-core small { color: #7eb4a9; font-size: 6px; font-weight: 700; letter-spacing: 1.8px; }
.cg-art-node { position: absolute; display: grid; place-items: center; width: 47px; height: 47px; border: 1px solid color-mix(in srgb, var(--cg-accent) 23%, var(--cg-border)); border-radius: 13px; background: color-mix(in srgb, var(--cg-accent) 12%, var(--cg-panel)); color: color-mix(in srgb, var(--cg-accent) 80%, var(--cg-text)); box-shadow: 0 6px 15px rgba(0, 0, 0, .1); }
.cg-art-node-one { top: 0; left: 60px; }
.cg-art-node-two { top: 80px; right: 0; }
.cg-art-node-three { bottom: -2px; left: 54px; }
.cg-art-dot { position: absolute; width: 6px; height: 6px; border: 1px solid color-mix(in srgb, var(--cg-accent) 23%, var(--cg-border)); border-radius: 50%; background: color-mix(in srgb, var(--cg-accent) 12%, var(--cg-panel)); }
.cg-art-dot-one { left: 25px; top: 117px; }
.cg-art-dot-two { right: 52px; bottom: 7px; }
.cg-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin: 20px 0 31px; }
.cg-stat-card { display: flex; align-items: flex-start; gap: 15px; padding: 20px; border: 1px solid var(--cg-border); border-radius: 10px; background: var(--cg-panel); }
.cg-stat-icon { display: grid; flex: 0 0 auto; place-items: center; width: 36px; height: 36px; border: 1px solid color-mix(in srgb, var(--cg-accent) 23%, var(--cg-border)); border-radius: 9px; background: color-mix(in srgb, var(--cg-accent) 12%, var(--cg-panel)); color: color-mix(in srgb, var(--cg-accent) 80%, var(--cg-text)); }
.cg-stat-icon .cg-icon { width: 18px; height: 18px; }
.cg-stat-icon-blue { border-color: #2e465d; background: #203047; color: #7bafe5; }
.cg-stat-icon-violet { border-color: #474263; background: #2b2942; color: #afa1e2; }
.cg-stat-card > div { min-width: 0; }
.cg-stat-label { display: block; margin: -1px 0 3px; color: var(--cg-muted); font-size: 10px; }
.cg-stat-card strong { display: block; color: var(--cg-text); font-size: 26px; font-weight: 650; letter-spacing: -.7px; line-height: 1.3; }
.cg-stat-card strong.cg-stat-role { margin-top: 6px; margin-bottom: 2px; font-size: 20px; }
.cg-stat-card small { display: block; margin-top: 6px; color: var(--cg-muted); font-size: 9px; line-height: 1.5; }
.cg-tools { scroll-margin-top: 18px; }
.cg-tools-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 15px; margin-bottom: 20px; }
.cg-tools-heading h2 { margin: 0 0 4px; color: var(--cg-text); font-size: 17px; font-weight: 600; letter-spacing: -.4px; }
.cg-tools-heading p { margin: 0; color: var(--cg-muted); font-size: 11px; }
.cg-tool-search { display: flex; align-items: center; gap: 8px; width: 233px; min-height: 35px; margin: 0; padding: 0 10px; border: 1px solid var(--cg-border); border-radius: 6px; background: var(--cg-panel); color: var(--cg-muted); }
.cg-tool-search .cg-icon { width: 15px; height: 15px; }
.cg-tool-search input { width: 100%; min-width: 0; min-height: 33px; padding: 4px 0; border: 0; border-radius: 0; background: transparent; color: var(--cg-text); font-size: 11px; outline: 0; box-shadow: none; }
.cg-tool-search:focus-within { outline: 2px solid var(--cg-accent); outline-offset: 2px; }
.cg-tool-search input::placeholder { color: var(--cg-muted); }
.cg-module-section { margin-top: 22px; }
.cg-section-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 11px; }
.cg-section-heading h3 { margin: 0; color: var(--cg-text); font-size: 11px; font-weight: 600; }
.cg-section-heading span { padding: 1px 6px; border: 1px solid var(--cg-border); border-radius: 4px; color: var(--cg-muted); font-size: 8px; }
.cg-module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cg-module-card { display: flex; align-items: flex-start; gap: 12px; min-height: 108px; padding: 18px 16px; border: 1px solid var(--cg-border); border-radius: 9px; background: var(--cg-panel); color: var(--cg-text); transition: border-color 160ms ease, background 160ms ease, transform 160ms ease; }
.cg-module-card:hover { border-color: color-mix(in srgb, var(--cg-accent) 23%, var(--cg-border)); background: color-mix(in srgb, var(--cg-accent) 12%, var(--cg-panel)); color: #fff; transform: translateY(-2px); }
.cg-module-icon { display: grid; flex: 0 0 auto; place-items: center; width: 31px; height: 31px; border: 1px solid var(--cg-border); border-radius: 7px; background: var(--cg-panel-raised); color: var(--cg-muted); }
.cg-module-icon .cg-icon { width: 16px; height: 16px; }
.cg-module-copy { flex: 1; min-width: 0; }
.cg-module-copy strong { display: block; margin: 1px 0 7px; color: inherit; font-size: 13px; font-weight: 650; }
.cg-module-copy small { display: block; color: var(--cg-muted); font-size: 11px; line-height: 1.65; }
.cg-card-arrow { margin-top: 5px; color: var(--cg-muted); }
.cg-card-arrow .cg-icon { width: 13px; height: 13px; }
.cg-module-card:hover .cg-module-icon, .cg-module-card:hover .cg-card-arrow { color: var(--cg-accent); }
.cg-dashboard-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 25px; padding: 14px 16px; border: 1px solid var(--cg-border); border-radius: 7px; background: var(--cg-panel); color: var(--cg-muted); }
.cg-dashboard-note .cg-icon { width: 14px; height: 14px; margin-top: 2px; }
.cg-dashboard-note p { margin: 0; font-size: 10px; line-height: 1.6; }
.cg-search-status:empty { display: none; }
.cg-search-status { color: color-mix(in srgb, var(--cg-accent) 80%, var(--cg-text)); font-size: 11px; }
.cg-search-empty { padding: 40px 20px; border: 1px dashed var(--cg-border); border-radius: 8px; color: var(--cg-muted); text-align: center; }
.cg-search-empty h3 { color: var(--cg-text); font-size: 15px; }
.cg-search-empty p { font-size: 12px; }

/* Retain all module markup and interactions with a calmer shared treatment. */
.cg-hosted-shell .panel, .cg-hosted-shell .config-card, .cg-hosted-shell .notice, .cg-hosted-shell .error { border-color: var(--cg-border); border-radius: 9px; background: var(--cg-panel); box-shadow: none; }
.cg-hosted-shell .panel h2, .cg-hosted-shell .panel h3, .cg-hosted-shell .toolbar h1 { color: var(--cg-text); }
.cg-hosted-shell .desktop-page-toolbar { padding: 0 0 18px; border-bottom: 1px solid var(--cg-border); }
.cg-hosted-shell .desktop-page-toolbar h1, .cg-hosted-shell .toolbar h1 { font-size: clamp(23px, 2.2vw, 30px); font-weight: 650; }
.cg-hosted-shell .desktop-page-toolbar p { color: var(--cg-muted); font-size: 12px; }
.cg-hosted-shell input, .cg-hosted-shell select, .cg-hosted-shell textarea { border-color: var(--cg-border); border-radius: 6px; background: var(--cg-input); color: var(--cg-text); box-shadow: none; }
.cg-hosted-shell input:focus, .cg-hosted-shell select:focus, .cg-hosted-shell textarea:focus { border-color: var(--cg-accent); }
.cg-hosted-shell button, .cg-hosted-shell .button { border-color: var(--cg-accent); border-radius: 6px; background: var(--cg-accent); color: var(--cg-bg); box-shadow: none; font-size: 12px; }
.cg-hosted-shell button:hover, .cg-hosted-shell .button:hover { background: color-mix(in srgb, var(--cg-accent) 80%, var(--cg-text)); color: var(--cg-bg); }
.cg-hosted-shell .secondary { border-color: var(--cg-border); background: var(--cg-panel-raised); color: var(--cg-text); }
.cg-hosted-shell .secondary:hover { border-color: var(--cg-border); background: var(--cg-panel-raised); color: var(--cg-text); }
.cg-hosted-shell .danger-button { border-color: #7c444e; background: #4c2933; color: #efacb6; }
.cg-hosted-shell .danger-button:hover { border-color: #a15363; background: #68323f; color: #ffd1d9; }
.cg-hosted-shell .cg-icon-button { border-color: transparent; background: transparent; color: var(--cg-muted); }
.cg-hosted-shell .cg-icon-button:hover { border-color: var(--cg-border); background: var(--cg-panel-raised); color: var(--cg-text); }
.cg-hosted-shell .inner-tabs { gap: 5px; padding: 5px; border: 1px solid var(--cg-border); border-radius: 8px; background: var(--cg-panel); }
.cg-hosted-shell .inner-tab { border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--cg-muted); box-shadow: none; font-size: 11px; }
.cg-hosted-shell .inner-tab.active { border-color: color-mix(in srgb, var(--cg-accent) 23%, var(--cg-border)); background: color-mix(in srgb, var(--cg-accent) 12%, var(--cg-panel)); color: color-mix(in srgb, var(--cg-accent) 80%, var(--cg-text)); }
.cg-hosted-shell th { background: var(--cg-panel-raised); color: var(--cg-muted); }
.cg-hosted-shell td { border-color: var(--cg-border); }
.cg-hosted-shell tr:hover td { background: rgba(57, 86, 100, .16); }
.cg-hosted-shell .badge-good { border-color: #315b4e; background: #1b3a30; color: #82d7b2; }
.cg-hosted-shell .badge-warn { border-color: #66573a; background: #3d3426; color: #dec48b; }
.cg-hosted-shell .badge-bad { border-color: #71424d; background: #402731; color: #e8a4b0; }
.cg-hosted-shell .notice { border-left: 3px solid var(--cg-accent); color: color-mix(in srgb, var(--cg-accent) 80%, var(--cg-text)); }
.cg-hosted-shell .error { border-left: 3px solid #df7c93; color: #ebbec9; }
.cg-hosted-shell .restart-status { font-size: 9px; }
.cg-hosted-shell .cg-sidebar-backdrop { border: 0; border-radius: 0; background: rgba(3, 8, 15, .72); }
.cg-hosted-shell .cg-sidebar-backdrop:hover { border: 0; background: rgba(3, 8, 15, .72); transform: none; }
.cg-hosted-shell .cg-topbar .restart-bot-button { border-color: var(--cg-border); background: var(--cg-panel-raised); color: var(--cg-muted); font-size: 10px; }
.cg-hosted-shell .cg-topbar .restart-bot-button:hover { background: var(--cg-panel-raised); color: var(--cg-text); }

/* Keep generic records readable without changing the map's custom tables. */
.cg-hosted-shell .table-wrap { min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; border-color: var(--cg-border); background: var(--cg-panel); scrollbar-width: thin; }
.cg-hosted-shell :is(.cg-standard-table, .cg-wide-table, .cg-mobile-cards) { table-layout: auto; }
.cg-hosted-shell .cg-wide-table { min-width: 44rem; }
.cg-hosted-shell :is(.cg-standard-table, .cg-wide-table, .cg-mobile-cards) th { max-width: none; white-space: nowrap; overflow-wrap: normal; word-break: normal; }
.cg-hosted-shell :is(.cg-standard-table, .cg-wide-table, .cg-mobile-cards) td { overflow-wrap: break-word; word-break: normal; }
.cg-cell-value { min-width: 0; }

/* CG Solutions welcome page: a fixed brand palette, scoped to guest sign-in. */
.cg-login-branded { --cg-accent: #ff872e; --cg-bg: #090b0f; --cg-text: #f1f2f5; --cg-muted: #a0a5af; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100vh; min-height: 100svh; background: #090b0f; color: #f1f2f5; }
.cg-login-branded .cg-login-intro { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; min-width: 0; overflow: hidden; padding: 30px clamp(28px, 4vw, 76px); border-right: 1px solid #33271e; background: radial-gradient(ellipse at 48% 45%, #4e25162b, transparent 64%), #0c0d10; }
.cg-login-branded .cg-login-intro::before { position: absolute; z-index: -1; inset: 0; background-image: linear-gradient(#ffffff03 1px, transparent 1px), linear-gradient(90deg, #ffffff03 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(transparent, #000 45%, transparent); content: ""; pointer-events: none; }
.cg-login-branded .cg-brand { min-height: 48px; padding: 0; gap: 13px; color: #f1f2f5; }
.cg-login-branded .cg-brand-type { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.cg-login-branded .cg-brand-type small { margin-top: 4px; color: #a6a3a1; font-size: 9px; letter-spacing: 2.1px; }
.cg-login-brand-logo { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%; }
.cg-login-branded .cg-login-showcase { width: 100%; max-width: 600px; margin: 0 auto; text-align: center; }
.cg-login-emblem { display: block; width: min(100%, clamp(230px, 34vh, 370px)); height: auto; margin: 0 auto 22px; border-radius: 50%; filter: drop-shadow(0 0 32px #fd65161a); }
.cg-login-branded .cg-login-showcase .cg-eyebrow { margin: 0 0 13px; color: #f69a59; font-size: 10px; letter-spacing: 2.4px; }
.cg-login-branded .cg-login-intro h1 { margin: 0; color: #eceff3; font-size: clamp(38px, 3.4vw, 60px); font-weight: 750; letter-spacing: -2px; line-height: 1.07; }
.cg-login-branded .cg-login-intro h1 span { color: #ff8a36; }
.cg-login-branded .cg-login-description { margin: 20px auto 0; color: #a0a5af; font-size: 14px; line-height: 1.8; }
.cg-login-capabilities { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 22px; padding-top: 22px; border-top: 1px solid #ffffff0d; color: #a0a5af; font-size: 11px; }
.cg-login-capabilities > span { display: inline-flex; align-items: center; gap: 8px; }
.cg-login-capabilities .cg-icon { width: 15px; height: 15px; color: #ed985b; }
.cg-login-branded .cg-login-form-side { display: grid; place-items: center; min-width: 0; padding: 56px 32px; background: radial-gradient(ellipse at 100% 0, #61351e14, transparent 55%), #0c0f14; }
.cg-login-access { width: min(440px, 100%); }
.cg-login-mobile-brand { display: none; }
.cg-login-branded .cg-login-panel { position: relative; width: 100%; padding: 38px; border: 1px solid #343137; border-radius: 18px; background: linear-gradient(145deg, #1b1d23, #12151b 65%); box-shadow: 0 24px 80px #0000004d, 0 0 60px #f5751d06; }
.cg-login-branded .cg-login-panel::before { position: absolute; top: -1px; left: 15%; right: 15%; height: 1px; background: linear-gradient(90deg, transparent, #f09552, transparent); content: ""; pointer-events: none; }
.cg-login-access-label { display: flex; align-items: center; gap: 12px; margin-bottom: 25px; }
.cg-login-branded .cg-login-lock { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border: 1px solid #714325; border-radius: 10px; background: #ff872e0d; color: #ff9b53; }
.cg-login-branded .cg-login-lock .cg-icon { width: 17px; height: 17px; }
.cg-login-access-label .cg-eyebrow { margin: 0; color: #b4b0af; font-size: 9px; letter-spacing: 2px; }
.cg-login-branded .cg-login-panel h2 { margin: 0 0 9px; color: #f1f2f5; font-size: clamp(29px, 2.5vw, 36px); font-weight: 700; letter-spacing: -1.3px; line-height: 1.2; }
.cg-login-branded .cg-login-panel h2 span { color: #ff872e; }
.cg-login-branded .cg-login-panel > p { margin: 0 0 29px; color: #a0a5af; font-size: 13px; line-height: 1.65; }
.cg-login-branded .cg-login-panel label { display: block; margin-top: 20px; color: #d6d8dd; font-size: 12px; font-weight: 550; }
.cg-login-branded .cg-login-panel input { display: block; width: 100%; min-width: 0; min-height: 50px; margin-top: 8px; padding: 12px 14px; border: 1px solid #383c45; border-radius: 8px; background: #0d1015; color: #f1f2f5; font-size: 16px; box-shadow: inset 0 1px 3px #00000026; }
.cg-login-branded .cg-login-panel input:focus { border-color: #f09552; outline: 2px solid #ff872e33; outline-offset: 2px; box-shadow: none; }
.cg-login-branded .cg-login-panel button.cg-primary-button { width: 100%; min-height: 50px; margin-top: 28px; padding: 13px 18px; border: 1px solid #ff9e56; border-radius: 8px; background: linear-gradient(115deg, #ff963f, #f87823); color: #1b1009; box-shadow: 0 5px 22px #ed6b161f; font-size: 14px; font-weight: 750; }
.cg-login-branded .cg-login-panel button.cg-primary-button:hover { border-color: #ffc18e; background: linear-gradient(115deg, #ffac68, #ff8f42); color: #1b1009; transform: none; }
.cg-login-branded .cg-login-help { display: block; margin-top: 24px; color: #a0a5af; font-size: 11px; line-height: 1.7; text-align: center; }
.cg-login-signature { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 9px; margin: 26px 0 0; color: #8c8f98; font-size: 9px; letter-spacing: 1.3px; }
.cg-login-signature > span:first-child { width: 5px; height: 5px; border-radius: 50%; background: #ee8c46; box-shadow: 0 0 9px #ee8c4666; }
.cg-login-signature > span:last-child { color: #55555b; }
.cg-login-branded .cg-login-panel :is(.notice, .error) { margin: 14px 0; padding: 12px; overflow-wrap: anywhere; border: 1px solid #45434b; border-radius: 8px; background: #24242c; color: #d6d8dd; font-size: 12px; }
.cg-login-branded .cg-login-panel .error { border-color: #8a4c46; background: #3c2427; color: #ffc3bc; }
.cg-login-branded :focus-visible { outline-color: #ff9b53; }
@media (max-width: 900px) {
  .cg-login-branded { grid-template-columns: minmax(0, 1fr); }
  .cg-login-branded .cg-login-intro { display: none; }
  .cg-login-branded .cg-login-form-side { padding: max(28px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left)); background: radial-gradient(ellipse at 50% 0, #f46d1821, transparent 58%), #0c0f14; }
  .cg-login-mobile-brand { display: flex; justify-content: center; align-items: center; gap: 15px; margin: 0 0 28px; color: #f1f2f5; }
  .cg-login-mobile-brand:hover { color: #f1f2f5; }
  .cg-login-mobile-brand img { width: 88px; height: 88px; border-radius: 50%; }
  .cg-login-mobile-brand > span { font-size: 22px; font-weight: 700; letter-spacing: -.5px; }
  .cg-login-mobile-brand small { display: block; margin-top: 5px; color: #b0a5a0; font-size: 8px; letter-spacing: 2px; }
  .cg-login-branded .cg-login-panel { padding: 30px; }
}
@media (max-width: 390px) {
  .cg-login-branded .cg-login-form-side { padding-right: max(16px, env(safe-area-inset-right)); padding-left: max(16px, env(safe-area-inset-left)); }
  .cg-login-branded .cg-login-panel { padding: 26px 22px; }
  .cg-login-signature { font-size: 8px; letter-spacing: 1px; }
}

/* The saved Theme Editor palette is the source for every major surface. */
.cg-hero { background: radial-gradient(ellipse at 87% 10%, color-mix(in srgb, var(--cg-accent) 16%, transparent), transparent 60%), linear-gradient(112deg, color-mix(in srgb, var(--cg-accent) 9%, var(--cg-panel)), var(--cg-panel)); }
.cg-hero h2 { color: var(--cg-text); }
.cg-hero h2 > span, .cg-hero p { color: var(--cg-muted); }
.cg-art-core { border-color: color-mix(in srgb, var(--cg-accent) 42%, var(--cg-border)); background: linear-gradient(145deg, color-mix(in srgb, var(--cg-accent) 18%, var(--cg-panel)), var(--cg-panel)); }
.cg-art-core small { color: var(--cg-muted); }
.cg-art-orbit { border-color: color-mix(in srgb, var(--cg-accent) 24%, transparent); }
.cg-art-orbit-inner { border-color: color-mix(in srgb, var(--cg-accent) 20%, transparent); }
.cg-account-badge, .cg-avatar { border-color: var(--cg-border); }
.cg-avatar { background: var(--cg-panel-raised); }
.cg-tool-search { background: var(--cg-input); }

@media (min-width: 1600px) {
  .cg-topbar, .cg-workspace-footer { padding-right: 50px; padding-left: 50px; }
  .cg-content.desktop-tab-body { padding-right: 50px; padding-left: 50px; }
}
@media (max-width: 1250px) {
  .cg-sidebar { width: 225px; }
  .cg-brand { padding-right: 17px; padding-left: 18px; }
  .cg-workspace { margin-left: 225px; }
  .cg-topbar { padding-right: 24px; padding-left: 24px; }
  .cg-content.desktop-tab-body { padding-right: 24px; padding-left: 24px; }
  .cg-hero { padding: 27px; }
  .cg-hero-art { flex-basis: 230px; width: 230px; margin-right: 0; transform: scale(.86); }
  .cg-stat-card { gap: 10px; padding: 16px 13px; }
  .cg-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .cg-sidebar { width: 248px; transform: translateX(-100%); transition: transform 180ms ease; }
  .cg-workspace { margin-left: 0; }
  .cg-menu-button { display: inline-flex; }
  .cg-topbar { min-height: 65px; padding: 12px 20px; }
  .cg-menu-open .cg-sidebar { transform: translateX(0); }
  .cg-sidebar-backdrop { position: fixed; inset: 0; z-index: 55; display: block; width: 100%; height: 100%; padding: 0; cursor: default; }
  body.cg-menu-lock { overflow: hidden; }
  .cg-topbar-actions .cg-account-badge { display: none; }
  .cg-content.desktop-tab-body { min-height: calc(100vh - 125px); padding: 27px 24px 35px; }
  .cg-hero-art { flex-basis: 270px; width: 270px; transform: scale(.92); }
}
@media (max-width: 700px) {
  .cg-hosted-shell, .cg-login-shell { min-height: 100svh; }
  .cg-topbar { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left)); }
  .cg-topbar-start { grid-column: 1; grid-row: 1; gap: 7px; }
  .cg-topbar-context { flex: 1; }
  .cg-topbar .cg-app-title { max-width: 100%; font-size: 13px; }
  .cg-breadcrumb { gap: 5px; padding-top: 2px; font-size: 11px; }
  .cg-breadcrumb strong { min-width: 0; overflow-wrap: break-word; }
  .cg-topbar .cg-desktop-actions { display: none; }
  .cg-topbar-notice { grid-column: 1 / -1; grid-row: 2; }
  .cg-hosted-shell .cg-topbar-notice .restart-status { max-width: 100%; font-size: 11px; overflow-wrap: break-word; }
  .cg-mobile-actions { position: relative; display: block; grid-column: 2; grid-row: 1; min-width: 0; }
  .cg-mobile-actions > summary { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 10px 11px; border: 1px solid var(--cg-border); border-radius: 7px; background: var(--cg-panel-raised); color: var(--cg-text); font-size: 12px; font-weight: 600; white-space: nowrap; list-style: none; cursor: pointer; }
  .cg-mobile-actions > summary::-webkit-details-marker { display: none; }
  .cg-mobile-actions > summary .cg-icon { width: 15px; height: 15px; }
  .cg-mobile-actions > summary::after { width: 6px; height: 6px; margin: -3px 1px 0 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); content: ""; }
  .cg-mobile-actions[open] > summary { border-color: var(--cg-accent); }
  .cg-mobile-actions[open] > summary::after { margin-top: 3px; transform: rotate(225deg); }
  .cg-mobile-actions-panel { position: absolute; top: calc(100% + 9px); right: 0; z-index: 45; display: grid; gap: 8px; width: min(300px, calc(100vw - 28px)); max-height: min(65vh, 440px); padding: 12px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--cg-border); border-radius: 10px; background: var(--cg-panel); box-shadow: 0 14px 32px rgba(0, 0, 0, .35); }
  .cg-mobile-actions:not([open]) > .cg-mobile-actions-panel { display: none; }
  .cg-mobile-actions-panel > form { width: 100%; margin: 0; }
  .cg-hosted-shell .cg-topbar .cg-mobile-actions-panel :is(button, .button) { width: 100%; max-width: none; min-height: 44px; padding: 10px 12px; font-size: 14px; white-space: normal; overflow-wrap: break-word; }
  .cg-content.desktop-tab-body { min-width: 0; padding: 22px max(14px, env(safe-area-inset-right)) 30px max(14px, env(safe-area-inset-left)); }
  .cg-dashboard-heading { margin-bottom: 22px; }
  .cg-dashboard-heading h1 { font-size: 24px; }
  .cg-workspace-tag { display: none; }
  .cg-hero { min-height: 252px; padding: 25px; }
  .cg-hero-art { display: none; }
  .cg-hero h2 { font-size: 29px; }
  .cg-hero p { font-size: 13px; line-height: 1.65; }
  .cg-stat-grid { gap: 10px; margin-top: 15px; }
  .cg-stat-card { flex-direction: column; gap: 11px; padding: 13px; }
  .cg-stat-icon { width: 29px; height: 29px; border-radius: 7px; }
  .cg-stat-icon .cg-icon { width: 15px; height: 15px; }
  .cg-stat-card strong { font-size: 22px; }
  .cg-stat-card strong.cg-stat-role { font-size: 16px; }
  .cg-stat-label { font-size: 11px; }
  .cg-stat-card small { font-size: 11px; }
  .cg-tool-search { width: 100%; min-height: 46px; }
  .cg-module-grid { gap: 10px; }
  .cg-module-card { gap: 9px; padding: 15px 12px; }
  .cg-card-arrow { display: none; }
  .cg-module-copy strong { font-size: 15px; }
  .cg-module-copy small { font-size: 12px; }
  .cg-module-icon { width: 28px; height: 28px; }
  .cg-workspace-footer { padding: 16px max(14px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
  .cg-login-shell { grid-template-columns: 1fr; }
  .cg-login-intro { display: none; }
  .cg-login-form-side { padding: 45px 25px; }
  .cg-hosted-shell .desktop-page-toolbar { flex-direction: column; }
}
@media (max-width: 430px) {
  .cg-dashboard-heading h1 { font-size: 22px; }
  .cg-stat-grid { grid-template-columns: 1fr; gap: 9px; }
  .cg-stat-card { flex-direction: row; align-items: center; gap: 13px; padding: 13px 15px; }
  .cg-stat-card > div { display: grid; grid-template-columns: 1fr auto; flex: 1; gap: 0 10px; align-items: center; }
  .cg-stat-label { grid-column: 1; margin: 0; font-size: 11px; }
  .cg-stat-card strong, .cg-stat-card strong.cg-stat-role { grid-column: 2; grid-row: 1 / 3; margin: 0; font-size: 21px; }
  .cg-stat-card strong.cg-stat-role { font-size: 17px; }
  .cg-stat-card small { grid-column: 1; margin-top: 3px; font-size: 11px; }
  .cg-tools-heading { align-items: stretch; }
  .cg-tool-search { width: 100%; }
  .cg-module-grid { grid-template-columns: 1fr; }
  .cg-module-card { min-height: 94px; padding: 17px; }
  .cg-module-copy strong { font-size: 15px; }
  .cg-module-copy small { font-size: 12px; }
  .cg-card-arrow { display: block; }
  .cg-workspace-footer > span:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.bot-target-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.bot-target-grid label { display: grid; gap: 7px; align-content: start; min-width: 0; }
.bot-target-grid input:not([type="checkbox"]), .bot-target-grid textarea { width: 100%; min-width: 0; box-sizing: border-box; }
.bot-target-editor .actions { margin-top: 18px; }
.cg-topbar .bot-control-link { white-space: nowrap; }
.bot-control-page table td { vertical-align: middle; }
@media (max-width: 700px) {
  .bot-target-grid { grid-template-columns: 1fr; gap: 14px; }
  .cg-hosted-shell .cg-content > *, .cg-hosted-shell .cg-content :is(.panel, form, label, .editor-pane) { min-width: 0; max-width: 100%; }
  .cg-hosted-shell .cg-content :is(input, select, textarea), .cg-login-panel input { min-width: 0; max-width: 100%; font-size: 16px; }
  .cg-hosted-shell .cg-content input:not([type="checkbox"]):not([type="radio"]), .cg-hosted-shell .cg-content select, .cg-login-panel input { min-height: 44px; }
  .cg-hosted-shell .cg-content :is(button:not(.map-marker):not(.map-zone), .button), .cg-hosted-shell .cg-topbar :is(button, .button), .cg-hosted-shell .cg-sidebar button, .cg-login-panel button { min-height: 44px; }
  .cg-hosted-shell .cg-icon-button { min-width: 44px; min-height: 44px; }
  .cg-hosted-shell .cg-content :is(input[type="checkbox"], input[type="radio"]) { width: 22px; height: 22px; flex: 0 0 auto; }
  .cg-hosted-shell .cg-content .check-row { min-height: 44px; }
  .cg-hosted-shell .cg-nav-link { min-height: 44px; font-size: 14px; }
  .cg-sidebar { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .cg-hosted-shell .cg-content :is(.form-grid, .connection-profile-row, .connection-fields, .map-config-grid, .three-pane-editor, .user-access-basics, .user-account-meta) { grid-template-columns: minmax(0, 1fr); }
  .cg-hosted-shell .cg-content :is(.path-row, .form-row, .theme-row) { grid-template-columns: minmax(0, 1fr); }
  .cg-hosted-shell .cg-content :is(.desktop-toolbar, .summary-toolbar) { align-items: stretch; }
  .cg-hosted-shell .cg-content :is(.desktop-toolbar, .summary-toolbar) :is(label, .form-row, select) { min-width: 0; }
  .cg-hosted-shell .cg-content :is(.picker, .map-toolbar) > label { flex: 1 1 100%; min-width: 0; }
  .cg-hosted-shell .cg-content .path-row .button, .cg-hosted-shell .cg-content .connection-profile-row > button { width: 100%; margin-top: 0; }
  .cg-hosted-shell .cg-content .player-profile-heading { align-items: flex-start; flex-direction: column; padding: 16px; }
  .cg-hosted-shell .cg-content .player-profile-heading > * { min-width: 0; max-width: 100%; }
  .cg-hosted-shell .cg-content .player-profile-heading h2 { overflow-wrap: anywhere; word-break: normal; }
  .cg-hosted-shell .cg-content .player-badges { max-width: 100%; flex-wrap: wrap; }
  .cg-hosted-shell .cg-content :is(.player-badge, .player-count) { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

  /* Only opted-in setup lists become cards; data-heavy tables keep scrolling. */
  .cg-hosted-shell .table-wrap:has(> table.cg-mobile-cards) { max-height: none; overflow: visible; border: 0; border-radius: 0; background: transparent; }
  .cg-hosted-shell table.cg-mobile-cards { display: block; width: 100%; min-width: 0; }
  .cg-hosted-shell .cg-mobile-cards thead { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); border: 0; white-space: nowrap; }
  .cg-hosted-shell .cg-mobile-cards thead th { position: static; }
  .cg-hosted-shell .cg-mobile-cards tbody { display: grid; gap: 12px; }
  .cg-hosted-shell .cg-mobile-cards tbody tr { display: block; min-width: 0; padding: 5px 14px; border: 1px solid var(--cg-border); border-radius: 9px; background: var(--cg-panel); }
  .cg-hosted-shell .cg-mobile-cards tbody td { display: grid; grid-template-columns: minmax(80px, .35fr) minmax(0, 1fr); align-items: start; gap: 12px; width: 100%; max-width: none; padding: 11px 0; border-bottom: 1px solid var(--cg-border); white-space: normal; overflow-wrap: normal; }
  .cg-hosted-shell .cg-mobile-cards tbody td::before { content: attr(data-label); color: var(--cg-muted); font-size: 12px; font-weight: 500; line-height: 1.6; }
  .cg-hosted-shell .cg-mobile-cards tbody td:last-child { border-bottom: 0; }
  .cg-hosted-shell .cg-mobile-cards tbody td:first-child .cg-cell-value { color: var(--cg-text); font-size: 15px; font-weight: 650; }
  .cg-hosted-shell .cg-mobile-cards .cg-cell-value { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; word-break: normal; }
  .cg-hosted-shell .cg-mobile-cards tbody td.cg-actions-cell { grid-template-columns: minmax(0, 1fr); gap: 8px; padding-top: 12px; padding-bottom: 14px; }
  .cg-hosted-shell .cg-mobile-cards .cg-actions-cell .actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; width: 100%; }
  .cg-hosted-shell .cg-mobile-cards .cg-actions-cell :is(form, button, .button) { width: 100%; min-width: 0; margin: 0; }
  .cg-hosted-shell .cg-mobile-cards .cg-actions-cell :is(button, .button) { min-height: 44px; padding: 10px 12px; font-size: 14px; white-space: normal; overflow-wrap: break-word; }
  .cg-hosted-shell .cg-mobile-cards tbody tr:hover td { background: transparent; }
}

/* Guardian and Falcon expose each record locally on a phone. The desktop
   detail pane remains the only visible full-record column at larger widths. */
.cg-protection-module :is(th, td).cg-record-detail { display: none; }

@media (max-width: 700px) {
  .cg-hosted-shell .cg-protection-module { min-width: 0; max-width: 100%; }
  .cg-hosted-shell .cg-protection-module .inner-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 6px; max-width: 100%; overflow: visible; }
  .cg-hosted-shell .cg-protection-module .inner-tab { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 44px; padding: 10px 8px; font-size: 14px; line-height: 1.35; text-align: center; white-space: normal; overflow-wrap: break-word; }
  .cg-hosted-shell .cg-protection-module .summary-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 10px; padding: 12px; }
  .cg-hosted-shell .cg-protection-module .summary-toolbar > .muted { min-width: 0; max-width: 100%; font-size: 13px; line-height: 1.55; overflow-wrap: break-word; }
  .cg-hosted-shell .cg-protection-module .summary-toolbar > form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; width: 100%; min-width: 0; margin: 0; }
  .cg-hosted-shell .cg-protection-module .summary-toolbar > form :is(input:not([type="hidden"]), select, button) { width: 100%; min-width: 0; max-width: 100%; margin: 0; }
  .cg-hosted-shell .cg-protection-module :is(.config-split, .config-split > .editor-pane) { min-width: 0; max-width: 100%; }
  .cg-hosted-shell .cg-protection-module .config-split { grid-template-columns: minmax(0, 1fr); }
  .cg-hosted-shell .cg-protection-module :is(.form-row, .path-row) { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .cg-hosted-shell .cg-protection-module :is(.form-row > span, .check-row) { font-size: 14px; line-height: 1.55; overflow-wrap: break-word; }
  .cg-hosted-shell .cg-protection-module .check-row { align-items: center; gap: 10px; padding: 5px 0; }
  .cg-hosted-shell .cg-protection-module .desktop-action-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; width: 100%; }
  .cg-hosted-shell .cg-protection-module .desktop-action-row :is(button, .button) { width: 100%; min-width: 0; margin: 0; padding: 10px 12px; font-size: 14px; white-space: normal; }
  .cg-hosted-shell .cg-protection-module :is(.stats-band, .guardian-stats) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cg-hosted-shell .cg-protection-module :is(.stat, .guardian-stat) { min-width: 0; min-height: 100px; padding: 14px; }
  .cg-hosted-shell .cg-protection-module :is(.stat span, .guardian-stat span) { font-size: 12px; line-height: 1.5; letter-spacing: .03em; overflow-wrap: break-word; }
  .cg-hosted-shell .cg-protection-module .guardian-stat small { font-size: 12px; line-height: 1.5; overflow-wrap: break-word; }

  .cg-hosted-shell .cg-protection-module .cg-mobile-records { grid-template-columns: minmax(0, 1fr); min-width: 0; }
  .cg-hosted-shell .cg-protection-module .cg-mobile-records > .split-table { min-height: 0; }
  .cg-hosted-shell .cg-protection-module .cg-mobile-records > aside.split-detail { display: none; }
  .cg-hosted-shell .cg-protection-module .cg-mobile-cards tbody td { grid-template-columns: minmax(90px, .3fr) minmax(0, 1fr); gap: 6px 14px; font-size: 14px; line-height: 1.6; }
  .cg-hosted-shell .cg-protection-module .cg-mobile-cards tbody td::before { min-width: 0; font-size: 12px; line-height: 1.65; overflow-wrap: break-word; }
  .cg-hosted-shell .cg-protection-module .cg-mobile-cards .cg-cell-value { min-width: 0; max-width: 100%; font-size: 14px; line-height: 1.6; white-space: normal; overflow-wrap: anywhere; word-break: normal; }
  .cg-hosted-shell .cg-protection-module .cg-mobile-cards tbody td:first-child .cg-cell-value { font-size: 15px; font-weight: 600; }
  .cg-hosted-shell .cg-protection-module .cg-mobile-cards tbody tr.selected { border-color: var(--cg-accent); background: color-mix(in srgb, var(--cg-accent) 11%, var(--cg-panel)); }
  .cg-hosted-shell .cg-protection-module .cg-mobile-cards tbody tr:focus-visible { outline: 2px solid var(--cg-accent); outline-offset: 3px; }
  .cg-hosted-shell .cg-protection-module .cg-mobile-cards tbody tr:is(.selected, :focus-visible) td { background: transparent; }
  .cg-hosted-shell .cg-protection-module .cg-mobile-cards th.cg-record-detail { display: table-cell; }
  .cg-hosted-shell .cg-protection-module .cg-mobile-cards tbody td.cg-record-detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .cg-hosted-shell .cg-protection-module .cg-record-detail .cg-cell-value > details { min-width: 0; max-width: 100%; border: 1px solid var(--cg-border); border-radius: 7px; background: var(--cg-input); }
  .cg-hosted-shell .cg-protection-module .cg-record-detail summary { min-height: 44px; padding: 11px 12px; color: var(--cg-text); font-size: 14px; line-height: 1.5; list-style-position: inside; cursor: pointer; overflow-wrap: break-word; }
  .cg-hosted-shell .cg-protection-module .cg-record-detail pre { width: 100%; min-width: 0; max-width: 100%; max-height: none; margin: 0; padding: 0 12px 12px; color: var(--cg-text); font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; }
}

@media (max-width: 430px) {
  .cg-hosted-shell .cg-protection-module .inner-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cg-hosted-shell .cg-protection-module .cg-mobile-cards tbody td { grid-template-columns: minmax(0, 1fr); }
  .cg-hosted-shell .cg-protection-module .cg-mobile-cards tbody td::before { font-weight: 600; }
}

@media (max-width: 360px) {
  .cg-hosted-shell .cg-protection-module :is(.stats-band, .guardian-stats) { grid-template-columns: minmax(0, 1fr); }
}

/* The map handles its own gestures; the surrounding page keeps native scroll. */
.cg-hosted-shell #map-stage { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.cg-hosted-shell #map-stage img { -webkit-user-drag: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.cg-hosted-shell #map-stage > canvas#map-tile-layer { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; opacity: 1; pointer-events: none; }
.cg-hosted-shell #map-stage > #map-surface { z-index: 1; }
.cg-hosted-shell #map-stage.has-map-renderer #map-image { visibility: hidden; }
.cg-hosted-shell #map-controls-panel .map-zoom-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.cg-hosted-shell #map-controls-panel .map-zoom-controls button { min-width: 44px; min-height: 44px; padding: 10px 12px; font-size: 14px; line-height: 1.4; }
.cg-hosted-shell #map-controls-panel #map-zoom-reset { min-width: 88px; }
.cg-hosted-shell #map-gesture-help { margin: 9px 0 0; color: var(--cg-muted); font-size: 13px; line-height: 1.55; }

@media (max-width: 980px) {
  .cg-hosted-shell #map-workspace, .cg-hosted-shell #map-workspace.sidebar-collapsed { grid-template-columns: minmax(0, 1fr); min-width: 0; max-width: 100%; }
  .cg-hosted-shell #map-stage { width: 100%; min-width: 0; max-width: 100%; height: min(calc(100vw - 28px), 70vh); height: min(calc(100vw - 28px), 70svh); min-height: 280px; max-height: 70vh; max-height: 70svh; aspect-ratio: auto; }
  .cg-hosted-shell #map-sidebar { position: static; width: 100%; min-width: 0; max-width: 100%; max-height: none; overflow: visible; }
  .cg-hosted-shell #map-controls-panel { min-width: 0; max-width: 100%; }
  .cg-hosted-shell #map-controls-panel .map-command-heading { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cg-hosted-shell #map-controls-panel .map-command-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: 0; }
  .cg-hosted-shell #map-controls-panel .map-command-actions > button { width: 100%; min-width: 0; min-height: 44px; padding: 10px 8px; white-space: normal; }
  .cg-hosted-shell #map-controls-panel .map-command-actions > .map-zoom-controls { grid-column: 1 / -1; }
  .cg-hosted-shell #map-controls-panel .map-zoom-controls button { width: auto; }
  .cg-hosted-shell #map-controls-panel .map-tool-strip { min-width: 0; }
  .cg-hosted-shell #map-controls-panel .map-tool-value { max-width: 100%; overflow-wrap: break-word; }
}

@media (max-width: 980px) and (max-height: 480px) and (orientation: landscape) {
  .cg-hosted-shell #map-stage { height: 65vh; height: 65svh; min-height: 0; max-height: 65vh; max-height: 65svh; aspect-ratio: auto; }
}
