/*
  Septima Internal — the one look of every page on internal.septima.ai.

  Quiet and compact: one sans typeface (monospace only for codes), cool
  neutral greys, hairline borders, one indigo accent. The theme is an
  attribute: a boot script in each page's head stamps `data-theme="light"`
  or `"dark"` on <html> from the stored choice (`septima.theme`: light, dark
  or system), so no rule reads prefers-color-scheme and the choice holds on
  every page, the Review page included.

  The Review page (web/) is its own Svelte app. Its tokens in web/src/app.css
  and its bar in web/src/components/GlobalNav.svelte carry the same values;
  change both together.
*/

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #0f1012;
  --surface: #151619;
  --surface-2: #1c1d21;
  --hover: #202126;
  --line: #24252a;
  --line-strong: #34363c;
  --ink: #e5e6e9;
  --ink-dim: #9b9da4;
  --ink-faint: #64666e;
  --accent: #7c85e8;
  --accent-strong: #5e6ad2;
  --accent-soft: rgba(124, 133, 232, 0.14);
  --accent-ink: #ffffff;
  --ok: #4cb782;
  --ok-soft: rgba(76, 183, 130, 0.14);
  --warn: #f2a65a;
  --warn-soft: rgba(242, 166, 90, 0.14);
  --alarm: #eb6a5c;
  --alarm-soft: rgba(235, 106, 92, 0.14);
  --info: #6ba6e8;
  --info-soft: rgba(107, 166, 232, 0.14);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--line);

  --radius: 6px;
  --radius-lg: 10px;
  --bar: 40px;

  color-scheme: dark;
}

:root[data-theme='light'] {
  --bg: #fbfbfc;
  --surface: #ffffff;
  --surface-2: #f4f4f6;
  --hover: #f0f0f3;
  --line: #e8e8ec;
  --line-strong: #d6d6dc;
  --ink: #1d1e22;
  --ink-dim: #686a72;
  --ink-faint: #9a9ca3;
  --accent: #5e6ad2;
  --accent-strong: #4f5bc4;
  --accent-soft: rgba(94, 106, 210, 0.1);
  --ok: #2e9e67;
  --ok-soft: rgba(46, 158, 103, 0.1);
  --warn: #c7781f;
  --warn-soft: rgba(199, 120, 31, 0.1);
  --alarm: #d1453b;
  --alarm-soft: rgba(209, 69, 59, 0.1);
  --info: #3b7fcf;
  --info-soft: rgba(59, 127, 207, 0.1);
  --shadow: 0 8px 30px rgba(20, 20, 30, 0.1), 0 0 0 1px var(--line);

  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.5 var(--font);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}
a { color: inherit; }
code, .mono { font-family: var(--mono); font-size: 12px; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 4px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* ---------------------------------------------------------------- the bar */

.gnav {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--bar);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.gnav .brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 8px 0 4px;
  margin-right: 6px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
  text-decoration: none;
  border-radius: var(--radius);
}
.gnav .logo {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.gnav .links { display: flex; align-items: center; gap: 2px; min-width: 0; }
.gnav .link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius);
  color: var(--ink-dim);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
.gnav .link svg { width: 14px; height: 14px; opacity: 0.8; flex: none; }
.gnav .link:hover { background: var(--hover); color: var(--ink); }
.gnav .link[aria-current='page'] { background: var(--surface-2); color: var(--ink); }
.gnav .gap { flex: 1; }
.gnav .who { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-dim); min-width: 0; }
.gnav .who .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: var(--accent-strong);
  object-fit: cover;
}
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--ink-dim);
  cursor: pointer;
}
.icon-button:hover { background: var(--hover); color: var(--ink); }
.icon-button svg { width: 15px; height: 15px; }
.gnav form { margin: 0; display: inline-flex; }
@media (max-width: 640px) {
  .gnav .link span, .gnav .who .name, .gnav .brand .word { display: none; }
  .gnav .link { padding: 0 8px; }
}

/* ---------------------------------------------------------------- page */

