/* Redesigned Hypercare (Phase 12: screens 51-53, reference-app/src/pages/Hypercare.jsx).
   Layout glue on top of the design-system classes (pl-head, toolbar, seg, kb, col, kcard, drawer, tabs, props,
   checklist, radio-cards, savebar). Tokens only. */

#hypercareView[data-ui="v2"] { flex: 1; min-height: 0; min-width: 0; overflow: hidden; background: var(--bg); color: var(--text); }
#hypercareView [hidden] { display: none !important; }
#hypercareView .hc-page { height: 100%; }
#hypercareView .hc-head { flex: none; }
#hypercareView .pl-title-row { flex-wrap: wrap; align-items: flex-end; }
#hypercareView .hc-title-wrap { flex: 1; min-width: 260px; }
#hypercareView .hc-pills { margin-left: auto; flex-wrap: wrap; }
#hypercareView .hc-pills > span .ua-ic { flex: none; }
#hypercareView .tb-search { min-width: 220px; }
#hypercareView .hc-owner { width: 160px; height: 34px; font-size: var(--fs-13); }
#hypercareView .hc-closed { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; }
#hypercareView .hc-closed input, .hc-dw input[type="checkbox"], .hc-modal-root input[type="checkbox"] { accent-color: var(--brand); width: 15px; height: 15px; margin: 0; flex: none; }
#hypercareView .seg .dot { width: 8px; height: 8px; }

