:root {
  --bg: #f6f2e8;
  --card: #fffdf8;
  --line: #e4dac2;
  --gold: #83754c;
  --gold-light: #b5a77d;
  --gold-pale: #f1e9d4;
  --gold-deep: #4e4529;
  --ink: #2b2618;
  --muted: #7a7058;
  --ok: #4f6b3c;
  --ok-bg: #e6eddc;
  --dec: #9a6a14;
  --dec-bg: #f6ead0;
  --late: #923a30;
  --late-bg: #f4e0db;
  --radius: 18px;
  --shadow: 0 8px 24px rgba(78, 69, 41, 0.07);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Tajawal", system-ui, sans-serif;
}

button {
  font: inherit;
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

/* ------------------------------------------------------------ top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 32px;
  background: rgba(246, 242, 232, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.logo {
  height: 46px;
}
.tabs {
  display: flex;
  gap: 6px;
  background: var(--gold-pale);
  padding: 5px;
  border-radius: 999px;
}
.tab {
  border: 0;
  background: transparent;
  color: var(--gold-deep);
  font-weight: 700;
  font-size: 17px;
  padding: 8px 22px 10px;
  border-radius: 999px;
}
.tab.is-active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(78, 69, 41, 0.12);
}
.today {
  margin-right: auto;
  color: var(--gold);
  font-weight: 700;
}

main {
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px 32px 48px;
}
.page {
  display: none;
  flex-direction: column;
  gap: 28px;
}
.page.is-active {
  display: flex;
  animation: rise 0.35s ease;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.hello h1 {
  font-size: 38px;
  font-weight: 800;
}
.hello p {
  color: var(--muted);
  font-size: 18px;
  margin-top: 4px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 4px 14px;
}
.section-head h2 {
  font-size: 26px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-head h2::before {
  content: "";
  width: 7px;
  height: 22px;
  border-radius: 3px;
  background: var(--gold);
}
.section-head .chips,
.section-head .hint {
  margin-right: auto;
}
.hint {
  color: var(--muted);
  font-size: 15px;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--gold-deep);
  font-weight: 700;
  font-size: 15px;
  padding: 5px 14px 7px;
  border-radius: 999px;
}
.chip.is-on {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}
.chip .n {
  opacity: 0.75;
  margin-right: 4px;
}

.btn {
  border: 1px solid var(--gold);
  background: var(--gold);
  color: #fff;
  font-weight: 700;
  padding: 7px 16px 9px;
  border-radius: 12px;
}
.btn.ghost {
  background: transparent;
  color: var(--gold-deep);
}

/* ---------------------------------------------------------------- KPIs */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.kpi {
  text-align: right;
  padding: 18px 22px;
  border: 1px solid var(--line);
  transition: transform 0.15s, box-shadow 0.15s;
}
button.kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(78, 69, 41, 0.12);
}
.kpi .v {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
}
.kpi .l {
  font-size: 17px;
  font-weight: 700;
  color: var(--gold-deep);
  margin-top: 8px;
}
.kpi .s {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 2px;
}
.kpi .s.warn {
  color: var(--late);
}

/* ------------------------------------------------------------ projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.project {
  text-align: right;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-right: 5px solid var(--gold);
  transition: transform 0.15s, box-shadow 0.15s;
}
.project:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(78, 69, 41, 0.13);
}
.project.decision {
  border-right-color: var(--dec);
}
.project.late {
  border-right-color: var(--late);
}
.project .top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.project .name {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.3;
}
.project .meta {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}
.badge {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 11px 5px;
  border-radius: 999px;
}
.badge.ok {
  color: var(--ok);
  background: var(--ok-bg);
}
.badge.decision {
  color: var(--dec);
  background: var(--dec-bg);
}
.badge.late {
  color: var(--late);
  background: var(--late-bg);
}
.last {
  background: #faf6ec;
  border-radius: 12px;
  padding: 10px 12px 12px;
}
.last .d {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
}
.last .t {
  font-size: 15px;
  line-height: 1.45;
  margin-top: 2px;
}
.owner {
  display: flex;
  align-items: center;
  gap: 10px;
}
.owner .k {
  font-size: 12px;
  color: var(--muted);
}
.owner .o {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-deep);
}
.avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

/* Stage stepper */
.stepper {
  display: flex;
}
.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  position: relative;
  font-size: 12px;
  color: var(--muted);
}
.step + .step::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--line);
}
.step.done + .step::before,
.step.done + .step.cur::before {
  background: var(--gold);
}
.stepper.late .step.done + .step::before {
  background: var(--late);
}
.dot {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--card);
}
.step.done .dot {
  background: var(--gold);
  border-color: var(--gold);
}
.step.cur {
  color: var(--ink);
  font-weight: 800;
}
.step.cur .dot {
  box-shadow: 0 0 0 5px var(--gold-pale);
}
.stepper.late .step.done .dot {
  background: var(--late);
  border-color: var(--late);
}
.stepper.late .step.cur .dot {
  box-shadow: 0 0 0 5px var(--late-bg);
}

/* --------------------------------------------------------------- lists */
.two-col {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 16px;
  align-items: start;
}
.list {
  padding: 4px 20px;
}
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.row:first-child {
  border-top: 0;
}
.check {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 7px;
  border: 2px solid var(--gold-light);
  background: transparent;
  display: grid;
  place-items: center;
  padding: 0;
  transition: background 0.15s;
}
.check.late {
  border-color: var(--late);
}
.check.on {
  background: var(--gold);
  border-color: var(--gold);
}
.row .body {
  flex: 1;
}
.row .tx {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}
.row .sub {
  font-size: 13px;
  color: var(--muted);
}
.row.done {
  opacity: 0.5;
}
.row.done .tx {
  text-decoration: line-through;
}
.due {
  text-align: left;
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
  color: var(--gold-deep);
}
.due small {
  display: block;
  font-size: 12px;
}
.due.late {
  color: var(--late);
}
.due .hi {
  color: var(--dec);
}
.row.flash {
  animation: flash 1.2s ease;
}
@keyframes flash {
  0%,
  40% {
    background: var(--gold-pale);
  }
}
.more {
  display: block;
  width: 100%;
  border: 0;
  border-top: 1px dashed var(--line);
  background: transparent;
  color: var(--gold);
  font-weight: 700;
  padding: 10px 0 12px;
}

