@font-face { font-family: "Source Sans 3"; src: url("/fonts/SourceSans3-latin.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Sans Pro"; src: url("/fonts/SourceSansPro-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans Pro"; src: url("/fonts/SourceSansPro-Semibold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans Pro"; src: url("/fonts/SourceSansPro-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }

/* Builtcore Portal v108 palette (Coreframe plan PDF, 19 Nov 2026).
   v116 r2/r3: compact one-screen tiles; Coreframe banner stays at live size.
   v118-a8: even 2-col tile grid (H&S same size as the other tiles); Directory stays
   full-width at the bottom; phone-landscape descriptions stay visible.
   Branding stays Builtcore / D&K. Module colours: Guard #E57A12, Site #1565E8,
   Bid #1F9A55, Buy #118FA3, Budget #6B4FD8. Navy #0B1F4D, chrome #F2F5FB, peach #FFF7EF. */
:root {
  --navy: #0B1F4D;
  --navy-mid: #142753;
  --navy-deep: #081739;
  --ink: #0B1F4D;
  --muted: #6A7690;
  --section: #F2F5FB;
  --card: #FFFFFF;
  --peach: #FFF7EF;
  --peach-deep: #FFECDA;
  --guard: #E57A12;
  --site: #1565E8;
  --bid: #1F9A55;
  --buy: #118FA3;
  --budget: #6B4FD8;
  --quotes: #C2387A;
  --accent: #4C8DFF;
  --cta: #1565E8;
  --cta-hover: #0F52C4;
  --directory: #3D4F73;
  --signin: #1565E8;
  --border: #D8E0F0;
  --shadow: 0 20px 50px rgba(8, 23, 57, .28);
  --shadow-hover: 0 24px 56px rgba(8, 23, 57, .36);
  --radius: 16px;
  --font: "Source Sans 3", "Source Sans Pro", "Liberation Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { height: 100%; }
body {
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font);
  background-color: var(--navy);
  background-image:
    linear-gradient(to right, rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  color: #fff;
  font-size: 15px;
  line-height: 1.45;
  position: relative;
}
body::after {
  content: "";
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--guard) 0 20%, var(--site) 20% 40%, var(--bid) 40% 60%, var(--buy) 60% 75%, var(--quotes) 75% 88%, var(--budget) 88% 100%);
  z-index: 2;
  pointer-events: none;
}

.page {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px calc(12px + env(safe-area-inset-bottom, 0px) + 4px);
  position: relative;
  z-index: 1;
  width: 100%;
}

.brand {
  text-align: center;
  margin: 0 0 10px;
  width: 100%;
  max-width: 640px;
  flex: 0 0 auto;
}
.logo {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  margin: 0 auto 16px;
  background: #fff;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
img.company-logo {
  display: block;
  width: auto;
  max-width: 240px;
  max-height: 72px;
  height: auto;
  margin: 0 auto 12px;
  background: #fff;
  border-radius: 12px;
  padding: 8px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  object-fit: contain;
}
.brand.is-company picture.suite-banner { display: none; }
h1 {
  margin: 0 0 2px;
  font-size: 22px;
  letter-spacing: -0.03em;
  color: #fff;
  font-weight: 700;
  line-height: 1.2;
}
.sub {
  margin: 0;
  color: #9BA3B4;
  font-size: 14px;
}
.lead {
  margin: 4px 0 0;
  color: #9EC0FF;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.portal-card {
  width: 100%;
  max-width: 640px;
  background: var(--section);
  color: var(--ink);
  border-radius: 16px;
  padding: 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.module-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0 0 6px;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex: 0 0 auto;
}
.module-tabs::-webkit-scrollbar { display: none; }
.module-tab { flex-shrink: 0; }
.module-tabs[hidden] { display: none !important; }
.module-tab {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid transparent;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  padding: 5px 8px 5px 6px;
  min-height: 28px;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
}
.module-tab:hover { text-decoration: none; color: var(--ink); }
.module-tab:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.module-tab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.module-tab-icon {
  width: 16px;
  height: 16px;
  display: none;
}
.module-tab--guard { color: var(--guard); border-color: rgba(229, 122, 18, .35); }
.module-tab--site { color: var(--site); border-color: rgba(21, 101, 232, .35); }
.module-tab--bid { color: var(--bid); border-color: rgba(31, 154, 85, .35); }
.module-tab--buy { color: var(--buy); border-color: rgba(17, 143, 163, .35); }
.module-tab--quotes { color: var(--quotes); border-color: rgba(194, 56, 122, .35); }
.module-tab--budget { color: var(--budget); border-color: rgba(107, 79, 216, .35); }
.module-tab--directory { color: var(--directory); border-color: rgba(61, 79, 115, .35); }
.module-tab--signin { color: var(--cta); border-color: rgba(21, 101, 232, .35); }

.tiles {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
}
.tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  border-radius: 12px;
  padding: 8px 10px;
  min-height: 44px;
  min-width: 0;
  transition: transform .14s ease, box-shadow .14s ease;
  border: 1px solid #fff;
  box-shadow: 0 1px 2px rgba(11, 31, 77, .04);
  border-top: 3px solid var(--tile-accent, var(--cta));
  position: relative;
}
.tile:hover {
  text-decoration: none;
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(11, 31, 77, .12);
}
.tile:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.tile[aria-disabled="true"] {
  cursor: default;
  opacity: .72;
  transform: none;
  box-shadow: none;
}

.tile--guard { --tile-accent: var(--guard); }
.tile--site { --tile-accent: var(--site); }
.tile--bid { --tile-accent: var(--bid); }
.tile--buy { --tile-accent: var(--buy); }
.tile--quotes { --tile-accent: var(--quotes); }
.tile--budget { --tile-accent: var(--budget); }
.tile--directory { --tile-accent: var(--directory); }
.tile--signin { --tile-accent: var(--signin); }

.tile[data-key="signin"], .tile--signin { order: 0; grid-column: 1 / -1; }
.tile[data-key="safety"] { order: 1; }
.tile[data-key="site"] { order: 2; }
.tile[data-key="tenders"] { order: 3; }
.tile[data-key="quotes"] { order: 4; }
.tile[data-key="materials"] { order: 5; }
.tile[data-key="budget"] { order: 6; }
.tile[data-key="directory"] { order: 7; grid-column: 1 / -1; }

.tile[data-key="safety"] {
  background: var(--peach);
  border-color: var(--peach-deep);
}
.tile[data-key="directory"],
.tile--signin {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
}

.tile-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--tile-accent, var(--cta));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tile-icon svg { width: 18px; height: 18px; display: block; }

.tile-body { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.tile-name-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
}
.tile-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile-module {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1;
  padding: 2px 6px;
  flex-shrink: 0;
  border-radius: 999px;
  color: var(--tile-accent, var(--cta));
  background: #fff;
  border: 1.5px solid var(--border);
  border-color: color-mix(in srgb, var(--tile-accent, var(--cta)) 35%, #fff);
}
.tile[data-key="safety"] .tile-module {
  background: #fff;
  border-color: color-mix(in srgb, var(--guard) 40%, #fff);
}
.tile-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tile-go {
  font-size: 12px;
  font-weight: 700;
  color: var(--tile-accent, var(--cta));
  letter-spacing: .04em;
  text-transform: uppercase;
}
.tile:hover .tile-go { filter: brightness(.9); }

.install-hint {
  margin: 8px 0 0;
  text-align: center;
  color: #9BA3B4;
  font-size: 12px;
  max-width: 420px;
  flex: 0 0 auto;
  line-height: 1.3;
}
@media (display-mode: standalone), (display-mode: fullscreen) {
  .install-hint { display: none !important; }
}
.install-hint[hidden] { display: none !important; }
.install-btn {
  appearance: none;
  border: 0;
  background: #fff;
  color: var(--navy);
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.install-btn:hover { background: var(--section); }
.install-btn[hidden],
.install-ios[hidden] { display: none !important; }

.designed-by {
  text-align: center;
  font-size: 11px;
  color: #9BA3B4;
  padding: 8px 12px 4px;
  margin: 0;
  letter-spacing: .01em;
  flex: 0 0 auto;
}
.designed-by strong { color: #fff; font-weight: 700; }

/* Phone-first. Logo stays at live size (width 100%, max-width none). Space comes from compact 2-col tiles. */
@media (max-width: 820px) {
  .page {
    justify-content: flex-start;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 14px calc(8px + env(safe-area-inset-bottom, 0px) + 4px);
  }
  .brand { margin-top: auto; margin-bottom: 8px; }
  .logo { width: 100%; max-width: none; }
  h1 { font-size: 20px; }
  .lead { display: none; }
  .portal-card { padding: 6px; border-radius: 14px; }
  .tiles { gap: 5px; }
  .tile { padding: 7px 8px; gap: 4px; }
  .tile-icon { width: 32px; height: 32px; }
  .tile-icon svg { width: 16px; height: 16px; }
  .tile-name { font-size: 14px; }
  .tile-desc {
    font-size: 11px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    white-space: normal;
  }
  .tile-go { display: none; }
  .tile--site .tile-go,
  .tile--bid .tile-go,
  .tile--buy .tile-go,
  .tile--quotes .tile-go,
  .tile--budget .tile-go { display: none; }
  .module-tab { font-size: 11px; padding: 4px 7px 4px 6px; min-height: 26px; }
  .designed-by { margin-top: auto; }
}

@media (max-width: 420px) {
  .tile-module { font-size: 9px; padding: 2px 5px; }
}

/* Short viewports (iPhone SE, phone landscape, TWA with a thin Chrome bar):
   keep 44px targets and leave tile descriptions visible as a single line. */
@media (max-width: 820px) and (max-height: 640px) {
  .brand { margin-bottom: 6px; }
  h1 { font-size: 18px; }
  .module-tabs { margin-bottom: 4px; padding-bottom: 4px; }
  .portal-card { padding: 5px; }
  .tiles { gap: 4px; }
  .tile, .tile[data-key="directory"], .tile--signin { padding: 5px 7px; gap: 2px; }
  .tile-desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 11px;
  }
  .designed-by { padding: 6px 10px 2px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .tile { transition: none; }
  .tile:hover { transform: none; }
}

@media (min-width: 821px) {
  .install-hint { display: none !important; }
  .page { padding-top: calc(12px + env(safe-area-inset-top, 0px)); padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px) + 4px); }
  .brand { max-width: 680px; margin-bottom: 10px; }
  .logo { width: 100%; max-width: 680px; }
  h1 { font-size: 24px; }
  .lead { font-size: 14px; }
  .portal-card { padding: 10px; max-width: 680px; }
  .tiles { gap: 6px; }
  .tile { padding: 8px 12px; gap: 6px; }
  .tile[data-key="directory"],
  .tile--signin { padding: 8px 12px; }
  .tile-name { font-size: 15px; }
  .tile-desc { font-size: 12px; white-space: nowrap; display: block; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: unset; }
  .tile-go { display: none; }
}

@media (min-width: 821px) and (max-height: 800px) {
  h1 { font-size: 22px; }
  .lead { margin-top: 2px; }
  .brand { margin-bottom: 8px; }
  .tile { padding: 6px 10px; gap: 4px; }
}

/* Phone landscape, including iPhone widths over 820px (844x390, 932x430):
   same banner image, scaled down so the even grid and descriptions stay on screen. */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 1000px) {
  .page {
    justify-content: flex-start;
    padding: calc(4px + env(safe-area-inset-top, 0px)) 14px calc(4px + env(safe-area-inset-bottom, 0px) + 4px);
  }
  .lead { display: none; }
  .brand { margin-bottom: 4px; max-width: 680px; }
  .logo { margin-bottom: 4px; max-width: 400px; width: 100%; }
  h1 { font-size: 16px; }
  .account { margin: 2px 0 0; font-size: 13px; gap: 4px 8px; }
  .account-signout { min-height: 32px; padding: 0 10px; }
  .portal-card { padding: 4px; max-width: 680px; }
  .tiles { gap: 3px; }
  .tile, .tile[data-key="directory"], .tile--signin {
    flex-direction: row;
    align-items: center;
    padding: 4px 8px;
    gap: 8px;
  }
  .tile-name { font-size: 13px; }
  .tile-icon { width: 28px; height: 28px; }
  .tile-icon svg { width: 14px; height: 14px; }
  .tile-desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 11px;
  }
  .designed-by { padding: 4px 10px 0; font-size: 10px; }
}

.tile-msg {
  grid-column: 1 / -1;
  background: var(--card);
  color: var(--ink);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  box-shadow: none;
  border: 1px solid var(--border);
}
.tile-msg-title { margin: 0 0 .35rem; font-weight: 700; color: var(--ink); font-size: 1.1rem; }
.tile-msg-detail { margin: 0; color: var(--muted); }


/* v117 suite polish: signed-in name and Sign out under the heading. */
.account { margin: 6px 0 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; font-size: 14px; color: inherit; opacity: .9; }
.account[hidden] { display: none; }
.account-signout { min-height: 44px; padding: 0 14px; border-radius: 8px; border: 1px solid currentColor; background: transparent; color: inherit; font: inherit; font-weight: 700; cursor: pointer; }
.account-signout:disabled { opacity: .6; }

/* v118 audit-2: David's Coreframe suite banner. It carries its own white card and navy border, so no extra box.
   Phones (600 px and under) show the left part (logo, CoreFrame, Construction Software Suite) so it stays readable. */
.logo { background: none; box-shadow: none; border-radius: 0; height: auto; }
@media (max-width: 600px) { .logo { width: 100%; max-width: 320px; } }


/* v118-a10: Notifications preferences modal (matches the account Sign out control). */
.notify-modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); background: rgba(11, 31, 77, .55); }
.notify-modal[hidden] { display: none; }
.notify-modal-card { width: min(440px, 100%); background: var(--card, #fff); color: var(--ink, #0B1A3C); border: 1px solid var(--border, #d6deea); border-radius: 14px; padding: 1.25rem 1.35rem 1.1rem; box-shadow: 0 12px 40px rgba(11, 26, 60, .2); }
.notify-modal-card h2 { margin: 0 0 .4rem; font-size: 1.2rem; }
.notify-modal-lead { margin: 0 0 1rem; color: var(--muted, #5b6b82); font-size: 14px; }
.notify-modal-cats { display: grid; gap: 10px; margin: 0 0 1rem; }
.notify-pref { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.35; cursor: pointer; }
.notify-pref input { margin-top: 3px; width: 18px; height: 18px; flex: 0 0 auto; }
.notify-pref strong { display: block; }
.notify-pref-hint { display: block; color: var(--muted, #5b6b82); font-size: 12px; margin-top: 2px; }
.notify-modal-status { margin: 0 0 10px; font-size: 13px; }
.notify-modal-status--error { color: #9b1c1c; }
.notify-modal-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.notify-modal-actions .account-signout { color: var(--ink, #0B1A3C); }
