/* Damascene heritage: warm stone, olive and gold, the Umayyad Mosque at
   the top of every page, a green rail with the sections on the right.
   Loaded after styles.css and map3d.css: it redefines their tokens and
   lays the new frame (rail, top bar, photo band) over the same pages. */

:root {
  --bg: #efe5d0;
  --card: rgba(255, 251, 242, 0.94);
  --line: rgba(90, 66, 30, 0.14);
  --gold: #a8812f;
  --gold-light: #cfa955;
  --gold-pale: #f3e8cc;
  --gold-deep: #6b5020;
  --ink: #2a2116;
  --muted: #7a6a52;
  --ok: #2f7a5f;
  --ok-bg: #dcebe2;
  --dec: #946410;
  --dec-bg: #f6e7c6;
  --late: #a83c28;
  --late-bg: #f5ddd5;
  --green: #233f35;
  --green-2: #2f5446;
  --radius: 18px;
  --shadow: 0 0 0 1px rgba(168, 129, 47, 0.1), 0 16px 34px rgba(80, 60, 25, 0.09);
  --rail-w: 84px;
}

html,
body {
  background: var(--bg);
}
body {
  padding-right: var(--rail-w);
  position: relative;
  min-height: 100vh;
}

/* ------------------------------------------------------------ photo band */
.hero {
  position: absolute;
  top: 0;
  right: var(--rail-w);
  left: 0;
  height: 540px;
  overflow: hidden;
  pointer-events: none;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/hero_umayyad.webp") center 52% / cover no-repeat;
  filter: sepia(0.55) saturate(0.85) contrast(1.02);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(239, 229, 208, 0) 0%, rgba(239, 229, 208, 0.2) 48%, rgba(239, 229, 208, 0.92) 88%, var(--bg) 100%),
    linear-gradient(90deg, rgba(35, 28, 18, 0.12), rgba(35, 28, 18, 0.58));
}
/* ------------------------------------------------------------------ rail */
.rail {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 0;
  background: var(--green);
  box-shadow: -8px 0 30px rgba(20, 35, 28, 0.18);
}
.rail-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #fffaf0;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.rail-logo .logo {
  height: auto;
  width: 44px;
}
.rail .tab,
.rail .rjump {
  width: 64px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: rgba(240, 230, 205, 0.72);
  padding: 9px 0 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: none;
  transition: background 0.2s, color 0.2s;
}
.rail .tab svg,
.rail .rjump svg {
  width: 23px;
  height: 23px;
}
.rail .tab:hover,
.rail .rjump:hover {
  background: rgba(240, 230, 205, 0.08);
  color: #fff8ea;
}
.rail .tab.is-active {
  background: linear-gradient(140deg, #d8b45e, #9a7426);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(207, 169, 85, 0.18), 0 8px 20px rgba(0, 0, 0, 0.25);
}
.rail .rjump {
  position: relative;
}
.rail .tab + .rjump,
.rail .rjump + .tab {
  margin-top: 0;
}

/* --------------------------------------------------------------- top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr minmax(380px, 640px) 1fr;
  align-items: center;
  gap: 18px;
  padding: 16px 32px;
  background: transparent;
  border-bottom: 1px solid transparent;
  backdrop-filter: none;
  transition: background 0.3s, border-color 0.3s, padding 0.3s;
}
body.scrolled .topbar {
  background: rgba(35, 63, 53, 0.94);
  backdrop-filter: blur(12px);
  border-bottom-color: rgba(0, 0, 0, 0.1);
  padding-top: 10px;
  padding-bottom: 10px;
}
.topbar .today {
  margin: 0;
  justify-self: start;
  color: #fff8ea;
  font-weight: 700;
  font-size: 15px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
.topbar .tools {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar .live-pill {
  background: rgba(255, 251, 242, 0.9);
  box-shadow: 0 6px 16px rgba(30, 20, 8, 0.15);
}

/* «اسألني»: the smart search as an ask bar, with room for the voice */
.gsearch.ask {
  position: relative;
  flex: none;
  width: 100%;
  max-width: none;
  margin: 0;
  justify-self: center;
}
.gsearch.ask input {
  height: 52px;
  font-size: 16px;
  padding: 0 64px 2px 52px;
  border-radius: 999px;
  border: 1px solid rgba(255, 248, 234, 0.35);
  background: rgba(30, 24, 16, 0.32)
    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='%23f3e8cc' 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 left 20px center;
  backdrop-filter: blur(14px);
  color: #fff8ea;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 14px 34px rgba(30, 20, 8, 0.22);
}
.gsearch.ask input::placeholder {
  color: rgba(255, 248, 234, 0.75);
}
.gsearch.ask input:focus {
  background-color: rgba(255, 251, 242, 0.97);
  color: var(--ink);
  border-color: var(--gold);
  box-shadow: 0 0 0 5px rgba(207, 169, 85, 0.25), 0 14px 34px rgba(30, 20, 8, 0.22);
}
.gsearch.ask input:focus::placeholder {
  color: var(--muted);
}
.gsearch.ask kbd {
  left: auto;
  right: 60px;
  color: rgba(255, 248, 234, 0.7);
  border-color: rgba(255, 248, 234, 0.3);
}
.gsearch.ask input:focus ~ kbd {
  display: none;
}
.gsearch.ask .mic {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #d8b45e, #9a7426);
  color: #fff;
  box-shadow: 0 4px 12px rgba(120, 90, 30, 0.35);
}
.gsearch.ask .mic svg {
  width: 20px;
  height: 20px;
}
.gsearch.ask .gresults {
  right: 0;
  left: 0;
  width: auto;
}

/* ------------------------------------------------------- page beginnings */
main {
  position: relative;
  z-index: 1; /* above the photo band and the lattice */
  padding-top: 40px;
}
.page-lead h1 {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff8ea;
  text-shadow: 0 3px 22px rgba(0, 0, 0, 0.5);
  margin: 0;
}
.page-lead p,
.page-lead .hint {
  color: rgba(255, 248, 234, 0.85) !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  font-size: 17px;
  margin-top: 6px;
}
.page-lead {
  margin-bottom: 64px;
}
.mail-head.page-lead {
  align-items: flex-end;
}
.mail-head.page-lead .seg {
  background: rgba(255, 251, 242, 0.88);
  backdrop-filter: blur(10px);
}

/* ---------------------------------------------------------------- cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid rgba(168, 129, 47, 0.55);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.map-stage.card {
  border-top: 0;
}
.kpi .v {
  color: var(--ink);
}
.kpi.lic {
  background: linear-gradient(160deg, #fbf1d8, #fffaf0);
  border-color: rgba(168, 129, 47, 0.3);
}
.section-head h2 {
  color: var(--ink);
}
.section-head h2::before {
  background: linear-gradient(180deg, #cfa955, #8d6a24);
}
.chip.is-on,
.btn {
  background: linear-gradient(140deg, #c9a24a, #8d6a24);
  border-color: transparent;
}
.btn.ghost {
  background: transparent;
  border-color: var(--gold);
}
.credit {
  margin: 34px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* ------------------------------------------------------------ narrow */
@media (max-width: 1100px) {
  :root {
    --rail-w: 74px;
  }
  .rail .tab,
  .rail .rjump {
    width: 58px;
    font-size: 10.5px;
  }
  .topbar {
    grid-template-columns: auto 1fr auto;
  }
}
@media (max-width: 720px) {
  :root {
    --rail-w: 0px;
  }
  body {
    padding-bottom: 74px;
  }
  /* The rail becomes a tab bar at the bottom. */
  .rail {
    top: auto;
    bottom: 0;
    left: 0;
    width: auto;
    height: 66px;
    flex-direction: row;
    justify-content: space-around;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    gap: 0;
    box-shadow: 0 -8px 24px rgba(20, 35, 28, 0.2);
  }
  .rail-logo {
    display: none;
  }
  .rail .tab,
  .rail .rjump {
    width: auto;
    flex: 1;
    padding: 6px 0 4px;
    font-size: 10.5px;
    border-radius: 12px;
  }
  .rail .tab svg,
  .rail .rjump svg {
    width: 21px;
    height: 21px;
  }
  .hero {
    height: 330px;
  }
  .topbar {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
  }
  .topbar .today {
    display: none;
  }
  .gsearch.ask {
    flex: 1;
  }
  .gsearch.ask input {
    width: 100%;
    height: 44px;
    padding: 0 54px 2px 44px;
    color: #fff8ea;
    background-position: left 14px center;
    cursor: text;
  }
  .gsearch.ask input::placeholder {
    color: rgba(255, 248, 234, 0.75);
  }
  .gsearch.ask:focus-within input {
    position: static;
    padding: 0 54px 2px 44px;
    background-position: left 14px center;
  }
  .gsearch.ask kbd {
    display: none;
  }
  .gsearch.ask .mic {
    width: 34px;
    height: 34px;
    right: 5px;
  }
  .gsearch.ask .gresults {
    position: fixed;
    top: 64px;
  }
  main {
    padding-top: 22px;
  }
  .page-lead h1 {
    font-size: 30px;
  }
  .page-lead p {
    font-size: 14px;
  }
  .page-lead {
    margin-bottom: 30px;
  }
}

/* ================================================ follow-up page (stage 2) */
.hk-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hk-row {
  display: grid;
  grid-template-columns: 4fr 3fr 3fr 2fr;
  gap: 16px;
}
.hk-strip {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 12px;
}
.hk,
.hk-mini,
.hk-map {
  text-align: right;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.hk:hover,
.hk-mini:hover,
.hk-map:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(168, 129, 47, 0.18), 0 22px 40px rgba(80, 60, 25, 0.14);
}
.hk {
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hk-t {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
  color: var(--gold-deep);
}
.hk-t .ic {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--gold-pale);
  color: var(--gold);
  flex-shrink: 0;
}
.hk-t .ic svg {
  width: 18px;
  height: 18px;
}
.hk-t .r {
  margin-right: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.hk-big {
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  color: var(--gold-deep);
  margin-bottom: 10px;
}
.hk-foot {
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--muted);
}
.hk-lic {
  background: linear-gradient(160deg, #fbf0d4, #fffaf0 70%);
  border-color: rgba(168, 129, 47, 0.3);
}
.hk-lic-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}
.hk-cols {
  flex: 1;
  max-width: 300px;
  height: 118px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.hk-cols > div {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}
.hk-cols i {
  display: block;
  width: 100%;
  max-width: 26px;
  border-radius: 8px 8px 3px 3px;
  background: rgba(168, 129, 47, 0.25);
}
.hk-cols .cur i {
  background: linear-gradient(180deg, #e0bd68, #8d6a24);
  box-shadow: 0 6px 16px rgba(168, 129, 47, 0.4);
}
.hk-cols em {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  color: var(--gold-deep);
  min-height: 14px;
}
.hk-cols span {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.hk-gauge {
  position: relative;
  height: 136px;
}
.hk-gauge svg {
  width: 100%;
  height: 100%;
}
.hk-gauge .tk {
  stroke: rgba(90, 66, 30, 0.16);
}
.hk-gauge .tk.on {
  stroke: #c2573f;
}
.hk-gauge .track {
  stroke: rgba(90, 66, 30, 0.08);
}
.hk-gauge .g0 {
  stop-color: #d99a2b;
}
.hk-gauge .g1 {
  stop-color: #a83c28;
}
.hk-gauge .v {
  position: absolute;
  right: 0;
  left: 0;
  bottom: 2px;
  text-align: center;
}
.hk-gauge .v b {
  display: block;
  font-size: 38px;
  font-weight: 800;
  line-height: 1.05;
}
.hk-gauge .v small {
  font-size: 13px;
  color: var(--muted);
}
.hk-ring {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}
.hk-ring svg {
  flex-shrink: 0;
}
.hk-ring .track {
  stroke: rgba(90, 66, 30, 0.08);
}
.hk-ring .arc {
  stroke: #a8812f;
  filter: drop-shadow(0 0 5px rgba(168, 129, 47, 0.35));
}
.hk-ring .lbl {
  fill: var(--ink);
  font-family: inherit;
}
.hk-mid {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
}
.hk-sub {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}
.hk-sub b {
  color: var(--gold-deep);
}
.hk-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hk-stack .hk-mini {
  flex: 1;
}
.hk-mini {
  padding: 13px 15px 13px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.hk-mini .l {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--gold-deep);
  line-height: 1.35;
}
.hk-mini .v {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hk-mini .v .pf-trend {
  font-size: 12px;
  padding: 1px 8px 3px;
}
.hk-mini .s {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.hk-mini .s.warn {
  color: var(--late);
}
.hk-strip .hk-mini {
  border-top-width: 2px;
}
.hk-strip .hk-mini.new {
  background: linear-gradient(180deg, rgba(220, 235, 226, 0.55), var(--card) 46%);
}
.hk-strip .hk-mini.new .l::after {
  content: " ●";
  color: var(--ok);
  font-size: 8px;
  vertical-align: 3px;
}

/* Sections in a grid */
.fgrid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 22px 18px;
  align-items: start;
}
.f-projects {
  grid-column: span 8;
}
.f-letters {
  grid-column: span 4;
}
.f-points {
  grid-column: span 7;
}
.f-agenda {
  grid-column: span 5;
}
.f-map {
  grid-column: span 7;
}
.f-funnel {
  grid-column: span 5;
}
.fgrid .project-grid {
  grid-template-columns: repeat(2, 1fr);
}
.fgrid .section-head {
  flex-wrap: wrap;
}

/* Project cards: lighter, with a stage bar in segments */
.project {
  border-right-width: 4px;
  padding: 16px 18px;
  gap: 12px;
}
.project .name {
  font-size: 18px;
}
.last {
  background: #f8f0dd;
}
.stepper {
  gap: 5px;
}
.step + .step::before {
  display: none;
}
.dot {
  width: 100%;
  height: 7px;
  border-radius: 99px;
  border: 0;
  background: rgba(90, 66, 30, 0.1);
}
.step.done .dot {
  background: linear-gradient(90deg, #d8b45e, #a8812f);
  border: 0;
}
.step.cur .dot {
  box-shadow: 0 0 10px rgba(168, 129, 47, 0.5);
}
.stepper.late .step.done .dot {
  background: linear-gradient(90deg, #d9725c, #a83c28);
}
.stepper.late .step.cur .dot {
  box-shadow: 0 0 10px rgba(168, 60, 40, 0.4);
}
.step {
  font-size: 11.5px;
}

/* Letters: an envelope beside each */
#letters .row.letter {
  align-items: flex-start;
}
#letters .dirtag {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 0;
  flex-shrink: 0;
  background: var(--ok-bg)
    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='%232f7a5f' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 7l9 6 9-6'/%3E%3C/svg%3E")
    no-repeat center;
}
#letters .state {
  display: none;
}
#letters .tx {
  font-weight: 700;
  line-height: 1.5;
}

/* Mini map */
.hk-map {
  padding: 16px 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mm-wrap {
  position: relative;
  width: 100%;
}
.mm-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.mm-shadow {
  fill: rgba(80, 60, 25, 0.13);
}
.mm-gov {
  stroke: #fffaf0;
  stroke-width: 1.4;
  transition: filter 0.15s;
}
.mm-gov.zero {
  fill: #f2ead8;
  stroke: #d8c8a4;
}
.mm-gov:hover {
  filter: brightness(1.08) drop-shadow(0 0 6px rgba(168, 129, 47, 0.45));
}
.mm-river {
  fill: none;
  stroke: #6a9fbe;
  stroke-width: 1.4;
  stroke-opacity: 0.65;
  pointer-events: none;
}
.mm-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.mm-lbl {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.mm-lbl b {
  min-width: 28px;
  height: 28px;
  padding: 0 4px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 800;
  background: #fffaf0;
  border: 1.5px solid rgba(168, 129, 47, 0.55);
  box-shadow: 0 3px 8px rgba(80, 60, 25, 0.15);
}
.mm-lbl.top b {
  background: linear-gradient(140deg, #d8b45e, #8d6a24);
  color: #fff;
  border-color: transparent;
}
.mm-lbl.zero {
  opacity: 0.55;
}
.mm-lbl small {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  text-shadow: 0 0 3px #fff7e6, 0 0 6px #fff7e6;
  white-space: nowrap;
}
.mm-pin {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50% 50% 50% 0;
  transform: translate(-50%, -100%) rotate(-45deg);
  background: var(--c);
  border: 1.5px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.mm-pin.decision {
  border-color: #f2b33a;
}
.mm-pin.late {
  border-color: #c2412b;
}
.mm-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.mm-legend {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mm-legend i {
  width: 90px;
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, #eadcb8, #b9a061, #2f7a5f);
}
.mm-open {
  font-weight: 800;
  color: var(--gold-deep);
}

/* Stage conversion */
.hk-steps {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 4px;
}
.hk-steps .st {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.hk-steps .bar {
  height: 26px;
  border-radius: 9px;
  background: rgba(90, 66, 30, 0.07);
  overflow: hidden;
}
.hk-steps .bar i {
  display: block;
  height: 100%;
  border-radius: 9px;
  background: linear-gradient(90deg, rgba(47, 122, 95, 0.45), #2f7a5f);
}
.hk-steps .st.last .bar i {
  background: linear-gradient(90deg, #d8b45e, #8d6a24);
}
.hk-steps .n {
  font-weight: 800;
  text-align: left;
}
.hk-steps .n small {
  margin-right: 4px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}
.hk-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 6px;
}
.hk-trio > div {
  background: #f8f0dd;
  border-radius: 12px;
  padding: 9px 11px 10px;
  display: flex;
  flex-direction: column;
}
.hk-trio b {
  font-size: 24px;
  font-weight: 800;
}
.hk-trio small {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}
.hk-trio .bad b {
  color: var(--late);
}

@media (max-width: 1300px) {
  .hk-strip {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 1100px) {
  .hk-row {
    grid-template-columns: 1fr 1fr;
  }
  .hk-stack {
    flex-direction: row;
  }
  .f-projects,
  .f-letters,
  .f-points,
  .f-agenda,
  .f-map,
  .f-funnel {
    grid-column: 1 / -1;
  }
}
@media (max-width: 720px) {
  .hk-row {
    grid-template-columns: 1fr;
  }
  .hk-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .fgrid .project-grid {
    grid-template-columns: 1fr;
  }
  .hk-big {
    font-size: 52px;
  }
}

/* ======================================= stage 4: drawers, mail, team */

/* Side drawers (project, point, appointment, demo letter) */
.drawer {
  background: #fffaf0;
  border-right: 0;
  box-shadow: 24px 0 60px rgba(35, 28, 18, 0.28);
  padding-top: 34px;
}
.drawer::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--green), #a8812f 70%, #d8b45e);
}
.drawer::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 0;
  left: 0;
  height: 70px;
  pointer-events: none;
  opacity: 0.1;
  background:
    radial-gradient(circle at 18px 18px, transparent 7px, #a8812f 8px, #a8812f 9px, transparent 10px) 0 0 / 36px 36px,
    conic-gradient(from 45deg, #a8812f 0 25%, transparent 0 50%, #a8812f 0 75%, transparent 0) 0 0 / 18px 18px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent);
  mask-image: linear-gradient(180deg, #000, transparent);
}
.drawer > *:not(.drawer-close) {
  position: relative;
  z-index: 1;
}
.drawer-close {
  background: var(--green);
  color: #f3e8cc;
  top: 18px;
  z-index: 2;
}
.drawer-close:hover {
  background: var(--green-2);
}
.drawer h3 {
  font-size: 26px;
  line-height: 1.4;
  color: var(--ink);
}
.drawer .block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}
.drawer .block > .k {
  font-size: 13px;
  color: var(--gold-deep);
  display: flex;
  align-items: center;
  gap: 8px;
}
.drawer .block > .k::before {
  content: "";
  width: 6px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, #cfa955, #8d6a24);
}
.drawer .pin-row {
  border-top: 0;
  padding-top: 0;
}
.scrim {
  background: rgba(35, 28, 18, 0.32);
  backdrop-filter: blur(2px);
}

/* Mail */
.md-block .ai {
  color: var(--ok);
  background: var(--ok-bg);
}
.mail-detail {
  border-top-width: 3px;
}
.md-head h2 {
  color: var(--ink);
}
.md-facts {
  background: #fffaf0;
}
.fact .k,
.md-block .k,
.md-files .k {
  color: var(--gold-deep);
}
.md-files .file {
  background: #f8f0dd;
}
.mrow.on {
  background: linear-gradient(90deg, transparent, var(--gold-pale) 40%);
  border-right-color: var(--gold);
}
.viewer {
  background: rgba(35, 28, 18, 0.5);
}
.viewer-box {
  background: #fffaf0;
}
.viewer-bar {
  background: var(--green);
  color: #fff8ea;
  border-bottom: 3px solid #a8812f;
}
.viewer-bar .btn.ghost {
  color: #f3e8cc;
  border-color: rgba(243, 232, 204, 0.5);
}
.viewer-bar .drawer-close {
  background: rgba(243, 232, 204, 0.14);
}

/* Team member page: a green header like the rail */
.member {
  background: rgba(35, 28, 18, 0.45);
}
.member-box {
  background: #f6eedb;
  padding-top: 0;
}
.mb-head {
  margin: 0 -30px 4px;
  padding: 28px 30px 24px 70px;
  background:
    radial-gradient(circle at 22px 22px, transparent 8px, rgba(216, 180, 94, 0.22) 9px, rgba(216, 180, 94, 0.22) 10px, transparent 11px) 0 0 / 44px 44px,
    linear-gradient(135deg, var(--green), var(--green-2));
  color: #fff8ea;
  border-bottom: 3px solid #a8812f;
}
.mb-head .role {
  color: #e0bd68;
}
.mb-head h2 {
  color: #fff8ea;
}
.mb-head .meta {
  color: rgba(255, 248, 234, 0.75);
}
.mb-head .tm-face {
  border-color: #d8b45e;
  box-shadow: 0 0 0 5px rgba(216, 180, 94, 0.2), 0 10px 24px rgba(0, 0, 0, 0.25);
}
.member-box > .drawer-close {
  top: 18px;
  left: 18px;
  background: rgba(243, 232, 204, 0.16);
  color: #fff8ea;
}
.mt-tile,
.mb-card {
  background: #fffaf0;
  border-top: 3px solid rgba(168, 129, 47, 0.45);
}
.mt-tile.gold {
  background: linear-gradient(160deg, #fbf0d4, #fffaf0);
}
.mt-tile.na {
  background: transparent;
  border-top-style: dashed;
}

/* Search results under «اسألني» */
.gresults {
  border-top: 3px solid #a8812f;
  background: #fffaf0;
}
.gg-h {
  color: var(--gold-deep);
}

/* The team list beside the circle */
.tm-name {
  background: #fffaf0;
  border-top: 2px solid rgba(168, 129, 47, 0.5);
}
.tm-main {
  background: radial-gradient(circle at 30% 25%, #e0bd68, #a8812f 55%, #6b5020);
}
@media (max-width: 720px) {
  .mb-head {
    margin: 0 -16px 4px;
    padding: 22px 16px 18px 56px;
  }
}

/* ==================================================== visual fixes */

/* The photo: darker behind the title so the minarets do not compete */
.hero::after {
  background:
    linear-gradient(180deg, rgba(239, 229, 208, 0) 0%, rgba(239, 229, 208, 0.2) 48%, rgba(239, 229, 208, 0.92) 88%, var(--bg) 100%),
    linear-gradient(90deg, rgba(35, 28, 18, 0.18), rgba(35, 28, 18, 0.48) 50%, rgba(35, 28, 18, 0.72)),
    radial-gradient(700px 260px at 85% 26%, rgba(25, 18, 10, 0.35), transparent 70%);
}
.page-lead p,
.page-lead .hint {
  color: #fff8ea !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 2px 14px rgba(0, 0, 0, 0.55);
  font-weight: 700;
}
/* Mashrabiya as a small ornament under each page title, instead of a band
   that showed beside and between the cards */
.page-lead > div:first-child::after,
.hello.page-lead::after,
#page-map .page-lead::after {
  content: "";
  display: block;
  width: 220px;
  height: 18px;
  margin-top: 12px;
  opacity: 0.8;
  background:
    radial-gradient(circle at 9px 9px, transparent 4px, #e0bd68 4.6px, #e0bd68 5.6px, transparent 6.2px) 0 0 / 18px 18px,
    conic-gradient(from 45deg, rgba(224, 189, 104, 0.55) 0 25%, transparent 0 50%, rgba(224, 189, 104, 0.55) 0 75%, transparent 0) 0 0 / 9px 9px;
  -webkit-mask-image: linear-gradient(270deg, #000 55%, transparent);
  mask-image: linear-gradient(270deg, #000 55%, transparent);
}

/* «اسألني»: the shortcut beside the search glass, clear of the text */
.gsearch.ask input {
  padding-left: 82px;
}
.gsearch.ask kbd {
  right: auto;
  left: 46px;
}

/* The strip of small indicators: four to a row, the "new" mark a corner dot */
.hk-strip {
  grid-template-columns: repeat(4, 1fr);
}
.hk-strip .hk-mini {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "l v" "s v";
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
  padding: 12px 16px;
}
.hk-strip .hk-mini .l {
  grid-area: l;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hk-strip .hk-mini .s {
  grid-area: s;
}
.hk-strip .hk-mini .v {
  grid-area: v;
  font-size: 30px;
}
.hk-strip .hk-mini.new .l::after {
  content: none;
}
.hk-strip .hk-mini.new::after {
  content: "";
  position: absolute;
  top: 9px;
  left: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(47, 122, 95, 0.15);
}
.hk-cols span {
  font-size: 12px;
  font-weight: 700;
}
.hk-lic .pf-trend small {
  font-size: 12px;
}

/* Section heads: filters beside their own title, letters on one line */
.f-projects .section-head .chips {
  margin-right: 14px;
}
.f-letters .section-head {
  flex-wrap: nowrap;
}
.f-letters .section-head h2 {
  white-space: nowrap;
}
.f-letters .section-head .chips {
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}
.f-letters .section-head .chips .hint {
  font-size: 13px;
  white-space: nowrap;
}
.f-letters .section-head .chips .chip {
  white-space: nowrap;
  font-size: 13px;
  padding: 4px 11px 6px;
}

/* Project cards: the status edge alone (no gold top edge beside it), and an
   odd last card across both columns */
.project.card {
  border-top: 1px solid var(--line);
}
.fgrid .project-grid .project.wide {
  grid-column: 1 / -1;
}

@media (max-width: 1100px) {
  .hk-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 720px) {
  .hk-strip {
    grid-template-columns: 1fr;
  }
  .gsearch.ask input {
    padding-left: 44px;
  }
  .f-letters .section-head {
    flex-wrap: wrap;
  }
  .page-lead > div:first-child::after,
  .hello.page-lead::after,
  #page-map .page-lead::after {
    width: 150px;
    margin-top: 8px;
  }
}
/* Rivers run on past the border: keep them inside the mini map. */
.mm-wrap,
.mm-svg {
  overflow: hidden;
}
@media (max-width: 720px) {
  /* Six sections in a 390px bar: the buttons share the width evenly. */
  .rail {
    padding-right: 2px;
    padding-left: 2px;
    overflow: hidden;
  }
  .rail .tab,
  .rail .rjump {
    flex: 1 1 0;
    min-width: 0;
    font-size: 10px;
  }
  .rail .tab span,
  .rail .rjump span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
/* Grid columns that may shrink below their contents' width (the bars,
   the gauge), so the cards fit the screen. */
.hk-row > *,
.hk-strip > *,
.hk-stack > *,
.fgrid > * {
  min-width: 0;
}
.hk-cols {
  min-width: 0;
}
@media (max-width: 720px) {
  .hk-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .hk-stack {
    flex-direction: row;
  }
  .hk-lic-row {
    gap: 12px;
  }
}

/* ===================================================== calendar page */
.agenda-open {
  margin-right: auto;
  font-size: 13px;
  padding: 4px 12px 6px;
}
#calendar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cal2-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 16px;
}
.cal2-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cal2-btn {
  border: 1px solid var(--line);
  background: #fffaf0;
  color: var(--gold-deep);
  font-weight: 800;
  border-radius: 10px;
  padding: 5px 12px 7px;
  font-size: 15px;
}
.cal2-btn:hover {
  background: var(--gold-pale);
}
.cal2-btn.today {
  background: linear-gradient(140deg, #c9a24a, #8d6a24);
  border-color: transparent;
  color: #fff;
}
.cal2-title {
  margin: 0 10px 0 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
}
.cal2-legend {
  display: flex;
  gap: 14px;
  font-size: 12.5px;
  color: var(--muted);
  margin-right: auto;
}
.cal2-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cal2-legend i {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}
.cal2-legend i.sched,
.cal2-ev.sched,
.cal2-chip.sched,
.cal2-mchip.sched {
  --c: #a8812f;
  --b: #f6ecd2;
}
.cal2-legend i.pending,
.cal2-ev.pending,
.cal2-chip.pending,
.cal2-mchip.pending {
  --c: #c98a1b;
  --b: #fbf0d8;
}
.cal2-legend i.resched,
.cal2-ev.resched,
.cal2-chip.resched,
.cal2-mchip.resched {
  --c: #a83c28;
  --b: #f7e2dc;
}
.cal2-legend i.done,
.cal2-ev.done,
.cal2-chip.done,
.cal2-mchip.done {
  --c: #2f7a5f;
  --b: #e3efe7;
}
.cal2-ev.cancel,
.cal2-chip.cancel,
.cal2-mchip.cancel {
  --c: #8a8070;
  --b: #eee8dc;
  text-decoration: line-through;
}
.cal2-legend i {
  background: var(--b);
  border: 2px solid var(--c);
}
.cal2-views button {
  font-size: 14px;
}
.cal2-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

/* Week */
.cal2-week {
  padding: 0;
  overflow: hidden;
}
.cal2-head,
.cal2-allday {
  display: grid;
  grid-template-columns: 62px repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}
.cal2-corner {
  border-left: 1px solid var(--line);
}
.cal2-corner.k {
  font-size: 11px;
  color: var(--muted);
  padding: 8px 6px;
  font-weight: 700;
}
.cal2-dh {
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  padding: 10px 4px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  color: var(--ink);
}
.cal2-dh:hover {
  background: rgba(243, 232, 204, 0.5);
}
.cal2-dh span {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.cal2-dh b {
  font-size: 24px;
  font-weight: 800;
  width: 40px;
  height: 40px;
  line-height: 40px;
  border-radius: 50%;
}
.cal2-dh small {
  font-size: 11px;
  color: var(--gold-deep);
  font-weight: 700;
}
.cal2-dh.today b {
  background: linear-gradient(140deg, #d8b45e, #8d6a24);
  color: #fff;
}
.cal2-dh.past b {
  color: var(--muted);
}
.cal2-dh.weekend,
.cal2-col.weekend {
  background: rgba(243, 232, 204, 0.32);
}
.cal2-adcell {
  border-left: 1px solid var(--line);
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 120px;
  overflow-y: auto;
}
.cal2-chip {
  border: 0;
  border-right: 3px solid var(--c);
  background: var(--b);
  color: var(--ink);
  border-radius: 6px;
  padding: 3px 7px 4px;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal2-scroll {
  max-height: 640px;
  overflow-y: auto;
}
.cal2-grid {
  position: relative;
  display: grid;
  grid-template-columns: 62px repeat(7, minmax(0, 1fr));
}
.cal2-hours {
  position: relative;
  border-left: 1px solid var(--line);
}
.cal2-hr {
  position: absolute;
  right: 0;
  left: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  transform: translateY(-50%);
}
.cal2-hr:first-child {
  transform: none;
}
.cal2-col {
  position: relative;
  border-left: 1px solid var(--line);
}
.cal2-col.today {
  background: rgba(216, 180, 94, 0.07);
}
.cal2-line {
  position: absolute;
  right: 0;
  left: 0;
  border-top: 1px solid rgba(90, 66, 30, 0.08);
}
.cal2-ev {
  position: absolute;
  border: 0;
  border-right: 4px solid var(--c);
  background: var(--b);
  color: var(--ink);
  border-radius: 9px;
  padding: 5px 8px 5px 6px;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(80, 60, 25, 0.1);
  transition: box-shadow 0.15s, transform 0.15s;
  z-index: 1;
}
.cal2-ev:hover {
  z-index: 3;
  transform: translateX(-2px);
  box-shadow: 0 10px 22px rgba(80, 60, 25, 0.2);
}
.cal2-ev .tm {
  font-size: 11px;
  font-weight: 800;
  color: var(--c);
}
.cal2-ev .tt {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}
.cal2-ev .pl {
  font-size: 11px;
  color: var(--muted);
}
.cal2-ev.short {
  padding-top: 2px;
  padding-bottom: 2px;
}
.cal2-ev.short .tm {
  display: none;
}
.cal2-ev.short .tt {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}
.cal2-ev.pending {
  background: repeating-linear-gradient(-45deg, #fbf0d8 0 6px, #f6e5bf 6px 12px);
}
.cal2-ev.past {
  opacity: 0.6;
}
.cal2-now {
  position: absolute;
  right: 0;
  left: 0;
  height: 0;
  border-top: 2px solid var(--late);
  z-index: 4;
  pointer-events: none;
}
.cal2-now::before {
  content: "";
  position: absolute;
  right: -5px;
  top: -6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--late);
}

/* Month */
.cal2-month {
  padding: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.cal2-mh {
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.cal2-mc {
  min-height: 118px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cal2-mc.out {
  background: rgba(239, 229, 208, 0.45);
}
.cal2-mc.out .cal2-md {
  color: rgba(122, 106, 82, 0.5);
}
.cal2-mc.weekend {
  background: rgba(243, 232, 204, 0.32);
}
.cal2-md {
  align-self: flex-start;
  border: 0;
  background: transparent;
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  padding: 0;
}
.cal2-md:hover {
  background: var(--gold-pale);
}
.cal2-mc.today .cal2-md {
  background: linear-gradient(140deg, #d8b45e, #8d6a24);
  color: #fff;
}
.cal2-mchip {
  border: 0;
  border-right: 3px solid var(--c);
  background: var(--b);
  color: var(--ink);
  border-radius: 5px;
  padding: 2px 6px 3px;
  font-size: 11.5px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal2-mchip b {
  color: var(--c);
  margin-left: 4px;
  font-size: 11px;
}
.cal2-more {
  border: 0;
  background: transparent;
  color: var(--gold-deep);
  font-weight: 800;
  font-size: 11.5px;
  text-align: right;
  padding: 0 4px;
}

/* List */
.cal2-list {
  padding: 6px 18px;
}
.cal2-lday {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.cal2-lday:first-child {
  border-top: 0;
}
.cal2-ldate {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--muted);
}
.cal2-ldate b {
  font-size: 30px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
}
.cal2-ldate span {
  font-weight: 700;
  font-size: 13px;
}
.cal2-ldate small {
  font-size: 12px;
}
.cal2-lday.today .cal2-ldate b {
  color: var(--gold);
}
.cal2-litems {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cal2-li {
  display: grid;
  grid-template-columns: 112px 1fr auto;
  align-items: center;
  gap: 12px;
  border: 0;
  border-right: 4px solid var(--c);
  background: var(--b);
  border-radius: 10px;
  padding: 9px 12px;
  text-align: right;
  color: var(--ink);
}
.cal2-li .t {
  font-size: 13px;
  font-weight: 800;
  color: var(--c);
}
.cal2-li .n {
  font-weight: 800;
  display: flex;
  flex-direction: column;
}
.cal2-li .n small {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}
.cal2-li .s {
  font-size: 12px;
  font-weight: 800;
  color: var(--c);
  white-space: nowrap;
}
.cal2-li.sched,
.cal2-li.pending,
.cal2-li.resched,
.cal2-li.done,
.cal2-li.cancel {
  --c: inherit;
}
.cal2-li.sched { --c: #a8812f; --b: #f6ecd2; }
.cal2-li.pending { --c: #c98a1b; --b: #fbf0d8; }
.cal2-li.resched { --c: #a83c28; --b: #f7e2dc; }
.cal2-li.done { --c: #2f7a5f; --b: #e3efe7; }
.cal2-li.cancel { --c: #8a8070; --b: #eee8dc; }
.cal2-empty {
  padding: 50px 10px;
  text-align: center;
}

/* Side column */
.cal2-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 90px;
}
.cal2-sum {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 12px;
  gap: 6px;
}
.cal2-sum > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f8f0dd;
  border-radius: 12px;
  padding: 8px 4px 9px;
}
.cal2-sum b {
  font-size: 26px;
  font-weight: 800;
}
.cal2-sum small {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 700;
}
.cal2-sum .warn b {
  color: var(--dec);
}
.cal2-sbox {
  padding: 14px 14px 10px;
}
.cal2-sbox h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--gold-deep);
  margin: 0 0 8px;
}
.cal2-srow {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  padding: 9px 2px;
  text-align: right;
  color: var(--ink);
}
.cal2-srow .d {
  width: 44px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 10px;
  padding: 4px 0 5px;
  background: var(--b, #f6ecd2);
  border: 1px solid var(--c, #a8812f);
}
.cal2-srow.pending { --c: #c98a1b; --b: #fbf0d8; }
.cal2-srow.resched { --c: #a83c28; --b: #f7e2dc; }
.cal2-srow .d b {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
}
.cal2-srow .d small {
  font-size: 10px;
  color: var(--muted);
}
.cal2-srow .n {
  display: flex;
  flex-direction: column;
  font-weight: 700;
  font-size: 14px;
  min-width: 0;
}
.cal2-srow .n small {
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
}
.cal2-srow:hover .n {
  color: var(--gold-deep);
}
.cal2-note {
  font-size: 12px;
  color: var(--dec);
  margin: 8px 0 2px;
}

@media (max-width: 1100px) {
  .cal2-main {
    grid-template-columns: minmax(0, 1fr);
  }
  .cal2-side {
    position: static;
  }
  .cal2-legend {
    order: 3;
    width: 100%;
    margin-right: 0;
  }
}
@media (max-width: 720px) {
  .cal2-title {
    font-size: 17px;
    width: 100%;
    margin: 6px 0 0;
  }
  .cal2-nav {
    flex-wrap: wrap;
  }
  .cal2-legend {
    flex-wrap: wrap;
    gap: 8px 12px;
  }
  .cal2-head,
  .cal2-allday,
  .cal2-grid {
    grid-template-columns: 40px repeat(7, minmax(0, 1fr));
  }
  .cal2-dh span {
    font-size: 10px;
  }
  .cal2-dh b {
    font-size: 16px;
    width: 28px;
    height: 28px;
    line-height: 28px;
  }
  .cal2-dh small,
  .cal2-ev .tm,
  .cal2-ev .pl {
    display: none;
  }
  .cal2-ev .tt {
    font-size: 10.5px;
  }
  .cal2-ev {
    padding: 3px 4px;
    border-right-width: 3px;
  }
  .cal2-mc {
    min-height: 74px;
    padding: 3px;
  }
  .cal2-mchip {
    font-size: 10px;
    padding: 1px 3px 2px;
  }
  .cal2-mchip b {
    display: none;
  }
  .cal2-li {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .cal2-lday {
    grid-template-columns: 54px 1fr;
    gap: 10px;
  }
}

/* ================================== tall portrait screens (27" upright) */
/* A 27-inch screen turned upright shows 1440 x 2560 (QHD, or 4K at 150%)
   or 1080 x 1920 (FHD). The follow-up page then lays out for height: a
   shorter top, the key projects three across, points beside the
   appointments, then letters, mini map and pipeline in one row, so at
   1440 x 2560 nearly the whole page sits on one screen. */
@media (orientation: portrait) and (min-width: 1000px) and (min-height: 1600px) {
  .hero {
    height: 470px;
  }
  main {
    max-width: none;
    padding-top: 26px;
  }
  .page-lead {
    margin-bottom: 34px;
  }
  .hk-strip {
    grid-template-columns: repeat(4, 1fr);
  }
  .fgrid {
    gap: 20px 18px;
  }
  .f-projects {
    grid-column: 1 / -1;
    order: 1;
  }
  .f-points {
    grid-column: span 7;
    order: 2;
  }
  .f-agenda {
    grid-column: span 5;
    order: 3;
  }
  .f-letters {
    grid-column: span 4;
    order: 4;
  }
  .f-map {
    grid-column: span 5;
    order: 5;
  }
  .f-funnel {
    grid-column: span 3;
    order: 6;
  }
  .fgrid .project-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .fgrid .project-grid .project.wide {
    grid-column: auto;
  }
  /* Letters: two lines of subject, one of sender, so the row stays level */
  #letters .tx {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  #letters .sub {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #letters .row .body {
    flex: 1;
    min-width: 0; /* or a one-line sender stretches the row past the card */
  }
  /* The day timeline as tall as the points beside it */
  .cal-scroll {
    max-height: 420px;
  }
  .page-lead h1 {
    font-size: 40px;
  }
  .page-lead {
    margin-bottom: 26px;
  }
  /* Compact project cards and letter rows: the page fits one screen */
  .project {
    padding: 13px 16px;
    gap: 9px;
  }
  .project .name {
    font-size: 17px;
  }
  .project .last {
    padding: 7px 10px 8px;
  }
  .project .last .t {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .project .owner .avatar {
    width: 26px;
    height: 26px;
  }
  #letters .row {
    padding: 9px 0;
  }
  /* The follow-up officer beside the latest development, details on one line */
  .project {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "top top" "step step" "last owner";
    align-items: center;
  }
  .project > .top {
    grid-area: top;
  }
  .project > .stepper {
    grid-area: step;
  }
  .project > .last {
    grid-area: last;
  }
  .project > .owner {
    grid-area: owner;
    flex-direction: column;
    gap: 2px;
    text-align: center;
  }
  .project .owner .k {
    display: none;
  }
  .project .owner .o {
    font-size: 12.5px;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .project .meta {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .f-funnel .hk-steps .st {
    grid-template-columns: 52px 1fr 52px;
    gap: 8px;
  }
  .f-funnel .hk-trio {
    grid-template-columns: 1fr;
  }
  .f-funnel .hk-trio > div {
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
  }
}

/* 1080 wide (FHD upright): the large cards two by two, the strip four
   across with labels allowed to wrap, points and appointments full width */
@media (orientation: portrait) and (min-width: 1000px) and (max-width: 1299px) and (min-height: 1600px) {
  .hk-row {
    grid-template-columns: 1fr 1fr;
  }
  .hk-stack {
    flex-direction: column;
  }
  .hk-strip .hk-mini .l {
    white-space: normal;
  }
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .f-points {
    grid-column: 1 / -1;
  }
  .f-agenda {
    grid-column: span 6;
  }
  .f-letters {
    grid-column: span 6;
  }
  .f-map {
    grid-column: span 7;
  }
  .f-funnel {
    grid-column: span 5;
  }
  .fgrid .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .fgrid .project-grid .project.wide {
    grid-column: 1 / -1;
  }
  .f-funnel .hk-trio {
    grid-template-columns: repeat(3, 1fr);
  }
  .f-funnel .hk-trio > div {
    flex-direction: column;
  }
}

/* ================================================= media monitoring */
#press {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.pr-row {
  grid-template-columns: 3fr 3fr 3fr 3fr;
}
.pr-hero {
  background: linear-gradient(160deg, #fbf0d4, #fffaf0 70%);
  border-color: rgba(168, 129, 47, 0.3);
}
.pr-big {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pr-big b {
  font-size: 54px;
  font-weight: 800;
  line-height: 1;
  color: var(--gold-deep);
}
.pr-reach {
  display: flex;
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(90, 66, 30, 0.08);
  margin-top: 8px;
}
.pr-reach i {
  display: block;
  height: 100%;
}
.pr-reach i.wide,
.pr-reach-k i.wide,
.pr-legend i.v-wide,
.pr-views-bars a.wide {
  background: #2f7a5f;
}
.pr-reach i.medium,
.pr-reach-k i.medium,
.pr-legend i.v-medium,
.pr-views-bars a.medium {
  background: #c9a24a;
}
.pr-reach i.none,
.pr-reach-k i.none,
.pr-legend i.v-none,
.pr-views-bars a.none {
  background: #cdbf9f;
}
.pr-reach-k {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  font-size: 13px;
}
.pr-reach-k span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pr-reach-k i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.pr-reach-k b {
  margin-right: auto;
  font-size: 16px;
}
.hk-mini.warnv .v {
  color: var(--late);
}

/* Feed beside the charts */
.pr-grid {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: 18px;
  align-items: start;
}
.pr-feed .section-head {
  flex-wrap: wrap;
}
.pr-feed .seg button {
  font-size: 14px;
}
.pr-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.pr-tools input {
  flex: 1 1 260px;
  font: inherit;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 14px 11px;
  background: #fffaf0;
  color: var(--ink);
  outline: none;
}
.pr-tools input:focus {
  border-color: var(--gold);
}
.pr-posts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.pr-post {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
  border-right: 4px solid #cdbf9f;
}
.pr-post.wide {
  border-right-color: #2f7a5f;
}
.pr-post.medium {
  border-right-color: #c9a24a;
}
.pr-img {
  display: block;
  height: 150px;
  background: #e9dfc8 center / cover no-repeat;
  position: relative;
}
.pr-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(35, 28, 18, 0.6);
  color: #fff;
  font-size: 16px;
}
.pr-body {
  padding: 12px 15px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.pr-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.pr-meta .pr-badge {
  margin-right: auto;
}
.pr-badge {
  font-size: 11.5px;
  font-weight: 800;
  border-radius: 999px;
  padding: 1px 9px 3px;
}
.pr-badge.wide {
  color: #fff;
  background: #2f7a5f;
}
.pr-badge.medium {
  color: #5b4413;
  background: #f0dfa9;
}
.pr-badge.none {
  color: var(--muted);
  background: #eee5d1;
}
.pr-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pr-echo {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 12.5px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
  margin-top: auto;
}
.pr-echo b {
  color: var(--gold-deep);
  font-size: 12.5px;
}
.pr-echo.none {
  color: var(--muted);
}
.pr-site {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 9px 4px;
  background: #f3ead4;
  border: 1px solid var(--line);
}
.pr-site::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-left: 5px;
  background: var(--k);
}
.pr-site:hover {
  border-color: var(--gold);
}
.pr-site.sy,
.pr-kind.sy,
.b-sy {
  --k: #2f7a5f;
}
.pr-site.arab,
.pr-kind.arab,
.b-arab {
  --k: #a8812f;
}
.pr-site.intl,
.pr-kind.intl,
.b-intl {
  --k: #5c7fa3;
}
.pr-open {
  align-self: flex-start;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--gold-deep);
  text-decoration: none;
}
.pr-arts {
  padding: 4px 16px;
}
.pr-art {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}
.pr-art:first-child {
  border-top: 0;
}
.pr-art:hover b {
  color: var(--gold-deep);
  text-decoration: underline;
  text-decoration-color: var(--gold-light);
}
.pr-kind {
  flex-shrink: 0;
  min-width: 46px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 800;
  border-radius: 8px;
  padding: 3px 6px 4px;
  color: #fff;
  background: var(--k);
}
.pr-at {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pr-at b {
  font-size: 14.5px;
  line-height: 1.55;
}
.pr-at small {
  font-size: 12px;
  color: var(--muted);
}

/* Charts */
.pr-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 90px;
}
.pr-chart {
  cursor: default;
}
.pr-chart:hover {
  transform: none;
}
.pr-daily {
  width: 100%;
  height: auto;
  display: block;
}
.pr-daily .axis {
  stroke: rgba(90, 66, 30, 0.2);
}
.pr-daily rect {
  fill: var(--k);
}
.pr-daily .b-post {
  fill: #e0bd68;
  stroke: #8d6a24;
  stroke-width: 1;
}
.pr-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 12px;
  color: var(--muted);
}
.pr-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.pr-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--k);
}
.pr-legend i.round {
  border-radius: 50%;
  background: #e0bd68;
  border: 1px solid #8d6a24;
}
.pr-views-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 110px;
  padding-top: 6px;
}
.pr-views-bars a {
  flex: 1;
  border-radius: 4px 4px 1px 1px;
  min-width: 0;
  transition: filter 0.15s;
}
.pr-views-bars a:hover {
  filter: brightness(1.15);
}
.pr-sites .row {
  grid-template-columns: minmax(80px, 46%) 1fr 26px;
}
.pr-note {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.pr-wait {
  padding: 40px 20px;
  text-align: center;
}
.pr-wait p {
  color: var(--muted);
}

@media (max-width: 1100px) {
  .pr-row {
    grid-template-columns: 1fr 1fr;
  }
  .pr-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .pr-side {
    position: static;
  }
}
@media (max-width: 720px) {
  .pr-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .pr-posts {
    grid-template-columns: minmax(0, 1fr);
  }
  .pr-feed .seg {
    display: flex;
    width: 100%;
  }
  .pr-feed .seg button {
    flex: 1;
    font-size: 12.5px;
    padding: 6px 4px 8px;
  }
}
@media (orientation: portrait) and (min-width: 1000px) and (min-height: 1600px) {
  .pr-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .pr-side {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .pr-posts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------------------------------------------- cloud copy: stale notice */
.cloud-note {
  margin: 10px 0 0;
  padding: 8px 14px 10px;
  border-radius: 12px;
  background: #fbf0d4;
  border: 1px solid rgba(168, 129, 47, 0.35);
  color: #5b4413;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.7;
  text-align: center;
}
