:root {
  color-scheme: light;
  --brand-bg: #0b101b;
  --brand-surface: #111827;
  --brand-line: #303c50;
  --brand-text: #f4f6fb;
  --brand-muted: #b8c2d1;
  --mint: #9cf5cd;
  --bg: #f4f7f6;
  --surface: #fff;
  --text: #15232b;
  --muted: #52636b;
  --line: #dbe4e2;
  --focus: #007e5b;
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 280px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

::selection { background: var(--mint); color: var(--brand-bg); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.wrap {
  width: min(1140px, calc(100% - 48px));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  z-index: 2;
  inset: 8px auto auto 12px;
  transform: translateY(-140%);
  padding: 8px 13px;
  border-radius: 6px;
  color: var(--brand-bg);
  background: var(--mint);
}

.skip-link:focus { transform: none; }

.site-header {
  color: var(--brand-text);
  background: var(--brand-bg);
  border-bottom: 1px solid var(--brand-line);
}

.site-header :focus-visible,
.auth-card :focus-visible { outline-color: var(--mint); }

.header-layout {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 30px;
}

.brand {
  flex: none;
  display: inline-flex;
  align-items: baseline;
  color: var(--brand-text);
  font-size: 26px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -1.3px;
  text-decoration: none;
  white-space: nowrap;
}

.brand-icon {
  display: inline-block;
  width: 20px;
  height: 23px;
  margin-inline: -1px;
  color: var(--mint);
  transform: translateY(2px);
}

.brand-icon svg { display: block; width: 100%; height: 100%; }
.brand-icon circle { fill: currentColor; }
.brand-icon path { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.brand-period { color: var(--mint); margin-left: 2px; }
.header-label { margin-left: auto; color: var(--brand-muted); font-size: 14px; }

.main-nav,
.account {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.main-nav { flex-wrap: wrap; }
.main-nav a {
  padding: 8px 10px;
  color: var(--brand-muted);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.main-nav a:hover,
.main-nav a[aria-current] { color: var(--mint); background: var(--brand-surface); }

.account { margin-left: auto; }
.account-details { min-width: 0; text-align: right; }
.account-details strong, .account-details span { display: block; overflow-wrap: anywhere; }
.account-details strong { font-size: 14px; }
.account-details span { color: var(--brand-muted); font-size: 12px; }
.account form { flex: none; }

.demo-banner {
  border-bottom: 1px solid #d9e4c8;
  background: #edf3dd;
  color: #3b5027;
  font-size: 13px;
  font-weight: 650;
  padding-block: 7px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 680;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  background: var(--mint);
  border-color: #8adab8;
  color: #123329;
}

.button-primary:hover { background: #b6fbdc; }

.button-header,
.button-auth {
  color: var(--brand-text);
  background: var(--brand-surface);
  border-color: var(--brand-line);
}

.button-header:hover,
.button-auth:hover { color: var(--mint); border-color: var(--mint); }
.button-header { min-height: 38px; padding-block: 6px; }

.auth-page { background: var(--brand-bg); color: var(--brand-text); }
.auth-layout { display: grid; justify-items: center; padding-block: clamp(36px, 8vw, 100px); }

.auth-card {
  width: min(100%, 480px);
  padding: clamp(24px, 5vw, 40px);
  border: 1px solid var(--brand-line);
  border-radius: 14px;
  color: var(--brand-text);
  background: var(--brand-surface);
}

.auth-card h1,
.page-heading h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 730;
  line-height: 1.12;
  letter-spacing: -1.2px;
  margin: 0;
}

.intro { margin: 14px 0 26px; color: var(--brand-muted); }
.auth-options { display: grid; gap: 10px; }
.auth-options + .auth-form { margin-top: 20px; }
.auth-form button { width: 100%; }

.workspace { padding-block: 36px 60px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.page-heading p { color: var(--muted); margin: 7px 0 0; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  grid-template-areas: "projects intake" "history intake";
  grid-template-rows: min-content 1fr;
  align-items: start;
  gap: 20px;
}

.projects-panel { grid-area: projects; }
.intake-panel { grid-area: intake; }
.history-panel { grid-area: history; }

.panel {
  min-width: 0;
  padding: clamp(18px, 3vw, 25px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.panel h2 { margin: 0 0 14px; font-size: 21px; letter-spacing: -.35px; line-height: 1.3; }
.project-list, .entry-list { list-style: none; margin: 0; padding: 0; }
.project-list li, .entry-list > li { min-width: 0; overflow-wrap: anywhere; }
.project-list li { padding: 15px 0; border-top: 1px solid var(--line); }
.project-list h3, .entry-list h3 { font-size: 17px; line-height: 1.4; margin: 0; }
.project-list p, .entry-project { color: var(--muted); margin: 5px 0 0; }
.project-list li:last-child { padding-bottom: 0; }

.intake-form { display: grid; gap: 14px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field label { font-size: 14px; font-weight: 650; }
.field label span { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  display: block;
  min-width: 0;
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #aebfbd;
  border-radius: 6px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
}

.field textarea { resize: vertical; }
.field-hint { padding: 0; margin: 0; color: var(--muted); font-size: 13px; }
.intake-form .button { justify-self: start; }

.empty-state {
  padding: 12px 14px;
  margin: 0;
  border-radius: 6px;
  color: var(--muted);
  background: var(--bg);
}

.message {
  padding: 10px 13px;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 14px;
  background: var(--bg);
}

.message-success { color: #24513a; background: #ebf9ef; border-color: #c4e8ce; }
.message-error { color: #842439; background: #fff0f2; border-color: #edccd2; }
.auth-card .message:not(.message-error) { color: var(--brand-text); background: var(--brand-bg); border-color: var(--brand-line); }

.history-panel .entry-list > li { border-top: 1px solid var(--line); padding: 16px 0; }
.history-panel .entry-list > li:last-child { padding-bottom: 0; }
.entry-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 6px; }
.entry-meta { color: var(--muted); font-size: 13px; }
.kind-label { color: #24654e; font-size: 13px; font-weight: 750; }
.entry-description { margin: 7px 0 0; white-space: pre-wrap; }
.inbox-list { display: grid; gap: 14px; }
.entry-details { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 10px 0 15px; }
.entry-details dt { color: var(--muted); font-size: 13px; }
.entry-details dd { font-size: 14px; margin: 0; }

@media (max-width: 720px) {
  .wrap { width: calc(100% - 32px); }
  .header-layout {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 64px;
    padding-block: 10px;
    gap: 7px 15px;
  }
  .main-nav { grid-row: 2; grid-column: 1 / -1; gap: 6px; }
  .account { justify-self: end; }
  .workspace { padding-top: 25px; }
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "projects" "intake" "history";
    grid-template-rows: auto;
    gap: 14px;
  }
}

@media (max-width: 390px) {
  .account { gap: 7px; }
  .account-details span { display: none; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
}
