:root, [data-theme="jd"] {
  --bg-1:#faf8f8; --bg-2:#f2efef; --ink:#1e1e1e; --ink-2:#383838;
  --meta:#9a9a9a; --card:#fff; --border:#eae5e5; --divider:#f0ebeb;
  --accent:#d94045; --accent-2:#c03538; --accent-soft:#fdf0f0;
  --accent-border:#f0c0c2; --danger:#d94045;
}
[data-theme="wechat"] {
  --bg-1:#f6f8f6; --bg-2:#eef2ee; --ink:#1e1e1e; --ink-2:#383838;
  --meta:#9a9a9a; --card:#fff; --border:#e2e8e2; --divider:#eaf0ea;
  --accent:#1aad5c; --accent-2:#159a50; --accent-soft:#edf8f2;
  --accent-border:#b8e4cc; --danger:#d94045;
}
[data-theme="weibo"] {
  --bg-1:#faf8f6; --bg-2:#f3f0ec; --ink:#1e1e1e; --ink-2:#383838;
  --meta:#9a9a9a; --card:#fff; --border:#eae6e0; --divider:#f2ede8;
  --accent:#e8700a; --accent-2:#d06008; --accent-soft:#fef5ec;
  --accent-border:#f5d4a8; --danger:#d94045;
}
[data-theme="douyin"] {
  --bg-1:#181a24; --bg-2:#1e2030; --ink:#ededf0; --ink-2:#c8c8cc;
  --meta:#6e6e78; --card:#262838; --border:#363848; --divider:#2e3040;
  --accent:#f0284a; --accent-2:#d82040; --accent-soft:#2c1820;
  --accent-border:#6a2030; --danger:#f0284a;
}
* { box-sizing:border-box; }
html, body { margin:0; padding:0; height:100%; }
body {
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
  background:linear-gradient(180deg,var(--bg-1),var(--bg-2));
  color:var(--ink); -webkit-font-smoothing:antialiased;
}
#app { min-height:100vh; padding-bottom:calc(130px + env(safe-area-inset-bottom)); }

/* ===== Tab Bar ===== */
.tab-bar {
  position:fixed; left:0; right:0; bottom:0; z-index:50;
  display:flex; align-items:stretch;
  background:var(--card); border-top:1px solid var(--border);
  padding-bottom:env(safe-area-inset-bottom);
}
.tab-bar[hidden] { display:none; }
.tab-item {
  flex:1; display:flex; flex-direction:column; align-items:center;
  justify-content:center; gap:2px; padding:8px 0;
  border:0; background:transparent; color:var(--meta);
  font-size:10px; cursor:pointer; transition:color .15s;
}
.tab-item .tab-icon { font-size:22px; line-height:1; }
.tab-item .tab-label { font-size:10px; }
.tab-item.active { color:var(--accent); }
.tab-item:active { opacity:.7; }

.app-header { display:flex; align-items:center; gap:12px; padding:16px 20px; }
.app-header h1 { margin:0; font-size:20px; font-weight:600; flex:1; }
.app-header .header-avatar {
  background:transparent; border:0; font-size:20px; padding:8px;
  min-width:44px; min-height:44px; cursor:pointer; color:var(--ink);
}
.app-header .back {
  background:transparent; border:0; font-size:20px; padding:8px;
  min-width:44px; min-height:44px; color:var(--ink);
}
.header-refresh {
  background:transparent; border:0; font-size:20px; padding:8px;
  min-width:44px; min-height:44px; color:var(--meta); cursor:pointer;
}
.header-refresh:hover { color:var(--accent); }
.compose-btn {
  background:transparent; border:0; font-size:24px; padding:8px;
  min-width:44px; min-height:44px; color:var(--accent); cursor:pointer;
  font-weight:300;
}

/* ===== Compose FAB ===== */
.compose-fab {
  position:fixed; right:20px;
  bottom:calc(68px + env(safe-area-inset-bottom));
  width:52px; height:52px; border-radius:50%;
  background:var(--accent); color:#fff; border:0;
  font-size:20px; cursor:pointer; z-index:20;
  box-shadow:0 4px 12px rgba(156,106,48,.3);
  display:flex; align-items:center; justify-content:center;
  transition:transform .15s, box-shadow .15s;
}
.compose-fab:active { transform:scale(.92); }

.ask-fab {
  position:fixed; right:20px;
  bottom:calc(100px + env(safe-area-inset-bottom));
  display:flex; align-items:center; gap:8px;
  padding:12px 18px 12px 16px; border:0; border-radius:999px;
  background:linear-gradient(135deg,rgba(200,147,85,.7),rgba(156,106,48,.7));
  color:#fff; font-size:14px; font-weight:500; letter-spacing:.5px;
  box-shadow:0 4px 12px rgba(156,106,48,.2);
  cursor:pointer; z-index:40;
  animation:fab-pop 360ms ease-out both;
  transition:transform .15s ease, box-shadow .15s ease;
}
.ask-fab:hover {
  transform:translateY(-1px);
  box-shadow:0 10px 28px rgba(156,106,48,.4), 0 2px 8px rgba(40,30,10,.2);
}
.ask-fab:active { transform:scale(.97); }
body.composer-open .ask-fab {
  opacity:0; pointer-events:none;
  transform:scale(.9) translateY(8px);
  transition:opacity .18s ease, transform .18s ease;
}
.ask-fab-icon {
  display:inline-flex; align-items:center; justify-content:center;
  width:22px; height:22px; border-radius:50%;
  background:rgba(255,255,255,.2);
  font-size:13px;
  animation:fab-sparkle 2.8s ease-in-out infinite;
}
.ask-fab-label { white-space:nowrap; }

@keyframes fab-pop {
  from { opacity:0; transform:scale(.8) translateY(8px); }
  to   { opacity:1; transform:none; }
}
@keyframes fab-sparkle {
  0%, 100% { transform:rotate(0deg) scale(1); opacity:1; }
  45%      { transform:rotate(180deg) scale(1.15); opacity:.85; }
}
@media (prefers-reduced-motion: reduce) {
  .ask-fab, .ask-fab-icon { animation:none !important; }
}

.insight-bar {
  display:flex; align-items:center; gap:10px; margin:0 20px 12px;
  padding:10px 14px; background:var(--accent-soft);
  border:1px solid var(--accent-border); border-radius:12px; font-size:14px;
}
.insight-bar .close {
  margin-left:auto; border:0; background:transparent; color:var(--meta);
  min-width:44px; min-height:44px; font-size:14px;
}

/* ===== Reflect Reminders ===== */
.reflect-reminder {
  display:flex; align-items:center; gap:10px; margin:0 20px 8px;
  padding:10px 14px; background:#fef9f0;
  border:1px solid #f0d9a8; border-radius:12px; font-size:13px;
}
.reflect-reminder-text { flex:1; color:var(--ink-2); }
.reflect-reminder-go {
  border:0; background:transparent; color:var(--accent); font-size:13px;
  font-weight:500; cursor:pointer; white-space:nowrap; padding:4px 0;
}
.reflect-reminder-close {
  border:0; background:transparent; color:var(--meta); font-size:13px;
  cursor:pointer; padding:4px; min-width:28px; min-height:28px;
}

