/* ========================================
   布谷记事 Design System — Global Styles
   Light Blue Theme
   ======================================== */

/* --- Design Tokens (CSS Variables) --- */
:root {
  /* Background */
  --bg-primary: #F5F7FA;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #EDF1F5;
  --bg-overlay: rgba(0, 0, 0, 0.4);

  /* Accent — Light Blue */
  --primary: #5B9BD5;
  --primary-light: #8FC5F0;
  --primary-dark: #3A7BBF;
  --primary-15: rgba(91, 155, 213, 0.12);
  --primary-10: rgba(91, 155, 213, 0.08);

  /* Schedule Colors */
  --schedule-meeting: #5B9BD5;
  --schedule-meeting-15: rgba(91, 155, 213, 0.1);
  --schedule-conflict: #E85D75;
  --schedule-conflict-15: rgba(232, 93, 117, 0.1);
  --schedule-habit: #4CAF93;
  --schedule-habit-15: rgba(76, 175, 147, 0.1);
  --schedule-todo: #F0A050;
  --schedule-todo-15: rgba(240, 160, 80, 0.1);

  /* Agent */
  --agent-primary: #5B9BD5;
  --agent-secondary: #3A7BBF;
  --agent-glow: rgba(91, 155, 213, 0.2);
  --agent-15: rgba(91, 155, 213, 0.1);

  /* Text */
  --text-primary: #1A1A1A;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --text-placeholder: #B0B8C4;

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;

  /* Radii */
  --radius-card: 12px;
  --radius-button: 8px;
  --radius-input: 22px;
  --radius-tag: 4px;

  /* Shadows */
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-agent: 0 4px 16px rgba(91, 155, 213, 0.15);

  /* Typography */
  --font-cn: -apple-system, 'PingFang SC', 'Helvetica Neue', sans-serif;
  --font-en: -apple-system, 'SF Pro Display', 'Helvetica Neue', sans-serif;
  --font-mono: 'SF Mono', 'Menlo', monospace;

  /* Sizes */
  --heading1: 28px;
  --heading2: 22px;
  --heading3: 17px;
  --body: 15px;
  --caption: 13px;

  /* Layout */
  --phone-width: 393px;
  --phone-height: 852px;
  --navbar-height: 56px;
  --tabbar-height: 48px;
  --dialog-height: 56px;
  --safe-bottom: 34px;

  /* Dividers */
  --divider: rgba(0, 0, 0, 0.05);
  --divider-strong: rgba(0, 0, 0, 0.08);

  /* Legacy aliases */
  --accent-gold: var(--primary);
  --accent-gold-light: var(--primary-light);
  --accent-gold-dark: var(--primary-dark);
  --accent-gold-15: var(--primary-15);
}

/* ========================================
   Pink Theme (Female)
   ======================================== */
[data-theme="pink"] {
  --primary: #E88D95;
  --primary-light: #F5BCC3;
  --primary-dark: #D06B78;
  --primary-15: rgba(232, 141, 149, 0.12);
  --primary-10: rgba(232, 141, 149, 0.08);

  --schedule-meeting: #E88D95;
  --schedule-meeting-15: rgba(232, 141, 149, 0.1);
  --schedule-conflict: #E85D75;
  --schedule-conflict-15: rgba(232, 93, 117, 0.1);
  --schedule-habit: #8FC9A9;
  --schedule-habit-15: rgba(143, 201, 169, 0.1);
  --schedule-todo: #F0A050;
  --schedule-todo-15: rgba(240, 160, 80, 0.1);

  --agent-primary: #E88D95;
  --agent-secondary: #D06B78;
  --agent-glow: rgba(232, 141, 149, 0.2);
  --agent-15: rgba(232, 141, 149, 0.1);

  --shadow-agent: 0 4px 16px rgba(232, 141, 149, 0.15);

  --accent-gold: var(--primary);
  --accent-gold-light: var(--primary-light);
  --accent-gold-dark: var(--primary-dark);
  --accent-gold-15: var(--primary-15);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-cn);
  font-size: var(--body);
  color: var(--text-primary);
  background: #E0E5EC;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

input, textarea {
  border: none;
  outline: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
}

ul, ol { list-style: none; }

/* --- Phone Frame --- */
.phone-frame {
  width: var(--phone-width);
  height: var(--phone-height);
  margin: 20px auto;
  background: var(--bg-primary);
  border-radius: 44px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 0 2px #C8CDD4, 0 20px 60px rgba(0, 0, 0, 0.15);
}

