/* AI Software Development: portal sign-in gate and portal design preview. Tokens live in base.css. */
.muted { color: var(--muted); font-size: 13px; }
.tag {
  display: inline-flex; align-items: center; vertical-align: middle; margin-left: 6px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--warning); border: 1px solid rgba(221, 184, 86, 0.45); background: rgba(221, 184, 86, 0.08);
  border-radius: 999px; padding: 1px 7px; line-height: 1.5;
}
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; }
.field input {
  width: 100%; min-height: 46px; padding: 11px 14px; background: rgba(3, 12, 20, 0.8);
  border: 1px solid var(--border); border-radius: var(--r-md); font-size: 15px;
}
.field input:focus-visible { border-color: var(--cyan); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none;
  background: transparent; border: 1px solid transparent; border-radius: var(--r-md); color: var(--text-2); cursor: pointer;
}
.icon-btn:hover:not([disabled]) { color: var(--highlight); background: var(--raised); }
.icon-btn[disabled] { cursor: not-allowed; opacity: 0.6; }
.nav-scrim { position: fixed; inset: 0; background: rgba(1, 6, 11, 0.6); z-index: 40; }

/* =========================== Sign-in gate =========================== */
.gate-page { min-height: 100vh; display: flex; flex-direction: column; }
.gate-bg { position: fixed; inset: 0; z-index: 0; }
.gate-bg img { object-position: 70% center; }
.gate-bg__shade {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(3, 12, 20, 0.96) 0%, rgba(3, 12, 20, 0.85) 38%, rgba(3, 12, 20, 0.35) 70%, rgba(3, 12, 20, 0.2) 100%),
              linear-gradient(0deg, rgba(3, 12, 20, 0.9), rgba(3, 12, 20, 0) 35%);
}
.gate-header, .gate-main, .gate-footer { position: relative; z-index: 1; }
.gate-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 40px; }
/* Ultrawide (Jason's-eyes check, 2026-10-13): the brand, "Back to site" and the footer line up with the card's
   1360px column instead of sitting at the far edges of a 3440px screen. Below 1440px this is the plain 40px. */
