:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --ink: #111111;
  --muted: #444444;
  --line: #d7d7d7;
  --green: #111111;
  --yellow: #8a5a00;
  --red: #b42318;
  --blue: #0b57d0;
  --accent: #0b57d0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  padding: 0 16px;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.08);
}

code {
  background: #e9eee7;
  border-radius: 4px;
  padding: 2px 5px;
}

.is-hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 32px;
  box-shadow: none;
}

.login-panel h1,
.topbar h1,
.sidebar h2 {
  margin: 0;
  letter-spacing: 0;
}

.login-panel h1 {
  font-size: 34px;
  line-height: 1.08;
}

.topbar > div:first-child {
  min-width: 0;
}

.topbar h1 {
  max-width: 760px;
  overflow-wrap: anywhere;
  font-size: 34px;
  line-height: 1.08;
}

.sidebar h2 {
  font-size: 32px;
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.subtle,
.hint {
  color: var(--muted);
}

.login-form,
.import-form,
.compact-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.compact-form {
  gap: 10px;
  margin-top: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: auto;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
  color: #17231d;
  padding: 11px 12px;
}

input::placeholder,
textarea::placeholder {
  color: #6c756f;
  opacity: 1;
}

textarea {
  resize: vertical;
}

.onboarding-panel {
  width: min(560px, 100%);
}

.onboarding-hero {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 22px;
}

.reason-list,
.name-suggestions,
.invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reason-list {
  margin-top: 18px;
}

.reason-list span,
.name-suggestions button {
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.reason-list span {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  padding: 8px 10px;
}

.name-suggestions {
  margin-top: -4px;
}

.name-suggestions button {
  min-height: 34px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
}

.space-picker-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.space-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.space-card-invite {
  flex-basis: 100%;
}

.error-text {
  color: var(--red);
}

.space-picker-title {
  display: grid;
  gap: 4px;
}

.space-picker-item small {
  color: var(--muted);
  font-size: 13px;
}

.space-picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.space-type-field {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.space-type-field legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.space-type-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  color: var(--ink);
  cursor: pointer;
}

.space-type-option:has(input:checked) {
  border-color: var(--accent);
  background: #f4f8ff;
}

.space-type-option input {
  width: auto;
  margin-top: 3px;
}

.space-type-option span {
  display: grid;
  gap: 4px;
}

.space-type-option small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.invite-actions {
  margin-top: 12px;
}

.invite-actions button {
  min-height: 38px;
  width: auto;
}

.invite-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  text-align: center;
}

.invite-code-display {
  width: 100%;
  min-height: 58px;
  background: #ffffff;
  color: #9b5f4c;
  font-size: 46px;
  font-weight: 750;
  letter-spacing: 0;
}

.invite-wait-copy {
  margin-top: 14px;
}

.invite-close-button {
  width: 100%;
  margin-top: 12px;
}

.invite-field {
  gap: 6px;
  margin-top: 8px;
}

.invite-field input {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.space-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.space-actions button {
  width: auto;
}

.danger-button {
  border: 1px solid #d92d20;
  background: #ffffff;
  color: var(--red);
}

.dashboard-screen {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  background: #ffffff;
  padding: 24px;
}

nav {
  display: grid;
  gap: 8px;
  max-height: 70vh;
  overflow: auto;
}

.nav-button,
.secondary-button {
  width: 100%;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.secondary-button {
  border: 1px solid var(--line);
}

.nav-button.is-active {
  background: var(--accent);
  color: white;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.filters {
  display: grid;
  grid-template-columns: 170px 160px;
  gap: 10px;
}

.status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.status-pill {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 750;
}

.status-pill.yellow {
  background: #ffffff;
  color: var(--yellow);
}

.status-pill.red {
  background: #ffffff;
  color: var(--red);
}

.status-pill.blue {
  background: #ffffff;
  color: var(--blue);
}

.presence {
  color: var(--muted);
  font-size: 13px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  font-size: clamp(20px, 2vw, 28px);
  letter-spacing: 0;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.panel {
  padding: 18px;
}

.panel h3 {
  margin: 0 0 14px;
  font-size: 21px;
  line-height: 1.18;
}

.wide {
  grid-column: 1 / -1;
}

.progress-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #eeeeee;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.bar-list,
.recommendation-list,
.table-list {
  display: grid;
  gap: 10px;
}

.compact-list {
  margin-top: 12px;
}

.bar-row,
.table-row,
.recommendation {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #ffffff;
}

.bar-row-header,
.table-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mini-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eeeeee;
}

.mini-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.recommendation {
  border-left: 4px solid var(--blue);
}

.recommendation.warning {
  border-left-color: var(--yellow);
}

.recommendation.positive {
  border-left-color: var(--green);
}

.large-line {
  margin: 0;
  font-size: 24px;
  font-weight: 750;
}

@media (max-width: 900px) {
  .dashboard-screen {
    grid-template-columns: 1fr;
  }

  .sidebar {
    gap: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar,
  .status-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .filters,
  .metric-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .login-screen {
    align-items: stretch;
    padding: 14px;
  }

  .login-panel {
    width: 100%;
    min-height: calc(100vh - 28px);
    padding: 22px;
  }

  .login-panel h1,
  .topbar h1,
  .sidebar h2 {
    font-size: 25px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 14px;
  }

  nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    max-height: none;
    padding-bottom: 4px;
  }

  .nav-button,
  .secondary-button {
    width: auto;
    min-width: max-content;
    text-align: center;
  }

  .workspace {
    padding: 14px;
  }

  .topbar {
    margin-bottom: 14px;
  }

  .metric-grid {
    gap: 10px;
  }

  .bar-row-header,
  .table-row-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}
