/* Shared shell integration; legacy functionality keeps its original form owner. */
body.unified-cockpit .cockpit{display:block;min-height:100vh}
body.unified-cockpit .cockpit-workspace>main{width:100%!important;max-width:none!important;margin:0;padding:0 0 30px}
body.unified-cockpit .cockpit-sidebar{height:100dvh;min-height:0;align-items:stretch;overflow:hidden}
body.unified-cockpit .cockpit-spine{display:flex;flex-direction:column;height:100%;min-height:0;width:100%}
body.unified-cockpit .cockpit-utilities{display:flex;padding:18px 0;gap:4px}
body.unified-cockpit .cockpit-utilities>.cockpit-nav-link{flex:1}
body.unified-cockpit .cockpit-search-trigger{width:48px;min-width:48px;justify-content:center;padding:0}
body.unified-cockpit .cockpit-search-trigger>span{display:none}
body.unified-cockpit .cockpit-tools{overflow:auto;max-height:45vh;flex:none}
body.unified-cockpit .cockpit-sidebar-foot{flex:none}
body.unified-cockpit .cockpit-sidebar-foot>span:nth-child(2){min-width:0;flex:1;overflow-wrap:anywhere}
body.unified-cockpit .cockpit-help,body.unified-cockpit .cockpit-logout{min-width:36px;width:36px;min-height:48px;padding:0;justify-content:center}
body.unified-cockpit .cockpit-section-link>span:last-child{min-width:0;flex:1}
body.unified-cockpit .cockpit-section-link small{display:block;font-size:9px;color:var(--cockpit-night-muted)}
body.unified-cockpit .cockpit-section-link .campo-dot{float:right;margin-top:-14px}
body.unified-cockpit .cockpit-menu #cockpit-menu-slot{background:var(--cockpit-night);color:var(--cockpit-night-text);padding:18px;max-height:calc(88dvh - 85px);overflow:auto}
body.unified-cockpit .cockpit-menu .cockpit-spine{height:auto;min-height:0}
body.unified-cockpit .cockpit-menu .cockpit-section-list{flex:none;max-height:none;overflow:visible}
body.unified-cockpit .cockpit-menu .cockpit-brand{display:none}
body.unified-cockpit .cockpit-menu-head strong{font:600 24px var(--cockpit-serif);color:var(--cockpit-wine)}
body.unified-cockpit .cockpit-page-head .campo-dot{margin-right:5px}
body.unified-cockpit .campo-current h1{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal}
body.unified-cockpit .campo-current{padding:0 0 24px;margin:0;scroll-margin-top:24px}
body.unified-cockpit .campo-current h1>[data-campo-active-id]{color:var(--cockpit-muted);font-size:.5em}
body.unified-cockpit .campo-current [data-campo-active-state]{font-size:11px;margin-top:12px;color:var(--cockpit-muted)}
body.unified-cockpit .cockpit-capture-surface{display:grid;grid-template-columns:minmax(0,1fr) 270px;border:1px solid var(--cockpit-line);border-radius:16px;background:var(--cockpit-surface);overflow:clip}
body.unified-cockpit .cockpit-mode-form{min-width:0}
body.unified-cockpit .cockpit-mode-form #main-project-form{border:0;margin:0;padding:26px;box-shadow:none;background:transparent;border-radius:0}
body.unified-cockpit .cockpit-mode-form #main-project-form>h2[data-campo-visible="segment"]{font:600 23px var(--cockpit-serif);margin:0 0 25px;padding:0 0 18px;border-bottom:1px solid var(--cockpit-line);color:var(--cockpit-wine)}
body.unified-cockpit .cockpit-mode-form .grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 24px}
body.unified-cockpit .cockpit-evidence-panel{padding:25px 22px;border-left:1px solid var(--cockpit-line);background:var(--cockpit-paper-soft);min-width:0}
body.unified-cockpit .cockpit-evidence-panel h2{font:600 24px/1.2 var(--cockpit-serif);color:var(--cockpit-wine);margin:11px 0 20px}
body.unified-cockpit .cockpit-evidence-panel .cockpit-kicker{font-size:9px;letter-spacing:1px;color:var(--cockpit-muted)}
body.unified-cockpit .campo-photos{padding:25px 15px;border:1px dashed var(--cockpit-line-strong);border-radius:10px;background:var(--cockpit-surface);font-size:12px;margin-bottom:18px}
body.unified-cockpit .campo-photos ul{padding:0;margin:0;list-style:none}
body.unified-cockpit .campo-photos a{overflow-wrap:anywhere}
body.unified-cockpit .campo-photos-empty{margin:0;color:var(--cockpit-muted);text-align:center}
body.unified-cockpit .campo-photos ul:empty{display:none}
body.unified-cockpit .cockpit-evidence-tip{font-size:11px;line-height:1.7;color:var(--cockpit-muted);border-top:1px solid var(--cockpit-line);margin-top:20px;padding-top:16px}
body.unified-cockpit .campo-bar,body.unified-cockpit .sticky-actions{position:fixed;left:var(--cockpit-rail);right:0;bottom:0;z-index:55;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:17px 46px;min-height:92px;max-width:none;transform:none;background:var(--cockpit-surface);border:0;border-top:1px solid var(--cockpit-line);border-radius:0;box-shadow:none}
body.unified-cockpit .campo-msg{font-size:12px;margin:0;color:var(--cockpit-muted)}
body.unified-cockpit .campo-msg[data-tone="warn"]{color:var(--cockpit-amber)}
body.unified-cockpit .campo-msg[data-tone="ok"]{color:var(--cockpit-green)}
body.unified-cockpit .campo-actions{display:flex;gap:10px;margin:0}
body.unified-cockpit .campo-btn{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:0 20px;border:1px solid var(--cockpit-line-strong);border-radius:8px;font:600 12px var(--cockpit-sans);background:var(--cockpit-surface);color:var(--cockpit-wine)}
body.unified-cockpit .campo-primary{background:var(--cockpit-gold);border-color:var(--cockpit-gold);color:var(--cockpit-gold-ink);min-width:170px}
body.unified-cockpit .campo-photo-btn{width:100%}
body.unified-cockpit .m-app.cockpit-workspace{width:auto;max-width:none}
body.unified-cockpit.m-body{padding:0}
body.unified-cockpit .cockpit-form-section{margin:0 0 22px;padding:24px 26px;background:var(--cockpit-surface);border:1px solid var(--cockpit-line);border-radius:13px}
body.unified-cockpit .cockpit-form-section>h2{font:600 26px var(--cockpit-serif);margin:0 -26px 24px;padding:0 26px 20px;border-bottom:1px solid var(--cockpit-line);color:var(--cockpit-wine)}
body.unified-cockpit:not(.modo-campo):not(.modo-escritorio) #main-project-form{padding:0;border:0;background:none;box-shadow:none}
body.unified-cockpit .cockpit-capture-surface select{font-weight:600}
body.unified-cockpit .cockpit-dock-state{font-size:9px;line-height:1.5;color:var(--cockpit-night-muted);min-width:0}
body.unified-cockpit .cockpit-mobile-dock [hidden]{display:none}
body.unified-cockpit .hero.compact{background:transparent;color:var(--cockpit-ink);border:0;padding:0;margin:0 0 28px;box-shadow:none}
body.unified-cockpit .hero.compact h1{font:600 44px/1.1 var(--cockpit-serif);color:var(--cockpit-wine);margin:10px 0 14px;letter-spacing:-1px}
body.unified-cockpit .hero.compact .eyebrow{color:var(--cockpit-wine);font-size:10px;letter-spacing:1.5px}
body.unified-cockpit .hero.compact .hero-actions{margin-top:14px;max-width:none;justify-content:flex-start}
body.unified-cockpit .readiness-graph{background:var(--cockpit-surface);border:1px solid var(--cockpit-line);box-shadow:none;border-radius:12px;margin-bottom:22px}
body.unified-cockpit .readiness-heading h2{font:600 21px var(--cockpit-serif);color:var(--cockpit-wine)}
body.unified-cockpit .readiness-next{background:var(--cockpit-gold-soft);border-color:var(--cockpit-line-strong)}
body.unified-cockpit :where(.m-sticky-save,.ow-dock,.statusbar){bottom:0}
body.unified-cockpit .table-scroll{max-width:100%;overflow:auto}
body.unified-cockpit :where(.grid,.subpanel,.section-note,.form-panel){min-width:0}
@media(max-width:960px){
body.unified-cockpit .cockpit-workspace{margin-left:0;padding:24px 18px 130px}
body.unified-cockpit .cockpit-sidebar{display:none}
body.unified-cockpit .cockpit-capture-surface{display:flex;flex-direction:column}
body.unified-cockpit .cockpit-evidence-panel{order:0;border-left:0;border-bottom:1px solid var(--cockpit-line);padding:15px 16px;display:grid;grid-template-columns:1fr 48px;gap:8px 12px;align-items:center}
body.unified-cockpit .cockpit-evidence-panel h2{font:600 12px var(--cockpit-sans);margin:0;grid-column:1}
body.unified-cockpit .cockpit-evidence-panel .cockpit-kicker,body.unified-cockpit .cockpit-evidence-tip{display:none}
body.unified-cockpit .campo-photos{grid-column:1;grid-row:2;border:0;background:none;padding:0;margin:0;font-size:10px}
body.unified-cockpit .campo-photos-empty{text-align:left}
body.unified-cockpit .cockpit-evidence-panel .campo-photo-btn{grid-row:1/3;grid-column:2;font-size:0;min-width:48px;width:48px;padding:0}
body.unified-cockpit .cockpit-evidence-panel .campo-photo-btn:before{content:'+';font:400 25px var(--cockpit-sans)}
body.unified-cockpit .cockpit-mode-form{order:1}
body.unified-cockpit .cockpit-mode-form #main-project-form{padding:22px 16px}
body.unified-cockpit .cockpit-mode-form .grid{grid-template-columns:1fr;gap:17px}
body.unified-cockpit .campo-bar,body.unified-cockpit #sticky-actions{display:none}
body.unified-cockpit .cockpit-mobile-dock{display:flex;min-height:87px;padding:10px 14px calc(10px + env(safe-area-inset-bottom))}
body.unified-cockpit .cockpit-mobile-primary{flex:1}
body.unified-cockpit .cockpit-mobile-dock .cockpit-dock-state:empty{display:none}
body.unified-cockpit .cockpit-mobile-action{flex:none;min-width:52px}
body.unified-cockpit .cockpit-form-section{padding:21px 16px;border-radius:12px}
body.unified-cockpit .cockpit-form-section>h2{font-size:24px;margin:0 -16px 21px;padding:0 16px 17px}
body.unified-cockpit .hero.compact h1{font-size:35px}

body.unified-cockpit :where(.m-sticky-save,.ow-dock,.statusbar){bottom:var(--cockpit-dock)}
body.unified-cockpit :where(.m-sticky-save,.ow-dock,.statusbar)~*{scroll-margin-bottom:180px}
}

