*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--body-font, Menlo, 'Lucida Console', 'Liberation Mono', Consolas, monospace);
  font-size: 10px;
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  padding: 1rem;
  line-height: 1.6;
  display: flex;
  align-items: center;
  justify-content: center;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #fff;
  padding: 1.4rem;
  border-radius: 12px;
  min-width: 320px;
  max-width: 420px;
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.15);
}

.modal-content h3 {
  margin: 0 0 0.75rem;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--heading);
}

.modal-content textarea,
.modal-content input {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  font-size: 11px;
  margin-bottom: 0.8rem;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.modal-buttons button {
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0.4rem 0.9rem;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  background: #fff;
  color: var(--heading);
}

h1 {
  font-size: 10px;
  margin-bottom: 0.4rem;
  color: var(--heading);
  letter-spacing: 0.02em;
}

h2 {
  margin-top: 1rem;
  margin-bottom: 0.15rem;
  font-size: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding-bottom: 0.15rem;
  color: var(--heading);
}

section {
  margin-bottom: 0.25rem;
}

ul {
  padding-left: 1.4rem;
  list-style: none;
  margin-top: 0.15rem;
}

li {
  margin-bottom: 0.08rem;
}

label {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  line-height: 1;
}

.details {
  margin-left: 1.25rem;
  color: var(--muted);
  font-size: 10px;
}

ul.details {
  list-style: none;
  padding-left: 1.4rem;
  margin-top: 0.3rem;
}

.contact {
  font-size: 10px;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.memory-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 10px;
  color: var(--muted);
}

#memory-reset {
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  background: var(--soft-orange);
  color: #3f2a25;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 18px rgba(149, 79, 44, 0.35);
}

#memory-reset:focus-visible {
  outline: 2px solid #1d8bff;
  outline-offset: 2px;
}

.add-task-panel {
  margin-top: 2rem;
  padding: 1.2rem;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), var(--sunrise));
  border: 1px solid var(--border);
  box-shadow: var(--panel-shadow);
}

.section-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.section-actions input {
  flex: 1;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 10px;
}

.hero-action-panel {
  width: 46px;
  height: 46px;
  font-size: 10px;
  border-width: 2px;
}

.section-actions + .details {
  margin-bottom: 0;
}

.task-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.35rem 0.4rem;
  margin-bottom: 0.4rem;
}

button,
input[type="checkbox"] {
  touch-action: manipulation;
  text-transform: uppercase;
}

input[type="checkbox"] {
  width: 1em;
  height: 1em;
  min-width: 1em;
  min-height: 1em;
  accent-color: var(--heading);
  box-sizing: content-box;
}

@media (max-width: 640px) {
  body {
    padding: 0.75rem;
  }

  section {
    margin-bottom: 1rem;
    padding: 0 0.25rem;
  }

  .task-row {
    flex-direction: column;
    align-items: stretch;
  }

  .task-row button {
    width: 100%;
    text-align: center;
  }
}
