:root {
  --bg: #000;
  --panel: #111;
  --border: #333;
  --green: #00ff00;
  --cyan: #00ffff;
  --yellow: #ffff00;
  --red: #ff3300;
  --dim: #888;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--green);
  font-family: Arial, Helvetica, sans-serif;
}
a { color: var(--cyan); text-decoration: none; }
.topbar {
  position: fixed;
  inset: 0 0 auto;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #000;
  border-bottom: 2px solid #008b8b;
  z-index: 10;
}
.home { color: var(--yellow); font-weight: 800; letter-spacing: 1px; margin-right: auto; }
.page-content { padding: 58px 8px 72px; }
.panel {
  max-width: 760px;
  margin: 0 auto;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
}
h1 { margin: 0 0 10px; font-size: 22px; color: var(--yellow); }
input {
  width: 100%;
  min-height: 40px;
  background: #050505;
  color: var(--green);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px;
  font-size: 16px;
}
input:focus { outline: 1px solid var(--green); box-shadow: 0 0 8px #00ff0044; }
.btn {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 10px;
  font-weight: 800;
}
.btn-primary { background: #009999; color: #000; border-color: var(--cyan); }
.btn-success { background: #063; color: var(--green); border-color: var(--green); }
.btn-danger { background: var(--red); color: #fff; border-color: #f00; }
.btn-neutral { background: #666; color: #fff; }
.add-form, .edit-form, .todo-row, .filters { display: flex; gap: 6px; }
.add-form { margin-bottom: 10px; }
.filters { flex-wrap: wrap; margin: 10px 0; }
.filter {
  padding: 6px 10px;
  background: #003333;
  border: 1px solid var(--cyan);
  border-radius: 14px;
}
.filter.active { background: var(--yellow); color: #000; }
.todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.todo-row {
  align-items: center;
  padding: 6px;
  border: 1px solid var(--border);
  background: #080808;
}
.todo-row.done input { color: var(--dim); text-decoration: line-through; }
.todo-row.note-row {
  border-left: 3px solid var(--yellow);
  background: #0a0a05;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 8px;
}
.todo-row.note-row .task-summary { flex: 1; min-width: 0; }
.todo-row.note-row .task-thumb {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
  order: 1;
}
.todo-row.note-row .task-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.todo-row.note-row .task-note {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.todo-row.note-row .note-project { color: var(--yellow); opacity: 0.7; font-size: 11px; }
.note-detail textarea[name="note"] {
  font-size: 16px;
  line-height: 1.4;
  border: none;
  background: transparent;
  color: inherit;
  padding: 0;
  resize: none;
  overflow: hidden;
  font-family: inherit;
}
/* Hide caret when unfocused on mobile */
@media (pointer: coarse) {
  .note-detail textarea[name="note"]:not(:focus) {
    caret-color: transparent;
  }
}
.note-detail textarea[name="note"]:focus {
  outline: none;
  background: transparent;
  box-shadow: none;
  caret-color: auto;
}
.inline-form { display: inline; }
.edit-form { flex: 1; }
.toggle-form { flex: 0 0 auto; }
.empty, .stamp { color: var(--dim); text-align: center; }
.alert { margin: 8px 0; padding: 8px; border: 1px solid var(--red); background: #300; color: var(--red); }
.bottom-nav {
  position: fixed;
  inset: auto 0 0;
  display: flex;
  justify-content: space-around;
  background: #080808;
  border-top: 2px solid #008b8b;
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
}
.bottom-nav a { display: grid; gap: 1px; text-align: center; font-size: 12px; }

.search-form { display: flex; gap: 6px; margin: 6px 0; align-items: center; }
.search-form input[name="q"] { flex: 1; }

/* New task highlight */
@keyframes task-highlight {
  0% { background: #004400; box-shadow: 0 0 12px #00ff0044; border-color: var(--green); }
  100% { background: var(--panel); box-shadow: none; border-color: var(--border); }
}
.todo-row.new-task {
  animation: task-highlight 3s ease-out;
}
.todo-row.new-task-glow {
  border-color: var(--green);
  box-shadow: 0 0 8px #00ff0022;
  transition: border-color 1s, box-shadow 1s;
}

.task-summary { flex: 1; display: grid; gap: 2px; min-width: 0; }
.task-title {
  color: var(--green);
  font-weight: 700;
  word-break: break-word;
}
.todo-row.done .task-title { color: var(--dim); text-decoration: line-through; }
.todo-row.doing { border-left: 3px solid var(--yellow); }
.todo-row.doing .task-title { color: var(--yellow); }
/* Search highlight */
.task-title mark,
.task-note mark,
.note-project mark {
  background: rgba(255, 255, 0, 0.3);
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}
.btn-doing {
  min-height: 32px;
  padding: 2px 8px;
  font-size: 13px;
  background: #1a1a00;
  color: var(--dim);
  border: 1px solid #444;
  border-radius: 4px;
  cursor: pointer;
}
.btn-doing:hover { background: #222; color: var(--yellow); border-color: var(--yellow); }
.btn-doing.active {
  background: #1a1a00;
  color: var(--yellow);
  border-color: var(--yellow);
}
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--dim); }
.due { color: var(--yellow); }

.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: #022;
  border: 1px solid var(--cyan);
  border-radius: 12px;
  color: var(--cyan);
  font-size: 12px;
}
.chip-x {
  background: transparent;
  border: 0;
  color: var(--cyan);
  cursor: pointer;
  padding: 0 2px;
  font-size: 12px;
  line-height: 1;
}
.chip-x:hover { color: var(--red); }

.task-detail h1 { margin-bottom: 14px; }
.detail-form { display: grid; gap: 12px; }
.field { display: grid; gap: 4px; }
.field span { color: var(--cyan); font-size: 13px; letter-spacing: 0.5px; }
.field textarea {
  width: 100%;
  min-height: 120px;
  background: #050505;
  color: var(--green);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px;
  font: inherit;
  resize: vertical;
}
.field textarea:focus { outline: 1px solid var(--green); box-shadow: 0 0 8px #00ff0044; }

.tag-editor {
  display: grid;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px;
  background: #050505;
}
.chip-list { display: flex; flex-wrap: wrap; gap: 4px; min-height: 22px; }
.tag-input {
  border: 1px dashed var(--border);
  background: transparent;
}

.picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  display: none;
  flex-direction: column;
  padding: 8px;
  box-sizing: border-box;
}
.picker-overlay.open { display: flex; }
.picker-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}
.picker-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.picker-search {
  flex: 1;
  border-color: var(--green) !important;
  padding: 8px !important;
  font-size: 16px !important;
}
.picker-list {
  flex: 1;
  overflow: auto;
  border: 1px solid var(--green);
  background: #050505;
}
.picker-item, .picker-create {
  display: flex;
  width: 100%;
  text-align: left;
  align-items: center;
  gap: 8px;
  background: #050505;
  color: var(--green);
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.picker-item:hover, .picker-item:focus,
.picker-create:hover, .picker-create:focus { background: #003333; outline: none; }
.picker-item.active { background: #022; color: var(--cyan); }
.picker-name { flex: 1; word-break: break-word; }
.picker-count { color: var(--dim); font-size: 12px; }
.picker-mark { color: var(--yellow); font-weight: 800; }
.picker-create { color: var(--yellow); border-bottom: 1px solid var(--cyan); }
.picker-empty { padding: 12px; color: var(--dim); text-align: center; }
.picker-close { background: #330000; color: #f66; border-color: #f66; }
body.modal-open { overflow: hidden; touch-action: none; }

.detail-actions, .detail-side-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.detail-side-actions { border-top: 1px dashed var(--border); padding-top: 10px; }
.inline-form { display: inline-flex; }

.task-detail h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.save-status {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 10px;
  transition: opacity 0.2s ease;
  min-width: 0;
}
.save-status[data-state="idle"] { opacity: 0; }
.save-status[data-state="saving"] {
  color: var(--cyan);
  background: #022;
  border: 1px solid var(--cyan);
}
.save-status[data-state="saved"] {
  color: var(--green);
  background: #032;
  border: 1px solid var(--green);
}
.save-status[data-state="error"] {
  color: #fff;
  background: var(--red);
  border: 1px solid #f00;
}

.row-delete { flex: 0 0 auto; }
@media (max-width: 520px) {
  .todo-row { align-items: stretch; }
}

.due {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: #330;
  border: 1px solid var(--yellow);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--yellow);
  white-space: nowrap;
}
.due.overdue { background: #300; border-color: var(--red); color: var(--red); }
.due.today { background: #330; border-color: var(--yellow); color: var(--yellow); }
.due.tomorrow { background: #033; border-color: var(--cyan); color: var(--cyan); }
.due.future { background: #030; border-color: var(--green); color: var(--green); }

.add-form input[name="title"] { flex: 1; min-width: 0; }
.add-form input[type="date"] { width: auto; min-width: 130px; flex: 0 0 auto; }

.task-thumb {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}
.task-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.todo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 6px;
  border: 1px solid var(--border);
  background: #080808;
  gap: 6px;
}
.photos-section {
  margin: 20px 0;
  padding: 12px;
  border: 1px solid var(--border);
  background: #0a0a0a;
  border-radius: 4px;
}
.photos-section h3 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--yellow);
}

/* Sub-tasks */
.subtasks-section {
  margin: 20px 0;
  padding: 12px;
  border: 1px solid var(--border);
  background: #0a0a0a;
  border-radius: 4px;
}
.subtasks-section h3 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--yellow);
}
.subtask-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
}
.subtask-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #222;
}
.subtask-item.done .subtask-title {
  text-decoration: line-through;
  color: var(--dim);
}
.subtask-title {
  flex: 1;
  cursor: pointer;
  word-break: break-word;
}
.subtask-title[href] {
  color: var(--yellow);
  text-decoration: none;
}
.subtask-title[href]:hover {
  text-decoration: underline;
}
.subtask-nested-badge {
  font-size: 10px;
  color: var(--yellow);
  opacity: 0.8;
  margin-left: 4px;
  white-space: nowrap;
}
.subtask-parent-link {
  margin-bottom: 12px;
}
.subtask-parent-link a {
  color: var(--yellow);
  text-decoration: none;
  font-size: 14px;
}
.subtask-parent-link a:hover {
  text-decoration: underline;
}
.subtask-empty {
  padding: 8px 0;
  font-size: 14px;
}
.add-subtask-form {
  display: flex;
  gap: 6px;
}
.add-subtask-form input {
  flex: 1;
}
.subtask-badge {
  display: inline-block;
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #1a1a1a;
  color: #aaa;
  margin-left: 4px;
  vertical-align: middle;
  font-weight: 600;
}
.subtask-badge.done {
  background: #063;
  color: #5f5;
}
.subtask-edit-input {
  background: #050505;
  color: var(--green);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 14px;
}

.photos-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}
.photo-item {
  position: relative;
  width: calc(50% - 5px);
  max-width: 200px;
  background: #111;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.photo-item img {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
}
.photo-item .btn-sm {
  position: absolute;
  top: 4px;
  right: 4px;
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
  opacity: 0.8;
}
.photo-item .btn-sm:hover { opacity: 1; }
.camera-upload {
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}
.camera-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.btn-secondary {
  background: #0066cc;
  color: #fff;
  border-color: #08f;
}
.btn-sm {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 12px;
}
.upload-status {
  margin-top: 8px;
  font-size: 13px;
  min-height: 20px;
}
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-blue { color: var(--cyan); }
.text-dim { color: var(--dim); }
.task-note {
  color: #c0a060;
  font-size: 13px;
  margin-top: 2px;
  word-break: break-word;
  white-space: pre-wrap;
  max-height: none;
  overflow: visible;
}
.todo-row.note-row .task-note {
  color: #a09060;
  font-size: 13px;
}
.todo-row.done .task-note { color: #5a5030; }

.priority-form {
  display: flex;
  gap: 0;
}
.btn-priority {
  min-height: 24px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: #111;
  color: var(--dim);
  cursor: pointer;
}
.btn-priority:hover { color: var(--green); border-color: var(--green); }
.btn-priority.p1.active { background: #cc0000; color: #fff; border-color: #ff3333; }
.btn-priority.p2.active { background: #cc6600; color: #fff; border-color: #ff9900; }
.btn-priority.p3.active { background: #006600; color: #fff; border-color: #33cc33; }

/* Priority section - task detail */
.priority-section {
  margin: 20px 0;
  padding: 12px;
  border: 1px solid var(--border);
  background: #0a0a0a;
  border-radius: 4px;
}
.priority-section h3 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--yellow);
}
.detail-priority-form {
  display: grid;
  gap: 6px;
}
.btn-priority-lg {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  background: #111;
  color: var(--dim);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
  text-align: left;
}
.btn-priority-lg:hover {
  background: #1a1a1a;
  color: var(--green);
}
.btn-priority-lg .priority-icon {
  font-size: 16px;
}
.btn-priority-lg.p1 { border-left-color: #ff3333; }
.btn-priority-lg.p2 { border-left-color: #ff9900; }
.btn-priority-lg.p3 { border-left-color: #33cc33; }
.btn-priority-lg.p1.active {
  background: #2a0000;
  color: #ff6666;
  border-color: #ff3333;
  border-left-color: #ff3333;
  box-shadow: 0 0 12px #ff000033;
}
.btn-priority-lg.p2.active {
  background: #2a1500;
  color: #ffaa33;
  border-color: #ff9900;
  border-left-color: #ff9900;
  box-shadow: 0 0 12px #ff990033;
}
.btn-priority-lg.p3.active {
  background: #002a00;
  color: #66ff66;
  border-color: #33cc33;
  border-left-color: #33cc33;
  box-shadow: 0 0 12px #33cc3333;
}

/* Quick due date buttons */
.quick-due-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 8px;
}
.btn-quick-due {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: #111;
  color: var(--dim);
  cursor: pointer;
  border-radius: 14px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-quick-due:hover {
  background: #003333;
  color: var(--cyan);
  border-color: var(--cyan);
}
.btn-quick-due.active {
  background: #003333;
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 8px #00ffff33;
}
.btn-quick-due.clear {
  color: #999;
}
.btn-quick-due.clear:hover {
  background: #330000;
  color: var(--red);
  border-color: var(--red);
}

/* Photo viewer overlay */
.photo-viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  -ms-touch-action: none;
  overscroll-behavior: contain;
  user-select: none;
  -webkit-user-select: none;
}
.photo-viewer-overlay .photo-viewer-img {
  max-width: 95vw;
  max-height: 85vh;
  object-fit: contain;
  cursor: grab;
  transition: none;
  transform-origin: center center;
  touch-action: none;
  -webkit-user-drag: none;
  pointer-events: none; /* let the overlay handle pointer events */
  will-change: transform;
}
.photo-viewer-overlay.dragging .photo-viewer-img {
  cursor: grabbing;
}
.photo-viewer-controls {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  max-width: 96vw;
}
.photo-viewer-controls .btn {
  min-width: 40px;
  min-height: 40px;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
@media (max-width: 380px) {
  .photo-viewer-controls .btn {
    min-width: 36px;
    min-height: 36px;
    font-size: 16px;
  }
  .btn-save-rotation {
    font-size: 12px !important;
    padding: 0 10px !important;
  }
}
.btn-save-rotation {
  font-size: 14px !important;
  background: #063 !important;
  color: var(--green) !important;
  border-color: var(--green) !important;
  padding: 0 16px !important;
  white-space: nowrap;
}
body.photo-viewer-open {
  overflow: hidden;
}

/* Undone page — ultra compact */
.undone-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.undone-task {
  border-bottom: 1px solid var(--border);
  padding: 2px 4px;
  margin: 0;
}
.undone-task:last-child {
  border-bottom: none;
}
.undone-task h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
}
.undone-task h3 a {
  color: var(--green);
  text-decoration: none;
}
.undone-task .task-meta {
  margin: 0;
  font-size: 11px;
  line-height: 1.1;
}
.undone-task .subtask-list {
  margin: 0;
  padding: 0 0 0 12px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.undone-task .subtask-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  line-height: 1.2;
  margin: 0;
  padding: 0;
}
.undone-task .subtask-item .btn-sm {
  min-height: 20px;
  min-width: 20px;
  padding: 0 2px;
  font-size: 11px;
}
.undone-task .subtask-item.done .subtask-title {
  text-decoration: line-through;
  opacity: 0.5;
}
.undone-task .task-thumb {
  display: inline-block;
  vertical-align: middle;
  margin: 0 4px 0 0;
  width: 28px;
  height: 28px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.undone-task .task-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Undo toast */
.undo-toast {
  position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--cyan); color: var(--green);
  padding: 10px 16px; border-radius: 8px; display: flex; align-items: center; gap: 12px;
  z-index: 1000; opacity: 0; transition: opacity 0.3s; pointer-events: none;
  font-size: 14px; max-width: 90vw;
}
.undo-toast.visible { opacity: 1; pointer-events: auto; }
.undo-toast .btn-sm { padding: 4px 12px; font-size: 13px; }

/* NLP Date Hint */
.nlp-date-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px 0 10px;
  padding: 6px 10px;
  background: #022;
  border: 1px solid var(--cyan);
  border-radius: 6px;
  font-size: 13px;
  color: var(--cyan);
  animation: nlp-hint-in 0.2s ease-out;
}
.nlp-date-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.nlp-date-text {
  flex: 1;
  word-break: break-word;
  cursor: pointer;
}
.nlp-date-clear {
  background: transparent;
  border: 1px solid var(--cyan);
  border-radius: 4px;
  color: var(--cyan);
  font-size: 12px;
  padding: 2px 6px;
  cursor: pointer;
  flex-shrink: 0;
  min-height: 24px;
}
.nlp-date-clear:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
@keyframes nlp-hint-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Reminders --- */
.reminders-section { margin: 14px 0; padding: 10px; border: 1px solid var(--border); background: #0a0a0a; }
.reminders-section h3 { margin: 0 0 8px; font-size: 15px; color: var(--yellow); }
.reminder-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.reminder-item { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px; border: 1px solid #222; font-size: 13px; }
.reminder-item.sent { opacity: 0.45; text-decoration: line-through; }
.add-reminder-form { display: flex; gap: 4px; }
.add-reminder-form input { flex: 1; }
.btn-sm { min-height: 28px; padding: 2px 8px; font-size: 12px; background: #222; color: var(--cyan); border: 1px solid #444; border-radius: 4px; cursor: pointer; }
.btn-sm:hover { background: #333; }

/* --- Project Sidebar --- */
.project-sidebar {
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: #0a0a0a;
}
.project-sidebar h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--yellow);
}
.project-create {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}
.project-create input {
  flex: 1;
  min-height: 30px;
  padding: 4px 8px;
  font-size: 13px;
}
.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 13px;
}
.project-item:hover { border-color: #333; background: #111; }
.project-item.active {
  border-color: var(--yellow);
  background: #1a1a00;
}
.project-item a {
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  text-decoration: none;
}
.project-item a:hover { color: var(--cyan); }
.project-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* --- Project Selector (Detail Page) --- */
.project-section {
  margin: 14px 0;
  padding: 10px;
  border: 1px solid var(--border);
  background: #0a0a0a;
}
.project-section h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--yellow);
}
.detail-project-form {
  display: flex;
  gap: 6px;
  align-items: center;
}
.detail-project-form select {
  flex: 1;
  min-height: 36px;
  background: #050505;
  color: var(--green);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 14px;
}

/* --- Project Filter Link (sidebar arrow) --- */
.project-filter-link {
  padding: 2px 6px;
  color: var(--dim);
  text-decoration: none;
  font-size: 12px;
  border: 1px solid #333;
  border-radius: 3px;
  margin-left: 4px;
}
.project-filter-link:hover { color: var(--cyan); border-color: var(--cyan); }

/* --- Projects Dashboard --- */
.project-create-inline {
  display: flex;
  gap: 6px;
  margin: 10px 0 16px;
  flex-wrap: wrap;
}
.project-create-inline input {
  flex: 1;
  min-height: 36px;
  min-width: 120px;
}
.project-cards {
  display: grid;
  gap: 8px;
}
.project-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0a0a0a;
}
.project-card:hover {
  border-color: var(--yellow);
  background: #111;
}
.project-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--green);
  margin-bottom: 4px;
}
.project-card-name { font-weight: 600; }
.project-note-line { color: var(--dim); font-size: 13px; }
.project-card-tasks {
  color: var(--dim);
  font-size: 12px;
  margin-top: 4px;
  margin-left: 22px;
}

/* --- Project Detail Page --- */
.project-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.project-detail-header h1 {
  flex: 1;
  margin: 0;
  font-size: 18px;
}
.project-detail-actions {
  display: flex;
  gap: 4px;
}
.editable-name { cursor: pointer; }
.editable-name:hover { color: var(--yellow); }

.project-detail-note {
  margin: 12px 0;
  padding: 10px;
  border: 1px solid var(--border);
  background: #0a0a0a;
}
.project-detail-note h3 { margin: 0 0 4px; font-size: 14px; color: var(--yellow); }
.project-detail-note p { margin: 0 0 8px; font-size: 14px; }

#rename-form, #note-edit-form { margin-bottom: 10px; }
#rename-form input, #note-edit-form textarea {
  width: 100%;
  margin-bottom: 4px;
}
#note-edit-form textarea { color: var(--green); }

.project-task-section { margin-top: 16px; }
.project-task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.project-task-header h3 { margin: 0; font-size: 15px; color: var(--yellow); }
.project-stats { font-size: 12px; color: var(--dim); }

/* --- Keyboard Focus --- */
.todo-row:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: -2px;
  z-index: 1;
}
.todo-row.selected {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
  background: #0a1a1a;
}

/* --- Command Palette --- */
.palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}
.palette-modal {
  width: 100%;
  max-width: 540px;
  background: #0d0d0d;
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  animation: palette-in 0.1s ease-out;
}
@keyframes palette-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.palette-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 16px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: #080808;
  color: var(--green);
}
.palette-input::placeholder { color: var(--dim); }
.palette-input:focus { outline: none; background: #111; }
.palette-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}
.palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid #111;
}
.palette-item.highlighted {
  background: #1a1a00;
  color: var(--yellow);
}
.palette-label { display: flex; align-items: center; gap: 8px; }
.palette-item kbd {
  font-size: 11px;
  padding: 2px 6px;
  background: #222;
  border: 1px solid #444;
  border-radius: 3px;
  color: var(--dim);
}
.palette-item.highlighted kbd { color: var(--yellow); border-color: var(--yellow); }
.palette-footer {
  padding: 6px 14px;
  font-size: 11px;
  color: var(--dim);
  border-top: 1px solid var(--border);
}

