/* === CSS Variables === */
:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-hover: #fafafa;
  --text: #333333;
  --text-secondary: #888888;
  --text-muted: #bbbbbb;
  --border: #f0f0f0;
  --input-bg: #ffffff;
  --input-border: #dddddd;
  --accent: #4a90d9;
  --accent-hover: #3a7bc8;
  --accent-ring: rgba(74, 144, 217, 0.12);
  --accent-light: #f0f6ff;
  --danger: #e55;
  --danger-bg: #fef0f0;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  --modal-backdrop: rgba(0, 0, 0, 0.35);
  --drag-handle: #cccccc;
  --checkbox-border: #d0d0d0;
  --priority-0: #ffffff;
  --priority-1: #edf5fc;
  --priority-2: #e1eff9;
  --priority-3: #edeef2;
  --priority-4: #fcf0e3;
  --priority-5: #fde8d5;
  --ghost-bg: #e8f0fe;
  --empty-color: #cccccc;
  --btn-restore-border: #e0e0e0;
  --btn-restore-hover-bg: #f0f6ff;
}

body.dark {
  --bg: #1a1a1d;
  --surface: #252528;
  --surface-hover: #2d2d30;
  --text: #e0e0e0;
  --text-secondary: #999999;
  --text-muted: #666666;
  --border: #3a3a3e;
  --input-bg: #2d2d30;
  --input-border: #444448;
  --accent: #5a9fe0;
  --accent-hover: #4a8fd0;
  --accent-ring: rgba(90, 159, 224, 0.15);
  --accent-light: #1e2d3d;
  --danger: #f66;
  --danger-bg: #3d2020;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  --modal-backdrop: rgba(0, 0, 0, 0.55);
  --drag-handle: #555555;
  --checkbox-border: #555555;
  --priority-0: #252528;
  --priority-1: #1e2832;
  --priority-2: #1f2a33;
  --priority-3: #23252a;
  --priority-4: #292620;
  --priority-5: #2d241c;
  --ghost-bg: #1e3040;
  --empty-color: #555555;
  --btn-restore-border: #444448;
  --btn-restore-hover-bg: #1e2d3d;
}

/* === Reset === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 560px;
  overflow-x: hidden;
}

/* === Header === */
header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.header-row h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.count {
  margin-top: 0.3rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  min-height: 1.3em;
}

/* Theme toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--input-border);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1;
}

.theme-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--text-muted);
}

/* === Tabs === */
.tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.25rem;
}

.tab-btn {
  background: none;
  border: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.5rem 1.5rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* === Add form === */
.add-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.add-form input {
  flex: 1;
  padding: 0.7rem 1rem;
  font-size: 16px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  outline: none;
  background: var(--input-bg);
  color: var(--text);
  transition: border-color 0.15s;
}

.add-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.add-form button {
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
  font-weight: 500;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.add-form button:hover {
  background: var(--accent-hover);
}

/* === Todo list === */
.todo-list {
  list-style: none;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.todo-item:last-child {
  border-bottom: none;
}

.todo-item:hover {
  background: var(--surface-hover);
}

/* Priority background colors */
.priority-0 { background: var(--priority-0); }
.priority-1 { background: var(--priority-1); }
.priority-2 { background: var(--priority-2); }
.priority-3 { background: var(--priority-3); }
.priority-4 { background: var(--priority-4); }
.priority-5 { background: var(--priority-5); }

/* Drag handle */
.drag-handle {
  cursor: grab;
  color: var(--drag-handle);
  font-size: 1.1rem;
  user-select: none;
  flex-shrink: 0;
  padding: 0 2px;
}

.drag-handle:active {
  cursor: grabbing;
}

/* Checkbox */
.todo-item input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--checkbox-border);
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  background: transparent;
}

.todo-item input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.todo-item input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 6px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Text */
.todo-text {
  flex: 1;
  font-size: 0.95rem;
  word-break: break-word;
  overflow-wrap: anywhere;
  cursor: default;
  transition: color 0.15s;
  color: var(--text);
  min-width: 0;
}

.todo-item.completed .todo-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Todo body — wraps row + optional notes */
.todo-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.todo-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

/* Notes toggle */
.note-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.6rem;
  padding: 0.15rem 0.3rem;
  border-radius: 3px;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}

.note-toggle:hover {
  color: var(--accent);
  background: var(--accent-light);
}

/* Notes display */
.todo-notes {
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 0.35rem 0 0.15rem 0;
  margin: 0;
  line-height: 1.45;
  word-break: break-word;
}

/* Inline edit input */
.todo-text input {
  width: 100%;
  font-size: 16px;
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  outline: none;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--text);
}

/* Edit button */
.edit-btn {
  background: none;
  border: none;
  color: var(--drag-handle);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}

.edit-btn:hover {
  color: var(--accent);
  background: var(--accent-light);
}

/* Delete button */
.delete-btn {
  background: none;
  border: none;
  color: var(--drag-handle);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}

.delete-btn:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

/* Priority select dropdown */
.priority-select {
  appearance: none;
  background: transparent;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  padding: 0.15rem 1.2rem 0.15rem 0.35rem;
  font-size: 0.75rem;
  font-family: inherit;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23bbb'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.3rem center;
  transition: background-color 0.2s;
}

.priority-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-radius: 4px;
}

/* Drag ghost */
.sortable-ghost {
  opacity: 0.4;
  background: var(--ghost-bg) !important;
}