@media (min-width: 500px) {
  body {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
  }
}

@media (max-width: 499px) {
  .phone-frame {
    width: 100%;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

/* --- Status Bar --- */
.status-bar {
  height: 54px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 28px 8px;
  font-family: var(--font-en);
  font-size: var(--caption);
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-primary);
}
.status-bar .time { font-variant-numeric: tabular-nums; }
.status-bar .icons { display: flex; gap: 6px; align-items: center; }

/* --- Navigation Bar --- */
.navbar {
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-md);
  background: var(--bg-primary);
  position: relative;
  z-index: 10;
}
.navbar-title {
  font-size: 20px;
  font-weight: 600;
  font-family: var(--font-en);
  color: var(--text-primary);
  letter-spacing: -0.3px;
}
.navbar-subtitle {
  font-size: var(--caption);
  color: var(--text-secondary);
  margin-top: -4px;
}
.navbar-left { display: flex; align-items: center; gap: var(--spacing-sm); }
.navbar-right { display: flex; align-items: center; gap: var(--spacing-sm); }
.navbar-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 18px;
  transition: background 0.2s; color: var(--text-primary);
}
.navbar-btn:active { background: var(--bg-tertiary); }

/* =========================================
   TOP TAB BAR (moved from bottom)
   ========================================= */
.top-tabbar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: var(--tabbar-height);
  background: var(--bg-primary);
  border-bottom: 0.5px solid var(--divider);
  position: relative;
  z-index: 10;
}

.top-tab-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-tertiary);
  transition: color 0.2s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  padding: 4px 16px;
  position: relative;
  height: 100%;
}

.top-tab-item .tab-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
}

.top-tab-item .tab-icon svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: var(--text-tertiary);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s;
}

.top-tab-item.active { color: var(--primary); }
.top-tab-item.active .tab-icon svg { stroke: var(--primary); }
.top-tab-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 2.5px;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
}

/* --- Old Tab Bar (keeping for backward compat, but hidden) --- */
.tabbar {
  display: none;
}
.tab-item { display: none; }

/* =========================================
   BOTTOM DIALOG (fixed, on all tabs)
   ========================================= */
.bottom-dialog {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border-top: 0.5px solid var(--divider);
  z-index: 200;
  padding: var(--spacing-xs) var(--spacing-md);
  padding-bottom: max(var(--spacing-xs), env(safe-area-inset-bottom));
}

/* Quick topic chips */
.quick-topics {
  display: flex;
  gap: 6px;
  padding: 4px 0 6px;
  overflow-x: auto;
}
.quick-topics::-webkit-scrollbar { display: none; }

.quick-topic {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.quick-topic:active {
  background: var(--primary-15);
  color: var(--primary);
}

/* Dialog input row */
.dialog-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.dialog-input {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--divider-strong);
  border-radius: 24px;
  padding: 8px 14px;
  min-height: 38px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.dialog-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-15);
}

.dialog-input span {
  flex: 1;
  font-size: var(--body);
  color: var(--text-placeholder);
  line-height: 1.4;
  user-select: none;
  cursor: text;
  min-height: 20px;
}

.dialog-input textarea {
  display: none;
  flex: 1;
  font-size: var(--body);
  color: var(--text-primary);
  line-height: 1.4;
  resize: none;
  min-height: 20px;
  max-height: 80px;
}

.dialog-input.active span { display: none; }
.dialog-input.active textarea { display: block; }

/* Mic button (long press → voice) */
.dialog-mic {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 18px;
  color: var(--text-secondary);
  transition: all 0.2s;
  flex-shrink: 0;
}
.dialog-mic:active {
  background: var(--primary-15);
  color: var(--primary);
}
.dialog-mic.recording {
  background: var(--schedule-conflict-15);
  color: var(--schedule-conflict);
  animation: goldGlow 1s ease-in-out infinite;
}

/* Add button */
.dialog-add {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--primary-10);
  color: var(--primary);
  font-size: 22px;
  font-weight: 300;
  transition: all 0.2s;
  flex-shrink: 0;
  line-height: 1;
}
.dialog-add:active {
  background: var(--primary-15);
  transform: scale(0.95);
}

/* --- Page Content Area --- */
.page-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 100px; /* space for bottom dialog */
}
.page-content::-webkit-scrollbar { display: none; }