/* Board */
#hypercareView .hc-kb-wrap { padding-top: var(--s-4); }
#hypercareView .kb .col { width: 280px; }
#hypercareView .hc-col-hint { line-height: 1.4; }
#hypercareView .hc-col-empty { padding: var(--s-6) var(--s-2); border: 1px dashed var(--divider); border-radius: var(--r-lg); }
#hypercareView .hc-empty-note { display: flex; align-items: center; justify-content: center; gap: var(--s-2); padding: 0 0 var(--s-4); }
.hc-card { border-left: 3px solid var(--border-strong); }
.hc-card.st-green { border-left-color: var(--success); }
.hc-card.st-amber { border-left-color: var(--warning); }
.hc-card.st-red { border-left-color: var(--danger); }
.hc-card.closed { opacity: 0.72; }
.hc-card.dragging { opacity: 0.5; }
.hc-card:focus-visible { outline: 2px solid var(--brand-ring); outline-offset: 2px; }
.hc-card .t { min-width: 0; }
.hc-card .hc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-card .hc-st { flex: none; }
.hc-card .hc-deal { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: -4px; }
.hc-card .s { display: flex; align-items: center; gap: 6px; }
.hc-card .hc-day .num { white-space: nowrap; }
.hc-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.hc-rev { display: flex; align-items: flex-end; gap: 10px; font-size: var(--fs-12); }
.hc-rev .hc-rev-v { font-size: var(--fs-14); font-weight: 600; }
.hc-rev-side { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; color: var(--text-3); }
.hc-rev-side b { color: var(--text-2); font-weight: 600; }
.hc-trend { display: inline-flex; vertical-align: -2px; margin-left: 3px; }
.hc-trend.up { color: var(--success); }
.hc-trend.down { color: var(--danger); }
.hc-card .f .num { display: inline-flex; align-items: center; gap: 5px; }
.hc-people { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.hc-people .avatar { width: 22px; height: 22px; font-size: var(--fs-11); }

/* Drawer */
.hc-overlay { z-index: 2590; background: color-mix(in srgb, var(--overlay) 60%, transparent); }
.hc-dw { width: min(640px, 100vw); z-index: 2600; }
.hc-dw .dw-head { align-items: center; }
.hc-dw .hc-dw-tw { flex: 1; min-width: 0; }
.hc-dw .dw-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-dw .dw-sub a { display: inline-flex; align-items: center; gap: 4px; }
.hc-dw .hc-banner { margin: 14px 24px 0; display: flex; align-items: center; gap: 8px; }
.hc-dw .rec-kpis b { font-size: var(--fs-20); }
.hc-dw .tabs { flex: none; overflow-x: auto; scrollbar-width: none; }
.hc-dw .tab { white-space: nowrap; background: none; border: 0; cursor: pointer; }
.hc-dw .dw-body { min-height: 0; }
.hc-dw .hc-gap { margin-top: 20px; }
.hc-dw .hc-rev-card { padding: 4px 6px 10px; }
.hc-dw .hc-rev-table { background: transparent; border: 0; }
.hc-dw .hc-rev-table th { background: transparent; }
.hc-dw .hc-rev-table td:first-child { color: var(--text-3); }
.hc-dw .hc-rev-meta { padding: 8px 8px 0; }
.hc-dw .hc-rev-empty { display: flex; gap: 10px; align-items: center; text-align: left; padding: var(--s-3); }
.hc-dw .hc-status-seg button:disabled, .hc-dw .radio-card:disabled { cursor: default; opacity: 0.6; }
.hc-dw .hc-defs { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.hc-dw .hc-defs > span { display: inline-flex; align-items: flex-start; gap: 6px; }
.hc-dw .hc-defs > span > .ua-ic { margin-top: 2px; flex: none; }
.hc-dw .hc-progress { min-height: 36px; display: flex; flex-direction: column; justify-content: center; gap: 2px; font-size: var(--fs-13); }
.hc-dw .field label .hint { font-weight: 400; margin-left: 4px; }
.hc-dw .hc-props { grid-template-columns: 170px minmax(0, 1fr); }
.hc-dw .hc-props .k { height: auto; min-height: 36px; }
.hc-dw .hc-props .hc-k-top { align-self: start; }
.hc-dw .iv.dirty, .hc-dw .input.dirty, .hc-dw .select.dirty { box-shadow: inset 0 0 0 1px var(--warning); }
.hc-dw .iv-static .hint { margin-left: 4px; }
.hc-dw .hc-ops { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 6px 10px; }
.hc-check-row { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-13); cursor: pointer; padding: 4px 0; }
.hc-check-row .avatar { width: 22px; height: 22px; font-size: var(--fs-11); }
.hc-dw .hc-check-hint { margin: 0 0 8px; }
.hc-dw .hc-checklist { margin-top: 12px; }
.hc-dw .hc-checklist label input { margin-top: 2px; }
.hc-dw .hc-checklist small { font-size: var(--fs-12); text-decoration: none; display: inline; }
.hc-dw .hc-outcomes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hc-dw .hc-history { margin-top: 0; }
.hc-dw .hc-history.hc-feed-empty::before { display: none; }
.hc-dw .hc-hist-av { background: transparent; border: 0; }
.hc-dw .hc-hist-av .avatar { width: 31px; height: 31px; }
.hc-dw .hc-hist-main { flex: 1; min-width: 0; }
.hc-dw .savebar { flex: none; }
.hc-dw .savebar .hc-spacer { flex: 1; }
.hc-dw .savebar .errtext { color: var(--danger); }

/* Shared views modal */
.hc-view-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.hc-view-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--divider); }
.hc-view-row:last-child { border-bottom: 0; }
.hc-view-ic { color: var(--text-3); display: inline-flex; flex: none; }
.hc-view-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-13); }
.hc-row-actions { display: flex; gap: 4px; flex: none; }
.hc-view-search { width: 100%; }
.hc-studio-results { max-height: 240px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r-md); padding: 4px 10px; display: flex; flex-direction: column; }
.hc-picked { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hc-picked .chip { gap: 4px; padding-right: 4px; }
.hc-unpick { display: inline-flex; border-radius: var(--r-xs); color: var(--text-3); padding: 1px; }
.hc-unpick:hover { color: var(--text); background: var(--surface-hover); }

@media (max-width: 760px) {
    #hypercareView .pl-head { padding: var(--s-4) var(--s-4) var(--s-3); }
    #hypercareView .hc-kb-wrap { padding: var(--s-3) var(--s-4) var(--s-4); }
    #hypercareView .hc-title-wrap { min-width: 0; flex-basis: 100%; }
    #hypercareView .hc-pills { margin-left: 0; }
    #hypercareView .tb-search { min-width: 0; width: 100%; }
    #hypercareView .toolbar .grow { display: none; }
    #hypercareView .seg { flex-wrap: wrap; }
    .hc-dw .rec-kpis { grid-template-columns: repeat(2, 1fr); margin: 14px 16px 0; }
    .hc-dw .dw-head, .hc-dw .dw-body { padding-left: 16px; padding-right: 16px; }
    .hc-dw .tabs { padding: 0 16px; gap: 16px; }
    .hc-dw .hc-props { grid-template-columns: 1fr; }
    .hc-dw .hc-props .k { min-height: 0; padding-top: 8px; }
    .hc-dw .hc-outcomes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hc-dw .grid-2 { grid-template-columns: 1fr; }
    .hc-dw .grid-2 .span-2 { grid-column: auto; }
    .hc-dw .savebar { flex-wrap: wrap; padding: 10px 16px; }
    .hc-dw #hcCopy { display: none; }
    .hc-dw .dw-head { flex-wrap: wrap; padding-top: 12px; }
    .hc-dw .dw-actions { order: -1; flex-basis: 100%; justify-content: flex-end; }
}
.hc-still .overlay, .hc-still .drawer { animation: none; }
.hc-modal-root .hc-err { color: var(--danger); font-size: var(--fs-13); }
.hc-modal-root .hc-err:empty { display: none; }