.sortable-chosen {
  background: var(--surface) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* === Archive items === */
.archive-item .todo-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.archive-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.archive-item .todo-text .archive-date {
  text-decoration: none;
}

/* Restore button */
.restore-btn {
  background: none;
  border: 1px solid var(--btn-restore-border);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 5px;
  flex-shrink: 0;
  transition: all 0.15s;
  font-family: inherit;
}

.restore-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--btn-restore-hover-bg);
}

/* Archive footer */
.archive-footer {
  margin-top: 1rem;
  text-align: center;
}

.clear-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  font-family: inherit;
}

.clear-btn:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

.hidden {
  display: none;
}

/* Ensure hidden overrides any display property (modal-overlay, etc.) */
.modal-overlay.hidden {
  display: none;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--empty-color);
  font-size: 0.9rem;
}

/* === Settings === */
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow-x: hidden;
}

.settings-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  flex-shrink: 0;
}

.site-name-input {
  width: 180px;
  padding: 0.45rem 0.6rem;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  outline: none;
  background: var(--input-bg);
  color: var(--text);
  transition: border-color 0.15s;
}

.site-name-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.site-name-input[readonly] {
  background: var(--bg);
  color: var(--text-secondary);
  cursor: default;
}

.lang-btns {
  display: flex;
  gap: 0.4rem;
}

.lang-btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-family: inherit;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.lang-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lang-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal {
  background: var(--surface);
  border-radius: 12px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.modal-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.modal-label:first-child {
  margin-top: 0;
}

.modal-input,
.modal-select,
.modal-textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  outline: none;
  background: var(--input-bg);
  color: var(--text);
  transition: border-color 0.15s;
}

.modal-input:focus,
.modal-select:focus,
.modal-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.modal-textarea {
  resize: vertical;
  min-height: 80px;
}

.modal-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
  cursor: pointer;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

.btn-cancel {
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.btn-cancel:hover {
  background: var(--surface-hover);
}

.btn-save {
  padding: 0.6rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.btn-save:hover {
  background: var(--accent-hover);
}

/* === Login overlay === */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.login-overlay.hidden {
  display: none;
}

.login-card {
  background: var(--surface);
  border-radius: 12px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  padding: 2rem;
}

.login-card h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.25rem;
  text-align: center;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.login-form label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 0.3rem;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  outline: none;
  background: var(--input-bg);
  color: var(--text);
  transition: border-color 0.15s;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.login-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.login-remember label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  margin-top: 0;
}

.login-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin: 0.2rem 0;
}

.login-error.hidden {
  display: none;
}

.login-btn {
  margin-top: 0.5rem;
  width: 100%;
  padding: 0.7rem;
  font-size: 1rem;
  font-weight: 500;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.login-btn:hover {
  background: var(--accent-hover);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* === User management in settings === */
.user-info-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.user-info-detail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-info-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.role-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 10px;
  background: var(--accent-light);
  color: var(--accent);
}

.role-badge.admin {
  background: #fef0e6;
  color: #d4852a;
}

body.dark .role-badge.admin {
  background: #332818;
  color: #e0a040;
}

.logout-btn {
  width: 100%;
  padding: 0.6rem;
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}

.logout-btn:hover {
  opacity: 0.85;
}

.user-mgmt-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.user-mgmt-section h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.user-list {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--input-bg);
}

.user-row:last-child {
  border-bottom: none;
}

.user-row-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text);
}

.user-actions {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.user-actions .delete-btn,
.user-actions .edit-btn {
  font-size: 1rem;
}

.user-actions .new-pass-input {
  width: 120px;
  padding: 0.3rem 0.5rem;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  outline: none;
  background: var(--input-bg);
  color: var(--text);
}

.user-actions .new-pass-input:focus {
  border-color: var(--accent);
}

.user-actions .save-pass-btn,
.user-actions .cancel-pass-btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

.add-user-form {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.add-user-form input,
.add-user-form select {
  padding: 0.4rem 0.5rem;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  outline: none;
  background: var(--input-bg);
  color: var(--text);
  flex: 1;
  min-width: 80px;
}

.add-user-form input:focus,
.add-user-form select:focus {
  border-color: var(--accent);
}

.add-user-form button {
  flex: 0 0 auto;
}

/* === Export / Import === */
.export-import-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.export-btns {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* === Toggle switch === */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--input-border);
  border-radius: 24px;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* === Confirm dialog === */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: var(--modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 250;
  padding: 1rem;
}

.confirm-overlay.hidden {
  display: none;
}

.confirm-card {
  background: var(--surface);
  border-radius: 12px;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  text-align: center;
}

.confirm-card p {
  font-size: 0.95rem;
  color: var(--text);
  margin: 0 0 1.25rem 0;
  line-height: 1.5;
}

.confirm-buttons {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.btn-danger {
  background: var(--danger) !important;
}

.btn-danger:hover {
  opacity: 0.85;
}

/* === Toast === */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 300;
  animation: toast-in 0.25s ease;
  font-family: inherit;
  max-width: 90vw;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* === Responsive — mobile === */
@media (max-width: 480px) {
  body {
    padding: 1rem 0.75rem;
  }

  .header-row h1 {
    font-size: 1.4rem;
  }

  .add-form {
    flex-direction: column;
  }

  .add-form button {
    width: 100%;
  }

  .todo-item {
    padding: 0.7rem 0.85rem;
  }

  .archive-item .todo-text {
    font-size: 0.9rem;
  }

  .modal {
    max-width: none;
    border-radius: 12px 12px 0 0;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
  }

  .modal-body {
    padding: 1rem 1.25rem;
  }

  .modal-header,
  .modal-footer {
    padding: 0.85rem 1.25rem;
  }
}
