:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #13201f;
  background: #eef4f2;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overscroll-behavior-y: contain;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 34%),
    linear-gradient(180deg, #f8fbfa 0%, #e8f0ee 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: #0f766e;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:active {
  transform: translateY(1px);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.26);
  outline-offset: 2px;
}

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
  transition: transform 180ms ease;
}

.app-shell.pulling {
  transform: translateY(28px);
}

.pull-refresh {
  position: fixed;
  z-index: 10;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  min-height: 34px;
  padding: 8px 14px;
  border: 1px solid #d8e5e1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(39, 63, 59, 0.12);
  color: #0f766e;
  font-size: 0.82rem;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.pull-refresh.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 2.4rem;
  line-height: 1;
}

h2 {
  font-size: 1.05rem;
  line-height: 1.25;
}

.network-pill,
.saved-label {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #dff3ef;
  color: #0f766e;
  font-size: 0.82rem;
  font-weight: 800;
}

.network-pill.offline {
  background: #fff1d6;
  color: #9a5b00;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.summary > div,
.panel {
  border: 1px solid #d8e5e1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 42px rgba(39, 63, 59, 0.08);
}

.summary > div {
  min-height: 82px;
  padding: 14px 10px;
}

.metric {
  display: block;
  color: #0f766e;
  font-size: 1.8rem;
  font-weight: 850;
  line-height: 1.1;
}

.metric-label {
  display: block;
  margin-top: 4px;
  color: #5b6b67;
  font-size: 0.82rem;
  font-weight: 700;
}

.panel {
  margin-top: 14px;
  padding: 16px;
}

.section-title,
.utility-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ghost-button {
  min-height: 36px;
  padding: 0 12px;
  background: #edf5f3;
  color: #0f766e;
  font-size: 0.88rem;
}

.task-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 14px;
}

.sync-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 14px;
}

.task-form button,
.sync-form button,
#install-button {
  padding: 0 18px;
}

input,
textarea {
  width: 100%;
  border: 1px solid #c8d8d3;
  border-radius: 8px;
  background: #fff;
  color: #13201f;
}

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

textarea {
  display: block;
  margin-top: 14px;
  min-height: 150px;
  padding: 12px;
  line-height: 1.6;
  resize: vertical;
}

.task-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.task-item {
  display: grid;
  grid-template-columns: 32px 1fr 36px;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px;
  border: 1px solid #e1ebe8;
  border-radius: 8px;
  background: #fbfdfc;
}

.task-item input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  accent-color: #0f766e;
}

.task-title {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.task-item.done .task-title {
  color: #71817d;
  text-decoration: line-through;
}

.delete-button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  background: #f2e9e4;
  color: #8a3b20;
  font-size: 1.25rem;
  line-height: 1;
}

.empty-state {
  margin-top: 14px;
  color: #65736f;
  line-height: 1.6;
}

.utility-panel p {
  margin-top: 6px;
  color: #5b6b67;
  line-height: 1.5;
}

.hint {
  color: #65736f;
  font-size: 0.92rem;
  line-height: 1.6;
}

.form-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.release-version {
  flex: 0 0 auto;
  color: #71817d;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.6;
}

@media (max-width: 520px) {
  .topbar,
  .section-title,
  .utility-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .network-pill,
  .saved-label {
    align-self: flex-start;
  }

  .task-form,
  .sync-form {
    grid-template-columns: 1fr;
  }

  .form-meta {
    flex-direction: column;
    gap: 4px;
  }

  .summary {
    gap: 8px;
  }

  .summary > div {
    min-height: 74px;
    padding: 12px 8px;
  }

  .metric {
    font-size: 1.5rem;
  }
}