/* ===== Goal Suggestion Bar ===== */
.goal-suggest-bar {
  display:flex; align-items:center; gap:10px; margin:0 20px 8px;
  padding:10px 14px; background:var(--accent-soft);
  border:1px solid var(--accent-border); border-radius:12px; font-size:13px;
}
.goal-suggest-text { flex:1; color:var(--ink-2); }
.goal-suggest-text b { font-weight:500; }
.goal-suggest-create {
  border:0; background:transparent; color:var(--accent); font-size:13px;
  font-weight:500; cursor:pointer; white-space:nowrap; padding:4px 8px;
}
.goal-suggest-dismiss {
  border:0; background:transparent; color:var(--meta); font-size:13px;
  cursor:pointer; padding:4px; min-width:28px; min-height:28px;
}

.timeline { padding:0 16px; display:flex; flex-direction:column; gap:10px; }
.note-swipe {
  position:relative; overflow:hidden; border-radius:12px;
}
.note-swipe .note {
  position:relative; z-index:1;
  background:var(--card); border:1px solid var(--border); border-radius:12px;
  padding:14px 16px; box-shadow:0 1px 2px rgba(40,30,10,.04);
  animation:slide-in 200ms ease-out both;
  will-change:transform;
}
.note-swipe .swipe-delete {
  position:absolute; right:0; top:0; bottom:0; width:72px;
  background:var(--danger); color:#fff; border:0;
  font-size:14px; font-weight:500; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  visibility:hidden;
}
.note-swipe.swiped .swipe-delete {
  visibility:visible;
}
@media (hover: hover) {
  .note-swipe .swipe-delete {
    width:auto; padding:0 12px; top:50%; bottom:auto;
    transform:translateY(-50%); right:8px; height:32px;
    border-radius:8px; opacity:0; transition:opacity .15s;
    z-index:2; visibility:visible;
  }
  .note-swipe:hover .swipe-delete { opacity:1; }
}
@media (hover: none) {
  .note-swipe .swipe-delete { z-index:0; }
}
.note .body {
  font-size:15px; line-height:1.7; color:var(--ink-2); white-space:pre-wrap; word-break:break-word;
  display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden;
}
.note .meta { margin-top:8px; font-size:12px; color:var(--meta); display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.note .tag { color:var(--accent); }
.note .time { margin-left:auto; }

.capsule-host {
  position:fixed; left:0; right:0; bottom:calc(52px + env(safe-area-inset-bottom));
  padding:12px 16px;
  background:linear-gradient(180deg, rgba(247,245,240,0), var(--bg-2) 40%);
  z-index:10;
}
.capsule {
  width:100%; height:48px; border-radius:999px;
  background:var(--accent); color:#fff; font-size:14px; font-weight:400;
  align-items:center; justify-content:center; gap:8px;
  border:0; cursor:pointer;
  box-shadow:0 4px 14px rgba(184,131,74,.25);
}
.capsule:not([hidden]) {
  display:flex;
}
.capsule:active { transform:scale(.98); }

.capsule-input {
  width:100%; background:var(--card); color:var(--ink);
  border:1px solid var(--border); border-radius:20px;
  padding:10px 12px 8px; flex-direction:column; gap:8px;
  box-shadow:0 4px 18px rgba(40,30,10,.08);
}
.capsule-input:not([hidden]) {
  display:flex;
}
.capsule-input-head {
  display:flex; align-items:center; gap:8px;
}
.capsule-input-head .time-chip-slot { flex:1; min-width:0; }
.capsule-input .capsule-collapse {
  border:0; background:transparent; color:var(--meta);
  width:32px; height:32px; border-radius:50%; font-size:18px; cursor:pointer;
}
.capsule-input .capsule-collapse:hover { background:var(--bg-2); }

.capsule-input .capsule-text {
  width:100%; border:0; outline:0; background:transparent;
  font:inherit; font-size:15px; line-height:1.6; color:var(--ink);
  resize:none; overflow-y:auto;
  min-height:24px; max-height:240px;
  padding:2px 4px;
}
.capsule-input .capsule-text::placeholder { color:var(--meta); }

.capsule-input-foot {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:0 4px;
}
.capsule-counter {
  font-size:12px; color:var(--meta); font-variant-numeric:tabular-nums;
}
.capsule-counter.near-limit { color:var(--danger); }

.capsule-input .capsule-send {
  border:0; background:var(--accent); color:#fff;
  height:32px; padding:0 16px; border-radius:16px;
  font-size:14px; font-weight:500; cursor:pointer;
  transition:opacity .15s;
}
.capsule-input .capsule-send:disabled {
  opacity:.4; cursor:not-allowed;
}

/* ===== Compose Page ===== */
.compose-page {
  display:flex; flex-direction:column; min-height:100vh;
  background:var(--bg-1);
}
.compose-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 16px; border-bottom:1px solid var(--divider);
}
.compose-header .compose-counter {
  font-size:12px; color:var(--meta); font-variant-numeric:tabular-nums;
}
.compose-cancel {
  border:0; background:transparent; font-size:15px; color:var(--meta);
  padding:8px 4px; cursor:pointer;
}
.compose-submit {
  border:0; background:var(--accent); color:#fff;
  padding:8px 20px; border-radius:18px; font-size:14px; font-weight:500;
  cursor:pointer; transition:opacity .15s;
}
.compose-submit:disabled { opacity:.4; cursor:not-allowed; }
.compose-textarea {
  flex:1; min-height:200px; padding:20px 16px; border:0; outline:0;
  background:transparent; font:inherit; font-size:16px; line-height:1.8;
  color:var(--ink); resize:none;
}
.compose-textarea::placeholder { color:var(--meta); }

