:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f4f6fa;
  --navy: #0c3153;
  --navy-deep: #082843;
  --ink: #172033;
  --muted: #667085;
  --line: #dfe4ec;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --blue: #2478c7;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
svg { display: block; width: 100%; height: 100%; fill: currentColor; }

/* Login */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: min(100%, 420px); background: #fff; border: 1px solid #dfe4ec; border-radius: 18px; padding: 36px; box-shadow: 0 18px 50px rgba(23,32,51,.10); }
.brand { font-size: 28px; font-weight: 800; letter-spacing: -.04em; }
.eyebrow { margin: 8px 0 28px; color: #667085; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
h1 { margin: 0; }
.intro { margin: 10px 0 26px; color: #667085; line-height: 1.5; }
label { display: block; margin: 18px 0 7px; font-size: 14px; font-weight: 700; }
input { width: 100%; border: 1px solid #cfd6e2; border-radius: 10px; padding: 12px 13px; font: inherit; background: #fff; }
input:focus { outline: 3px solid rgba(44,94,220,.15); border-color: #2c5edc; }
.login-card button { width: 100%; margin-top: 24px; border: 0; border-radius: 10px; padding: 13px 18px; font: inherit; font-weight: 800; color: #fff; background: #172033; cursor: pointer; }
.login-card button:hover { background: #27334b; }
.login-error { margin: 18px 0 4px; border-radius: 10px; padding: 11px 13px; background: #fff1f0; border: 1px solid #ffc9c4; color: #8b1e17; font-size: 14px; }

/* Authenticated portal shell */
.portal-body { background: #f2f5f9; color: var(--ink); }
.portal-topbar { position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; border-bottom: 1px solid rgba(255,255,255,.1); box-shadow: 0 4px 18px rgba(8,40,67,.15); }
.portal-topbar-inner { width: min(1180px, calc(100% - 40px)); min-height: 72px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.portal-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.portal-brand-mark { width: 32px; height: 32px; padding: 6px; display: grid; place-items: center; border-radius: 8px; background: #2684cf; color: #fff; }
.portal-brand-name { font-size: 21px; font-weight: 850; letter-spacing: -.035em; text-transform: uppercase; }
.portal-brand-divider { width: 1px; height: 24px; margin-left: 2px; background: rgba(255,255,255,.28); }
.portal-brand-product { color: #dce9f4; font-size: 14px; font-weight: 650; letter-spacing: .01em; }
.operator-area { display: flex; align-items: center; gap: 14px; min-width: 0; }
.operator-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.operator-icon { width: 34px; height: 34px; padding: 8px; border-radius: 50%; color: #d7e8f6; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); flex: 0 0 auto; }
.operator-copy { display: grid; line-height: 1.2; min-width: 0; }
.operator-copy strong { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.operator-copy span { margin-top: 3px; color: #b8cad9; font-size: 11px; }
.signout-form { margin: 0; }
.signout-form input { display: none; }
.signout-button { width: auto; margin: 0; padding: 8px 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; color: #eef6fc; background: rgba(255,255,255,.06); font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.signout-button:hover { background: rgba(255,255,255,.12); }
.signout-button:focus-visible, .tool-card-link:focus-visible, .portal-brand:focus-visible { outline: 3px solid rgba(126,200,255,.55); outline-offset: 3px; }

.dashboard-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 44px 0 56px; }
.dashboard-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 28px; margin-bottom: 34px; }
.dashboard-eyebrow, .section-kicker { margin: 0 0 8px; color: #2478c7; font-size: 12px; font-weight: 800; letter-spacing: .105em; text-transform: uppercase; }
.dashboard-hero h1 { font-size: clamp(30px, 4vw, 42px); line-height: 1.08; letter-spacing: -.035em; }
.dashboard-intro { max-width: 760px; margin: 14px 0 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.role-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 8px 11px; border: 1px solid #cfe0ef; border-radius: 999px; background: #fff; color: #36516b; font-size: 12px; font-weight: 750; box-shadow: 0 2px 7px rgba(15,49,83,.05); }
.role-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: #22a06b; box-shadow: 0 0 0 3px rgba(34,160,107,.12); }

.dashboard-section { margin-top: 30px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 15px; }
.section-heading h2 { margin: 0; color: #1d2b3d; font-size: 20px; letter-spacing: -.018em; }
.section-note { max-width: 470px; margin: 0; color: #7b8798; font-size: 12px; text-align: right; line-height: 1.5; }
.tool-grid { display: grid; gap: 14px; }
.tool-grid-primary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tool-grid-secondary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tool-card { min-width: 0; min-height: 180px; position: relative; display: flex; align-items: flex-start; gap: 15px; padding: 22px; border: 1px solid #dce3ec; border-radius: 14px; background: var(--surface); box-shadow: 0 3px 12px rgba(24,50,79,.045); }
.tool-card-link { text-decoration: none; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.tool-card-link:hover { transform: translateY(-2px); border-color: #bfd1e4; box-shadow: 0 10px 26px rgba(24,50,79,.095); }
.tool-icon { width: 42px; height: 42px; padding: 10px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; }
.tool-icon-blue { color: #176ab4; background: #eaf4fd; }
.tool-icon-violet { color: #6657c8; background: #f0edff; }
.tool-icon-emerald { color: #16845b; background: #e9f8f2; }
.tool-icon-amber { color: #a75d0a; background: #fff4e2; }
.tool-icon-slate { color: #53657a; background: #edf1f5; }
.tool-card-copy { min-width: 0; display: grid; align-content: start; }
.tool-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; color: #8491a1; font-size: 11px; font-weight: 650; }
.status-badge { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .02em; }
.status-available { background: #e8f8f1; color: #14754f; }
.status-planned { background: #eef2f7; color: #58697d; }
.status-unavailable { background: #fff0ee; color: #a33a32; }
.tool-card-copy strong { color: #17263a; font-size: 17px; line-height: 1.25; letter-spacing: -.012em; }
.tool-card-copy > span:last-child { margin-top: 8px; color: #68788c; font-size: 12.5px; line-height: 1.55; }
.tool-arrow { position: absolute; right: 20px; bottom: 18px; color: #3b82c4; font-size: 21px; line-height: 1; }
.tool-card-disabled, .tool-card-planned { background: #fbfcfe; box-shadow: none; }
.tool-card-disabled { border-style: dashed; }

.viewer-notice { display: flex; align-items: flex-start; gap: 14px; padding: 20px 22px; border: 1px solid #d7e2ed; border-radius: 14px; background: #fff; }
.viewer-notice-icon { width: 38px; height: 38px; padding: 9px; flex: 0 0 auto; border-radius: 10px; color: #526b84; background: #edf3f8; }
.viewer-notice strong { color: #23364b; font-size: 14px; }
.viewer-notice p { margin: 5px 0 0; color: #6e7d8e; font-size: 12.5px; line-height: 1.55; }

.authority-note { display: flex; align-items: flex-start; gap: 13px; margin-top: 34px; padding: 17px 19px; border: 1px solid #cfe0ef; border-radius: 12px; background: #eef6fc; }
.authority-note-icon { width: 32px; height: 32px; padding: 7px; flex: 0 0 auto; border-radius: 9px; color: #236ca7; background: #dceefd; }
.authority-note strong { color: #214869; font-size: 12.5px; }
.authority-note p { margin: 4px 0 0; color: #53718b; font-size: 11.5px; line-height: 1.55; }

@media (max-width: 900px) {
  .tool-grid-secondary { grid-template-columns: 1fr 1fr; }
  .section-note { display: none; }
}

@media (max-width: 720px) {
  .portal-topbar-inner { width: min(100% - 28px, 1180px); min-height: 66px; }
  .portal-brand-product, .portal-brand-divider, .operator-copy span { display: none; }
  .operator-copy strong { max-width: 120px; }
  .dashboard-shell { width: min(100% - 28px, 1180px); padding-top: 32px; }
  .dashboard-hero { display: block; }
  .role-chip { margin-top: 18px; }
  .tool-grid-primary, .tool-grid-secondary { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .login-card { padding: 28px 22px; border-radius: 14px; }
  .portal-brand-name { font-size: 18px; }
  .operator-icon { display: none; }
  .signout-button { padding: 7px 9px; }
  .dashboard-shell { width: min(100% - 22px, 1180px); }
  .tool-card { min-height: 0; padding: 18px; }
  .tool-icon { width: 38px; height: 38px; padding: 9px; }
  .tool-arrow { right: 16px; bottom: 14px; }
  .authority-note { padding: 15px; }
}
