:root {
  color-scheme: light;
  --bg: #f6f8fc;
  --surface: #fff;
  --subtle: #f3f5f9;
  --text: #17243b;
  --muted: #546176;
  --border: #c5cedd;
  --accent: #7130df;
  --hover: #6022c6;
  --selected: #ede9fe;
  --field: #fbfcfe;
  --field-border: #7c889b;
  --danger: #b42318;
  --success: #12644b;
  --success-bg: #e4f6ee;
  --hero: #10213e;
  --hero-end: #293f6c;
  --white: #fff;
  --focus: #7130df;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0a16;
  --surface: #171321;
  --subtle: #211b2e;
  --text: #f4f1ff;
  --muted: #b6b0c6;
  --border: #574b6a;
  --accent: #baa0ff;
  --hover: #d5c4ff;
  --selected: #2c2044;
  --field: #110e19;
  --field-border: #81748f;
  --danger: #ff9b96;
  --success: #8be2bc;
  --success-bg: #17362b;
  --hero: #1a102d;
  --hero-end: #35205b;
  --focus: #baa0ff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0a16;
    --surface: #171321;
    --subtle: #211b2e;
    --text: #f4f1ff;
    --muted: #b6b0c6;
    --border: #574b6a;
    --accent: #baa0ff;
    --hover: #d5c4ff;
    --selected: #2c2044;
    --field: #110e19;
    --field-border: #81748f;
    --danger: #ff9b96;
    --success: #8be2bc;
    --success-bg: #17362b;
    --hero: #1a102d;
    --hero-end: #35205b;
    --focus: #baa0ff;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    16px/1.6 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--accent);
  color: var(--surface);
  padding: 9px 17px;
  font-weight: 650;
  cursor: pointer;
  gap: 8px;
  text-decoration: none;
}
button:hover,
.button:hover {
  background: var(--hover);
}
button.secondary,
.button.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
button.secondary:hover,
.button.secondary:hover {
  background: var(--subtle);
}
button.danger {
  background: var(--surface);
  border-color: var(--danger);
  color: var(--danger);
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}
header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px max(24px, calc((100vw - 1280px) / 2));
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-wrap: wrap;
}
.wordmark {
  color: var(--text);
  font-size: 27px;
  letter-spacing: -1.2px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark span {
  color: var(--accent);
}
nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
nav a {
  display: inline-block;
  color: var(--muted);
  padding: 7px 10px;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
}
nav a[aria-current="page"] {
  background: var(--selected);
  border-color: var(--border);
  color: var(--accent);
}
#identity {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}
#identity small {
  display: block;
  color: var(--muted);
}
.icon-button {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  width: 44px;
  padding: 6px;
  font-size: 22px;
}
.context {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.context select {
  max-width: 300px;
}
#workspace-context {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.context label {
  font-size: 14px;
  margin: 0;
  color: var(--muted);
}
main {
  max-width: 1232px;
  margin: auto;
  padding: 24px 24px 72px;
  min-height: 65vh;
}
h1 {
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -1.1px;
  margin: 4px 0 12px;
}
h2 {
  font-size: 23px;
  line-height: 1.3;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 18px;
  margin: 0 0 8px;
}
p {
  margin: 0 0 16px;
}
.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 750;
  color: var(--muted);
  margin: 0 0 8px;
}
.muted,
small {
  color: var(--muted);
}
.page-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.page-title p {
  color: var(--muted);
  max-width: 740px;
}
.hero {
  padding: 36px 40px;
  background: linear-gradient(115deg, var(--hero), var(--hero-end));
  color: var(--white);
  border-radius: 24px;
  margin-bottom: 28px;
}
.hero .eyebrow {
  color: #8ce3c6;
}
.hero h1 {
  max-width: 700px;
  font-size: 40px;
}
.hero p {
  max-width: 680px;
  color: #e1e7f3;
}
.hero a {
  color: var(--white);
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.card,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}
.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.card p {
  color: var(--muted);
}
.card .actions {
  margin-top: auto;
}
.metric {
  font-size: 40px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -1.5px;
}
.section {
  margin-top: 32px;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.badge {
  display: inline-block;
  background: var(--subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 650;
  white-space: normal;
}
.badge.good {
  color: var(--success);
  background: var(--success-bg);
}
.empty {
  padding: 40px 24px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  text-align: center;
  background: var(--surface);
}
.empty p {
  color: var(--muted);
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 14px;
}
caption {
  text-align: left;
  padding: 18px;
  font-size: 18px;
  font-weight: 650;
}
th {
  color: var(--muted);
  font-weight: 650;
  background: var(--subtle);
}
td,
th {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tbody tr:last-child td {
  border-bottom: none;
}
td .actions button {
  font-size: 13px;
  padding: 6px 11px;
  min-height: 36px;
}
td p {
  margin: 0;
}
.stack {
  display: grid;
  gap: 20px;
}
.detail-top {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.requirement {
  padding: 20px 0;
  border-top: 1px solid var(--border);
}
.requirement:first-child {
  border-top: 0;
}
.requirement li {
  margin-bottom: 10px;
}
.hint {
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
  background: var(--selected);
  border-radius: 0 10px 10px 0;
  margin: 20px 0;
}
.danger-text,
#dialog-error {
  color: var(--danger);
}
.preserve {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.help {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 42px;
  border-top: 1px solid var(--border);
  padding-top: 28px;
}
.help nav {
  display: flex;
  flex-direction: column;
  align-self: start;
}
.help article {
  max-width: 800px;
}
.help article li {
  margin-bottom: 16px;
}
.help article h2 {
  font-size: 32px;
}
label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin: 16px 0 6px;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  background: var(--field);
  color: var(--text);
  padding: 11px 12px;
  min-height: 44px;
}
textarea {
  min-height: 100px;
  resize: vertical;
}
input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
}
.check input {
  margin-top: 3px;
}
fieldset {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin: 20px 0;
}
legend {
  font-weight: 650;
  padding: 0 6px;
}
.requirement-editor {
  border-top: 1px solid var(--border);
  margin: 20px 0;
  padding-top: 8px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 16px;
}
dialog {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: min(720px, calc(100vw - 32px));
  padding: 28px;
  max-height: 90vh;
}
dialog::backdrop {
  background: #080b1980;
}
.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.dialog-header h2 {
  margin: 0;
}
.dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 24px;
}
#dialog-error {
  margin-top: 16px;
}
#notice:not(:empty) {
  max-width: 1184px;
  margin: 8px auto;
  padding: 14px 20px;
  background: var(--success-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--success);
}
#notice.error {
  color: var(--danger);
  background: var(--surface);
}
footer {
  padding: 24px;
  max-width: 1232px;
  margin: auto;
  border-top: 1px solid var(--border);
  font-size: 14px;
  font-weight: 650;
}
footer span {
  float: right;
  color: var(--muted);
  font-weight: 400;
}
.skip {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--surface);
  padding: 12px;
  z-index: 10;
}
.skip:focus {
  top: 12px;
}
.login {
  max-width: 720px;
  margin: 40px auto;
}
.login .hero {
  padding: 48px;
}
.login .button {
  background: var(--white);
  color: #10213e;
}
code {
  background: var(--subtle);
  border-radius: 6px;
  padding: 3px 6px;
  overflow-wrap: anywhere;
  font-size: 13px;
}
details summary {
  cursor: pointer;
  min-height: 32px;
}
details {
  margin: 12px 0;
}
hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}
@media (max-width: 1100px) {
  header {
    gap: 12px;
  }
  nav {
    order: 3;
    width: 100%;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #identity {
    margin-left: auto;
  }
}
@media (max-width: 650px) {
  header {
    padding: 14px 16px;
  }
  .context {
    padding: 14px 16px;
    align-items: flex-start;
    flex-direction: column;
  }
  main {
    padding: 16px 16px 48px;
  }
  .grid,
  .grid.two,
  .help,
  .field-row {
    grid-template-columns: 1fr;
  }
  .hero {
    padding: 28px 24px;
  }
  .hero h1 {
    font-size: 32px;
  }
  .page-title {
    flex-direction: column;
    gap: 8px;
  }
  h1 {
    font-size: 29px;
  }
  .help {
    gap: 24px;
  }
  .help nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .help article h2 {
    font-size: 27px;
  }
  footer span {
    float: none;
    display: block;
    margin-top: 8px;
  }
  #identity {
    gap: 6px;
    flex-wrap: wrap;
  }
  dialog {
    padding: 20px;
  }
  nav a {
    padding: 8px;
    font-size: 13px;
  }
  .context select {
    max-width: 100%;
  }
  #workspace-context {
    width: 100%;
  }
  #identity small {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
@media (forced-colors: active) {
  button,
  .badge,
  nav a[aria-current="page"] {
    border: 1px solid ButtonText;
  }
}
/* Keep identity utilities together while navigation wraps within its own area. */
header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}
header > nav {
  min-width: 0;
}
#identity {
  margin-left: 0;
}
.context select {
  width: auto;
  min-width: 220px;
}
.context > div {
  flex: 1;
}
.context .badge {
  flex-shrink: 0;
}
@media (max-width: 1100px) {
  header {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  header > nav {
    grid-column: 1/-1;
    grid-row: 2;
    width: 100%;
  }
  #identity {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  #settings {
    grid-column: 3;
    grid-row: 1;
  }
}
@media (max-width: 650px) {
  header {
    grid-template-columns: 1fr auto;
  }
  #identity {
    grid-column: 1/-1;
    grid-row: 2;
    justify-self: start;
  }
  #settings {
    grid-column: 2;
    grid-row: 1;
  }
  header > nav {
    grid-row: 3;
  }
  .context select {
    min-width: 0;
    width: 100%;
  }
  .context .badge {
    flex-shrink: 1;
  }
  #workspace-context {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  #workspace-context label,
  #workspace-context select {
    grid-column: 1/-1;
  }
}