body.unified-cockpit .cockpit-sidebar-foot>form{flex:none;width:auto;margin:0;padding:0;border:0;box-shadow:none;background:transparent}

body.unified-cockpit .cockpit-boolean-field{min-width:0}
body.unified-cockpit .cockpit-boolean-field>label{display:block;margin-bottom:9px}
body.unified-cockpit .cockpit-boolean{display:flex;gap:0;max-width:240px;border:1px solid var(--cockpit-line-strong);border-radius:8px;background:var(--cockpit-surface);overflow:hidden}
body.unified-cockpit .cockpit-boolean>button{flex:1;min-height:48px;padding:10px 20px;border:0;border-radius:0;box-shadow:none;background:transparent;color:var(--cockpit-muted);font:600 12px var(--cockpit-sans)}
body.unified-cockpit .cockpit-boolean>button+button{border-left:1px solid var(--cockpit-line)}
body.unified-cockpit .cockpit-boolean>[aria-checked="true"]{background:var(--cockpit-gold-soft);color:var(--cockpit-wine)}
body.unified-cockpit .cockpit-boolean>[aria-checked="true"]:before{content:'✓';margin-right:8px}
body.unified-cockpit .cockpit-boolean>button:disabled{opacity:.65;cursor:default}

body.unified-cockpit .cockpit-sidebar-foot{gap:6px;padding-left:0;padding-right:0}
body.unified-cockpit .cockpit-sidebar-foot>span:nth-child(2){overflow-wrap:normal}
body.unified-cockpit .campo-current h1{max-width:none;font-size:42px}
body.unified-cockpit.modo-campo .cockpit-mode-form #main-project-form>h2[data-campo-visible="segment"]{display:none}
body.unified-cockpit .hero.compact .back{display:none}
body.unified-cockpit .hero.compact h1{max-width:100%;font-size:40px}
body.unified-cockpit :where(.stepper,#spine){display:none}
body.unified-cockpit .cockpit-document-actions{display:flex;flex-direction:column;align-items:stretch;gap:5px;padding:15px 8px;border-top:1px solid var(--cockpit-night-rule);margin:10px 0}
body.unified-cockpit .cockpit-document-actions :where(a,button,summary){color:var(--cockpit-night-text);text-align:left;font:500 11px/1.5 var(--cockpit-sans);min-height:48px;border:0;background:none;box-shadow:none;white-space:normal}
body.unified-cockpit .cockpit-document-actions .cloud-presence-badge{margin:8px 0}
body.unified-cockpit .cockpit-document-actions .view-mode-toggle{max-width:100%;flex-wrap:wrap;background:var(--cockpit-night-active);border:0}
body.unified-cockpit .cockpit-project-tools{margin:0 0 22px;padding:0;border:1px solid var(--cockpit-line);border-radius:10px;background:var(--cockpit-surface)}
body.unified-cockpit .cockpit-project-tools>summary{padding:16px 20px;min-height:52px;color:var(--cockpit-wine);font:600 12px var(--cockpit-sans);cursor:pointer}
body.unified-cockpit .cockpit-project-tools[open]{padding-bottom:15px}
body.unified-cockpit .cockpit-project-tools>section,body.unified-cockpit .cockpit-project-tools>.campo-desk-tools{margin:12px 16px;box-shadow:none}
body.unified-cockpit .readiness-graph{padding:20px 24px}
body.unified-cockpit .readiness-heading{margin:0 0 12px}
body.unified-cockpit .readiness-heading h2{font:600 20px var(--cockpit-serif)}
body.unified-cockpit .readiness-scope{font-size:11px}
body.unified-cockpit .readiness-counts{margin:0 0 10px}
body.unified-cockpit .readiness-counts>span{font-size:10px}
body.unified-cockpit .readiness-list>summary{min-height:48px;padding:12px 0;font-size:12px}
@media(max-width:960px){body.unified-cockpit .campo-current h1{font-size:34px;max-width:none}body.unified-cockpit .hero.compact h1{font-size:34px}body.unified-cockpit .readiness-graph{padding:17px 16px}body.unified-cockpit .cockpit-project-tools>summary{font-size:11px;padding:14px 16px}}
body.unified-cockpit .cockpit-tools .flight-deck-workbench-bar{display:block;position:static;max-width:100%;width:auto;margin:12px 0;padding:12px 8px;border:0;border-top:1px solid var(--cockpit-night-rule);background:transparent;box-shadow:none;color:var(--cockpit-night-text)}
body.unified-cockpit .cockpit-tools .workbench-bar-actions{display:flex;flex-direction:column;align-items:stretch;gap:6px}
body.unified-cockpit .cockpit-tools .btn-workbench-toggle{min-height:48px;white-space:normal;text-align:left;color:var(--cockpit-night-text);background:var(--cockpit-night-active);border-color:var(--cockpit-night-rule)}
body.unified-cockpit .flight-deck-reopen-pill{display:none!important}
body.unified-cockpit .sticky-actions>.primary{background:var(--cockpit-gold);color:var(--cockpit-gold-ink);border-color:var(--cockpit-gold);border-radius:8px;box-shadow:none;min-height:48px;min-width:170px}
body.unified-cockpit :where(button,[role="button"],.button){min-height:48px;min-width:48px}
@media(max-width:960px){body.unified-cockpit .cockpit-menu :where(.cockpit-help,.cockpit-logout){width:48px;min-width:48px;min-height:48px}}

@media(max-width:960px){
body.unified-cockpit .cockpit-mobile-dock .cockpit-dock-state:not(:empty){display:block;position:absolute;bottom:100%;left:0;right:0;padding:9px 18px;background:var(--cockpit-surface);color:var(--cockpit-muted);border-top:1px solid var(--cockpit-line);font:500 11px/1.5 var(--cockpit-sans)}
body.unified-cockpit .cockpit-mobile-dock .cockpit-dock-state:is([data-state="error"],[data-state="conflict"],[data-state="validation"]){color:var(--cockpit-danger)}
}

/* Keep map controls, especially Close, reachable beside long titles on phones. */
@media (max-width: 760px) {
  body.unified-cockpit .gis-lightbox-content {
    width: calc(100vw - 24px) !important;
    max-height: calc(100dvh - 24px);
    overflow: auto;
  }
  body.unified-cockpit .gis-lightbox-header {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
  }
  body.unified-cockpit .gis-lightbox-header > div:first-child { padding-right: 52px; }
  body.unified-cockpit .gis-lightbox-header > div:last-child { flex-wrap: wrap; }
  body.unified-cockpit .gis-lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    margin: 0 !important;
    min-width: 48px;
    min-height: 48px;
  }
  body.unified-cockpit .gis-lightbox-body { padding: 12px !important; max-height: 60dvh !important; }
  body.unified-cockpit .gis-lightbox-footer { flex-wrap: wrap; gap: 12px; padding: 16px; }
  body.unified-cockpit .gis-lightbox-footer > div { flex-wrap: wrap; }
  body.unified-cockpit #gis-sheet-counter { min-width: 48px; }
  body.unified-cockpit #gis-lightbox-download { width: 100%; text-align: center; justify-content: center; }
}

/* Phone target sizes survive more specific legacy page/button selectors. */
@media (max-width: 960px) {
  body.unified-cockpit :is(button, [role="button"], input[type="submit"], input[type="button"], input[type="reset"], .button, .btn, .m-btn, .ow-button) {
    min-width: 48px !important;
    min-height: 48px !important;
  }
}
