:root {
  color-scheme: light dark;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-alt: #eef0f3;
  --text: #202124;
  --muted: #6f737b;
  --border: #dfe2e7;
  --accent: #565cff;
  --accent-text: #ffffff;
  --danger: #c73737;
  --shadow: 0 12px 32px rgb(20 24 32 / 10%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151619;
    --surface: #202226;
    --surface-alt: #292c31;
    --text: #f2f3f5;
    --muted: #a4a8b0;
    --border: #34373d;
    --accent: #8589ff;
    --accent-text: #111216;
    --danger: #ff7b7b;
    --shadow: 0 16px 36px rgb(0 0 0 / 28%);
  }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  --site-drawer-width: 0px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body:has(.task-workspace.has-detail) {
  --site-drawer-width: clamp(360px, 34vw, 480px);
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.site-shell {
  width: calc(100% - var(--site-drawer-width));
  min-height: 100vh;
  transition: width .34s cubic-bezier(.22, 1, .36, 1);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
}

.site-brand {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .01em;
  text-decoration: none;
}

.site-header form {
  margin: 0;
}

.site-logout {
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.site-main {
  min-height: calc(100vh - 57px);
}

@media (max-width: 720px) {
  body:has(.task-workspace.has-detail) {
    --site-drawer-width: 0px;
  }

  .site-shell {
    width: 100%;
  }
}
