:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #182230;
  background: #f5f7fa;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --muted: #667085;
  --border: #e4e7ec;
  --blue: #175cd3;
  --blue-dark: #1849a9;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input { font: inherit; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 clamp(20px, 5vw, 72px);
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.wordmark { display: inline-flex; align-items: center; gap: 10px; color: #182230; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #175cd3; color: #fff; font-size: 14px; font-weight: 800; letter-spacing: .04em; }
.brand-mark-small { width: 32px; height: 32px; border-radius: 9px; font-size: 11px; }

.page-shell { width: min(100% - 40px, 1040px); margin: 48px auto 72px; }
.page-shell-narrow { width: min(100% - 40px, 760px); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading h1, h1 { margin: 0; font-size: clamp(28px, 4vw, 36px); letter-spacing: -.035em; }
.page-heading .muted { margin: 8px 0 0; }
.eyebrow { margin: 0 0 10px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.muted { color: var(--muted); line-height: 1.6; }

.panel { background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 2px 5px rgb(16 24 40 / 4%); }
.destination-list { display: grid; gap: 16px; }
.destination-card { padding: 24px; }
.workspace-card { min-height: 110px; }
.workspace-meta { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.destination-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.destination-heading h2 { margin: 0; font-size: 19px; }
.destination-url { margin: 7px 0 0; max-width: 720px; overflow-wrap: anywhere; color: #475467; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.assignment-block { margin-top: 24px; padding-top: 18px; border-top: 1px solid #f0f1f3; }
.setup-panel { display: grid; gap: 12px; margin: 0 0 34px; padding: clamp(20px, 4vw, 30px); }
.setup-panel h2, .section-heading h2 { margin: 0; font-size: 20px; }
.setup-panel .muted { margin: 8px 0 4px; max-width: 760px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 0 0 16px; }
.section-heading .eyebrow { margin-bottom: 6px; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.copy-row { display: flex; gap: 10px; }
.copy-row input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.workspace-delete { margin-top: 28px; }
.assignment-block h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 13px; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 20px; background: #eff4ff; color: #1849a9; font-size: 11px; }
.project-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.project-list li { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; color: #475467; font-size: 12px; }
.project-key { margin-right: 4px; color: #182230; font-weight: 700; }
.delete-form { display: flex; justify-content: flex-end; margin-top: 18px; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 700; text-decoration: none; transition: background-color .15s ease, border-color .15s ease; }
.button:hover { text-decoration: none; }
.button-primary { background: var(--blue); color: #fff; }
.button-primary:hover { background: var(--blue-dark); }
.button-secondary { border-color: #d0d5dd; background: #fff; color: #344054; }
.button-secondary:hover { background: #f9fafb; }
.button-quiet { background: transparent; color: #475467; }
.button-quiet:hover { background: #f2f4f7; }
.button-danger-quiet { min-height: 32px; padding: 0 8px; background: transparent; color: #b42318; font-size: 12px; }
.button-danger-quiet:hover { background: #fef3f2; }

.auth-shell { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.auth-panel { width: min(100%, 420px); padding: 32px; }
.auth-panel .brand-mark { margin-bottom: 26px; }
.auth-panel h1 { margin-bottom: 8px; }
.auth-panel > .muted { margin: 0 0 24px; }
.stack { display: grid; gap: 11px; }
label, legend { color: #344054; font-size: 13px; font-weight: 650; }
input[type="text"], input[type="url"], input[type="password"] { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid #d0d5dd; border-radius: 8px; outline: none; background: #fff; color: #182230; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid rgb(23 92 211 / 24%); outline-offset: 2px; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue); }

.empty-state { padding: 36px; text-align: center; }
.empty-state h2 { margin: 0; font-size: 20px; }
.empty-state .muted { margin: 8px auto 20px; max-width: 480px; }
.notice { padding: 12px 14px; border: 1px solid; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.notice-success { border-color: #abefc6; background: #ecfdf3; color: #067647; }
.notice-error { border-color: #fecdca; background: #fef3f2; color: #b42318; }
.page-footer { margin-top: 22px; color: var(--muted); font-size: 12px; text-align: center; }
.back-link { display: inline-block; margin-bottom: 16px; font-size: 13px; font-weight: 650; }
.form-panel { padding: clamp(22px, 4vw, 34px); }
.form-panel h1 { margin-bottom: 8px; }
.form-panel > .muted { margin: 0 0 24px; }
.field-hint { margin: -5px 0 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.project-picker { min-width: 0; margin: 8px 0 0; padding: 0; border: 0; }
.project-picker legend { width: 100%; margin-bottom: 10px; }
.required-hint { margin-left: 5px; color: var(--muted); font-size: 11px; font-weight: 400; }
.checkbox-list { max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 9px; }
.checkbox-row { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-bottom: 1px solid #f0f1f3; cursor: pointer; }
.checkbox-row:last-child { border-bottom: 0; }
.checkbox-row:hover { background: #f9fafb; }
.checkbox-row > span { display: flex; flex-wrap: wrap; gap: 3px 9px; align-items: baseline; }
.project-name { color: var(--muted); font-size: 12px; font-weight: 400; }
.checkbox-row-unavailable { background: #fffaeb; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.stack > .checkbox-row { margin-top: 5px; border: 1px solid var(--border); border-radius: 8px; }
.stack > .checkbox-row > span { flex: 1; }

@media (max-width: 640px) {
  .page-shell { margin-top: 30px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .destination-card { padding: 18px; }
  .destination-heading { flex-direction: column; }
  .destination-heading .button { align-self: flex-start; }
  .copy-row { align-items: stretch; flex-direction: column; }
  .copy-row .button { align-self: flex-start; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .auth-panel { padding: 26px 22px; }
}
