/* Client Portal (/portal/): the guard company's clients, read-only.
   Standalone surface on the shared theme tokens (theme-tokens.css) and the customer accent family
   (body.custom-body[data-role="customer"] sets --app-context*). Light and dark follow data-bs-theme,
   set by the shared theme preference in gj-ui.js. Mobile first; everything is scoped to .gj-portal. */

.gj-portal {
  --p-radius: 16px;
  --p-radius-sm: 10px;
  --p-control: 2.6rem;
  --p-surface: var(--theme-surface);
  --p-canvas: var(--theme-canvas);
  --p-ink: var(--theme-ink);
  --p-muted: var(--theme-muted);
  --p-line: var(--theme-line);
  --p-raised: #f8fafb;
  --p-shadow-1: 0 1px 2px rgb(16 24 40 / .05), 0 6px 18px -10px rgb(16 24 40 / .12);
  --p-shadow-2: 0 2px 4px rgb(16 24 40 / .06), 0 16px 32px -14px rgb(16 24 40 / .22);
  --p-accent-ink: var(--app-context-dark);
  --p-on-accent: #ffffff;
  --p-focus: color-mix(in srgb, var(--app-context) 35%, transparent);
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(60rem 30rem at 100% -10%, color-mix(in srgb, var(--app-context) 9%, transparent), transparent 70%),
    radial-gradient(50rem 26rem at -10% 110%, color-mix(in srgb, var(--app-context-accent2) 8%, transparent), transparent 70%),
    var(--p-canvas);
  color: var(--p-ink);
  font: 400 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[data-bs-theme="dark"] .gj-portal {
  --p-raised: #1d252e;
  --p-shadow-1: inset 0 1px 0 rgb(255 255 255 / .05), 0 8px 20px -12px rgb(0 0 0 / .6);
  --p-shadow-2: inset 0 1px 0 rgb(255 255 255 / .06), 0 18px 36px -16px rgb(0 0 0 / .7);
  --p-accent-ink: var(--app-context-dark);
  --p-on-accent: #0b1520;
  color-scheme: dark;
}
.gj-portal *, .gj-portal *::before, .gj-portal *::after { box-sizing: border-box; }
.gj-portal a { color: var(--p-accent-ink); }
.gj-portal :focus-visible { outline: 3px solid var(--p-focus); outline-offset: 2px; border-radius: 8px; }
.gj-portal h1, .gj-portal h2, .gj-portal h3, .gj-portal h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }

