@import url('./assets/ibm-plex.css');

:root {
  --ivory: #f3f5f7;
  --paper: #ffffff;
  --ink: #16324f;
  --ink-soft: #344b60;
  --slate: #647587;
  --line: #d8e2ea;
  --line-strong: #a9b9c7;
  --copper: #16324f;
  --copper-deep: #0b233b;
  --copper-pale: #d8e2ea;
  --green: #356551;
  --green-pale: #dcebe2;
  --red: #983f37;
  --red-pale: #f5dfdc;
  --sidebar: #102940;
  --sidebar-muted: #a9bdce;
  --sidebar-line: rgba(216, 226, 234, .17);
  --shadow: 0 18px 45px rgba(16, 41, 64, .10);
  --display: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--ivory); }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); background: var(--ivory); font-family: var(--sans); font-size: 15px; line-height: 1.5; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: inherit; }
:focus-visible { outline: 3px solid #7299bc; outline-offset: 3px; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; transform: translateY(-180%); padding: 8px 12px; border-radius: 3px; background: var(--paper); color: var(--ink); font-weight: 700; }
.skip-link:focus { transform: translateY(0); }

.startup, .login-shell, .invite-shell { display: grid; min-height: 100vh; place-content: center; padding: 32px; }
.startup > *, .login-panel > *, .invite-panel > * { max-width: 620px; }
.eyebrow { margin: 0 0 8px; color: var(--copper-deep); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); font-family: var(--display); font-weight: 600; line-height: 1.15; }
h1 { margin-bottom: 14px; font-size: clamp(33px, 4vw, 52px); letter-spacing: -.03em; }
h2 { margin-bottom: 9px; font-size: clamp(27px, 3vw, 38px); letter-spacing: -.025em; }
h3 { margin-bottom: 5px; font-size: 22px; }
.muted { color: var(--slate); }
.small { font-size: 13px; }

.login-panel, .invite-panel { width: min(100%, 500px); padding: 38px; border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); }
.login-panel .brand-lockup, .invite-panel .brand-lockup { margin-bottom: 42px; }
.brand-lockup strong { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.brand-lockup span { color: var(--slate); font-family: var(--display); font-size: 22px; }
.security-note { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--slate); font-size: 13px; }

