/* Crosscut Hub — visual layer (v0.21). Loads right after app.css and brings every screen to the Proposals/Inbox look:
   soft cards, rounded controls, sentence-case type, calmer chrome. Layout and markup stay in app.css / app.js. */
:root {
  --ground: #f3f1ed; --line: #e7e3dc; --muted: #86817a; --ink: #45423e; --charcoal: #232221;
  --r: 14px; --r-sm: 10px; --ease: cubic-bezier(.2,.8,.2,1);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.06);
  --shadow-hi: 0 2px 6px rgba(0,0,0,.06), 0 16px 40px rgba(0,0,0,.10);
  --fill: #efece6; --fill-2: #e8e4dc; --focus: 0 0 0 3px rgba(248,156,51,.28);
}
body { font-size: 15px; letter-spacing: -.005em; font-feature-settings: "tnum" 0; text-rendering: optimizeLegibility; }
::selection { background: rgba(248,156,51,.3); }

/* ---- type ---- */
h1, h2, h3 { font-family: var(--text); text-transform: none; letter-spacing: -.02em; color: var(--charcoal); }
h1 { font-size: 28px; font-weight: 700; } h2 { font-size: 20px; font-weight: 700; } h3 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.label { font-family: var(--text); font-weight: 600; font-size: 11.5px; letter-spacing: .02em; text-transform: none; color: var(--muted); }
.num { font-family: var(--text); font-weight: 700; font-size: 30px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.opp .v, .score { font-family: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* ---- chrome ---- */
.topbar { height: var(--nav-h); }
@media (min-width: 900px) {
  .topbar { background: color-mix(in srgb, var(--ground) 82%, transparent); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); border-bottom: 1px solid transparent; }
  .shell { grid-template-columns: 248px minmax(0, 1fr); } /* minmax(0,…): a wide board scrolls inside the page instead of stretching it */
  .side { background: #1f1e1d; }
  .side-logo { border-bottom: 0; padding: 22px 22px 14px; }
  .side-nav { padding: 6px 10px; }
  .side-nav a { border-left: 0; border-radius: 10px; padding: 10px 12px; margin: 1px 0; font-size: 15px; gap: 12px; color: #c9c4bb; transition: background .15s, color .15s; }
  .side-nav a svg { width: 20px; height: 20px; opacity: .75; }
  .side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
  .side-nav a.on { background: rgba(255,255,255,.1); color: #fff; font-weight: 600; }
  .side-nav a.on svg { color: var(--orange); opacity: 1; }
  .side-user { border-top: 1px solid rgba(255,255,255,.07); margin: 0 10px; padding: 14px 6px; }
  .side-user .btn, .side-user button:not(.avatar) { border-radius: 8px; border: 1px solid rgba(255,255,255,.14) !important; background: transparent; color: #a9a49b; font: 600 12px/1 var(--text); padding: 7px 10px; letter-spacing: 0; text-transform: none; }
  .main { padding: 22px 32px 48px; }
}
.search input { border-radius: var(--r-sm); border: 1px solid transparent; }
@media (min-width: 900px) { .search input { background: var(--paper); border-color: var(--line); box-shadow: 0 1px 2px rgba(0,0,0,.03); } }
.search .results { border-radius: 12px; border: 0; box-shadow: var(--shadow-hi); overflow: hidden; margin-top: 6px; }
.search .gi { padding: 10px 14px; } .search .gi:last-child { border-bottom: 0; }
.avatar { border-radius: 50%; font-family: var(--text); font-weight: 700; font-size: 12.5px; }
.pill { border-radius: 999px; font-family: var(--text); font-weight: 700; font-size: 11px; padding: 1px 7px; line-height: 17px; }
.side-nav a .pill { background: var(--orange); color: #231f1a; }
.tabs { background: color-mix(in srgb, #1f1e1d 92%, transparent); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); border-top: .5px solid rgba(255,255,255,.08); }
.tabs a { font-family: var(--text); font-size: 10.5px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.morepop { border-radius: 18px; background: color-mix(in srgb, #1f1e1d 94%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: .5px solid rgba(255,255,255,.1); }
.morepop::after { display: none; }
.moregrid a { font-family: var(--text); font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; border-radius: 12px; }

/* ---- cards & lists ---- */
.grid { gap: 14px; } .grid > * { min-width: 0; }
.card { border: 0; border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 18px 16px; }
.card.accent { border-top: 0; box-shadow: inset 0 3px 0 var(--orange), var(--shadow); }
.card h3 { margin-bottom: 12px; }
.card h3 .pill { background: var(--fill); color: var(--ink); }
.card.accent h3 .pill { background: var(--orange); color: #231f1a; }
.stat .label { margin-bottom: 2px; }
.list li { padding: 11px 0; border-top-color: var(--line); align-items: center; }
.list li .t { font-weight: 600; }
.empty { padding: 22px 0; font-size: 14px; }
.toolbar { gap: 10px; margin-bottom: 18px; align-items: center; }
.toolbar h1 { margin-right: auto; }
.toolbar > .muted, .toolbar > span.muted { font-size: 13.5px; }

/* segmented control (was square tabs) */
.seg { display: inline-flex; border: 0; background: var(--fill-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border-radius: 8px; padding: 7px 12px; font: 600 13px/1 var(--text); letter-spacing: 0; text-transform: none; color: var(--ink); transition: background .2s var(--ease), box-shadow .2s var(--ease); }
.seg button.on { background: var(--paper); color: var(--charcoal); box-shadow: 0 1px 4px rgba(0,0,0,.14); }

/* ---- buttons & fields ---- */
.btn { border-radius: var(--r-sm); font: 650 14px/1.1 var(--text); letter-spacing: -.005em; text-transform: none; padding: 10px 15px; transition: background .15s, transform .12s var(--ease), box-shadow .15s; }
.btn:active { transform: scale(.97); }
.btn.sm { padding: 7px 11px; font-size: 13px; border-radius: 9px; }
.btn.ghost { border: 0; background: var(--fill); color: var(--charcoal); }
.btn.ghost:hover { background: var(--fill-2); }
.btn.dark:hover { background: #000; }
.btn:focus-visible, .seg button:focus-visible, .side-nav a:focus-visible { outline: none; box-shadow: var(--focus); }
input, select, textarea { border-radius: var(--r-sm); border: 1px solid var(--line); padding: 10px 12px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--orange); box-shadow: var(--focus); }
input[type=checkbox], input[type=radio] { accent-color: var(--orange); }
select { appearance: none; -webkit-appearance: none; padding-right: 32px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2386817a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center; }
.field .label { font-size: 12px; }

/* ---- modal → sheet ---- */
.modal-bg { background: rgba(20,20,20,.38); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: thFade .2s ease-out; }
.modal { border-top: 0; border-radius: 20px 20px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0,0,0,.18); animation: thUp .32s var(--ease); }
@media (min-width: 720px) { .modal { border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.28); animation: thPop .26s var(--ease); } }
.modal .actions { gap: 8px; }
@keyframes thFade { from { opacity: 0; } } @keyframes thUp { from { transform: translateY(40px); opacity: .4; } } @keyframes thPop { from { transform: scale(.96); opacity: 0; } }

/* ---- tables ---- */
table.data { background: transparent; font-size: 14px; }
.card table.data { margin: 0 -4px; width: calc(100% + 8px); }
table.data th { font: 600 12px/1.2 var(--text); letter-spacing: 0; text-transform: none; color: var(--muted); border-bottom: 1px solid var(--line); padding: 8px 8px 9px; }
table.data td { padding: 11px 8px; border-bottom-color: #f0ede7; vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover td { background: #faf8f5; }
.card > table.data:only-child, .card > .data { box-shadow: none; }
.reasons span { border: 0; background: var(--fill); border-radius: 6px; padding: 2px 7px; }
.tier { border-radius: 6px; font: 700 10.5px/1.5 var(--text); letter-spacing: .02em; padding: 1px 7px; text-transform: none; }
.score { border-radius: 12px; font-weight: 700; font-size: 18px; }

/* ---- pipeline ---- */
.board { gap: 14px; padding-bottom: 16px; scroll-snap-type: x proximity; }
.col { flex: 0 0 272px; background: #ebe8e1; border-top: 0; border-radius: 16px; padding-bottom: 4px; scroll-snap-align: start; }
.col.hot { box-shadow: inset 0 3px 0 var(--orange); } .col.done { background: #e9efe9; border-top: 0; box-shadow: inset 0 3px 0 var(--green); }
.col header { padding: 12px 14px 10px; }
.col header .label { color: var(--charcoal); font-size: 13px; font-weight: 700; }
.opp { margin: 0 8px 8px; padding: 12px 13px; border: 0; border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 3px 10px rgba(0,0,0,.04); border-left: 0; transition: transform .15s var(--ease), box-shadow .15s; position: relative; }
.opp:hover { box-shadow: var(--shadow-hi); transform: translateY(-1px); }
.opp.stale::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--red); }
.opp .t { font-weight: 600; } .opp .v { font-size: 16px; font-weight: 700; margin-top: 6px; }
.opp .src { border-radius: 6px; font: 700 10px/1.6 var(--text); letter-spacing: .02em; padding: 0 6px; background: var(--fill); }

/* ---- schedule ---- */
.sched { border: 0; border-radius: var(--r); box-shadow: var(--shadow); }
.sched th, .sched td { border-color: #efebe4; }
.sched th { font: 600 11.5px/1.25 var(--text); letter-spacing: 0; text-transform: none; background: #faf8f5; }
.sched th.today { color: var(--orange-2); box-shadow: inset 0 -2px 0 var(--orange); }
.sched td.eq { font: 600 12.5px/1.2 var(--text); letter-spacing: 0; background: #faf8f5; }
.sched td.sun { background: #f6f3ee; }
.sched .blk { border-radius: 7px; margin: 3px; height: calc(100% - 6px); line-height: 32px; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.capbar { height: 8px; border-radius: 99px; overflow: visible; background: var(--fill-2); }
.capbar i { border-radius: 99px; }
.cbar { border: 0; border-radius: 99px; overflow: hidden; }

/* ---- map ---- */
.mapbox { border: 0; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.mapside, .mapdetail { border-radius: var(--r); }
.lyr { border-bottom-color: #f0ede7; padding: 8px 4px; }
.pdetail { border-top: 0; padding-top: 4px; }
@media (max-width: 900px) { .mapside .lyr { border-radius: 999px; border: 0; background: var(--paper); box-shadow: 0 1px 3px rgba(0,0,0,.08); } }

/* ---- inbox (legacy) + misc ---- */
.toast { border-left: 0; border-radius: 999px; padding: 11px 18px; font-weight: 500; background: color-mix(in srgb, #1f1e1d 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: thUp .3s var(--ease); }
.scope.keep { border-left: 0; border-radius: 10px; box-shadow: inset 3px 0 0 var(--orange); }
.oak { border-radius: 10px; }
.crewcard { border-radius: var(--r); transition: transform .15s var(--ease), box-shadow .15s; } .crewcard:hover { transform: translateY(-1px); box-shadow: var(--shadow-hi); }
details > summary { cursor: pointer; }

/* ---- login ---- */
.login { background: radial-gradient(1200px 600px at 50% -10%, #3a3733 0%, #1c1b1a 60%); }
.login form { border-top: 0; border-radius: 22px; padding: 34px 30px 30px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.login input { border: 1px solid var(--line); border-radius: 12px; font-size: 17px; background: #faf8f5; }
.login .btn { width: 100%; padding: 14px; font-size: 16px; border-radius: 12px; }
.login .label { font-size: 12.5px; }

/* ---- deal stage: compact menu + progress bar ---- */
.stage-sel { width: auto; min-width: 150px; font-weight: 600; background-color: var(--paper); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.stepper { display: flex; gap: 4px; margin: -4px 0 18px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.stepper::-webkit-scrollbar { display: none; }
.stepper button { flex: 1 0 auto; min-width: 92px; border: 0; background: none; padding: 0; cursor: pointer; display: flex; flex-direction: column; gap: 7px; text-align: left; font: 600 12px/1.2 var(--text); color: var(--muted); border-radius: 6px; }
.stepper button i { display: block; height: 6px; border-radius: 99px; background: var(--fill-2); transition: background .3s var(--ease); }
.stepper button.done i { background: color-mix(in srgb, var(--orange) 55%, var(--fill-2)); }
.stepper button.on i { background: var(--orange); box-shadow: 0 0 0 3px rgba(248,156,51,.18); }
.stepper button.done span { color: var(--ink); } .stepper button.on span { color: var(--charcoal); font-weight: 700; }
.stepper button:hover i { background: color-mix(in srgb, var(--orange) 35%, var(--fill-2)); } .stepper button.on:hover i { background: var(--orange); }
.stepper button:focus-visible { outline: none; box-shadow: var(--focus); }
.stepper.off button { opacity: .45; } .stepper-note { align-self: flex-end; white-space: nowrap; font: 700 12px/1 var(--text); color: var(--red); padding: 0 6px 1px; }

/* ---- phones: wide tables scroll sideways instead of crushing ---- */
@media (max-width: 719px) {
  table.data { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  table.data td, table.data th { white-space: nowrap; }
  h1 { font-size: 26px; }
  .card { padding: 16px 15px 14px; }
  .toolbar { gap: 8px; }
}

/* ---- phone fixes (v0.21.1) ---- */
/* Checkboxes/radios keep their natural size (app.css gives every input width:100%, which squeezed their labels into a sliver). */
input[type=checkbox], input[type=radio] { width: auto; flex: none; padding: 0; box-shadow: none; }
/* Button rows wrap instead of pushing the page wider than the phone. */
.card .row { flex-wrap: wrap; }
/* Equipment & rates: the spec line truncates inside its column; on phones the price + Edit drop under the name. */
#catl .px-cat-row { grid-template-columns: 56px minmax(0, 1fr) auto; } /* #catl: hub-proposals.css loads after this file */
#catl .px-cat-row > div { min-width: 0; } #catl .px-cat-row .px-hint { max-width: 100% !important; }
@media (max-width: 719px) { #catl .px-cat-row { grid-template-columns: 56px minmax(0, 1fr); } #catl .px-cat-row > :nth-child(3) { grid-column: 2; } }
/* The map's own layers (z-index 400–1000) must stay under the top bar, tab bar and sheets. */
.mapbox, .leaflet-container { position: relative; isolation: isolate; z-index: 0; }
/* Safety net: nothing may widen the page on a phone. */
.main { min-width: 0; }
@media (max-width: 899px) { html, body { overflow-x: hidden; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
