:root {
  --bg: #0e0e10; --bg2: #16161a; --bg3: #1e1e24; --bg4: #26262e;
  --border: rgba(255,255,255,0.08); --border2: rgba(255,255,255,0.16);
  --text: #f0ede8; --text2: #9a9690; --text3: #5a5855;
  --accent: #c8a96e; --accent2: #e8c98e;
  --green: #5dba8a; --red: #e06b6b; --blue: #6b9fe0; --purple: #9b7fe0;
  --radius: 14px; --radius-sm: 9px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { background: var(--bg); color: var(--text); font-family: 'Noto Serif SC', Georgia, serif; min-height: 100dvh; overflow-x: hidden; }

/* ── Layout ── */
.app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; padding-top: var(--safe-top); }

/* ── Header ── */
.header { padding: 14px 16px 10px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--bg); z-index: 20; border-bottom: 0.5px solid var(--border); gap: 8px; }
.header-left h1 { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.header-sub { display: flex; align-items: center; gap: 6px; margin-top: 1px; }
.cal-label { font-size: 11px; color: var(--accent); font-family: 'DM Mono', monospace; background: rgba(200,169,110,0.1); padding: 2px 7px; border-radius: 8px; border: 0.5px solid rgba(200,169,110,0.2); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.icon-btn { background: var(--bg3); border: 0.5px solid var(--border); color: var(--text2); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.icon-btn:hover { border-color: var(--border2); }
.account-area { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm); transition: background 0.15s; }
.account-area:hover { background: var(--bg3); }
.avatar { width: 28px; height: 28px; border-radius: 50%; border: 0.5px solid var(--border2); object-fit: cover; display: none; }
.header-auth-btn { font-size: 12px; color: var(--text2); font-family: 'Noto Serif SC', serif; white-space: nowrap; }

/* ── Bottom Nav ── */
.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; background: rgba(14,14,16,0.96); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 0.5px solid var(--border); display: flex; padding: 8px 0 calc(8px + var(--safe-bottom)); z-index: 100; }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; cursor: pointer; border: none; background: none; color: var(--text3); font-size: 10px; font-family: 'Noto Serif SC', serif; transition: color 0.15s; }
.nav-item.active { color: var(--accent); }
.nav-icon { font-size: 18px; line-height: 1; }