/* ---------------------------------------------------------------- agenda */
#agenda {
  padding: 16px 20px;
}
.slot {
  display: flex;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: right;
  padding: 0;
}
.slot .tm {
  width: 52px;
  flex-shrink: 0;
  font-weight: 800;
  padding-top: 8px;
  direction: ltr;
  text-align: right;
  color: var(--gold-deep);
}
.slot .rail {
  width: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.slot .rail i {
  width: 12px;
  height: 12px;
  margin-top: 13px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: var(--card);
}
.slot .rail b {
  flex: 1;
  width: 2px;
  background: var(--line);
  margin-top: 3px;
}
.slot .box {
  flex: 1;
  margin-bottom: 8px;
  padding: 6px 12px 9px;
  border-radius: 12px;
  transition: background 0.15s;
}
.slot:hover .box {
  background: #faf6ec;
}
.slot.past {
  opacity: 0.5;
}
.slot.past .rail i {
  background: var(--gold);
}
.slot.now .rail i {
  background: var(--gold);
  box-shadow: 0 0 0 6px #efe4c8;
}
.slot.now .box {
  background: #f4ebd5;
}
.slot .box .k {
  font-size: 12px;
  font-weight: 800;
  color: var(--gold);
}
.slot .box .tt {
  font-weight: 700;
  font-size: 16px;
}
.slot .box .pl {
  font-size: 13px;
  color: var(--muted);
}
.slot .extra {
  display: none;
  font-size: 13px;
  color: var(--gold-deep);
  margin-top: 6px;
  line-height: 1.5;
}
.slot.open .extra {
  display: block;
}
.tomorrow {
  border-top: 1px dashed var(--line);
  margin-top: 6px;
  padding-top: 10px;
  font-size: 14px;
}
.tomorrow b {
  color: var(--gold);
}

/* --------------------------------------------------------------- letters */
.letter {
  cursor: pointer;
}
.letter:hover .tx {
  color: var(--gold-deep);
}
.letter .no {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.state {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}
.state.wait {
  color: var(--dec);
}
.urgent {
  font-size: 12px;
  font-weight: 700;
  color: var(--late);
  background: var(--late-bg);
  border-radius: 999px;
  padding: 1px 9px 3px;
  margin-right: 6px;
}
.dirtag {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-deep);
  background: var(--gold-pale);
  border-radius: 6px;
  padding: 1px 8px 3px;
}

/* ---------------------------------------------------------------- drawer */
.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(460px, 92vw);
  z-index: 40;
  background: var(--card);
  border-right: 1px solid var(--line);
  box-shadow: 20px 0 50px rgba(43, 38, 24, 0.18);
  padding: 28px 28px 40px;
  overflow-y: auto;
  transform: translateX(-105%);
  transition: transform 0.3s ease;
}
.drawer.open {
  transform: none;
}
.drawer-close {
  position: absolute;
  top: 14px;
  left: 16px;
  border: 0;
  background: var(--gold-pale);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  color: var(--gold-deep);
}
.scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(43, 38, 24, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.scrim.open {
  opacity: 1;
  pointer-events: auto;
}
.drawer h3 {
  font-size: 24px;
  font-weight: 800;
  margin: 8px 0 4px;
}
.drawer .meta {
  color: var(--muted);
}
.drawer .block {
  margin-top: 20px;
}
.drawer .block > .k {
  font-size: 14px;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 8px;
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline li {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 0;
  color: var(--muted);
}
.timeline li i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--line);
}
.timeline li.done {
  color: var(--ink);
}
.timeline li.done i {
  background: var(--gold);
  border-color: var(--gold);
}
.timeline li.cur {
  font-weight: 800;
}
.timeline li span {
  margin-right: auto;
  direction: ltr;
}
.mini {
  font-size: 15px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.mini:first-of-type {
  border-top: 0;
}

/* ------------------------------------------------------------------- map */
.map-row {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.map-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
}
.map-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.map-head h2 {
  font-size: 22px;
  font-weight: 800;
}
.map-wrap {
  position: relative;
  flex: 1;
  min-height: 560px;
  margin-top: 8px;
}
#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.gov {
  stroke: #fffdf8;
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
  transition: fill 0.35s, opacity 0.35s;
  cursor: pointer;
}
.gov:hover {
  filter: brightness(1.06);
  stroke: var(--gold-deep);
}
.gov.sel {
  stroke: var(--gold-deep);
  stroke-width: 2;
}
.gov.dim {
  opacity: 0.25;
}
.dist {
  fill: rgba(255, 253, 248, 0.55);
  stroke: var(--gold-deep);
  stroke-width: 1;
  stroke-dasharray: 4 3;
  vector-effect: non-scaling-stroke;
  transition: fill 0.2s;
}
.dist.has {
  fill: rgba(255, 253, 248, 0.15);
}
.dist.hl {
  fill: rgba(255, 241, 201, 0.75);
}
.bubble circle {
  fill: var(--card);
  stroke: var(--gold);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.bubble text,
.dlabel {
  font-family: "Tajawal", sans-serif;
  font-weight: 800;
  fill: var(--ink);
  text-anchor: middle;
  pointer-events: none;
}
.bubble {
  pointer-events: none;
  transition: opacity 0.3s;
}
.gname {
  font-family: "Tajawal", sans-serif;
  font-weight: 700;
  fill: var(--gold-deep);
  text-anchor: middle;
  pointer-events: none;
}
.pin {
  cursor: pointer;
}
.pin circle.halo {
  fill: rgba(131, 117, 76, 0.22);
}
.pin circle.core {
  stroke: #fff;
  vector-effect: non-scaling-stroke;
}
.pin.hl circle.halo {
  fill: rgba(131, 117, 76, 0.45);
}
.legend {
  position: absolute;
  bottom: 6px;
  left: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.85);
  padding: 6px 10px;
  border-radius: 10px;
}
.legend .ramp {
  width: 120px;
  height: 10px;
  border-radius: 5px;
}

