:root {
  --bg:      #1e2326;
  --surface: #374145;
  --border:  #272e33;
  --text:    #e0e0e0;
  --muted:   #7a8478;
  --accent:  #a7c080;
  --font:    'JetBrains Mono', 'Courier New', monospace;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Hide scrollbar everywhere */
::-webkit-scrollbar { width: 0; background: transparent; }
::-webkit-scrollbar-thumb { background: transparent; }
* { scrollbar-width: none; }

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }

input, select, textarea {
  font-family: var(--font);
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 6px 10px;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }

input[type="radio"] {
  width: 14px; height: 14px;
  accent-color: var(--accent);
  padding: 0;
  background: none;
  border: none;
}

button {
  font-family: var(--font);
  font-size: 11px;
  cursor: pointer;
  border-radius: 3px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 12px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.ghost-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.ghost-btn:hover { color: var(--accent); border-color: var(--accent); }

.primary-btn {
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  font-weight: 700;
}
.primary-btn:hover { background: transparent; color: var(--accent); }

.danger-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 3px 8px;
}
.danger-btn:hover { color: #e05252; border-color: #e05252; }

.muted { color: var(--muted); }

/* Top nav */
#top-nav {
  position: fixed;
  top: 0; right: 0;
  padding: 14px 20px;
  z-index: 100;
}

/* Top nav links — always subtly visible, brightens on hover */
#settings-btn, #logout-btn {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.28;
  transition: opacity 0.2s, color 0.2s;
}
#settings-btn:hover, #logout-btn:hover {
  opacity: 1;
  color: var(--accent);
}

/* Section label */
.sec-label {
  font-size: 16px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sec-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 8px 16px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 9999;
  animation: fadeInOut 2.5s forwards;
  pointer-events: none;
}
@keyframes fadeInOut {
  0%   { opacity: 0; transform: translateY(6px); }
  12%  { opacity: 1; transform: translateY(0); }
  75%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Index page ──────────────────────────────────────────────────────────── */

#main {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 52px 52px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  overflow: hidden;
}

#hero {
  padding: 88px 0 56px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

#greeting {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
  letter-spacing: 0.16em;
}

#clock {
  font-size: clamp(54px, 9vw, 100px);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  /* cursor set via JS so it only applies when the element is interactive */
  user-select: none;
}

.sep { color: var(--accent); }

#clock-ampm {
  font-size: 0.32em;
  vertical-align: middle;
  color: var(--muted);
  letter-spacing: 0.12em;
}

#date-line {
  font-size: 18px;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-top: 6px;
}

#content-row {
  display: flex;
  gap: 52px;
  align-items: flex-start;
  flex: 1;
  overflow: hidden;
}

/* Tasks */
#tasks-col {
  flex: 0 0 420px;
  overflow: hidden;
}

#task-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
  max-height: 340px;
  overflow-y: auto;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}
.task-item::before {
  content: '›';
  color: var(--accent);
  flex-shrink: 0;
}
.task-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Empty state — no bullet prefix */
.task-empty-state::before { content: none; }
.task-empty-state {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.04em;
  opacity: 0.8;
}

/* Task row fade-out before removal */
@keyframes task-fade-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-12px); }
}
.task-fading {
  animation: task-fade-out 0.22s ease-out forwards;
  pointer-events: none;
}

/* Local task check button */
.local-task-check {
  cursor: pointer;
  color: var(--accent);
  flex-shrink: 0;
  font-size: 12px;
  line-height: 1.8;
  user-select: none;
}
.local-task-check:hover { color: var(--text); }

/* Google Tasks */
.gtask-check {
  cursor: pointer;
  color: var(--accent);
  flex-shrink: 0;
  font-size: 12px;
  line-height: 1.8;
  user-select: none;
}
.gtask-check:hover { color: var(--text); }
.gtask-check.task-btn-loading { opacity: 0.4; pointer-events: none; }

