/* MailOS: red, white, black. Clean SaaS layout: black rail, white workspace, red actions. */
:root {
  --red: #d7262b;
  --red-dark: #b01c21;
  --red-tint: #fdecec;
  --black: #111214;
  --ink: #1d1f23;
  --ink-2: #4a4f57;
  --ink-3: #7c828c;
  --line: #e3e5e8;
  --line-2: #eef0f2;
  --bg: #f6f7f8;
  --white: #ffffff;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(17, 18, 20, .06), 0 1px 1px rgba(17, 18, 20, .04);
  --shadow-lg: 0 18px 50px rgba(17, 18, 20, .25);
  --font: 'Lexend Deca', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body, #app { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
a { color: var(--red); }
a.btn { color: var(--ink); text-decoration: none; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--white); cursor: pointer;
  font-weight: 500; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--red); border-color: var(--red); color: var(--white); }
.btn.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 16px; height: 16px; }

.input {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--white);
}
.input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }

/* ---------- auth ---------- */
.auth { min-height: 100%; display: grid; grid-template-columns: 1.25fr 1fr; }
.auth-brand {
  background: var(--black); color: var(--white); padding: clamp(32px, 5vw, 80px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.auth-brand .logo { font-size: clamp(18px, 1.4vw, 24px); padding: 0; }
.auth-brand .logo .mark { width: clamp(28px, 2.2vw, 40px); height: clamp(28px, 2.2vw, 40px); }
.auth-brand h1 { font-size: clamp(34px, 3.6vw, 68px); line-height: 1.05; margin: 0 0 18px; font-weight: 700; letter-spacing: -.025em; max-width: 14ch; }
.auth-brand p { color: #b9bdc4; max-width: 520px; margin: 0; font-size: clamp(15px, 1.1vw, 19px); }
.auth-brand .bar { width: 56px; height: 4px; background: var(--red); margin-bottom: 28px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: clamp(28px, 4vh, 56px); max-width: 860px; }
.feature { border: 1px solid #26282d; border-radius: 10px; padding: 16px 18px; background: #17181b; }
.feature svg { width: 22px; height: 22px; color: var(--red); }
.feature strong { display: block; margin: 10px 0 4px; font-size: 15px; color: var(--white); }
.feature span { color: #8a9099; font-size: 13px; }
.auth-foot { color: #6c727b; font-size: 13px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px clamp(16px, 4vw, 64px); background: var(--white); }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h2 { margin: 0 0 6px; font-size: clamp(24px, 1.8vw, 32px); letter-spacing: -.01em; }
.auth-card .sub { color: var(--ink-3); margin: 0 0 28px; font-size: 15px; }
.auth-card label { display: block; font-weight: 500; margin: 16px 0 6px; }
.auth-card .input { height: 46px; font-size: 15px; }
.auth-card .btn.primary { width: 100%; justify-content: center; height: 48px; margin-top: 24px; font-size: 15px; }
.auth-card .switch { margin-top: 20px; color: var(--ink-3); text-align: center; }
.auth-card .switch button { border: 0; background: none; color: var(--red); cursor: pointer; font-weight: 500; padding: 0; }
.error { color: var(--red); margin-top: 12px; min-height: 20px; }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--ink-3); margin-bottom: 6px; font-size: 13px; }
.crumbs button { border: 0; background: none; color: var(--ink-2); cursor: pointer; padding: 2px 4px; border-radius: 4px; }
.crumbs button:hover { color: var(--red); }
.crumbs button.drop-target { background: var(--red-tint); color: var(--red); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- grid ---------- */
.section-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 6px 0 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 24px; }
.tile {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  cursor: pointer; user-select: none; overflow: hidden; display: flex; flex-direction: column; min-width: 0;
}
.tile:hover { border-color: #c9ccd1; }
.tile.selected { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-tint), var(--shadow); }
.tile.drop-target { border-color: var(--red); background: var(--red-tint); }
.tile .thumb { aspect-ratio: 4 / 3; background: var(--line-2); display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--line); }
.tile .thumb img { width: 100%; height: 100%; object-fit: cover; }
.tile .meta { padding: 9px 11px 10px; min-width: 0; }
.tile .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .sub { color: var(--ink-3); font-size: 12px; }
.folder-tile { flex-direction: row; align-items: center; gap: 10px; padding: 12px; }
.folder-tile svg { width: 28px; height: 28px; color: var(--black); flex: none; }
.folder-tile .meta { padding: 0; }

.badge {
  font-weight: 700; font-size: 12px; letter-spacing: .06em; padding: 6px 10px; border-radius: 4px; color: var(--white); background: var(--ink-2);
}
.badge.pdf { background: var(--red); }
.badge.zip { background: var(--black); }

.empty {
  border: 2px dashed var(--line); border-radius: 12px; padding: 56px 24px; text-align: center; color: var(--ink-3); background: var(--white);
}
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

.dropzone {
  position: absolute; inset: 12px; border: 2px dashed var(--red); border-radius: 12px; background: rgba(253, 236, 236, .9);
  display: none; place-items: center; color: var(--red); font-size: 18px; font-weight: 600; z-index: 5; pointer-events: none;
}
.dragging-files .dropzone { display: grid; }

/* ---------- upload tray ---------- */
.tray {
  position: fixed; right: 20px; bottom: 20px; width: 340px; background: var(--white); border-radius: 10px; box-shadow: var(--shadow-lg);
  overflow: hidden; z-index: 30; border: 1px solid var(--line);
}
.tray-head { background: var(--black); color: var(--white); padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; font-weight: 500; }
.tray-head button { border: 0; background: none; color: #b9bdc4; cursor: pointer; }
.tray-list { max-height: 240px; overflow: auto; }
.tray-row { padding: 9px 14px; border-bottom: 1px solid var(--line-2); }
.tray-row .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.tray-row .s { font-size: 12px; color: var(--ink-3); }
.tray-row .s.err { color: var(--red); }
.progress { height: 4px; background: var(--line-2); border-radius: 2px; margin-top: 5px; overflow: hidden; }
.progress > div { height: 100%; background: var(--red); width: 0; transition: width .15s; }

/* ---------- modal / preview ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(17, 18, 20, .6); z-index: 40; display: flex; padding: 24px; }
.modal {
  background: var(--white); border-radius: 12px; margin: auto; width: 100%; max-width: 1200px; height: 100%; max-height: 900px;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg);
}
.modal.small { max-width: 420px; height: auto; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal-head .title { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-head .sub { color: var(--ink-3); font-weight: 400; margin-left: 8px; font-size: 13px; }
.modal-body { flex: 1; min-height: 0; background: var(--bg); display: flex; }
.modal.small .modal-body { background: var(--white); padding: 18px 16px; display: block; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 16px 16px; }

.viewer { flex: 1; min-width: 0; display: grid; place-items: center; overflow: auto; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer iframe { width: 100%; height: 100%; border: 0; background: var(--white); }
.viewer video { max-width: 100%; max-height: 100%; }
.viewer pre { align-self: stretch; justify-self: stretch; margin: 0; padding: 16px; background: var(--white); overflow: auto; font: 12px/1.5 ui-monospace, Menlo, monospace; white-space: pre-wrap; }
.viewer .none { text-align: center; color: var(--ink-3); }
.viewer .none strong { display: block; color: var(--ink); margin-bottom: 6px; }

.zip { display: grid; grid-template-columns: 320px 1fr; width: 100%; min-height: 0; }
.zip-side { background: var(--white); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.zip-side .crumbs { padding: 10px 12px 8px; margin: 0; border-bottom: 1px solid var(--line-2); }
.zip-list { overflow: auto; flex: 1; }
.zip-row {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left; padding: 8px 12px; cursor: pointer;
  border-bottom: 1px solid var(--line-2);
}
.zip-row:hover { background: var(--bg); }
.zip-row.active { background: var(--red-tint); box-shadow: inset 3px 0 0 var(--red); }
.zip-row svg { width: 18px; height: 18px; flex: none; color: var(--ink-2); }
.zip-row .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zip-row .s { color: var(--ink-3); font-size: 12px; }
.zip-count { padding: 8px 12px; color: var(--ink-3); font-size: 12px; border-top: 1px solid var(--line); }
.zip .viewer { position: relative; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--black); color: var(--white);
  padding: 10px 16px; border-radius: 8px; z-index: 50; box-shadow: var(--shadow-lg);
}

.results-path { color: var(--ink-3); font-size: 12px; }

@media (max-width: 760px) {
  .auth { grid-template-columns: 1fr; }
  .features { display: none; }
  .auth-brand { padding: 32px 16px; }
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .rail { flex-direction: row; align-items: center; overflow-x: auto; padding: 8px; gap: 4px; }
  .rail .nav-label, .rail-foot, .nav-item .soon { display: none; }
  .rail .logo { padding: 0 8px 0 4px; }
  .rail .logo span { display: none; }
  .nav-item { width: auto; white-space: nowrap; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .zip { grid-template-columns: 1fr; grid-template-rows: 40% 1fr; }
  .modal-back { padding: 0; }
  .modal { border-radius: 0; max-height: none; }
}

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; height: 100%; }
.rail { background: var(--black); color: #c8ccd2; display: flex; flex-direction: column; padding: 16px 10px; overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--white); font-weight: 700; font-size: 18px; padding: 4px 10px 18px; text-decoration: none; }
.logo .mark { width: 28px; height: 28px; border-radius: 6px; background: var(--red); display: grid; place-items: center; flex: none; }
.logo .mark svg { width: 16px; height: 16px; color: var(--white); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px; color: inherit; text-decoration: none; }
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item:hover { background: #1f2125; color: var(--white); }
.nav-item.active { background: #26282d; color: var(--white); box-shadow: inset 3px 0 0 var(--red); }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6c727b; padding: 16px 10px 6px; }
.rail-foot { margin-top: auto; border-top: 1px solid #26282d; padding: 12px 10px 0; font-size: 13px; }
.rail-foot .org { color: var(--white); font-weight: 600; }
.rail-foot .who { color: #8a9099; overflow: hidden; text-overflow: ellipsis; }
.rail-links { display: flex; gap: 14px; margin-top: 8px; align-items: center; }
.rail-links a, .rail-links button { display: inline-flex; gap: 6px; align-items: center; border: 0; background: none; color: #8a9099; cursor: pointer; padding: 0; text-decoration: none; font-size: 13px; }
.rail-links svg { width: 14px; height: 14px; }
.rail-links a:hover, .rail-links button:hover { color: var(--white); }
.main { display: flex; flex-direction: column; min-width: 0; height: 100%; overflow: hidden; }
.topbar { height: 60px; background: var(--white); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 28px; flex: none; }
.search { position: relative; flex: 1; max-width: 560px; }
.search svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: var(--ink-3); }
.search .input { padding-left: 34px; background: var(--bg); }
.content { flex: 1; overflow: auto; padding: 28px; position: relative; }
.view { max-width: 1600px; margin: 0 auto; }

/* ---------- text helpers ---------- */
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.pre { white-space: pre-wrap; }
.page-sub { color: var(--ink-3); margin-top: 4px; }
.crumbs a { color: var(--ink-2); text-decoration: none; padding: 2px 4px; border-radius: 4px; }
.crumbs a:hover { color: var(--red); }
.crumbs a.drop-target { background: var(--red-tint); color: var(--red); }
.campaign-link { color: var(--red); text-decoration: none; font-weight: 500; }
.campaign-link:hover { text-decoration: underline; }
.btn.danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.tiny { height: 26px; padding: 0 8px; }
.btn.float { position: absolute; top: 12px; right: 12px; z-index: 1; }
.input.slim { height: 34px; width: auto; min-width: 160px; }
select.input { padding-right: 28px; }
textarea.input { height: auto; padding: 9px 12px; resize: vertical; line-height: 1.45; }

/* ---------- pills, segmented control, ⋯ menu ---------- */
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 500; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: #e6f4ea; color: #1e6b34; }
.pill.warn { background: #fff4d6; color: #8a5a00; }
.pill.bad { background: var(--red-tint); color: var(--red-dark); }
.pill.muted { background: var(--line-2); color: var(--ink-3); }
.thumb .pill { position: absolute; left: 8px; bottom: 8px; box-shadow: var(--shadow); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--white); }
.seg button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; background: none; cursor: pointer; color: var(--ink-2); font-weight: 500; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--black); color: var(--white); }
.seg svg { width: 15px; height: 15px; }
.dots { width: 28px; height: 28px; border: 0; background: none; border-radius: 6px; display: grid; place-items: center; cursor: pointer; color: var(--ink-3); flex: none; }
.dots svg { width: 16px; height: 16px; }
.dots:hover { background: var(--line-2); color: var(--ink); }
.menu { position: absolute; z-index: 60; width: 200px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 4px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 5px; cursor: pointer; }
.menu button:hover { background: var(--bg); }
.menu button.danger { color: var(--red); }

/* ---------- file tiles ---------- */
a.tile { color: inherit; text-decoration: none; }
.tile .thumb { position: relative; }
.name-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.name-row .name { flex: 1; min-width: 0; }
.folder-dot svg { width: 16px; height: 16px; color: var(--red); display: block; }
.folder-glyph svg { width: 44px; height: 44px; color: #c3c7cd; }
.folder-card .thumb { background: #f0f1f3; }
.folder-card.compact { padding: 12px; }
.folder-card.compact .meta { padding: 0; }
.tile:focus-visible, .card:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* ---------- toolbar, panels, layout ---------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
.two-col.even { grid-template-columns: 1fr 1fr; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.panel-head a { color: var(--red); text-decoration: none; font-weight: 500; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: 12px; }
.check-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check-row input { width: 16px; height: 16px; accent-color: var(--red); }
.add-row { display: flex; gap: 8px; align-items: flex-start; }
.add-row .input { flex: 1; }
.row-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: inherit; text-decoration: none; background: var(--white); width: 100%; text-align: left; cursor: pointer; }
.list-row + .list-row { margin-top: -4px; }
.list-row:hover { border-color: #c9ccd1; }
.list-row.static { cursor: default; }
.list-row.static:hover { border-color: var(--line); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.kv > div { background: var(--bg); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv span { color: var(--ink-3); font-size: 12px; }
.kv strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpis.small { margin: 0; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.kpi span { color: var(--ink-3); font-size: 12px; font-weight: 500; }
.kpi strong { font-size: 22px; letter-spacing: -.01em; }
.kpi.warn strong { color: #8a5a00; }
.callout { background: var(--bg); border-left: 3px solid var(--ink-3); padding: 10px 12px; border-radius: 0 6px 6px 0; font-size: 13px; white-space: pre-wrap; }
.callout.warn { border-color: #e0a100; background: #fff8e6; }
.progress.inline { width: 100px; margin: 0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: 10px; }
.panel .table-wrap { border-radius: 8px; }
.grid-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid-table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--ink-3); background: #fafbfb; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid-table td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.grid-table tr:last-child td { border-bottom: 0; }
.grid-table.edit td { padding: 4px 6px; }
.grid-table tr.clickable { cursor: pointer; }
.grid-table tr.clickable:hover td, .grid-table tbody tr:hover td { background: #fbfbfc; }
.grid-table .num, .grid-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.grid-table .neg { color: var(--red); }
.grid-table .best { background: #e6f4ea !important; color: #1e6b34; font-weight: 600; }
.grid-table tr.total td { font-weight: 700; border-top: 2px solid var(--ink); }
.grid-table td.late, .late { color: var(--red); }
.cell-input { width: 100%; min-width: 80px; height: 32px; border: 1px solid transparent; border-radius: 5px; background: transparent; padding: 0 8px; font-size: 13px; }
.cell-input:hover { border-color: var(--line); background: var(--white); }
.cell-input:focus { outline: none; border-color: var(--red); background: var(--white); box-shadow: 0 0 0 3px var(--red-tint); }
.cell-input.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-link { color: inherit; text-decoration: none; white-space: nowrap; }
.cell-link:hover strong { color: var(--red); }

/* ---------- phases (campaigns) ---------- */
.ph-0 { --ph: #12a594; } .ph-1 { --ph: #7b5cd6; } .ph-2 { --ph: #2f7fd1; } .ph-3 { --ph: #d98a00; } .ph-4 { --ph: #d7262b; }
.ph-5 { --ph: #e8559f; } .ph-6 { --ph: #3949ab; } .ph-7 { --ph: #9a6a00; } .ph-8 { --ph: #1e8a4c; } .ph-9 { --ph: #7a7f87; } .ph-none { --ph: #c3c7cd; }
.pill-select { height: 28px; border-radius: 14px; border: 0; padding: 0 26px 0 12px; font-weight: 600; font-size: 12px; color: #fff; background: var(--ph); cursor: pointer; }
/* Columns wrap onto new rows instead of scrolling sideways. */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; padding-bottom: 12px; align-items: start; }
.col { background: #eef0f2; border-radius: 10px; padding: 8px; min-height: 120px; }
.col.drop-target { background: var(--red-tint); outline: 2px dashed var(--red); }
.col-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 13px; padding: 6px 8px 10px; border-top: 3px solid var(--ph); border-radius: 3px; }
.count { background: var(--white); color: var(--ink-2); border-radius: 10px; padding: 1px 8px; font-size: 12px; font-weight: 600; }
.col-body { display: flex; flex-direction: column; gap: 8px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 12px; color: inherit; text-decoration: none; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 5px; cursor: pointer; }
.card:hover { border-color: #c3c7cd; }
.card-code { display: flex; justify-content: space-between; gap: 6px; font-weight: 700; letter-spacing: .01em; }
.card-name { color: var(--ink-2); font-size: 13px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--ink-3); }
.card-next { font-size: 12px; background: var(--bg); border-radius: 5px; padding: 5px 8px; }
.card-next.late { background: var(--red-tint); color: var(--red-dark); }
.groups { display: flex; flex-direction: column; gap: 18px; }
.group-head { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ph); margin-bottom: 8px; }
.group-head .count { background: var(--line-2); }
.group .table-wrap { border-left: 4px solid var(--ph); }
.pipeline { display: flex; gap: 4px; margin-bottom: 18px; }
.pipeline button { flex: 1; min-width: 0; height: 38px; line-height: 1.1; overflow: hidden; border: 0; background: var(--line-2); color: var(--ink-3); font-weight: 600; font-size: 12px; cursor: pointer; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); padding: 0 16px; }
.pipeline button:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); border-radius: 6px 0 0 6px; }
.pipeline button.done { background: #3a3d43; color: #fff; }
.pipeline button.current { background: var(--red); color: #fff; }
.pipeline button:hover:not(.current) { background: #d9dce0; color: var(--ink); }
.tasks { display: flex; flex-direction: column; }
.task { display: grid; grid-template-columns: 22px 1fr 150px 170px 30px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.task input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--red); }
.task.done .task-title { text-decoration: line-through; color: var(--ink-3); }
.task.late .task-title { color: var(--red); font-weight: 500; }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.mini { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--white); color: inherit; text-decoration: none; cursor: pointer; padding: 0; text-align: left; display: flex; flex-direction: column; }
.mini:hover { border-color: var(--red); }
.mini .thumb { aspect-ratio: 4 / 3; background: var(--line-2); display: grid; place-items: center; overflow: hidden; }
.mini .thumb img { width: 100%; height: 100%; object-fit: cover; }
.mini-name { font-size: 12px; padding: 6px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- vendors ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.vcard { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 16px; color: inherit; text-decoration: none; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.vcard:hover { border-color: var(--red); }
.vcard-head { display: flex; gap: 12px; align-items: center; }
.avatar { width: 40px; height: 40px; border-radius: 8px; background: var(--black); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.vcard-meta { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--ink-2); overflow: hidden; }
.feed { display: flex; flex-direction: column; gap: 10px; }
.feed-item { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; }
.feed-meta { font-size: 12px; color: var(--ink-3); }
.feed-body { white-space: pre-wrap; }

/* ---------- modal additions ---------- */
.modal.small.wide { max-width: 640px; }
.modal .form-body { display: flex; flex-direction: column; gap: 12px; max-height: 70vh; overflow-y: auto; }
.modal .form-body p { margin: 0; overflow-wrap: anywhere; }
.modal-head .seg { margin-right: 4px; }
.split { display: grid; grid-template-columns: 1fr 300px; width: 100%; min-height: 0; }
.redact-side { background: var(--white); border-left: 1px solid var(--line); padding: 18px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.redact-side h3 { margin: 0; }
.redact-side p { margin: 0; }

/* ---------- public pages (vendor portal, reading room) ---------- */
body.public { background: var(--bg); }
.pub-head { background: var(--black); padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pub-head .logo { padding: 0; }
.pub-org { color: #b9bdc4; font-size: 14px; }
.pub-main { max-width: 1100px; margin: 0 auto; padding: 28px 16px 60px; display: flex; flex-direction: column; gap: 14px; }
.pub-main h1 { margin: 0; font-size: 26px; }

@media (max-width: 1100px) {
  .two-col, .two-col.even { grid-template-columns: minmax(0, 1fr); }
  .task { grid-template-columns: 22px 1fr 30px; }
  .task .cell-input { grid-column: 2; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .rail { flex-direction: row; align-items: center; overflow-x: auto; padding: 8px; gap: 4px; }
  .nav { flex-direction: row; }
  .rail .nav-label, .rail-foot { display: none; }
  .rail .logo { padding: 0 8px 0 4px; }
  .rail .logo span, .nav-item span { display: none; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .split { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .redact-side { border-left: 0; border-top: 1px solid var(--line); max-height: 40vh; }
}

/* ---------- donors & selects ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--ink-2); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--red); border-bottom-color: var(--red); }
.select-count { display: flex; flex-direction: column; gap: 4px; }
.select-count > span { color: var(--ink-3); font-size: 12px; font-weight: 500; }
.select-count > strong { font-size: 40px; letter-spacing: -.02em; line-height: 1.1; }
.sticky { position: sticky; top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 16px; padding: 4px 10px; cursor: pointer; font-size: 13px; background: var(--white); }
.chip input { accent-color: var(--red); }
.chip em { color: var(--ink-3); font-style: normal; font-size: 12px; }
.vcard.dim { opacity: .6; }
pre.code { background: var(--black); color: #e8eaed; padding: 14px; border-radius: 8px; overflow-x: auto; font: 12px/1.5 ui-monospace, Menlo, monospace; margin: 0; }
code { font: 12px ui-monospace, Menlo, monospace; background: var(--line-2); padding: 1px 5px; border-radius: 4px; }

/* ---------- HubSpot-style filter builder ---------- */
.select-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; align-items: start; }
.filter-panel { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; max-height: calc(100vh - 140px); overflow-y: auto; box-shadow: var(--shadow); }
.filter-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.filter-head h3 { margin: 0; font-size: 15px; flex: 1; }
.fgroup { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 6px; background: #fafbfb; }
.fgroup-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.fchip { display: flex; align-items: stretch; background: var(--white); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.fchip:hover { border-color: var(--red); }
.fchip-body { flex: 1; text-align: left; border: 0; background: none; padding: 8px 10px; cursor: pointer; font-size: 13px; line-height: 1.4; }
.fchip-body strong { font-weight: 600; }
.fchip-x { border: 0; background: none; width: 30px; cursor: pointer; color: var(--ink-3); display: grid; place-items: center; }
.fchip-x svg { width: 14px; height: 14px; }
.fchip-x:hover { color: var(--red); background: var(--red-tint); }
.and-sep { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; padding-left: 4px; }
.or-sep { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.or-sep::before, .or-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.add-filter { color: var(--red); justify-content: flex-start; }
.add-group { justify-content: center; }
.prop-list, .op-list { display: flex; flex-direction: column; gap: 2px; max-height: 55vh; overflow-y: auto; }
.prop { display: flex; justify-content: space-between; gap: 8px; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 6px; cursor: pointer; }
.prop:hover { background: var(--red-tint); color: var(--red-dark); }
.op-list .check-row { padding: 6px 4px; }
.op-list input[type=radio] { accent-color: var(--red); width: 16px; height: 16px; }
.opt-list { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
.records-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.records-n { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.table-foot { padding: 10px 12px; border-top: 1px solid var(--line-2); }
@media (max-width: 1000px) { .select-layout { grid-template-columns: minmax(0, 1fr); } .filter-panel { position: static; max-height: none; } }

/* saved views bar (selects) */
.view-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; box-shadow: var(--shadow); }
.view-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-right: 4px; }
.view-tab { border: 1px solid var(--line); background: var(--white); border-radius: 16px; height: 30px; padding: 0 14px; cursor: pointer; font-weight: 500; color: var(--ink-2); }
.view-tab:hover { border-color: var(--ink-3); color: var(--ink); }
.view-tab.on { background: var(--black); border-color: var(--black); color: var(--white); }
/* Campaigns without a phase get a full-width row of cards rather than one tall column. */
.col.unset { grid-column: 1 / -1; }
.col.unset .col-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }

/* ---------- campaign search + mail-date calendar ---------- */
.search.big { flex: 1; min-width: 240px; max-width: none; }
.search.big .input { height: 40px; background: var(--white); }
.search.big svg { top: 12px; }
.toolbar { align-items: center; }
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.cal-head { display: flex; align-items: center; gap: 8px; }
.cal-head h3 { margin: 0; min-width: 160px; text-align: center; }
.rot svg { transform: rotate(180deg); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--ink-3); text-align: center; padding: 4px 0; }
.cal-day { min-height: 92px; background: var(--bg); border-radius: 6px; padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.blank { background: transparent; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--red); }
.cal-day.drop-target, .cal-tray.drop-target { background: var(--red-tint); outline: 2px dashed var(--red); }
.cal-num { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.cal-chip { display: block; font-size: 11px; line-height: 1.3; padding: 3px 6px; border-radius: 4px; background: var(--white); border-left: 3px solid var(--ph); color: inherit; text-decoration: none; box-shadow: var(--shadow); overflow-wrap: anywhere; cursor: grab; }
.cal-chip:hover { outline: 1px solid var(--ph); }
.cal-tray { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; border-radius: 6px; padding: 2px; }
@media (max-width: 1100px) { .cal-wrap { grid-template-columns: minmax(0, 1fr); } .cal-day { min-height: 64px; } }

/* ---------- titles wrap instead of being cut off ---------- */
.tile .name, .mini-name { white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; overflow-wrap: anywhere; }
.mini-name { min-height: 2.6em; }
.cell-link { white-space: normal; }
.card-code { overflow-wrap: anywhere; }
.callout.nodata { margin-bottom: 14px; }

/* ---------- merge/purge sheet ---------- */
.mp-table tr[style*="--rowc"] td { background: var(--rowc); }
.mp-table tr.mp-seed td { font-weight: 600; }
.mp-table .cell-input.code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; min-width: 100px; }
.mp-table .cell-input { min-width: 60px; }
.mp-table td:nth-child(4) .cell-input { min-width: 72px; }
.mp-table input[type=date].cell-input { min-width: 0; width: 122px; padding: 0 4px; }
.mp-table .cell-input.override { color: var(--red-dark); font-weight: 600; }
.mp-table td.bbref { background: #1f3fd1 !important; color: #fff; font-size: 11px; max-width: 140px; overflow-wrap: anywhere; line-height: 1.3; }
.mp-table th.bbref-h { background: var(--red); color: #fff; }
.mp-table td:nth-child(2) .cell-input, .mp-table td:nth-child(3) .cell-input { min-width: 140px; }
.cell-input.wrap { resize: none; field-sizing: content; min-height: 32px; height: auto; padding: 6px 8px; line-height: 1.35; white-space: normal; overflow: hidden; font: inherit; font-size: 13px; }
.mp-table .cell-input.code { min-width: 92px; }
.mp-table td:nth-child(6) .cell-input { min-width: 48px; }
.mp-table .cell-input.num { min-width: 64px; }
.mp-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; font-weight: 600; }
.mp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mp-legend i { width: 18px; height: 12px; border: 1px solid #999; border-radius: 2px; }
.mp-notes { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.mp-notes li { padding-left: 4px; }
.mp-notes li > * { vertical-align: top; }
.mp-notes li { display: list-item; }
.mp-notes li textarea { width: calc(100% - 110px); display: inline-block; }
.mp-notes li .row-actions { display: inline-flex; margin-left: 6px; }
.mp-notes li.tinted textarea { background: var(--rowc); }
.mp-notes li.flag textarea { color: var(--red); font-weight: 700; }
.btn.tiny.on { background: var(--red); color: #fff; border-color: var(--red); }
.mp-table th { white-space: normal; line-height: 1.25; vertical-align: bottom; }

/* ---------- artwork studio ---------- */
.art-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.art-top .title-input { max-width: 360px; font-weight: 600; font-size: 16px; }
.art-top > .row-actions { margin-left: auto; }
.art-shell { display: grid; grid-template-columns: 200px minmax(0, 1fr) 260px; gap: 12px; align-items: start; }
.art-tools, .art-props { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.art-tools h4, .art-props h4, .art-layers h4 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.tool { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--white); border-radius: 6px; padding: 8px 10px; cursor: pointer; text-align: left; font-weight: 500; }
.tool:hover { border-color: var(--red); color: var(--red); }
.tool svg { width: 16px; height: 16px; }
.tool strong { width: 16px; text-align: center; font-family: Georgia, serif; }
.sw { width: 16px; height: 12px; display: inline-block; flex: none; }
.sw.rect { background: var(--red); border-radius: 2px; }
.sw.ellipse { background: var(--black); border-radius: 50%; }
.sw.line { height: 2px; background: var(--black); }
.art-layers { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.layer { text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 5px; cursor: pointer; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer:hover { background: var(--bg); }
.layer.on { background: var(--red-tint); color: var(--red-dark); font-weight: 600; }
.art-canvas { background: #e4e6ea; border-radius: 10px; min-height: 420px; display: grid; place-items: center; padding: 24px; overflow: auto; position: relative; }
.art-canvas.dropping { outline: 3px dashed var(--red); background: var(--red-tint); }
.art-stage { position: relative; line-height: 0; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); touch-action: none; cursor: default; }
.art-stage .art-svg { display: block; }
.art-overlay { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.art-overlay .sel-box { fill: none; stroke: #2f7fd1; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.art-overlay .sel-handle { fill: #fff; stroke: #2f7fd1; stroke-width: 1.2; vector-effect: non-scaling-stroke; pointer-events: all; cursor: nwse-resize; }
.art-overlay .sel-handle[data-handle="ne"], .art-overlay .sel-handle[data-handle="sw"] { cursor: nesw-resize; }
.form-grid.two { grid-template-columns: 1fr 1fr; gap: 8px; }
.art-props .input { height: 34px; }
.art-props textarea.input { height: auto; }
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type=color] { width: 44px; height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 2px; background: #fff; cursor: pointer; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; max-height: 55vh; overflow-y: auto; }
@media (max-width: 1100px) { .art-shell { grid-template-columns: minmax(0, 1fr); } .art-tools { flex-direction: row; flex-wrap: wrap; } .art-layers { display: none; } }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.card-date { font-size: 11px; font-weight: 700; background: var(--black); color: #fff; border-radius: 4px; padding: 2px 7px; }
.card-date.none { background: var(--line-2); color: var(--ink-3); font-weight: 600; }
.card-date.inferred { background: #3a3d43; }

/* correspondence */
.thread-list { display: flex; flex-direction: column; gap: 6px; max-height: 520px; overflow-y: auto; }
.thread { display: flex; flex-direction: column; gap: 4px; text-align: left; border: 1px solid var(--line); background: var(--white); border-radius: 8px; padding: 9px 12px; cursor: pointer; }
.thread:hover { border-color: var(--red); }
.thread-subj { font-weight: 600; overflow-wrap: anywhere; }
.thread-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.thread-open { border-left: 3px solid var(--red); margin: -2px 0 6px 6px; padding: 4px 0 4px 12px; display: flex; flex-direction: column; gap: 10px; }
.msg-head { font-size: 13px; }
.msg-body { white-space: pre-wrap; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; max-height: 320px; overflow-y: auto; background: var(--bg); border-radius: 6px; padding: 8px 10px; }

/* ---------- vendor rolodex ---------- */
.vgroup { margin-bottom: 22px; }
.vblocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.vblock { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 14px; color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); min-width: 0; overflow: hidden; }
.vblock:hover { border-color: var(--red); }
.vblock-head { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vblock-name { font-size: 15px; overflow-wrap: anywhere; }
.vblock-co { display: flex; flex-direction: column; gap: 1px; font-size: 12px; color: var(--ink-2); min-width: 0; }
.vblock-co span, .person-line, .person-name { overflow-wrap: anywhere; min-width: 0; }
.vblock-people { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line-2); padding-top: 8px; }
.person-name { font-weight: 600; font-size: 13px; }
.person-line { font-size: 12px; color: var(--ink-2); }
/* Nothing spills out of a card: long names and emails wrap. */
.vcard, .vcard *, .list-row, .list-row *, .kv strong { overflow-wrap: anywhere; min-width: 0; }
.seg-table td:first-child { min-width: 220px; overflow-wrap: anywhere; }
.seg-detail > td { background: #fafbfb !important; padding: 12px 16px !important; }
.seg-detail-body { display: flex; flex-direction: column; gap: 8px; }
.seg-detail-body .grid-table { background: var(--white); border: 1px solid var(--line); border-radius: 8px; }

/* ---------- standup ---------- */
.notes-editor { font: 13px/1.55 ui-monospace, Menlo, monospace; min-height: 420px; }
.notes-read { display: flex; flex-direction: column; gap: 6px; line-height: 1.5; overflow-wrap: anywhere; }
.notes-read h4 { margin: 12px 0 0; font-size: 14px; }
.notes-read h4:first-child { margin-top: 0; }
.notes-read ul { margin: 2px 0 6px; padding-left: 20px; }
.notes-read li { margin: 2px 0; }
.brief-row { border-top: 1px solid var(--line-2); padding-top: 10px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.brief-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.brief-head .pill { margin-left: auto; }
.brief-head:hover strong { color: var(--red); }
.brief-mail { font-size: 12px; overflow-wrap: anywhere; }
.date-list { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; }
.date-link { padding: 5px 8px; border-radius: 5px; color: inherit; text-decoration: none; font-size: 13px; }
.date-link:hover { background: var(--bg); }
.date-link.on { background: var(--red-tint); color: var(--red-dark); font-weight: 600; }
.wf-step { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line-2); padding-top: 8px; }
.wf-main { flex: 1; min-width: 0; text-align: left; border: 0; background: none; cursor: pointer; padding: 2px 0; }
.wf-main:hover .wf-title { color: var(--red); }
.wf-title { font-weight: 600; overflow-wrap: anywhere; }
.task input[type=date] { cursor: pointer; }
.sync-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

/* ---------- Blue Book ledger ---------- */
.ledger { font-size: 12px; }
.ledger th, .ledger td { padding: 6px 8px; white-space: nowrap; }
.ledger th { white-space: normal; vertical-align: bottom; line-height: 1.2; }
.ledger td.wide { white-space: normal; min-width: 160px; max-width: 260px; overflow-wrap: anywhere; }
.ledger td.mono { font-family: ui-monospace, Menlo, monospace; font-size: 11px; }
.ledger td.editable { cursor: text; }
.ledger td.editable:hover { background: #fffbe8 !important; }
.ledger td:not(.editable):not(:first-child) { background: #f7f8fa; }
.ledger tr.bb-section td { background: var(--black) !important; color: #fff; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.ledger tr.subtotal td { background: #eef0f2 !important; font-weight: 600; }
.ledger tr.total td { background: #dfe2e6 !important; font-weight: 700; border-top: 2px solid var(--ink); }
.ledger .cell-input { min-width: 70px; height: 26px; font-size: 12px; }
.ledger-wrap { max-height: 70vh; overflow: auto; }
.ledger thead th { position: sticky; top: 0; z-index: 1; }
.btn.disabled { opacity: .4; pointer-events: none; }

/* ---------- segment profitability bands ---------- */
.band-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; vertical-align: middle; flex: none; }
.band-dot.g { background: #1e8a4c; } .band-dot.y { background: #e0a100; } .band-dot.r { background: var(--red); } .band-dot.n { background: #b8bdc4; }
.seg-table tr.band-green td:first-child { box-shadow: inset 4px 0 0 #1e8a4c; }
.seg-table tr.band-yellow td:first-child { box-shadow: inset 4px 0 0 #e0a100; }
.seg-table tr.band-red td:first-child { box-shadow: inset 4px 0 0 var(--red); }
.seg-table tr.band-gray td:first-child { box-shadow: inset 4px 0 0 #b8bdc4; }
.band-panel { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.band-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.band-card { display: flex; flex-direction: column; gap: 3px; text-align: left; border: 1px solid var(--line); border-top: 4px solid; border-radius: 10px; padding: 12px 14px; background: var(--white); cursor: pointer; box-shadow: var(--shadow); }
.band-card.g { border-top-color: #1e8a4c; } .band-card.y { border-top-color: #e0a100; } .band-card.r { border-top-color: var(--red); } .band-card.n { border-top-color: #b8bdc4; }
.band-card.on { outline: 2px solid var(--black); }
.band-card strong { font-size: 20px; }
.band-label { display: flex; align-items: center; font-weight: 600; font-size: 13px; }
.band-in { width: 70px; height: 28px; display: inline-block; padding: 0 6px; }
.ledger th, .ledger td { padding: 6px 6px; }
.ledger td.memo { cursor: pointer; text-align: center; }
.memo-pill { font-size: 11px; font-weight: 600; background: var(--line-2); border-radius: 10px; padding: 2px 7px; white-space: nowrap; }
.ledger td.memo:hover .memo-pill { background: var(--red-tint); color: var(--red-dark); }
.pp-toggle { margin-left: auto; }
.ledger td.wide { min-width: 140px; max-width: 220px; }
.ledger td.wide { min-width: 120px; max-width: 170px; }
.ledger td:last-child { width: 30px; padding: 0 2px; }
.ledger td.mono { font-size: 10.5px; }
.ledger { font-size: 11.5px; }
.grid-table.people td.addr { min-width: 200px; overflow-wrap: anywhere; line-height: 1.35; }
.grid-table.people td { vertical-align: top; }
.grid-table.people td.who { min-width: 150px; overflow-wrap: anywhere; } .grid-table.people .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; } .grid-table.people td.addr { min-width: 170px; }

/* ---------- email reader ---------- */
.mail-shell { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 14px; height: calc(100vh - 230px); min-height: 420px; }
.mail-list { background: var(--white); border: 1px solid var(--line); border-radius: 10px; overflow-y: auto; box-shadow: var(--shadow); }
.mail-item { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line-2); background: none; padding: 10px 12px; cursor: pointer; min-width: 0; }
.mail-item:hover { background: var(--bg); }
.mail-item.on { background: var(--red-tint); box-shadow: inset 3px 0 0 var(--red); }
.mail-item-top { display: flex; justify-content: space-between; gap: 8px; min-width: 0; }
.mail-item-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-subj { font-size: 13px; overflow-wrap: anywhere; }
.mail-snip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mail-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.mail-reader { background: var(--white); border: 1px solid var(--line); border-radius: 10px; overflow-y: auto; padding: 18px 22px; box-shadow: var(--shadow); min-width: 0; }
.mail-head h2 { margin: 0 0 4px; font-size: 18px; overflow-wrap: anywhere; }
.mail-head { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 6px; }
.mail-msg { border-bottom: 1px solid var(--line-2); padding: 14px 0; display: flex; flex-direction: column; gap: 4px; }
.mail-msg header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mail-from-addr { overflow-wrap: anywhere; }
.mail-body, .mail-quoted { white-space: pre-wrap; overflow-wrap: anywhere; font: 13.5px/1.55 var(--font); margin: 6px 0 0; color: var(--ink); }
.mail-quoted { color: var(--ink-3); border-left: 3px solid var(--line); padding-left: 10px; font-size: 12.5px; }
a.thread { color: inherit; text-decoration: none; }
@media (max-width: 900px) { .mail-shell { grid-template-columns: minmax(0, 1fr); height: auto; } .mail-list { max-height: 40vh; } }

/* v0.5 email connector */
.email-acct { align-items: flex-start; gap: 12px; }
.email-acct .row { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.error-text { color: var(--red, #c8102e); }
.wf-auto { color: var(--red, #c8102e); margin-top: 2px; }
.task-by { font-weight: 400; white-space: nowrap; }

/* Campaign board: stacked phase dropdowns with an even card grid */
.phase-board { display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; }
.phase-tools { display: flex; justify-content: flex-end; gap: 6px; }
.phase-sec { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--ph); border-radius: 10px; }
.phase-sec.drop-target { background: var(--red-tint); outline: 2px dashed var(--red); }
.phase-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; font-weight: 700; font-size: 14px; user-select: none; }
.phase-head::-webkit-details-marker { display: none; }
.phase-head:hover { background: var(--bg); border-radius: 10px; }
.phase-chev { width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(-45deg); transition: transform .15s; margin: 0 2px; }
.phase-sec[open] > .phase-head .phase-chev { transform: rotate(45deg); }
.phase-name { color: var(--ink); }
.phase-head .count { background: var(--ph); color: #fff; border-radius: 10px; padding: 1px 9px; font-size: 12px; font-weight: 700; }
.phase-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); grid-auto-rows: 1fr; gap: 10px; padding: 0 14px 14px; }
.phase-grid .card { height: 100%; box-sizing: border-box; }
.card-foot { margin-top: auto; padding-top: 4px; display: flex; justify-content: flex-end; }
.card-phase { height: 24px; font-size: 11px; padding: 0 22px 0 10px; max-width: 100%; }
.bb-block { margin-top: 18px; }
.bb-block-head { font-size: 15px; padding: 0 2px 6px; border-bottom: 2px solid var(--black); margin-bottom: 6px; }
.bb-block-head a { color: var(--red); text-decoration: none; }

/* Reading Room (in-app shelf) */
.rr-pills { display: flex; gap: 6px; }
.rr-pill { border: 1px solid var(--line); background: var(--white); border-radius: 999px; padding: 4px 12px; font-size: 12px; cursor: pointer; color: var(--ink-2); }
.rr-pill.on { background: var(--black); color: #fff; border-color: var(--black); }
.rr-shelves { display: flex; flex-direction: column; gap: 22px; margin-bottom: 24px; }
.rr-ctitle { font-weight: 700; font-size: 15px; padding-bottom: 6px; border-bottom: 2px solid var(--black); margin-bottom: 10px; }
.rr-ctitle a { color: inherit; text-decoration: none; }
.rr-ctitle a:hover { color: var(--red); }
.rr-code { background: var(--black); color: #fff; border-radius: 3px; padding: 1px 6px; font-size: 11px; margin-right: 8px; vertical-align: 2px; }
.rr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.rr-item { background: var(--white); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); content-visibility: auto; contain-intrinsic-size: auto 260px; }
.rr-item:hover { border-color: var(--red); }
.rr-thumb { display: flex; position: relative; align-items: center; justify-content: center; width: 100%; height: 220px; border: 0; padding: 0; background: #f6f3ec; cursor: zoom-in; }
.rr-thumb img { position: relative; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .15s; }
.rr-thumb img.on { opacity: 1; }
.rr-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #a39c8c; font-size: 12px; }
.rr-cap { display: flex; align-items: center; gap: 6px; padding: 7px 8px; font-size: 12px; font-weight: 600; }
.rr-cap > span:first-child { flex: 1; }
.rr-x { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 12px; padding: 2px 4px; }
.rr-x:hover { color: var(--red); }
.rr-links > summary { cursor: pointer; list-style: none; }
.rr-links > summary::-webkit-details-marker { display: none; }
.rr-link { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.bb-x { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 12px; padding: 2px 6px; border-radius: 4px; }
.bb-x:hover { color: #fff; background: var(--red); }
.bb-add { margin-top: 6px; }
.bb-section td { position: relative; }
.bb-addrow { margin-left: 12px; border: 0; background: none; color: var(--red); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; padding: 0 4px; text-transform: none; letter-spacing: 0; }
.bb-addrow:hover { text-decoration: underline; }
.bb-add { display: flex; gap: 6px; }
.modal-body > p.muted { white-space: pre-line; }

/* Merge/Purge builder (archive layout) */
.mp2-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 18px; margin-bottom: 12px; }
.mp2-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mp2-f > span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.mp2-wide { grid-column: 1 / -1; }
.mp2-pair { grid-column: span 2; }
@media (max-width: 700px) { .mp2-pair { grid-column: 1 / -1; } }
.mp2-pair-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mp2-sub { display: flex; flex-direction: column; gap: 4px; }
.mp2-sub em { font-style: normal; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.mp2-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.mp2-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; margin-top: 8px; padding: 10px 12px; background: var(--bg); border-radius: 8px; }
.mp2-pick { display: flex; align-items: center; gap: 8px; font-size: 12px; cursor: pointer; min-width: 0; }
.mp2-pick i { width: 11px; height: 10px; flex: 0 0 auto; border: 1px solid #9aa3b0; }
.mp2-pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp2-drop { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px dashed var(--line); border-radius: 10px; padding: 18px; color: var(--ink-3); cursor: pointer; background: var(--white); }
.mp2-drop:hover, .mp2-drop.on { border-color: var(--red); color: var(--red); background: var(--red-tint); }
.mp2-drop.has { border-style: solid; color: var(--ink); }
.mp2-actions { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.mp2-done { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.mp2-sheet { background: #fff; border: 1px solid #c2c9d4; border-radius: 6px; padding: 16px; }
.mp2-title { font-weight: 700; font-size: 15px; margin: 0 0 8px; }
.mp2-key { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; font-size: 11px; font-weight: 600; }
.mp2-key span { display: flex; align-items: center; gap: 7px; }
.mp2-key i { width: 11px; height: 10px; display: inline-block; border: 1px solid #9aa3b0; }
.mp2-scroll { overflow-x: auto; }
.mp2-sheet table { border-collapse: collapse; font-size: 11.5px; width: 100%; }
.mp2-sheet th { background: #000; color: #fff; font-weight: 600; text-align: left; padding: 6px 8px; vertical-align: bottom; }
.mp2-sheet td { padding: 5px 8px; border-bottom: 1px solid #e6eaf0; }
.mp2-sheet .mp2-gap { background: #fff; border: 0; width: 20px; min-width: 20px; padding: 0; }
.mp2-sheet th.mp2-ref { background: #f00; }
.mp2-sheet td.mp2-ref { background: #00f; color: #fff; }
.mp2-dim { color: #8a94a8; }
.mp2-notes { margin-top: 14px; font-size: 11px; line-height: 1.7; }
.mp2-notes div { padding: 0 3px; }

/* Blue Book, cleaner: one stats strip, light section bands, row controls on hover, repeated drop dates hidden */
.bb-stats { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.bb-stats .kpi { border: 0; border-radius: 0; box-shadow: none; padding: 12px 16px; border-left: 1px solid var(--line-2); }
.bb-stats .kpi:first-child { border-left: 0; }
.bb-stats .kpi strong { font-size: 19px; }
.bb-stats .kpi.neg strong { color: var(--red); }
@media (max-width: 900px) { .bb-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } .bb-stats .kpi:nth-child(5) { border-left: 0; } }
.ledger tr.bb-section td { background: var(--line-2) !important; color: var(--ink); font-size: 11px; letter-spacing: .06em; padding-top: 7px; padding-bottom: 7px; border-top: 1px solid var(--line); }
.ledger tr.bb-section.bare td { padding-top: 2px; padding-bottom: 2px; border-top: 0; background: transparent !important; }
.ledger tr.bb-section .bb-addrow { opacity: 0; transition: opacity .12s; }
.ledger tr.bb-section:hover .bb-addrow, .ledger tr.bb-section.bare .bb-addrow { opacity: 1; }
.ledger tr.bb-section.bare .bb-addrow { margin-left: 0; }
.ledger .bb-x, .ledger td.memo .muted { opacity: 0; transition: opacity .12s; }
.ledger tbody tr:hover .bb-x, .ledger tbody tr:hover td.memo .muted { opacity: 1; }
.ledger td.ditto { color: transparent; }
.ledger tbody tr:not(.bb-section):not(.total):not(.subtotal):hover td { background-color: #fafbfc; }
.bb-foot { margin-top: 8px; }

/* Blue Book: the archive's book — one line per campaign, opening to its ledger */
.bb-stats5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bb-toolbar { margin-bottom: 8px; }
.bb-secs { flex-wrap: wrap; margin-bottom: 14px; }
.bb-book { display: flex; flex-direction: column; gap: 6px; }
.bb-camp { background: var(--white); border: 1px solid var(--line); border-radius: 10px; }
.bb-camp.open { box-shadow: var(--shadow); }
.bb-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; min-width: 0; }
.bb-head:hover { background: var(--bg); border-radius: 10px; }
.bb-caret { color: var(--ink-3); width: 10px; flex: 0 0 auto; }
.bb-code { font-weight: 700; font-size: 12px; background: var(--black); color: #fff; border-radius: 4px; padding: 2px 7px; flex: 0 0 auto; }
.bb-ab { font-size: 10px; font-weight: 700; color: var(--red-dark); background: var(--red-tint); border-radius: 4px; padding: 2px 6px; flex: 0 0 auto; }
.bb-name { font-weight: 600; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-drop { font-size: 12px; color: var(--ink-2); flex: 0 0 auto; }
.bb-sec { font-size: 11px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; flex: 0 0 auto; }
.bb-sum { font-size: 12px; color: var(--ink-2); flex: 0 0 auto; white-space: nowrap; }
.bb-sum b { color: var(--ink); }
.bb-campmv { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; flex: 0 0 auto; }
.bb-head:hover .bb-campmv { opacity: 1; }
.bb-mv { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 12px; padding: 2px 4px; border-radius: 4px; }
.bb-mv:hover { background: var(--line-2); color: var(--ink); }
.bb-body:not(:empty) { padding: 0 10px 12px; }
.ledger td.bb-act { white-space: nowrap; text-align: right; }
.ledger .bb-act .bb-mv { opacity: 0; }
.ledger tbody tr:hover .bb-act .bb-mv { opacity: 1; }
.bb-chip { font-size: 9.5px; font-weight: 700; letter-spacing: .04em; background: var(--line-2); color: var(--ink-2); border-radius: 3px; padding: 1px 5px; margin-right: 4px; }
.bb-chip.dupe { background: #fff4d6; color: #8a5a00; }
.ledger tr.bb-blocktot td { color: var(--ink-3); font-style: italic; background: #fbfbfc !important; }
.ledger tr.bb-blockdupe td { color: var(--ink-3); text-decoration: line-through; text-decoration-color: #c3c7cd; }
.ledger tr.bb-blockdupe td.bb-act { text-decoration: none; }
.ledger tr.bb-panel-b td { border-top: 2px solid var(--red) !important; }
.bb-tag { display: inline-block; margin-left: 6px; font-family: var(--font); font-size: 10px; background: var(--red-tint); color: var(--red-dark); border-radius: 3px; padding: 0 5px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.bb-tip { font-style: normal; font-size: 9px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 50%; width: 12px; height: 12px; display: inline-flex; align-items: center; justify-content: center; margin-left: 3px; vertical-align: 1px; }
.ledger tr.bb-entry td { background: #fffdf5 !important; padding: 4px; }
.ledger tr.bb-entry .cell-input { width: 100%; min-width: 56px; font-size: 11.5px; }
.ledger tr.bb-entry .cell-input.num { text-align: right; }
.bb-plus { border: 0; background: var(--red); color: #fff; border-radius: 5px; width: 24px; height: 24px; cursor: pointer; font-size: 14px; }
@media (max-width: 1000px) { .bb-sec, .bb-drop { display: none; } }
.ledger tr.bb-entry .cell-input { min-width: 0; padding: 3px 5px; }
.ledger tr.bb-entry input[type=date] { width: 104px; font-size: 11px; }
.bb-body .ledger th, .bb-body .ledger td { padding-left: 5px; padding-right: 5px; }
.bb-body .ledger td.wide { min-width: 110px; max-width: 160px; }
.bb-body .ledger td.wide { min-width: 150px; max-width: 210px; }
.bb-body .ledger { font-size: 11.5px; }
.bb-body .ledger th { font-size: 10.5px; }
.bb-body .ledger th, .bb-body .ledger td { padding-left: 4px; padding-right: 4px; }
.bb-body .ledger td.wide { min-width: 135px; }
.bb-body .ledger td.bb-act { padding: 0 2px; }
.bb-body .ledger .bb-mv, .bb-body .ledger .bb-x { padding: 1px 2px; font-size: 11px; }
.bb-body:not(:empty) { padding: 0 6px 10px; }
.bb-body .ledger td.wide { min-width: 118px; }
.bb-body .ledger td.wide { min-width: 110px; }

/* Bid sheets: the archive's document, on the page */
.bs-controls { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; margin-bottom: 14px; }
.bs-ctl { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.bs-ctl select { min-width: 260px; max-width: 420px; }
.bd-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.bd-dls { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.bd-dl { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); background: var(--white); border-radius: 6px; padding: 6px 11px; font-size: 12.5px; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; cursor: pointer; }
.bd-dl:hover { border-color: var(--red); color: var(--red); }
.bd-dl small { font-weight: 400; color: var(--ink-3); }
.bd-dl.bd-off { opacity: .45; cursor: not-allowed; }
.bd-saved { font-size: 12px; color: var(--ink-3); font-style: italic; }
.bd-vendors { margin-top: 14px; }
.bd { border: 1px solid var(--bd-border); border-radius: 6px; background: var(--bd-page); color: var(--bd-value); box-shadow: var(--shadow); overflow: hidden; }
.bd.yal { --bd-page: #fff; --bd-header: #0b1f3f; --bd-header-t: #fff; --bd-section: #dce3ed; --bd-border: #b4bcc8; --bd-input: #fffff7; --bd-label: #333; --bd-value: #111; --bd-muted: #555; --bd-accent: #0b1f3f; --bd-font: Georgia, 'Times New Roman', serif; }
.bd.saltwind { --bd-page: #f3e9cf; --bd-header: #2a1c08; --bd-header-t: #f7ecc9; --bd-section: #e6d3a0; --bd-border: #8a6d24; --bd-input: #fffdf4; --bd-label: #2e2309; --bd-value: #160d02; --bd-muted: #4a3c1c; --bd-accent: #4a3712; --bd-font: Georgia, serif; }
.bd-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--bd-header); color: var(--bd-header-t); padding: 12px 18px; }
.bd-top h3 { font-family: var(--bd-font); font-size: 22px; margin: 0; font-weight: 400; letter-spacing: .06em; }
.bd-top span { font-family: var(--bd-font); font-size: 12px; opacity: .85; display: block; margin-top: 2px; }
.bd-logo { height: 64px; width: auto; max-width: 45%; object-fit: contain; flex: 0 0 auto; }
.bd-sec { display: flex; align-items: center; gap: 10px; background: var(--bd-section); color: var(--bd-accent); font-family: var(--bd-font); font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; padding: 7px 16px; border-top: 1px solid var(--bd-border); border-bottom: 1px solid var(--bd-border); font-weight: 600; }
.bd-hint { margin-left: auto; font-weight: 400; font-size: 10.5px; color: var(--bd-muted); text-transform: none; letter-spacing: 0; }
.bd-hint a { color: var(--bd-accent); }
.bd-grid { display: grid; grid-template-columns: 1fr 1fr; }
.bd-f { display: flex; align-items: center; gap: 8px; padding: 5px 16px; border-bottom: 1px solid var(--bd-border); min-width: 0; }
.bd-f.wide { grid-column: 1 / -1; }
.bd-f label { font-family: var(--bd-font); font-size: 12px; color: var(--bd-label); min-width: 140px; flex: 0 0 auto; }
.bd-f input, .bd-f select { flex: 1; min-width: 0; font-family: var(--bd-font); font-size: 12.5px; background: var(--bd-input); border: 1px solid var(--bd-border); border-radius: 2px; color: var(--bd-value); padding: 3px 6px; }
.bd-f .bd-cell { flex: 1; min-width: 0; }
.bd-cell { display: flex; flex-direction: column; gap: 2px; }
.bd-free { font-size: 11px !important; padding: 1px 4px !important; opacity: .85; }
.bd-free:placeholder-shown { opacity: .6; }
.bd-split { margin-left: 6px; display: inline-flex; gap: 3px; flex: 0 0 auto; }
.bd-split button, .bd-ctl button, .bd-add button { font-family: var(--bd-font); font-size: 11px; background: var(--bd-input); border: 1px solid var(--bd-border); border-radius: 2px; color: var(--bd-muted); padding: 1px 6px; cursor: pointer; }
.bd-split button:hover, .bd-ctl button:hover, .bd-add button:hover { color: var(--bd-accent); border-color: var(--bd-accent); }
.bd-billto { background: var(--bd-section); }
.bd-billto .bd-f label { font-weight: 700; }
.bd-addr { flex: 1; font-family: var(--bd-font); font-size: 12px; color: var(--bd-value); }
.bd-add { padding: 8px 16px; border-bottom: 1px solid var(--bd-border); font-family: var(--bd-font); font-size: 11.5px; color: var(--bd-muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bd-scroll { overflow-x: auto; }
.bd-matrix { width: 100%; border-collapse: collapse; font-family: var(--bd-font); font-size: 12px; min-width: 940px; table-layout: fixed; }
.bd-cmp { table-layout: auto; }
.bd-matrix th, .bd-matrix td { border: 1px solid var(--bd-border); padding: 4px 5px; vertical-align: middle; text-align: left; }
.bd-matrix thead th { background: var(--bd-section); color: var(--bd-accent); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; text-align: center; white-space: normal; line-height: 1.15; padding: 7px 4px; overflow-wrap: anywhere; }
.bd-matrix th.bd-vend { background: var(--bd-header); color: var(--bd-header-t); }
.bd-matrix th.bd-vend small { display: block; font-size: 9px; opacity: .8; text-transform: none; }
.bd-matrix .bd-rowh { background: var(--bd-section); color: var(--bd-accent); text-align: left; font-weight: 600; position: sticky; left: 0; z-index: 1; white-space: normal; }
.bd-matrix select, .bd-matrix input { width: 100%; min-width: 0; font-family: var(--bd-font); font-size: 11.5px; background: var(--bd-input); border: 1px solid var(--bd-border); border-radius: 2px; color: var(--bd-value); padding: 2px 4px; box-sizing: border-box; }
.bd-matrix select, .bd-matrix input.bd-free, .bd-matrix input.bd-num { height: 22px; }
.bd-matrix .bd-na { color: var(--bd-muted); text-align: center; font-style: italic; }
.bd-matrix tr.bd-svc .bd-na, .bd-matrix tr.bd-tot .bd-na { text-align: left; padding-left: 10px; font-style: normal; }
.bd-matrix tr.bd-sub .bd-na { text-align: right; font-style: normal; padding-right: 10px; }
.bd-matrix td.bd-blocked { background: var(--bd-header); opacity: .55; cursor: not-allowed; }
.bd-matrix tr.bd-svchead th { background: var(--bd-header); color: var(--bd-header-t); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; padding: 7px 10px; }
.bd-matrix tr.bd-strong th.bd-rowh, .bd-matrix tr.bd-strong td, .bd-matrix tr.bd-sub th.bd-rowh, .bd-tot .bd-rowh, .bd-tot .bd-ext-total, .bd-matrix tr.bd-sub .bd-ext-sub { font-weight: 700; }
.bd-svc .bd-rowh { font-weight: 400 !important; font-style: italic; }
.bd-price { text-align: right !important; color: var(--bd-muted); }
.bd-num { text-align: right; }
.bd-ext, .bd-ext-total, .bd-ext-sub { text-align: right; font-variant-numeric: tabular-nums; }
.bd-cname { display: block; line-height: 1.2; }
.bd-ctl { display: flex; gap: 4px; margin-top: 4px; }
.bd-other-in { display: flex; flex-direction: column; gap: 2px; padding: 3px 0; }
.bd-o { display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; }
.bd-o i { flex: 0 0 40%; font-style: normal; font-size: 10px; color: var(--bd-muted); line-height: 1.15; overflow-wrap: anywhere; }
.bd-o .bd-cell, .bd-o input, .bd-o select { flex: 1 1 auto; min-width: 0; }
.bd-matrix col.c-comp { width: 12%; } .bd-matrix col.c-pages { width: 8%; } .bd-matrix col.c-size { width: 10.5%; } .bd-matrix col.c-stock { width: 6.5%; }
.bd-matrix col.c-weight { width: 5%; } .bd-matrix col.c-ink { width: 8%; } .bd-matrix col.c-pers { width: 8%; } .bd-matrix col.c-other { width: 17.5%; }
.bd-matrix col.c-fold { width: 7%; } .bd-matrix col.c-money { width: 5.5%; } .bd-matrix col.c-qty { width: 6.5%; }
.bd-cmp th.bd-rowh { min-width: 190px; }
.bd-cmp th.bd-sub2 { font-size: 9.5px; font-weight: 400; }
.bd-cmp td, .bd-cmp th { white-space: nowrap; }
.bd-instr { display: block; width: 100%; box-sizing: border-box; font-family: var(--bd-font); font-size: 12.5px; line-height: 1.5; background: var(--bd-input); border: 0; border-top: 1px solid var(--bd-border); color: var(--bd-value); padding: 10px 16px; resize: vertical; }
body.bd-full .sidebar, body.bd-full .topbar, body.bd-full .page-head, body.bd-full .bs-controls { display: none !important; }
body.bd-full .main { margin: 0; padding: 10px; }
body.bd-full .shell { grid-template-columns: 0 1fr; }
body.bd-full .rail { display: none; }

/* Donors & Selects: Edit columns */
th.col-edit { width: 1%; white-space: nowrap; text-align: right; }
.col-edit-body { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-height: 60vh; }
.col-edit-body > div { overflow: auto; min-height: 0; }
.col-all { display: flex; flex-direction: column; gap: 4px; }
.col-picked { display: flex; flex-direction: column; gap: 4px; }
.col-row { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: var(--white); }
.col-row span { flex: 1; font-size: 13px; }
.col-row .bb-mv, .col-row .bb-x { opacity: 1; }
/* File and folder names: up to three lines, broken between words, never mid-word */
.tile .name, .mini-name { -webkit-line-clamp: 3; overflow-wrap: break-word; word-break: normal; hyphens: none; }
.tile .name.two { display: flex; flex-direction: column; -webkit-line-clamp: unset; }
.tile .name.two .name-code { font-weight: 700; font-size: 12px; letter-spacing: .01em; }
.tile .name.two .name-sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink-2); font-size: 12.5px; line-height: 1.3; overflow-wrap: break-word; }
.name-row { align-items: flex-start; }

/* Campaign page: emails behind a step, match words, invoice PDFs */
.task-mailbtn { border: 1px solid var(--line); background: var(--white); border-radius: 999px; padding: 0 8px; margin-left: 8px; font-size: 11px; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 3px; vertical-align: 1px; }
.task-mailbtn svg { width: 12px; height: 12px; }
.task-mailbtn:hover, .task-mailbtn.on { border-color: var(--red); color: var(--red); }
.task-mails { margin: -2px 0 6px 30px; border-left: 2px solid var(--red-tint); padding-left: 10px; display: flex; flex-direction: column; gap: 2px; }
.task-mail { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; align-items: baseline; padding: 4px 6px; border-radius: 6px; color: inherit; text-decoration: none; font-size: 12.5px; }
.task-mail:hover { background: var(--bg); }
.task-mail-subj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-terms { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.match-pill { display: inline-flex; align-items: center; gap: 4px; }
.match-pill button { border: 0; background: none; cursor: pointer; color: var(--ink-3); font-size: 10px; padding: 0 2px; }
.match-pill button:hover { color: var(--red); }
.cost-file { color: var(--red); font-weight: 600; }

/* Vendors: the archive's rolodex */
.vband { display: flex; align-items: baseline; gap: 10px; width: 100%; font-weight: 700; font-size: 15px; margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--black); background: none; border-top: 0; border-left: 0; border-right: 0; text-align: left; color: var(--ink); }
.vband-n { font-weight: 400; font-size: 12px; color: var(--ink-3); }
.vfold-h { cursor: pointer; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; align-items: start; }
.vcard { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vcard.k-do-not-use { border-color: #f1b8ba; background: #fffafa; }
.vcard-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.vcard-name { font-weight: 700; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.vcard-name:hover { color: var(--red); }
.vtag { font-size: 10.5px; font-weight: 600; background: var(--line-2); color: var(--ink-2); border-radius: 4px; padding: 1px 6px; }
.vtag.bad { background: var(--red-tint); color: var(--red-dark); }
.vtag.pot { background: #fff4d6; color: #8a5a00; }
.vcard-tools { margin-left: auto; display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.vcard:hover .vcard-tools { opacity: 1; }
.vcard-tools button { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 11.5px; padding: 1px 4px; border-radius: 4px; }
.vcard-tools button:hover { background: var(--line-2); color: var(--ink); }
.vcard-where { font-size: 11.5px; color: var(--ink-3); }
.vcard-meta { font-size: 12px; }
.vnote { height: 84px; overflow-y: auto; white-space: pre-wrap; font-size: 12.5px; line-height: 1.45; background: #fffdf2; border: 1px solid #eee3b8; border-radius: 6px; padding: 7px 9px; cursor: text; color: var(--ink); }
.vnote.empty { color: var(--ink-3); background: var(--bg); border-style: dashed; border-color: var(--line); height: auto; min-height: 32px; }
.vnote.editing { height: auto; cursor: default; padding: 6px; }
.vnote-area { width: 100%; min-height: 110px; box-sizing: border-box; font: inherit; border: 1px solid var(--line); border-radius: 5px; padding: 6px; resize: vertical; }
.vnote-act { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.vc { border-top: 1px solid var(--line-2); padding-top: 5px; }
.vc-main { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: 12.5px; }
.vc-name { font-weight: 600; }
.vc-email { color: var(--ink-2); overflow-wrap: anywhere; }
.vc-copy { cursor: pointer; color: var(--ink-3); font-size: 11px; }
.vc-copy:hover { color: var(--red); }
.vc-camps { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.vc-add { align-self: flex-start; border: 0; background: none; color: var(--ink-3); font-size: 11.5px; cursor: pointer; padding: 2px 0; }
.vc-add:hover { color: var(--red); }

/* Campaign Manager: aligned table columns, progress percentages */
.camp-table { table-layout: fixed; width: 100%; }
.camp-table td, .camp-table th { overflow: hidden; text-overflow: ellipsis; }
.camp-table .cell-link { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-cell { display: flex; align-items: center; gap: 8px; }
.progress-cell .progress { flex: 1; min-width: 40px; }
.pct { font-size: 12px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.card-foot { justify-content: space-between; align-items: center; gap: 8px; }
.card-pct { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.card-bar { width: 54px; height: 5px; border-radius: 3px; background: var(--line-2); overflow: hidden; display: inline-block; }
.card-bar i { display: block; height: 100%; background: var(--red); }
/* The billed entity's mark, nearly the height of the band, as in the archive */
.bd-top { min-height: 120px; }
.bd-logo { height: 110px; max-width: 54%; }

/* Archive: the asset library */
.ar-filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.ar-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ar-pname { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin-right: 4px; min-width: 76px; }
.ar-pills .rr-pill b { font-weight: 700; color: var(--ink-3); }
.ar-pills .rr-pill.on b { color: #fff; }
.ar-shelves { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ar-camp { background: var(--white); border: 1px solid var(--line); border-radius: 10px; }
.ar-camp.open { box-shadow: var(--shadow); }
.ar-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; min-width: 0; }
.ar-head:hover { background: var(--bg); border-radius: 10px; }
.ar-name-t { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-date { font-size: 12px; color: var(--ink-2); flex: 0 0 auto; }
.ar-count { margin-left: auto; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.ar-body:not(:empty) { padding: 0 14px 14px; }
.ar-group { margin-top: 10px; }
.ar-gtitle { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); margin-bottom: 6px; }
.ar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ar-item { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--white); content-visibility: auto; contain-intrinsic-size: auto 200px; }
.ar-item:hover { border-color: var(--red); }
.ar-thumb { display: flex; align-items: center; justify-content: center; width: 100%; height: 150px; border: 0; padding: 0; background: #f4f5f7; cursor: zoom-in; }
.ar-thumb img { width: 100%; height: 100%; object-fit: contain; }
.ar-ext { font-weight: 700; color: var(--ink-3); font-size: 13px; }
.ar-cap { display: flex; align-items: center; gap: 4px; padding: 5px 6px; font-size: 11.5px; }
.ar-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-ctl { display: flex; gap: 1px; flex: 0 0 auto; }
.ar-ctl button { border: 0; background: none; cursor: pointer; color: var(--ink-3); font-size: 12px; padding: 1px 3px; border-radius: 4px; }
.ar-ctl button:hover { background: var(--line-2); color: var(--ink); }
.ar-ctl button.on { color: #d9a400; }
.ar-add { border: 1.5px dashed var(--line); border-radius: 8px; background: none; color: var(--ink-3); font-size: 22px; cursor: pointer; min-height: 180px; }
.ar-add:hover { border-color: var(--red); color: var(--red); }
/* Every vendor block the same size; its contacts scroll inside */
.vgrid { align-items: stretch; }
.vcard { height: 340px; }
.vcard > .vcard-h, .vcard > .vcard-where, .vcard > .vcard-meta, .vcard > .vnote, .vcard > .vc-add { flex: 0 0 auto; }
.vcard > .vnote { height: 72px; }
.vcard > .vnote.empty { height: auto; }
.vcard > .vnote.editing { height: auto; max-height: 220px; overflow: auto; }
.vc-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; padding-right: 2px; }
.mp2-notes-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.mp2-notes-act { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.mp2-note { display: flex; align-items: center; gap: 4px; border-radius: 3px; }
.mp2-note-in { flex: 1; border: 1px solid transparent; background: transparent; font: inherit; font-size: 11.5px; padding: 2px 4px; border-radius: 3px; color: inherit; }
.mp2-note-in:hover, .mp2-note-in:focus { border-color: var(--line); background: rgba(255,255,255,.6); }
.mp2-note-in.bold { color: #c01010; font-weight: 700; }
.mp2-note .bb-x { opacity: 0; }
.mp2-note:hover .bb-x { opacity: 1; }
.bd-vpair { display: inline-flex; align-items: center; }
.bd-vx { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 11px; padding: 2px 4px; opacity: 0; }
.bd-vpair:hover .bd-vx { opacity: 1; }
.bd-vx:hover { color: var(--red); }
.bd-addv select { border: 1px dashed var(--line); background: var(--white); border-radius: 6px; padding: 6px 10px; font: inherit; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.mini-sec { display: block; font-size: 10.5px; }

/* ---------- Campaign Manager table: fits any width ----------
   Fixed widths per column (the same in every phase's table, so they line up); Campaign takes what's left and wraps
   code over name. Below 1280px Quantity drops, below 1050px Type too (both are on the campaign's page); a phone shows
   each campaign as a card. */
.camp-table { table-layout: fixed; width: 100%; min-width: 640px; }
.camp-table th, .camp-table td { overflow: visible; text-overflow: clip; }
.camp-table th { white-space: nowrap; }
.camp-table .c-camp { width: auto; }
.camp-table .c-phase { width: 162px; }
.camp-table .c-type { width: 124px; }
.camp-table .c-date { width: 138px; }
.camp-table .c-qty { width: 92px; }
.camp-table .c-next { width: 190px; }
.camp-table .c-prog { width: 112px; }
.camp-table .cell-link { display: block; white-space: normal; overflow: hidden; line-height: 1.3; }
.camp-table .cell-link strong { display: block; }
.camp-table .camp-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; }
.camp-table .pill-select { width: 100%; max-width: 150px; text-overflow: ellipsis; }
.camp-table .cell-input { width: 100%; min-width: 0; box-sizing: border-box; }
.camp-table .c-next { font-size: 12.5px; line-height: 1.35; }
@media (max-width: 1280px) { .camp-table .c-qty { display: none; } .camp-table .c-next { width: 160px; } }
@media (max-width: 1050px) { .camp-table .c-type { display: none; } .camp-table .c-next { width: 140px; } .camp-table .c-prog { width: 96px; } }
@media (max-width: 760px) {
  .group .table-wrap { overflow: visible; }
  .camp-table, .camp-table tbody { display: block; min-width: 0; }
  .camp-table thead { display: none; }
  .camp-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: center; }
  .camp-table tr:last-child { border-bottom: 0; }
  .camp-table td { display: block; width: auto !important; padding: 0; border: 0; }
  .camp-table .c-camp { grid-column: 1 / -1; }
  .camp-table .c-phase { grid-column: 1; }
  .camp-table .c-date { grid-column: 2; }
  .camp-table .c-date .cell-input { width: 150px; }
  .camp-table .c-next { grid-column: 1; color: var(--ink-2); }
  .camp-table .c-prog { grid-column: 2; width: 110px !important; }
  .camp-table .c-type, .camp-table .c-qty { display: none; }
  .camp-table .pill-select { max-width: 170px; }
}

/* ---------- phones: nothing spills sideways ---------- */
@media (max-width: 760px) {
  /* Bid sheet: the sheet itself scrolls sideways inside its frame (it's a document, laid out like the Excel). */
  .bd { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .bd-actions .bd-dl, .bd-vpair { white-space: normal; }
  .bd-dls { margin-left: 0; }
  .bd-addv select { max-width: 100%; }
  /* Blue Book: a campaign's heading wraps its totals under the name; the move arrows stay visible (no hover on touch). */
  .bb-head { flex-wrap: wrap; row-gap: 4px; }
  .bb-sum { white-space: normal; flex: 1 1 100%; }
  .bb-campmv { opacity: 1; }
  /* Long status pills wrap instead of running off the screen. */
  .pill { white-space: normal; height: auto; min-height: 22px; padding: 3px 9px; line-height: 1.3; }
}