.portal { display: grid; grid-template-columns: 258px minmax(0, 1fr); min-height: 100vh; }
.sidebar { display: flex; position: sticky; top: 0; height: 100vh; flex-direction: column; padding: 30px 18px 20px; color: #f8f3e9; background: var(--sidebar); }
.wordmark { padding: 4px 10px 31px; border-bottom: 1px solid var(--sidebar-line); }
.wordmark strong { display: block; color: #fffaf0; font-size: 12px; letter-spacing: .115em; line-height: 1.35; text-transform: uppercase; }
.wordmark span { display: block; margin-top: 4px; color: var(--sidebar-muted); font-family: var(--display); font-size: 19px; }
.nav-list { display: grid; gap: 3px; margin: 24px 0; padding: 0; list-style: none; }
.nav-link { display: flex; align-items: center; min-height: 43px; padding: 9px 10px; border-left: 2px solid transparent; color: #d8e0dd; text-decoration: none; font-size: 14px; font-weight: 650; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.is-active { border-left-color: #8fb1cc; background: rgba(255,255,255,.10); color: #fff; }
.sidebar-bottom { margin-top: auto; padding: 18px 10px 2px; border-top: 1px solid var(--sidebar-line); }
.write-status { display: flex; gap: 8px; align-items: center; color: #d8e0dd; font-size: 12px; font-weight: 700; }
.write-status::before { width: 8px; height: 8px; border-radius: 50%; background: #8fb1cc; content: ""; }
.sidebar-bottom p { margin: 7px 0 0; color: var(--sidebar-muted); font-size: 12px; }

.page-wrap { min-width: 0; }
.demo-banner { display: flex; gap: 12px; align-items: baseline; padding: 10px max(24px, 4vw); border-bottom: 1px solid #b7cada; color: var(--ink); background: var(--copper-pale); font-size: 13px; }
.demo-banner strong { white-space: nowrap; }
.topbar { display: flex; min-height: 78px; align-items: center; justify-content: space-between; gap: 24px; padding: 18px max(28px, 4.7vw); border-bottom: 1px solid var(--line); }
.breadcrumb { color: var(--slate); font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 16px; }
.viewer { text-align: right; }
.viewer strong { display: block; font-size: 14px; }
.viewer span { display: block; color: var(--slate); font-size: 12px; }
.content { max-width: 1450px; margin: 0 auto; padding: 43px max(28px, 4.7vw) 70px; }
.section-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.section-header p { max-width: 640px; margin: 0; color: var(--slate); }
.section-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }

.button { min-height: 39px; padding: 8px 13px; border: 1px solid var(--ink); border-radius: 2px; color: #fffdf8; background: var(--ink); font-size: 13px; font-weight: 750; letter-spacing: .01em; }
.button:hover:not(:disabled) { background: #304146; }
.button.copper { border-color: var(--copper-deep); background: var(--copper); }
.button.copper:hover:not(:disabled) { background: var(--copper-deep); }
.button.quiet { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.button.quiet:hover:not(:disabled) { border-color: var(--ink); background: #eef3f7; }
.button.danger { border-color: var(--red); color: var(--red); background: transparent; }
.button.link-button { min-height: auto; padding: 0; border: 0; color: var(--copper-deep); background: transparent; text-decoration: underline; text-underline-offset: 3px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 31px; border: 1px solid var(--line); background: var(--paper); }
.stat { min-height: 118px; padding: 20px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat-label { display: block; color: var(--slate); font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.stat-value { display: block; margin-top: 14px; font-family: var(--display); font-size: 39px; line-height: 1; }
.stat-note { display: block; margin-top: 9px; color: var(--slate); font-size: 12px; }

.panel { margin-bottom: 22px; border: 1px solid var(--line); background: var(--paper); }
.panel-head { display: flex; min-height: 70px; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 21px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; }
.panel-head p { margin: 3px 0 0; color: var(--slate); font-size: 13px; }
.panel-body { padding: 21px; }
.two-up { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .85fr); gap: 22px; align-items: start; }

.table-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 21px; border-bottom: 1px solid var(--line); }
.field { display: grid; gap: 6px; margin-bottom: 17px; }
.field > label, .field-label { color: var(--ink-soft); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.input, .select { width: 100%; min-height: 42px; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 2px; color: var(--ink); background: #ffffff; }
.input:focus, .select:focus { border-color: var(--copper); outline: 2px solid rgba(22,50,79,.18); outline-offset: 0; }
.table-tools .input { min-width: min(100%, 260px); max-width: 360px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-spacing: 0; border-collapse: collapse; text-align: left; }
th { padding: 12px 21px; border-bottom: 1px solid var(--line); color: var(--slate); font-size: 11px; font-weight: 800; letter-spacing: .075em; text-transform: uppercase; white-space: nowrap; }
td { padding: 12px 21px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f3f7fa; }
.cell-title { display: block; color: var(--ink); font-weight: 750; }
.cell-sub { display: block; margin-top: 3px; color: var(--slate); font-size: 12px; }
.actions-cell { text-align: right; white-space: nowrap; }
.empty { padding: 38px 21px; color: var(--slate); text-align: center; }

.badge-row { display: flex; flex-wrap: wrap; gap: 5px; }
.badge { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 7px; border: 1px solid #c5d2de; border-radius: 999px; color: #344b60; background: #eef3f7; font-size: 11px; font-weight: 700; line-height: 1.25; }
.badge.green { border-color: #b8d5c4; color: #24523e; background: var(--green-pale); }
.badge.red { border-color: #e7bbb5; color: #86372f; background: var(--red-pale); }
.badge.copper { border-color: #afc3d5; color: var(--ink); background: var(--copper-pale); }

.notice { margin-bottom: 16px; padding: 15px 17px; border-left: 3px solid var(--copper); color: #344b60; background: #edf3f8; font-size: 13px; }
.notice strong { color: var(--ink); }
.resource-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.resource-list li { padding: 13px 0; border-bottom: 1px solid var(--line); }
.resource-list li:last-child { border-bottom: 0; }
.resource-label { display: block; margin-bottom: 7px; font-weight: 750; }
.definition { display: grid; grid-template-columns: minmax(110px, .6fr) minmax(0, 1.4fr); gap: 11px 18px; margin: 0; font-size: 14px; }
.definition dt { color: var(--slate); }
.definition dd { margin: 0; }
.code-block { overflow-x: auto; margin: 14px 0 0; padding: 16px; color: #ebeee8; background: #1d2c2e; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.65; white-space: pre; }
.api-path { padding: 2px 5px; color: var(--ink); background: var(--copper-pale); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

.check-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.check { display: flex; gap: 9px; align-items: start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--copper-deep); }
.check span { font-size: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 15px; }
.form-span { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; margin-top: 26px; }
.form-error { min-height: 20px; margin: 8px 0 0; color: var(--red); font-size: 13px; }

.modal-backdrop { display: grid; position: fixed; z-index: 50; inset: 0; place-items: center; padding: 22px; background: rgba(18, 29, 31, .54); }
.modal { width: min(100%, 620px); max-height: min(820px, calc(100vh - 44px)); overflow: auto; border: 1px solid var(--line-strong); background: var(--paper); box-shadow: 0 28px 75px rgba(0,0,0,.27); }
.modal-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding: 25px 26px 19px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 30px; }
.modal-head p { margin: 6px 0 0; color: var(--slate); font-size: 13px; }
.close-button { width: 34px; height: 34px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--ink); background: transparent; font-size: 23px; line-height: 1; }
.modal-body { padding: 24px 26px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 17px 26px; border-top: 1px solid var(--line); background: #f3f7fa; }
.token-box { display: flex; gap: 8px; align-items: stretch; margin-top: 14px; }
.token-box .input { min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.share-text { resize: vertical; margin: 15px 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.share-text + .button { margin-bottom: 12px; }
.token-warning { margin: 15px 0 0; color: var(--red); font-size: 13px; font-weight: 700; }

.toast-region { position: fixed; z-index: 80; right: 20px; bottom: 20px; display: grid; width: min(390px, calc(100vw - 40px)); gap: 9px; }
.toast { padding: 13px 15px; border: 1px solid var(--line-strong); color: var(--ink); background: var(--paper); box-shadow: 0 10px 26px rgba(0,0,0,.14); font-size: 13px; }
.toast.error { border-color: #cd827a; color: #762f29; }
.toast.success { border-color: #9fc2a9; color: #204b37; }
.loading { padding: 35px 0; color: var(--slate); }

@media (max-width: 980px) {
  .portal { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; min-width: 0; height: auto; padding: 18px 20px 12px; }
  .wordmark { display: flex; align-items: baseline; justify-content: space-between; padding: 0 0 13px; }
  .wordmark strong, .wordmark span { display: inline; }
  .wordmark span { margin: 0 0 0 7px; }
  .nav-list { display: flex; overflow-x: auto; margin: 13px 0 5px; }
  .nav-list li { flex-shrink: 0; }
  .nav-link { flex: 0 0 auto; border-bottom: 2px solid transparent; border-left: 0; }
  .nav-link.is-active { border-bottom-color: #8fb1cc; border-left-color: transparent; }
  .sidebar-bottom { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .two-up { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .topbar { align-items: start; padding: 15px 20px; }
  .top-actions { gap: 10px; }
  .viewer { display: none; }
  .content { padding: 30px 20px 50px; }
  .section-header { display: block; }
  .section-actions { margin-top: 17px; }
  .stat-grid { grid-template-columns: 1fr; }
  .stat, .stat:nth-child(2) { min-height: 100px; border-right: 0; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: 0; }
  .panel-head, .table-tools { padding-right: 15px; padding-left: 15px; }
  th, td { padding-right: 15px; padding-left: 15px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-span { grid-column: auto; }
  .modal-backdrop { padding: 10px; }
  .modal-head, .modal-body { padding-right: 18px; padding-left: 18px; }
  .modal-foot { padding-right: 18px; padding-left: 18px; }
  .demo-banner { display: block; padding: 9px 20px; }
  .demo-banner strong { display: block; margin-bottom: 3px; }
}
