/* new.kalwanis.com — the estate.
 *
 * ONE SCREEN, NO PAGE SCROLL. The map is the product; the corporate
 * information sits in a dock beside it rather than in bands beneath it. The
 * only thing that scrolls is the dock's own contents, and the clients wall
 * inside it.
 *
 * ONE THEME, DELIBERATELY DARK: the chrome stays out of the way of the
 * satellite ground, which is in full colour at every zoom (the owner, 9 Nov 2026).
 */

:root {
  /* NOT BLACK. The rail and the dock are a deep slate-blue, so the chrome
     reads as a control console beside the satellite rather than a void.
     The owner, 7 Nov 2026: "the top bar and left bar cannot be black". */
  --bg:      #0B1016;
  --surface: #141C25;
  --raised:  #1C2733;
  --fg:      #E8EEF4;
  --muted:   #8FA0B0;
  --accent:  #4DD6C4;
  --line:    #27323E;
  --shadow:  0 1px 2px rgba(0,0,0,.5), 0 10px 30px rgba(0,0,0,.45);

  /* Chakra Petch is angular and technical - it reads like a simulation HUD,
     which is what this is. Saira carries the running text without fighting it.
     These are LINKED in index.html; the previous rewrite dropped the font link
     entirely and the whole page silently fell back to system sans. */
  --ff-display: "Chakra Petch", "Trebuchet MS", system-ui, sans-serif;
  --ff-body: Saira, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ff-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --rail: 76px;
  --dock: 380px;
  /* the WhatsApp button: its size, its margin, and the room on the right that what shares its corner leaves it */
  --wa: 56px;
  --wa-edge: 20px;
  --wa-room: calc(var(--wa) + 2 * var(--wa-edge));
  --wa-clear: var(--wa-room);   /* what the stage's own corner leaves it: none on a phone while the panel is open (below) */
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; overflow: hidden; }
body {
  background: var(--bg); color: var(--fg);
  font-family: var(--ff-body); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1,h2 { font-family: var(--ff-display); margin: 0; font-weight: 600; text-wrap: balance; }
p { margin: 0; }
button { font: inherit; }
a { color: var(--accent); }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; height: 100%;
         grid-template-columns: var(--rail) var(--dock) 1fr; }

/* ---------------------------------------------------------------- rail */
.rail {
  display: flex; flex-direction: column; align-items: stretch; gap: 2px;
  background: var(--surface); border-right: 1px solid var(--line);
  padding-top: max(10px, env(safe-area-inset-top, 0px));
  padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
  padding-left: env(safe-area-inset-left, 0px);
  overflow: hidden;
}
.railmark { display: flex; justify-content: center; padding: 10px 0 16px; }
.railmark img { width: 34px; height: 34px; object-fit: contain; display: block; }
.railbtn {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 11px 4px; border-left: 2px solid transparent;
}
.railbtn i { font-style: normal; font-size: 1.05rem; line-height: 1; }
.railbtn span { font-family: var(--ff-mono); font-size: .56rem; letter-spacing: .08em;
                text-transform: uppercase; text-align: center; }
.railbtn:hover { color: var(--fg); background: var(--raised); }
.railbtn[aria-pressed="true"] { color: var(--accent); border-left-color: var(--accent); background: var(--raised); }

/* ---------------------------------------------------------------- dock */
.dock {
  background: var(--surface); border-right: 1px solid var(--line);
  min-width: 0; display: flex; flex-direction: column; overflow: hidden;
}
.dockbody {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 16px;
}
.dockhead { display: flex; flex-direction: column; gap: 5px; }
.dockhead .ttl { font-family: var(--ff-display); font-size: 1.32rem; font-weight: 700;
                 line-height: 1.12; letter-spacing: .01em; }
.dockhead .sub { font-family: var(--ff-mono); font-size: .68rem; color: var(--muted); }

.tile { background: var(--raised); border: 1px solid var(--line); border-radius: 3px;
        padding: 12px; cursor: pointer; text-align: left; color: inherit; min-width: 0; }
.tile:hover { border-color: var(--accent); }
.tile .k { font-family: var(--ff-mono); font-size: .58rem; letter-spacing: .1em;
           text-transform: uppercase; color: var(--muted); }
