:root {
  --bg:         #0f0e0c;
  --surface:    #161512;
  --border:     #2c2a27;
  --text:       #e6e2d9;
  --muted:      #857f75;
  --accent:     #c8a84b;
  --accent-dim: rgba(200, 168, 75, 0.08);
  --green:      #4a9470;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

/* ── LOGIN ─────────────────────────────── */

#login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card { width: 100%; max-width: 320px; }

.login-logo {
  font-family: 'Newsreader', serif;
  font-size: 34px;
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 6px;
}

.login-sub {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 40px;
}

.login-input {
  display: block;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  padding: 11px 13px;
  outline: none;
  transition: border-color 0.15s;
  margin-bottom: 8px;
}

.login-input:focus { border-color: var(--accent); }
.login-input::placeholder { color: var(--muted); }

.login-btn {
  display: block;
  width: 100%;
  margin-top: 4px;
  background: var(--accent);
  border: none;
  border-radius: 2px;
  color: var(--bg);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 12px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.login-btn:hover    { opacity: 0.84; }
.login-btn:disabled { opacity: 0.5; cursor: default; }

.login-error {
  font-size: 11px;
  color: #c44;
  text-align: center;
  margin-top: 13px;
  min-height: 16px;
  letter-spacing: 0.04em;
}

/* ── APP ────────────────────────────────── */

#app-view { display: none; min-height: 100vh; }

/* ── HEADER ─────────────────────────────── */

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 48px;
  gap: 14px;
}

.logo {
  font-family: 'Newsreader', serif;
  font-size: 18px;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}

nav { display: flex; gap: 0; flex: 1; }

nav button {
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

nav button.active             { color: var(--text); border-bottom-color: var(--accent); }
nav button:hover:not(.active) { color: var(--text); }

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-email {
  font-size: 10px;
  color: var(--muted);
  display: none;
}

@media (min-width: 540px) { .header-email { display: block; } }

.signout-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 0;
  cursor: pointer;
  transition: color 0.15s;
}

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

/* ── FOCUS STRIP ────────────────────────── */

#focus-strip {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--accent-dim);
}

.focus-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: blink 2.4s ease-in-out infinite;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.now-label {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  flex-shrink: 0;
}

.focus-text {
  flex: 1;
  font-family: 'Newsreader', serif;
  font-size: 14px;
  font-weight: 300;
  font-style: italic;
}

.focus-parent { font-size: 10px; color: var(--muted); flex-shrink: 0; }

.focus-clear {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  padding: 0;
  transition: color 0.15s;
}

.focus-clear:hover { color: var(--text); }

/* ── MAIN ───────────────────────────────── */

main {
  padding: 26px 20px 80px;
}

/* Goals view stays narrow and centered */
#view-goals {
  max-width: 620px;
  margin: 0 auto;
}

.view        { display: none; }
.view.active { display: block; }

.section-title {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ── ADD ROW ────────────────────────────── */

.add-row { display: flex; gap: 8px; margin-bottom: 20px; }

.add-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s;
}

.add-input:focus       { border-color: var(--accent); }
.add-input::placeholder { color: var(--muted); }

.add-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 14px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.add-btn:hover { color: var(--text); border-color: var(--muted); }

/* ── GOALS ──────────────────────────────── */

.goal-item {
  border: 1px solid var(--border);
  border-radius: 2px;
  margin-bottom: 6px;
  overflow: hidden;
}

.goal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 13px;
  cursor: pointer;
  transition: background 0.12s;
}

.goal-header:hover { background: var(--surface); }

.goal-title {
  flex: 1;
  font-family: 'Newsreader', serif;
  font-size: 15px;
  font-weight: 300;
  font-style: italic;
}

.goal-progress { font-size: 10px; color: var(--muted); flex-shrink: 0; }

.goal-del {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  opacity: 0;
  transition: opacity 0.15s;
}

.goal-header:hover .goal-del { opacity: 1; }

