:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
}
* { 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;
}
#app { width: 100%; height: 100%; position: relative; }
.screen { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: flex; flex-direction: column; }
.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; }

/* ---- layout ---- */
.bar {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 22px 28px 16px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--bg-tertiary);
}
.bar h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.3px; }
.date { font-size: 16px; color: var(--text-secondary); }
.content {
  flex: 1; padding: 24px 28px;
  display: flex; flex-direction: column; gap: 20px;
  overflow-y: auto;
}
.hint {
  padding: 14px 28px; font-size: 15px; color: var(--text-muted);
  background: var(--bg-primary); border-top: 1px solid var(--bg-tertiary);
  text-align: center;
}

/* ---- home today card ---- */
.today-card {
  background: var(--bg-secondary); border-radius: var(--radius-md);
  padding: 20px 24px; border: 1px solid var(--bg-tertiary);
}
.today-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0;
}
.today-label { font-size: 18px; color: var(--text-secondary); }
.today-val { font-size: 26px; font-weight: 700; }
.today-meta { margin-top: 8px; font-size: 15px; color: var(--text-muted); }

/* ---- menu / buttons ---- */
.menu { display: flex; flex-direction: column; gap: 14px; }
.btn {
  min-height: 88px; border-radius: var(--radius-md);
  background: var(--bg-tertiary); color: var(--text-primary);
  font-size: 22px; font-weight: 600;
  display: flex; align-items: center; gap: 16px;
  padding: 0 26px; width: 100%;
}
.btn-ico { font-size: 28px; width: 34px; text-align: center; color: var(--accent); }
.btn-primary { background: var(--bg-tertiary); }
.btn-primary .btn-ico { color: var(--accent-secondary); }
.btn-danger { color: var(--danger); }
.btn-danger:focus { border-color: var(--danger); box-shadow: 0 0 20px rgba(255,68,102,0.4); }

.actions { display: flex; gap: 14px; margin-top: auto; }
.actions .btn { min-height: 72px; justify-content: center; font-size: 20px; }
.actions-pinned {
  padding: 20px 28px; background: var(--bg-primary);
  border-top: 1px solid var(--bg-tertiary); margin-top: 0;
}

/* ---- scale grid (mood + pain) ---- */
.scale-grid { display: grid; gap: 12px; }
.mood-grid { grid-template-columns: repeat(5, 1fr); }
.pain-grid { grid-template-columns: repeat(6, 1fr); }
.cell {
  min-height: 88px; border-radius: var(--radius-md);
  background: var(--bg-secondary);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 6px;
}
.cell-face { font-size: 32px; line-height: 1; }
.cell-lbl { font-size: 13px; color: var(--text-secondary); }
.cell-num { font-size: 26px; font-weight: 700; }
.cell.sel {
  background: var(--bg-tertiary);
  outline: 3px solid var(--accent); outline-offset: -3px;
}
.cell.sel .cell-lbl { color: var(--accent); }
.pain-grid .cell.sel { outline-color: var(--danger); }
.pain-grid .cell.sel .cell-num { color: var(--danger); }

/* ---- pain meter ---- */
.pain-meter { text-align: center; }
.pain-num { font-size: 64px; font-weight: 800; line-height: 1; }
.pain-word { font-size: 20px; color: var(--text-secondary); margin: 4px 0 14px; }
.pain-bar {
  height: 14px; background: var(--bg-tertiary); border-radius: 8px; overflow: hidden;
}
.pain-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent-secondary), var(--danger));
  transition: width 0.15s ease;
}

/* ---- note / chip ---- */
.note-box { display: flex; flex-direction: column; gap: 8px; }
.note-label { font-size: 16px; color: var(--text-secondary); }
.chip-row {
  min-height: 56px; border-radius: var(--radius-md);
  background: var(--bg-secondary); color: var(--text-primary);
  font-size: 18px; padding: 0 20px; text-align: left;
  display: flex; align-items: center;
}

/* ---- history ---- */
.hist-list { display: flex; flex-direction: column; gap: 12px; }
.hist-item {
  background: var(--bg-secondary); border-radius: var(--radius-md);
  padding: 16px 20px; display: flex; align-items: center; gap: 16px;
}
.hist-emo { font-size: 30px; width: 40px; text-align: center; }
.hist-body { flex: 1; min-width: 0; }
.hist-line { font-size: 19px; font-weight: 600; }
.hist-sub { font-size: 14px; color: var(--text-muted); margin-top: 2px; }
.hist-pain {
  font-size: 20px; font-weight: 700; padding: 4px 12px;
  border-radius: 20px; background: var(--bg-tertiary);
}
.hist-empty {
  text-align: center; color: var(--text-muted); font-size: 18px;
  padding: 60px 20px;
}

/* ---- toast ---- */
.toast {
  position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: var(--bg-tertiary); color: var(--text-primary);
  padding: 14px 28px; border-radius: 30px; font-size: 18px; font-weight: 600;
  border: 1px solid var(--accent);
  box-shadow: 0 0 24px var(--focus-glow);
  z-index: 50;
}
