/* Meeting OS configuration portal.
   Plain CSS, no build step. Tokens first so a theme swap is one block. */

:root {
  --ground: #faf8f9;
  --surface: #ffffff;
  --surface-2: #f4f1f4;
  --ink: #241f27;
  --ink-soft: #6c6473;
  --ink-faint: #958c9c;
  --line: #e4dfe6;
  --line-soft: #efebf0;
  --accent: #e21766;
  --accent-ink: #ffffff;
  --accent-soft: #fdecf2;
  --accent-line: #f4b9d0;
  --ok: #1f6f52;
  --ok-soft: #e6f2ec;
  --warn: #8a5d00;
  --warn-soft: #fbf1dd;
  --bad: #a81f19;
  --bad-soft: #fbeceb;
  --bar: #b4266b;
  --radius: 6px;
  --sans: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #17141a; --surface: #1f1b23; --surface-2: #272230;
    --ink: #f2eef4; --ink-soft: #b0a6b8; --ink-faint: #877d90;
    --line: #342d3c; --line-soft: #2b2532;
    --accent: #ff4d8d; --accent-ink: #21101a; --accent-soft: #3a1c2b; --accent-line: #6d2a46;
    --ok: #62c79b; --ok-soft: #17322a; --warn: #d8a648; --warn-soft: #332a17;
    --bad: #f0857e; --bad-soft: #3a1f1e; --bar: #e0538e;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* --- sign in --------------------------------------------------------- */
#signin { min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 32px 16px; gap: 26px; }
.brandmark { display: flex; align-items: center; gap: 11px; }
.brandmark .glyph { width: 28px; height: 28px; border: 2px solid var(--ink); border-radius: 5px;
  display: grid; place-items: center; }
.brandmark .glyph i { display: block; width: 10px; height: 10px; background: var(--accent); border-radius: 2px; }
.brandmark b { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.signin-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px; }
.sso { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--ink); border-radius: var(--radius);
  padding: 12px; font-weight: 500; }
.sso:hover { background: var(--surface-2); }
.ms-tile { display: grid; grid-template-columns: repeat(2, 7px); gap: 2px; }
.ms-tile i { width: 7px; height: 7px; background: var(--ink-soft); }
.ms-tile i:first-child, .ms-tile i:last-child { background: var(--ink); }

/* --- shell ----------------------------------------------------------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 20px; height: 58px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; }
.tenant { font-size: 12px; color: var(--ink-soft); border: 1px solid var(--line);
  border-radius: 20px; padding: 3px 11px; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.who { font-size: 12px; color: var(--ink-soft); }

.btn { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius);
  padding: 8px 15px; font-weight: 500; font-size: 13px; }
.btn:hover { background: var(--surface-2); }
.btn.dark { border-color: var(--ink); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(0.94); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn[disabled]:hover { background: var(--surface); }

.body { display: flex; align-items: flex-start; }
.rail { width: 190px; flex-shrink: 0; padding: 18px 0; border-right: 1px solid var(--line);
  background: var(--surface); align-self: stretch; min-height: calc(100vh - 58px); }
.rail button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: 0; border-left: 3px solid transparent; padding: 10px 18px;
  color: var(--ink-soft); font-size: 13px; font-weight: 500; }
.rail button:hover { color: var(--ink); }
.rail button[aria-current="true"] { color: var(--ink); border-left-color: var(--accent); background: var(--accent-soft); }
.rail svg { flex-shrink: 0; }

main { flex-grow: 1; min-width: 0; padding-block: 26px 56px; padding-left: 28px; padding-right: 28px; }
.wrap { max-width: 980px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 23px; }
.page-head p { margin: 6px 0 0; color: var(--ink-soft); max-width: 62ch; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2 { font-size: 15px; }
.panel-head span { font-size: 12px; color: var(--ink-faint); }

.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.tile { display: flex; flex-direction: column; gap: 7px; text-align: left; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tile:hover { border-color: var(--ink-faint); }
.tile[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent); }
.tile .row { display: flex; align-items: center; gap: 9px; }
.dot-radio { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink-faint); flex-shrink: 0; }
.tile[aria-pressed="true"] .dot-radio { border-color: var(--accent); background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--accent-soft); }
.tile .name { font-weight: 500; font-size: 13px; }
.tile .sub { font-size: 11.5px; color: var(--ink-faint); line-height: 1.4; }
.tile[disabled] { opacity: 0.55; cursor: not-allowed; }

.fields { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-top: 18px; }
.field label { display: block; font-size: 12px; font-weight: 500; color: var(--ink-soft); margin-bottom: 5px; }
.field input, .field select { width: 100%; font-family: var(--mono); font-size: 12.5px;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); }
.field select { font-family: var(--sans); font-size: 13px; }
.field .hint { font-size: 11px; color: var(--ink-faint); margin-top: 5px; }

.footrow { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; margin-top: 18px; padding-top: 15px; border-top: 1px dashed var(--line); }
.statusline { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-soft); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); } .dot.idle { background: var(--ink-faint); }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500;
  padding: 3px 9px; border-radius: 20px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }

.notice { display: flex; gap: 13px; border: 1px solid var(--ink); border-left-width: 4px;
  border-radius: var(--radius); padding: 16px 18px; background: var(--surface); margin-bottom: 16px; }
.notice h3 { font-size: 13.5px; margin-bottom: 5px; }
.notice p { margin: 0; font-size: 13px; color: var(--ink-soft); max-width: 66ch; }

.banner { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; background: var(--ink); color: var(--ground);
  border-radius: var(--radius); padding: 13px 18px; margin-top: 18px; }
.banner p { margin: 0; font-size: 13px; }
.banner .btn { background: transparent; color: var(--ground); border-color: rgba(255,255,255,0.35); }
.banner .btn:hover { background: rgba(255,255,255,0.12); }
.banner .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.mono { font-family: var(--mono); font-size: 0.92em; background: var(--surface-2); padding: 1px 5px; border-radius: 3px; }

.walk { border: 1px solid var(--accent-line); background: var(--accent-soft);
  border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.walk-head { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; background: none; border: 0; padding: 15px 18px; text-align: left; }
.walk-title { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.walk-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-soft); flex-shrink: 0; }
.walk.shut .chev { transform: rotate(-90deg); }
.walk-body { padding: 0 18px 18px; }
.walk-body ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 9px; }
.walk-body li { font-size: 13px; line-height: 1.55; max-width: 72ch; }
.walk-body li::marker { color: var(--accent); font-weight: 600; }
.walk-need { margin: 15px 0 0; font-size: 13px; padding-top: 13px; border-top: 1px solid var(--accent-line); }
.walk-note { margin: 9px 0 0; font-size: 12.5px; color: var(--ink-soft); max-width: 72ch; }

.preview { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.preview-label { font-size: 11.5px; color: var(--ink-faint); padding: 9px 16px;
  background: var(--surface-2); border-bottom: 1px solid var(--line); }
.preview-body { padding: 16px 18px; }
.preview-body p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.55; max-width: 66ch; }
.preview-body p:last-child { margin-bottom: 0; }

.terms { display: flex; flex-direction: column; }
.term { display: grid; grid-template-columns: minmax(120px, 190px) 1fr 32px; gap: 12px;
  align-items: center; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.term:first-child { border-top: 0; }
.term-word { font-family: var(--mono); font-size: 12.5px; }
.term-note { font-size: 12px; color: var(--ink-faint); }
.term-x { padding: 5px 7px; line-height: 0; color: var(--ink-faint); }
.term-x:hover { color: var(--bad); border-color: var(--bad); }

.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px;
  text-align: center; color: var(--ink-soft); font-size: 13px; }
.empty strong { display: block; color: var(--ink); font-size: 14px; margin-bottom: 6px; }


/* Off screen until focused, then lands where a first Tab expects it. */
.skip { position: absolute; left: 14px; top: -60px; z-index: 70; background: var(--surface);
  color: var(--ink); border: 1px solid var(--ink); border-radius: var(--radius);
  padding: 9px 14px; font-size: 13px; font-weight: 500; text-decoration: none; }
