:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f7f6;
  color: #172422;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-width: 320px;
  margin: 0;
  background: #f4f7f6;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.todo-app {
  width: min(100%, 720px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
}

.todo-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  min-height: 56px;
}

.back-button, .refresh-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid #d8e2df;
  border-radius: 13px;
  background: #fff;
  color: #1b625a;
  text-decoration: none;
}

.back-button svg, .refresh-button svg { width: 21px; height: 21px; }
.refresh-button:active, .back-button:active { background: #e9f3ef; transform: scale(.98); }
.refresh-button.is-loading svg { animation: spin .85s linear infinite; }
.refresh-button:disabled { opacity: .55; }

.todo-title { min-width: 0; }
.todo-title p { margin: 0 0 2px; color: #71827e; font-size: 10px; font-weight: 760; letter-spacing: .08em; }
.todo-title h1 { margin: 0; color: #173b37; font-size: 21px; line-height: 1.16; }

.todo-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 108px;
  margin: 15px 0 18px;
  padding: 18px;
  border: 1px solid rgba(39, 97, 89, .2);
  border-radius: 18px;
  background: linear-gradient(135deg, #164842, #1f5f58);
  box-shadow: 0 12px 28px rgba(18, 67, 60, .14);
  color: #fff;
}

.todo-overview span { display: block; margin-bottom: 6px; color: rgba(244, 255, 252, .72); font-size: 12px; font-weight: 650; }
.todo-overview h2 { margin: 0; font-size: 18px; line-height: 1.35; }
.todo-total { min-width: 52px; color: #fff; font-size: 38px; font-weight: 780; letter-spacing: 0; line-height: 1; text-align: right; }

.todo-state, .todo-empty, .todo-error {
  border: 1px solid #dae5e1;
  border-radius: 16px;
  background: #fff;
  text-align: center;
}

.todo-state { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 96px; color: #64746f; font-size: 14px; }
.todo-state svg { width: 19px; animation: spin .85s linear infinite; }
.todo-empty, .todo-error { padding: 42px 22px; }
.empty-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 16px; background: #e4f1eb; color: #197064; }
.empty-icon svg { width: 25px; height: 25px; }
.todo-empty h2, .todo-error h2 { margin: 0; color: #20312e; font-size: 18px; }
.todo-empty p, .todo-error p { margin: 8px 0 0; color: #6c7b77; font-size: 14px; line-height: 1.55; }
.todo-error .empty-icon { background: #faece9; color: #b64b3f; }
.todo-error button { min-height: 42px; margin-top: 18px; padding: 0 17px; border: 0; border-radius: 11px; background: #1b6f65; color: #fff; font-weight: 700; }

.todo-groups { display: grid; gap: 18px; }
.todo-group { display: grid; gap: 8px; }
.todo-group h2 { margin: 0 2px; color: #314440; font-size: 15px; font-weight: 760; }
.todo-items { display: grid; overflow: hidden; border: 1px solid #dce6e3; border-radius: 15px; background: #fff; box-shadow: 0 6px 18px rgba(31, 63, 57, .045); }
.todo-item { min-height: 64px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 18px; align-items: center; gap: 9px; padding: 10px 13px; color: #1c2a27; text-decoration: none; }
.todo-item + .todo-item { border-top: 1px solid #edf1ef; }
.todo-item:active { background: #f1f7f4; }
.todo-item-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: #e8f2ee; color: #1a7064; }
.todo-item-icon svg { width: 17px; height: 17px; }
.todo-item-title { overflow: hidden; font-size: 15px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.todo-item strong { min-width: 25px; color: #17695f; font-size: 20px; font-variant-numeric: tabular-nums; text-align: right; }
.todo-arrow { width: 17px; height: 17px; color: #95a39e; }
.tone-urgent .todo-item-icon { background: #fff0e9; color: #c45b34; }
.tone-urgent strong { color: #c45137; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 760px) {
  .todo-app { padding-top: 28px; }
  .todo-overview { min-height: 124px; }
  .todo-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .todo-group:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