/* ── Pages ── */
.page { display: none; padding: 12px 14px calc(80px + var(--safe-bottom)); animation: fadeIn 0.18s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

/* ── Toast ── */
.toast-wrap { position: fixed; top: calc(68px + var(--safe-top)); left: 50%; transform: translateX(-50%); width: calc(100% - 28px); max-width: 452px; z-index: 999; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; font-family: 'DM Mono', monospace; display: flex; align-items: center; gap: 8px; animation: toastIn 0.2s ease; pointer-events: auto; }
.toast-success { background: rgba(93,186,138,0.15); color: var(--green); border: 0.5px solid rgba(93,186,138,0.35); }
.toast-error { background: rgba(224,107,107,0.15); color: var(--red); border: 0.5px solid rgba(224,107,107,0.35); }
.toast-loading { background: rgba(200,169,110,0.12); color: var(--accent); border: 0.5px solid rgba(200,169,110,0.3); }
.toast-info { background: rgba(107,159,224,0.12); color: var(--blue); border: 0.5px solid rgba(107,159,224,0.3); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Token warning ── */
.token-warn { background: rgba(224,107,107,0.1); border: 0.5px solid rgba(224,107,107,0.3); border-radius: var(--radius-sm); padding: 9px 14px; font-size: 13px; color: var(--red); margin: 0 14px 8px; display: none; }
.token-warn.visible { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ── Login ── */
.login-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 82vh; padding: 32px; text-align: center; }
.login-icon { font-size: 42px; margin-bottom: 14px; }
.login-title { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.login-sub { font-size: 13px; color: var(--text2); line-height: 1.7; margin-bottom: 24px; }
.warn-text { display: block; color: var(--red); font-size: 12px; margin-top: 8px; }
.google-btn { display: flex; align-items: center; gap: 10px; padding: 13px 24px; background: var(--bg2); border: 0.5px solid var(--border2); border-radius: var(--radius); cursor: pointer; font-size: 14px; color: var(--text); font-family: 'Noto Serif SC', serif; transition: all 0.15s; width: 100%; justify-content: center; }
.google-btn:hover { background: var(--bg3); border-color: var(--accent); }
.google-logo { width: 20px; height: 20px; flex-shrink: 0; }
#savedAccountsList { width: 100%; margin-top: 16px; }
.saved-account-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; cursor: pointer; transition: border-color 0.15s; }
.saved-account-item:hover { border-color: var(--accent); }
.saved-account-item img { width: 32px; height: 32px; border-radius: 50%; }
.saved-account-name { font-size: 14px; flex: 1; }
.saved-account-email { font-size: 11px; color: var(--text3); }

/* ── Cards ── */
.card { background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--radius); padding: 13px 15px; margin-bottom: 10px; }
.card-label { font-size: 10px; letter-spacing: 0.1em; color: var(--text3); text-transform: uppercase; margin-bottom: 10px; font-family: 'DM Mono', monospace; }

/* ── Page toolbar ── */
.page-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.page-date { font-size: 13px; color: var(--text2); font-family: 'DM Mono', monospace; }
.toolbar-actions { display: flex; gap: 6px; }

/* ── Batch bar ── */
.batch-bar { background: var(--bg3); border: 0.5px solid var(--border2); border-radius: var(--radius-sm); padding: 9px 13px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 13px; }
.batch-actions { display: flex; gap: 6px; }

/* ── Event items ── */
.event-item { background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; transition: border-color 0.15s; position: relative; overflow: hidden; }
.event-item:hover { border-color: var(--border2); }
.event-item.selected { border-color: var(--accent); background: rgba(200,169,110,0.05); }
.event-item.done { opacity: 0.55; }
.event-item.done .event-name { text-decoration: line-through; color: var(--text3); }
.event-color-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: var(--radius) 0 0 var(--radius); }
.event-inner { padding-left: 8px; }
.event-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.event-name { font-size: 14px; font-weight: 500; flex: 1; min-width: 0; }
.event-meta { font-size: 12px; color: var(--text2); margin-top: 3px; font-family: 'DM Mono', monospace; }
.event-desc { font-size: 12px; color: var(--text2); margin-top: 4px; line-height: 1.5; }
.event-actual { font-size: 12px; color: var(--green); margin-top: 4px; font-family: 'DM Mono', monospace; }
.event-actual.over { color: var(--red); }
.event-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.event-checkbox { width: 18px; height: 18px; border-radius: 4px; border: 0.5px solid var(--border2); background: var(--bg3); cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.event-checkbox.checked { background: var(--accent); border-color: var(--accent); }

/* ── Badges ── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 9px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.badge-学习 { background: #0d2340; color: #6b9fe0; }
.badge-课程 { background: #1a1040; color: #9b7fe0; }
.badge-科研 { background: #0d2a2a; color: #4dbdbd; }
.badge-社工 { background: #0d2a1a; color: #5dba8a; }
.badge-运动 { background: #2a1a0d; color: #e09b4d; }
.badge-娱乐 { background: #2a0d1a; color: #e04d8a; }
.badge-工作 { background: #2a1a1a; color: #e06b6b; }
.badge-其他 { background: #1e1e24; color: #9a9690; }

/* ── Buttons ── */
.btn { padding: 10px 14px; font-size: 13px; font-weight: 500; border-radius: var(--radius-sm); cursor: pointer; border: 0.5px solid var(--border2); background: var(--bg3); color: var(--text); transition: all 0.15s; font-family: 'Noto Serif SC', serif; width: 100%; }
.btn:hover { background: var(--bg4); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: #1a1208; border-color: transparent; font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--accent2); }
.btn-sm { width: auto; padding: 5px 11px; font-size: 12px; }
.btn-success { border-color: var(--green); color: var(--green); }
.btn-success:hover { background: rgba(93,186,138,0.1); }
.btn-danger { border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: rgba(224,107,107,0.1); }
.btn-ai { border-color: var(--accent); color: var(--accent); margin-top: 8px; }
.btn-ai:hover { background: rgba(200,169,110,0.08); }

/* ── Chat ── */
.chat-area { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; min-height: 100px; }
.msg { display: flex; gap: 8px; align-items: flex-end; }
.msg-ai { flex-direction: row; }
.msg-user { flex-direction: row-reverse; }
.msg-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--bg3); border: 0.5px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; color: var(--text2); }
.bubble { max-width: 82%; padding: 9px 13px; border-radius: 14px; font-size: 13px; line-height: 1.6; }
.bubble-ai { background: var(--bg3); border: 0.5px solid var(--border); border-bottom-left-radius: 4px; }
.bubble-user { background: var(--accent); color: #1a1208; border-bottom-right-radius: 4px; font-weight: 500; }
.bubble-thinking { background: var(--bg3); border: 0.5px solid var(--border); border-bottom-left-radius: 4px; color: var(--text2); }
.chat-input-wrap { position: sticky; bottom: calc(68px + var(--safe-bottom)); background: linear-gradient(to top, var(--bg) 80%, transparent); padding: 10px 0 4px; display: flex; gap: 8px; align-items: flex-end; }
.chat-input { flex: 1; padding: 10px 13px; font-size: 14px; background: var(--bg2); border: 0.5px solid var(--border2); border-radius: var(--radius); color: var(--text); font-family: 'Noto Serif SC', serif; resize: none; min-height: 44px; max-height: 120px; line-height: 1.5; transition: border-color 0.15s; overflow-y: auto; }
.chat-input:focus { outline: none; border-color: var(--accent); }
.chat-input::placeholder { color: var(--text3); }
.send-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); border: none; cursor: pointer; font-size: 20px; color: #1a1208; font-weight: 600; display: flex; align-items: center; justify-content: center; transition: all 0.15s; flex-shrink: 0; }
.send-btn:hover { background: var(--accent2); }
.send-btn:active { transform: scale(0.94); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ── Confirm card ── */
.confirm-card { background: var(--bg2); border: 0.5px solid rgba(200,169,110,0.35); border-radius: var(--radius); padding: 13px 15px; margin-bottom: 10px; }
.confirm-title { font-size: 13px; font-weight: 500; color: var(--accent); margin-bottom: 10px; }
.confirm-row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 0.5px solid var(--border); font-size: 13px; }
.confirm-row:last-of-type { border-bottom: none; }
.confirm-key { color: var(--text2); }
.confirm-val { color: var(--text); text-align: right; max-width: 62%; }
.confirm-actions { display: flex; gap: 8px; margin-top: 11px; }

