:root {
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #171b1a;
  --muted: #66716d;
  --line: #dfe5df;
  --green: #0f7a5f;
  --blue: #2467a8;
  --amber: #a76500;
  --red: #b34035;
  --violet: #6c4aa5;
  --shadow: 0 12px 32px rgba(23, 27, 26, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button,
.ghost-button,
summary {
  min-height: 44px;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(16px, env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid rgba(223, 229, 223, 0.9);
  background: rgba(246, 247, 244, 0.94);
  backdrop-filter: blur(12px);
}

.topbar h1,
.login-card h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.updated-at {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow,
.category {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  text-decoration: none;
  font-weight: 700;
}

.dashboard {
  width: min(100%, 1100px);
  margin: 0 auto;
  padding: 16px 12px 32px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.summary-card {
  min-height: 92px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
  box-shadow: var(--shadow);
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.status-waiting {
  border-left-color: var(--amber);
}

.status-blocked {
  border-left-color: var(--red);
}

.status-done {
  border-left-color: var(--blue);
}

.status-paused {
  border-left-color: var(--violet);
}

.quick-add,
.project-card,
.empty-state,
.report-section,
.event-timeline {
  margin-top: 12px;
}

.quick-add details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.quick-add summary {
  display: flex;
  align-items: center;
  padding: 14px;
  font-weight: 700;
  cursor: pointer;
}

.task-form,
.stack {
  display: grid;
  gap: 12px;
}

.task-form {
  padding: 0 14px 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.project-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.project-card,
.empty-state,
.report-section,
.event-timeline {
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-head h2,
.report-section h2,
.empty-state h2,
.event-timeline h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f9faf8;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 700;
}

.task-title {
  margin: 12px 0 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.next-step,
.result,
.muted {
  color: var(--muted);
  line-height: 1.45;
}

.next-step span,
.result span {
  color: var(--ink);
  font-weight: 700;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.meta-row span {
  border-radius: 999px;
  background: #f2f4f1;
  padding: 6px 9px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.quick-actions button {
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 10px 8px;
  font-size: 13px;
}

.event-timeline {
  border-left-color: var(--violet);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.event-timeline ol {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.event-timeline li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.event-timeline time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.event-timeline strong {
  display: block;
  font-size: 13px;
}

.event-timeline span {
  display: block;
  margin-top: 2px;
  line-height: 1.35;
}

.event-timeline p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

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

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

.form-error {
  border-radius: 8px;
  background: #fff0ee;
  color: var(--red);
  padding: 10px;
}

@media (min-width: 780px) {
  .topbar {
    padding-inline: 24px;
  }

  .dashboard {
    padding-inline: 24px;
  }

  .summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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