/* Voice input */
.voice-area {
  display:flex; flex-direction:column; align-items:center;
  gap:12px; padding:20px 0 32px;
}
.voice-btns {
  display:flex; gap:24px;
}
.voice-status {
  font-size:13px; color:var(--meta); height:20px;
}
.voice-status.recording { color:var(--accent); }
.voice-status.cancel-hint { color:var(--meta); }
.voice-status.transcribing { color:#b08d57; }
.mic-btn {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  width:72px; height:72px; border-radius:50%;
  background:var(--bg-2); border:1.5px solid var(--divider);
  cursor:pointer; transition:all .15s; user-select:none;
}
.mic-btn i { font-size:24px; color:var(--accent); }
.mic-btn .mic-label { font-size:11px; color:var(--meta); margin-top:2px; }
.mic-btn.active {
  background:var(--accent); border-color:var(--accent); transform:scale(1.1);
}
.mic-btn.active i { color:#fff; }
.mic-btn.active .mic-label { color:rgba(255,255,255,.8); }
.mic-btn.disabled { opacity:.5; pointer-events:none; }

/* Voice Overlay */
.voice-overlay {
  position:fixed; inset:0; z-index:200;
  background:rgba(0,0,0,0.85);
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  opacity:0; transition:opacity .15s ease;
}
.voice-overlay.visible { opacity:1; }
.voice-overlay-content {
  display:flex; flex-direction:column; align-items:center; gap:20px;
  padding:0 32px; width:100%;
}
.voice-overlay-text {
  font-size:18px; color:#fff; text-align:center;
  max-width:80%; min-height:48px; line-height:1.7;
  word-break:break-all; outline:none;
  transition:all .2s ease;
}
.voice-overlay-text.editable {
  background:rgba(255,255,255,.1); border-radius:12px;
  padding:12px 16px; cursor:text;
  text-align:left; max-width:88%;
}
.voice-wave {
  display:flex; align-items:center; gap:4px; height:40px;
}
.voice-wave span {
  width:3px; border-radius:2px; background:var(--accent);
  animation:wave-bar .8s ease-in-out infinite;
}
.voice-wave span:nth-child(1) { height:12px; animation-delay:0s; }
.voice-wave span:nth-child(2) { height:20px; animation-delay:.1s; }
.voice-wave span:nth-child(3) { height:28px; animation-delay:.2s; }
.voice-wave span:nth-child(4) { height:20px; animation-delay:.3s; }
.voice-wave span:nth-child(5) { height:12px; animation-delay:.4s; }
@keyframes wave-bar {
  0%,100% { transform:scaleY(1); }
  50% { transform:scaleY(1.8); }
}
.voice-overlay-hint {
  font-size:13px; color:rgba(255,255,255,.5);
}
.voice-confirm-bar {
  display:flex; justify-content:center; gap:16px;
}
.voice-btn-cancel, .voice-btn-send {
  border:0; height:44px; padding:0 32px; border-radius:22px;
  font-size:15px; font-weight:500; cursor:pointer;
  transition:transform .1s;
}
.voice-btn-cancel:active, .voice-btn-send:active { transform:scale(.95); }
.voice-btn-cancel {
  background:rgba(255,255,255,.15); color:rgba(255,255,255,.85);
}
.voice-btn-send {
  background:var(--accent); color:#fff;
}

/* Capsule expand & mic buttons */
.capsule-expand {
  border:0; background:transparent; color:var(--meta);
  width:32px; height:32px; border-radius:50%; font-size:16px; cursor:pointer;
}
.capsule-expand:hover { background:var(--bg-2); color:var(--ink); }
.capsule-foot-actions {
  display:flex; align-items:center; gap:8px;
}
.capsule-mic {
  border:0; background:var(--bg-2); color:var(--accent);
  width:32px; height:32px; border-radius:50%; font-size:16px;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition:background .15s;
}
.capsule-mic:hover { background:var(--accent); color:#fff; }

.sheet-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,.4);
  display:flex; align-items:flex-end; z-index:50;
}
.sheet {
  width:100%; background:var(--card); border-top-left-radius:16px; border-top-right-radius:16px;
  padding:12px 20px 24px; max-height:80vh; overflow:auto;
  animation:slide-up 240ms ease-out both;
}
.sheet .drag-handle {
  width:36px; height:4px; background:var(--border); border-radius:2px;
  margin:6px auto 14px;
}
.sheet .meta-row { display:flex; align-items:center; gap:8px; color:var(--meta); margin:12px 0; }
.sheet .edited-hint { font-size:12px; color:var(--meta); font-style:italic; }
.sheet .edit-time { border:0; background:transparent; color:var(--accent); min-width:44px; min-height:44px; }
.sheet .sheet-textarea {
  width:100%; min-height:120px; padding:12px; border:1px solid var(--border);
  border-radius:10px; font-size:15px; line-height:1.7; color:var(--ink-2);
  background:var(--bg-1); resize:vertical; font-family:inherit;
}
.sheet .sheet-actions { display:flex; gap:12px; margin-top:16px; justify-content:flex-end; }
.sheet .btn-icon {
  width:44px; height:44px; border-radius:50%; border:1px solid var(--border);
  background:var(--bg-1); font-size:18px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition:background .15s;
}
.sheet .btn-icon:hover { background:var(--bg-2); }
.sheet .btn-del { border-color:var(--danger); color:var(--danger); }
.sheet .btn-del:hover { background:rgba(184,90,90,.08); }
.sheet .confirm-bar {
  margin-top:12px; padding:12px 16px; border-radius:10px;
  background:rgba(184,90,90,.06); border:1px solid var(--danger);
  display:flex; align-items:center; gap:12px;
}
.sheet .confirm-text { flex:1; font-size:14px; color:var(--danger); }
.sheet .confirm-yes {
  padding:6px 16px; border-radius:8px; border:0;
  background:var(--danger); color:#fff; font-size:13px; cursor:pointer;
}
.sheet .confirm-no {
  padding:6px 16px; border-radius:8px; border:1px solid var(--border);
  background:transparent; color:var(--ink); font-size:13px; cursor:pointer;
}
.sheet .btn-save {
  flex:1; padding:12px; border-radius:10px; border:0;
  background:var(--accent); color:#fff; font-size:14px; font-weight:500; cursor:pointer;
}
.sheet .btn-save:disabled { opacity:.6; }
.sheet .btn-delete.danger {
  padding:12px 20px; border-radius:10px;
  border:1px solid var(--danger); background:transparent; color:var(--danger);
  font-size:14px; cursor:pointer;
}
.sheet .edit-expired { font-size:12px; color:var(--meta); align-self:center; }
.sheet .delete.danger { width:100%; padding:12px; border-radius:10px;
  border:1px solid var(--danger); background:transparent; color:var(--danger); }
.sheet .summary { color:var(--meta); font-size:14px; }

.toast {
  position:fixed; bottom:calc(80px + env(safe-area-inset-bottom)); left:50%;
  transform:translateX(-50%) translateY(20px);
  background:var(--ink); color:#fff; padding:10px 18px; border-radius:20px;
  font-size:13px; opacity:0; transition:opacity .25s, transform .25s; z-index:100;
}
.toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

.empty, .skeleton { padding:24px; text-align:center; color:var(--meta); }
.skeleton { background:#ece8dc; height:72px; border-radius:12px; animation:pulse 1.4s infinite; }
@keyframes slide-in { from {opacity:0; transform:translateY(8px);} to {opacity:1; transform:none;} }
@keyframes slide-up { from {transform:translateY(100%);} to {transform:none;} }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:.55;} }
@media (prefers-reduced-motion: reduce) {
  .note, .sheet { animation:none !important; }
}

.filter-chip {
  margin-bottom:10px; padding:8px 12px; font-size:13px; color:var(--accent);
  background:var(--accent-soft); border:1px solid var(--accent-border);
  border-radius:999px; display:inline-flex; align-items:center; gap:6px;
}
.filter-chip .clear {
  border:0; background:transparent; color:var(--accent); min-width:44px; min-height:32px;
}
.time-chip {
  border:1px solid var(--border); background:var(--accent-soft);
  color:var(--accent-2); padding:4px 10px; border-radius:12px;
  font-size:12px; margin-right:8px; white-space:nowrap;
}
.capsule-input-head .time-chip-slot { position:relative; }
.time-picker {
  position:absolute; bottom:calc(100% + 6px); left:0; min-width:180px;
  background:var(--card); border:1px solid var(--border); border-radius:12px;
  box-shadow:0 4px 20px rgba(40,30,10,.1); padding:6px; z-index:20;
  display:flex; flex-direction:column;
}
.time-picker button {
  border:0; background:transparent; padding:12px; text-align:left;
  font-size:14px; color:var(--ink-2); min-height:44px; cursor:pointer;
}
.time-picker button:hover { background:var(--accent-soft); }