.gate-header, .gate-footer { padding-left: calc(40px + max(0px, (100vw - 1360px) / 2)); padding-right: calc(40px + max(0px, (100vw - 1360px) / 2)); }
.gate-back { color: var(--text-2); text-decoration: none; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.gate-back:hover { color: var(--highlight); }
.gate-back__icon { transform: rotate(180deg); }
.gate-main { flex: 1; display: flex; align-items: center; padding: 24px 40px 48px; }
.gate-card {
  width: 100%; max-width: 440px; margin-left: max(0px, calc((100vw - 1360px) / 2));
  padding: 32px; border-radius: var(--r-lg);
  background: rgba(7, 27, 41, 0.82); border: 1px solid var(--border); backdrop-filter: blur(12px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.gate-title { font-size: 34px; margin: 12px 0 8px; }
.gate-sub { color: var(--text-2); font-size: 15px; margin-bottom: 18px; }
.notice {
  display: flex; gap: 10px; align-items: flex-start; margin: 22px 0; padding: 12px 14px;
  border-radius: var(--r-md); font-size: 14px; line-height: 1.45;
}
.notice .icon { margin-top: 2px; }
.notice--warn { background: rgba(221, 184, 86, 0.08); border: 1px solid rgba(221, 184, 86, 0.4); color: var(--text); }
.notice--warn .icon { color: var(--warning); }
.notice.is-flash { animation: flash 1.2s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(221, 184, 86, 0.6); } 100% { box-shadow: 0 0 0 10px rgba(221, 184, 86, 0); } }
.gate-form { display: grid; gap: 16px; }
.gate-submit { width: 100%; margin-top: 4px; }
/* One sign-in: the Forgot password · Create account · Email me a code row under the form. */
.gate-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 14px 0 10px; color: var(--muted); font-size: 14px; }
.gate-link { background: none; border: 0; padding: 6px 0; min-height: 44px; color: var(--highlight); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.gate-link:hover { color: var(--cyan); }
/* View as (owner sessions only): the small switch in the top bar, js/portal-shell.js. */
.view-as { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.view-as select { min-height: 44px; padding: 4px 8px; background: rgba(3, 12, 20, 0.8); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-md); font: inherit; font-size: 13px; }
.view-as select:focus-visible { border-color: var(--cyan); }
.gate-preview { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.gate-preview__link { display: inline-flex; gap: 8px; align-items: center; color: var(--highlight); font-weight: 500; min-height: 44px; }
.gate-preview__note { color: var(--muted); font-size: 13px; }
.gate-footer { padding-top: 18px; padding-bottom: 18px; color: var(--muted); font-size: 13px; }

/* =========================== Portal preview =========================== */
.preview-banner {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 10px; padding: 8px 20px; min-height: 40px;
  background: #2A2310; border-bottom: 1px solid rgba(221, 184, 86, 0.55); color: #F6E7BC; font-size: 13.5px;
}
.preview-banner .icon { color: var(--warning); }
.preview-banner p { flex: 1; }
.preview-banner__more { color: #D9C893; }
.preview-banner__link { color: #F6E7BC; font-weight: 500; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }

.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 40px); background: linear-gradient(90deg, var(--sidebar) 219px, var(--border) 219px, var(--border) 220px, transparent 220px); }
.sidebar {
  background: var(--sidebar); border-right: 1px solid var(--border);
  padding: 18px 12px; display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: 40px; height: calc(100vh - 40px); overflow-y: auto;
}
.sidebar__top { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.sidebar__close { display: none; }
.brand--stack .brand__mark { width: 36px; height: 36px; }
.brand--stack .brand__name { font-size: 14px; line-height: 1.2; font-weight: 600; }
.side-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.side-nav a, .side-nav__soon {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px;
  color: var(--text-2); text-decoration: none; font-size: 14.5px; border-radius: var(--r-sm); border: 1px solid transparent;
}
.side-nav a:hover { color: var(--text); background: rgba(11, 35, 52, 0.7); }
.side-nav a[aria-current="page"] {
  color: var(--text); background: linear-gradient(90deg, rgba(52, 200, 244, 0.18), rgba(52, 200, 244, 0.04));
  border-color: rgba(38, 115, 152, 0.55);
}
.side-nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: -1px; top: 9px; bottom: 9px; width: 3px; border-radius: 2px;
  background: var(--cyan); box-shadow: var(--glow);
}
.side-nav a[aria-current="page"] .icon { color: var(--cyan); }
.side-nav__soon { color: var(--muted); cursor: default; }
.side-nav__soon em, .is-soon em { font-style: normal; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; margin-left: auto; }
.sidebar__foot { margin-top: auto; padding: 0 14px; color: var(--muted); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }

.app__main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 12px 24px; min-height: 68px;
  border-bottom: 1px solid var(--border); background: rgba(3, 12, 20, 0.92);
}
.topbar__menu { display: none; }
.search {
  flex: 0 1 420px; min-width: 0; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 10px 0 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md); color: var(--muted);
}
.search:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(52, 200, 244, 0.15); }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; height: 100%; font-size: 14px; color: var(--text); }
.search input:focus { outline: none; }
.search input::placeholder { color: var(--muted); }
.search kbd { font-size: 11px; color: var(--text-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: var(--r-md); }
.user__avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); border: 1px solid var(--outline-active); color: var(--cyan); }
.user__text { display: grid; line-height: 1.2; }
.user__text strong { font-size: 13.5px; font-weight: 600; }
.user__text small { font-size: 12px; color: var(--muted); }
.user__chev { color: var(--muted); }

.dash { padding: 20px 24px 24px; display: grid; gap: 18px; }

