:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --green: #16a34a;
  --green-dark: #15803d;
  --red: #dc2626;
  --line: #e2e8f0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "PingFang SC", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.wrap { max-width: 680px; margin: 0 auto; padding: 24px 16px 48px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}

.date { color: var(--muted); font-size: 14px; margin: 0 0 4px; }
h1 { font-size: 22px; margin: 0 0 16px; }
.count { color: var(--muted); font-size: 16px; font-weight: 600; }
.hint { color: var(--muted); margin: 4px 0 12px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.empty { color: var(--muted); grid-column: 1 / -1; }
code { background: #eef2f7; border-radius: 4px; padding: 1px 5px; font-size: 12px; }

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
  margin-bottom: 12px;
}
textarea:focus { outline: 2px solid #86efac; }

.btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  padding: 14px;
  cursor: pointer;
  letter-spacing: 8px;
}
.btn:hover { background: var(--green-dark); }
.btn:active { transform: scale(.99); }

.done-box { text-align: center; padding: 12px 0 4px; }
.done-icon {
  width: 56px; height: 56px; line-height: 56px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: #dcfce7;
  color: var(--green);
  font-size: 30px; font-weight: 700;
}
.done-title { font-weight: 700; margin: 0; }
.done-time { color: var(--muted); margin: 4px 0 0; }
.note { color: var(--text); margin: 8px 0 0; }

.streak {
  color: var(--muted);
  font-size: 14px;
  margin: 16px 0 0;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}

.bar { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; margin-bottom: 16px; }
.bar-inner { height: 100%; background: var(--green); border-radius: 4px; transition: width .3s; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.chip { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.chip.ok { background: #f0fdf4; border-color: #bbf7d0; }
.chip-head { display: flex; justify-content: space-between; align-items: center; }
.chip-name { font-weight: 600; }
.chip.ok .chip-mark { color: var(--green); font-weight: 700; }
.chip.miss .chip-mark { color: var(--red); }
.chip-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.chip-note {
  color: var(--text); font-size: 12px; margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.daynav { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; font-size: 14px; flex-wrap: wrap; }
.daynav a { color: #2563eb; text-decoration: none; }
.daynav .right { margin-left: auto; }
.summary { margin: 0 0 12px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 600; }

.linkrow { margin-bottom: 10px; }
.copy {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--muted);
  background: #f8fafc;
  margin-top: 4px;
}

.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 8px; }
.foot a { color: var(--muted); }

.userbar { text-align: right; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.userbar a { color: var(--muted); }

.btn-plain { letter-spacing: normal; }

.field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  margin-bottom: 12px;
}

.warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: #92400e;
  margin-bottom: 12px;
  text-align: left;
}

.error { color: var(--red); font-size: 14px; margin: 0 0 12px; }
