:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --warm: #ffb86b;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
  --radius-lg: 18px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 600px; height: 600px; overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
#app { width: 100%; height: 100%; position: relative; }
.screen {
  width: 100%; height: 100%;
  position: absolute; top: 0; left: 0;
  display: flex; flex-direction: column;
  padding: 28px 32px;
  gap: 18px;
}
.screen.hidden { display: none; }
.focusable {
  transition: all 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer;
  outline: none;
}
.focusable:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
}
.hidden { display: none !important; }

/* HEADER */
.hdr {
  display: flex; align-items: center; gap: 16px;
  padding-bottom: 8px;
}
.hdr-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--warm), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #000; font-weight: 700;
}
.hdr-titles { flex: 1; }
.hdr-titles h1 {
  font-size: 26px; font-weight: 700; letter-spacing: -0.5px;
  color: var(--text-primary);
}
.date {
  font-size: 14px; color: var(--text-secondary);
  margin-top: 2px;
}
.hdr-back {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 32px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid transparent;
}

/* HOME STATUS */
.home-status {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  border-left: 4px solid var(--accent);
}
.status-label {
  font-size: 13px; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 1.5px;
}
.status-value {
  font-size: 22px; color: var(--text-primary);
  margin-top: 6px; font-weight: 600;
}
.status-value.done { color: var(--accent-secondary); }

/* MENU */
.menu {
  display: flex; flex-direction: column; gap: 12px;
  flex: 1;
}
.menu-item {
  height: 88px;
  display: flex; align-items: center; gap: 18px;
  padding: 0 24px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  text-align: left;
}
.menu-item.primary {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.18), rgba(0, 255, 136, 0.14));
}
.mi-icon {
  font-size: 28px; color: var(--accent);
  width: 36px; text-align: center;
  font-weight: 600;
}
.menu-item.primary .mi-icon { color: var(--accent-secondary); }
.mi-label { font-size: 20px; font-weight: 500; }

/* HINT */
.hint {
  font-size: 13px; color: var(--text-muted);
  text-align: center; padding-top: 4px;
  letter-spacing: 0.5px;
}

/* SLOTS (entry) */
.slots {
  display: flex; flex-direction: column; gap: 10px;
  flex: 1;
}
.slot {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 22px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  text-align: left;
  min-height: 70px;
}
.slot-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-primary);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  flex-shrink: 0;
}
.slot.filled .slot-num {
  background: var(--accent);
  color: #000;
}
.slot-text {
  font-size: 18px; flex: 1;
  color: var(--text-secondary);
  line-height: 1.3;
}
.slot.filled .slot-text {
  color: var(--text-primary);
  font-weight: 500;
}

/* ENTRY ACTIONS */
.entry-actions {
  display: flex; gap: 10px;
}
.btn-action {
  flex: 1; height: 64px;
  background: var(--accent);
  color: #000;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 18px; font-weight: 600;
}
.btn-action.ghost {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.btn-action.danger {
  background: var(--danger);
  color: #fff;
}
.btn-action:disabled,
.btn-action[aria-disabled="true"] {
  opacity: 0.4;
}

/* PROMPT LIST */
.prompt-list {
  flex: 1;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-tertiary) transparent;
}
.prompt-list::-webkit-scrollbar { width: 6px; }
.prompt-list::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary); border-radius: 3px;
}
.prompt-item {
  padding: 14px 18px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: 17px;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 12px;
  font-family: inherit;
  text-align: left;
  min-height: 56px;
}
.prompt-emoji {
  font-size: 22px;
  width: 28px; text-align: center;
  flex-shrink: 0;
}

/* HISTORY LIST */
.history-list {
  flex: 1;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-tertiary) transparent;
}
.history-list::-webkit-scrollbar { width: 6px; }
.history-list::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary); border-radius: 3px;
}
.h-item {
  padding: 16px 20px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-family: inherit;
  text-align: left;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 78px;
}
.h-date {
  font-size: 13px; color: var(--accent);
  text-transform: uppercase; letter-spacing: 1px;
  font-weight: 600;
}
.h-preview {
  font-size: 15px; color: var(--text-secondary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.h-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 20px;
  font-size: 16px;
  line-height: 1.5;
}

/* DETAIL */
.detail-body {
  flex: 1;
  display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto;
  padding-right: 4px;
}
.d-item {
  padding: 16px 20px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  display: flex; align-items: center; gap: 16px;
}
.d-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  flex-shrink: 0;
}
.d-text { font-size: 18px; line-height: 1.3; }

/* STATS */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stat-card {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  display: flex; flex-direction: column; gap: 4px;
}
.stat-num {
  font-size: 38px; font-weight: 700;
  color: var(--accent);
  letter-spacing: -1px;
  line-height: 1;
}
.stat-label {
  font-size: 13px; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 1px;
}
.top-themes {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  flex: 1;
  overflow-y: auto;
}
.th-label {
  font-size: 13px; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 10px;
}
.th-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0;
  font-size: 16px;
}
.th-name { color: var(--text-primary); }
.th-count { color: var(--accent); font-weight: 600; }

/* TOAST */
.toast {
  position: absolute;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 12px 22px;
  border-radius: 28px;
  font-size: 15px;
  border: 1px solid var(--accent);
  box-shadow: 0 0 20px var(--focus-glow);
  z-index: 100;
}