.tile .v { font-family: var(--ff-display); font-size: .96rem; font-weight: 600; margin-top: 3px;
           overflow: hidden; text-overflow: ellipsis; }
.tile .n { font-family: var(--ff-mono); font-size: .66rem; color: var(--muted); margin-top: 2px; }

/* WHAT WE DO: each division with the old site's categories hanging under it,
   so Warehousing-Dry or Apartments & Villas is one click from the rail. */
.division { display: flex; flex-direction: column; gap: 6px; }
.division .tile { width: 100%; }
.sublist { display: flex; flex-direction: column; gap: 2px;
           margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--line); }
.subrow { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
          width: 100%; background: none; border: 0; border-radius: 3px; padding: 7px 8px;
          cursor: pointer; text-align: left; color: inherit;
          font-family: var(--ff-display); font-size: .88rem; }
.subrow:hover, .subrow[aria-pressed="true"] { background: var(--raised); color: var(--accent); }
.subrow .n { font-family: var(--ff-mono); font-size: .64rem; color: var(--muted); white-space: nowrap; }

/* CLIENTS AND PARTNERS: equal cards in equal columns, the same gap across and down
   (the owner, 8 Nov 2026). Two columns in the dock and on a phone; a tablet's wider
   sheet fits more of the same size of card rather than stretching two. 16 of the 36
   logos are dark ink on transparency, drawn for a white page, so every card is white.
   The padding is a share of the width so the space inside a card keeps one shape at
   any screen size: that shape is LOGO_BOX in app.js, and logoWidth there sets each
   logo's size. */
.logogrid { flex: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(166px, 45%), 1fr));
            gap: 10px; margin: 0; padding: 0; list-style: none; }
.logocard { box-sizing: border-box; aspect-ratio: 16 / 9; padding: 7.2%; display: flex;
            align-items: center; justify-content: center; background: #FFFFFF; border-radius: 8px;
            transition: transform .18s ease, box-shadow .18s ease; }
.logocard img { display: block; flex: none; height: auto; }
@media (hover: hover) {
  .logocard:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, .4); }
}
@media (prefers-reduced-motion: reduce) {
  .logocard { transition: none; }
  .logocard:hover { transform: none; }
}
.complist { display: flex; flex-direction: column; gap: 7px; }
.comprow { display: flex; align-items: center; gap: 12px; background: var(--raised);
           border: 1px solid var(--line); border-radius: 4px; padding: 11px 13px;
           cursor: pointer; text-align: left; color: inherit; width: 100%; min-width: 0; }