/* ── Stats ── */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.stat-card { background: var(--bg3); border-radius: var(--radius-sm); padding: 12px; border: 0.5px solid var(--border); }
.stat-label { font-size: 11px; color: var(--text3); margin-bottom: 4px; font-family: 'DM Mono', monospace; }
.stat-val { font-size: 24px; font-weight: 600; color: var(--accent); letter-spacing: -0.02em; }
.stat-sub { font-size: 11px; color: var(--text3); margin-top: 2px; font-family: 'DM Mono', monospace; }
.week-nav-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.week-arrow { background: var(--bg3); border: 0.5px solid var(--border); color: var(--text2); padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; }
.week-label-txt { font-size: 14px; font-weight: 500; }

/* Bar chart rows */
.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.bar-label { font-size: 12px; color: var(--text2); width: 38px; flex-shrink: 0; }
.bar-wrap { flex: 1; }
.bar-track { height: 6px; background: var(--bg4); border-radius: 3px; overflow: hidden; margin-bottom: 2px; }
.bar-fill { height: 100%; border-radius: 3px; transition: width 0.6s ease; }
.bar-pct { font-size: 10px; color: var(--text3); font-family: 'DM Mono', monospace; }
.bar-time { font-size: 11px; color: var(--text2); width: 36px; text-align: right; flex-shrink: 0; font-family: 'DM Mono', monospace; }

