body {
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  background-color: #f5f5f5;
  color: #333;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#header {
  display: flex;
  align-items: center;
  padding: 10px 8px 10px 20px;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#logo {
  font-size: 2rem;
  font-weight: 700;
  margin-right: auto;
}

#settings-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s;
  border-radius: 8px;
}

#settings-btn:hover {
  color: #222;
}

#settings-btn svg {
  width: 24px;
  height: 24px;
  display: block;
}

/* ── Navigation Menu ────────────────────────────────────── */

#nav-menu-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

#nav-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s;
  border-radius: 8px;
}

#nav-menu-btn:hover {
  color: #222;
}

#nav-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 500;
  min-width: 200px;
  overflow: hidden;
}

#nav-menu.hidden {
  display: none;
}

#nav-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: #555;
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  transition: background 0.15s, color 0.15s;
}

#nav-menu a:hover {
  background: #f5f5f5;
  color: #111;
}

#nav-menu a.active {
  color: #4CAF50;
  font-weight: 700;
}

#nav-menu a.active svg {
  color: #4CAF50;
}

#settings {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#settings.hidden {
  display: none;
}

#settings-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  width: 80%;
  max-width: 300px;
  text-align: center;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  color: #999;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.modal-close:hover {
  color: #333;
  background: rgba(0, 0, 0, 0.07);
}

#project-name {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  box-sizing: border-box;
}

#theme-select,
#project-switch,
#voice-lang-select {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  box-sizing: border-box;
}

#save-name {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
}

#todo-list {
  flex: 1;
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
}

#todo-list li {
  display: flex;
  align-items: center;
  background: white;
  margin-bottom: 3px;
  padding: 10px;
}

.todo-checkbox {
  margin-right: 10px;
}

.todo-text {
  flex: 1;
}

.done {
  color: #ccc;
  text-decoration: line-through;
}

.editing {
  border: 2px solid #2196F3;
  box-shadow: inset 0 0 0 1px #2196F3;
  background: #e3f2fd;
}

#item-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#item-menu.hidden {
  display: none;
}

#item-menu-content {
  background: white;
  padding: 10px;
  border-radius: 10px;
  width: 80%;
  max-width: 300px;
  text-align: center;
  position: relative;
}

#delete-item {
  background-color: #f44336;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  margin: 5px;
}

#move-up {
  background-color: #2196F3;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  margin: 5px;
}

.more-btn {
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
  color: #666;
}

.more-btn svg {
  width: 24px;
  height: 24px;
}

.show-more-item {
  background: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.show-more-btn {
  display: block;
  width: 100%;
  padding: 10px;
  background: none;
  border: none;
  border-top: 1px solid #eee;
  cursor: pointer;
  color: #999;
  font-family: inherit;
  font-size: 0.85rem;
  text-align: center;
}

.show-more-btn:hover {
  background: #f5f5f5;
  color: #555;
}

#mic-hint {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.75rem;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  z-index: 100;
  line-height: 1.8;
  pointer-events: none;
}

#mic-hint.visible {
  display: block;
}

#mic-hint kbd {
  font-family: inherit;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.72rem;
}

#input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: white;
  margin: 3px 0;
  transition: outline 0.15s;
}

#input-wrapper.listening {
  outline: 2px solid rgba(244, 67, 54, 0.4);
  outline-offset: -2px;
}

#mic-btn {
  position: absolute;
  left: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  color: #bbb;
  z-index: 1;
  transition: color 0.2s;
}

#mic-btn:hover:not(:disabled) {
  color: #666;
}

#mic-btn.listening {
  color: #f44336;
  animation: mic-pulse 1.2s ease-in-out infinite;
}

#mic-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

@keyframes mic-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.45; transform: scale(0.82); }
}

#todo-input {
  flex: 1;
  padding: 15px 20px 15px 40px;
  border: 0;
  background: transparent;
  box-sizing: border-box;
  font-size: 1rem;
  outline: none;
}

#todo-list a {
  color: #1a73e8;
  text-decoration: underline;
}

.todo-tag {
  --tag-color: #666;
  display: inline-block;
  color: var(--tag-color);
  background-color: color-mix(in srgb, var(--tag-color) 12%, transparent);
  border: 1.5px solid var(--tag-color);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1.6;
  transition: background-color 0.15s;
}

.todo-tag:hover {
  background-color: color-mix(in srgb, var(--tag-color) 22%, transparent);
}

#tag-filter-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  background: #e8f0fe;
  font-size: 0.9rem;
}

#clear-tag-filter {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #666;
  padding: 0 4px;
}

#clear-tag-filter:hover {
  color: #333;
}

@media (min-width: 768px) {
  #todo-list {
    margin-bottom: 0;
  }
}

.app-version {
  margin-top: 16px;
  font-size: 11px;
  color: #999;
  text-align: center;
}