* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.7;
}
button,
input,
select {
  font: inherit;
}
a {
  color: var(--brand);
  text-decoration: none;
}
button,
.button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 17px;
  min-height: 44px;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
button:hover,
.button:hover {
  border-color: var(--gold);
}
button.primary,
.button.primary {
  background: var(--deep);
  color: var(--on-dark);
  border-color: var(--deep);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button.danger {
  color: #a32929;
  border-color: #eed5d5;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
header {
  min-height: 94px;
  background: var(--deep);
  color: var(--on-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px max(24px, calc((100vw - 1200px) / 2));
}
.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
}
.logo img:first-child {
  width: 27px;
  height: 36px;
}
.logo img:last-child {
  width: 130px;
  height: auto;
}
.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
header button {
  background: transparent;
  border-color: #ffffff35;
  color: var(--on-dark);
}
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(25px, 4vw, 36px);
  font-weight: 600;
  line-height: 1.5;
}
h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}
h3 {
  font-size: 16px;
  font-weight: 600;
}
.eyebrow {
  color: var(--brand);
  font-size: 13px;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
  font-weight: 600;
}
.muted {
  color: var(--muted);
}
.intro {
  margin-bottom: 28px;
}
.intro p {
  margin-top: 8px;
  max-width: 720px;
}
.login-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  min-height: calc(100vh - 250px);
}
.login-copy p {
  max-width: 450px;
  margin-top: 18px;
  font-size: 17px;
}
.steps {
  display: grid;
  gap: 14px;
  margin-top: 32px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  display: flex;
  gap: 12px;
  align-items: center;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--brand);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}
.panel,
.space-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
}
.panel > p {
  margin-bottom: 20px;
}
.login-panel {
  max-width: 500px;
  width: 100%;
  justify-self: end;
  box-shadow: var(--shadow);
}
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.tabs button {
  flex: 1;
}
.tabs [aria-selected='true'] {
  background: var(--soft);
  border-color: var(--gold);
  color: var(--brand);
}
form {
  display: grid;
  gap: 16px;
}
.field {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 500;
}
input,
select {
  width: 100%;
  min-width: 0;
  background: white;
  color: var(--ink);
  border: 1px solid #cecec5;
  border-radius: 9px;
  min-height: 45px;
  padding: 9px 12px;
}
.field small,
.hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.space-card {
  display: grid;
  gap: 18px;
}
.space-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}
.badge {
  padding: 3px 11px;
  border-radius: 20px;
  background: var(--soft);
  color: var(--brand);
  font-size: 12px;
  white-space: nowrap;
}
.badge.expired,
.badge.paused {
  background: #fbecec;
  color: #922b2b;
}
dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  font-size: 14px;
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.actions button {
  padding: 7px 12px;
  font-size: 13px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
}
.stat b {
  font-size: 28px;
  display: block;
  font-weight: 600;
}
.stat span {
  color: var(--muted);
  font-size: 13px;
}
.notice,
.error,
.success {
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
  background: var(--soft);
  color: #69501b;
  overflow-wrap: anywhere;
}
.error {
  background: #fbecec;
  color: #922b2b;
}
.success {
  background: #eaf4ed;
  color: #245e38;
}
[hidden] {
  display: none !important;
}
.invite-link {
  display: grid;
  gap: 12px;
}
.invite-link input {
  font-size: 12px;
}
.empty {
  padding: 40px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 16px;
  margin-top: 24px;
}
.client-summary {
  max-width: 780px;
}
.client-summary .actions {
  margin-top: 24px;
}
.client-tools {
  margin-top: 24px;
}
.section {
  margin-top: 28px;
}
details > summary {
  cursor: pointer;
  font-weight: 600;
  padding: 8px 0;
}
details[open] > summary {
  margin-bottom: 16px;
}
footer {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 12px;
}
dialog {
  width: min(500px, calc(100vw - 32px));
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  color: var(--ink);
}
dialog::backdrop {
  background: #11111170;
}
dialog p {
  margin-bottom: 20px;
}
.loading {
  padding: 64px;
  text-align: center;
}
@media (max-width: 720px) {
  header {
    padding: 18px;
    gap: 10px;
    min-height: 80px;
  }
  .logo {
    gap: 8px;
  }
  .logo img:first-child {
    width: 21px;
  }
  .logo img:last-child {
    width: 104px;
  }
  header button {
    padding: 8px 10px;
    font-size: 13px;
  }
  main {
    padding: 28px 16px 40px;
  }
  .login-layout {
    grid-template-columns: 1fr;
    gap: 28px;
    min-height: auto;
  }
  .login-copy p {
    font-size: 15px;
  }
  .steps {
    display: none;
  }
  .login-panel {
    max-width: none;
  }
  .panel,
  .space-card {
    padding: 20px;
  }
  .grid,
  .cards {
    grid-template-columns: 1fr;
  }
  .stats {
    gap: 8px;
  }
  .stat {
    padding: 12px;
  }
  .stat b {
    font-size: 24px;
  }
  .stat span {
    font-size: 11px;
  }
}
@media print {
  header,
  footer,
  button,
  form,
  .client-tools,
  .invite-link {
    display: none !important;
  }
  main {
    padding: 0;
  }
  .space-card {
    break-inside: avoid;
  }
}