.comprow .who { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.comprow[disabled] { opacity: .5; cursor: default; }
.comprow:hover { border-color: var(--accent); }
/* The company marks were drawn for a white page, exactly like the client
   logos: Phoenix Marina, Arabian Ports and Zari are dark ink on transparency
   and all but vanished against the dark row. They get the same pale plate. */
.comprow img { height: 46px; width: 60px; object-fit: contain; flex: none;
               background: #F2F4F6; border-radius: 6px; padding: 4px 6px; }
/* the name wraps rather than truncating: "Kalwanis Holding Compa..." is not a
   way to write the company the whole group is named after */
.comprow .nm { font-size: .92rem; min-width: 0; font-family: var(--ff-display);
               font-weight: 500; line-height: 1.25; }
.comprow .sw { width: 8px; height: 8px; border-radius: 1px; flex: none; }
.comprow .n { font-family: var(--ff-mono); font-size: .66rem; color: var(--muted); }
.comprow[aria-pressed="true"] { border-color: var(--accent); }

.row { background: var(--raised); border: 1px solid var(--line); border-radius: 3px; padding: 11px 12px; }
.row dt { font-family: var(--ff-mono); font-size: .58rem; letter-spacing: .12em;
          text-transform: uppercase; color: var(--muted); }
.row dd { margin: 3px 0 0; font-size: .9rem; word-break: break-word; }

.dock dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.dock dl.facts dt { font-family: var(--ff-mono); font-size: .66rem; color: var(--muted); }
.dock dl.facts dd { margin: 0; font-family: var(--ff-mono); font-size: .85rem; font-variant-numeric: tabular-nums; }
.note { font-size: .76rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }
.enqsend { width: 100%; min-height: 46px; font-family: var(--ff-mono); font-size: .9rem; letter-spacing: .04em;
            background: var(--accent); border: 0; color: #08120F; padding: 11px; border-radius: 3px;
            cursor: pointer; font-weight: 500; }
.enqsend:hover { filter: brightness(1.08); }

/* CONTACT US TODAY. Every label stays visible above its field, the fields are 44px tall for a thumb, and the
   text is 16px so a phone does not zoom the page when one is tapped. */
.enquiry { flex: none; color-scheme: dark; background: var(--raised); border: 1px solid var(--line);
           border-top: 2px solid var(--accent); border-radius: 4px; padding: 14px 13px 15px; }
.enqttl { margin: 0; font-family: var(--ff-display); font-size: 1.1rem; font-weight: 700; letter-spacing: .04em; }
.enqsub { margin: 5px 0 0; font-size: .86rem; line-height: 1.4; }
.enquiry form { display: flex; flex-direction: column; gap: 13px; margin-top: 12px; }
.enquiry form[hidden], .enqdone[hidden] { display: none; }
.enqkey { margin: 0; font-size: .76rem; color: var(--muted); }
.enquiry .req { color: var(--accent); }
.enqfield { display: flex; flex-direction: column; gap: 4px; }
.enqfield label { font-size: .86rem; font-weight: 500; }
.enqfield .opt { font-weight: 400; color: var(--muted); }
.enqfield input, .enqfield select, .enqfield textarea {
  box-sizing: border-box; width: 100%; min-height: 44px; padding: 9px 10px; font: inherit; font-size: 1rem;
  color: var(--fg); background: var(--surface); border: 1px solid var(--muted); border-radius: 3px;
  scroll-margin-top: 32px; /* a field the form jumps to keeps its label in view */ }
.enqfield textarea { display: block; min-height: 140px; line-height: 1.4; resize: vertical; }
.enquiry :focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.enqfield [aria-invalid="true"] { border-color: #FFA99A; }
.enqerr, .enqmsg { margin: 0; font-size: .82rem; line-height: 1.35; color: #FFA99A; }
.enqerr:empty, .enqmsg:empty { display: none; }
.enqmsg a { color: inherit; }
.enqsend:disabled { opacity: .65; cursor: wait; }
.enqdone { margin: 12px 0 0; font-size: .95rem; line-height: 1.45; color: var(--fg); outline: none; }
.backbtn { align-self: flex-start; font-family: var(--ff-mono); font-size: .68rem; background: none;
           border: 0; color: var(--muted); cursor: pointer; padding: 0; }
.backbtn:hover { color: var(--accent); }

/* ---------------------------------------------------------------- stage */
/* in its grid cell by name, as the WhatsApp button over it is: else the button, placed first, would push it out of its cell */
.stage { position: relative; min-width: 0; grid-column: 3; grid-row: 1; }
#map { position: absolute; inset: 0; }
.maplibregl-ctrl-attrib { font-size: 10px; }
.maplibregl-ctrl-bottom-right { right: var(--wa-clear); }   /* the scale, clear of the WhatsApp button */

/* ------------------------------------------------------ the WhatsApp button */
/* A chat with the group on WhatsApp, in a new tab (the owner, 19 Nov 2026), in the bottom-right corner of the map or the 3D
   view: of the screen on a desktop, just above the tab bar on a phone. It stands in the shell's grid over the stage (on a
   phone over the stage and the panel), so the page, which never scrolls, holds it there with no measuring; above everything
   there, a photograph opened full size (50) included. What shares its corner ends --wa-clear short of the right edge: the map's
   scale, the photo strip, the 3D view's photographs and its bar, a clicked thing's card. Its mark is Simple Icons' (CC0). */
.wafab {
  grid-column: 3; grid-row: 1; align-self: end; justify-self: end; margin: var(--wa-edge);
  position: relative; z-index: 60;
  width: var(--wa); height: var(--wa); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #25D366; color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.28);
  transition: transform .18s ease, box-shadow .18s ease;
}
.wafab svg { width: 55%; height: 55%; fill: currentColor; display: block; }
.wafab:hover { transform: scale(1.08); box-shadow: 0 3px 8px rgba(0,0,0,.34), 0 10px 24px rgba(0,0,0,.32); }
.wafab:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .wafab { transition: none; } }

/* the running simulations, drawn over the map; every click goes through to the map beneath */
.live-sim { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }

/* the buttons over the simulation's 3D view (static/ops/warehouse-ops.js makes them) */
.chip {
  font-family: var(--ff-mono); font-size: .71rem;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line); color: var(--fg);
  padding: 6px 10px; border-radius: 3px; cursor: pointer;
  backdrop-filter: blur(8px); box-shadow: var(--shadow);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--raised); }

/* ------------------------------------------------------- the photo strip */
.strip {
  position: absolute; left: 0; right: var(--wa-clear); bottom: 0; z-index: 12;
  display: flex; gap: 6px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  overflow-x: auto; scrollbar-width: none;
  background: linear-gradient(to top, rgba(8,9,11,.92), rgba(8,9,11,0));
}
.strip::-webkit-scrollbar { display: none; }
.strip img { height: 92px; width: auto; border-radius: 3px; cursor: pointer; flex: none;
             border: 1px solid var(--line); background: var(--raised); }
.strip img:hover { border-color: var(--accent); }
.strip .cap { font-family: var(--ff-mono); font-size: .6rem; color: var(--muted);
              align-self: flex-end; padding-bottom: 4px; white-space: nowrap; }

/* ------------------------------------------------------- the photo viewer */
/* above the simulation too (40), whose gallery opens it */
.viewer { position: absolute; inset: 0; z-index: 50; display: flex; align-items: center;
          justify-content: center; background: rgba(8,9,11,.9); backdrop-filter: blur(6px); }
.viewer[hidden] { display: none !important; }
.viewer img { max-width: calc(100% - 140px); max-height: 82%; border-radius: 4px; box-shadow: var(--shadow); }
/* the arrows either side of the photograph */
.viewernav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 72px;
             border: 1px solid var(--line); background: var(--surface); color: var(--fg);
             border-radius: 3px; cursor: pointer; font-size: 34px; line-height: 1; }