.gtask-due {
  font-size: 9px;
  color: var(--muted);
  flex-shrink: 0;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  padding: 1px 4px;
  border-radius: 2px;
}

.local-task-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.local-task-del {
  flex-shrink: 0;
  font-size: 12px;
  line-height: 1.6;
  color: transparent;
  cursor: pointer;
  user-select: none;
  transition: color 0.12s;
  padding-left: 4px;
}
.task-item:hover .local-task-del { color: var(--border); }
.local-task-del:hover { color: #e05252 !important; }

#task-refresh {
  font-size: 10px;
  padding: 3px 0;
  border: none;
  background: transparent;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}
#task-refresh:hover { color: var(--accent); }

/* Bookmarks */
#bookmarks-col {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
}

/* Bookmark search */
#bm-search-wrap {
  margin-bottom: 12px;
  flex-shrink: 0;
}

.bm-search-input {
  width: 200px;
  font-size: 11px;
  padding: 4px 9px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  transition: border-color 0.15s, color 0.15s, width 0.2s;
}
.bm-search-input::placeholder { color: var(--border); }
.bm-search-input:focus {
  border-color: var(--border);
  color: var(--text);
  outline: none;
  width: 260px;
}
.bm-search-input:not(:placeholder-shown) {
  border-color: var(--accent);
  color: var(--text);
}

#bookmark-grid {
  display: flex;
  gap: 36px;
  align-items: flex-start;
  flex: 1;
}

.bm-category { flex: 0 0 155px; }

.bm-cat-label {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}

.bm-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.bm-link {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  padding: 3px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.1s;
  position: relative;
  border-radius: 2px;
  outline: none;
}
.bm-link:hover,
.bm-link:focus {
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent);
}
/* Keyboard focus ring — visible but not intrusive */
.bm-link:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.bm-fav {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  opacity: 0.45;
  image-rendering: -webkit-optimize-contrast;
}
.bm-link:hover .bm-fav,
.bm-link:focus .bm-fav { opacity: 1; }

.bm-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.bm-link .bm-tooltip {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  padding: 4px 9px;
  white-space: nowrap;
  z-index: 50;
  margin-top: 2px;
  font-weight: 400;
  text-decoration: none;
  pointer-events: none;
}
.bm-link:hover .bm-tooltip { display: block; }

@media (max-width: 720px) {
  html, body { overflow: auto; }
  #main { height: auto; overflow: visible; padding: 0 20px 40px; }
  #hero { padding: 64px 0 44px; }
  #content-row { flex-direction: column; gap: 36px; overflow: visible; }
  #tasks-col { flex: none; width: 100%; }
  .bm-search-input { width: 100%; }
  .bm-search-input:focus { width: 100%; }
}

/* Due date badge on google tasks */
.task-due {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 0 4px;
  border-radius: 2px;
  margin-left: 5px;
  vertical-align: middle;
  white-space: nowrap;
  opacity: 0.8;
}

/* ── Task state classes ──────────────────────────────────────────────────── */

.task-done          { opacity: 0.38; }
.task-strikethrough { text-decoration: line-through; text-decoration-color: var(--accent); }
.task-error-msg     { color: #e05252; }
.task-inline-err    { color: #e05252; font-size: 10px; }

/* Google Tasks add-task row */
#gtask-add-row {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.gtask-add-controls {
  display: flex;
  gap: 6px;
}

.task-text-input {
  flex: 1;
  font-size: 11px;
  padding: 4px 7px;
  min-width: 0;
}

.gtask-due-input {
  font-size: 10px;
  padding: 3px 7px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: var(--font);
  width: 100%;
  color-scheme: dark;
}
.gtask-due-input:focus { border-color: var(--accent); }
.gtask-due-input::-webkit-calendar-picker-indicator { filter: invert(0.6); cursor: pointer; }

.gtask-add-btn {
  padding: 3px 8px;
  font-size: 10px;
}

/* Local task input row */
#local-task-input-row {
  margin-bottom: 20px;
  display: flex;
  gap: 6px;
}