/* Compare rows */
.compare-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 0.5px solid var(--border); }
.compare-row:last-child { border-bottom: none; }
.compare-name { font-size: 13px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-detail { text-align: right; }
.compare-vals { font-size: 11px; color: var(--text3); font-family: 'DM Mono', monospace; }
.compare-bar-wrap { width: 80px; height: 4px; background: var(--bg4); border-radius: 2px; overflow: hidden; margin-top: 3px; margin-left: auto; }
.compare-bar-fill { height: 100%; border-radius: 2px; }
.compare-diff { font-size: 12px; font-weight: 500; font-family: 'DM Mono', monospace; }
.diff-over { color: var(--red); }
.diff-under { color: var(--green); }

/* ── AI box ── */
.ai-box { background: var(--bg3); border: 0.5px solid rgba(200,169,110,0.25); border-radius: var(--radius); padding: 13px; margin-top: 8px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; display: none; }
.ai-box.visible { display: block; }
.ai-label { font-size: 10px; color: var(--accent); font-family: 'DM Mono', monospace; letter-spacing: 0.08em; margin-bottom: 8px; }

/* ── Settings ── */
.form-label { font-size: 12px; color: var(--text2); margin-bottom: 5px; display: block; }
.form-row { margin-bottom: 11px; }
.form-input { width: 100%; padding: 9px 12px; font-size: 14px; background: var(--bg3); border: 0.5px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-family: 'Noto Serif SC', serif; transition: border-color 0.15s; -webkit-appearance: none; }
.form-input:focus { outline: none; border-color: var(--accent); }
.form-input::placeholder { color: var(--text3); }
select.form-input option { background: var(--bg3); }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 0.5px solid var(--border); gap: 12px; }
.settings-row:last-child { border-bottom: none; }
.settings-lbl { font-size: 14px; }
.settings-sub { font-size: 11px; color: var(--text3); margin-top: 2px; }
.settings-input { width: 110px; flex-shrink: 0; }
.api-key-wrap { position: relative; }
.api-key-wrap input { padding-right: 40px; }
.eye-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text3); cursor: pointer; font-size: 15px; padding: 4px; }
.security-note { font-size: 11px; color: var(--text3); line-height: 1.6; padding: 9px 11px; background: var(--bg3); border-radius: var(--radius-sm); margin-top: 8px; }
.ext-link { font-size: 12px; color: var(--accent); text-decoration: none; display: block; margin-top: 10px; }
.revoke-link { font-size: 11px; color: var(--red); text-decoration: none; display: block; margin-top: 8px; }
.footer-note { text-align: center; margin-top: 20px; font-size: 11px; color: var(--text3); line-height: 1.8; }

/* Account list in settings */
.account-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 0.5px solid var(--border); }
.account-row:last-child { border-bottom: none; }
.account-row img { width: 30px; height: 30px; border-radius: 50%; }
.account-row-info { flex: 1; }
.account-row-name { font-size: 13px; }
.account-row-email { font-size: 11px; color: var(--text3); }
.account-row-active { font-size: 10px; color: var(--green); font-family: 'DM Mono', monospace; }