.side {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.side h3 {
  font-size: 22px;
  font-weight: 800;
}
.rank {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 7px 4px;
  border-radius: 10px;
  text-align: right;
}
.rank:hover {
  background: #faf6ec;
}
.rank .nm {
  width: 90px;
  font-weight: 700;
}
.rank .bar {
  flex: 1;
  height: 10px;
  background: var(--gold-pale);
  border-radius: 5px;
  overflow: hidden;
}
.rank .bar i {
  display: block;
  height: 100%;
  background: var(--gold);
  border-radius: 5px;
}
.rank .ct {
  width: 26px;
  text-align: left;
  font-weight: 800;
}
.rank .tag {
  font-size: 11px;
  color: var(--gold);
  font-weight: 800;
}
.seg {
  display: inline-flex;
  background: var(--gold-pale);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}
.seg button {
  border: 0;
  background: transparent;
  font-weight: 700;
  color: var(--gold-deep);
  padding: 5px 14px 7px;
  border-radius: 999px;
}
.seg button.on {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(78, 69, 41, 0.12);
}
.group-k {
  font-size: 14px;
  font-weight: 800;
  color: var(--gold);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.group-k i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.gp {
  width: 100%;
  text-align: right;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.gp:hover,
.gp.hl {
  border-color: var(--gold);
  box-shadow: 0 6px 18px rgba(78, 69, 41, 0.12);
}
.gp .nm {
  font-weight: 800;
  font-size: 16px;
}
.gp .mt {
  font-size: 13px;
  color: var(--muted);
}
.side-split {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ---------------------------------------------------------------- charts */
.charts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.chart-card {
  padding: 18px 22px;
}
.chart-card h3 {
  font-size: 19px;
  font-weight: 800;
}
.chart-card svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 8px;
  overflow: visible;
}
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
}
.donut-wrap svg {
  width: 230px;
  flex-shrink: 0;
}
.donut-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.donut-legend button {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 5px 8px;
  border-radius: 10px;
  text-align: right;
  font-weight: 700;
  color: var(--ink);
}
.donut-legend button:hover,
.donut-legend button.on {
  background: #faf6ec;
}
.donut-legend i {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex-shrink: 0;
}
.donut-legend span {
  margin-right: auto;
  color: var(--muted);
}
.arc {
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  transform-origin: center;
}
.arc.dim {
  opacity: 0.25;
}
.svgtext {
  font-family: "Tajawal", sans-serif;
}
.hbar {
  cursor: pointer;
}
.hbar:hover rect.fill {
  fill: var(--gold-deep);
}

.tooltip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 12px 8px;
  border-radius: 10px;
  opacity: 0;
  transform: translate(-50%, -120%);
  transition: opacity 0.12s;
  white-space: nowrap;
}
.tooltip.on {
  opacity: 1;
}

.footnote {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* --------------------------------------------------------------- narrow */
@media (max-width: 1100px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .two-col,
  .map-row,
  .charts {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  main {
    padding: 18px 14px 40px;
  }
  .topbar {
    padding: 10px 14px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .today {
    display: none;
  }
  .kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
  .map-wrap {
    min-height: 380px;
  }
  .donut-wrap {
    flex-direction: column;
  }
}

/* Live data from Workiom */
.live-pill {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 12px 6px;
  border-radius: 999px;
  white-space: nowrap;
}
.live-pill.on {
  color: var(--ok);
  background: var(--ok-bg);
}
.live-pill.on::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--ok);
  animation: livepulse 1.6s ease-out infinite;
}
.live-pill.off {
  color: var(--late);
  background: var(--late-bg);
}
@keyframes livepulse {
  0% {
    box-shadow: 0 0 0 0 rgba(79, 107, 60, 0.6);
  }
  100% {
    box-shadow: 0 0 0 8px rgba(79, 107, 60, 0);
  }
}
.empty {
  color: var(--muted);
  padding: 10px 4px 14px;
}
.wk-link {
  display: inline-block;
  margin-top: 8px;
  text-decoration: none;
  font-size: 14px;
}
a.tx {
  color: inherit;
  text-decoration: none;
}
a.tx:hover {
  text-decoration: underline;
}
.check:disabled {
  cursor: default;
}

/* Sections jumped to from the indicators stop below the sticky top bar. */
.section,
#page-map {
  scroll-margin-top: 96px;
}
@media (max-width: 720px) {
  .section,
  #page-map {
    scroll-margin-top: 70px;
  }
  .topbar {
    flex-wrap: nowrap;
    gap: 10px;
    padding: 8px 12px;
  }
  .logo {
    height: 34px;
  }
  .tabs {
    padding: 3px;
    gap: 2px;
  }
  .tab {
    font-size: 14px;
    padding: 6px 12px 8px;
    white-space: nowrap;
  }
  /* Only the live dot on a phone; the time shows on wider screens. */
  .live-pill {
    margin-right: auto;
    width: 30px;
    height: 30px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
    display: grid;
    place-items: center;
  }
  .live-pill.on::before,
  .live-pill.off::before {
    margin: 0;
  }
  .live-pill.off::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--late);
  }
}
.tab,
.today {
  white-space: nowrap;
}
@media (max-width: 900px) {
  .today {
    display: none;
  }
  .live-pill {
    margin-right: auto;
  }
}