.viewernav.prev { left: 14px; }
.viewernav.next { right: 14px; }
.viewernav[hidden] { display: none; }
.viewercap { position: absolute; bottom: 18px; font-family: var(--ff-mono); font-size: .68rem; color: var(--muted); }
.viewerclose { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px;
               border: 1px solid var(--line); background: var(--surface); color: var(--fg);
               border-radius: 3px; cursor: pointer; font-size: 19px; line-height: 1; }

/* ------------------------------------------------------------ the theatre */
/* display:flex on a class BEATS the browser's [hidden]{display:none}, so
   without this the closed theatre covers the map and eats every click. */
.theatre[hidden] { display: none !important; }
/* It lies exactly over the map, so its 3D view starts as the very picture the map was showing and nothing shifts, and the
   dock beside it works as it always does: the sidebar works at all times (the owner, 9 Nov 2026). It has no side panel
   (the owner, 10 Nov 2026). */
.theatre { position: absolute; inset: 0; z-index: 40; background: var(--bg); display: flex; flex-direction: column;
           transition: opacity .3s ease; will-change: opacity; }
/* unseen as it comes and as it goes: the map underneath keeps the clicks, the wheel and the pinch */
.theatre.ops-preparing { opacity: 0; }
.theatre.ops-preparing, .theatre.ops-preparing * { pointer-events: none !important; }
@media (prefers-reduced-motion: reduce) { .theatre { transition: none; } }
.simnote[hidden] { display: none; }
.simnote { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 20; pointer-events: none;
           font-family: var(--ff-mono); font-size: .72rem; color: var(--fg); background: var(--raised);
           border: 1px solid var(--line); border-radius: 3px; padding: 7px 12px; white-space: nowrap; }
/* Show 3D on the map, for a plot shown flat (the owner, 12 Nov 2026), where the note stands while a plot opens */
.mapshow3d[hidden] { display: none; }
.mapshow3d { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 20; white-space: nowrap;
  font-family: var(--ff-mono); font-size: .72rem; background: var(--raised); border: 1px solid var(--line); color: var(--fg);
  padding: 8px 12px; border-radius: 3px; cursor: pointer; }
.theatre canvas { display: block; touch-action: none; cursor: grab; }
.theatre canvas:active { cursor: grabbing; }
.theatre-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px max(14px, var(--wa-clear)) calc(10px + env(safe-area-inset-bottom, 0px)) 14px;
  border-top: 1px solid var(--line); background: var(--surface); }