/* --- Help Modal --- */
.help-modal { max-width: 600px; max-height: 80vh; overflow-y: auto; }
.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.help-header h2 { margin: 0; font-size: 16px; color: var(--yellow); }
.help-body { padding: 12px 16px; }
.help-section { margin-bottom: 16px; }
.help-section h3 { margin: 0 0 6px; font-size: 13px; color: var(--yellow); text-transform: uppercase; letter-spacing: 0.5px; }
.help-table { width: 100%; border-collapse: collapse; }
.help-table td { padding: 4px 8px; font-size: 13px; border-bottom: 1px solid #111; }
.help-table td:first-child { width: 140px; }
.help-table kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  background: #222;
  border: 1px solid #444;
  border-radius: 3px;
  color: var(--green);
}

/* --- Shortcut badge on project detail filter link --- */
.project-detail-footer-link { display: block; text-align: center; margin-top: 10px; font-size: 13px; color: var(--dim); }
.project-detail-footer-link a { color: var(--cyan); }

/* --- Help Page --- */
.help-page { max-width: 700px; }
.help-page h1 { margin-bottom: 4px; }
.help-page .text-dim { margin-bottom: 20px; font-size: 13px; }
.help-page .text-dim kbd {
  display: inline-block;
  padding: 1px 5px;
  font-size: 11px;
  background: #222;
  border: 1px solid #444;
  border-radius: 3px;
  color: var(--green);
}
.help-page .help-section {
  margin-bottom: 20px;
  padding: 12px;
  border: 1px solid var(--border);
  background: #0a0a0a;
}
.help-page .help-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.help-page .help-table { width: 100%; border-collapse: collapse; }
.help-page .help-table td {
  padding: 5px 8px;
  font-size: 13px;
  border-bottom: 1px solid #111;
  vertical-align: top;
}
.help-page .help-table td:first-child { width: 160px; white-space: nowrap; }
.help-page .help-table kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 12px;
  background: #222;
  border: 1px solid #444;
  border-radius: 3px;
  color: var(--green);
}

