:root {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: #213532;
  background: #f5f7f6;
  font-synthesis: none;
  font-size: 16px;
  --green: #274c47;
  --muted: #61736f;
  --line: #dce4e0;
  --accent: #e9f0cb;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
button,
input,
select {
  min-height: 48px;
}
input,
textarea,
select {
  width: 100%;
  max-width: 100%;
  border: 1px solid #b7c6bf;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  color: #213532;
}
textarea {
  resize: vertical;
}
input[type="checkbox"] {
  width: 22px;
  min-height: 22px;
  accent-color: var(--green);
}
button {
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 600;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #698a30;
  outline-offset: 3px;
}
#install-guide-title:focus-visible {
  outline: 2px solid #698a30;
  outline-offset: 3px;
}
label {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 22px;
}
h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -0.04em;
  font-size: 2.6rem;
  line-height: 1.12;
  margin: 16px 0 26px;
}
p {
  line-height: 1.5;
}
.brand {
  font-size: 0.87rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.hint {
  color: var(--muted);
  font-size: 0.85rem;
}
.primary {
  background: var(--green);
  color: white;
  width: 100%;
}
.secondary {
  border: 1px solid var(--line);
  background: white;
  width: 100%;
  margin-top: 22px;
}
.quiet {
  background: transparent;
  color: var(--green);
  padding: 10px 12px;
  white-space: nowrap;
}
.error {
  color: #9c342b;
  font-size: 0.9rem;
  min-height: 1em;
}
.error:empty {
  display: none;
}
[hidden] {
  display: none !important;
}
.login {
  max-width: 430px;
  margin: 0 auto;
  padding: calc(48px + env(safe-area-inset-top)) 24px 30px;
}
.login .brand {
  display: block;
  margin-bottom: 54px;
}
.intro {
  color: var(--muted);
  margin-bottom: 34px;
}
.login .hint {
  margin-top: 28px;
}
.topbar {
  padding: 10px max(20px, calc((100vw - 720px) / 2));
  padding-top: calc(10px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.workspace {
  max-width: 720px;
  margin: auto;
  padding: 24px 20px 130px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.page-heading h1 {
  margin: 8px 0 26px;
}
.page-heading p {
  margin: 0;
}
.filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 3px 3px 12px;
  margin: 0 -3px;
  scrollbar-width: thin;
}
.filters button {
  white-space: nowrap;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 28px;
  font-size: 0.85rem;
  padding: 10px 14px;
}
.filters button[aria-pressed="true"] {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
#search-form {
  display: flex;
  gap: 4px;
  margin: 8px 0 22px;
}
#search-form input {
  min-width: 0;
  background: #edf1ef;
  border-color: transparent;
}
.task-item {
  display: block;
  text-align: left;
  width: 100%;
  padding: 20px 0;
  background: transparent;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
  overflow-wrap: anywhere;
}
.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 9px;
}
.task-title {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
}
.task-description {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-top: 8px;
  white-space: pre-wrap;
}
.priority {
  padding: 3px 8px;
  border-radius: 6px;
  background: #e7eee9;
  font-weight: 600;
  color: var(--green);
}
.priority.high,
.priority.urgent {
  background: #f9e3d2;
  color: #8c401c;
}
.overdue {
  color: #9c342b;
}
.actionbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #f5f7f6;
}
.actionbar .primary {
  display: block;
  max-width: 680px;
  margin: auto;
  background: var(--green);
}
.actionbar span {
  font-size: 1.2rem;
  margin-right: 4px;
}
.editor {
  max-width: 620px;
  margin: auto;
  padding: calc(12px + env(safe-area-inset-top)) 20px 40px;
}
.editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.editor-heading button {
  margin-left: -12px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-row label {
  min-width: 0;
}
.checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 400;
}
.editor-actions {
  padding: 16px 0 calc(12px + env(safe-area-inset-bottom));
  background: #f5f7f6;
}
#status:not(:empty) {
  position: fixed;
  z-index: 10;
  top: calc(14px + env(safe-area-inset-top));
  left: 20px;
  right: 20px;
  max-width: 560px;
  margin: auto;
  border: 1px solid #b6c997;
  border-radius: 12px;
  background: var(--accent);
  padding: 16px;
  box-shadow: 0 4px 18px #21353215;
}
.empty {
  padding: 40px 0;
  color: var(--muted);
  max-width: 38ch;
}
.empty strong {
  display: block;
  color: var(--green);
  margin-bottom: 8px;
}
.install-entry {
  padding-left: 0;
  white-space: normal;
  text-align: left;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 4px;
}
#install-dialog {
  width: min(100% - 24px, 440px);
  max-height: calc(
    100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)
  );
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #f5f7f6;
  color: #213532;
  overscroll-behavior: contain;
}
#install-dialog::backdrop {
  background: #122e28a6;
}
body:has(#install-dialog[open]) {
  overflow: hidden;
}
.install-content {
  padding: 28px 24px 20px;
}
.install-icon {
  display: block;
  border-radius: 18px;
  margin-bottom: 20px;
}
.install-content .brand {
  margin: 0 0 10px;
}
#install-title {
  font: 400 2.1rem/1.12 Georgia, "Times New Roman", serif;
  letter-spacing: -0.04em;
  margin: 0 0 16px;
}
#install-description {
  color: var(--muted);
  margin: 0 0 24px;
}
#install-guide {
  border-top: 1px solid var(--line);
  margin-bottom: 20px;
}
#install-guide h3 {
  font-size: 1rem;
  margin: 20px 0;
  scroll-margin-top: 12px;
}
#install-steps {
  list-style: none;
  padding: 0;
  counter-reset: install-step;
}
#install-steps li {
  position: relative;
  padding-left: 38px;
  margin-bottom: 20px;
  counter-increment: install-step;
}
#install-steps li::before {
  content: counter(install-step);
  position: absolute;
  left: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e5ece8;
  color: var(--green);
  text-align: center;
  line-height: 26px;
  font-weight: 600;
}
#install-steps strong {
  font-size: 0.9rem;
}
#install-steps p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.install-actions {
  display: grid;
  gap: 8px;
}
.install-actions .quiet {
  white-space: normal;
}
.install-note {
  margin: 12px 0 0;
  font-size: 0.75rem;
}
@media (max-width: 380px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .workspace,
  .editor {
    padding-left: 16px;
    padding-right: 16px;
  }
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }
  .brand {
    font-size: 0.8rem;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition: background-color 0.15s;
  }
}