/* ── Modals ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200; display: none; align-items: flex-end; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: var(--bg2); border: 0.5px solid var(--border2); border-radius: var(--radius) var(--radius) 0 0; padding: 20px 18px calc(20px + var(--safe-bottom)); width: 100%; max-width: 480px; max-height: 70vh; overflow-y: auto; animation: slideUp 0.22s ease; }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
.cal-option { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 0.5px solid var(--border); cursor: pointer; transition: opacity 0.15s; }
.cal-option:hover { opacity: 0.8; }
.cal-option:last-child { border-bottom: none; }
.cal-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.cal-option-name { font-size: 14px; flex: 1; }
.cal-option-check { font-size: 14px; color: var(--accent); }

/* ── Out-of-hours banner ── */
.ooh-banner { background: rgba(224,107,107,0.1); border: 0.5px solid rgba(224,107,107,0.3); border-radius: var(--radius-sm); padding: 10px 13px; font-size: 13px; color: var(--red); margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ooh-banner.hidden { display: none; }

/* ── Misc ── */
.spinner { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(200,169,110,0.3); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; vertical-align: middle; margin-right: 5px; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 36px 16px; color: var(--text3); font-size: 14px; }
.empty-icon { font-size: 28px; margin-bottom: 8px; }
.section-title { font-size: 11px; letter-spacing: 0.08em; color: var(--text3); text-transform: uppercase; margin: 14px 0 8px; font-family: 'DM Mono', monospace; }

/* ══ Calendar View ══ */
.calview-toolbar { display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:8px; }
.calview-title-wrap { display:flex;flex-direction:column;align-items:center;gap:4px;flex:1; }
.calview-title { font-size:14px;font-weight:500;color:var(--text); }
.calview-mode-switch { display:flex;gap:3px;background:var(--bg3);border-radius:var(--radius-sm);padding:2px; }
.mode-btn { background:none;border:none;color:var(--text2);font-size:12px;padding:3px 10px;border-radius:6px;cursor:pointer;font-family:'Noto Serif SC',serif;transition:all 0.15s; }
.mode-btn.active { background:var(--bg2);color:var(--accent);border:0.5px solid var(--border); }

/* Week view grid */
.cv-week { display:flex;flex-direction:column;overflow:hidden; }
.cv-header-row { display:grid;grid-template-columns:36px repeat(7,1fr);border-bottom:0.5px solid var(--border);padding-bottom:6px;margin-bottom:4px; }
.cv-day-head { text-align:center;font-size:11px;color:var(--text2);font-family:'DM Mono',monospace;line-height:1.4; }
.cv-day-head.today { color:var(--accent);font-weight:600; }
.cv-day-num { font-size:14px;font-weight:500;display:block; }
.cv-body { position:relative;overflow-y:auto;max-height:calc(100dvh - 220px); }
.cv-time-col { position:sticky;left:0;background:var(--bg);z-index:2; }
.cv-row { display:grid;grid-template-columns:36px repeat(7,1fr);min-height:44px;border-bottom:0.5px solid var(--border); }
.cv-time-label { font-size:10px;color:var(--text3);font-family:'DM Mono',monospace;padding:2px 4px 0 0;text-align:right;line-height:1; }
.cv-cell { border-left:0.5px solid var(--border);position:relative;cursor:pointer;transition:background 0.1s; }
.cv-cell:hover { background:rgba(200,169,110,0.05); }
.cv-cell.today-col { background:rgba(200,169,110,0.03); }

/* Event blocks inside grid */
.cv-event { position:absolute;left:1px;right:1px;border-radius:4px;padding:2px 4px;font-size:10px;line-height:1.3;overflow:hidden;cursor:pointer;z-index:1;transition:opacity 0.15s; }
.cv-event:hover { opacity:0.85;z-index:2; }
.cv-event-name { font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.cv-event-time { opacity:0.75;font-family:'DM Mono',monospace; }
.cv-event.done { opacity:0.45;text-decoration:line-through; }

/* Day view */
.cv-day { display:flex;flex-direction:column;overflow:hidden; }
.cv-day-header { text-align:center;padding:8px;font-size:14px;font-weight:500;border-bottom:0.5px solid var(--border);margin-bottom:4px; }
.cv-day-body { display:flex;overflow-y:auto;max-height:calc(100dvh - 220px);position:relative; }
.cv-day-time-col { width:44px;flex-shrink:0; }
.cv-day-events-col { flex:1;position:relative; }
.cv-day-row { display:flex;min-height:56px;border-bottom:0.5px solid var(--border); }
.cv-day-time { font-size:10px;color:var(--text3);font-family:'DM Mono',monospace;padding:2px 6px 0 0;text-align:right;line-height:1;width:44px;flex-shrink:0; }
.cv-day-slot { flex:1;border-left:0.5px solid var(--border);position:relative;min-height:56px;cursor:pointer;transition:background 0.1s; }
.cv-day-slot:hover { background:rgba(200,169,110,0.05); }
.cv-day-event { position:absolute;left:2px;right:2px;border-radius:5px;padding:3px 6px;font-size:11px;line-height:1.4;overflow:hidden;cursor:pointer;z-index:1; }
.cv-day-event-name { font-weight:500; }
.cv-day-event-time { font-size:10px;opacity:0.75;font-family:'DM Mono',monospace; }
.cv-day-event.done { opacity:0.45; }

/* All-day area */
.cv-allday-row { display:grid;grid-template-columns:36px repeat(7,1fr);border-bottom:0.5px solid var(--border2);min-height:24px;margin-bottom:2px; }
.cv-allday-cell { border-left:0.5px solid var(--border);padding:1px 2px; }
.cv-allday-event { border-radius:3px;font-size:10px;padding:1px 4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:1px; }

/* Current time indicator */
.cv-now-line { position:absolute;left:0;right:0;height:1.5px;background:var(--red);z-index:3;pointer-events:none; }
.cv-now-dot  { position:absolute;left:-3px;top:-3px;width:7px;height:7px;border-radius:50%;background:var(--red); }

/* Event detail modal content */
.ed-row { display:flex;justify-content:space-between;padding:6px 0;border-bottom:0.5px solid var(--border);font-size:13px; }
.ed-row:last-of-type { border-bottom:none; }
.ed-key { color:var(--text2); }
.ed-val { color:var(--text);text-align:right;max-width:65%; }

/* ══ Pomodoro ══ */
.pomodoro-modal { max-height: 92dvh; overflow-y: auto; }
.pomo-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.pomo-close-btn { background:none; border:none; color:var(--text3); font-size:16px; cursor:pointer; padding:4px 6px; }

.pomo-task-row { margin-bottom:14px; }
.pomo-task-select { font-size:13px; }

/* Ring timer */
.pomo-ring-wrap { position:relative; width:160px; height:160px; margin:0 auto 14px; }
.pomo-ring { width:100%; height:100%; transform:rotate(-90deg); }
.pomo-ring-bg { fill:none; stroke:var(--bg4); stroke-width:8; }
.pomo-ring-fg { fill:none; stroke:var(--accent); stroke-width:8; stroke-linecap:round;
  stroke-dasharray:326.7; stroke-dashoffset:0; transition:stroke-dashoffset 1s linear, stroke 0.3s; }
.pomo-ring-fg.break-mode { stroke:var(--green); }
.pomo-ring-fg.long-mode  { stroke:var(--blue); }
.pomo-time-center { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; }
.pomo-time  { font-size:32px; font-weight:600; font-family:'DM Mono',monospace; color:var(--text); letter-spacing:0.02em; }
.pomo-phase { font-size:12px; color:var(--text2); }

/* Session dots */
.pomo-dots { display:flex; justify-content:center; gap:6px; margin-bottom:16px; }
.pomo-dot { width:10px; height:10px; border-radius:50%; background:var(--bg4); border:0.5px solid var(--border2); transition:background 0.3s; }
.pomo-dot.done   { background:var(--accent); border-color:var(--accent); }
.pomo-dot.active { background:var(--bg4); border-color:var(--accent); box-shadow:0 0 0 2px rgba(200,169,110,0.3); }

/* Controls */
.pomo-controls { display:flex; gap:8px; margin-bottom:16px; }
.pomo-btn { flex:1; padding:10px; border-radius:var(--radius-sm); border:0.5px solid var(--border2); background:var(--bg3); color:var(--text); font-size:13px; cursor:pointer; font-family:'Noto Serif SC',serif; transition:all 0.15s; }
.pomo-btn:hover { background:var(--bg4); }
.pomo-btn:active { transform:scale(0.97); }
.pomo-btn-main { background:var(--accent); color:#1a1208; border-color:transparent; font-weight:600; flex:2; }
.pomo-btn-main:hover { background:var(--accent2); }
.pomo-btn-main.running { background:var(--red); }
.pomo-btn-main.running:hover { background:#f07070; }

/* Settings */
.pomo-settings { background:var(--bg3); border-radius:var(--radius-sm); padding:10px 12px; margin-bottom:12px; border:0.5px solid var(--border); }
.pomo-setting-row { display:flex; align-items:center; justify-content:space-between; padding:6px 0; border-bottom:0.5px solid var(--border); }
.pomo-setting-row:last-child { border-bottom:none; }
.pomo-setting-label { font-size:12px; color:var(--text2); }
.pomo-setting-ctrl { display:flex; align-items:center; gap:8px; font-size:13px; font-family:'DM Mono',monospace; }
.pomo-setting-ctrl button { background:var(--bg4); border:0.5px solid var(--border); color:var(--text); width:24px; height:24px; border-radius:4px; cursor:pointer; font-size:14px; display:flex; align-items:center; justify-content:center; }
.pomo-setting-ctrl button:hover { border-color:var(--accent); color:var(--accent); }

/* Log */
.pomo-log { font-size:12px; color:var(--text3); font-family:'DM Mono',monospace; line-height:1.7; max-height:80px; overflow-y:auto; }
.pomo-log-entry { padding:1px 0; }
.pomo-log-entry.focus { color:var(--accent); }
.pomo-log-entry.brk   { color:var(--green); }

/* ══ Inline result cards (chat) ══ */
.result-card { background:var(--bg3); border:0.5px solid rgba(200,169,110,0.3); border-radius:var(--radius); padding:10px 13px; max-width:82%; }
.result-row { display:flex; justify-content:space-between; gap:8px; padding:4px 0; border-bottom:0.5px solid var(--border); font-size:12px; }
.result-row:last-of-type { border-bottom:none; }
.result-key { color:var(--text2); flex-shrink:0; }
.result-val { color:var(--text); text-align:right; }
.result-actions { display:flex; gap:6px; margin-top:8px; flex-wrap:wrap; }

/* ══ Complete button ══ */
.btn-complete { width:28px; height:28px; border-radius:50%; border:1.5px solid var(--green); background:transparent; color:var(--green); font-size:14px; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all 0.15s; flex-shrink:0; line-height:1; }
.btn-complete:hover { background:rgba(93,186,138,0.15); }
.btn-complete:active { background:var(--green); color:#1a1208; transform:scale(0.9); }

/* ══ Main line dashboard ══ */
.mainline-row { margin-bottom:12px; }
.mainline-row:last-child { margin-bottom:0; }
.mainline-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:4px; }
.mainline-label { font-size:12px; font-weight:500; }
.mainline-nums { font-size:11px; color:var(--text2); font-family:'DM Mono',monospace; }
.mainline-bar-track { height:8px; background:var(--bg4); border-radius:4px; overflow:hidden; position:relative; }
.mainline-bar-fill { height:100%; border-radius:4px; transition:width 0.6s ease; }
.mainline-target-line { position:absolute; right:0; top:0; bottom:0; width:1.5px; background:var(--text3); }
.mainline-status { font-size:10px; margin-top:2px; font-family:'DM Mono',monospace; }
.mainline-other { font-size:11px; color:var(--text3); margin-top:8px; font-family:'DM Mono',monospace; }

/* ══ Query result items ══ */
.query-item { display:flex; align-items:center; gap:7px; padding:4px 0; border-bottom:0.5px solid var(--border); font-size:13px; }
.query-item:last-child { border-bottom:none; }
.query-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.query-time { font-family:'DM Mono',monospace; font-size:11px; color:var(--text2); width:38px; flex-shrink:0; }
.query-name { flex:1; min-width:0; }