.chevron {
  color: var(--muted);
  font-size: 9px;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.goal-item.open .chevron { transform: rotate(180deg); }

.goal-body {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 10px 13px 12px;
}

.goal-item.open .goal-body { display: block; }

/* ── TASKS ──────────────────────────────── */

.task-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.task-item:last-of-type { border-bottom: none; }

.task-item.focused {
  margin: 0 -13px;
  padding: 7px 13px;
  background: var(--accent-dim);
}

.tcheck {
  width: 12px;
  height: 12px;
  border: 1px solid var(--muted);
  border-radius: 2px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.tcheck.done               { background: var(--green); border-color: var(--green); }
.tcheck.done::after        { content: '✓'; font-size: 7px; color: #fff; line-height: 1; }

.task-text      { flex: 1; font-size: 12px; color: var(--text); }
.task-text.done { color: var(--muted); text-decoration: line-through; }

.focus-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  padding: 0 3px;
  opacity: 0;
  transition: all 0.15s;
}

.task-item:hover .focus-toggle         { opacity: 1; }
.task-item.focused .focus-toggle       { opacity: 1; color: var(--accent); }
.focus-toggle:hover                    { color: var(--accent); }

.task-del {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  opacity: 0;
  transition: opacity 0.15s;
}

.task-item:hover .task-del { opacity: 1; }

.task-list    { margin-bottom: 10px; }
.task-add-row { display: flex; gap: 6px; margin-top: 4px; }

.task-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.15s;
}

.task-input:focus        { border-color: var(--accent); }
.task-input::placeholder { color: var(--muted); }

.task-add-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  padding: 0 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.task-add-btn:hover { color: var(--text); border-color: var(--muted); }

.no-tasks { font-size: 11px; color: var(--muted); padding: 6px 0 4px; }

/* ── QUEUE ──────────────────────────────── */

.queue-layout {
  display: grid;
  grid-template-columns: minmax(280px, 33%) 1fr;
  gap: 32px;
  align-items: start;
}

.queue-panel {
  position: sticky;
  top: 60px;
}

@media (max-width: 640px) {
  .queue-layout {
    grid-template-columns: 1fr;
  }
  .queue-panel { position: static; }
}

.q-textarea {
  display: block;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s;
  resize: none;
  overflow: hidden;
  min-height: 80px;
}

.q-textarea:focus       { border-color: var(--accent); }
.q-textarea::placeholder { color: var(--muted); }

.queue-add-row { display: flex; gap: 8px; margin-top: 8px; }

.q-edit-actions {
  display: none;
  margin-top: 8px;
}

.q-cancel-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 0;
  cursor: pointer;
  transition: color 0.15s;
}

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

.q-hint {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-top: 6px;
  opacity: 0.7;
}

.tag-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }

.tag-pill {
  font-size: 10px;
  letter-spacing: 0.06em;
  background: none;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.tag-pill.active              { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.tag-pill:hover:not(.active)  { color: var(--text); border-color: var(--muted); }

.q-item {
  display: flex;
  flex-direction: column;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 12px 14px;
  margin-bottom: 6px;
  transition: border-color 0.15s;
}

.q-item:hover { border-color: var(--muted); }

.q-row     { display: flex; align-items: flex-start; gap: 10px; }
.q-actions { display: flex; gap: 5px; align-items: center; flex-shrink: 0; }
.q-tags    { display: flex; gap: 6px; flex-wrap: wrap; }

.q-text {
  flex: 1;
  font-family: 'Newsreader', serif;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.5;
  cursor: pointer;
  transition: color 0.12s;
}

.q-text:hover { color: var(--accent); }

.q-item.done .q-text {
  text-decoration: line-through;
  color: var(--muted);
  cursor: pointer;
}

.q-item.done .q-text:hover { color: var(--muted); }

.tag { font-size: 10px; color: var(--accent); letter-spacing: 0.04em; }

.copy-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  cursor: pointer;
  transition: all 0.15s;
}

.copy-btn:hover  { color: var(--accent); border-color: var(--accent); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }

.q-del {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  opacity: 0;
  transition: opacity 0.15s;
}

.q-item:hover .q-del { opacity: 1; }

/* ── FOOTER ─────────────────────────────── */

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 44px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 10px;
}

footer a {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

footer a:hover { color: var(--text); }

footer .sep {
  color: var(--border);
  font-size: 12px;
  user-select: none;
}

/* ── MISC ───────────────────────────────── */

.empty {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 48px 0;
  letter-spacing: 0.08em;
}

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 9px 16px;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 480px) {
  header, #focus-strip  { padding-left: 14px; padding-right: 14px; }
  main                  { padding-left: 14px; padding-right: 14px; }
  footer                { padding-left: 14px; padding-right: 14px; }
}