/* --- Page Layout --- */
.page-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-primary);
}

/* --- Card --- */
.card {
  background: var(--bg-secondary);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.card-glow { border: 1px solid rgba(91, 155, 213, 0.2); }
.card-elevated { box-shadow: var(--shadow-sm); }

/* --- Agent Card (blue left border) --- */
.agent-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-card);
  border-left: 3px solid var(--primary);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-sm);
}

/* --- Schedule Card --- */
.schedule-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-card);
  padding: var(--spacing-md);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}
.schedule-card:active { transform: scale(0.97); }
.schedule-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
}
.schedule-card[data-type="meeting"]::before { background: var(--schedule-meeting); }
.schedule-card[data-type="conflict"]::before { background: var(--schedule-conflict); }
.schedule-card[data-type="habit"]::before { background: var(--schedule-habit); }
.schedule-card[data-type="todo"]::before { background: var(--schedule-todo); }
.schedule-card .sc-title {
  font-size: var(--body); font-weight: 500;
  margin-bottom: 4px; color: var(--text-primary);
}
.schedule-card .sc-time {
  font-size: var(--caption); color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.schedule-card .sc-location {
  font-size: var(--caption); color: var(--text-tertiary); margin-top: 2px;
}

/* --- Badge --- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500;
}
.badge-conflict { background: var(--schedule-conflict-15); color: var(--schedule-conflict); }
.badge-habit { background: var(--schedule-habit-15); color: var(--schedule-habit); }
.badge-todo { background: var(--schedule-todo-15); color: var(--schedule-todo); }
.badge-agent { background: var(--primary-15); color: var(--primary-dark); }

/* --- Color Dot --- */
.color-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.color-dot.meeting { background: var(--schedule-meeting); }
.color-dot.conflict { background: var(--schedule-conflict); }
.color-dot.habit { background: var(--schedule-habit); }
.color-dot.todo { background: var(--schedule-todo); }
.color-dot.agent { background: var(--primary); }

/* --- Chat Bubble --- */
.chat-bubble {
  max-width: 85%; padding: 10px 14px; border-radius: 16px;
  font-size: var(--body); line-height: 1.5; position: relative; word-break: break-word;
}
.chat-bubble.user {
  background: var(--primary); border-radius: 16px 4px 16px 16px;
  align-self: flex-end; color: #FFFFFF;
}
.chat-bubble.agent {
  background: var(--bg-secondary); border-radius: 4px 16px 16px 16px;
  border-left: 2px solid var(--primary);
  align-self: flex-start; color: var(--text-primary); box-shadow: var(--shadow-sm);
}

/* --- Quick Input (legacy) --- */
.quick-input {
  display: flex; align-items: center; gap: var(--spacing-sm);
  padding: 8px 16px; background: var(--bg-secondary);
  border-top: 0.5px solid var(--divider);
}
.quick-input-field {
  flex: 1; display: flex; align-items: center;
  background: var(--bg-tertiary); border-radius: var(--radius-input);
  padding: 10px 16px; gap: var(--spacing-sm);
}
.quick-input-field input { flex: 1; background: none; color: var(--text-primary); font-size: var(--body); }
.quick-input-field input::placeholder { color: var(--text-tertiary); }
.quick-input-field .send-btn {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--primary); color: #FFFFFF;
  font-size: 14px; font-weight: 700; transition: opacity 0.2s, transform 0.2s;
}
.quick-input-field .send-btn:active { transform: scale(0.9); }
.quick-input-field .send-btn.disabled { opacity: 0.3; pointer-events: none; }

.voice-btn {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 20px; transition: background 0.2s; color: var(--text-secondary);
}
.voice-btn:active { background: var(--bg-tertiary); }

/* --- Toggle Switch --- */
.toggle {
  position: relative; width: 48px; height: 28px; cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider {
  position: absolute; inset: 0; background: #CCCCCC;
  border-radius: 14px; transition: background 0.3s;
}
.toggle .slider::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #FFFFFF; transition: transform 0.3s, background 0.3s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.toggle input:checked + .slider { background: var(--primary); }
.toggle input:checked + .slider::after { transform: translateX(20px); background: #FFFFFF; }

/* --- Segmented Control --- */
.segmented-control {
  display: flex; background: var(--bg-tertiary);
  border-radius: var(--radius-button); padding: 2px; gap: 2px;
}
.segmented-control .seg-item {
  flex: 1; text-align: center; padding: 8px 0;
  font-size: var(--caption); font-weight: 500;
  color: var(--text-secondary); border-radius: 6px;
  cursor: pointer; transition: all 0.25s;
}
.segmented-control .seg-item.active {
  background: var(--bg-secondary); color: var(--primary);
  font-weight: 600; box-shadow: var(--shadow-sm);
}

/* --- Section Header --- */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-md) var(--spacing-sm);
}
.section-header .sh-title {
  font-size: var(--heading3); font-weight: 600; color: var(--text-primary);
}
.section-header .sh-count {
  font-size: var(--caption); color: var(--text-secondary);
}