/* ask 市场页 + agent 详情页 */
.ask-view { padding:0 20px 32px; }
.ask-intro {
  margin:0 0 16px; padding:12px 16px;
  background:var(--accent-soft); border:1px solid var(--accent-border);
  border-radius:12px; color:var(--ink-2);
  font-size:13px; line-height:1.6;
}
.ask-body { display:flex; flex-direction:column; gap:24px; }

.ask-section-title {
  font-size:12px; font-weight:600; color:var(--meta);
  letter-spacing:.5px; text-transform:uppercase;
}

.ask-group { display:flex; flex-direction:column; gap:8px; margin-bottom:16px; }

.ask-list { list-style:none; padding:0; margin:0;
            display:flex; flex-direction:column; gap:10px; }
.ask-list li { list-style:none; }

.ask-card {
  width:100%; display:flex; align-items:flex-start; gap:12px;
  padding:14px 16px; text-align:left;
  background:var(--card); border:1px solid var(--border); border-radius:14px;
  cursor:pointer; color:var(--ink);
  transition:border-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.ask-card:hover {
  border-color:var(--accent-border);
  box-shadow:0 2px 10px rgba(40,30,10,.06);
}
.ask-card:active { transform:scale(.995); }
.ask-card-icon {
  flex-shrink:0; width:36px; height:36px; border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  background:var(--accent-soft); font-size:18px;
}
.ask-card-body { flex:1; display:flex; flex-direction:column; gap:4px; min-width:0; }
.ask-card-title { font-size:15px; font-weight:600; color:var(--ink); }
.ask-card-desc { font-size:13px; line-height:1.55; color:var(--ink-2); }
.ask-card-when { font-size:12px; line-height:1.5; color:var(--meta); margin-top:2px; }
.ask-card-arrow {
  flex-shrink:0; color:var(--meta); font-size:20px; line-height:1; margin-top:6px;
}

.ask-history { display:flex; flex-direction:column; gap:8px; }
.ask-history-head { display:flex; align-items:center; gap:8px; }
.ask-history-refresh {
  margin-left:auto; border:0; background:transparent;
  color:var(--meta); font-size:16px; padding:4px 8px; cursor:pointer;
}
.ask-history-list { list-style:none; padding:0; margin:0;
                    display:flex; flex-direction:column; gap:6px; }
.ask-history-list li { list-style:none; }
.run-row {
  display:flex; align-items:center; gap:10px;
  padding:10px 12px; border:1px solid var(--border);
  border-radius:10px; background:var(--card);
  cursor:pointer;
}
.run-row:hover { border-color:var(--accent-border); }
.run-slug { font-size:12px; color:var(--accent-2); min-width:100px; }
.run-preview { flex:1; font-size:13px; color:var(--ink-2);
               overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.run-time { font-size:12px; color:var(--meta); flex-shrink:0; }
.empty-inline { padding:12px; text-align:center; color:var(--meta); font-size:13px; }

/* agent detail */
.agent-detail { padding:0 20px 48px; }
.agent-rerun {
  border:0; background:transparent; color:var(--accent);
  font-size:18px; padding:8px; min-width:44px; min-height:44px; cursor:pointer;
}
.agent-meta { margin-bottom:20px; }
.agent-desc { margin:0 0 6px; font-size:14px; color:var(--ink-2); line-height:1.6; }
.agent-when { margin:0; font-size:12px; color:var(--meta); line-height:1.6; }

.agent-result { margin-bottom:20px; }
.agent-result .skeleton.tall { height:160px; border-radius:12px; }
.insight-card {
  background:var(--card); border:1px solid var(--border); border-radius:12px;
  padding:16px; line-height:1.75; white-space:normal; word-break:break-word;
}
.error-card {
  padding:14px 16px; border-radius:12px;
  background:#fbe8e6; border:1px solid #f1c1bc; color:var(--danger);
  font-size:14px; line-height:1.6;
}

.agent-evidence { margin-bottom:16px; }
.evidence-list { list-style:none; padding:0; margin:8px 0 0;
                 display:flex; flex-direction:column; gap:6px; }
.evidence-list li { list-style:none; }
.evidence-row {
  display:flex; flex-direction:column; gap:6px;
  padding:12px 14px; border:1px solid var(--border);
  border-radius:10px; background:var(--card); cursor:pointer;
}
.evidence-row:hover { border-color:var(--accent-border); }
.evidence-row-head {
  display:flex; align-items:center; gap:8px;
  font-size:12px; color:var(--meta); flex-wrap:wrap;
}
.evidence-time { white-space:nowrap; }
.evidence-tags { display:inline-flex; flex-wrap:wrap; gap:6px; }
.evidence-tag { color:var(--accent); font-size:12px; }
.evidence-preview {
  font-size:13px; line-height:1.6; color:var(--ink-2);
  white-space:pre-wrap; word-break:break-word;
}
.evidence-placeholder { color:var(--meta); font-style:italic; }

.evidence-row.highlight {
  border-color:var(--accent);
  box-shadow:0 0 0 3px var(--accent-soft);
  transition:border-color .2s, box-shadow .2s;
}

.cite {
  display:inline-flex; align-items:center;
  padding:1px 8px; margin:0 2px;
  font-size:12px; line-height:1.5;
  color:var(--accent-2);
  background:var(--accent-soft);
  border:1px solid var(--accent-border);
  border-radius:999px;
  font-family:inherit;
  cursor:pointer;
  vertical-align:baseline;
  transition:transform .1s ease, background .15s ease;
}
.cite:hover { background:#f6ead1; }
.cite:active { transform:scale(.96); }
.cite.cite-unknown {
  color:var(--meta); background:var(--bg-2);
  border-color:var(--border); cursor:default;
}

.agent-footnote { margin:8px 0 0; font-size:12px; color:var(--meta); text-align:center; }

/* ===== Login Page ===== */
.login-page {
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  padding:20px;
}
.login-card {
  width:100%; max-width:360px; background:var(--card);
  border-radius:16px; padding:40px 28px; text-align:center;
  box-shadow:0 4px 24px rgba(0,0,0,.06);
}
.login-title {
  margin:0 0 4px; font-size:28px; font-weight:700; color:var(--ink);
}
.login-subtitle {
  margin:0 0 32px; font-size:14px; color:var(--meta);
}
.login-form .form-group { margin-bottom:16px; }
.login-form input {
  width:100%; padding:12px 16px; border:1px solid var(--border);
  border-radius:10px; font-size:15px; background:var(--bg-1);
  color:var(--ink); outline:none; transition:border-color .2s;
}
.login-form input:focus { border-color:var(--accent); }
.login-form .form-hint {
  margin:0 0 16px; font-size:13px; color:var(--meta); text-align:left;
}
.btn-login {
  width:100%; padding:13px; border:0; border-radius:10px;
  background:linear-gradient(135deg,#c89355,#9c6a30);
  color:#fff; font-size:15px; font-weight:500; cursor:pointer;
  transition:opacity .2s;
}
.btn-login:disabled { opacity:.6; cursor:not-allowed; }
.btn-login:active:not(:disabled) { opacity:.85; }
.btn-switch {
  display:block; width:100%; margin-top:12px; padding:8px;
  border:0; background:transparent; color:var(--accent);
  font-size:13px; cursor:pointer;
}
.btn-switch:hover { text-decoration:underline; }

/* ===== Profile Page ===== */
.profile-page { padding-bottom:40px; }
.profile-card {
  margin:0 16px; background:var(--card); border-radius:12px;
  border:1px solid var(--border); overflow:hidden;
}
.profile-row {
  display:flex; align-items:center; padding:14px 16px;
  border-bottom:1px solid var(--divider);
}
.profile-row:last-child { border-bottom:0; }
.profile-row .label { width:80px; font-size:14px; color:var(--meta); flex-shrink:0; }
.profile-row .value { flex:1; font-size:15px; color:var(--ink); }
.profile-row .btn-icon-sm {
  width:32px; height:32px; border-radius:50%; border:1px solid var(--border);
  background:var(--bg-1); font-size:14px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.profile-row .inline-input {
  width:100%; padding:4px 8px; border:1px solid var(--accent);
  border-radius:6px; font-size:15px; outline:none;
}
.profile-section { padding:16px; }
.profile-loading { padding:40px; text-align:center; color:var(--meta); }
.btn-outline {
  width:100%; padding:12px; border-radius:10px;
  border:1px solid var(--border); background:transparent;
  color:var(--ink); font-size:14px; cursor:pointer;
}
.btn-primary {
  width:100%; padding:12px; border-radius:10px; border:0;
  background:var(--accent); color:#fff; font-size:14px; cursor:pointer; margin-top:10px;
}
.btn-logout {
  width:100%; padding:12px; border-radius:10px;
  border:1px solid var(--danger); background:transparent;
  color:var(--danger); font-size:14px; cursor:pointer;
}
.pwd-form { display:flex; flex-direction:column; gap:10px; }
.pwd-form input {
  width:100%; padding:10px 14px; border:1px solid var(--border);
  border-radius:8px; font-size:14px; background:var(--bg-1);
}

/* ===== Goals Page ===== */
.goals-page { padding:0 16px; }
.goals-add {
  background:transparent; border:0; font-size:24px; color:var(--accent);
  min-width:44px; min-height:44px; cursor:pointer;
}
.goal-card {
  background:var(--card); border:1px solid var(--border); border-radius:12px;
  padding:14px 16px; margin-bottom:10px;
}
.goal-card-head { display:flex; align-items:center; gap:8px; }
.goal-period-badge {
  font-size:12px; padding:2px 8px; border-radius:999px;
  background:var(--accent-soft); color:var(--accent-2); border:1px solid var(--accent-border);
}
.goal-title { font-size:15px; font-weight:500; color:var(--ink); }
.goal-desc { margin-top:6px; font-size:13px; color:var(--meta); }
.goal-actions { margin-top:10px; display:flex; gap:12px; }
.btn-text { border:0; background:transparent; font-size:13px; color:var(--accent); cursor:pointer; padding:4px 0; }
.btn-text.danger { color:var(--danger); }
.goal-form-card {
  background:var(--card); border:1px solid var(--border); border-radius:12px;
  padding:20px 16px;
}
.goal-form-card h3 { margin:0 0 16px; font-size:16px; }
.form-label { display:block; margin-bottom:14px; font-size:13px; color:var(--meta); }
.form-input {
  display:block; width:100%; margin-top:6px; padding:10px 12px;
  border:1px solid var(--border); border-radius:8px; font-size:14px;
  background:var(--bg-1); color:var(--ink); outline:none;
}
.form-input:focus { border-color:var(--accent); }
textarea.form-input { min-height:60px; resize:vertical; font-family:inherit; }
select.form-input { appearance:auto; }
.form-input.compact { display:inline-block; width:auto; padding:6px 10px; margin-top:0; font-size:14px; }
.reflect-setting-col { display:flex; flex-direction:column; gap:6px; }

/* ===== Reflect Settings ===== */
.reflect-settings { padding:0 !important; overflow:hidden; }
.rs-header {
  padding:14px 16px 10px; font-size:15px; font-weight:600; color:var(--ink);
  border-bottom:1px solid var(--divider);
}
.rs-block {
  display:flex; gap:12px; padding:14px 16px;
  border-bottom:1px solid var(--divider);
}
.rs-block:last-of-type { border-bottom:0; }
.rs-icon { font-size:20px; flex-shrink:0; padding-top:2px; }
.rs-body { flex:1; display:flex; flex-direction:column; gap:8px; }
.rs-title { font-size:14px; font-weight:500; color:var(--ink); }
.rs-row {
  display:flex; align-items:center; gap:6px; flex-wrap:wrap;
  font-size:13px; color:var(--ink-2); line-height:2;
}
.rs-select {
  padding:4px 8px; border:1px solid var(--border); border-radius:6px;
  background:var(--bg-1); font-size:13px; color:var(--ink);
  appearance:auto; outline:none;
}
.rs-select:focus { border-color:var(--accent); }
.rs-save {
  display:block; width:calc(100% - 32px); margin:12px 16px 16px;
  padding:10px; border:0; border-radius:10px;
  background:var(--accent); color:#fff; font-size:14px;
  font-weight:500; cursor:pointer; transition:opacity .15s;
}
.rs-save:active { opacity:.85; }
.settings-page { padding:0 16px; }
.settings-page .rs-block { background:var(--card); border:1px solid var(--border); border-radius:12px; margin-bottom:10px; }
.settings-page .rs-save { width:100%; }
.form-actions { display:flex; gap:10px; margin-top:16px; }
.form-actions .btn-outline, .form-actions .btn-primary { flex:1; margin-top:0; }

/* ===== Reflections Page ===== */
.reflections-page { padding:0 16px; }
.reflections-tabs { display:flex; gap:8px; margin-bottom:16px; }
.reflections-tabs .tab {
  flex:1; padding:8px 0; border:1px solid var(--border); border-radius:8px;
  background:var(--card); font-size:14px; color:var(--meta); cursor:pointer;
  text-align:center;
}
.reflections-tabs .tab.active {
  background:var(--accent-soft); color:var(--accent-2); border-color:var(--accent-border);
}
.reflection-card {
  background:var(--card); border:1px solid var(--border); border-radius:12px;
  padding:14px 16px; margin-bottom:10px; cursor:pointer;
  transition:border-color .15s;
}
.reflection-card:active { border-color:var(--accent); }
.reflection-time { font-size:12px; color:var(--meta); margin-bottom:6px; }
.reflection-preview { font-size:14px; color:var(--ink-2); line-height:1.6; }
.reflections-more { display:block; margin:12px auto; }

/* ===== Ask Shortcuts ===== */
.ask-shortcuts { display:flex; gap:10px; margin:0 20px 12px; }
.ask-shortcut {
  flex:1; padding:10px 12px; border:1px solid var(--border); border-radius:10px;
  background:var(--card); font-size:13px; color:var(--ink); cursor:pointer;
  text-align:center; transition:border-color .15s;
}
.ask-shortcut:active { border-color:var(--accent); }

/* ===== Reflect Page ===== */
.reflect-page { padding:0 16px; }
.reflect-entries { display:flex; flex-direction:column; gap:8px; margin-bottom:16px; }
.reflect-entry {
  display:flex; align-items:center; gap:12px; padding:14px 16px;
  background:var(--card); border:1px solid var(--border); border-radius:12px;
  cursor:pointer; transition:border-color .15s; text-align:left; width:100%;
}
.reflect-entry:active { border-color:var(--accent); }
.reflect-entry-icon { font-size:24px; flex-shrink:0; }
.reflect-entry-body { flex:1; display:flex; flex-direction:column; gap:2px; }
.reflect-entry-title { font-size:15px; font-weight:500; color:var(--ink); }
.reflect-entry-desc { font-size:12px; color:var(--meta); }
.reflect-entry-arrow { font-size:18px; color:var(--meta); }
.reflect-shortcuts {
  display:flex; flex-direction:column; gap:0;
  margin-top:16px; padding-top:16px; border-top:1px solid var(--border);
}
.reflect-entry.secondary {
  background:transparent; border:none; padding:10px 12px;
}
.reflect-entry.secondary .reflect-entry-icon { color:var(--meta); }

.reflect-entry-status {
  font-size:12px; color:var(--meta); margin-top:2px;
}
.reflect-entry-status.done { color:var(--accent); }

.cycle-blocked { text-align:center; padding:40px 20px; }
.cycle-blocked-msg { font-size:15px; color:var(--ink-2); margin:0 0 8px; line-height:1.6; }
.cycle-blocked-time { font-size:13px; color:var(--meta); margin:0; }

.cycle-confirm { text-align:center; padding:32px 20px; }
.cycle-confirm-msg { font-size:15px; color:var(--ink-2); margin:0 0 20px; line-height:1.6; }
.cycle-confirm-actions { display:flex; gap:12px; justify-content:center; }
.cycle-confirm-yes {
  padding:10px 24px; border:none; border-radius:8px;
  background:var(--accent); color:#fff; font-size:14px; cursor:pointer;
}
.cycle-confirm-no {
  padding:10px 24px; border:1px solid var(--border); border-radius:8px;
  background:transparent; color:var(--meta); font-size:14px; cursor:pointer;
}

.cycle-pick { padding:16px 0; }
.cycle-pick-title { font-size:15px; color:var(--ink); margin:0 0 12px; font-weight:500; }
.cycle-pick-option {
  display:block; width:100%; padding:14px 16px; margin-bottom:8px;
  background:var(--card); border:1px solid var(--border); border-radius:12px;
  cursor:pointer; font-size:14px; text-align:left; color:var(--ink);
}
.cycle-pick-option:hover { border-color:var(--accent); background:var(--accent-soft); }

.loading-state { display:flex; flex-direction:column; align-items:center; gap:12px; }
.loading-hint { font-size:13px; color:var(--meta); }

/* ===== Range Picker ===== */
.agent-range-picker { padding:0 20px; margin-bottom:12px; }
.range-picker { background:var(--card); border:1px solid var(--border); border-radius:12px; padding:12px 14px; }
.range-modes { display:flex; gap:8px; margin-bottom:8px; }
.range-mode {
  flex:1; padding:6px 0; border:1px solid var(--border); border-radius:8px;
  background:transparent; font-size:13px; color:var(--meta); cursor:pointer; text-align:center;
}
.range-mode.active { background:var(--accent-soft); color:var(--accent-2); border-color:var(--accent-border); }
.range-custom { display:flex; align-items:center; gap:8px; margin-top:8px; }
.range-custom input { flex:1; }
.range-custom span { font-size:13px; color:var(--meta); }
.range-label { display:block; font-size:13px; color:var(--meta); }

/* ===== Feedback ===== */
.agent-feedback { margin-top:16px; }
.feedback-form {
  display:flex; flex-wrap:wrap; align-items:center; gap:10px;
  padding:12px 16px; background:var(--card); border:1px solid var(--border);
  border-radius:12px;
}
.feedback-label { font-size:13px; color:var(--meta); }
.feedback-stars { display:flex; gap:2px; }
.feedback-stars .star {
  background:none; border:none; font-size:20px; cursor:pointer;
  color:var(--accent); padding:0 2px;
}
.feedback-comment {
  flex:1; min-width:120px; border:1px solid var(--border); border-radius:8px;
  padding:6px 10px; font-size:13px; outline:none;
}
.feedback-comment:focus { border-color:var(--accent); }
.feedback-submit {
  padding:6px 14px; border:none; border-radius:8px;
  background:var(--accent); color:#fff; font-size:13px; cursor:pointer;
}
.feedback-submit:disabled { opacity:.4; cursor:default; }
.feedback-done { font-size:13px; color:var(--meta); padding:8px 0; }

/* ===== Onboarding ===== */
.onboard-overlay {
  position:fixed; inset:0; z-index:200;
  background:rgba(40,30,10,.45);
  display:flex; align-items:center; justify-content:center;
  padding:24px;
  backdrop-filter:blur(2px);
}
.onboard-card {
  width:100%; max-width:380px;
  background:#fff; border-radius:24px;
  padding:40px 32px 28px;
  box-shadow:0 16px 48px rgba(40,30,10,.2);
  animation:onboard-pop .32s ease-out both;
}
.onboard-emoji { text-align:center; font-size:36px; margin-bottom:12px; color:var(--accent); }
.onboard-title { text-align:center; font-size:22px; font-weight:600; margin:0 0 6px; }
.onboard-sub { text-align:center; font-size:14px; color:var(--meta); margin:0 0 28px; }
.onboard-steps { display:flex; flex-direction:column; gap:18px; margin-bottom:32px; }
.onboard-step { display:flex; align-items:flex-start; gap:12px; }
.step-icon {
  flex-shrink:0; width:36px; height:36px; border-radius:10px;
  background:var(--accent-soft); color:var(--accent-2);
  display:flex; align-items:center; justify-content:center; font-size:18px;
}
.step-icon.gold { background:linear-gradient(135deg,#c89355,#9c6a30); color:#fff; }
.step-body { flex:1; }
.step-title { font-size:15px; font-weight:600; margin-bottom:3px; }
.step-desc { font-size:13px; line-height:1.5; color:var(--ink-2); }
.onboard-cta {
  display:block; width:100%; padding:14px; text-align:center;
  background:linear-gradient(135deg,#c89355,#9c6a30);
  color:#fff; font-size:16px; font-weight:500;
  border:none; border-radius:999px; cursor:pointer;
  box-shadow:0 6px 16px rgba(156,106,48,.3);
}
.onboard-cta:hover { opacity:.92; }
@keyframes onboard-pop {
  from { opacity:0; transform:scale(.94) translateY(8px); }
  to { opacity:1; transform:none; }
}

/* ===== Insight Feed ===== */
.insight-tabs {
  display:flex; gap:8px; padding:0 16px 12px;
}
.insight-tab {
  position:relative; flex:1; display:flex; align-items:center; justify-content:center;
  gap:6px; padding:10px 12px; font-size:14px; font-weight:500;
  border:1px solid var(--border); border-radius:10px; background:var(--card);
  color:var(--ink-2); cursor:pointer; transition:all .15s;
}
.insight-tab i { font-size:16px; }
.insight-tab.active {
  background:var(--accent); border-color:var(--accent); color:#fff;
}
.insight-tab:hover:not(.active) { border-color:var(--accent-border); }
.insight-tab-badge {
  position:absolute; top:-6px; right:-6px;
  min-width:18px; height:18px; padding:0 5px;
  background:#e85d5d; color:#fff; font-size:10px;
  font-weight:600; border-radius:9px; text-align:center; line-height:18px;
}
.insight-tab.active .insight-tab-badge {
  background:#fff; color:var(--accent);
}
.insight-feed { padding:0 16px; }
.insight-empty {
  text-align:center; padding:80px 32px;
  color:var(--meta); font-size:15px; line-height:1.8;
}
.insight-empty::before {
  content:"✨"; display:block; font-size:48px; margin-bottom:16px;
}
.insight-loading { text-align:center; padding:60px 0; color:var(--meta); font-size:14px; }

.insight-card {
  background:var(--card); border:1px solid var(--border); border-radius:12px;
  padding:16px; margin-bottom:10px; cursor:pointer; transition:border-color .15s;
}
.insight-card:hover { border-color:var(--accent-border); }
.insight-card.unread { border-left:3px solid var(--accent); }
.insight-card-header {
  display:flex; align-items:center; justify-content:space-between; margin-bottom:8px;
}
.insight-card-date { font-size:12px; color:var(--meta); }
.insight-card-meta { display:flex; align-items:center; gap:8px; }
.insight-card-period {
  font-size:11px; color:var(--accent-2); background:var(--accent-soft);
  padding:2px 8px; border-radius:10px; font-weight:500;
}
.insight-card-style { font-size:16px; }
.insight-card-preview {
  font-size:14px; color:var(--ink-2); line-height:1.7;
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden;
}
.insight-load-more {
  display:block; width:100%; margin:12px 0; padding:12px;
  background:transparent; border:1px dashed var(--border); border-radius:8px;
  color:var(--meta); font-size:13px; text-align:center; cursor:pointer;
}
.insight-load-more:hover { border-color:var(--accent); color:var(--accent); }

/* Insight Detail */
.insight-detail-page { padding:0 20px; }
.insight-detail-header { margin-bottom:20px; }
.insight-detail-meta { font-size:13px; color:var(--meta); }
.insight-detail-content {
  font-size:16px; line-height:2; color:var(--ink);
  padding:24px; background:var(--card); border:1px solid var(--border);
  border-radius:14px; white-space:pre-wrap; word-break:break-word;
}
.insight-detail-feedback { padding:24px 0; }
.feedback-done { display:flex; align-items:center; gap:10px; }
.feedback-stars { font-size:20px; color:var(--accent); }
.feedback-label { font-size:13px; color:var(--meta); }
.feedback-prompt { font-size:14px; color:var(--ink-2); margin-bottom:12px; }
.feedback-stars-input { display:flex; gap:8px; }
.star-btn {
  font-size:28px; color:var(--accent); background:transparent;
  border:0; cursor:pointer; padding:4px; transition:transform .1s;
}
.star-btn:hover { transform:scale(1.2); }

/* Tab Badge */
.tab-badge {
  position:absolute; top:4px; right:50%; transform:translateX(14px);
  min-width:16px; height:16px; padding:0 4px;
  background:#e85d5d; color:#fff; font-size:10px; font-weight:600;
  border-radius:8px; display:flex; align-items:center; justify-content:center;
}
.tab-badge[hidden] { display:none; }
.tab-item { position:relative; }

/* Onboarding */
.onboarding-page {
  padding:40px 20px; display:flex; flex-direction:column; align-items:center;
  min-height:70vh; justify-content:center;
}
.onboarding-step { width:100%; max-width:400px; animation:onboard-pop .3s ease; }
.onboarding-step.hidden { display:none; }
.onboarding-title {
  font-size:22px; font-weight:600; color:var(--ink); margin-bottom:12px; text-align:center;
}
.onboarding-desc {
  font-size:14px; color:var(--ink-2); line-height:1.8; text-align:center; margin-bottom:32px;
}
.onboarding-next {
  display:block; width:100%; padding:14px; margin-top:24px;
  background:var(--accent); color:#fff; font-size:15px; font-weight:500;
  border:none; border-radius:10px; cursor:pointer;
}
.onboarding-next:hover { opacity:.9; }
.onboarding-styles { display:flex; flex-direction:column; gap:10px; }
.style-option {
  display:flex; align-items:flex-start; gap:12px; padding:14px;
  border:1px solid var(--border); border-radius:10px; cursor:pointer;
  transition:border-color .15s, background .15s;
}
.style-option:has(input:checked), .style-option.active {
  border-color:var(--accent); background:var(--accent-soft);
}
.style-option input { display:none; }
.style-icon { font-size:24px; flex-shrink:0; margin-top:2px; }
.style-body { flex:1; }
.style-name { font-size:15px; font-weight:500; color:var(--ink); display:block; margin-bottom:4px; }
.style-desc { font-size:12px; color:var(--meta); line-height:1.5; }
.onboarding-time-rows { display:flex; flex-direction:column; gap:14px; }
.time-row {
  display:flex; align-items:center; gap:8px; font-size:14px; color:var(--ink-2);
}
.time-row select {
  padding:6px 10px; border:1px solid var(--border); border-radius:6px;
  font-size:14px; background:var(--card);
}

/* Settings: style selector + toggle */
.rs-styles { display:flex; flex-direction:column; gap:8px; margin-top:10px; }
.rs-style-option {
  display:flex; align-items:flex-start; gap:10px; padding:12px;
  border:1px solid var(--border); border-radius:8px; cursor:pointer;
  transition:border-color .15s, background .15s;
}
.rs-style-option.active { border-color:var(--accent); background:var(--accent-soft); }
.rs-style-option input { display:none; }
.rs-style-icon { font-size:20px; flex-shrink:0; }
.rs-style-body { flex:1; }
.rs-style-name { font-size:14px; font-weight:500; color:var(--ink); display:block; margin-bottom:2px; }
.rs-style-desc { font-size:12px; color:var(--meta); line-height:1.4; }
.rs-toggle { position:relative; display:inline-block; width:40px; height:22px; margin-left:auto; }
.rs-toggle input { opacity:0; width:0; height:0; }
.rs-toggle-slider {
  position:absolute; inset:0; background:var(--border); border-radius:11px;
  transition:background .2s; cursor:pointer;
}
.rs-toggle-slider::before {
  content:""; position:absolute; left:2px; top:2px;
  width:18px; height:18px; background:#fff; border-radius:50%;
  transition:transform .2s;
}
.rs-toggle input:checked + .rs-toggle-slider { background:var(--accent); }
.rs-toggle input:checked + .rs-toggle-slider::before { transform:translateX(18px); }
.rs-title { display:flex; align-items:center; gap:8px; }

.header-action {
  background:transparent; border:0; font-size:20px; padding:8px;
  min-width:44px; min-height:44px; color:var(--meta); cursor:pointer;
}
.header-action:hover { color:var(--accent); }

/* Theme Picker */
.theme-picker {
  display:flex; gap:8px; flex-wrap:wrap; margin-top:8px;
}
.theme-swatch {
  display:flex; flex-direction:column; align-items:center; gap:4px;
  padding:8px; border:2px solid var(--border); border-radius:10px;
  cursor:pointer; transition:all .15s; min-width:56px;
}
.theme-swatch:hover { border-color:var(--accent-border); }
.theme-swatch.active { border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-soft); }
.swatch-color {
  width:32px; height:32px; border-radius:50%; border:1px solid rgba(0,0,0,.08);
}
.swatch-name { font-size:11px; color:var(--ink-2); white-space:nowrap; }

/* Insight Settings Page */
.is-section { margin-bottom:20px; }
.is-section-title {
  font-size:14px; font-weight:600; color:var(--ink); margin:0 0 10px;
  padding:0 4px;
}
.is-style-grid {
  display:grid; grid-template-columns:1fr 1fr; gap:8px;
}
.is-style-card {
  display:flex; flex-direction:column; align-items:center; gap:4px;
  padding:14px 8px; border:1.5px solid var(--border); border-radius:12px;
  background:var(--card); cursor:pointer; transition:all .15s; text-align:center;
}
.is-style-card:hover { border-color:var(--accent-border); }
.is-style-card.active { border-color:var(--accent); background:var(--accent-soft); }
.is-style-card input { display:none; }
.is-style-icon { font-size:24px; }
.is-style-name { font-size:13px; font-weight:500; color:var(--ink); }
.is-style-desc { font-size:11px; color:var(--meta); line-height:1.4; }
.is-card {
  background:var(--card); border:1px solid var(--border); border-radius:12px;
  overflow:hidden;
}
.is-card-row {
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px; border-bottom:1px solid var(--divider);
}
.is-card-row:last-child { border-bottom:none; }
.is-label { font-size:14px; color:var(--ink-2); }
.is-select {
  padding:6px 10px; border:1px solid var(--border); border-radius:6px;
  font-size:13px; background:var(--card); color:var(--ink);
}
.is-select-group { display:flex; gap:6px; }
.is-save {
  display:block; width:100%; margin-top:24px; padding:14px;
  background:var(--accent); color:#fff; font-size:15px; font-weight:500;
  border:none; border-radius:10px; cursor:pointer;
}
.is-save:hover { opacity:.9; }

/* Explore Page */
.explore-page { padding:20px 16px; }
.explore-grid { display:flex; flex-direction:column; gap:12px; }
.explore-card {
  display:flex; align-items:center; background:var(--card);
  border-radius:12px; padding:16px; border:1px solid var(--border); cursor:pointer;
}
.explore-card:hover { border-color:var(--accent); }
.explore-card-icon {
  width:44px; height:44px; border-radius:10px; display:flex;
  align-items:center; justify-content:center; font-size:22px; flex-shrink:0;
}
.explore-card-icon.bills { background:#fef3e6; color:#e8700a; }
.explore-card-icon.goals { background:#e8f5e9; color:#4caf50; }
.explore-card-icon.agents { background:#e3f2fd; color:#1976d2; }
.explore-card-body { flex:1; margin-left:12px; }
.explore-card-title { font-size:15px; font-weight:500; color:var(--ink); }
.explore-card-desc { font-size:12px; color:var(--meta); margin-top:2px; }
.explore-card-arrow { font-size:20px; color:var(--meta); flex-shrink:0; }
.explore-footer { margin-top:32px; text-align:center; }
.explore-hint { font-size:13px; color:var(--meta); }

/* Bills Page */
.bills-page { padding:20px 16px; }
.bills-period-tabs { display:flex; justify-content:center; gap:8px; margin-bottom:16px; }
.period-tab {
  padding:6px 20px; border-radius:16px; font-size:13px; cursor:pointer;
  background:var(--card); border:1px solid var(--border); color:var(--meta);
}
.period-tab.active { background:var(--ink); color:#fff; border-color:var(--ink); }
.bills-date-nav { display:flex; align-items:center; justify-content:center; gap:16px; margin-bottom:16px; }
.date-arrow {
  width:28px; height:28px; border-radius:50%; display:flex; align-items:center;
  justify-content:center; background:var(--card); border:1px solid var(--border); cursor:pointer;
}
.date-label { font-size:14px; font-weight:500; }
.bills-summary-card { background:var(--card); border-radius:12px; padding:16px; border:1px solid var(--border); margin-bottom:16px; }
.summary-row { display:flex; justify-content:space-between; margin-bottom:12px; }
.summary-item { text-align:center; flex:1; }
.summary-label { display:block; font-size:11px; color:var(--meta); margin-bottom:4px; }
.summary-amount { display:block; font-size:16px; font-weight:600; }
.summary-amount.expense { color:var(--danger); }
.summary-amount.income { color:#4caf50; }
.necessity-bar { display:flex; height:6px; border-radius:3px; overflow:hidden; background:var(--divider); margin-bottom:8px; }
.bar-need { background:#66bb6a; } .bar-want { background:#ffa726; } .bar-invest { background:#42a5f5; }
.necessity-legend { display:flex; justify-content:center; gap:16px; font-size:11px; color:var(--meta); }
.legend-need::before,.legend-want::before,.legend-invest::before { content:''; display:inline-block; width:8px; height:8px; border-radius:2px; margin-right:4px; vertical-align:middle; }
.legend-need::before { background:#66bb6a; } .legend-want::before { background:#ffa726; } .legend-invest::before { background:#42a5f5; }
.bills-view-toggle { display:flex; justify-content:flex-end; gap:6px; margin-bottom:12px; }
.toggle-btn {
  width:32px; height:32px; display:flex; align-items:center; justify-content:center;
  border-radius:6px; background:var(--card); border:1px solid var(--border); cursor:pointer; font-size:16px; color:var(--meta);
}
.toggle-btn.active { background:var(--ink); border-color:var(--ink); color:#fff; }
.bill-item { display:flex; align-items:center; background:var(--card); border-radius:10px; padding:12px; margin-bottom:8px; border:1px solid var(--border); }
.bill-icon { font-size:20px; margin-right:10px; }
.bill-body { flex:1; overflow:hidden; }
.bill-category { display:block; font-size:13px; font-weight:500; color:var(--ink); }
.bill-merchant { display:block; font-size:11px; color:var(--meta); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bill-right { text-align:right; flex-shrink:0; margin-left:8px; }
.bill-amount { display:block; font-size:14px; font-weight:600; color:var(--danger); }
.bill-item.income .bill-amount { color:#4caf50; }
.bill-time { display:block; font-size:10px; color:var(--meta); }
.chart-categories { background:var(--card); border-radius:12px; padding:16px; border:1px solid var(--border); }
.chart-bar-row { display:flex; align-items:center; margin-bottom:8px; }
.chart-bar-icon { font-size:14px; margin-right:6px; width:20px; text-align:center; }
.chart-bar-label { font-size:11px; color:var(--meta); width:60px; flex-shrink:0; }
.chart-bar-track { flex:1; height:8px; background:var(--divider); border-radius:4px; overflow:hidden; margin:0 8px; }
.chart-bar-fill { height:100%; background:var(--accent); border-radius:4px; min-width:2px; }
.chart-bar-amount { font-size:11px; color:var(--ink); font-weight:500; width:60px; text-align:right; flex-shrink:0; }
.empty { text-align:center; padding:40px 0; color:var(--meta); font-size:13px; }
