:root {
  --app-header-height: 48px;
  --app-header-bg: #14532d;
  --app-header-text: #f0fdf4;
  --app-header-border: #166534;
  --app-header-font-size: 0.88rem;
  --app-header-padding-x: 1rem;
  --app-body-bg: #f0fdf4;
  --radius-sm: 6px;
  --radius-md: 8px;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--app-body-bg);
  color: #14532d;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-viewer-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  height: var(--app-header-height);
  background: var(--app-header-bg);
  color: var(--app-header-text);
  border-bottom: 1px solid var(--app-header-border);
  padding: 0 var(--app-header-padding-x);
  gap: 0.75rem;
  font-size: var(--app-header-font-size);
}

.app-viewer-name {
  font-weight: 600;
  white-space: nowrap;
}

.app-viewer-body {
  flex: 1;
  background: var(--app-body-bg);
  min-height: calc(100vh - var(--app-header-height));
}

.todo-container {
  max-width: 480px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.todo-form {
  display: flex;
  gap: 0.5rem;
}

.todo-form input {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border: 1px solid #86efac;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  outline: none;
  background: #fff;
  color: #14532d;
}

.todo-form input:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.todo-form button {
  padding: 0.6rem 1.1rem;
  background: var(--green-600);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.todo-form button:hover {
  background: var(--green-700);
}

.todo-list {
  list-style: none;
  margin-top: 1rem;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  background: #fff;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  margin-bottom: 0.45rem;
}

.todo-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green-600);
  cursor: pointer;
  flex-shrink: 0;
}

.todo-item span {
  flex: 1;
  font-size: 0.95rem;
  word-break: break-word;
}

.todo-item.done span {
  text-decoration: line-through;
  opacity: 0.5;
}

.todo-item button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.15rem;
  color: #86efac;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  line-height: 1;
}

.todo-item button:hover {
  color: #ef4444;
  background: #fef2f2;
}

.empty-msg {
  text-align: center;
  color: #6ee7b7;
  margin-top: 2rem;
  font-size: 0.95rem;
}

.empty-msg.hidden {
  display: none;
}

@media (max-width: 575.98px) {
  .app-viewer-header {
    gap: 0.5rem;
    --app-header-padding-x: 0.65rem;
  }

  .todo-container {
    margin: 1rem auto;
  }
}