.welcome {
  position: relative; min-height: 172px; border-radius: var(--r-lg); border: 1px solid var(--border);
  display: flex; align-items: center; background: var(--panel);
}
.welcome > picture { left: 32%; }
.welcome__img { object-position: center 42%; }
.welcome__shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, var(--bg) 0%, var(--bg) 30%, rgba(3, 12, 20, 0.55) 48%, rgba(3, 12, 20, 0) 75%);
}
.welcome__copy { position: relative; padding: 24px 28px; }
.welcome h1, .welcome__title { font-size: clamp(30px, 3vw, 42px); font-weight: 600; margin: 10px 0 6px; }
.welcome__sub { color: var(--text-2); font-size: 16px; }
.welcome__tag {
  position: absolute; right: 230px; top: 20px; text-align: right; font-size: 11px; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--text); line-height: 1.7; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric {
  display: flex; gap: 16px; align-items: flex-start; padding: 20px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
}
.metric__icon {
  width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center;
  color: var(--cyan); background: radial-gradient(circle, rgba(52, 200, 244, 0.16), rgba(52, 200, 244, 0.04));
  border: 1px solid rgba(38, 115, 152, 0.7); box-shadow: inset 0 0 14px rgba(52, 200, 244, 0.15);
}
.metric__label { font-family: var(--font-body); font-size: 13px; font-weight: 500; color: var(--text-2); }
.metric__value { font-family: var(--font-head); font-size: 28px; font-weight: 600; margin: 2px 0 4px; line-height: 1.2; }
.metric__link { display: inline-flex; align-items: center; gap: 6px; color: var(--cyan); font-size: 13px; font-weight: 500; text-decoration: none; min-height: 44px; }
.metric__link:hover { color: var(--highlight); }
.metric__link.is-soon { color: var(--muted); gap: 8px; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px 18px 14px; min-width: 0; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.panel__head h2 { font-family: var(--font-body); font-size: 15px; font-weight: 600; }
.panel__more { font-size: 12.5px; color: var(--muted); }
a.panel__more { color: var(--cyan); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
a.panel__more:hover { color: var(--highlight); }
.grid2 > .eva-p { margin-top: 0; }
.panel__note { color: var(--muted); font-size: 12px; margin-top: 8px; }
.list { list-style: none; margin: 0; padding: 0; }
.list__empty { color: var(--muted); font-size: 13px; padding: 10px 2px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid rgba(23, 59, 81, 0.6); min-height: 58px; }
.row:first-child { border-top: 0; }
.row__text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row__text strong { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__text small { font-size: 12px; color: var(--muted); }
.row__chev { color: var(--muted); }
.row__time { font-size: 12px; color: var(--muted); white-space: nowrap; align-self: flex-start; padding-top: 2px; }
/* A feed row's time ("5 min ago · Oct 13, 2026, 8:25 PM") drops under the text when the
   column is narrow, instead of squeezing the title to a few letters. */
.row--feed { flex-wrap: wrap; row-gap: 2px; }
.row--feed .row__text { flex: 1 1 160px; }
.row--feed .row__time { margin-left: auto; white-space: normal; max-width: 100%; text-align: right; }
.row__actions { display: flex; gap: 8px; }
.row__actions .btn { min-height: 44px; padding: 4px 14px; font-size: 12.5px; border-radius: var(--r-sm); }
.thumb { width: 52px; height: 40px; flex: none; border-radius: var(--r-sm); border: 1px solid rgba(38, 115, 152, 0.6); background: var(--raised) center / cover no-repeat; }
.thumb--ai { background-image: url("../images/card-ai.webp"); }
.thumb--sw { background-image: url("../images/card-software.webp"); }
.thumb--auto { background-image: url("../images/card-automation.webp"); }
.thumb--data { background-image: url("../images/portal-banner.webp"); background-position: 30% 60%; }
.status { display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.core__foot .status::before { display: none; }
.status--ok { color: var(--success); }
.status--warn { color: var(--warning); }
.status--info { color: var(--cyan); }
.feed-icon { width: 36px; height: 36px; flex: none; border-radius: var(--r-sm); display: grid; place-items: center; border: 1px solid; }
.feed-icon--ok { color: var(--success); border-color: rgba(54, 200, 148, 0.45); background: rgba(54, 200, 148, 0.1); }
.feed-icon--warn { color: var(--warning); border-color: rgba(221, 184, 86, 0.45); background: rgba(221, 184, 86, 0.1); }
.feed-icon--info { color: var(--cyan); border-color: rgba(52, 200, 244, 0.4); background: rgba(52, 200, 244, 0.08); }

.grid3 { display: grid; grid-template-columns: 28fr 44fr 28fr; gap: 18px; align-items: stretch; }
.core { position: relative; display: flex; flex-direction: column; min-width: 0; }
.core__stage { position: relative; flex: 1; min-height: 360px; }
.core__stage .globe { position: absolute; inset: -10px 0 30px; width: 100%; height: calc(100% - 20px); }
.core__base {
  position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); width: 72%; height: 54px;
  border-radius: 50%; border: 1px solid rgba(52, 200, 244, 0.55);
  background: radial-gradient(ellipse at center, rgba(52, 200, 244, 0.22), rgba(7, 27, 41, 0.9) 60%, rgba(3, 12, 20, 0.95));
  box-shadow: 0 0 30px rgba(52, 200, 244, 0.25), inset 0 0 18px rgba(52, 200, 244, 0.25);
  display: grid; place-items: center;
}
.core__base span { font-size: 10.5px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--text-2); }
.core__foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; padding: 10px 8px 0; font-size: 12.5px; }

.grid2 { display: grid; grid-template-columns: 38fr 62fr; gap: 18px; }
.assist { position: relative; display: flex; align-items: stretch; gap: 16px; padding: 0; overflow: hidden; min-height: 176px; }
.assist__body { flex: 1 1 auto; padding: 20px 0 18px 22px; display: grid; align-content: start; gap: 6px; max-width: 520px; }
.assist__body h2 { font-family: var(--font-body); font-size: 16px; font-weight: 600; }
.assist__form { display: flex; align-items: center; gap: 4px; margin-top: 10px; padding: 2px 4px 2px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); }
.assist__form input { flex: 1; min-width: 0; border: 0; background: transparent; height: 44px; font-size: 14px; }
.assist__form input:disabled { color: var(--muted); cursor: not-allowed; }
.assist__form input::placeholder { color: var(--muted); }
.assist__off { font-size: 12px; color: var(--muted); }
.assist__bubble {
  align-self: center; flex: none; padding: 12px 14px; font-size: 12.5px; line-height: 1.45; color: var(--text-2);
  background: rgba(11, 35, 52, 0.9); border: 1px solid var(--border); border-radius: var(--r-md); max-width: 190px;
}
.assist__portrait { flex: 0 0 200px; align-self: stretch; background: transparent; }
.assist__portrait img { object-position: center 30%; -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%); mask-image: linear-gradient(90deg, transparent, #000 30%); }

.app-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 14px 24px 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px; margin-top: auto; }
.app-footer .mono { letter-spacing: 0.18em; text-transform: uppercase; font-size: 11px; }