/* ------------------------------------------------------- smart search */
mark {
  background: #f6dc8a;
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}
.gsearch {
  position: relative;
  flex: 1;
  max-width: 440px;
  margin-right: auto;
}
.gsearch input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  border: 1px solid var(--line);
  background: var(--card)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2383754c' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M20 20l-4.6-4.6'/%3E%3C/svg%3E")
    no-repeat right 12px center;
  border-radius: 999px;
  padding: 8px 40px 10px 40px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.gsearch input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(131, 117, 76, 0.14);
}
.gsearch input::-webkit-search-cancel-button {
  display: none;
}
.gsearch kbd {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 7px 4px;
  pointer-events: none;
}
.gsearch input:focus + kbd {
  display: none;
}
.gresults {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(560px, 92vw);
  max-height: min(70vh, 640px);
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(43, 38, 24, 0.2);
  padding: 8px;
  display: none;
  z-index: 50;
}
.gresults.open {
  display: block;
  animation: rise 0.18s ease;
}
.gg + .gg {
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding-top: 6px;
}
.gg-h {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--gold);
  padding: 6px 10px 4px;
}
.gg-h span {
  background: var(--gold-pale);
  border-radius: 999px;
  padding: 0 8px 2px;
  font-size: 12px;
}
.gr {
  display: block;
  width: 100%;
  text-align: right;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 8px 10px 9px;
  color: var(--ink);
}
.gr:hover,
.gr.on {
  background: var(--gold-pale);
}
.gr-t {
  font-weight: 700;
  font-size: 15px;
}
.gr-s {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.gr-hit,
.mrow-hit {
  font-size: 13px;
  color: var(--gold-deep);
  margin-top: 4px;
  line-height: 1.6;
}
.gr-hit b,
.mrow-hit b {
  color: var(--gold);
  font-weight: 700;
}
.gr.more-r {
  color: var(--gold-deep);
  font-weight: 700;
  font-size: 14px;
}
.gg-more,
.gg-none {
  font-size: 13px;
  color: var(--muted);
  padding: 6px 10px 8px;
}
.gg-none {
  padding: 18px 10px;
  text-align: center;
}

/* ---------------------------------------------------------------- mail */
.mail-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.mail-head h1 {
  font-size: 34px;
  font-weight: 800;
}
.mail-dir button {
  font-size: 16px;
  padding: 7px 18px 9px;
}
.mail-dir .n {
  display: inline-block;
  margin-right: 8px;
  font-size: 13px;
  background: rgba(131, 117, 76, 0.14);
  border-radius: 999px;
  padding: 0 8px 2px;
}
.mail-dir button.on .n {
  background: var(--gold);
  color: #fff;
}
.mail-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px;
}
.mail-bar input {
  flex: 1 1 340px;
  font: inherit;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 14px 11px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
}
.mail-bar input:focus {
  border-color: var(--gold);
  background: var(--card);
}
.mail-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.fsel {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-deep);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px 8px;
  max-width: 220px;
}
.fsel.is-on {
  border-color: var(--gold);
  background: var(--gold-pale);
}
.chip.clear {
  color: var(--late);
  border-color: transparent;
  background: transparent;
}
.mail-split {
  display: grid;
  grid-template-columns: minmax(340px, 420px) 1fr;
  gap: 18px;
  align-items: start;
}
.mail-list,
.mail-detail {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.mail-list {
  padding: 6px;
}
.mrow {
  display: block;
  width: 100%;
  text-align: right;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  padding: 11px 14px 12px;
  border-right: 4px solid transparent;
}
.mrow + .mrow {
  margin-top: 2px;
}
.mrow:hover {
  background: rgba(241, 233, 212, 0.55);
}
.mrow.on {
  background: var(--gold-pale);
  border-right-color: var(--gold);
}
.mrow.wait:not(.on) {
  border-right-color: rgba(154, 106, 20, 0.35);
}
.mrow-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.mrow-top .urgent {
  margin: 0;
}
.mrow-top .date {
  margin-right: auto;
}
.mrow-subj {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.55;
  margin-top: 4px;
}
.mrow-party {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.mrow-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.mrow-foot .state {
  font-size: 12px;
}
.mrow-foot .clip {
  margin-right: auto;
  filter: grayscale(1);
  opacity: 0.6;
}
.dirtag.out {
  background: #e6eddc;
  color: var(--ok);
}
.mail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 10px;
}
.mail-detail {
  padding: 26px 28px 30px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.md-empty {
  padding: 60px 10px;
  text-align: center;
}
.md-back {
  display: none;
  align-self: flex-start;
}
.md-head .tags {
  display: flex;
  align-items: center;
  gap: 8px;
}
.md-head .tags .urgent {
  margin: 0;
}
.md-head .tags .state {
  margin-right: auto;
}
.md-head h2 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.45;
  margin-top: 10px;
}
.md-head .meta {
  color: var(--muted);
  font-size: 15px;
  margin-top: 4px;
}
.md-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.fact {
  background: var(--card);
  padding: 10px 14px 12px;
}
.fact .k,
.md-block .k,
.md-files .k {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
}
.fact .v {
  font-weight: 700;
  margin-top: 2px;
}
.md-block .k,
.md-files .k {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}
.md-block .txt {
  line-height: 1.85;
  white-space: pre-line;
}
.md-block .ai {
  font-size: 11px;
  color: #5a4a8a;
  background: #ece6f6;
  border-radius: 999px;
  padding: 1px 8px 3px;
}
.md-files .file {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: var(--bg);
}
.md-files .file + .file {
  margin-top: 8px;
}
.md-files .fn {
  flex: 1;
  min-width: 0;
}
.md-files .name {
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.md-files .sz {
  font-size: 12px;
  color: var(--muted);
}
.md-files .btn {
  white-space: nowrap;
  text-decoration: none;
  font-size: 14px;
}

/* File preview over the page */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(43, 38, 24, 0.45);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.viewer.open {
  opacity: 1;
  pointer-events: auto;
}
.viewer-box {
  width: min(1100px, 94vw);
  height: 92vh;
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  transform: scale(0.98);
  transition: transform 0.25s;
}
.viewer.open .viewer-box {
  transform: none;
}
.viewer-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.viewer-bar b {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.viewer-bar .btn {
  text-decoration: none;
  font-size: 14px;
}
.viewer-bar .drawer-close {
  position: static;
}
.viewer iframe {
  flex: 1;
  border: 0;
  width: 100%;
  background: #525659;
}

@media (max-width: 1100px) {
  .gsearch kbd {
    display: none;
  }
}
@media (max-width: 900px) {
  .mail-split {
    grid-template-columns: 1fr;
  }
  .mail-list,
  .mail-detail {
    position: static;
    max-height: none;
  }
  .mail-split.show-detail .mail-list,
  .mail-split:not(.show-detail) .mail-detail {
    display: none;
  }
  .md-back {
    display: inline-block;
  }
  .mail-head {
    flex-direction: column;
    align-items: stretch;
  }
  .mail-dir {
    display: flex;
  }
  .mail-dir button {
    flex: 1;
  }
}
@media (max-width: 720px) {
  /* The search shrinks to its icon and opens over the top bar when tapped. */
  .gsearch {
    position: static;
    flex: 0 0 38px;
    margin-right: 0;
  }
  .gsearch input {
    width: 38px;
    height: 38px;
    padding: 0;
    color: transparent;
    background-position: center;
    cursor: pointer;
  }
  .gsearch input::placeholder {
    color: transparent;
  }
  .gsearch:focus-within input {
    position: absolute;
    inset: 8px 12px;
    width: auto;
    height: auto;
    padding: 6px 40px 8px 14px;
    color: var(--ink);
    background-position: right 12px center;
    z-index: 2;
  }
  .gsearch:focus-within input::placeholder {
    color: var(--muted);
  }
  .gresults {
    position: fixed;
    top: 58px;
    right: 8px;
    left: 8px;
    width: auto;
  }
  .mail-head h1 {
    font-size: 26px;
  }
  .md-head h2 {
    font-size: 21px;
  }
  .mail-detail {
    padding: 18px 16px 22px;
  }
  .md-files .file {
    flex-wrap: wrap;
  }
  .md-files .fn {
    flex-basis: calc(100% - 50px);
  }
  .viewer-box {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
}
.mail-detail > * {
  flex-shrink: 0;
}
@media (max-width: 720px) {
  .tab-long {
    display: none;
  }
  .logo {
    height: 30px;
  }
  .tab {
    padding: 6px 11px 8px;
  }
}
@media (max-width: 720px) {
  .mail-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .fsel {
    max-width: none;
    width: 100%;
  }
  .mail-dir button {
    white-space: nowrap;
    padding: 7px 6px 9px;
    font-size: 15px;
  }
}
#mail-split {
  scroll-margin-top: 96px;
}
@media (max-width: 720px) {
  #mail-split {
    scroll-margin-top: 66px;
  }
  .md-facts {
    grid-template-columns: 1fr 1fr;
  }
}
/* Lines between the facts drawn by the cells, so a short last row leaves
   no coloured gap. */
.md-facts {
  gap: 0;
  background: var(--card);
}
.fact {
  border: solid var(--line);
  border-width: 0 0 1px 1px;
  margin: 0 0 -1px -1px;
}

/* ------------------------------------------- project-management team */
.team {
  position: relative;
  flex-shrink: 0;
}
.tm-main {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: radial-gradient(circle at 30% 25%, #a8996a, var(--gold) 55%, var(--gold-deep));
  box-shadow: 0 6px 18px rgba(78, 69, 41, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.team:hover .tm-main,
.team.open .tm-main {
  transform: scale(1.06);
  box-shadow: 0 0 0 5px rgba(131, 117, 76, 0.18), 0 10px 26px rgba(78, 69, 41, 0.3);
}
.tm-count {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 21px;
  height: 21px;
  border-radius: 999px;
  background: var(--card);
  color: var(--gold-deep);
  font-size: 12px;
  line-height: 19px;
  border: 1.5px solid var(--gold);
}
.tm-title {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
  color: var(--gold);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.tm-list {
  position: absolute;
  top: calc(100% + 34px);
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  overflow-x: visible;
  padding: 2px 12px 12px 3px;
  scrollbar-width: none;
}
.tm-member {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: right;
  opacity: 0;
  transform: translateY(calc(var(--i) * -48px)) scale(0.6);
  transition: opacity 0.22s ease, transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.25);
  transition-delay: calc(var(--i) * 28ms);
}
.team.open .tm-title,
.team.open .tm-member {
  opacity: 1;
  transform: none;
}
.team.open .tm-list {
  pointer-events: auto;
}
.tm-ring {
  --load: 50;
  flex-shrink: 0;
  padding: 3px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--load) * 1%), var(--gold-pale) 0);
  box-shadow: 0 4px 12px rgba(78, 69, 41, 0.2);
}
.tm-face {
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background: #f1e9d4;
  color: #83754c;
  border: 2px solid var(--card);
}
.tm-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tm-name {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 5px 12px 7px;
  box-shadow: 0 6px 16px rgba(78, 69, 41, 0.14);
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.tm-name b {
  font-size: 14px;
  color: var(--ink);
}
.tm-name small {
  font-size: 12px;
  color: var(--muted);
}
.tm-member:hover .tm-name,
.tm-member:focus-visible .tm-name {
  background: var(--gold-pale);
  border-color: var(--gold);
}
.tm-member:hover .tm-ring {
  transform: scale(1.08);
}

/* Member page */
.member {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(43, 38, 24, 0.42);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.member.open {
  opacity: 1;
  pointer-events: auto;
}
.member-box {
  position: relative;
  width: min(1040px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 22px;
  padding: 28px 30px 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.member.open .member-box {
  transform: none;
}
.member-box > * {
  flex-shrink: 0;
}
.member-box .drawer-close {
  position: absolute;
}
.mb-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-left: 40px;
}
.mb-head .tm-face {
  border: 3px solid var(--gold);
  box-shadow: 0 8px 22px rgba(78, 69, 41, 0.2);
}
.mb-head .role {
  font-size: 13px;
  font-weight: 800;
  color: var(--gold);
}
.mb-head h2 {
  font-size: 30px;
  font-weight: 800;
  direction: ltr;
  text-align: right;
}
.mb-head .meta {
  color: var(--muted);
  margin-top: 2px;
}
.mt-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.mt-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px 15px;
}
.mt-tile .v {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
}
.mt-tile .l {
  font-weight: 700;
  color: var(--gold-deep);
  margin-top: 4px;
}
.mt-tile .s {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.mt-tile.gold {
  background: linear-gradient(160deg, #fffaf0, #f1e9d4);
  border-color: var(--gold-light);
}
.mt-tile.gold .v {
  color: var(--gold-deep);
}
.mt-tile.warn .v {
  color: var(--late);
}
.mt-tile.na {
  background: transparent;
  border-style: dashed;
}
.mt-tile.na .v {
  color: var(--gold-light);
}
.mb-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.mb-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px 16px;
}
.mb-card h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 10px;
}
.mt-bars .row {
  display: grid;
  grid-template-columns: minmax(70px, 40%) 1fr 26px;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 3px 0;
}
.mt-bars .k {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mt-bars .bar {
  height: 8px;
  border-radius: 999px;
  background: var(--gold-pale);
  overflow: hidden;
}
.mt-bars .bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), #c7a04a);
}
.mt-bars .n {
  font-weight: 800;
  text-align: left;
}
.mb-projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 14px;
  max-height: 320px;
  overflow-y: auto;
}
.mb-p {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 7px 2px 8px;
  text-align: right;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
}
.mb-p:hover .nm {
  color: var(--gold-deep);
  text-decoration: underline;
}
.mb-p .nm {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.mb-p .pr {
  font-size: 11px;
  font-weight: 700;
  color: var(--late);
  background: var(--late-bg);
  border-radius: 999px;
  padding: 0 7px 2px;
}
.mb-p .st {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.mb-p .st.late {
  color: var(--late);
  font-weight: 700;
}
.located {
  font-size: 13px;
  font-weight: 700;
  margin-top: 6px;
  color: #ffd98a;
}
.map-stage.is-atlas .located {
  color: var(--gold-deep);
}
.located small {
  font-weight: 400;
  opacity: 0.7;
}

@media (max-width: 900px) {
  .mt-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .mb-cols,
  .mb-projects {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .tm-main {
    width: 36px;
    height: 36px;
  }
  .tm-main svg {
    width: 22px;
    height: 22px;
  }
  .tm-count {
    min-width: 17px;
    height: 17px;
    line-height: 15px;
    font-size: 10px;
  }
  .member-box {
    width: 100vw;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    padding: 20px 16px;
  }
  .mb-head h2 {
    font-size: 22px;
  }
  .mt-tile .v {
    font-size: 26px;
  }
}
@media (max-width: 720px) {
  .topbar {
    gap: 6px;
    padding: 8px 10px;
  }
  .logo {
    height: 26px;
  }
  .tab {
    font-size: 13px;
    padding: 6px 9px 8px;
  }
  .topbar .live-pill {
    display: none;
  }
}

/* ------------------------------------------------ key projects (pins) */
.home-link {
  display: flex;
  border-radius: 10px;
  transition: opacity 0.2s, transform 0.2s;
}
.home-link:hover {
  opacity: 0.85;
}
.home-link:active {
  transform: scale(0.97);
}
.home-link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}
.pin-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.pin-row .wk-link {
  margin-top: 0;
}
.pin-btn {
  border: 1.5px solid var(--gold);
  background: var(--card);
  color: var(--gold-deep);
  font-weight: 800;
  font-size: 14px;
  padding: 6px 14px 8px;
  border-radius: 12px;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.pin-btn:hover {
  background: var(--gold-pale);
}
.pin-btn:active {
  transform: scale(0.97);
}
.pin-btn.on {
  background: linear-gradient(135deg, #b39550, #83754c);
  border-color: transparent;
  color: #fff;
}
.pin-btn.on small {
  opacity: 0.8;
  font-weight: 700;
}
.pincard .pin-btn {
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  border-color: rgba(255, 217, 138, 0.7);
}
.map-stage.is-atlas .pincard .pin-btn {
  background: var(--card);
  color: var(--gold-deep);
}
.pincard .pin-btn.on {
  background: linear-gradient(135deg, #e0b25a, #b8862f);
  color: #1d160a;
}
.project {
  position: relative;
}
.project .unpin {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 17px;
  line-height: 1;
  color: var(--muted);
  background: var(--gold-pale);
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
}
.project:hover .unpin,
.project:focus-within .unpin {
  opacity: 1;
}
.project .unpin:hover {
  background: var(--late-bg);
  color: var(--late);
}
.project .top .badge {
  margin-left: 30px;
}
@media (hover: none) {
  .project .unpin {
    opacity: 0.7;
  }
}
.key-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 34px 20px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border-style: dashed;
}
.key-empty .star {
  font-size: 40px;
  color: var(--gold-light);
  line-height: 1;
}
.key-empty h3 {
  font-size: 22px;
  font-weight: 800;
}
.key-empty p {
  color: var(--muted);
  max-width: 520px;
  line-height: 1.7;
}
.key-empty .btn {
  margin-top: 6px;
}
.sugg-box {
  grid-column: 1 / -1;
  padding: 8px 18px 10px;
}
.sugg-h {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0 6px;
}
.sugg-h b {
  font-size: 16px;
}
.sugg-h span {
  font-size: 13px;
  color: var(--muted);
}
.sugg {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 9px 0;
}
.sugg .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
  flex-shrink: 0;
}
.sugg .dot.late {
  background: var(--late);
}
.sugg .dot.decision {
  background: var(--dec);
}
.sugg .nm {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: right;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0;
}
.sugg .nm small {
  font-weight: 400;
  font-size: 13px;
  color: var(--muted);
}
.sugg .nm:hover {
  color: var(--gold-deep);
}
.sugg .add {
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold-deep);
  font-weight: 800;
  font-size: 13px;
  border-radius: 999px;
  padding: 4px 12px 6px;
  white-space: nowrap;
}
.sugg .add:hover {
  background: var(--gold);
  color: #fff;
}
.sugg-toggle {
  grid-column: 1 / -1;
}
/* The hidden attribute wins over any display rule. */
[hidden] {
  display: none !important;
}

/* ------------------------------------------------- indicators and trend */
.kpis.five {
  grid-template-columns: repeat(5, 1fr);
}
.kpi.lic {
  background: linear-gradient(160deg, #fffaf0, #f1e9d4);
  border-color: var(--gold-light);
}
.kpi.lic .v {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--gold-deep);
}
.pf-trend {
  font-size: 15px;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 10px 4px;
  white-space: nowrap;
}
.pf-trend.up {
  color: var(--ok);
  background: var(--ok-bg);
}
.pf-trend.down {
  color: var(--late);
  background: var(--late-bg);
}
.pf-trend.flat {
  color: var(--muted);
  background: var(--gold-pale);
}
.pf-trend small {
  font-weight: 700;
  opacity: 0.8;
}
.perf-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.pf {
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pf.lic {
  grid-column: span 2;
  background: linear-gradient(160deg, #fffaf0, #f3ecd9);
  border-color: var(--gold-light);
}
.pf.fun,
.pf.load {
  grid-column: span 2;
}
.pf-t {
  font-size: 15px;
  font-weight: 800;
  color: var(--gold-deep);
}
.pf-big {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.pf-big b {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
}
.pf.lic .pf-big b {
  font-size: 56px;
  color: var(--gold-deep);
}
.pf-big.sm b {
  font-size: 34px;
}
.pf-big small {
  color: var(--muted);
  font-weight: 700;
}
.pf-sub {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}
.pf-sub b {
  color: var(--ink);
}
.pf-foot {
  margin-top: auto;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}
.pf-foot.warn-soft {
  color: var(--dec);
}
.pf-spark {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 92px;
}
.pf-spark .col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}
.pf-spark .col i {
  display: block;
  width: 100%;
  max-width: 34px;
  border-radius: 6px 6px 2px 2px;
  background: var(--gold-light);
  opacity: 0.55;
}
.pf-spark .col.cur i {
  background: linear-gradient(180deg, #c7a04a, var(--gold));
  opacity: 1;
}
.pf-spark .col span {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.pf-bars .row {
  display: grid;
  grid-template-columns: 96px 1fr 44px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 4px 0;
}
.pf-bars .bar {
  height: 10px;
  border-radius: 999px;
  background: var(--gold-pale);
  overflow: hidden;
}
.pf-bars .bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), #c7a04a);
}
.pf-bars .row.low .bar i {
  background: var(--late);
}
.pf-bars .row.mid .bar i {
  background: var(--dec);
}
.pf-bars .n {
  font-weight: 800;
  text-align: left;
}
.pf-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pf-ring {
  flex-shrink: 0;
  color: var(--ink);
}
.pf-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pf-trio > div {
  background: var(--bg);
  border-radius: 12px;
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
}
.pf-trio b {
  font-size: 26px;
  font-weight: 800;
}
.pf-trio small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.pf-trio .bad b {
  color: var(--late);
}
.pf-people {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 92px;
}
.pf-people .pp {
  flex: 1;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}
.pf-people .pp i {
  display: block;
  width: 100%;
  max-width: 30px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #c7a04a, var(--gold));
  transition: filter 0.15s;
}
.pf-people .pp:hover i {
  filter: brightness(1.15);
}
.pf-people .pp span {
  font-size: 11px;
  color: var(--muted);
  direction: ltr;
  white-space: nowrap;
}

/* ----------------------------------------------- follow-up point details */
.row button.body {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: right;
  color: inherit;
  cursor: pointer;
}
.row button.body:hover .tx {
  color: var(--gold-deep);
  text-decoration: underline;
  text-decoration-color: var(--gold-light);
}
.pt-tags {
  display: flex;
  gap: 8px;
  align-items: center;
}
.prio {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-deep);
  background: var(--gold-pale);
  border-radius: 999px;
  padding: 2px 10px 4px;
}
.prio.hi {
  color: var(--late);
  background: var(--late-bg);
}
.pt-facts {
  margin: 14px 0 4px;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}
.drawer .block .txt {
  white-space: pre-line;
  line-height: 1.8;
}

/* ------------------------------------------------- latest incoming letters */
.letter .new {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: var(--ok);
  border-radius: 999px;
  padding: 1px 8px 3px;
  margin-right: 6px;
}
.letter.fresh {
  animation: letterIn 1.4s ease;
}
@keyframes letterIn {
  0% {
    opacity: 0;
    transform: translateY(-10px);
    background: #f6ecd0;
  }
  40% {
    opacity: 1;
    transform: none;
    background: #f6ecd0;
  }
}

/* ---------------------------------------------------------- calendar */
#agenda {
  padding: 14px 16px 12px;
}
.cal-week {
  display: flex;
  align-items: stretch;
  gap: 4px;
}
.cal-nav {
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: 18px;
  font-weight: 800;
  padding: 0 4px;
  border-radius: 10px;
}
.cal-nav:hover:not(:disabled) {
  background: var(--gold-pale);
}
.cal-nav:disabled {
  opacity: 0.25;
  cursor: default;
}
.cal-day {
  flex: 1;
  min-width: 0;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 14px;
  padding: 6px 2px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  color: var(--ink);
  transition: background 0.15s;
}
.cal-day:hover {
  background: var(--bg);
}
.cal-day .dn {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.cal-day b {
  font-size: 19px;
  font-weight: 800;
}
.cal-day.past b {
  color: var(--muted);
}
.cal-day.weekend .dn {
  color: var(--gold-light);
}
.cal-day.today b {
  color: var(--gold-deep);
}
.cal-day.today .dn::after {
  content: " ·";
  color: var(--gold);
}
.cal-day.on {
  background: var(--gold);
  border-color: var(--gold);
}
.cal-day.on .dn,
.cal-day.on b {
  color: #fff;
}
.cal-day .dots {
  display: flex;
  gap: 3px;
  height: 8px;
  align-items: center;
}
.cal-day .dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}
.cal-day .dots i.pending {
  background: var(--dec);
}
.cal-day .dots i.resched {
  background: var(--late);
}
.cal-day.on .dots i {
  background: #fff;
}
.cal-day .dots small {
  font-size: 10px;
  color: var(--muted);
}
.cal-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 4px 8px;
  border-bottom: 1px solid var(--line);
}
.cal-head b {
  font-size: 16px;
}
.cal-head span {
  font-size: 13px;
  color: var(--muted);
}
.cal-allday {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px 4px;
}
.cal-allday .k {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.cal-chip {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 999px;
  padding: 3px 12px 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.cal-scroll {
  max-height: 470px;
  overflow-y: auto;
  margin-top: 6px;
}
.cal-grid {
  position: relative;
}
.cal-hour {
  position: absolute;
  right: 0;
  left: 0;
  border-top: 1px solid var(--line);
}
.cal-hour span {
  position: absolute;
  right: 4px;
  top: -9px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: var(--card);
  padding: 0 4px;
}
.cal-ev {
  position: absolute;
  border: 0;
  border-right: 4px solid var(--gold);
  background: #f6efdc;
  border-radius: 10px;
  padding: 6px 10px 6px 8px;
  text-align: right;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(78, 69, 41, 0.08);
  transition: transform 0.15s, box-shadow 0.15s;
}
.cal-ev:hover {
  transform: translateX(-2px);
  box-shadow: 0 8px 18px rgba(78, 69, 41, 0.16);
  z-index: 2;
}
.cal-ev .tm {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-deep);
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.cal-ev .tm em {
  font-style: normal;
  font-size: 11px;
  border-radius: 999px;
  padding: 0 7px 2px;
  background: var(--ok);
  color: #fff;
}
.cal-ev .tm em.pending {
  background: var(--dec-bg);
  color: var(--dec);
}
.cal-ev .tm em.resched {
  background: var(--late-bg);
  color: var(--late);
}
.cal-ev .tt {
  font-weight: 800;
  font-size: 14px;
  line-height: 1.45;
}
.cal-ev .pl {
  font-size: 12px;
  color: var(--muted);
}
.cal-ev.short {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
  padding-bottom: 2px;
}
.cal-ev.short .tt {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}
.cal-ev.pending {
  background: repeating-linear-gradient(-45deg, #fbf3df, #fbf3df 6px, #f6ead0 6px, #f6ead0 12px);
  border-right-color: var(--dec);
  outline: 1.5px dashed rgba(154, 106, 20, 0.45);
  outline-offset: -1.5px;
}
.cal-ev.resched {
  background: #f9e9e5;
  border-right-color: var(--late);
}
.cal-ev.past {
  opacity: 0.55;
}
.cal-ev.live {
  background: #fff6dc;
  box-shadow: 0 0 0 2px var(--gold), 0 8px 18px rgba(131, 117, 76, 0.2);
}
.cal-now {
  position: absolute;
  right: 48px;
  left: 0;
  height: 0;
  border-top: 2px solid var(--late);
  z-index: 3;
  pointer-events: none;
}
.cal-now::before {
  content: "";
  position: absolute;
  right: -5px;
  top: -6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--late);
}
.cal-now span {
  position: absolute;
  left: 0;
  top: -20px;
  font-size: 11px;
  font-weight: 800;
  color: var(--late);
  background: var(--card);
  padding: 0 4px;
}
.cal-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  padding: 34px 10px;
}
.cal-tag {
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 10px 4px;
  background: var(--gold-pale);
  color: var(--gold-deep);
}
.cal-tag.pending {
  background: var(--dec-bg);
  color: var(--dec);
}
.cal-tag.resched {
  background: var(--late-bg);
  color: var(--late);
}
.cal-note {
  font-size: 13px;
  color: var(--dec);
  background: var(--dec-bg);
  border-radius: 12px;
  padding: 10px 12px;
}

@media (max-width: 1100px) {
  .kpis.five {
    grid-template-columns: repeat(3, 1fr);
  }
  .perf-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 720px) {
  .kpis.five {
    grid-template-columns: repeat(2, 1fr);
  }
  .kpis.five .kpi.lic {
    grid-column: 1 / -1;
  }
  .perf-grid {
    grid-template-columns: 1fr;
  }
  .pf.lic,
  .pf.fun,
  .pf.load {
    grid-column: auto;
  }
  .cal-day .dn {
    font-size: 10px;
  }
  .cal-day b {
    font-size: 16px;
  }
}
.pf.load {
  grid-column: 1 / -1;
}
.pf.load .pf-people {
  height: 110px;
}
@media (max-width: 1100px) {
  .pf.load {
    grid-column: 1 / -1;
  }
}
