:root {
  --ink: #2b2b2b;
  --muted: #5a6269;
  --line: #dde1e4;
  --paper: #f6f7f7;
  --white: #fff;
  --navy: #0d1b2a;
  --navy2: #1b2a3c;
  --gold: #d4a843;
  --gold-soft: #f7eedb;
  --hero: #172536;
  --accent-ink: #8a6a24;
  --blue: #e8eef3;
  --sage: #e4ebe4;
  --success: #2f7d5a;
  --warning: #b7791f;
  --red: #b42318;
  --radius: 16px;
  --shadow: 0 16px 50px #0d1b2a1c;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Arial, Helvetica, sans-serif; color: var(--ink); background: var(--paper); font-size: 15px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; width: 194px; flex: none;
  background: var(--navy); color: #fff; display: flex; flex-direction: column; z-index: 30;
}
.logo { margin: 18px 13px 16px; background: #fff; border: 0; border-radius: 12px; padding: 10px 14px; display: grid; place-items: center; }
.logo img { width: 100%; max-width: 130px; display: block; }
.nav { flex: 1; overflow-y: auto; padding: 0 10px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: #e9edf2;
  padding: 10px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 700; text-align: left;
}
.nav-item .ico { width: 18px; text-align: center; opacity: .85; font-size: 12px; }
.nav-item:hover { background: #ffffff14; }
.nav-item.active { background: var(--gold); color: var(--navy); }
.nav-item .pill { margin-left: auto; font-size: 10px; background: #ffffff1f; padding: 2px 6px; border-radius: 99px; font-weight: 600; }
.blueprint-link { margin: 4px 10px 0; width: auto; border-top: 1px solid #ffffff1a; border-radius: 0; padding-top: 14px; }
.blueprint-link.active { border-radius: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 14px 18px 18px; font-size: 12px; }
.user-chip strong { display: block; font-size: 12.5px; }
.user-chip small { color: #c8ced6; }
.user-chip .dots { margin-left: auto; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: var(--navy); display: grid; place-items: center; font-weight: 700; font-size: 11px; flex: none; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center;
  padding: 0 30px; gap: 12px; position: sticky; top: 0; z-index: 20;
}
.page-title { font-size: 14.5px; font-weight: 700; }
.page-title span { font-size: 11px; color: var(--muted); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.bell { position: relative; border: 0; background: none; font-size: 14px; color: var(--muted); }
.bell .badge { position: absolute; top: -9px; right: -7px; background: var(--red); color: #fff; font-size: 9px; border-radius: 99px; padding: 1px 4px; font-weight: 700; }
.view-as { font-size: 9.5px; letter-spacing: .08em; color: var(--muted); display: flex; align-items: center; gap: 8px; font-weight: 700; }
.view-as[hidden] { display: none; }
.view-as select { font-size: 11.5px; font-weight: 700; color: var(--ink); padding: 6px 8px; min-width: 132px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.menu-btn { display: none; border: 0; background: none; font-size: 20px; }
main { padding: 34px 25px 40px; flex: 1; max-width: 1180px; width: 100%; outline: none; }
.footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 22px 25px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); }
.footer a { text-decoration: none; }

/* ---------- Typography & primitives ---------- */
.eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 8px; }
.h1 { font-size: 31px; font-weight: 400; letter-spacing: -.02em; margin-bottom: 10px; }
.h2 { font-size: 21px; font-weight: 400; letter-spacing: -.01em; }
.lede { color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 24px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px; }
.card + .card { margin-top: 0; }
.stack { display: grid; gap: 16px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.split { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(0,1fr); gap: 16px; }
/* Onboarding Document Center */
.dc-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.dc-section .module-row { box-shadow: none; border: 1px solid var(--line, #e7e7ea); }
.dc-section form.row-actions { flex-wrap: wrap; }
.dc-section input[type=file] { max-width: 100%; }
.dc-add > summary { list-style: none; display: inline-block; cursor: pointer; }
.dc-add > summary::-webkit-details-marker { display: none; }
@media (max-width: 860px) { .dc-grid { grid-template-columns: 1fr; } }
/* Employee profile */
.pf-head { display: grid; grid-template-columns: auto minmax(0,1fr) minmax(200px,260px); gap: 20px; align-items: center; margin-bottom: 16px; }
.pf-photo { border-radius: 50%; object-fit: cover; display: grid; place-items: center; flex: none; box-shadow: 0 0 0 4px #fff, 0 2px 10px rgba(0,0,0,.12); }
.pf-initials { background: var(--gold); color: var(--navy); font-weight: 700; }
.pf-title { font-weight: 600; margin: 4px 0 2px; }
.pf-actions { display: flex; flex-direction: column; gap: 8px; }
.pf-meter { margin-top: 4px; }
.pf-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.pf-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line, #e7e7ea); font-size: 14px; }
.pf-row:last-of-type { border-bottom: 0; }
.pf-row span { color: var(--muted, #6b7280); flex: none; }
.pf-row strong { text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.pf-contact { display: flex; flex-direction: column; padding: 9px 0; border-bottom: 1px solid var(--line, #e7e7ea); }
@media (max-width: 960px) { .pf-grid { grid-template-columns: 1fr; } .pf-head { grid-template-columns: auto minmax(0,1fr); } .pf-actions { grid-column: 1 / -1; } }
@media (max-width: 560px) { .pf-head { grid-template-columns: 1fr; justify-items: center; text-align: center; } .pf-head .pf-photo { width: 96px !important; height: 96px !important; } }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 9px 14px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.btn:hover { border-color: #b9c0c6; }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 6px 18px #0d1b2a33; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn.danger { color: var(--red); }
.btn.link { border: 0; background: none; padding: 0; text-decoration: none; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.big-btn { padding: 12px 14px; font-size: 14px; }
.tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--blue); color: var(--navy); letter-spacing: .02em; }
.tag.gold { background: var(--gold-soft); color: var(--accent-ink); }
.tag.green { background: #e3f1ea; color: var(--success); }
.tag.red { background: #fbe7e5; color: var(--red); }
.tag.amber { background: #fbf0dc; color: var(--warning); }
.tag.grey { background: #eef0f2; color: var(--muted); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 13px; font-size: 11.5px; font-weight: 600; }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip .count { margin-left: 6px; opacity: .65; }
.bar { height: 6px; border-radius: 99px; background: #e7e9eb; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--gold); border-radius: inherit; }
.banner { display: flex; gap: 12px; align-items: flex-start; background: var(--gold-soft); border: 1px solid #ecd9ad; border-radius: 12px; padding: 14px 16px; font-size: 13px; margin-bottom: 20px; }
.banner.blue { background: var(--blue); border-color: #d3dde6; }
.banner strong { display: block; margin-bottom: 2px; }
.icon-box { width: 34px; height: 34px; border-radius: 10px; background: var(--blue); display: grid; place-items: center; flex: none; font-size: 14px; }
.field { display: grid; gap: 6px; font-size: 12.5px; font-weight: 700; }
.field input, .field select, .field textarea { font-weight: 400; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: #fff; }
.field textarea { min-height: 84px; resize: vertical; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 10px; letter-spacing: .1em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.person strong { display: block; }
.person small { color: var(--muted); font-size: 11px; }
.mini-bar { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.mini-bar .bar { flex: 1; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

/* ---------- Dashboard ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 30px 30px 26px; color: #fff;
  background: radial-gradient(circle at 80% 20%, #2a3b52, transparent 50%), linear-gradient(135deg, var(--hero), var(--navy));
  margin-bottom: 14px; min-height: 255px;
}
.hero .due { background: var(--gold-soft); color: var(--navy); font-size: 10.5px; font-weight: 700; padding: 5px 10px; border-radius: 99px; display: inline-block; margin-bottom: 18px; }
.hero h2 { font-size: 22px; font-weight: 400; max-width: 340px; line-height: 1.45; margin-bottom: 14px; }
.hero p { max-width: 330px; font-size: 13.5px; color: #e3e7ec; }
.hero .progress { max-width: 330px; margin-top: 30px; }
.hero .bar { background: #ffffff38; }
.hero .meta { display: flex; gap: 22px; font-size: 10.5px; font-weight: 700; margin-top: 10px; }
.shield {
  position: absolute; right: 30px; top: 34px; width: 150px; height: 175px; border: 1px solid #d4a84399;
  border-radius: 46% 46% 50% 50% / 38% 38% 62% 62%; transform: rotate(-10deg);
  background: radial-gradient(circle at 40% 18%, #6d6a4f99, transparent 55%), #ffffff0d;
  display: grid; place-content: center; text-align: center;
}
.shield b { font-size: 46px; letter-spacing: -.03em; }
.shield small { font-size: 10px; letter-spacing: .18em; font-weight: 700; transform: rotate(6deg); }
.stat { display: flex; gap: 12px; padding: 16px 18px; }
.stat .s-ico { font-size: 11px; padding-top: 4px; }
.stat b { font-size: 19px; display: block; }
.stat small { font-size: 10.5px; color: var(--muted); }
.path { list-style: none; padding: 0; margin: 0; }
.path li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.path li:last-child { border-bottom: 0; }
.step { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: #eef0f2; color: var(--muted); flex: none; }
.step.done { background: var(--success); color: #fff; }
.step.now { background: var(--gold); color: var(--navy); }
.path .state { margin-left: auto; font-size: 11px; color: var(--muted); }
.announce { padding: 12px 0; border-bottom: 1px solid var(--line); }
.announce:last-of-type { border-bottom: 0; }
.announce h4 { font-size: 13.5px; margin: 6px 0 4px; }
.announce p { font-size: 12.5px; color: var(--muted); }
.announce small { display: block; margin-top: 6px; font-size: 11px; color: var(--muted); }

/* ---------- Onboarding ---------- */
.ring { --p: 38; width: 92px; height: 92px; border-radius: 50%; background: conic-gradient(var(--gold) calc(var(--p) * 1%), #e7e9eb 0); display: grid; place-items: center; flex: none; }
.ring > div { width: 72px; height: 72px; border-radius: 50%; background: #fff; display: grid; place-content: center; text-align: center; }
.ring b { font-size: 19px; }
.ring small { font-size: 10px; color: var(--muted); }
.module-row { display: flex; align-items: center; gap: 14px; padding: 16px 20px; }
.module-row h3 { font-size: 15px; font-weight: 700; }
.module-row p { font-size: 12.5px; color: var(--muted); }
.module-row .btn { margin-left: auto; }

/* ---------- Learning ---------- */
.course-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: box-shadow .15s; }
.course-card:hover { box-shadow: var(--shadow); }
.course-top { display: flex; justify-content: space-between; align-items: center; }
.hills { height: 92px; border-radius: 10px; background: #e9efe9; position: relative; overflow: hidden; }
.hills::before, .hills::after { content: ""; position: absolute; border-radius: 50%; }
.hills::before { width: 120%; height: 120%; left: -40%; top: 45%; background: #a9c0a9; }
.hills::after { width: 110%; height: 110%; left: 25%; top: 55%; background: #46684e; }
.hills i { position: absolute; width: 90%; height: 90%; left: -10%; top: 72%; background: #6e8d73; border-radius: 50%; z-index: 1; }
.course-card h3 { font-size: 15px; font-weight: 400; }

/* ---------- Video series ---------- */
.v-hero { background: linear-gradient(135deg, var(--hero), var(--navy)); color: #fff; border-radius: 22px; padding: 28px; margin-bottom: 16px; }
.v-hero .eyebrow { color: var(--gold); }
.v-hero .h1 { font-size: 28px; }
.v-hero p { color: #d7dde4; max-width: 620px; font-size: 14px; }
.v-hero .actions { display: flex; gap: 10px; margin: 20px 0 22px; flex-wrap: wrap; }
.v-hero .btn:not(.gold) { background: transparent; color: #fff; border-color: #ffffff4d; }
.v-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.v-stats div { background: #ffffff10; border-radius: 12px; padding: 12px 14px; }
.v-stats b { font-size: 20px; display: block; }
.v-stats small { color: #c8ced6; font-size: 11px; }
.phase { display: flex; flex-direction: column; gap: 4px; }
.phase small { font-size: 10px; letter-spacing: .1em; font-weight: 700; color: var(--accent-ink); }
.video-card { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.video-card .thumb { height: 110px; border-radius: 10px; background: linear-gradient(135deg, #24364c, var(--navy)); color: #fff; position: relative; display: grid; place-items: center; font-size: 22px; }
.video-card .thumb span { position: absolute; font-size: 10.5px; font-weight: 700; background: #00000059; padding: 3px 7px; border-radius: 6px; }
.video-card .thumb .id { left: 10px; top: 10px; }
.video-card .thumb .dur { right: 10px; bottom: 10px; }
.video-card .thumb.ready { background: linear-gradient(135deg, var(--accent-ink), var(--navy)); color: var(--gold); }
.video-card h3 { font-size: 14.5px; }
.video-card p { font-size: 12.5px; color: var(--muted); flex: 1; }
.video-card .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.video-card .basis { font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; }
.controls-list { columns: 2; padding-left: 18px; font-size: 13px; margin: 10px 0 0; }
.controls-list li { margin-bottom: 6px; }

/* ---------- Time off / calendar ---------- */
.balance { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.balance b { font-size: 16px; }
.cal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-head .month { font-size: 17px; min-width: 130px; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.cal .dow { font-size: 10.5px; font-weight: 700; color: var(--muted); padding: 8px; background: var(--paper); border-bottom: 1px solid var(--line); }
.cal .day { height: 112px; min-width: 0; overflow: hidden; display: flex; flex-direction: column; gap: 3px; padding: 5px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 11.5px; }
.cal .day-num { align-self: flex-start; border: 0; background: none; font: inherit; font-weight: 600; padding: 1px 6px; border-radius: 999px; cursor: pointer; color: inherit; }
.cal .day-num:hover { background: var(--paper); }
.cal .day.today .day-num { background: var(--navy, #1f2a44); color: #fff; }
.cal .day .ev { margin-top: 0; flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .ev-more { align-self: flex-start; border: 0; background: none; padding: 0 4px; font-size: 10.5px; font-weight: 700; color: var(--muted); cursor: pointer; }
.cal .ev-more:hover { text-decoration: underline; color: inherit; }
.cal .more-sm { display: none; }
.cal-day-item { display: grid; grid-template-columns: 10px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cal-day-item .ev { width: 10px; height: 10px; padding: 0; margin: 0; border-radius: 50%; display: block; }
.cal .day:nth-child(7n) { border-right: 0; }
.cal .day.out { color: #aab0b6; background: #fafbfb; }
.cal .ev { display: block; margin-top: 4px; font-size: 10.5px; padding: 3px 5px; border-radius: 5px; background: var(--blue); line-height: 1.25; }
.cal .ev.ooo { background: var(--gold-soft); }
.cal .ev.leave { background: #e3f1ea; }
.cal .ev.meeting { background: #e6eefc; }
.cal .ev.pending { background: var(--gold-soft); border: 1px dashed currentColor; }
.cal .ev.due, .cal .ev.assigned { background: var(--blue); }
.cal .ev.overdue { background: #fbe7e5; }
.cal .ev.done { background: #e3f1ea; text-decoration: line-through; }
.cal .ev.announcement { background: var(--gold-soft); }
.cal .ev[data-go] { cursor: pointer; }
.cal .ev.holiday { background: #fde2e2; font-weight: 600; }
.cal .ev.observance { background: #f1ecfb; }
.cal .ev.company { background: #fde2e2; border: 1px solid #e3a3a3; font-weight: 600; }

/* ---------- Assistant ---------- */
.chat { display: flex; flex-direction: column; min-height: 460px; padding: 0; overflow: hidden; }
.chat-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.chat-head img { width: 64px; border-radius: 6px; }
.chat-log { flex: 1; padding: 18px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; max-height: 460px; }
.msg { max-width: 82%; padding: 11px 14px; border-radius: 14px; font-size: 13.5px; }
.msg.bot { background: var(--paper); border: 1px solid var(--line); }
.msg.bot b { display: block; font-size: 11px; color: var(--accent-ink); margin-bottom: 4px; }
.msg.user { align-self: flex-end; background: var(--navy); color: #fff; }
.msg .cite { display: inline-block; margin-top: 8px; font-size: 11px; background: var(--gold-soft); border-radius: 6px; padding: 2px 7px; }
.chat-form { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.ai-msg { max-width: 94%; }
.ai-part { padding: 8px 0; border-top: 1px solid var(--line); }
.ai-part:first-of-type { border-top: 0; padding-top: 0; }
.ai-part strong { display: block; font-size: 12px; color: var(--navy); }
.ai-part p { margin: 3px 0 2px; white-space: pre-line; }
.ai-text p { white-space: normal; }
.ai-text ul { margin: 4px 0; padding-left: 18px; }
.ai-text strong { display: inline; font-size: inherit; color: inherit; }
.ai-hint { padding: 0 18px 10px; margin: 0; font-size: 11.5px; color: var(--muted); }
.ai-failed { border-color: var(--red); }
.ai-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); flex-direction: unset; }
.ai-main { display: flex; flex-direction: column; min-width: 0; }
.ai-side { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-right: 1px solid var(--line); min-width: 0; }
.ai-side input { border: 1px solid var(--line); border-radius: 8px; padding: 8px; width: 100%; box-sizing: border-box; }
.ai-list { display: flex; flex-direction: column; gap: 2px; flex: 1; max-height: 520px; overflow-y: auto; }
.ai-item { border-radius: 8px; padding: 2px 4px; }
.ai-item.active { background: var(--gold-soft); }
.ai-open { display: block; width: 100%; border: 0; background: none; text-align: left; padding: 6px; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; color: inherit; }
.ai-open small { display: block; color: var(--muted); font-size: 11px; }
@media (max-width: 760px) { .ai-layout { grid-template-columns: 1fr; } .ai-side { border-right: 0; border-bottom: 1px solid var(--line); } .ai-list { max-height: 180px; } }
.ai-conn { border-top: 1px solid var(--line); padding-top: 12px; }
.ai-conn[hidden] { display: none; }
.chat-form textarea { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 10px; resize: vertical; min-height: 44px; font: inherit; }
.samples { padding: 0 18px 16px; }
.samples small { display: block; font-size: 10px; letter-spacing: .1em; font-weight: 700; color: var(--muted); margin-bottom: 8px; }

/* ---------- Docs / policies / resources ---------- */
.doc-card { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.doc-card h3 { font-size: 14.5px; }
.doc-card p { font-size: 12.5px; color: var(--muted); }
.doc-meta { display: flex; gap: 6px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-top: auto; }
.doc-meta span:not(:last-child)::after { content: " ·"; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input, .toolbar select { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: #fff; }
.toolbar input { flex: 1; min-width: 200px; }
/* Long option names (course and request titles) must not push the page wider than a phone screen. */
main select { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
main .field, main .form-grid > * { min-width: 0; }
.split > * { min-width: 0; }
.res-card { display: flex; gap: 12px; padding: 16px; text-align: left; }
.res-card h3 { font-size: 14.5px; margin-bottom: 4px; }
.res-card p { font-size: 12.5px; color: var(--muted); }
.res-card small { display: block; margin-top: 8px; font-size: 11px; font-weight: 700; color: var(--accent-ink); }

/* ---------- Blueprint ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab { border: 0; background: none; padding: 10px 14px; font-weight: 700; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.active { color: var(--navy); border-color: var(--gold); }
.flow { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 10px; }
.flow .card { padding: 14px; }
.flow b { color: var(--gold); font-size: 12px; }
.flow h4 { font-size: 14px; margin: 4px 0; }
.flow p { font-size: 12px; color: var(--muted); }
.checks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.checks li { font-size: 13px; padding: 10px 12px; background: var(--paper); border-radius: 8px; }
.seq { display: flex; gap: 8px; flex-wrap: wrap; }
.seq span { font-size: 12.5px; background: var(--paper); border-radius: 99px; padding: 6px 12px; }
.seq b { color: var(--accent-ink); margin-right: 4px; }

/* ---------- HR ---------- */
.kpi b { font-size: 26px; display: block; }
.kpi small { color: var(--muted); font-size: 11.5px; }
.kpi .tag { margin-bottom: 8px; }
.queue-item { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.queue-item:last-child { border-bottom: 0; }
.track-row { display: grid; grid-template-columns: 1fr 120px 40px; gap: 10px; align-items: center; font-size: 13px; padding: 8px 0; }
.audit-row { display: grid; grid-template-columns: minmax(0, 80px) minmax(0, 170px) minmax(0, 140px) minmax(0, 1fr) 20px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.audit-row code { font-size: 11px; background: var(--blue); padding: 3px 6px; border-radius: 5px; }
.audit-row > * { min-width: 0; overflow-wrap: anywhere; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.editor-tools { display: flex; gap: 6px; padding: 6px; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; font-size: 12px; background: var(--paper); }
.editor { border: 1px solid var(--line); border-radius: 0 0 8px 8px; padding: 12px; min-height: 120px; font-size: 13.5px; }

/* ---------- Modal / toast ---------- */
.modal { position: fixed; inset: 0; background: #0d1b2a80; display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 18px; padding: 26px; max-width: 560px; width: 100%; max-height: 85vh; overflow-y: auto; position: relative; }
.modal-close { position: absolute; right: 14px; top: 10px; border: 0; background: none; font-size: 24px; color: var(--muted); }
.doc-page { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 22px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.doc-page .line { height: 8px; background: #e2e5e8; border-radius: 4px; margin: 9px 0; }
.modal-card.wide { max-width: 960px; }
.viewer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding-right: 24px; margin-bottom: 14px; }
.cfg-section input[type="file"] { max-width: 100%; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 8px; }
.theme-card { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; font-size: 13px; cursor: pointer; }
.theme-card:has(input:checked) { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.theme-sample { display: flex; height: 46px; border-radius: 6px; overflow: hidden; align-items: center; gap: 8px; }
.theme-sample i { width: 28%; height: 100%; }
.theme-sample b { padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.doc-viewer { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; background: #3a4048; }
.dv-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 8px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.dv-title { font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 200px; }
.dv-tools, .dv-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dv-tools { gap: 8px 14px; }
.dv-tools .btn { padding: 7px 11px; min-width: 38px; min-height: 38px; }
.dv-page, .dv-zoom { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dv-page input { width: 52px; padding: 6px; text-align: center; border: 1px solid var(--line); border-radius: 6px; }
.dv-zoom { min-width: 42px; text-align: center; }
.dv-scroll { flex: 1; min-height: 0; overflow: auto; scrollbar-gutter: stable; position: relative; touch-action: pan-x pan-y pinch-zoom; -webkit-overflow-scrolling: touch; }
.dv-pages { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px; width: max-content; min-width: 100%; box-sizing: border-box; }
.dv-sheet { background: #fff; flex: none; box-shadow: 0 1px 6px #0006; }
.dv-sheet canvas { display: block; width: 100%; height: 100%; }
.dv-status { color: #fff; text-align: center; padding: 48px 16px; margin: 0; }
body.dv-open { overflow: hidden; }
@media print { body.dv-open > * { display: none !important; } }
.pdf-frame { width: 100%; height: 68vh; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.welcome-video { width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; background: #000; display: block; }
.welcome-card { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; margin-bottom: 14px; padding: 16px 20px; }
.welcome-card:hover { box-shadow: var(--shadow); }
.welcome-card .play { width: 56px; height: 56px; border-radius: 50%; background: var(--navy) center 15% / cover; color: #fff; display: grid; place-items: center; flex: none; position: relative; }
.welcome-card .play i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: var(--navy); font-size: 9px; display: grid; place-items: center; position: absolute; right: 2px; bottom: 2px; }
.ceo-card { display: flex; gap: 24px; align-items: center; }
.home-intro { display: flex; gap: 20px; align-items: center; margin-bottom: 16px; }
.home-intro img { width: 84px; height: 84px; object-fit: contain; flex: none; }
.home-block { margin-bottom: 16px; }
.ceo-card img { width: 180px; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; border-radius: 14px; flex: none; }
.ceo-card blockquote { margin: 0 0 12px; font-size: 16px; line-height: 1.6; }
@media (max-width: 760px) { .home-intro { flex-direction: column; align-items: flex-start; } .ceo-card { flex-direction: column; align-items: flex-start; } .ceo-card img { width: 140px; } }
.msg .cite { border: 0; cursor: pointer; color: var(--navy); text-align: left; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 13px; z-index: 110; box-shadow: var(--shadow); }
.toast[hidden] { display: none; }
.scrim { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .split { grid-template-columns: 1fr; }
  .flow { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); transition: transform .2s; width: 240px; }
  .sidebar.open { transform: none; }
  .scrim.show { display: block; position: fixed; inset: 0; background: #0d1b2a66; z-index: 25; }
  .menu-btn { display: block; }
  .topbar { padding: 0 16px; }
  .view-as { font-size: 0; }
  .view-as select { min-width: 0; }
  main { padding: 24px 16px 32px; }
  .footer { padding: 18px 16px; }
  .g2, .g3, .flow, .checks { grid-template-columns: 1fr; }
  .shield { display: none; }
  .v-stats { grid-template-columns: repeat(2, 1fr); }
  .controls-list { columns: 1; }
  .audit-row { grid-template-columns: 1fr; gap: 4px; }
  .cal .day { height: 84px; padding: 4px; font-size: 10px; }
  .cal .ev { font-size: 9px; padding: 2px 3px; }
  .cal .day .ev-3, .cal .more-lg { display: none; }
  .cal .more-sm { display: block; }
  .h1 { font-size: 26px; }
}

/* ---------- Production additions ---------- */
body.booting .shell { visibility: hidden; }
body.signed-out .sidebar, body.signed-out .topbar, body.signed-out .footer, body.signed-out .scrim { display: none; }
body.signed-out main { max-width: none; padding: 0; }
.gate { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.gate .card { max-width: 440px; width: 100%; text-align: center; padding: 32px 28px; }
.gate img { width: 120px; margin: 0 auto 18px; display: block; }
.gate .btn { display: flex; width: 100%; justify-content: center; margin-top: 18px; text-decoration: none; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.inline-select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: inherit; font-size: 13px; }
.copy-box { display: flex; gap: 8px; margin-top: 10px; }
.copy-box input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 12px; }
.notif { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; font: inherit; }
.notif.unread h4::before { content: '● '; color: var(--gold); }
.notif h4 { font-size: 14px; margin-bottom: 2px; }
.health { display: flex; align-items: center; gap: 8px; }
.health i { width: 10px; height: 10px; border-radius: 50%; background: var(--red); display: inline-block; }
.health i.ok { background: #2e8b57; }
.dots { text-decoration: none; color: inherit; }
.check-list { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.check-list label { display: flex; gap: 8px; padding: 4px 0; font-size: 13px; }
.profile-btn { border: 0; background: none; padding: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; display: flex; flex-direction: column; min-width: 0; }
.profile-btn strong, .profile-btn small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-bar { background: var(--gold-soft); border-bottom: 1px solid var(--gold); padding: 10px 25px; font-size: 13px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.preview-bar[hidden] { display: none; }
.nav-group > .nav-item::after { content: '▾'; margin-left: auto; font-size: 10px; }
.nav-group.open > .nav-item::after { content: '▴'; }
.nav-sub { display: none; padding-left: 18px; }
.nav-group.open .nav-sub { display: block; }
.yt-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: #000; margin: 14px 0; }
.thumb.yt { background-size: cover; background-position: center; }
.md h2 { font-size: 20px; margin: 18px 0 8px; } .md h3 { font-size: 16px; margin: 14px 0 6px; } .md p { margin: 0 0 10px; line-height: 1.6; } .md ul { margin: 0 0 10px 20px; }
.section-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.cfg-section[hidden] { display: none; }
.lesson-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lesson-row:last-child { border-bottom: 0; }
.quiz-q { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.quiz-q label { display: flex; gap: 8px; padding: 4px 0; font-size: 14px; }
.progress-line { height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.progress-line i { display: block; height: 100%; background: var(--gold); width: 0; transition: width .2s; }
.folder-head { margin: 18px 0 8px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; font-size: 13px; }
textarea.code { font-family: Consolas, monospace; font-size: 12px; }

/* ---------- Platform Studio ---------- */
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; display: contents; }
fieldset.plain[disabled] { display: block; opacity: .7; }
.dnd-list { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 6px; }
.dnd-item { display: grid; grid-template-columns: 22px minmax(140px, 1fr) minmax(140px, 1.2fr) auto auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.dnd-item.dragging { opacity: .45; border-style: dashed; }
.dnd-handle { cursor: grab; color: #8a94a3; font-weight: 700; letter-spacing: -2px; user-select: none; }
.dnd-name { font-weight: 600; font-size: 14px; display: flex; flex-direction: column; }
.dnd-name small { font-weight: 400; color: #6b7685; font-size: 11px; }
.dnd-check { white-space: nowrap; }
.dnd-move { display: flex; gap: 2px; }
.dnd-move .btn { padding: 2px 6px; }
@media (max-width: 720px) {
  .dnd-item { grid-template-columns: 22px 1fr auto; }
  .dnd-item .inline-select { grid-column: 2 / -1; }
}
.cfg-bar { margin-top: 12px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.cfg-bar[hidden] { display: none; }
.dnd-item.dnd-short { grid-template-columns: 22px 1fr auto; }
.dnd-list[hidden] { display: none; }
/* Narrow screens: keep the top bar inside the screen when both Preview as and Organization are shown. */
@media (max-width: 700px) {
  .topbar { gap: 8px; }
  .page-title { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-right { gap: 6px; min-width: 0; }
  .view-as select { max-width: 110px; }
  #feedbackBtn { padding: 6px 4px; }
}
@media (max-width: 480px) {
  #feedbackBtn { font-size: 0; }
  #feedbackBtn::before { content: '✎'; font-size: 15px; }
  .view-as select { max-width: 92px; }
  .top-right { gap: 4px; }
}

/* Header time-clock shortcut */
.clock-sc { position: relative; display: inline-flex; }
.clock-sc-btn { white-space: nowrap; font-weight: 600; }
.clock-sc-btn.green { color: #067647; }
.clock-sc-btn.amber { color: #b54708; }
.clock-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 320px; max-width: calc(100vw - 24px); z-index: 60; padding: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.15); text-align: left; }
@media (max-width: 640px) {
  .clock-pop { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; }
  #clockScLabel { display: none; }
}

/* ---------- Ask AI dock (floating shortcut to the AI Assistant and Agents) ---------- */
#aiDock { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 70; }
#aiDock[hidden] { display: none; }
#aiFab { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 18px; background: var(--navy); color: #fff; box-shadow: var(--shadow); cursor: pointer; font: inherit; font-weight: 700; }
#aiFab span { color: var(--gold); font-size: 18px; line-height: 1; }
#aiFab[hidden] { display: none; }
#aiFab:hover, #aiFab:focus-visible { background: var(--navy2); outline: 2px solid var(--gold); outline-offset: 2px; }
#aiDock.aip-closed #aiFab { padding: 10px 12px; opacity: .85; }
#aiDock.aip-closed #aiFab b { display: none; }
#aiPanel { width: min(420px, calc(100vw - 32px)); height: min(620px, calc(100vh - 110px)); display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
#aiPanel[hidden] { display: none; }
.aip-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--navy); color: #fff; }
.aip-head img { width: 28px; height: 28px; object-fit: contain; background: #fff; border-radius: 6px; }
.aip-head img[src=""] { display: none; }
.aip-head div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.aip-head small { color: #ffffffb3; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aip-ctl { display: flex; gap: 4px; }
.aip-ctl button { background: transparent; color: #fff; border: 1px solid #ffffff40; border-radius: 8px; width: 32px; height: 32px; cursor: pointer; font-size: 14px; }
.aip-ctl button:hover, .aip-ctl button:focus-visible { background: #ffffff1f; outline: none; }
.aip-tabs { display: flex; gap: 6px; padding: 8px 12px 0; }
.aip-tabs:empty { display: none; }
.aip-tabs button { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: 13px; }
.aip-tabs button.on { background: var(--gold-soft); border-color: var(--gold); color: var(--accent-ink); font-weight: 700; }
.aip-body { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 8px 12px 10px; gap: 8px; }
.aip-log { flex: 1; overflow-y: auto; min-height: 0; }
.aip-log .msg { max-width: 100%; }
.aip-form { display: flex; gap: 8px; align-items: flex-end; }
.aip-form textarea { flex: 1; resize: none; }
.aip-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
@media (max-width: 640px) {
  #aiFab b { display: none; }
  #aiFab { padding: 12px 14px; }
  #aiDock:has(#aiPanel:not([hidden])) { left: 0; right: 0; bottom: 0; }
  #aiPanel { width: 100vw; height: 78vh; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom); }
}
@media print { #aiDock { display: none; } }

/* ---------- Team Connect ---------- */
.cx { display: grid; grid-template-columns: 250px minmax(0, 1fr); height: calc(100vh - 120px); min-height: 460px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: relative; }
.cx.cx-with-thread { grid-template-columns: 250px minmax(0, 1fr) minmax(260px, 340px); }
.cx-side { background: var(--paper); border-right: 1px solid var(--line); overflow-y: auto; padding: 10px 8px; display: flex; flex-direction: column; gap: 6px; }
.cx-search input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--white); }
.cx-sec { display: flex; flex-direction: column; }
.cx-sech { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 6px 4px; }
details.cx-sec > summary { cursor: pointer; }
.cx-add { border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.cx-add:hover { background: var(--line); color: var(--ink); }
.cx-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 8px; color: var(--ink); }
.cx-item:hover { background: var(--line); }
.cx-item.on { background: var(--navy); color: #fff; }
.cx-item.on .muted { color: #cfd6de; }
.cx-item.unread .cx-nm { font-weight: 700; }
.cx-ic { width: 16px; text-align: center; flex: none; opacity: .75; font-size: 13px; }
.cx-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }
.cx-none { padding: 2px 8px; }
.cx-foot { margin-top: auto; padding: 8px 6px 2px; }
.cx-main, .cx-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.cx-thread { border-left: 1px solid var(--line); background: var(--white); }
.cx-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); min-height: 58px; }
.cx-head > div:not(.cx-hacts), .cx-title { display: flex; flex-direction: column; min-width: 0; }
.cx-title strong, .cx-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-sp { flex: 1; }
.cx-hacts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cx-hacts .btn { padding: 6px 10px; }
.cx-back { display: none; font-size: 22px; padding: 0 6px; }
.cx-list { flex: 1; overflow-y: auto; padding: 10px 6px 10px 14px; min-height: 0; }
.cx-empty { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; padding: 48px 16px; }
.cx-day { display: flex; align-items: center; gap: 10px; margin: 12px 0 6px; font-size: 12px; color: var(--muted); }
.cx-day::before, .cx-day::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.cx-msg { position: relative; display: flex; gap: 10px; padding: 6px 8px; border-radius: 10px; }
.cx-msg:hover { background: var(--paper); }
.cx-msg.cx-ann { background: var(--gold-soft); border-left: 3px solid var(--gold); }
.cx-av { width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.cx-b { min-width: 0; flex: 1; }
.cx-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cx-h time { font-size: 12px; color: var(--muted); }
.cx-t { overflow-wrap: anywhere; margin-top: 2px; }
.cx-t a { color: var(--accent-ink); }
.cx-mention { background: var(--gold-soft); color: var(--accent-ink); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.cx-files, .cx-reacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cx-file { border: 1px solid var(--line); background: var(--white); border-radius: 8px; padding: 6px 10px; font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-react { border: 1px solid var(--line); background: var(--white); border-radius: 999px; padding: 1px 8px; font-size: 13px; }
.cx-react.on { border-color: var(--gold); background: var(--gold-soft); }
.cx-pick { display: inline-flex; gap: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); padding: 1px 4px; box-shadow: var(--shadow); }
.cx-pick button { border: 0; background: none; font-size: 16px; padding: 2px 4px; }
.cx-replies { padding: 2px 0; font-size: 13px; }
.cx-act { position: absolute; right: 8px; top: -10px; display: none; gap: 2px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 2px; box-shadow: 0 4px 14px #0d1b2a1a; }
.cx-msg:hover .cx-act, .cx-msg:focus-within .cx-act { display: flex; }
.cx-act button { border: 0; background: none; padding: 3px 7px; border-radius: 6px; font-size: 14px; }
.cx-act button:hover { background: var(--paper); }
.cx-meet { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 4px; background: var(--blue); }
.cx-compose { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.cx-compose textarea { width: 100%; resize: vertical; min-height: 44px; max-height: 200px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.cx-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cx-tools .btn { padding: 6px 10px; }
.cx-pend { display: flex; flex-wrap: wrap; gap: 6px; }
.cx-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 13px; background: var(--paper); }
.cx-chip button { border: 0; background: none; padding: 0 4px; }
.cx-ro { border-top: 1px solid var(--line); padding: 12px 14px; }
.cx-hit { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 10px 6px; }
.cx-hit:hover { background: var(--paper); }
.cx-mlist { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow: auto; }
.aip-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 8px; }
.aip-quick .btn { font-size: 13px; padding: 5px 10px; }
@media (max-width: 1100px) { .cx.cx-with-thread { grid-template-columns: 220px minmax(0, 1fr); } .cx.cx-with-thread .cx-thread { position: absolute; inset: 0; z-index: 5; } }
@media (max-width: 760px) {
  .cx, .cx.cx-with-thread { grid-template-columns: 1fr; height: calc(100vh - 96px); border-radius: 12px; }
  .cx .cx-main { display: none; }
  .cx.cx-m-main .cx-side { display: none; }
  .cx.cx-m-main .cx-main { display: flex; }
  .cx-back { display: inline-block; }
  .cx-lbl { display: none; }
  .cx-act { display: flex; position: static; box-shadow: none; border: 0; background: none; padding: 0; margin-left: auto; align-self: flex-start; }
  .cx-msg { flex-wrap: wrap; }
  .cx-thread { position: absolute; inset: 0; z-index: 5; }
}
@media print { .cx-side, .cx-compose, .cx-act { display: none !important; } .cx { display: block; height: auto; } }
/* On Team Connect the Ask AI button sits above the message box, so it never covers Send. */
body:has(#cx) #aiDock { bottom: max(96px, calc(env(safe-area-inset-bottom) + 96px)); }

/* Company contact details: one labelled row that reads left to right and wraps on narrow screens (every organization). */
.contact-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 10px 0 0; }
.contact-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.contact-field.wide { grid-column: span 2; }
.contact-row dt { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.contact-row dd { margin: 0; font-size: 14.5px; line-height: 1.4; writing-mode: horizontal-tb; overflow-wrap: break-word; word-break: normal; }
.contact-row dd a { overflow-wrap: anywhere; }
@media (max-width: 520px) { .contact-row { grid-template-columns: 1fr; } .contact-field.wide { grid-column: auto; } }
/* Ask AI launcher: drag along the right edge; no text selection or page scroll while dragging. */
#aiFab { touch-action: none; user-select: none; -webkit-user-select: none; }
#aiFab.dragging { cursor: grabbing; opacity: .85; box-shadow: 0 10px 30px #0d1b2a40; }

/* ---------- Dashboard analytics (uses each organization's theme colours) ---------- */
.an-panel { margin-bottom: 18px; }
.an-filters { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.an-filters select { margin-left: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.an-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.an-card { margin: 0; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.an-card.wide { grid-column: span 2; }
.an-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.an-head h3 { margin: 0; font-size: 15px; }
.an-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; flex: 1; }
.an-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); min-width: 0; }
.an-tile:not([disabled]):hover, .an-tile:not([disabled]):focus-visible { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px var(--gold-soft); }
.an-tile[disabled] { cursor: default; }
.an-tile strong { font-size: 20px; line-height: 1.15; overflow-wrap: anywhere; }
.an-tile span { font-size: 12px; color: var(--muted); }
.an-tile.bad strong { color: var(--red); }
.an-tile.warn strong { color: var(--warning); }
.an-split { display: flex; gap: 14px; align-items: center; }
.an-donut { width: 84px; height: 84px; flex: none; }
.an-donut .an-track { fill: none; stroke: var(--line); stroke-width: 8; }
.an-donut .an-fill { fill: none; stroke: var(--navy); stroke-width: 8; stroke-linecap: round; }
.an-donut text { font-size: 13px; font-weight: 700; fill: var(--ink); }
div.an-donut { display: grid; place-items: center; border-radius: 50%; border: 8px solid var(--line); box-sizing: border-box; font-weight: 700; }
.an-bars { display: flex; flex-direction: column; gap: 6px; }
.an-bar { display: grid; grid-template-columns: minmax(80px, 38%) 1fr 56px; gap: 8px; align-items: center; font-size: 13px; }
.an-bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-bt { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; }
.an-bt i { display: block; height: 100%; background: var(--navy); border-radius: 6px; }
.an-bv { text-align: right; font-variant-numeric: tabular-nums; }
.an-stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line); }
.an-stack i, .an-legend b { display: block; height: 100%; }
.an-stack .ok, .an-legend .ok { background: var(--success); }
.an-stack .mid, .an-legend .mid { background: var(--gold); }
.an-stack .low, .an-legend .low { background: #9aa3ab; }
.an-stack .bad, .an-legend .bad { background: var(--red); }
.an-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; color: var(--muted); }
.an-legend span { display: inline-flex; align-items: center; gap: 5px; }
.an-legend b { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.an-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.an-list li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line); }
.an-list li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.an-list li b { white-space: nowrap; font-weight: 600; }
.an-list li b.bad { color: var(--red); }
.an-skel div { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--line), var(--paper), var(--line)); background-size: 200% 100%; animation: anShimmer 1.2s infinite; }
.an-skel div + div { height: 60px; }
@keyframes anShimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .an-skel div { animation: none; } }
@media (max-width: 760px) { .an-card.wide { grid-column: auto; } .an-grid { grid-template-columns: 1fr; } .an-split { flex-direction: column; align-items: flex-start; } }
@media print { .an-filters .row-actions { display: none; } }

/* ---------- Employee dashboard on My Plan (organization theme colours) ---------- */
.emp-panel { margin-bottom: 22px; }
.emp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.emp-kpi { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); text-align: left; color: var(--ink); box-shadow: 0 6px 18px #0d1b2a0d; overflow: hidden; }
.emp-kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--navy); }
.emp-kpi.bad::before { background: var(--red); } .emp-kpi.warn::before { background: var(--warning); }
.emp-kpi:hover, .emp-kpi:focus-visible { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px var(--gold-soft), 0 8px 22px #0d1b2a14; }
.emp-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--gold-soft); }
.emp-kv { display: flex; flex-direction: column; min-width: 0; }
.emp-kv strong { font-size: 24px; line-height: 1.1; color: var(--navy); }
.emp-kpi.bad .emp-kv strong { color: var(--red); }
.emp-kv span { font-size: 13px; font-weight: 600; }
.emp-kv small { font-size: 12px; color: var(--muted); }
.emp-kpi .emp-prog { grid-column: 1 / -1; }
.emp-prog { display: block; height: 8px; border-radius: 6px; background: var(--line); overflow: hidden; }
.emp-prog i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--navy), var(--navy2)); }
.emp-prog.ok i { background: var(--success); } .emp-prog.bad i { background: var(--red); } .emp-prog.warn i { background: var(--warning); }
.emp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.emp-grid .an-card.wide { grid-column: auto; }
.emp-split { display: flex; align-items: center; gap: 18px; }
.emp-ring { width: 128px; height: 128px; flex: none; }
.emp-ring-track { fill: none; stroke: var(--line); stroke-width: 12; }
.emp-seg { fill: none; stroke-width: 12; }
.emp-seg.ok { stroke: var(--success); } .emp-seg.mid { stroke: var(--gold); } .emp-seg.bad { stroke: var(--red); } .emp-seg.rest { stroke: var(--blue); }
.emp-ring-big { font-size: 20px; font-weight: 700; fill: var(--ink); }
.emp-ring-sub { font-size: 9px; fill: var(--muted); }
.emp-facts { display: grid; gap: 8px; flex: 1; }
.emp-facts div { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--paper); font-size: 13px; }
.emp-facts b { font-size: 15px; } .emp-facts .warn b { color: var(--warning); }
.emp-legend { display: grid; gap: 8px; font-size: 13px; }
.emp-legend span { display: inline-flex; align-items: center; gap: 8px; }
.emp-legend b { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.emp-legend .ok { background: var(--success); } .emp-legend .mid { background: var(--gold); } .emp-legend .bad { background: var(--red); }
.emp-rows { display: grid; gap: 9px; margin-top: 6px; }
.emp-row { display: grid; grid-template-columns: minmax(90px, 40%) 1fr 70px; gap: 10px; align-items: center; font-size: 13px; }
.emp-rl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp-rv { text-align: right; font-weight: 600; display: flex; flex-direction: column; line-height: 1.2; }
.emp-rv small { font-weight: 400; font-size: 11px; color: var(--muted); } .emp-rv small.bad { color: var(--red); }
.emp-time { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.emp-time > li { min-width: 0; }
.emp-tl { display: flex; gap: 12px; align-items: center; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); text-align: left; color: var(--ink); }
.emp-tl:hover, .emp-tl:focus-visible { border-color: var(--gold); outline: none; }
.emp-date { width: 46px; flex: none; text-align: center; border-radius: 8px; background: var(--navy); color: #fff; padding: 4px 0; font-size: 17px; font-weight: 700; line-height: 1.1; display: flex; flex-direction: column; }
.emp-date b { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; opacity: .85; }
.emp-time li.bad .emp-date { background: var(--red); }
.emp-tt { display: flex; flex-direction: column; min-width: 0; } .emp-tt strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .emp-tt small { font-size: 12px; color: var(--muted); }
.emp-time li.bad .emp-tt small { color: var(--red); }
@media (max-width: 1100px) { .emp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .emp-grid { grid-template-columns: 1fr; } .emp-split { flex-direction: column; align-items: stretch; } .emp-ring { align-self: center; } }
@media (max-width: 440px) { .emp-kpis { grid-template-columns: 1fr; } .emp-row { grid-template-columns: minmax(80px, 38%) 1fr 62px; } }

/* ---------- Organization cleanup ---------- */
.cl-safe { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: var(--paper); }
.cl-list { max-height: 52vh; overflow: auto; margin-top: 8px; border-top: 1px solid var(--line); }
.cl-cat { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 12px 0 4px; }
.cl-row { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cl-row.flagged { background: linear-gradient(90deg, var(--gold-soft), transparent 60%); }
.cl-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cl-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.cl-act { display: flex; flex-direction: column; gap: 4px; flex: none; width: 190px; }
.cl-act select, .cl-act input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.cl-foot { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.cl-plan { margin: 8px 0; padding-left: 18px; font-size: 14px; } .cl-plan li { margin: 4px 0; } .cl-plan li.bad { color: var(--red); }
@media (max-width: 640px) { .cl-row { flex-direction: column; } .cl-act { width: 100%; } }
.cl-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; } .cl-tools input, .cl-tools select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; } .cl-tools #clQ { flex: 1; min-width: 160px; }
.cl-bulk { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 0; } .cl-bulk select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; }
.cl-row .cl-pick { flex: none; width: 18px; margin-top: 3px; } .cl-row.binned { background: linear-gradient(90deg, #b4231812, transparent 60%); }
.cl-switch { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); } .cl-switch span { display: flex; flex-direction: column; } .cl-switch small { color: var(--muted); }

/* Platform brand caption (Platform account global pages only) */
.brand-caption { margin: -8px 13px 14px; text-align: center; color: #fff; display: flex; flex-direction: column; gap: 2px; }
.brand-caption strong { font-size: 22px; letter-spacing: .02em; }
.brand-caption small { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--line, #c3cad2); }
body.platform-brand .sidebar { border-right: 3px solid var(--gold); }

.cl-pagebar{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 12px;margin-bottom:12px;border:1px dashed var(--line);border-radius:10px;background:var(--paper)}
.cl-deps{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:2px 12px;margin-top:6px}

.btn.danger { border-color: var(--red); }
/* Demonstration site bar (demo.keccal.com only) */
.demo-bar { position: fixed; left: 12px; bottom: 12px; z-index: 60; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; max-width: calc(100vw - 110px);
  background: #fff7e6; border: 1px solid #f0c36d; border-radius: 10px; padding: 6px 12px; box-shadow: 0 4px 16px rgba(0,0,0,.12); font-size: 13px; }
.demo-bar strong { background: #b45309; color: #fff; border-radius: 6px; padding: 1px 8px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.demo-bar select { max-width: 260px; padding: 3px 6px; }
@media (max-width: 760px) { .demo-bar { left: 6px; right: 6px; bottom: 6px; max-width: none; } .demo-bar .small:first-of-type { display: none; } }