.theatre-ttl { font-family: var(--ff-display); font-size: 1.05rem; font-weight: 600; }
/* at least 280px: in a narrower bar it takes a line of its own, where squeezed between the controls it stood one word wide */
.theatre-facts { font-family: var(--ff-mono); font-size: .7rem; color: var(--muted); min-width: 0; flex: 1 1 280px; }
.theatre-bar .btn { font-family: var(--ff-mono); font-size: .72rem; background: var(--raised);
  border: 1px solid var(--line); color: var(--fg); padding: 8px 12px; border-radius: 3px; cursor: pointer; }
/* the plot's photographs, along the bottom of its 3D view where the legend was (the owner, 10 Nov 2026); the card of what
   was clicked moves up out of its way */
.ops-gallery { position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 10px - max(10px, var(--wa-clear))); display: flex; align-items: center; gap: 6px;
  padding: 6px; overflow-x: auto; scrollbar-width: thin; border-radius: 4px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent); }
.ops-gallery[hidden] { display: none; }
.ops-gallery button { flex: none; padding: 0; border: 1px solid var(--line); border-radius: 3px; background: var(--raised); cursor: pointer; line-height: 0; }
.ops-gallery button:hover, .ops-gallery button:focus-visible { border-color: var(--accent); outline: none; }
.ops-gallery img { height: 64px; width: auto; min-width: 64px; border-radius: 2px; }
.ops-gallery .cap { font-family: var(--ff-mono); font-size: .6rem; color: var(--muted); padding: 0 6px; white-space: nowrap; }
.theatre.with-gallery .ops-sel { bottom: 96px; }
.theatre .ops-sel { right: max(10px, var(--wa-clear)); width: min(320px, calc(100% - 10px - max(10px, var(--wa-clear)))); }

/* ---------------------------------------------------------------- phone */
/* A 76px rail plus a 380px dock leaves no map at all on a 390px screen, so the
   rail becomes a bottom tab bar and the map and the dock share the screen above
   it half and half, the map (or the simulation) on top: the owner, 11 Nov 2026,
   "50-50 Screen Split" (the dock had risen over the map as a sheet two thirds
   high). Tapping the open section's button again puts the dock away and gives
   the map the whole height. dvh follows Safari's toolbars; where it is unknown
   the shell keeps its 100%. */
@media (max-width: 860px) {
  .shell { height: 100dvh; grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) 0 auto;
           transition: grid-template-rows .26s cubic-bezier(.2,.7,.3,1); }
  .shell:has(> .dock.open) { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .stage { grid-row: 1; grid-column: 1; }
  .rail { grid-row: 3; flex-direction: row; justify-content: space-around;
          border-right: 0; border-top: 1px solid var(--line); padding: 0; background: var(--surface); }
  .railmark { display: none; }
  .railbtn { border-left: 0; border-top: 2px solid transparent; flex: 1; padding: 9px 2px;
             padding-bottom: calc(9px + env(safe-area-inset-bottom, 0px)); }
  .railbtn[aria-pressed="true"] { border-left-color: transparent; border-top-color: var(--accent); }
  .dock { grid-row: 2; grid-column: 1; border-right: 0; border-top: 1px solid var(--line); }
  .dock:not(.open) { visibility: hidden; }
  /* a photograph still fills the screen, not only the map's half of it */
  .viewer { position: fixed; }
  .viewer img { max-width: 92%; }
  .viewernav { width: 38px; height: 56px; font-size: 28px; }
  .viewernav.prev { left: 6px; }
  .viewernav.next { right: 6px; }
  .strip img { height: 72px; }
  .ops-gallery img { height: 52px; min-width: 52px; }
  .theatre.with-gallery .ops-sel { bottom: 84px; }
  /* the WhatsApp button smaller, over the stage and the panel: its foot on the tab bar's top; the panel's end scrolls clear of it */
  :root { --wa: 48px; --wa-edge: 12px; }
  .wafab { grid-column: 1; grid-row: 1 / 3; }
  .dockbody { padding-bottom: var(--wa-room); }
  .shell:has(> .dock.open) { --wa-clear: 0px; }   /* the button stands over the panel then, not the map or the 3D view */
}
@media (prefers-reduced-motion: reduce) { .shell { transition: none; } }

