/* Innovation Lab Hub — blueprint paper, ink, and safety orange */
:root {
  /* Empower Care Network brand tokens */
  --paper: #FCFCFC;          /* Cloud White */
  --panel: #FFFFFF;
  --ink: #1D1C31;            /* Midnight Navy */
  --ink-2: #3a3950;
  --muted: #5A5A5A;          /* Slate Gray */
  --line: #EEEEEE;           /* Mist Gray */
  --line-2: #CCCCCC;         /* Border Gray */
  --accent: #25A4BA;         /* Empower Teal */
  --accent-dark: #1b8597;
  --accent-soft: #e3f4f7;
  --sage: #8FBC94;           /* Sage Green */
  --sage-dark: #5f9466;
  --gradient: linear-gradient(66.51deg, #25A4BA 18.02%, #8FBC94 80.38%);
  --blue: #1b8597;
  --blue-soft: #e3f4f7;
  --ok: #2c6e3a;
  --ok-soft: #D4EDDA;        /* status: complete */
  --warn: #7a5b00;
  --warn-soft: #FFF3CD;      /* status: in progress */
  --bad: #a3262f;
  --bad-soft: #F8D7DA;       /* status: blocked/urgent */
  --idle: #EEEEEE;           /* status: not started */
  --star: #c98a00;
  --display: "Montserrat", "Poppins", "Outfit", "Helvetica Neue", sans-serif;
  --body: "Lato", "Open Sans", "Segoe UI", sans-serif;
  --mono: "Lato", "Open Sans", "Segoe UI", sans-serif;
  --r: 10px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { overflow-x: hidden; margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.45; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 40px; color: var(--muted); }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.mono { letter-spacing: .01em; }
td.mono { white-space: nowrap; }
.num { text-align: right; white-space: nowrap; }

/* Shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #dfe6ec; padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain; }
.brand { display: flex; flex-direction: column; gap: 10px; }
.brand img { width: 150px; height: auto; display: block; }
.brand h1 { font-family: var(--display); font-weight: 700; font-size: 17px; margin: 0; line-height: 1.15; color: #fff; }
.brand small { display: block; color: #b9c3cc; font-size: 12px; margin-top: 3px; }
.countdown { background: var(--gradient); border-radius: var(--r); padding: 12px 14px; color: #fff; }
.countdown b { font-family: var(--display); font-size: 30px; color: #fff; font-weight: 700; line-height: 1; }
.countdown span { display: block; font-size: 12px; color: #fff; font-weight: 700; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { color: #d6dbe0; text-decoration: none; padding: 8px 10px; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; }
.nav a:hover { background: #2a2944; }
.nav a.on { background: var(--accent); color: #fff; font-weight: 700; }
.nav .lock { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; opacity: .7; }
.nav .badge { background: var(--sage); color: var(--ink); border-radius: 999px; font-size: 11px; padding: 0 7px; font-weight: 600; }
.nav a.on .badge { background: #fff; color: var(--accent-dark); }
.who { margin-top: auto; font-size: 13px; color: #b9c3cc; border-top: 1px solid #34334d; padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.who b { color: #fff; font-weight: 600; }
.who button { background: none; border: 1px solid #45445f; color: #d6dbe0; border-radius: 6px; padding: 5px 8px; cursor: pointer; text-align: left; }
.main { padding: 26px clamp(16px, 3vw, 36px) 60px; min-width: 0; }
.topbar { display: none; }
.tabbar, .scrim { display: none; }
.content { min-width: 0; }

h2.title { font-family: var(--display); font-weight: 700; font-size: 28px; margin: 0; color: var(--accent); letter-spacing: -.01em; }
.sub { color: var(--muted); margin: 2px 0 18px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.head .sub { margin-bottom: 0; }
h3 { font-family: var(--display); font-weight: 700; font-size: 16px; margin: 0 0 10px; color: var(--ink); }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 16px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.tile .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tile .v { font-family: var(--display); font-size: 28px; font-weight: 700; line-height: 1.15; color: var(--ink); }
.tile.hot .v { color: var(--accent); }
.tile { border-top: 3px solid var(--accent); }
.tile.hot { border-top-color: var(--sage); }

/* Controls */
.btn { border: 1px solid var(--line-2); background: var(--panel); border-radius: 6px; padding: 7px 12px; cursor: pointer; font-weight: 500; }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.accent { background: var(--gradient); border: none; color: #fff; font-weight: 700; padding: 8px 14px; }
.btn.small { padding: 3px 8px; font-size: 13px; }
.btn.link { border: none; background: none; color: var(--blue); padding: 0; }
.btn:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, select, textarea { border: 1px solid var(--line-2); border-radius: 6px; padding: 7px 9px; background: #fff; width: 100%; }
textarea { resize: vertical; min-height: 70px; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 160px; }
.row > .btn, .row > .shrink { flex: 0 0 auto; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.check input { width: auto; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 11px; background: var(--panel); cursor: pointer; font-size: 13px; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Pills */
.pill { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.pill.internal { background: var(--ink); color: #fff; }
.pill.shared { background: var(--blue-soft); color: var(--blue); }
.pill.Open, .pill.Not-started { background: var(--idle); color: var(--ink-2); }
.pill.Waiting, .pill.In-progress { background: var(--warn-soft); color: var(--warn); }
.pill.Resolved, .pill.Done, .pill.Contracted { background: var(--ok-soft); color: var(--ok); }
.pill.At-risk, .pill.Blocked, .pill.Overdue { background: var(--bad-soft); color: var(--bad); }
.pill.type { background: #eef0ec; color: var(--ink-2); }
.pill.Benchmark { background: #eef0ec; color: var(--muted); }
.pill.Bid { background: var(--blue-soft); color: var(--blue); }
.star { color: var(--star); font-size: 16px; }

/* Lists */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #fff; font-weight: 700; padding: 9px 12px; background: var(--accent); white-space: nowrap; }
tbody tr:nth-child(even) td { background: #f7f7f7; }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--accent-soft); }
.scroll { overflow-x: auto; }
.empty { color: var(--muted); padding: 18px; text-align: center; }
.feed { display: flex; flex-direction: column; gap: 12px; }
.post { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.post .meta { font-size: 13px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.post .meta b { color: var(--ink); }
.post .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; margin-top: 10px; }
.photos img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: zoom-in; background: #eee; }
.comments { margin-top: 10px; border-top: 1px dashed var(--line-2); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.comment b { font-weight: 600; }
.comment .t { color: var(--muted); font-size: 12px; margin-left: 6px; }
.mini-list { display: flex; flex-direction: column; }
.mini-list .li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mini-list .li:last-child { border-bottom: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.notice { background: var(--accent-soft); border: 1px solid #f3c6a5; border-radius: var(--r); padding: 10px 12px; font-size: 14px; }
.notice.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.notice { background: var(--accent-soft); border-color: #b8e1e9; }
.error { color: var(--bad); font-size: 14px; min-height: 1em; }

/* Gantt */
.gantt { position: relative; }
.g-row { display: grid; grid-template-columns: minmax(150px, 30%) 1fr; gap: 10px; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.g-row:last-child { border-bottom: none; }
.g-name { font-size: 14px; }
.g-name .muted { font-size: 12px; display: block; }
.g-track { position: relative; height: 22px; background: repeating-linear-gradient(90deg, transparent 0 calc(100%/15 - 1px), #eeeeee calc(100%/15 - 1px) calc(100%/15)); border-radius: 4px; }
.g-bar { position: absolute; top: 4px; height: 14px; border-radius: 4px; background: var(--sage); }
.g-bar.crit { background: var(--accent); }
.g-bar.Done { background: var(--ok); }
.g-today { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); opacity: .5; }
.g-target { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--bad); }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(18,32,47,.45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--panel); border-radius: 10px; width: min(720px, 100%); max-height: 90vh; overflow: auto; padding: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal .x { float: right; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: grid; place-items: center; z-index: 60; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 90vh; }
.toast { position: fixed; bottom: 18px; right: 18px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 70; font-size: 14px; }

/* Sign-in (style B) */
.auth { min-height: 100vh; background: var(--gradient); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 32px 16px; color: #fff; text-align: center; }
.auth .eyebrow { font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.auth-top h1 { font-family: var(--display); font-weight: 800; font-size: clamp(28px, 4vw, 38px); letter-spacing: -.02em; margin: 6px 0 0; color: #fff; }
.auth-card { width: min(420px, 100%); padding: 32px; color: var(--ink); text-align: left; border: none; border-radius: 14px; box-shadow: 0 18px 50px rgba(29,28,49,.18); }
.auth-logo { width: 220px; max-width: 80%; align-self: center; margin-bottom: 2px; }
.auth-rule { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 4px 0; }
.auth-head { text-align: center; }
.auth-head h2 { font-family: var(--display); font-weight: 700; font-size: 24px; color: var(--accent); margin: 0 0 2px; }
.auth-note { text-align: center; }
.auth-legal { font-size: 12px; opacity: .95; }
.legal-line { font-size: 11px; color: var(--muted); }
.side .legal-line { color: #8f96a3; }

@media (max-width: 820px) {
  .shell { display: block; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(280px, 84vw); z-index: 60; transform: translateX(-105%); transition: transform .2s; overflow-y: auto; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .side.open ~ .scrim { display: block; position: fixed; inset: 0; background: rgba(29,28,49,.35); z-index: 55; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px max(14px, env(safe-area-inset-right, 0px)) 10px max(14px, env(safe-area-inset-left, 0px)); position: sticky; top: 0; z-index: 30; }
  .tb-logo { height: 24px !important; width: auto; flex: 0 0 auto; }
  .tb-title { flex: 1 1 auto; min-width: 0; font-family: var(--display); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tb-menu { flex: 0 0 auto; background: none; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 12px; font-weight: 700; }
  .main { padding: 18px max(14px, env(safe-area-inset-right, 0px)) calc(86px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px)); }
  h2.title { font-size: 24px; }
  .head { margin-bottom: 12px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 10px 12px; }
  .tile .v { font-size: 24px; }
  .grid { gap: 12px; }
  .card { padding: 14px; }
  input, select, textarea { font-size: 16px; } /* stops iPhone zooming in on tap */
  .btn { padding: 10px 14px; }
  .row > * { flex-basis: 100%; }
  .row > .btn, .row > .shrink { flex-basis: auto; }
  .hide-sm { display: none !important; }
  .g-row { grid-template-columns: 1fr; gap: 4px; }
  .modal-bg { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .toast { left: 14px; right: 14px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); text-align: center; }

  /* Bottom tab bar */
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: #fff; border-top: 1px solid var(--line-2); padding: 6px max(6px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)); box-shadow: 0 -4px 16px rgba(29,28,49,.06); }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--muted); text-decoration: none; background: none; border: 0; padding: 4px 0; min-height: 48px; justify-content: center; }
  .tabbar a.on { color: var(--accent); }
  .tab-dot { position: absolute; top: 4px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--sage); }

  /* Tables become stacked cards on phones */
  .card.flush table, .card.flush tbody, .card.flush tr, .card.flush td { display: block; width: 100%; }
  .card.flush thead { display: none; }
  .card.flush tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .card.flush tbody tr:nth-child(even) td { background: none; }
  .card.flush tbody tr:nth-child(even) { background: #f9f9f9; }
  .card.flush td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; white-space: normal; }
  .card.flush td::before { content: attr(data-label); flex: 0 0 auto; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); text-align: left; }
  .card.flush td[data-label=""]::before { display: none; }
  .card.flush td:first-child, .card.flush td[data-label="Line"], .card.flush td[data-label="Name"] { display: block; text-align: left; font-weight: 700; font-size: 15px; }
  .card.flush td:first-child::before, .card.flush td[data-label="Line"]::before, .card.flush td[data-label="Name"]::before { display: none; }
  .card.flush td:empty { display: none; }
  .scroll { overflow-x: visible; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Logo always sits on white */
.brand-logo { background: #fff; margin: -18px -14px 4px; padding: 16px 14px 14px; border-bottom: 3px solid var(--accent); }
.brand-logo img { width: 170px; display: block; }
.topbar { background: #fff !important; color: var(--ink) !important; border-bottom: 3px solid var(--accent); }

/* Clickable rows look clickable */
tr.click { cursor: pointer; transition: background .12s; }
tr.click:hover td, tr.click:focus-visible td { background: var(--accent-soft) !important; }
tr.click:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.open-cell { position: relative; padding-right: 30px !important; }
.open-title { color: var(--accent-dark); font-weight: 700; }
tr.click:hover .open-title { text-decoration: underline; }
.chev { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 22px; line-height: 1; color: var(--accent); font-weight: 700; }
.g-row.click:hover, .g-row[style*="cursor:pointer"]:hover { background: var(--accent-soft); }
.edit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; background: #f6fafb; border: 1px solid #d5ebef; border-radius: 10px; padding: 12px; }
.edit-grid input[hidden] { display: none; }
@media (max-width: 820px) {
  .card.flush tr.click { position: relative; padding-right: 34px; }
  .card.flush tr.click:active { background: var(--accent-soft) !important; }
  .card.flush td.open-cell { padding-right: 0 !important; position: static; }
  .card.flush tr.click .chev { position: absolute; right: 12px; top: 50%; }
  .edit-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- Documents: thumbnails, grid, preview ---------- */
.upload-panel { margin-bottom: 14px; }
.doc-toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.doc-toolbar .filters { margin-bottom: 0; flex: 1 1 360px; }
.doc-tools { display: flex; gap: 8px; align-items: center; }
.doc-search { width: 220px; max-width: 100%; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button { border: none; background: var(--panel); padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--accent); color: #fff; font-weight: 700; }

.thumb { position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #f3f5f7; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; background: #fff; }
.thumb-pdf img { object-fit: contain; }
.thumb-xs { width: 34px; height: 26px; border-radius: 4px; flex: 0 0 auto; }
.thumb-sm { width: 64px; height: 48px; }
.thumb-lg { width: 100%; aspect-ratio: 4 / 3; border-radius: 8px 8px 0 0; border: none; border-bottom: 1px solid var(--line); }
.thumb-ext { font-family: Montserrat, sans-serif; font-weight: 800; font-size: 11px; letter-spacing: .04em; color: #fff; background: #8a94a3; padding: 2px 6px; border-radius: 4px; }
.thumb-pdf .thumb-ext { background: #c0392b; }
.thumb-image .thumb-ext { background: var(--sage); }
.thumb-lg .thumb-ext { font-size: 15px; padding: 4px 10px; }
.thumb-xs .thumb-ext { font-size: 8px; padding: 1px 3px; }
.thumb-pending::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.6) 50%, transparent 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce) { .thumb-pending::after { animation: none; } }

.doc-thumb-btn { border: none; background: none; padding: 0; cursor: zoom-in; display: block; border-radius: 6px; }
.doc-thumb-btn:hover .thumb { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(37,164,186,.25); }
.doc-name-btn { border: none; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--accent); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.doc-name-btn:hover { text-decoration: underline; }
.doc-table .th-thumb, .doc-table .td-thumb { width: 76px; }
.doc-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.doc-actions .btn { text-decoration: none; }
.mini-list .li-doc { justify-content: flex-start; align-items: center; }
.mini-list .li-doc .doc-name-btn { flex: 1; min-width: 0; font-weight: 600; }

.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.doc-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; min-width: 0; box-shadow: 0 1px 2px rgba(29,28,49,.04); }
.doc-card .doc-thumb-btn { border-radius: 10px 10px 0 0; }
.doc-card .doc-thumb-btn .thumb { border-radius: 10px 10px 0 0; }
.doc-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.doc-card-body .doc-name-btn { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.doc-card-foot { margin-top: auto; padding-top: 6px; display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Preview window */
.pv-bg { position: fixed; inset: 0; z-index: 1000; background: #15151f; display: flex; flex-direction: column; color: #fff; }
.pv-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(0,0,0,.35); }
.pv-title { min-width: 0; flex: 1 1 260px; display: flex; flex-direction: column; }
.pv-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: Montserrat, sans-serif; }
.pv-sub { font-size: 12px; opacity: .7; }
.pv-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pv-group { display: inline-flex; align-items: center; gap: 2px; background: rgba(255,255,255,.08); border-radius: 8px; padding: 2px; }
.pv-group[hidden] { display: none; }
.pv-btn { background: transparent; border: none; color: #fff; min-width: 36px; height: 36px; border-radius: 6px; font-size: 20px; line-height: 1; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; }
.pv-btn.pv-text { font-size: 14px; font-weight: 700; background: rgba(255,255,255,.08); }
.pv-group .pv-btn.pv-text { background: transparent; }
.pv-btn:hover:not(:disabled) { background: rgba(255,255,255,.18); }
.pv-btn:disabled { opacity: .35; cursor: default; }
.pv-close { background: var(--accent) !important; }
.pv-page { font-size: 13px; padding: 0 6px; white-space: nowrap; }
.pv-stage { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 16px; outline: none; touch-action: pan-x pan-y pinch-zoom; }
.pv-stage.pv-zoomed { align-items: flex-start; justify-content: flex-start; }
.pv-canvas { box-shadow: 0 6px 30px rgba(0,0,0,.5); background: #fff; margin: auto; }
.pv-img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 6px 30px rgba(0,0,0,.5); background: #fff; margin: auto; }
.pv-msg { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; opacity: .9; }
.pv-msg .thumb { width: 120px; }
.pv-foot { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; padding-bottom: max(8px, env(safe-area-inset-bottom)); background: rgba(0,0,0,.35); }
.pv-count { font-size: 13px; opacity: .75; }

@media (max-width: 820px) {
  .doc-tools { width: 100%; }
  .doc-search { flex: 1; width: auto; }
  .doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .doc-card-body { padding: 8px 10px 10px; }
  .doc-card-foot .btn.small { padding: 4px 8px; }
  .doc-table td.td-thumb { float: left; margin: 0 12px 4px 0; padding: 0 !important; border: none !important; width: auto; }
  .doc-table td.td-thumb::before { display: none; }
  .pv-bar { padding: 8px 10px; }
  .pv-title { flex: 1 1 0; }
  .pv-controls { order: 3; width: 100%; justify-content: space-between; }
  .pv-stage { padding: 8px; }
}

/* ---------- Bids & subs ---------- */
.good { color: var(--ok); font-weight: 700; }
.bad { color: var(--bad); font-weight: 700; }
.pkg-list { display: flex; flex-direction: column; gap: 14px; }
.card.pkg { padding: 14px 16px; border-left: 4px solid var(--accent); }
.card.pkg.pkg-late { border-left-color: var(--bad); }
.pkg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.pkg-title { min-width: 0; flex: 1 1 260px; }
.pkg-name { font-size: 17px; font-family: Montserrat, sans-serif; }
.pkg-figs { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pkg-figs > div { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.pkg-figs .k { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.pkg-figs b { font-size: 17px; }
.pkg-scope { margin-top: 6px; white-space: pre-line; }
.card.flush.inner { margin-top: 10px; box-shadow: none; }
.bid-table .row-awarded, .bid-table .row-awarded td { background: var(--ok-soft); }
.low-tag { display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; background: var(--sage); color: #fff; padding: 1px 6px; border-radius: 4px; vertical-align: middle; }
.file-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.compliance { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.pkg-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.pill.pk-Out-to-bid, .pill.bid-Invited { background: var(--blue-soft); color: var(--blue); }
.pill.pk-Leveling, .pill.bid-Received, .pill.bid-Recommended { background: var(--warn-soft); color: var(--warn); }
.pill.pk-Awarded, .pill.pk-Under-contract, .pill.pk-Complete, .pill.bid-Awarded, .pill.Awarded { background: var(--ok-soft); color: var(--ok); }
.pill.pk-Not-started, .pill.pk-On-hold, .pill.bid-Declined, .pill.bid-Not-selected { background: var(--idle); color: var(--ink-2); }
@media (max-width: 820px) {
  .card.pkg { padding: 12px; }
  .pkg-figs { width: 100%; justify-content: space-between; }
  .pkg-figs > div { align-items: flex-start; }
}

/* ---------- Help & guide ---------- */
.help-q { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-left: 10px; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent); font-size: 14px; font-weight: 800; text-decoration: none; vertical-align: middle; font-family: Montserrat, sans-serif; }
.help-q:hover { background: var(--accent); color: #fff; }
.help-you { margin-bottom: 14px; border-left: 4px solid var(--sage); }
.help-role { display: flex; flex-direction: column; margin-bottom: 4px; }
.help-role .k { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.help-role b { font-family: Montserrat, sans-serif; font-size: 20px; color: var(--accent); }
.help-you ul { margin: 6px 0 0; padding-left: 20px; }
.help-you li { margin: 3px 0; }
.help-toolbar { margin-bottom: 10px; }
.help-search { width: 100%; max-width: 520px; padding: 10px 12px; font-size: 15px; }
.help-toc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.help-toc .chip { text-decoration: none; color: var(--ink); }
.help-toc .chip.on { color: #fff; }
.help-list { display: flex; flex-direction: column; gap: 10px; }
.help-topic { padding: 0; overflow: hidden; scroll-margin-top: 70px; }
.help-topic > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; position: relative; padding-right: 40px; }
.help-topic > summary::-webkit-details-marker { display: none; }
.help-topic > summary::after { content: "›"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--accent); transition: transform .15s; }
.help-topic[open] > summary::after { transform: translateY(-50%) rotate(90deg); }
.help-topic[open] > summary { border-bottom: 1px solid var(--line); background: var(--blue-soft); }
.help-t { font-family: Montserrat, sans-serif; font-weight: 700; font-size: 16px; color: var(--ink); }
.help-body { padding: 4px 16px 16px; }
.help-body section { margin-top: 12px; }
.help-body h4 { margin: 0 0 6px; font-size: 14px; color: var(--accent); font-family: Montserrat, sans-serif; }
.help-body ol { margin: 0; padding-left: 22px; }
.help-body ol.single { list-style: none; padding-left: 0; }
.help-body li { margin: 4px 0; line-height: 1.45; }
.help-body .btn { margin-top: 14px; display: inline-block; text-decoration: none; }
.access-table th.me, .access-table td.me { background: var(--blue-soft); font-weight: 700; }
.access-table th.me { color: #fff; background: var(--ink); }
@media (max-width: 820px) {
  .help-topic > summary { padding: 12px 40px 12px 12px; }
  .help-body { padding: 2px 12px 14px; }
}

/* ---------- Feedback & bugs ---------- */
.fb-kind { margin-bottom: 4px; flex-wrap: wrap; }
.fb-table tr.fb-new td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.pill.fb-k-Bug, .pill.fb-k-Problem { background: var(--bad-soft); color: var(--bad); }
.pill.fb-k-Feature-request { background: var(--blue-soft); color: var(--blue); }
.pill.fb-k-Question { background: var(--idle); color: var(--ink-2); }
.pill.fb-s-New { background: var(--accent); color: #fff; }
.pill.fb-s-Reviewing, .pill.fb-s-Planned, .pill.fb-s-In-progress { background: var(--warn-soft); color: var(--warn); }
.pill.fb-s-Done { background: var(--ok-soft); color: var(--ok); }
.pill.fb-s-Won\'t-do, .pill.fb-s-Duplicate { background: var(--idle); color: var(--ink-2); }
.pill.fb-p-Urgent { background: var(--bad); color: #fff; }
.pill.fb-p-High { background: var(--bad-soft); color: var(--bad); }
.pill.fb-p-Normal, .pill.fb-p-Low { background: var(--idle); color: var(--ink-2); }
.fb-meta { margin-bottom: 8px; }
.fb-details { white-space: pre-wrap; background: #f6f8fa; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.fb-review { margin: 10px 0; background: #fbfcfd; }
.fb-review h4 { margin: 0 0 8px; color: var(--accent); }
.fb-status { margin: 8px 0; }
.who .report-btn { background: var(--gradient) !important; color: #fff !important; border: none !important; font-weight: 700; }

/* ---------- Cancelled items ---------- */
.pill.Cancelled { background: var(--idle); color: var(--muted); text-decoration: line-through; }
td.cancelled .open-title, .g-row.cancelled .g-name { text-decoration: line-through; color: var(--muted); }
.g-row.cancelled { opacity: .55; }
.notice.cancel-note { background: var(--idle); color: var(--ink-2); border-left: 4px solid var(--muted); margin-bottom: 12px; }

/* ---------- Gantt (Schedule) ---------- */
.gx-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
.gx-conflicts { margin-bottom: 12px; }
.gx-conflicts .btn.link { font-weight: 700; }
.gx { position: relative; overflow: auto; max-height: calc(100vh - 290px); min-height: 320px; background: #fff; border: 1px solid var(--line); border-radius: 12px; overscroll-behavior: contain; }
.gx-inner { position: relative; }
.gx-head { position: sticky; top: 0; z-index: 6; display: flex; background: #fff; border-bottom: 1px solid var(--line); }
.gx-left { position: sticky; left: 0; z-index: 4; flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: #fff; border-right: 1px solid var(--line); box-sizing: border-box; height: 100%; min-width: 0; }
.gx-corner { z-index: 7; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); align-items: flex-end; padding-bottom: 8px; }
.gx-scale { position: relative; flex: 0 0 auto; height: 100%; }
.gx-months { position: absolute; top: 0; left: 0; right: 0; height: 24px; }
.gx-month { position: absolute; top: 0; height: 24px; line-height: 24px; padding-left: 6px; font-size: 12px; font-weight: 700; color: var(--ink); border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; box-sizing: border-box; font-family: Montserrat, sans-serif; }
.gx-ticks { position: absolute; top: 24px; left: 0; right: 0; height: 28px; background: #f7f8fa; border-top: 1px solid var(--line); }
.gx-tick { position: absolute; top: 0; height: 28px; font-size: 11px; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; border-left: 1px solid #edf0f3; box-sizing: border-box; }
.gx-tick b { font-weight: 700; color: var(--ink-2); font-size: 11px; }
.gx-tick i { font-style: normal; font-size: 9px; }
.gx-tick.wk { background: #eef1f4; }
.gx-rows { position: relative; }
.gx-layer { position: absolute; z-index: 0; pointer-events: none; }
.gx-bg { position: relative; }
.gx-weekend { position: absolute; top: 0; bottom: 0; background: #f4f6f8; }
.gx-vline { position: absolute; top: 0; bottom: 0; width: 1px; background: #eceff2; }
.gx-band { position: absolute; opacity: .09; border-radius: 6px; }
.gx-rowline.phase { position: absolute; left: 0; right: 0; height: 1px; background: var(--line); }
.gx-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--ink); opacity: .7; z-index: 2; }
.gx-today span, .gx-target span { position: absolute; top: 2px; left: 4px; font-size: 10px; font-weight: 700; white-space: nowrap; background: #fff; padding: 0 4px; border-radius: 3px; }
.gx-target { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid #d03b3b; z-index: 2; }
.gx-target span { color: #d03b3b; }
.gx-arrows { position: absolute; top: 0; left: 0; overflow: visible; z-index: 1; }
.gx-arrow { fill: none; stroke: #7b8494; stroke-width: 1.5; }
.gx-arrow.bad { stroke: #d03b3b; stroke-width: 2; stroke-dasharray: 5 3; }
.gx-body { position: relative; z-index: 3; }
.gx-row { display: flex; position: relative; }
.gx-row.odd .gx-left { background: #fcfcfd; }
.gx-lane { position: relative; flex: 0 0 auto; }
.gx-phase .gx-left { background: #f3f5f8; }
.gx-phase-cell { border: none; border-right: 1px solid var(--line); font: inherit; cursor: pointer; text-align: left; color: var(--ink); }
.gx-phase-cell b { font-family: Montserrat, sans-serif; font-size: 13px; white-space: nowrap; }
.gx-caret { width: 12px; color: var(--muted); }
.gx-dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.gx-muted { color: var(--muted); font-size: 12px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gx-summary { position: absolute; top: 14px; height: 6px; border-radius: 3px; opacity: .45; overflow: hidden; }
.gx-summary-prog { height: 100%; background: rgba(0,0,0,.35); }
.gx-task-cell { cursor: pointer; font-size: 13px; padding-left: 22px; }
.gx-task-cell:hover .gx-name { color: var(--accent); }
.gx-task-cell.is-cancelled .gx-name { text-decoration: line-through; color: var(--muted); }
.gx-name { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gx-corner .gx-name { flex: 1 1 auto; }
.gx-who { flex: 0 0 52px; text-align: center; font-size: 11px; font-weight: 700; color: var(--ink-2); }
.gx-task-cell .gx-who { background: #eef1f4; border-radius: 10px; padding: 2px 0; flex-basis: 40px; margin: 0 6px; }
.gx-date { flex: 0 0 52px; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.gx-num { flex: 0 0 34px; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gx-st { flex: 0 0 18px; height: 18px; border-radius: 50%; border: 1.5px solid #b8c0ca; color: #8a94a3; font-size: 11px; line-height: 15px; text-align: center; box-sizing: border-box; }
.gx-st.st-Done { background: #1f7a3d; border-color: #1f7a3d; color: #fff; }
.gx-st.st-In-progress { border-color: var(--accent); color: var(--accent); }
.gx-st.st-At-risk { background: #fab219; border-color: #fab219; color: #0b0b0b; font-weight: 800; }
.gx-bar { position: absolute; top: 8px; height: 18px; border-radius: 4px; background: color-mix(in srgb, var(--c) 42%, #fff); overflow: hidden; cursor: pointer; box-shadow: 0 0 0 2px #fff; }
.gx-bar .gx-prog { height: 100%; background: var(--c); }
.gx-bar.done { background: var(--c); }
.gx-bar.crit { outline: 2px solid var(--ink); outline-offset: 0; }
.gx-bar.cancelled { background: repeating-linear-gradient(135deg, #e6e9ed 0 4px, #f5f6f8 4px 8px); }
.gx-bar.cancelled .gx-prog { display: none; }
.gx-bar.dragging { cursor: grabbing; opacity: .85; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.gx-grip { position: absolute; right: 0; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.gx-grip:hover { background: rgba(0,0,0,.18); }
.gx-ms { position: absolute; top: 9px; width: 16px; height: 16px; transform: rotate(45deg); border-radius: 2px; box-shadow: 0 0 0 2px #fff; cursor: pointer; }
.gx-label { position: absolute; top: 0; height: 34px; line-height: 34px; font-size: 12px; color: var(--ink); white-space: nowrap; pointer-events: none; }
.gx-label[data-hint]:not([data-hint=""])::after { content: attr(data-hint); margin-left: 8px; background: var(--ink); color: #fff; padding: 2px 6px; border-radius: 4px; font-size: 11px; }
.gx-risk { background: #fab219; color: #0b0b0b; font-weight: 700; padding: 1px 6px; border-radius: 4px; margin-right: 6px; font-size: 11px; }
.gx-tip { position: absolute; z-index: 20; width: 250px; background: var(--ink); color: #fff; border-radius: 8px; padding: 10px 12px; font-size: 12px; line-height: 1.45; box-shadow: 0 8px 24px rgba(0,0,0,.25); pointer-events: none; }
.gx-tip b { display: block; font-size: 13px; margin-bottom: 2px; }
.gx-tip .gx-muted { color: #c9cfd6; white-space: normal; }
.gx-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12px; color: var(--ink-2); align-items: center; }
.gx-legend span { display: inline-flex; align-items: center; gap: 6px; }
.gx-legend .sw { width: 18px; height: 10px; border-radius: 3px; display: inline-block; }
.gx-legend .sw.crit { background: #dde3ea; outline: 2px solid var(--ink); }
.gx-legend .sw.prog { background: linear-gradient(90deg, #2a78d6 55%, #b4cff1 55%); }
.gx-legend .ms { width: 10px; height: 10px; background: var(--ink-2); transform: rotate(45deg); display: inline-block; }
.gx-legend .ln { width: 0; height: 14px; display: inline-block; }
.gx-legend .ln.today { border-left: 2px dashed var(--ink); }
.gx-legend .ln.target { border-left: 2px solid #d03b3b; }
.pct-row { display: flex; align-items: center; gap: 10px; }
.pct-row input[type=range] { flex: 1; accent-color: var(--accent); }
.pct-row .pct { width: 76px; }
.dep-list { max-height: 180px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 820px) {
  .gx { max-height: calc(100vh - 250px); border-radius: 10px; }
  .gx-task-cell { padding-left: 8px; font-size: 12px; }
  .gx-phase-cell b { font-size: 12px; }
  .gx-toolbar .seg button { padding: 6px 9px; }
}
.gx-label { text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; }
.toast-undo { margin-left: 10px; background: #fff; color: var(--ink); border: none; border-radius: 6px; padding: 3px 10px; font-weight: 700; cursor: pointer; }
.gx-conflicts summary { cursor: pointer; }
.gx-conflicts ul { margin: 6px 0 0; padding-left: 20px; }
.gx-conflicts li { margin: 2px 0; }
@media (max-width: 820px) {
  .gx-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gx-tiles .tile { padding: 10px 12px; }
  .gx-tiles .v { font-size: 22px; }
}

/* Consistent spacing inside every dialog: each block after the first gets breathing room
   (vertical margins collapse, so paragraphs and headings don't double up). */
.modal > * + *:not(.x) { margin-top: 12px; }
.modal > h3 { margin-top: 0; }
.modal .row:has(> .btn) { align-items: center; }
.modal .stack > .btn, .modal .stack > button[type=submit] { align-self: flex-start; min-width: 110px; }
.error:empty { display: none; }

/* ---------- Budget (value-based) ---------- */
.bud-card { margin-bottom: 14px; display: flex; flex-direction: column; gap: 12px; }
.bud-track { position: relative; height: 22px; background: #eef1f4; border-radius: 6px; display: flex; overflow: visible; }
.bud-acc { background: #1baf7a; height: 100%; border-radius: 6px 0 0 6px; }
.bud-pend { background: repeating-linear-gradient(135deg, #9dc3ef 0 6px, #c6dcf6 6px 12px); height: 100%; border-left: 2px solid #fff; }
.bud-tick { position: absolute; top: -6px; bottom: -6px; width: 0; border-left: 2px solid var(--ink); }
.bud-tick span { position: absolute; top: -20px; left: 0; transform: translateX(-50%); font-size: 11px; font-weight: 700; white-space: nowrap; background: #fff; padding: 0 4px; }
.bud-bar { padding-top: 16px; }
.bud-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.bud-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bud-legend .sw { width: 16px; height: 10px; border-radius: 3px; display: inline-block; }
.bud-legend .sw.acc { background: #1baf7a; }
.bud-legend .sw.pend { background: repeating-linear-gradient(135deg, #9dc3ef 0 4px, #c6dcf6 4px 8px); }
.bud-legend .sw.tick { width: 0; height: 14px; border-left: 2px solid var(--ink); border-radius: 0; }
.bud-cont { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.bud-cont .pct-row { flex: 0 1 320px; }
.good-note { background: #e6f6ee; color: #135c33; border-left: 4px solid #1baf7a; }
.ref-note { border-top: 1px dashed var(--line); padding-top: 8px; }
.bud-table td.ref, .bud-table th.ref, .ref { color: #9aa3ae; }
.bud-row td { vertical-align: top; }
.bud-row.open td { background: #f4f9fb; }
.chev.rot { color: var(--accent); }
.lowest-chip { display: inline-block; background: #e6f6ee; color: #135c33; font-weight: 800; padding: 2px 8px; border-radius: 6px; }
.acc-amt { color: #135c33; }
.bud-total td { border-top: 2px solid var(--ink); background: #fafbfc; }
.pill.bs-Accepted { background: var(--ok-soft); color: var(--ok); }
.pill.bs-Partly-accepted, .pill.bs-Ready-to-accept { background: var(--warn-soft); color: var(--warn); }
.pill.bs-Needs-quotes, .pill.bs-On-hold { background: var(--idle); color: var(--ink-2); }
.pill.part { background: #eef1f4; color: var(--ink-2); }
.pill.pk-Accepted, .pill.bid-Accepted { background: var(--ok-soft); color: var(--ok); }
tr.bud-detail > td { background: #f4f9fb; padding: 0 !important; }
.bud-panel { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.bud-panel-top { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.tgt-wrap { flex: 0 0 180px; }
.refs { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; color: #8a94a3; font-size: 13px; padding-bottom: 8px; }
.refs b { color: #8a94a3; }
.bud-panel-top .btn { margin-left: auto; }
.q-compare { font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 6px; background: #fff; border: 1px solid var(--line); }
.q-compare.good { background: #e6f6ee; color: #135c33; border-color: #bfe6cf; }
.q-ways { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
.q-way { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.q-way.chosen { border-color: #1baf7a; box-shadow: 0 0 0 2px #e6f6ee; }
.q-way-h { display: flex; align-items: baseline; gap: 8px; font-family: Montserrat, sans-serif; font-weight: 800; font-size: 14px; }
.q-way-h b { margin-left: auto; font-size: 15px; }
.q-slot { border-top: 1px solid var(--line); padding-top: 6px; }
.q-head { display: flex; gap: 8px; align-items: baseline; font-size: 13px; margin-bottom: 4px; }
.q-row { display: grid; grid-template-columns: 1fr auto 62px auto; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 6px; font-size: 13px; }
.q-row.lowest { background: #f0faf4; }
.q-row.accepted { background: #e6f6ee; outline: 1px solid #1baf7a; }
.q-who { font-weight: 600; color: var(--ink); }
.q-amt { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.q-empty { padding: 2px 6px 4px; }
.q-lines { margin: 2px 6px 8px; padding: 6px 8px; border-left: 3px solid var(--line); font-size: 12.5px; }
.q-area + .q-area { margin-top: 6px; }
.q-area-h, .q-line { display: flex; justify-content: space-between; gap: 12px; }
.q-line { padding-left: 10px; color: #4a5560; }
.q-line > :last-child, .q-area-h > :last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bid-table .q-lines { margin: 6px 0 2px; max-width: 420px; }
.q-add { margin-top: 4px; }
.acc { border: 1px solid var(--accent); background: #fff; color: var(--accent); border-radius: 999px; padding: 3px 12px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.acc:hover { background: var(--blue-soft); }
.acc.on { background: #1baf7a; border-color: #1baf7a; color: #fff; }
.acc.static { display: inline-block; cursor: default; }
.comp-who { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-right: 10px; }
@media (max-width: 820px) {
  .q-ways { grid-template-columns: 1fr; }
  .q-row { grid-template-columns: 1fr auto; }
  .bud-panel { padding: 10px; }
  .tgt-wrap { flex: 1 1 140px; }
  .bud-panel-top .btn { margin-left: 0; }
}
.lowest-chip.partial { background: repeating-linear-gradient(135deg, #e6f6ee 0 6px, #f5fbf8 6px 12px); }
.lowest-chip { white-space: nowrap; }
@media (max-width: 820px) {
  .q-row { grid-template-columns: 1fr auto; grid-template-areas: "who amt" "tag acc"; row-gap: 4px; }
  .q-row > .q-who { grid-area: who; } .q-row > .q-amt { grid-area: amt; }
  .q-row > :nth-child(3) { grid-area: tag; justify-self: start; } .q-row > :nth-child(4) { grid-area: acc; justify-self: end; }
}

/* Video Logs — reuse the hub's cards, buttons and form controls. */
.video-form,.video-proposal,.video-detail > .card{padding:20px;margin:16px 0}
.video-form input[type=file]{max-width:100%}
.video-list{display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(min(100%,290px),1fr));margin-top:20px}
.video-log-link{display:block;padding:20px;color:inherit;text-decoration:none}
.video-log-link:hover{outline:2px solid var(--accent,#168b84)}
.video-media{display:block;width:100%;max-height:65vh;object-fit:contain;margin:16px 0;background:#10191d;border-radius:10px}
.video-detail{max-width:1000px}
.video-detail .body{white-space:pre-wrap}
.video-detail details{margin:16px 0}
.video-detail summary{cursor:pointer;font-weight:600;padding:8px 0}
.video-participants{display:flex;flex-wrap:wrap;gap:12px;margin:12px 0}
.video-participants input{width:auto}
.video-evidence{display:flex;align-items:flex-start;gap:12px;margin:12px 0}
.video-evidence button{flex-shrink:0}
.video-proposal textarea{width:100%}
@media(max-width:600px){.video-form,.video-proposal,.video-detail>.card{padding:14px}.video-evidence{gap:8px}}

/* ---------- Language switch (English / Español) ---------- */
.lang-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 700; line-height: 1; cursor: pointer;
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); white-space: nowrap; }
.lang-btn:hover, .lang-btn:focus-visible { border-color: var(--accent); color: var(--accent); }
.lang-btn .lang-ic { display: inline-flex; }
.auth-lang { display: flex; justify-content: flex-end; width: min(420px, 100%); margin: 0 auto 10px; }
.who .lang-btn { background: none; border-color: #45445f; color: #fff; align-self: flex-start; margin: 2px 0 4px; }
.who .lang-btn:hover, .who .lang-btn:focus-visible { border-color: #fff; color: #fff; }
.topbar .lang-btn { flex: 0 0 auto; margin-left: auto; padding: 7px 10px; }
.topbar .lang-btn + .tb-menu { margin-left: 0; }

/* Text written by people, shown translated. The original stays one tap away. */
.tx-mt { text-decoration: underline dotted rgba(29,28,49,.28); text-underline-offset: 3px; }
.tx-tag { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; color: var(--muted, #6b7280); text-decoration: none; }
.tx-toggle { font: inherit; background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; }
h3 .tx-tag { font-family: inherit; letter-spacing: 0; text-transform: none; }

/* Original document and accessible translation remain visible together. */
.pv-workspace { display:flex; flex:1; min-height:0; }
.pv-workspace .pv-stage { min-width:0; }
.pv-translation { width:40%; min-width:300px; max-width:650px; overflow:auto; padding:20px; background:#fff; color:#20212a; border-left:1px solid #ddd; }
.pv-translation[hidden] { display:none; }
.pv-translation h3 { margin-top:0; }
.pv-translation select { color:#20212a; background:white; padding:8px; }
.pv-translated-text { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.65; margin:16px 0; }
.pv-translation details { border-top:1px solid #ddd; padding-top:12px; margin-top:20px; }
@media(max-width:700px) {
  .pv-workspace { flex-direction:column; overflow:auto; }
  .pv-workspace .pv-stage { flex:none; height:45vh; min-height:240px; }
  .pv-translation { width:100%; max-width:none; min-width:0; box-sizing:border-box; overflow:visible; }
}

.pv-document-page { border-top:1px solid #bbb; padding-top:12px; margin-top:20px; }
