:root {
  --paper: #fffdf8;
  --ink: #20231f;
  --green: #176b50;
  --red: #b9382f;
  --line: #d9d8cf;
  --muted: #686b64;
  --unit: #2367b1;
  --unit-soft: #edf5ff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f2f0e8;
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Noto Sans TC", "PingFang TC", sans-serif;
  line-height: 1.55;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
.shell {
  width: min(760px, 100%);
  min-height: 100vh;
  margin: auto;
  background: var(--paper);
  padding: 24px 18px 100px;
}
header {
  border-bottom: 3px solid var(--ink);
  padding-bottom: 12px;
}
.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  position: static;
  padding: 12px 0 0;
}
.mode-switch a {
  display: block;
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}
.mode-switch a[aria-current="page"] {
  border-color: var(--green);
  background: var(--green);
  color: white;
}
.mast-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
h1 {
  font-size: clamp(25px, 6vw, 38px);
  line-height: 1.08;
  margin: 0;
}
.rhythm {
  margin: 6px 0 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 750;
}
.person {
  width: 128px;
  flex: 0 0 128px;
  text-align: right;
}
.person small {
  font-size: 11px;
}
.person strong {
  display: block;
  padding: 7px 9px;
  border-radius: 8px;
  background: #f2f0e8;
  font-size: 14px;
}
.person span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
label {
  display: grid;
  gap: 5px;
  font-weight: 650;
}
small {
  display: block;
  color: #555;
  font-weight: 500;
}
textarea,
input,
select {
  width: 100%;
  border: 1px solid #aaa99f;
  border-radius: 8px;
  background: white;
  padding: 11px 12px;
}
textarea {
  min-height: 82px;
  resize: vertical;
}
.retained {
  margin: 10px 0 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
}
.retained-toggle {
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--green);
  font-weight: 800;
  text-align: left;
  display: flex;
  justify-content: space-between;
}
.retained-toggle:after {
  content: "展開";
  font-size: 12px;
  color: var(--muted);
}
.retained.expanded .retained-toggle:after {
  content: "收合";
}
.retained small {
  display: none;
  margin: 7px 0;
}
.retained.expanded small {
  display: block;
}
.retained textarea {
  height: 3.15em;
  min-height: 3.15em;
  margin-top: 7px;
}
.retained.expanded textarea {
  height: auto;
  min-height: 110px;
}
nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  padding: 12px 0 10px;
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--paper);
}
nav button {
  min-width: 0;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: white;
  padding: 8px 1px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.4px;
}
nav button[aria-selected="true"] {
  background: var(--unit);
  border-color: var(--unit);
  color: white;
  box-shadow: 0 3px 9px color-mix(in srgb, var(--unit) 28%, transparent);
}
.guide {
  margin: 5px 0 14px;
  padding: 12px 13px;
  border-left: 5px solid var(--unit);
  border-radius: 0 10px 10px 0;
  background: var(--unit-soft);
}
.guide h2 {
  margin: 0;
  color: var(--unit);
  font-size: 22px;
}
.guide p {
  margin: 4px 0;
}
.guide .example {
  color: var(--unit);
  font-weight: 650;
}
.items {
  display: grid;
  gap: 14px;
}
.item {
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--unit);
  border-radius: 10px;
  background: white;
}
.item-head {
  display: flex;
  justify-content: space-between;
}
.fields {
  display: grid;
  gap: 11px;
}
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.checks label {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  padding: 8px;
  border-radius: 8px;
}
.checks input {
  width: auto;
}
.add,
.submit {
  width: 100%;
  margin-top: 16px;
  padding: 13px;
  border: 0;
  border-radius: 9px;
  background: var(--unit);
  color: white;
  font-weight: 750;
  box-shadow: 0 3px 9px color-mix(in srgb, var(--unit) 25%, transparent);
}
.remove {
  border: 0;
  background: none;
  color: var(--red);
}
.summary-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
}
.notice {
  margin-top: 12px;
  padding: 11px;
  background: #eef7f2;
  color: var(--green);
}
.progress {
  display: grid;
  gap: 8px;
}
.progress textarea { min-height: 76px; }
.progress-actions { display: flex; justify-content: flex-end; }
.progress-actions .cancel-goal { width: auto; padding: 7px 9px; border: 0; background: transparent; color: var(--red); }
.progress-hint { margin: 7px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.progress h3 {
  margin: 8px 0 0;
}
.progress fieldset {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.progress legend {
  padding: 0 5px;
  font-weight: 750;
}
.daily-submit,
.setup-link {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 9px;
  background: var(--green);
  color: white;
  padding: 13px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}
.log {
  border-left: 4px solid var(--green);
  padding: 8px 10px;
  background: #f3f8f5;
}
.log time {
  color: var(--green);
  font-weight: 800;
}
.log p {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}
.result-progress {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.change-log {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
}
.change-log h3 { margin: 0 0 8px; }
.change-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 4px 8px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.change-row time { color: var(--muted); }
.change-row small { grid-column: 2 / -1; color: var(--muted); }
@media (max-width: 520px) {
  .change-row { grid-template-columns: auto 1fr; }
  .change-row span { grid-column: 1 / -1; }
}
.error {
  padding: 12px;
  background: #fff0ee;
  color: var(--red);
  font-weight: 700;
}
.choice {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-width: 100%;
}
.choice label {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  overflow-wrap: anywhere;
}
.choice input {
  width: auto;
  flex: 0 0 auto;
}
.other-input {
  margin-top: 8px;
}
.goal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.goal-tags i {
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--unit-soft);
  color: var(--unit);
  font-size: 12px;
  font-style: normal;
  overflow-wrap: anywhere;
}
.result-flags {
  margin-top: 4px;
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (max-width: 520px) {
  .shell {
    padding-left: 14px;
    padding-right: 14px;
  }
}