/* ---- 1024: rebalance ---- */
@media (max-width: 1240px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .core { grid-column: 1 / -1; order: -1; }
  .core__stage { min-height: 340px; }
  .grid2 { grid-template-columns: 1fr; }
  .welcome__tag { display: none; }
}

/* ---- 768: drawer navigation ---- */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); background: none; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; height: 100vh; z-index: 70; width: 260px;
    transform: translateX(-100%); visibility: hidden; transition: transform .28s ease, visibility 0s linear .28s;
  }
  .sidebar.is-open { transform: none; visibility: visible; transition: transform .28s ease; }
  .sidebar__close { display: inline-flex; }
  .nav-scrim { z-index: 65; }
  .topbar__menu { display: inline-flex; }
  .topbar { padding: 10px 16px; gap: 10px; }
  .preview-banner__more { display: none; }
  .gate-header, .gate-main, .gate-footer { padding-left: 24px; padding-right: 24px; }
}

/* ---- 390–430 phones ---- */
@media (max-width: 600px) {
  .dash { padding: 16px; gap: 16px; }
  .search kbd, .user__text, .user__chev { display: none; }
  .welcome { min-height: 200px; align-items: flex-end; }
  .welcome > picture { left: 0; }
  .welcome__shade { background: linear-gradient(0deg, var(--bg) 10%, rgba(3, 12, 20, 0.7) 55%, rgba(3, 12, 20, 0.1)); }
  .welcome__copy { padding: 18px; }
  .welcome__tag { display: none; }
  .metrics { gap: 12px; }
  .metric { flex-direction: column; gap: 10px; padding: 16px; }
  .metric__icon { width: 42px; height: 42px; }
  .metric__value { font-size: 24px; }
  .grid3 { grid-template-columns: 1fr; }
  .core__stage { min-height: 300px; }
  .row--approval { flex-wrap: wrap; }
  .row--approval .row__actions { width: 100%; padding-left: 48px; }
  .assist { flex-direction: column; }
  .assist__body { padding: 18px 18px 0; }
  .assist__bubble { display: none; }
  .assist__portrait { flex: 0 0 220px; min-height: 220px; }
  .assist__portrait img { object-position: center 40%; }
  .assist__portrait img { -webkit-mask-image: linear-gradient(0deg, transparent, #000 40%); mask-image: linear-gradient(0deg, transparent, #000 40%); }
  .preview-banner { padding: 6px 12px; font-size: 12.5px; }
  .gate-card { padding: 24px 18px; }
  .gate-title { font-size: 28px; }
  .gate-header .brand__name { font-size: 15px; }
  .gate-header, .gate-main, .gate-footer { padding-left: 16px; padding-right: 16px; }
  .gate-back { font-size: 0; gap: 0; min-width: 44px; justify-content: center; }
  .gate-back__icon { width: 20px; height: 20px; }
}
.row__sentence { font-size: 13.5px; line-height: 1.4; overflow-wrap: anywhere; }

/* Ultrawide (Jason's-eyes check 2026-10-13; shared with portal-preview.html since audit 003): on a 3440px screen the
   working area stops at 1632px and sits centred right of the sidebar; the top bar and footer line up with it. One
   rule for the signed-in portal (portal-app.html) and the sample-data preview, so the two never drift. */
@media (min-width: 1241px) {
  .app-page .dash { padding-left: max(24px, calc((100% - 1632px) / 2)); padding-right: max(24px, calc((100% - 1632px) / 2)); }
  .app-page .topbar, .app-page .app-footer { padding-left: max(24px, calc((100% - 1632px) / 2)); padding-right: max(24px, calc((100% - 1632px) / 2)); }
}

/* Audit 004: preview-only Approve/Reject must read as disabled, not as a live teal button. */
.row__actions .btn[disabled] { opacity: 0.4; filter: grayscale(0.7); }

/* Ultra-wide sign-in page (his 3440x1440, 2026-10-14): the art keeps its own 16:9 shape, centred, and
   fades into the page at both edges, instead of stretching EVA out to the far right of the screen. */
@media (min-width: 2200px) {
  .gate-bg > picture {
    left: 50%; right: auto; width: min(100%, calc(100vh * 16 / 9)); transform: translateX(-50%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 90%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 90%, transparent 100%);
  }
}