/* --- Empty State --- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px var(--spacing-xl); text-align: center;
}
.empty-state .es-icon { font-size: 48px; margin-bottom: var(--spacing-md); }
.empty-state .es-text { font-size: var(--body); color: var(--text-secondary); }

/* --- Animations --- */
@keyframes agentThink {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.6; }
}
.agent-thinking { display: flex; gap: 6px; padding: 8px 0; }
.agent-thinking .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); animation: agentThink 1.5s ease-in-out infinite;
}
.agent-thinking .dot:nth-child(2) { animation-delay: 0.3s; }
.agent-thinking .dot:nth-child(3) { animation-delay: 0.6s; }

@keyframes agentSweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.agent-sweep { position: relative; overflow: hidden; }
.agent-sweep::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--primary-15), transparent);
  animation: agentSweep 0.8s linear;
}

@keyframes confirmBounce {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.confirm-bounce { animation: confirmBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

@keyframes alertFlash {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

@keyframes goldGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91, 155, 213, 0); }
  50% { box-shadow: 0 0 12px 2px rgba(91, 155, 213, 0.2); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease-out; }

/* --- Utility Classes --- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--spacing-xs); }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-conflict { color: var(--schedule-conflict); }
.text-habit { color: var(--schedule-habit); }
.text-todo { color: var(--schedule-todo); }
.text-agent { color: var(--primary); }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.rounded-card { border-radius: var(--radius-card); }
.rounded-button { border-radius: var(--radius-button); }
.rounded-input { border-radius: var(--radius-input); }

/* --- Scrollbar Hidden --- */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* --- Avatar --- */
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  color: var(--primary); background: var(--primary-15);
}

/* --- Subtask --- */
.subtask {
  display: flex; align-items: center; gap: var(--spacing-sm);
  padding: 10px 0; border-bottom: 0.5px solid var(--divider);
}
.subtask:last-child { border-bottom: none; }
.subtask .checkbox {
  width: 20px; height: 20px; border-radius: 4px;
  border: 2px solid var(--text-tertiary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}
.subtask .checkbox.checked { background: var(--primary); border-color: var(--primary); }
.subtask .checkbox.checked::after {
  content: '✓'; color: #FFFFFF; font-size: 12px; font-weight: 700;
}
.subtask .subtask-text { font-size: var(--body); flex: 1; }
.subtask .subtask-text.completed { text-decoration: line-through; color: var(--text-tertiary); }

/* --- Settings Row --- */
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--spacing-md); border-bottom: 0.5px solid var(--divider);
}
.settings-row:last-child { border-bottom: none; }
.settings-row .sr-label {
  display: flex; align-items: center; gap: var(--spacing-sm);
  font-size: var(--body); color: var(--text-primary);
}
.settings-row .sr-value {
  font-size: var(--caption); color: var(--text-secondary);
  display: flex; align-items: center; gap: 4px;
}

/* --- Settings Group --- */
.settings-group { margin: var(--spacing-md); }
.settings-group-title {
  font-size: var(--caption); font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 0 var(--spacing-md) var(--spacing-sm);
}
.settings-group .card { overflow: hidden; }

