:root {
  color-scheme: light;
  --page: #f6f5f1;
  --surface: #ffffff;
  --surface-alt: #eef3f4;
  --ink: #202124;
  --muted: #667075;
  --line: #d8dedf;
  --accent: #146c72;
  --accent-dark: #0c5056;
  --warn: #b85c38;
  --done: #3d7a49;
  --shadow: 0 18px 45px rgba(20, 35, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  line-height: 1.12;
}

h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.today {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  min-height: 108px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-label,
.metric-unit {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.metric strong {
  display: inline-block;
  margin: 6px 7px 2px 0;
  font-size: 2.3rem;
  line-height: 1;
}

.metric-alert strong {
  color: var(--warn);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.list-panel {
  min-height: 360px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

input,
textarea {
  width: 100%;
  border: 1px solid #cbd4d6;
  border-radius: 8px;
  background: #fbfcfc;
  color: var(--ink);
  outline: none;
}

input {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 142px;
  resize: vertical;
  padding: 11px 12px;
  line-height: 1.6;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 108, 114, 0.14);
}

.primary-button,
.delete-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.delete-button {
  padding: 0 12px;
  background: #f7eae4;
  color: #8c3d22;
}

.message {
  min-height: 1.2em;
  margin: 0;
  color: var(--warn);
  font-size: 0.86rem;
  font-weight: 700;
}

.note-list,
.task-list {
  display: grid;
  gap: 10px;
}

.empty {
  margin: 0;
  padding: 24px 0;
  color: var(--muted);
  text-align: center;
}

.note-item,
.task-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.note-item {
  padding: 14px;
}

.note-title {
  margin: 0 0 7px;
  font-size: 1rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.note-body {
  margin: 0 0 12px;
  color: #354144;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
}

.status-pill {
  color: var(--warn);
}

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

.task-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: start;
  padding: 12px;
}

.task-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.task-text {
  margin: 0 0 8px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.task-item.is-completed .task-text {
  color: var(--muted);
  text-decoration: line-through;
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 22px, 1180px);
    padding-top: 18px;
  }

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

  .dashboard,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 94px;
  }

  .task-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .delete-button {
    grid-column: 2;
    justify-self: start;
  }
}
