html, body { margin: 0; padding: 0; background: #1e1e1e; height: 100%; }
:root {
  --bg: #1e1e1e;
  --panel: #252526;
  --panel-alt: #2d2d2d;
  --border: #3c3c3c;
  --text: #d4d4d4;
  --muted: #8a8a8a;
  --accent: #528bff;
  --accent-dim: #3a5f9e;
  --danger: #e06c75;
  --mono: 'SF Mono', 'JetBrains Mono', 'Fira Code', ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
#app-root {
  font-family: var(--mono);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  width: 100%;
  font-size: 13.5px;
  line-height: 1.55;
}
.shell { max-width: 460px; margin: 0 auto; min-height: 100vh; position: relative; display: flex; flex-direction: column; background: var(--bg); }
.screen { flex: 1; padding: 18px 16px 90px; overflow-y: auto; }
.topbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; min-height: 24px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: #0BF81E; flex-shrink: 0; }
.topbar-actions { margin-left: auto; display: flex; gap: 4px; }
.icon-btn-plain {
  background: none; border: none; color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 4px;
  border-radius: 4px;
}
.icon-btn-plain:hover { color: var(--accent); }
.icon-btn-plain svg { width: 18px; height: 18px; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 14px; margin-bottom: 12px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel-title h2 { font-size: 11px; font-weight: 600; margin: 0; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

button {
  font-family: var(--mono); font-size: 12px; cursor: pointer;
  background: var(--panel-alt); color: var(--text);
  border: 1px solid var(--border); border-radius: 5px;
  padding: 6px 10px; transition: border-color .12s, color .12s;
}
button:hover { border-color: var(--accent); color: var(--accent); }
button.primary { background: var(--accent-dim); border-color: var(--accent); color: #fff; }
button.primary:hover { background: var(--accent); color: #fff; }
button:disabled { opacity: .45; cursor: default; }

input[type=text] {
  font-family: var(--mono); font-size: 16px; font-weight: 600;
  background: transparent; color: var(--text);
  border: none; border-bottom: 1px solid transparent;
  padding: 2px 0; width: 100%; outline: none;
}
input[type=text]:focus { border-bottom-color: var(--accent); }
input[type=text]::placeholder { color: #5a5a5a; font-weight: 600; }

input[type=password] {
  font-family: var(--mono); font-size: 16px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 5px;
  padding: 6px 10px; width: 100%; outline: none;
}
input[type=password]:focus { border-color: var(--accent); }
input[type=password]::placeholder { color: #5a5a5a; }

.search-box {
  display: flex; align-items: center; gap: 6px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; margin-bottom: 14px;
}
.search-box svg { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
.search-box input { font-size: 16px; font-weight: 400; color: var(--text); }
.search-box input::placeholder { font-weight: 400; color: #5a5a5a; }

.stat-row { display: flex; gap: 8px; margin-bottom: 8px; }
.stat { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; flex: 1; }
.stat .num { font-size: 20px; color: var(--accent); font-weight: 600; }
.stat .label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }

.cat-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.cat-filter-chip {
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 12px; cursor: pointer; transition: border-color .12s;
}
.cat-filter-chip:hover { border-color: var(--accent); }
.cat-filter-chip.active { background: var(--accent-dim); border-color: var(--accent); }
.cat-filter-chip .num { font-size: 20px; color: var(--accent); font-weight: 600; }
.cat-filter-chip.active .num { color: #fff; }
.cat-filter-chip .label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.cat-filter-chip.active .label { color: rgba(255,255,255,.7); }

.summary-box {
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 11px; margin-top: 2px; color: var(--text); font-size: 12.5px;
  white-space: pre-wrap; line-height: 1.6;
}
.summary-box.placeholder { color: var(--muted); }

.api-key-row { display: flex; gap: 6px; margin-top: 10px; }
.api-key-row input { flex: 1; }
.api-key-hint { font-size: 10.5px; color: var(--muted); margin-top: 6px; }
.api-key-hint a { color: var(--accent); text-decoration: none; }
.api-key-hint a:hover { text-decoration: underline; }

.empty-msg { color: var(--muted); font-size: 12px; padding: 6px 2px; }

.note-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px;
  padding: 12px 13px; margin-bottom: 10px; cursor: pointer; transition: border-color .12s;
}
.note-card:hover { border-color: var(--accent); }
.note-card .title { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-card .snippet { font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-card .meta-row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; gap: 6px; }
.note-card .meta { font-size: 10.5px; color: #666; display: flex; align-items: center; gap: 6px; }
.note-card .badge { font-size: 10px; color: var(--accent); border: 1px solid var(--accent-dim); border-radius: 10px; padding: 1px 7px; flex-shrink: 0; }
.note-card .cat-tag { font-size: 9.5px; color: var(--muted); border: 1px solid var(--border); border-radius: 10px; padding: 1px 7px; }

.fab {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 74px;
  max-width: 460px; width: 100%; pointer-events: none;
  display: flex; justify-content: flex-end; padding: 0 16px;
}
.fab button {
  pointer-events: all; width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); border: none; color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.4);
}
.fab button svg { width: 20px; height: 20px; }

.bottom-nav { position: sticky; bottom: 0; left: 0; right: 0; background: var(--panel); border-top: 1px solid var(--border); display: flex; padding-bottom: 30px; overflow: visible; }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 0 8px; cursor: pointer; color: var(--muted); }
.bottom-nav .nav-item:first-child { padding-left: 24px; }
.bottom-nav .nav-item:last-child { padding-right: 24px; }
.nav-item svg { width: 20px; height: 20px; }
.nav-item .nav-label { font-size: 9.5px; letter-spacing: .03em; text-transform: uppercase; }
.nav-item.active { color: #fff; }

.nav-create-btn {
  width: 44px; height: 44px; border-radius: 14px;
  background: #4e4e50; border: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; cursor: pointer;
  transition: background .12s;
  transform: translateY(-18px);
}
.nav-create-btn svg { width: 22px; height: 22px; }
.nav-create-btn:hover, .nav-create-btn:active { background: #636366; color: var(--bg); }

.cat-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.cat-pick {
  font-size: 11px; padding: 4px 10px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border); color: var(--muted); background: transparent;
}
.cat-pick:hover { border-color: var(--accent); color: var(--accent); }
.cat-pick.selected { background: var(--accent-dim); border-color: var(--accent); color: #fff; }
.cat-pick.add { border-style: dashed; }
.cat-new-input {
  font-size: 11px; padding: 4px 8px; border-radius: 12px; border: 1px solid var(--accent);
  background: var(--bg); color: var(--text); width: 110px; outline: none;
}

.editor-wrap { display: flex; flex-direction: column; height: 100%; }
.editor-topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.editor-title {
  font-family: var(--mono); font-size: 20px; font-weight: 600;
  background: transparent; color: var(--text);
  border: none; width: 100%; outline: none;
  padding: 2px 0 14px; border-bottom: 1px solid var(--border);
  margin-bottom: 12px; caret-color: #fff;
}
.editor-title::placeholder { color: #5a5a5a; font-weight: 600; }
.editor-body { flex: 1; min-height: 160px; cursor: text; }
.block-row { display: flex; align-items: flex-start; gap: 8px; padding: 3px 0; transition: opacity .22s, transform .22s; }
.block-row.leaving { opacity: 0; transform: translateX(8px); }
.block-check {
  flex-shrink: 0; width: 19px; height: 19px; border-radius: 50%;
  border: 1.5px solid var(--muted); margin-top: 3px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .12s, background .12s;
}
.block-check:hover { border-color: var(--accent); }
.block-check.checked { background: var(--accent); border-color: var(--accent); }
.block-check svg { width: 11px; height: 11px; color: #fff; opacity: 0; transition: opacity .12s; }
.block-check.checked svg { opacity: 1; }
.block-text {
  flex: 1; font-family: var(--mono); font-size: 16px; color: var(--text);
  background: transparent; border: none; outline: none; resize: none;
  padding: 1px 0; overflow: hidden; line-height: 1.55;
  caret-color: #fff;
}
.block-text::placeholder { color: #5a5a5a; }
.compose-bar {
  position: fixed; bottom: 130px; right: 16px;
  display: flex; gap: 10px; align-items: center;
  z-index: 20;
}
.mic-btn, .send-btn {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--panel-alt); color: #fff; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.mic-btn svg, .send-btn svg { width: 18px; height: 18px; }
.mic-btn:hover, .send-btn:hover { border-color: var(--muted); }
.mic-btn:disabled { opacity: .35; cursor: default; }
.mic-btn:disabled:hover { border-color: var(--border); }
.mic-btn.listening { background: var(--danger); border-color: var(--danger); color: #fff; animation: mic-pulse 1.2s ease-in-out infinite; }
.listening-label { font-size: 11px; color: var(--muted); white-space: nowrap; animation: label-fade-in .2s ease; }
@keyframes label-fade-in { from { opacity: 0; transform: translateX(4px); } to { opacity: 1; transform: translateX(0); } }
@keyframes mic-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(224,108,117,.45); } 50% { box-shadow: 0 0 0 7px rgba(224,108,117,0); } }
.archive-banner {
  font-size: 11px; color: var(--muted); background: var(--panel); border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 10px; margin-bottom: 12px;
}
.cursor-blink { display: inline-block; width: 6px; height: 12px; background: var(--accent); animation: blink 1s step-end infinite; vertical-align: middle; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }

.completed-section { margin-top: 14px; }
.completed-header {
  font-size: 11.5px; color: var(--muted); cursor: pointer; user-select: none;
  padding: 4px 0 8px; letter-spacing: .03em;
}
.completed-header:hover { color: var(--text); }
.block-text-done {
  flex: 1; font-family: var(--mono); font-size: 16px;
  color: var(--muted); text-decoration: line-through;
  padding: 1px 0; line-height: 1.55;
}