/* --- Button --- */
.btn {
  padding: 10px 20px; border-radius: var(--radius-button);
  font-size: var(--body); font-weight: 500;
  transition: all 0.2s; text-align: center;
}
.btn-primary { background: var(--primary); color: #FFFFFF; }
.btn-primary:active { background: var(--primary-dark); }
.btn-secondary { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-secondary:active { background: var(--primary-15); }
.btn-danger { color: var(--schedule-conflict); font-size: var(--body); }
.btn-agent { background: var(--primary); color: #FFFFFF; }

/* --- Quick Tags --- */
.quick-tags {
  display: flex; gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md); overflow-x: auto;
}
.quick-tags::-webkit-scrollbar { display: none; }
.quick-tag {
  padding: 6px 14px; border-radius: 16px; font-size: var(--caption);
  white-space: nowrap; background: var(--bg-tertiary);
  color: var(--text-secondary); cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}
.quick-tag:active { background: var(--primary-15); color: var(--primary); }

/* --- Bottom Sheet --- */
.bottom-sheet {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--bg-secondary); border-radius: 20px 20px 0 0;
  padding: var(--spacing-lg) var(--spacing-md) 120px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 200; box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}
.bottom-sheet.open { transform: translateY(0); }
.bottom-sheet-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: #D1D1D6; margin: 0 auto var(--spacing-md);
}

/* --- Overlay --- */
.overlay {
  position: absolute; inset: 0;
  background: var(--bg-overlay); z-index: 150;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.overlay.visible { opacity: 1; pointer-events: auto; }

/* --- Timeline (Waterfall Schedule) --- */
.schedule-timeline {
  display: flex; flex-direction: column; padding: 0 var(--spacing-md);
}
.timeline-item { display: flex; min-height: 72px; }
.timeline-left {
  display: flex; flex-direction: column; align-items: flex-end;
  width: 52px; flex-shrink: 0; position: relative;
}
.timeline-time {
  font-family: var(--font-en); font-size: var(--caption); font-weight: 600;
  color: var(--text-secondary); font-variant-numeric: tabular-nums;
  line-height: 1; padding-top: 14px;
}
.timeline-line {
  flex: 1; width: 2px; background: var(--bg-tertiary);
  position: relative; margin: 6px 0;
}
.timeline-dot {
  width: 10px; height: 10px; border-radius: 50%;
  position: absolute; top: -1px; right: -4px;
  border: 2px solid var(--bg-primary); z-index: 2;
}
.timeline-dot.meeting { background: var(--schedule-meeting); }
.timeline-dot.conflict { background: var(--schedule-conflict); }
.timeline-dot.habit { background: var(--schedule-habit); }
.timeline-dot.todo { background: var(--schedule-todo); }
.timeline-item.conflict .timeline-line {
  background: repeating-linear-gradient(
    to bottom,
    var(--schedule-conflict) 0px,
    var(--schedule-conflict) 4px,
    transparent 4px,
    transparent 8px
  );
  background-size: 2px 8px;
}
.timeline-item:last-child .timeline-line { display: none; }

.timeline-card {
  flex: 1; background: var(--bg-secondary); border-radius: var(--radius-card);
  padding: 12px 14px; margin: 6px 0 6px 12px;
  position: relative; overflow: hidden; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm); text-decoration: none; color: inherit; display: block;
}
.timeline-card:active { transform: scale(0.98); }
.timeline-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.timeline-card[data-type="meeting"]::before { background: var(--schedule-meeting); }
.timeline-card[data-type="conflict"]::before { background: var(--schedule-conflict); }
.timeline-card[data-type="habit"]::before { background: var(--schedule-habit); }
.timeline-card[data-type="todo"]::before { background: var(--schedule-todo); }
.timeline-card .sc-title {
  font-size: var(--body); font-weight: 500; color: var(--text-primary); margin-bottom: 4px;
}
.timeline-card .sc-meta {
  font-size: var(--caption); color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px;
}
.timeline-card .sc-meta .sc-sep { color: var(--text-tertiary); }
.timeline-card .sc-location {
  font-size: var(--caption); color: var(--text-tertiary); margin-top: 2px;
}

/* --- Now Indicator --- */
.now-indicator {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
  background: var(--primary-15); color: var(--primary);
  animation: nowPulse 2s ease-in-out infinite;
}
.now-indicator .now-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary); animation: agentThink 1.5s ease-in-out infinite;
}
@keyframes nowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91, 155, 213, 0); }
  50% { box-shadow: 0 0 8px 2px rgba(91, 155, 213, 0.2); }
}

/* --- Cuckoo Icon --- */
.cuckoo-icon { display: inline-flex; align-items: center; justify-content: center; }
.cuckoo-icon svg {
  fill: none; stroke: var(--agent-primary); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.cuckoo-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-15); border-radius: 50%; flex-shrink: 0;
}
.cuckoo-avatar svg {
  fill: none; stroke: var(--agent-primary); stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}

/* --- A11Y --- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