.skip:focus { top: 12px; }

/* The view takes focus on navigation but is not itself interactive, so the
   default ring would look like something is selected. */
#view:focus { outline: none; }
#view:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--radius); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 60;
  background: var(--ink); color: var(--ground); padding: 11px 20px; border-radius: 20px;
  font-size: 13px; font-weight: 500; box-shadow: 0 6px 20px rgba(0,0,0,0.18); max-width: 90vw; }
.toast.bad { background: var(--bad); color: #fff; }

.loading { padding: 60px 20px; text-align: center; color: var(--ink-faint); font-size: 13px; }

/* A request that failed, as opposed to .empty which is a screen with nothing
   on it yet. Amber rather than red on purpose: our status endpoint not
   answering is our problem, not something the customer has done wrong, and a
   red alarm for a transient fetch trains people to ignore red.
   Solid border rather than .empty's dashes, because dashes read as a
   placeholder and this is a real thing that happened. */
.failure { background: var(--surface); border: 1px solid var(--warn-line, var(--warn));
  border-radius: var(--radius); padding: 22px 24px; }
.failure-line { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; }
/* Scoped rather than added to .btn: every other button in the portal is text
   only, and giving them all flex would shift padding subtly everywhere. */
.failure-line .btn, .failure-details .btn { display: inline-flex; align-items: center; gap: 8px; }
.failure-text { display: flex; gap: 11px; align-items: flex-start; max-width: 66ch; }
.failure-text .dot { margin-top: 6px; }
.failure-text strong { display: block; font-size: 14px; color: var(--ink); margin-bottom: 3px; }
.failure-text span { font-size: 13px; color: var(--ink-soft); }

.failure hr { border: 0; border-top: 1px dashed var(--line); margin: 18px 0 4px; }
.dtoggle { display: inline-flex; align-items: center; gap: 7px; background: none; border: 0;
  padding: 8px 0; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--ink); cursor: pointer; }
.dtoggle svg { transition: transform 0.18s; }
.dtoggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.failure-details { margin-top: 4px; padding: 15px 17px; background: var(--surface-2); border-radius: var(--radius); }
.failure-details dl { margin: 0 0 13px; display: grid; grid-template-columns: 92px minmax(0, 1fr);
  gap: 6px 14px; font-size: 12.5px; }
.failure-details dt { color: var(--ink-soft); }
.failure-details dd { margin: 0; }
.failure-details .code { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }

.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spin { animation: none; }
  .dtoggle svg { transition: none; }
}

@media (max-width: 760px) {
  .body { flex-direction: column; }
  .rail { width: 100%; display: flex; overflow-x: auto; padding: 0; border-right: 0;
    border-bottom: 1px solid var(--line); align-self: auto; min-height: 0; }
  .rail button { width: auto; white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; }
  .rail button[aria-current="true"] { border-left-color: transparent; border-bottom-color: var(--accent); }
  main { padding-left: 16px; padding-right: 16px; }
  .term { grid-template-columns: 1fr 32px; }
  .term-note { grid-column: 1 / -1; }
}