/* Tones: status colors with a text-safe ink in both themes. */
.gj-portal [data-tone] { --tone: #64748b; --tone-soft: #eef2f6; --tone-ink: #475467; }
.gj-portal [data-tone="sky"] { --tone: #0284c7; --tone-soft: #e0f2fe; --tone-ink: #075985; }
.gj-portal [data-tone="emerald"] { --tone: #059669; --tone-soft: #dcfce7; --tone-ink: #166534; }
.gj-portal [data-tone="amber"] { --tone: #d97706; --tone-soft: #fef3c7; --tone-ink: #92400e; }
.gj-portal [data-tone="rose"] { --tone: #e11d48; --tone-soft: #ffe4e6; --tone-ink: #9f1239; }
.gj-portal [data-tone="violet"] { --tone: #7c3aed; --tone-soft: #ede9fe; --tone-ink: #5b21b6; }
[data-bs-theme="dark"] .gj-portal [data-tone] { --tone: #94a3b8; --tone-soft: rgb(148 163 184 / .16); --tone-ink: #cbd5e1; }
[data-bs-theme="dark"] .gj-portal [data-tone="sky"] { --tone: #38bdf8; --tone-soft: rgb(56 189 248 / .16); --tone-ink: #7dd3fc; }
[data-bs-theme="dark"] .gj-portal [data-tone="emerald"] { --tone: #34d399; --tone-soft: rgb(52 211 153 / .15); --tone-ink: #86efac; }
[data-bs-theme="dark"] .gj-portal [data-tone="amber"] { --tone: #fbbf24; --tone-soft: rgb(251 191 36 / .15); --tone-ink: #fcd34d; }
[data-bs-theme="dark"] .gj-portal [data-tone="rose"] { --tone: #fb7185; --tone-soft: rgb(251 113 133 / .15); --tone-ink: #fda4af; }
[data-bs-theme="dark"] .gj-portal [data-tone="violet"] { --tone: #a78bfa; --tone-soft: rgb(167 139 250 / .16); --tone-ink: #c4b5fd; }

.gj-portal__skip { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: .5rem .9rem; border-radius: 10px; background: var(--p-surface); color: var(--p-ink); box-shadow: var(--p-shadow-2); }
.gj-portal__skip:focus { left: 12px; }
.gj-portal__main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 1rem 1rem 2.5rem; flex: 1; outline: none; }
.gj-portal__muted { color: var(--p-muted); }
.gj-portal__block { display: block; }

/* ------------------------------------------------------------ top bar and navigation */
.gj-portal__bar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--p-surface) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--p-line);
}
.gj-portal__bar::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, var(--app-context), var(--app-context-glow), var(--app-context-accent2)); }
.gj-portal__bar-inner { max-width: 1180px; margin: 0 auto; padding: .7rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.gj-portal__brand { display: flex; align-items: center; gap: .7rem; min-width: 0; color: var(--p-ink) !important; text-decoration: none; }
.gj-portal__logo { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 12px; display: grid; place-items: center; overflow: hidden; background: var(--p-surface); border: 1px solid var(--p-line); box-shadow: var(--p-shadow-1); }
.gj-portal__logo img { width: 100%; height: 100%; object-fit: contain; }
.gj-portal__logo--initials { color: #fff; font-weight: 800; letter-spacing: .02em; border: 0; background: linear-gradient(135deg, var(--app-context), var(--app-context-deep)); box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--app-context) 70%, transparent); }
.gj-portal__brand-text { display: flex; flex-direction: column; min-width: 0; }
.gj-portal__brand-text strong { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gj-portal__brand-text small { color: var(--p-muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.gj-portal__bar-actions { display: flex; align-items: center; gap: .5rem; }
.gj-portal__bar-actions form { margin: 0; }
.gj-portal__who { display: none; align-items: center; gap: .4rem; color: var(--p-muted); font-weight: 600; font-size: .88rem; max-width: 14rem; }
.gj-portal__who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gj-portal__nav { max-width: 1180px; margin: 0 auto; padding: 0 1rem .6rem; display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; }
.gj-portal__nav::-webkit-scrollbar { display: none; }
.gj-portal__nav a {
  flex: none; display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .9rem; border-radius: 999px;
  color: var(--p-muted); font-weight: 650; font-size: .9rem; text-decoration: none; border: 1px solid transparent;
  transition: background-color .16s ease, color .16s ease, transform .16s ease;
}
.gj-portal__nav a:hover { color: var(--p-ink); background: var(--app-context-soft); }
.gj-portal__nav a[aria-current="page"] { color: var(--p-on-accent); background: linear-gradient(135deg, var(--app-context), color-mix(in srgb, var(--app-context) 70%, var(--app-context-deep))); box-shadow: 0 8px 20px -12px color-mix(in srgb, var(--app-context) 80%, transparent); }
[data-bs-theme="dark"] .gj-portal__nav a[aria-current="page"] { background: var(--app-context-dark); }

/* ------------------------------------------------------------ buttons */
.gj-portal__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: var(--p-control); padding: 0 1.05rem;
  border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 700; font-size: .92rem; text-decoration: none; cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, background-color .14s ease, border-color .14s ease;
  position: relative; overflow: hidden; white-space: nowrap;
}
.gj-portal__btn:hover { transform: translateY(-1px); }
.gj-portal__btn:active { transform: scale(.98); }
.gj-portal__btn--sm { min-height: 2.15rem; padding: 0 .75rem; font-size: .85rem; border-radius: 10px; }
.gj-portal__btn--block { width: 100%; }
.gj-portal__btn--primary { color: var(--p-on-accent) !important; background: linear-gradient(135deg, var(--app-context), var(--app-context-dark)); box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--app-context) 75%, transparent); }
[data-bs-theme="dark"] .gj-portal__btn--primary { background: linear-gradient(135deg, var(--app-context-dark), var(--app-context-glow)); }
.gj-portal__btn--primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / .28) 50%, transparent 70%); transform: translateX(-110%); transition: transform .6s ease; }
.gj-portal__btn--primary:hover::after { transform: translateX(110%); }
.gj-portal__btn--ghost { color: var(--p-ink) !important; background: var(--p-surface); border-color: var(--p-line); box-shadow: var(--p-shadow-1); }
.gj-portal__btn--ghost:hover { border-color: var(--app-context-border); box-shadow: var(--p-shadow-2); }
.gj-portal__btn[aria-disabled="true"] { opacity: .45; pointer-events: none; box-shadow: none; }
.gj-portal__btn--glow { color: #0b1520 !important; background: var(--app-context-glow); box-shadow: 0 10px 26px -12px var(--app-context-glow); }
.gj-portal__btn--glass { color: var(--theme-chrome-ink) !important; background: var(--theme-chrome-glass-strong); border-color: var(--theme-chrome-line); backdrop-filter: blur(10px); }
.gj-portal__icon-btn {
  flex: none; display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 12px; cursor: pointer;
  color: var(--p-ink) !important; background: var(--p-surface); border: 1px solid var(--p-line); text-decoration: none; font-size: 1.05rem;
  transition: transform .14s ease, border-color .14s ease, color .14s ease;
}
.gj-portal__icon-btn:hover { transform: translateY(-1px); border-color: var(--app-context-border); color: var(--p-accent-ink) !important; }
.gj-portal__icon-btn--glass { color: var(--theme-chrome-ink) !important; background: var(--theme-chrome-glass-strong); border-color: var(--theme-chrome-line); }

/* ------------------------------------------------------------ hero (aurora band) */
.gj-portal__hero {
  position: relative; overflow: hidden; isolation: isolate; margin: .25rem 0 1.25rem; padding: 1.4rem 1.2rem; border-radius: 22px;
  color: var(--theme-chrome-ink);
  background:
    radial-gradient(60% 120% at 100% 0%, color-mix(in srgb, var(--app-context-accent2) 30%, transparent), transparent 60%),
    radial-gradient(70% 140% at 0% 100%, color-mix(in srgb, var(--app-context-glow) 24%, transparent), transparent 55%),
    linear-gradient(135deg, var(--app-context-deep), var(--app-context-deeper));
  box-shadow: 0 24px 50px -30px color-mix(in srgb, var(--app-context-deep) 90%, transparent);
  display: grid; gap: 1.1rem;
}
.gj-portal__hero::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, transparent, var(--app-context-glow), var(--app-context-accent2), transparent); opacity: .8; }
.gj-portal__hero::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .35; background: radial-gradient(circle, var(--theme-chrome-glass-strong) 1px, transparent 1.6px) 0 0 / 18px 18px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 65%); mask-image: linear-gradient(90deg, transparent, #000 65%); }
.gj-portal__hero--compact { padding: 1.15rem 1.2rem; }
.gj-portal__hero-text h1 { font-size: clamp(1.45rem, 4.6vw, 2rem); font-weight: 800; display: flex; align-items: center; gap: .7rem; color: #fff; overflow-wrap: anywhere; }
.gj-portal__hero-text p { margin: .35rem 0 0; color: var(--theme-chrome-muted); max-width: 46rem; }
.gj-portal__eyebrow { margin: 0 0 .35rem !important; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--app-context-glow) !important; }
.gj-portal__hero-icon { flex: none; display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 14px; font-size: 1.2rem; color: #0b1520; background: linear-gradient(135deg, var(--app-context-glow), var(--app-context-accent2)); box-shadow: 0 10px 24px -10px var(--app-context-glow); }
.gj-portal__hero-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.gj-portal__hero-pills { margin-top: .6rem; }

/* KPI tiles (glass on the hero) */
.gj-portal__kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .65rem; }
.gj-portal__kpi {
  position: relative; display: grid; gap: .1rem; padding: .85rem .95rem 1rem; border-radius: 16px; text-decoration: none;
  color: var(--theme-chrome-ink) !important; background: var(--theme-chrome-glass); border: 1px solid var(--theme-chrome-line);
  backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
  transition: transform .16s ease, background-color .16s ease; animation: gj-portal-rise .45s ease both;
}
.gj-portal__kpi:nth-child(2) { animation-delay: .05s; } .gj-portal__kpi:nth-child(3) { animation-delay: .1s; }
a.gj-portal__kpi:hover { transform: translateY(-2px); background: var(--theme-chrome-glass-strong); }
.gj-portal__kpi::after { content: ""; position: absolute; left: .95rem; right: .95rem; bottom: .45rem; height: 3px; border-radius: 3px; background: var(--tone); opacity: .9; }
.gj-portal__kpi--spotlight { border: 1px solid transparent; background: linear-gradient(color-mix(in srgb, var(--app-context-deeper) 70%, transparent), color-mix(in srgb, var(--app-context-deeper) 70%, transparent)) padding-box, linear-gradient(135deg, var(--app-context-glow), var(--app-context-accent2)) border-box; }
.gj-portal__kpi-icon { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 10px; margin-bottom: .3rem; color: #0b1520; background: color-mix(in srgb, var(--tone) 70%, #fff); }
.gj-portal__kpi-label { font-size: .7rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--theme-chrome-muted); }
.gj-portal__kpi-value { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; color: #fff; overflow-wrap: anywhere; }
.gj-portal__kpi small { color: var(--theme-chrome-muted); font-size: .8rem; padding-bottom: .35rem; }

/* ------------------------------------------------------------ sections and site cards */
.gj-portal__section-title { display: flex; align-items: center; gap: .55rem; margin: 1.6rem 0 .8rem !important; font-size: 1.1rem; font-weight: 800; }
.gj-portal__section-title i { color: var(--p-accent-ink); }
.gj-portal__site-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.gj-portal__site-card {
  display: flex; flex-direction: column; background: var(--p-surface); border: 1px solid var(--p-line); border-radius: var(--p-radius);
  box-shadow: var(--p-shadow-1); overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; animation: gj-portal-rise .45s ease both;
}
.gj-portal__site-card:hover { transform: translateY(-2px); box-shadow: var(--p-shadow-2); }
.gj-portal__site-head { display: flex; gap: .8rem; padding: 1rem 1.1rem; background: linear-gradient(180deg, var(--app-context-soft), transparent); border-bottom: 1px solid var(--p-line); }
.gj-portal__site-head h3 { font-size: 1.05rem; font-weight: 800; overflow-wrap: anywhere; }
.gj-portal__site-head p { margin: .2rem 0 0; color: var(--p-muted); font-size: .85rem; display: flex; gap: .35rem; overflow-wrap: anywhere; }
.gj-portal__site-tile { flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 13px; color: #fff; font-size: 1.15rem; background: linear-gradient(135deg, var(--app-context), var(--app-context-accent2)); box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--app-context) 75%, transparent); }
.gj-portal__site-block { padding: .9rem 1.1rem .4rem; }
.gj-portal__site-block h4, .gj-portal__stat-label, .gj-portal__micro { font-size: .7rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--p-muted); }
.gj-portal__site-block h4 { margin-bottom: .45rem; }
.gj-portal__mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.gj-portal__mini-list li { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .45rem .55rem; margin: 0 -.55rem; border-radius: 10px; transition: background-color .14s ease; }
.gj-portal__mini-list li:hover { background: var(--p-raised); }
.gj-portal__mini-list a { display: grid; min-width: 0; text-decoration: none; color: var(--p-ink) !important; }
.gj-portal__mini-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gj-portal__mini-meta { color: var(--p-muted); font-size: .8rem; }
.gj-portal__site-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; padding: .7rem 1.1rem 1rem; }
.gj-portal__site-stats > div { display: grid; gap: .1rem; padding: .7rem .8rem; border-radius: 12px; background: var(--p-raised); border: 1px solid var(--p-line); min-width: 0; }
.gj-portal__site-stats strong { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.gj-portal__site-stats small { color: var(--p-muted); font-size: .78rem; overflow-wrap: anywhere; }
.gj-portal__site-links { margin-top: auto; display: flex; flex-wrap: wrap; border-top: 1px solid var(--p-line); }
.gj-portal__site-links a { flex: 1 1 33%; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .7rem .5rem; font-weight: 700; font-size: .85rem; text-decoration: none; color: var(--p-accent-ink) !important; }
.gj-portal__site-links a + a { border-left: 1px solid var(--p-line); }
.gj-portal__site-links a:hover i { transform: translateX(3px); }
.gj-portal__site-links i { transition: transform .16s ease; }

/* ------------------------------------------------------------ pills and chips */
.gj-portal__pill { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 750; white-space: nowrap; color: var(--tone-ink); background: var(--tone-soft); border: 1px solid color-mix(in srgb, var(--tone) 28%, transparent); }
.gj-portal__pill--glass { color: var(--theme-chrome-ink); background: var(--theme-chrome-glass-strong); border-color: var(--theme-chrome-line); }
.gj-portal__chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.gj-portal__chip { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .5rem; border-radius: 8px; font-size: .76rem; font-weight: 600; color: var(--p-muted); background: var(--p-raised); border: 1px solid var(--p-line); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gj-portal__chip[data-tone] { color: var(--tone-ink); background: var(--tone-soft); border-color: transparent; }

/* ------------------------------------------------------------ filters */
.gj-portal__filters { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; align-items: end; margin-bottom: 1rem; padding: .85rem; border-radius: var(--p-radius); background: var(--p-surface); border: 1px solid var(--p-line); box-shadow: var(--p-shadow-1); }
.gj-portal__field { display: grid; gap: .3rem; align-content: start; min-width: 0; }
.gj-portal__field > span:first-child { font-size: .78rem; font-weight: 750; color: var(--p-muted); }
.gj-portal__field input, .gj-portal__field select {
  width: 100%; min-height: var(--p-control); padding: 0 .75rem; border-radius: 11px; border: 1px solid var(--p-line); font: inherit; font-size: .92rem;
  color: var(--p-ink); background: var(--p-surface); box-shadow: inset 0 1px 2px rgb(16 24 40 / .05); transition: border-color .14s ease, box-shadow .14s ease;
}
.gj-portal__field input:focus, .gj-portal__field select:focus { outline: none; border-color: var(--app-context); box-shadow: 0 0 0 3px var(--p-focus); }
.gj-portal__field input[aria-invalid="true"] { border-color: var(--theme-danger); }
.gj-portal__filter-actions { grid-column: 1 / -1; display: flex; gap: .5rem; flex-wrap: wrap; }
.gj-portal__filter-actions .gj-portal__btn { flex: 1 1 auto; }
.gj-portal__segmented { grid-column: 1 / -1; display: inline-flex; gap: .25rem; padding: .25rem; border-radius: 12px; background: var(--p-raised); border: 1px solid var(--p-line); justify-self: start; }
.gj-portal__segmented a { padding: .4rem .9rem; border-radius: 9px; font-weight: 700; font-size: .88rem; text-decoration: none; color: var(--p-muted) !important; }
.gj-portal__segmented a[aria-current="true"] { color: var(--p-ink) !important; background: var(--p-surface); box-shadow: var(--p-shadow-1); }

/* ------------------------------------------------------------ rich rows */
.gj-portal__rows { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.gj-portal__row {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "tile main action" "tile date status"; gap: .35rem .8rem; align-items: center;
  padding: .9rem .95rem .9rem 1.1rem; border-radius: 14px; background: var(--p-surface); border: 1px solid var(--p-line); box-shadow: var(--p-shadow-1);
  transition: transform .16s ease, box-shadow .16s ease; animation: gj-portal-rise .4s ease both;
}
.gj-portal__row::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--tone); opacity: .65; transition: opacity .16s ease; }
.gj-portal__row:hover { transform: translateY(-1px); box-shadow: var(--p-shadow-2); }
.gj-portal__row:hover::before { opacity: 1; }
.gj-portal__row:nth-child(2) { animation-delay: .04s; } .gj-portal__row:nth-child(3) { animation-delay: .08s; } .gj-portal__row:nth-child(4) { animation-delay: .12s; } .gj-portal__row:nth-child(5) { animation-delay: .16s; }
.gj-portal__row-tile { grid-area: tile; align-self: start; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 12px; font-size: 1.1rem; color: var(--tone-ink); background: var(--tone-soft); }
.gj-portal__row-main { grid-area: main; min-width: 0; }
.gj-portal__row-title { font-weight: 750; color: var(--p-ink) !important; text-decoration: none; overflow-wrap: anywhere; }
a.gj-portal__row-title:hover { color: var(--p-accent-ink) !important; text-decoration: underline; text-underline-offset: 3px; }
.gj-portal__row-date { grid-area: date; display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .45rem; font-size: .86rem; }
.gj-portal__row-date small { color: var(--p-muted); }
.gj-portal__row > .gj-portal__pill { grid-area: status; justify-self: end; }
.gj-portal__row > .gj-portal__icon-btn, .gj-portal__row > .gj-portal__btn { grid-area: action; justify-self: end; align-self: start; }
.gj-portal__row--invoice { grid-template-areas: "tile main action" "tile date date" "tile amount status"; }
.gj-portal__row-amount { grid-area: amount; display: grid; }
.gj-portal__row-amount strong { font-size: 1.08rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.gj-portal__row-amount small { color: var(--tone-ink); font-weight: 650; font-size: .8rem; }

/* ------------------------------------------------------------ panels, coverage, tables */
.gj-portal__split { display: grid; gap: 1rem; }
.gj-portal__panel { padding: 1rem; border-radius: var(--p-radius); background: var(--p-surface); border: 1px solid var(--p-line); box-shadow: var(--p-shadow-1); min-width: 0; }
.gj-portal__panel > h2 { display: flex; align-items: center; gap: .5rem; font-size: 1rem; font-weight: 800; margin-bottom: .8rem; }
.gj-portal__panel > h2 i { color: var(--p-accent-ink); }
.gj-portal__coverage { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.gj-portal__coverage li { display: grid; grid-template-columns: auto 1fr; gap: .3rem .7rem; align-items: center; padding: .65rem .7rem; border-radius: 12px; background: var(--p-raised); border: 1px solid var(--p-line); }
.gj-portal__coverage-dot { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; color: var(--tone-ink); background: var(--tone-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 16%, transparent); }
.gj-portal__coverage-main { min-width: 0; display: grid; }
.gj-portal__coverage-main strong { overflow-wrap: anywhere; }
.gj-portal__coverage-main small, .gj-portal__coverage-stats small { color: var(--p-muted); font-size: .8rem; }
.gj-portal__coverage-stats { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.gj-portal__table-wrap { overflow-x: auto; margin: 0 -.25rem; }
.gj-portal__table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.gj-portal__table thead { display: none; }
.gj-portal__table tr { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem .75rem; padding: .7rem .25rem; border-bottom: 1px solid var(--p-line); }
.gj-portal__table td { display: block; min-width: 0; overflow-wrap: anywhere; }
.gj-portal__table td::before { content: attr(data-label); display: block; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--p-muted); }

/* ------------------------------------------------------------ detail */
.gj-portal__back { display: inline-flex; align-items: center; gap: .4rem; margin: .2rem 0 .6rem; font-weight: 700; text-decoration: none; }
.gj-portal__facts { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: 0 0 1rem; }
.gj-portal__facts > div { padding: .75rem .85rem; border-radius: 12px; background: var(--p-surface); border: 1px solid var(--p-line); box-shadow: var(--p-shadow-1); min-width: 0; }
.gj-portal__facts dt { font-size: .7rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--p-muted); }
.gj-portal__facts dd { margin: .15rem 0 0; font-weight: 650; overflow-wrap: anywhere; }
.gj-portal__prose { white-space: pre-line; margin: 0; overflow-wrap: anywhere; }
.gj-portal__note { display: flex; gap: .5rem; margin: 1rem 0 0; padding: .7rem .85rem; border-radius: 12px; font-size: .86rem; color: var(--p-muted); background: var(--p-raised); border: 1px dashed var(--p-line); }

/* ------------------------------------------------------------ states */
.gj-portal__empty { display: grid; justify-items: center; text-align: center; gap: .45rem; padding: 2.4rem 1rem; border-radius: var(--p-radius); background: var(--p-surface); border: 1px dashed var(--p-line); }
.gj-portal__empty--inline { padding: 1.6rem .8rem; background: var(--p-raised); }
.gj-portal__empty strong { font-size: 1.05rem; }
.gj-portal__empty > span:not(.gj-portal__empty-icon) { color: var(--p-muted); max-width: 30rem; }
.gj-portal__empty-icon, .gj-portal__state-icon { display: grid; place-items: center; width: 3.4rem; height: 3.4rem; border-radius: 50%; font-size: 1.45rem; color: var(--p-accent-ink); background: var(--app-context-soft); box-shadow: 0 0 0 8px color-mix(in srgb, var(--app-context) 7%, transparent); margin-bottom: .3rem; }
.gj-portal__empty-icon--amber, .gj-portal__state-icon--amber { color: #92400e; background: #fef3c7; box-shadow: 0 0 0 8px rgb(217 119 6 / .1); }
[data-bs-theme="dark"] .gj-portal__empty-icon--amber, [data-bs-theme="dark"] .gj-portal__state-icon--amber { color: #fcd34d; background: rgb(251 191 36 / .15); }
.gj-portal__flash { display: flex; align-items: center; gap: .55rem; margin: .3rem 0 1rem; padding: .7rem .9rem; border-radius: 12px; font-weight: 600; color: #166534; background: #dcfce7; border: 1px solid #bbf7d0; animation: gj-portal-rise .35s ease both; }
[data-bs-theme="dark"] .gj-portal__flash { color: #86efac; background: rgb(52 211 153 / .12); border-color: rgb(52 211 153 / .25); }
.gj-portal__pager { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: 1rem; }
.gj-portal__pager-text { color: var(--p-muted); font-size: .86rem; text-align: center; }
.gj-portal__pager-text--solo { margin: .8rem 0 0; }
.gj-portal__footer { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1rem; padding: 1.2rem 1rem 1.6rem; color: var(--p-muted); font-size: .8rem; }
.gj-portal__footer-mark { opacity: .8; }

/* ------------------------------------------------------------ sign-in surfaces */
.gj-portal--auth { background: var(--p-canvas); }
.gj-portal__auth-aurora {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(50% 60% at 85% 10%, color-mix(in srgb, var(--app-context-accent2) 26%, transparent), transparent 70%),
    radial-gradient(55% 65% at 10% 90%, color-mix(in srgb, var(--app-context-glow) 22%, transparent), transparent 70%),
    linear-gradient(160deg, var(--app-context-deep), var(--app-context-deeper));
}
.gj-portal__auth-aurora::after { content: ""; position: absolute; inset: 0; opacity: .4; background: radial-gradient(circle, var(--theme-chrome-glass-strong) 1px, transparent 1.6px) 0 0 / 20px 20px; -webkit-mask-image: radial-gradient(70% 60% at 50% 40%, #000, transparent); mask-image: radial-gradient(70% 60% at 50% 40%, #000, transparent); }
.gj-portal__auth-tools { position: fixed; top: 14px; right: 14px; z-index: 5; }
.gj-portal--auth .gj-portal__main { position: relative; z-index: 1; display: grid; place-items: center; padding-top: 3.5rem; }
.gj-portal__auth { width: 100%; max-width: 440px; }
.gj-portal__auth-card {
  position: relative; padding: 1.6rem 1.3rem; border-radius: 24px; border: 1px solid transparent;
  background:
    linear-gradient(var(--p-surface), var(--p-surface)) padding-box,
    linear-gradient(135deg, var(--app-context-glow), var(--p-line) 40%, var(--p-line) 60%, var(--app-context-accent2)) border-box;
  box-shadow: 0 30px 80px -20px rgb(9 14 22 / .55); animation: gj-portal-pop .4s cubic-bezier(.2,.9,.3,1.2) both;
}
.gj-portal__auth-brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.3rem; }
.gj-portal__auth-brand small { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--p-muted); }
.gj-portal__auth-brand strong { display: block; font-size: 1.05rem; overflow-wrap: anywhere; }
.gj-portal__auth-mark { flex: none; display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 15px; font-size: 1.35rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--app-context), var(--app-context-accent2)); box-shadow: 0 12px 26px -12px color-mix(in srgb, var(--app-context) 80%, transparent); overflow: hidden; }
.gj-portal__auth-mark--logo { background: var(--p-surface); border: 1px solid var(--p-line); }
.gj-portal__auth-mark--logo img { width: 100%; height: 100%; object-fit: contain; }
.gj-portal__auth-title { font-size: 1.45rem; font-weight: 800; }
.gj-portal__auth-lead { margin: .45rem 0 1.15rem; color: var(--p-muted); overflow-wrap: anywhere; }
.gj-portal__auth-form { display: grid; gap: .8rem; }
.gj-portal__input-icon { position: relative; display: block; }
.gj-portal__input-icon i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--p-muted); pointer-events: none; }
.gj-portal__input-icon input { padding-left: 2.4rem; min-height: 2.9rem; }
.gj-portal__field-error { display: flex; align-items: center; gap: .4rem; margin: -.3rem 0 0; color: var(--theme-danger); font-weight: 600; font-size: .86rem; }
.gj-portal__auth-points { list-style: none; margin: 1.2rem 0 0; padding: .9rem 0 0; border-top: 1px solid var(--p-line); display: grid; gap: .45rem; color: var(--p-muted); font-size: .9rem; }
.gj-portal__auth-points li { display: flex; gap: .55rem; align-items: center; }
.gj-portal__auth-points i { color: var(--p-accent-ink); }
.gj-portal__auth-note { margin: 1rem 0 0; font-size: .8rem; color: var(--p-muted); text-align: center; }
.gj-portal__state { display: grid; justify-items: center; text-align: center; }
.gj-portal__state .gj-portal__auth-points { text-align: left; margin-bottom: 1.1rem; justify-self: stretch; }

/* Phones: the four sections as an evenly split tab bar, a lone last KPI tile spans the row,
   and rows give the title the full width under the tile. */
@media (max-width: 639.98px) {
  .gj-portal__nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .3rem; overflow: visible; }
  .gj-portal__nav a { flex-direction: column; justify-content: center; gap: .1rem; padding: .4rem .2rem; border-radius: 12px; font-size: .74rem; text-align: center; line-height: 1.2; }
  .gj-portal__nav a i { font-size: 1.05rem; }
  .gj-portal__kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .gj-portal__row { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "tile main action" "date date status"; }
  .gj-portal__row--invoice { grid-template-areas: "tile main action" "date date date" "amount amount status"; }
  .gj-portal__brand-text strong { font-size: .95rem; }
}
.gj-portal__table td:first-child { white-space: nowrap; }
.gj-portal__filters--inline { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem 1rem; }
.gj-portal__filters--inline .gj-portal__segmented { align-self: end; }
.gj-portal__filters--inline .gj-portal__field { min-width: 14rem; }
.gj-portal__filters--inline .gj-portal__filter-actions { grid-column: auto; }

/* gj-ui.js page loader: keep the thin top bar, skip the full overlay on this lightweight surface. */
.gj-portal .gj-loader-bar { position: fixed; top: 0; left: 0; z-index: 60; height: 3px; width: 40%; background: linear-gradient(90deg, var(--app-context), var(--app-context-glow)); animation: gj-portal-load 1.1s ease-in-out infinite; }
.gj-portal .gj-loader { display: none; }

@keyframes gj-portal-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes gj-portal-pop { from { opacity: 0; transform: scale(.97) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes gj-portal-load { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ------------------------------------------------------------ larger screens */
@media (min-width: 640px) {
  .gj-portal__main { padding: 1.4rem 1.5rem 3rem; }
  .gj-portal__who { display: inline-flex; }
  .gj-portal__hero { padding: 1.8rem 1.8rem; }
  .gj-portal__filters { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
  .gj-portal__filter-actions { grid-column: auto; }
  .gj-portal__filter-actions .gj-portal__btn { flex: 0 0 auto; }
  .gj-portal__facts { grid-template-columns: repeat(3, 1fr); }
  .gj-portal__auth-card { padding: 2rem 2rem; }
}
@media (min-width: 900px) {
  .gj-portal__bar-inner { padding: .8rem 1.5rem; }
  .gj-portal__nav { padding: 0 1.5rem .65rem; }
  .gj-portal__hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; }
  .gj-portal__hero--compact { grid-template-columns: 1fr auto; }
  .gj-portal__site-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
  .gj-portal__split { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; }
  .gj-portal__row { grid-template-columns: auto minmax(0, 1fr) 9.5rem 8rem auto; grid-template-areas: "tile main date status action"; }
  .gj-portal__row-date { display: grid; gap: 0; }
  .gj-portal__row--invoice { grid-template-columns: auto minmax(0, 1fr) 9.5rem 9rem 8rem auto; grid-template-areas: "tile main date amount status action"; }
  .gj-portal__row-amount { text-align: right; }
  .gj-portal__row > .gj-portal__icon-btn, .gj-portal__row > .gj-portal__btn { align-self: center; }
  .gj-portal__row > .gj-portal__pill { justify-self: start; }
  .gj-portal__table thead { display: table-header-group; }
  .gj-portal__table th { position: sticky; top: 0; text-align: left; padding: .55rem .6rem; font-size: .7rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--p-muted); border-bottom: 1px solid var(--p-line); background: var(--p-surface); }
  .gj-portal__table tr { display: table-row; padding: 0; }
  .gj-portal__table td { display: table-cell; padding: .65rem .6rem; border-bottom: 1px solid var(--p-line); vertical-align: middle; }
  .gj-portal__table tbody tr:hover td { background: var(--p-raised); }
  .gj-portal__table td::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .gj-portal *, .gj-portal *::before, .gj-portal *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------ project progress (PROJECT_PLANNER_CONTRACT.md) */
.gj-portal__row--project { grid-template-areas: "tile main action" "tile amount amount" "tile date status"; }
.gj-portal__progress { grid-area: amount; display: grid; grid-template-columns: auto auto; justify-content: start; align-items: baseline; gap: .1rem .45rem; min-width: 0; }
.gj-portal__progress strong { font-size: 1.08rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.gj-portal__progress .gj-portal__progress-bar { grid-column: 1 / -1; }
.gj-portal__progress-bar { position: relative; display: block; width: 100%; min-width: 6rem; height: .5rem; overflow: hidden; border-radius: 999px; background: var(--p-raised); box-shadow: inset 0 0 0 1px var(--p-line); }
.gj-portal__progress-bar > span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, var(--app-context), var(--app-context-glow)); }
.gj-portal__milestones { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.gj-portal__milestones li { position: relative; display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto; gap: .65rem; align-items: start; padding: 0 0 .9rem; }
.gj-portal__milestones li::before { content: ""; position: absolute; left: .75rem; top: 1.5rem; bottom: 0; width: 2px; background: var(--p-line); }
.gj-portal__milestones li:last-child::before { display: none; }
.gj-portal__milestones strong { display: block; font-weight: 750; overflow-wrap: anywhere; }
.gj-portal__milestones small { color: var(--p-muted); }
.gj-portal__diamond { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; }
.gj-portal__diamond::before { content: ""; width: .9rem; height: .9rem; border-radius: 3px; transform: rotate(45deg); background: var(--tone); box-shadow: 0 0 0 4px var(--tone-soft); }
.gj-portal__phases { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.gj-portal__phases li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(5rem, 9rem) 2.6rem; gap: .7rem; align-items: center; }
.gj-portal__phases strong { display: block; font-weight: 700; overflow-wrap: anywhere; }
.gj-portal__phases small { color: var(--p-muted); }
.gj-portal__phases b { text-align: end; font-variant-numeric: tabular-nums; }
.gj-portal__split > div { display: grid; gap: 1rem; align-content: start; }
@media (min-width: 900px) {
  .gj-portal__row--project { grid-template-columns: auto minmax(0, 1fr) 10rem 12rem 7rem auto; grid-template-areas: "tile main amount date status action"; }
}