.page { max-width: 1120px; margin: 0 auto; padding: 28px 24px 64px; }
.page.wide { max-width: 1360px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.page-head p { margin: 4px 0 0; color: var(--ink-dim); max-width: 760px; }
.section-title { font-size: 12px; font-weight: 500; color: var(--ink-faint); margin: 0 0 8px; }
@media (max-width: 640px) { .page { padding: 20px 16px 56px; } }

/* ---------------------------------------------------------------- controls */

.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: 500 13px var(--font);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.button:hover { background: var(--hover); }
.button.primary { background: var(--accent-strong); border-color: transparent; color: var(--accent-ink); }
.button.primary:hover { background: var(--accent); }
.button.ghost { border-color: transparent; background: none; color: var(--ink-dim); }
.button.ghost:hover { background: var(--hover); color: var(--ink); }

.field, input[type='search'], select {
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: 13px var(--font);
}
input[type='search']:focus, select:focus, .field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type='checkbox'] { accent-color: var(--accent-strong); }

.segmented { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--radius); background: var(--surface-2); }
.segmented button {
  height: 22px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--ink-faint);
  font: 500 12px var(--font);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.segmented button svg { width: 13px; height: 13px; }
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed='true'] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--line); }

.chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  margin: 0 4px 4px 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 12px;
  white-space: nowrap;
}
.chip.warn { background: var(--alarm-soft); border-color: transparent; color: var(--alarm); }
.chip.muted { color: var(--ink-faint); }
.muted { color: var(--ink-dim); }

/* ---------------------------------------------------------------- surfaces */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  text-decoration: none;
}
.list-row:first-child { border-top: 0; }
a.list-row:hover { background: var(--hover); }
.list-row .icon {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.list-row .icon svg { width: 16px; height: 16px; }
.list-row .text { flex: 1; min-width: 0; }
.list-row .title { font-weight: 500; }
.list-row .sub { color: var(--ink-dim); font-size: 12.5px; }
.list-row .chev { color: var(--ink-faint); width: 14px; height: 14px; flex: none; }

/* A page with no bar: sign-in refused, signed out. */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.center .card { width: min(380px, 100%); padding: 28px; text-align: center; }
.center .logo { display: block; width: 44px; height: auto; margin: 0 auto 16px; color: var(--ink); }
.center h1 { font-size: 16px; margin: 0 0 6px; font-weight: 600; }
.center p { margin: 0 0 18px; color: var(--ink-dim); }
.center .choices { display: grid; gap: 8px; }
.center .choices { gap: 6px; text-align: left; }
.center .choices .who { margin: 8px 0 0; font-size: 12px; color: var(--ink-dim); }
.center .choices .who:first-child { margin-top: 0; }

/* The sign-in buttons of Google and Microsoft, as their brand rules give them.
   Google: https://developers.google.com/identity/branding-guidelines
   Microsoft: https://learn.microsoft.com/entra/identity-platform/howto-add-branding-in-apps */
.sso { display: flex; align-items: center; width: 100%; box-sizing: border-box; text-decoration: none; white-space: nowrap; cursor: pointer; }
.sso .sso-logo { flex: none; }
.sso span { flex: 1; text-align: center; }
.sso-google {
  height: 40px; padding: 0 12px; border-radius: 4px;
  font: 500 14px/20px 'Google Sans', Roboto, Arial, sans-serif; letter-spacing: 0.25px;
  background: #131314; color: #e3e3e3; border: 1px solid #8e918f;
}
.sso-google .sso-logo { width: 20px; height: 20px; margin-right: 10px; }
.sso-microsoft {
  height: 41px; padding: 0 12px;
  font: 600 15px/20px 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif;
  background: #2f2f2f; color: #ffffff; border: 0;
}
.sso-microsoft .sso-logo { width: 19px; height: 19px; margin-right: 12px; }
:root[data-theme='light'] .sso-google { background: #ffffff; color: #1f1f1f; border-color: #747775; }
:root[data-theme='light'] .sso-microsoft { background: #ffffff; color: #5e5e5e; border: 1px solid #8c8c8c; }
.sso:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
