:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #dfded9;
  --blue: #0a66c2;
  --green: #237a57;
  --red: #b42318;
  --amber: #946200;
  --shadow: 0 18px 45px rgba(29, 29, 31, 0.08);
}

* {
  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 {
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  min-height: 42px;
  padding: 0 16px;
  cursor: pointer;
}

button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

button.small {
  min-height: 32px;
  padding: 0 10px;
  background: #efefec;
  color: var(--ink);
}

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

textarea {
  min-height: 96px;
  resize: vertical;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  font-size: 17px;
}

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

.login-box {
  width: min(100%, 390px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 26px;
}

.login-box form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

#app {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 16px;
}

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

.tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 8px 0 14px;
  background: var(--bg);
}

.tab {
  min-height: 38px;
  padding: 0 8px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  white-space: nowrap;
}

.tab.active {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: 0 6px 18px rgba(29, 29, 31, 0.06);
}

.view {
  display: none;
  gap: 16px;
}

.view.active {
  display: grid;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

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

.two {
  display: grid;
  gap: 10px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.section-title h2 {
  color: var(--ink);
}

.stack {
  display: grid;
  gap: 10px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfbfa;
  display: grid;
  gap: 8px;
}

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

.item-title {
  font-weight: 700;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  background: white;
}

.priority-urgent,
.priority-high {
  color: var(--red);
}

.status-done {
  color: var(--green);
}

.status-running,
.status-queued {
  color: var(--amber);
}

.notes,
pre {
  color: #3f3f46;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

pre {
  margin: 0;
  background: #efefec;
  border-radius: 8px;
  padding: 10px;
  max-height: 280px;
  overflow: auto;
}

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

.area {
  min-height: 76px;
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.area strong {
  display: block;
  margin-bottom: 6px;
}

.area span {
  color: var(--muted);
}

.checkline {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.checkline input {
  width: auto;
}

.error {
  min-height: 20px;
  color: var(--red);
}

#toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  min-height: 0;
  padding: 0;
  border-radius: 8px;
  text-align: center;
  pointer-events: none;
  transform: translateY(18px);
  opacity: 0;
  transition: 160ms ease;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
  background: var(--ink);
  color: white;
  padding: 12px;
}

@media (min-width: 720px) {
  #app {
    padding: 28px;
  }

  .view.active {
    grid-template-columns: 360px 1fr;
    align-items: start;
  }

  #today.view.active {
    grid-template-columns: 1fr;
  }

  .two {
    grid-template-columns: 1fr 1fr;
  }

  .area-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
