:root {
  color-scheme: dark;
  --bg: #080a10;
  --bg-2: #111522;
  --card: rgba(255, 255, 255, 0.08);
  --card-strong: rgba(255, 255, 255, 0.13);
  --text: #f7f8fb;
  --muted: rgba(247, 248, 251, 0.62);
  --line: rgba(255, 255, 255, 0.12);
  --accent: #8ea7ff;
  --accent-2: #b9c7ff;
  --danger: #ff5d5d;
  --warning: #ffb86b;
  --success: #6ee7a8;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f8;
  --bg-2: #ffffff;
  --card: rgba(255, 255, 255, 0.76);
  --card-strong: rgba(255, 255, 255, 0.94);
  --text: #11131a;
  --muted: rgba(17, 19, 26, 0.58);
  --line: rgba(17, 19, 26, 0.1);
  --accent: #5578ff;
  --accent-2: #2f59f5;
  --danger: #ff3b30;
  --warning: #ff9500;
  --success: #34c759;
  --shadow: 0 22px 60px rgba(47, 60, 92, 0.14);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "HarmonyOS Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 520ms cubic-bezier(.2, .8, .2, 1), color 420ms ease;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.startup-screen {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background: #05070d;
  color: #fff;
  transition: opacity .85s ease, visibility .85s ease;
}
.startup-screen.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.startup-bg {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 50% 45%, rgba(142, 167, 255, 0.31), transparent 23%),
    radial-gradient(circle at 50% 52%, rgba(121, 78, 255, 0.46), transparent 28%),
    linear-gradient(180deg, #04060b 0%, #0c1020 100%);
  animation: startupPulse 2.6s ease-out forwards;
}
.startup-mark,
.startup-name { position: relative; z-index: 1; }
.startup-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: clamp(62px, 16vw, 110px);
  font-weight: 950;
  line-height: .88;
  letter-spacing: -0.06em;
  transform: scale(.58);
  opacity: 0;
  filter: blur(18px);
  animation: startupMark 2.65s cubic-bezier(.16, 1, .3, 1) forwards;
}
.startup-mark span:last-child { color: #dfe6ff; }
.startup-name {
  margin-top: 168px;
  font-size: 13px;
  letter-spacing: .34em;
  text-transform: uppercase;
  opacity: 0;
  animation: startupName 1.6s ease forwards 1.35s;
}
@keyframes startupPulse {
  0% { transform: scale(1.24); filter: blur(22px); }
  100% { transform: scale(1); filter: blur(0); }
}
@keyframes startupMark {
  0% { transform: scale(.5); opacity: 0; filter: blur(26px); }
  45% { opacity: 1; }
  100% { transform: scale(1); opacity: 1; filter: blur(0); text-shadow: 0 0 52px rgba(142,167,255,.62); }
}
@keyframes startupName {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: .92; transform: translateY(0); }
}

.device-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 6%, rgba(142, 167, 255, .38), transparent 33%),
    radial-gradient(circle at 82% 18%, rgba(136, 91, 255, .26), transparent 28%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
  transition: background 620ms cubic-bezier(.2, .8, .2, 1);
}
.app-shell {
  position: relative;
  width: min(100%, 540px);
  min-height: 100svh;
  margin: 0 auto;
  padding: calc(20px + var(--safe-top)) 18px calc(96px + var(--safe-bottom));
}
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 18px; }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(32px, 9vw, 44px); line-height: 1; letter-spacing: -0.06em; }
h2 { margin-bottom: 0; font-size: 22px; letter-spacing: -0.04em; }
h3 { margin-bottom: 4px; font-size: 15px; letter-spacing: -0.02em; }
.muted { color: var(--muted); margin-bottom: 8px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn, .primary-btn, .secondary-btn, .ghost-btn, .tiny-action {
  border: 0; border-radius: 999px; cursor: pointer; color: var(--text);
  transition: transform 180ms ease, opacity 180ms ease, background 320ms ease, color 320ms ease;
}
.icon-btn:active, .primary-btn:active, .secondary-btn:active, .ghost-btn:active, .tiny-action:active { transform: scale(.96); }
.icon-btn {
  position: relative; width: 44px; height: 44px; background: var(--card); border: 1px solid var(--line);
  overflow: hidden; backdrop-filter: blur(22px);
}
.icon-btn span { position: absolute; inset: 0; display: grid; place-items: center; transition: transform 460ms cubic-bezier(.2, .9, .15, 1), opacity 320ms ease; }
.icon-sun { transform: translateY(120%); opacity: 0; }
[data-theme="light"] .icon-sun { transform: translateY(0); opacity: 1; }
[data-theme="light"] .icon-moon { transform: translateY(-120%); opacity: 0; }
.primary-btn { min-height: 48px; padding: 0 22px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: white; font-weight: 750; box-shadow: 0 12px 32px rgba(85, 120, 255, .28); }
.primary-btn.compact { width: 48px; min-width: 48px; padding: 0; font-size: 24px; }
.secondary-btn { min-height: 42px; padding: 0 16px; background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(20px); color: var(--text); font-weight: 700; }
.secondary-btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.ghost-btn { background: transparent; color: rgba(255,255,255,.78); padding: 14px 18px; border: 1px solid rgba(255,255,255,.18); }
.tiny-action { width: 30px; height: 30px; background: transparent; color: var(--muted); font-size: 18px; }
.tiny-action.edit { color: var(--accent); }

.glass-card { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(28px) saturate(1.2); }
.hero-card { display: flex; align-items: center; justify-content: space-between; padding: 22px; border-radius: var(--radius-xl); margin-bottom: 18px; }
.progress-row { display: flex; align-items: baseline; gap: 10px; }
.progress-row strong { font-size: 32px; letter-spacing: -0.06em; }
.progress-row span { color: var(--muted); font-size: 14px; }
.hero-inline-stats, .quick-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.inline-pill { padding: 7px 10px; border-radius: 999px; background: color-mix(in srgb, var(--card-strong) 85%, transparent); color: var(--muted); font-size: 12px; border: 1px solid var(--line); }
.ring { --p: 0deg; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) var(--p), rgba(255,255,255,.12) 0deg); position: relative; transition: background 480ms ease; }
.ring::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: color-mix(in srgb, var(--bg) 78%, transparent); }
.ring span { position: relative; z-index: 1; font-weight: 800; }

.segmented {
  position: sticky; top: calc(10px + var(--safe-top)); z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 0; padding: 5px; margin: 4px 0 20px; border-radius: 999px; background: color-mix(in srgb, var(--card-strong) 72%, transparent);
  border: 1px solid var(--line); backdrop-filter: blur(26px) saturate(1.4); box-shadow: 0 10px 28px rgba(0,0,0,.12);
}
.seg { position: relative; z-index: 2; height: 38px; border: 0; background: transparent; color: var(--muted); font-weight: 750; font-size: 13px; cursor: pointer; border-radius: 999px; transition: color 260ms ease; }
.seg.active { color: var(--text); }
.seg-indicator { position: absolute; z-index: 1; top: 5px; left: 5px; width: calc((100% - 10px) / 5); height: 38px; border-radius: 999px; background: var(--card-strong); box-shadow: 0 10px 22px rgba(0,0,0,.16); transition: transform 420ms cubic-bezier(.19, 1, .22, 1), background 320ms ease; }
.view { display: none; opacity: 0; transform: translateY(14px) scale(.985); }
.view.active { display: block; animation: viewIn 430ms cubic-bezier(.2, .85, .2, 1) forwards; }
@keyframes viewIn { to { opacity: 1; transform: translateY(0) scale(1); } }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat-card, .plan-card, .mini-panel, .setting-row, .course-item, .timeline-item {
  padding: 16px; border-radius: var(--radius-lg); background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(20px);
}
.stat-card strong { display: block; margin-top: 8px; font-size: 28px; letter-spacing: -0.06em; }
.stat-card span, .setting-row p, .mini-panel p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.plan-card { margin: 12px 0; color: var(--muted); line-height: 1.55; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 18px 2px 10px; gap: 10px; }
.section-title span { color: var(--muted); font-size: 13px; }
.space-top { margin-top: 28px; }

.task-list, .schedule-list, .timeline-list { display: grid; gap: 12px; }
.empty { padding: 20px; border-radius: var(--radius-lg); color: var(--muted); border: 1px dashed var(--line); background: color-mix(in srgb, var(--card) 58%, transparent); }
.task-card {
  display: grid; grid-template-columns: 36px 1fr 40px; align-items: start; gap: 12px; padding: 16px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); backdrop-filter: blur(22px); box-shadow: 0 12px 32px rgba(0,0,0,.12); animation: cardIn 360ms ease both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
.task-card.done { opacity: .58; }
.task-card.done h3 { text-decoration: line-through; }
.task-card.high { border-color: color-mix(in srgb, var(--danger) 42%, var(--line)); }
.task-card.overdue { box-shadow: 0 14px 34px color-mix(in srgb, var(--danger) 20%, transparent); }
.task-card.exam { border-color: color-mix(in srgb, var(--warning) 28%, var(--line)); }
.check { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: transparent; cursor: pointer; position: relative; transition: all 260ms ease; }
.task-card.done .check { background: var(--success); border-color: var(--success); }
.task-card.done .check::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: white; font-weight: 900; }
.task-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.task-head h3 { margin: 0; line-height: 1.25; }
.badge { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent-2); }
.badge.high { background: color-mix(in srgb, var(--danger) 20%, transparent); color: var(--danger); }
.badge.low { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }
.badge.exam { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
.task-meta, .task-note { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.task-note:empty { display: none; }
.task-actions { display: flex; flex-direction: column; gap: 6px; }

.filter-bar, .course-filter-row, .week-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.filter-bar::-webkit-scrollbar, .course-filter-row::-webkit-scrollbar, .week-strip::-webkit-scrollbar { display: none; }
.chip, .course-chip, .day-chip {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 999px; padding: 10px 14px; font-weight: 750; cursor: pointer; transition: background 260ms ease, color 260ms ease, transform 180ms ease;
}
.chip.active, .course-chip.active, .day-chip.active { color: white; background: var(--accent); }
.course-item, .timeline-item { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.course-item strong, .timeline-item strong { display: block; }
.course-item small, .timeline-item small { display: block; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.delete-course { background: transparent; border: 0; color: var(--muted); font-size: 20px; }

.focus-card { padding: 24px; border-radius: var(--radius-xl); text-align: center; }
.focus-card h2 { margin-top: 4px; }
.timer { margin: 28px 0; font-size: clamp(58px, 18vw, 84px); letter-spacing: -0.08em; font-weight: 850; font-variant-numeric: tabular-nums; }
.focus-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-panel, .settings-list { margin-top: 14px; }
.settings-list { display: grid; gap: 12px; }
.setting-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.compact-select { max-width: 180px; }
.switch { position: relative; display: inline-block; width: 58px; height: 34px; flex: 0 0 auto; }
.switch input { display: none; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: rgba(120,120,128,.28); transition: background 260ms ease; }
.switch span::after { content: ""; position: absolute; width: 28px; height: 28px; top: 3px; left: 3px; border-radius: 50%; background: white; box-shadow: 0 3px 8px rgba(0,0,0,.25); transition: transform 320ms cubic-bezier(.2,.85,.2,1); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(24px); }

.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.show { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.46); backdrop-filter: blur(10px); animation: fadeIn 220ms ease both; }
.sheet {
  position: absolute; left: 50%; bottom: 0; width: min(100%, 540px); max-height: calc(var(--app-height, 100svh) - 8px); overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; transform: translateX(-50%);
  padding: 10px 18px calc(28px + var(--safe-bottom)); border-radius: 30px 30px 0 0; background: color-mix(in srgb, var(--bg-2) 92%, transparent); border: 1px solid var(--line); box-shadow: 0 -24px 70px rgba(0,0,0,.35); animation: sheetIn 430ms cubic-bezier(.19,1,.22,1) both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetIn { from { transform: translate(-50%, 105%); } to { transform: translate(-50%, 0); } }
.sheet-handle { width: 44px; height: 5px; border-radius: 99px; margin: 0 auto 18px; background: var(--line); }
.sheet label { display: grid; gap: 7px; margin-bottom: 12px; }
.sheet label span { color: var(--muted); font-size: 13px; font-weight: 750; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); color: var(--text); background: var(--card); border-radius: 17px; padding: 13px 14px; outline: none; transition: border 200ms ease, background 260ms ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.picker-sheet { max-height: 72svh; overflow: auto; }
.compact-list .task-card { cursor: pointer; }

.alert-screen {
  position: fixed; inset: 0; z-index: 200; display: none; place-items: center; align-content: center; padding: 32px 24px calc(40px + var(--safe-bottom)); text-align: center;
  background: radial-gradient(circle at 50% 24%, rgba(142,167,255,.35), transparent 30%), linear-gradient(180deg, #070910 0%, #111728 100%);
  color: white; overflow: hidden;
}
.alert-screen.show { display: grid; animation: alertIn 480ms cubic-bezier(.2,.85,.2,1) both; }
@keyframes alertIn { from { opacity: 0; transform: scale(1.03); filter: blur(8px); } to { opacity: 1; transform: scale(1); filter: blur(0); } }
.alert-orb { width: 148px; height: 148px; border-radius: 50%; background: radial-gradient(circle at 36% 32%, white, #8ea7ff 34%, #6855ff 62%, #252b68 100%); box-shadow: 0 0 90px rgba(142,167,255,.48); margin-bottom: 30px; animation: pulse 2.8s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); filter: saturate(1.25); } }
.alert-screen h2 { max-width: 420px; margin: 0 0 10px; font-size: clamp(32px, 10vw, 50px); line-height: 1.06; letter-spacing: -0.06em; }
.alert-screen p { color: rgba(255,255,255,.66); }
.slide-control { position: relative; width: min(100%, 390px); height: 66px; margin: 34px auto 12px; border-radius: 999px; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.18); overflow: hidden; user-select: none; touch-action: none; }
.slide-control::before { content: ""; position: absolute; inset: 0; width: var(--slide, 0%); border-radius: inherit; background: linear-gradient(90deg, rgba(142,167,255,.25), rgba(142,167,255,.72)); }
.slide-control span { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.72); font-weight: 800; }
.slide-control button { position: absolute; left: 6px; top: 6px; width: 54px; height: 54px; border: 0; border-radius: 50%; background: white; color: #111728; font-weight: 900; font-size: 22px; box-shadow: 0 10px 24px rgba(0,0,0,.25); transform: translateX(var(--knob, 0px)); }

@media (max-width: 430px) {
  .grid-3 { grid-template-columns: 1fr; }
  .seg { font-size: 12px; }
  .setting-row { align-items: flex-start; flex-direction: column; }
  .compact-select { max-width: 100%; }
}
@media (max-width: 380px) {
  .grid-2, .focus-actions, .sheet-actions, .stats-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}

body.modal-open { overflow: hidden; }
input, textarea, select { scroll-margin-block: 110px; }
.modal.show .sheet { padding-bottom: calc(96px + var(--safe-bottom)); }

.dashboard-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 20px;
  border-radius: var(--radius-xl);
  margin-bottom: 18px;
}
.dashboard-main h2 { margin: 2px 0 8px; }
.dashboard-main p:last-child { margin: 0; color: var(--muted); line-height: 1.5; font-size: 13px; }
.dashboard-metrics { display: grid; gap: 8px; min-width: 88px; }
.dashboard-metrics div {
  padding: 12px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--card-strong) 82%, transparent);
  border: 1px solid var(--line);
  text-align: center;
}
.dashboard-metrics strong { display: block; font-size: 24px; letter-spacing: -0.05em; }
.dashboard-metrics span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }

.subtask-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}
.subtask-item {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}
.subtask-item input {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--accent);
}
.subtask-item.done span { text-decoration: line-through; opacity: .65; }

.subtask-editor {
  margin: 8px 0 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--card) 75%, transparent);
}
.subtask-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.subtask-title-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}
.subtask-inputs {
  display: grid;
  gap: 8px;
}
.subtask-input-row {
  display: grid;
  grid-template-columns: 1fr 34px;
  gap: 8px;
  align-items: center;
}
.subtask-input-row input { min-height: 42px; }

.icon-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.icon-option {
  width: 74px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
}
.icon-option.active {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  color: var(--text);
  box-shadow: 0 12px 28px rgba(85, 120, 255, .18);
}
.icon-option img {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  margin: 0 auto 6px;
}
.icon-option span { font-size: 11px; font-weight: 750; }

.startup-mark[data-style="midnight"] span:last-child { color: #aebdff; }
.startup-mark[data-style="pearl"] span:last-child { color: #ffffff; }

@media (max-width: 430px) {
  .dashboard-card { grid-template-columns: 1fr; }
  .dashboard-metrics { grid-template-columns: repeat(2, 1fr); }
  .icon-setting { align-items: flex-start; flex-direction: column; }
  .icon-options { justify-content: flex-start; }
}


/* v6 homepage DDL */
.ddl-overview {
  padding: 20px;
  border-radius: var(--radius-xl);
  margin-bottom: 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.ddl-overview::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .72;
  pointer-events: none;
}
.ddl-overview.calm::before {
  background: radial-gradient(circle at 88% 10%, rgba(142,167,255,.22), transparent 32%);
}
.ddl-overview.near::before {
  background: radial-gradient(circle at 88% 10%, rgba(255,184,107,.22), transparent 32%);
}
.ddl-overview.soon::before {
  background: radial-gradient(circle at 88% 10%, rgba(255,149,0,.28), transparent 32%);
}
.ddl-overview.overdue::before {
  background: radial-gradient(circle at 88% 10%, rgba(255,93,93,.32), transparent 34%);
}
.ddl-overview-head {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.ddl-overview h2 {
  font-size: clamp(34px, 10vw, 54px);
  line-height: .9;
}
.ddl-count {
  min-width: 78px;
  padding: 12px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--card-strong) 82%, transparent);
  border: 1px solid var(--line);
  text-align: center;
}
.ddl-count strong {
  display: block;
  font-size: 34px;
  letter-spacing: -0.08em;
}
.ddl-count span {
  color: var(--muted);
  font-size: 12px;
}
.ddl-summary-text {
  position: relative;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.5;
}
.ddl-preview {
  position: relative;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 14px;
  scrollbar-width: none;
}
.ddl-preview::-webkit-scrollbar { display: none; }
.ddl-chip {
  flex: 0 0 auto;
  display: grid;
  gap: 3px;
  min-width: 150px;
  padding: 11px 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 82%, transparent);
}
.ddl-chip strong {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ddl-chip span {
  color: var(--muted);
  font-size: 12px;
}
.ddl-chip.soon { border-color: color-mix(in srgb, var(--warning) 40%, var(--line)); }
.ddl-chip.overdue { border-color: color-mix(in srgb, var(--danger) 44%, var(--line)); }
.ddl-detail-panel {
  margin-bottom: 18px;
}

/* v6 matrix */
.matrix-card {
  padding: 18px;
  border-radius: var(--radius-xl);
}
.matrix-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.matrix-title span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
}
.matrix-axis {
  position: relative;
  padding: 22px 0 0 22px;
}
.axis-y, .axis-x {
  position: absolute;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}
.axis-y { left: 0; top: 50%; transform: rotate(-90deg) translateX(35%); transform-origin: left center; }
.axis-x { right: 8px; top: 0; }
.matrix-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.matrix-quadrant {
  min-height: 138px;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 82%, transparent);
}
.matrix-quadrant.importantUrgent {
  background: linear-gradient(135deg, color-mix(in srgb, var(--danger) 12%, var(--card)), var(--card));
}
.matrix-quadrant.importantNotUrgent {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--card)), var(--card));
}
.matrix-quadrant.notImportantUrgent {
  background: linear-gradient(135deg, color-mix(in srgb, var(--warning) 13%, var(--card)), var(--card));
}
.matrix-quadrant-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.matrix-quadrant-head strong { font-size: 13px; }
.matrix-quadrant-head span {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--card-strong) 85%, transparent);
  color: var(--muted);
  font-size: 12px;
}
.matrix-quadrant p {
  margin: 5px 0 9px;
  color: var(--muted);
  font-size: 12px;
}
.matrix-items {
  display: grid;
  gap: 6px;
}
.matrix-items button {
  border: 0;
  text-align: left;
  padding: 7px 8px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--card-strong) 76%, transparent);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}
.matrix-items em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

/* v6 month calendar */
.calendar-toolbar {
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-xl);
  margin-bottom: 14px;
  text-align: center;
}
.month-calendar {
  padding: 14px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(22px);
}
.month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}
.month-weekdays span {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  font-weight: 750;
}
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.month-cell {
  min-height: 84px;
  padding: 7px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--card-strong) 58%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  overflow: hidden;
}
.month-cell.today-cell {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
}
.month-cell.muted-cell {
  opacity: .35;
}
.month-day {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 5px;
}
.month-ddls {
  display: grid;
  gap: 4px;
}
.month-ddl {
  border: 0;
  border-radius: 9px;
  padding: 4px 5px;
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  font-size: 10px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.month-ddl.soon { background: color-mix(in srgb, var(--warning) 22%, transparent); }
.month-ddl.overdue { background: color-mix(in srgb, var(--danger) 22%, transparent); }
.month-ddls small {
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 430px) {
  .month-cell {
    min-height: 68px;
    padding: 5px;
    border-radius: 12px;
  }
  .month-ddl {
    font-size: 9px;
    padding: 3px 4px;
  }
  .matrix-grid { gap: 8px; }
  .matrix-quadrant { min-height: 128px; padding: 10px; }
}


/* v7 fixes */
.matrix-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.matrix-add {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
}
.matrix-task {
  position: relative;
  z-index: 2;
  touch-action: manipulation;
}
.month-cell[data-date] {
  cursor: default;
}
.month-ddl {
  position: relative;
  z-index: 2;
  touch-action: manipulation;
}


/* v8: DDL preview buttons */
.ddl-chip {
  text-align: left;
  cursor: pointer;
  color: var(--text);
}
button.ddl-chip {
  border: 1px solid var(--line);
}

/* v8: Pomodoro */
.pomodoro-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0 18px;
}
.pomodoro-stats > div,
.pomodoro-option {
  min-height: 54px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card-strong) 78%, transparent);
}
.pomodoro-stats strong {
  display: block;
  font-size: 22px;
  letter-spacing: -0.05em;
}
.pomodoro-stats span {
  color: var(--muted);
  font-size: 12px;
}
.pomodoro-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 750;
}
.pomodoro-option input {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--accent);
}

.pomodoro-screen {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: none;
  place-items: center;
  align-content: center;
  padding: 32px 24px calc(40px + var(--safe-bottom));
  text-align: center;
  background: #05070d;
  color: white;
  overflow: hidden;
}
.pomodoro-screen.show {
  display: grid;
  animation: alertIn 480ms cubic-bezier(.2, .85, .2, 1) both;
}
.pomodoro-bg {
  position: absolute;
  inset: -15%;
  background:
    radial-gradient(circle at 50% 22%, rgba(142,167,255,.36), transparent 28%),
    radial-gradient(circle at 50% 70%, rgba(111,86,255,.28), transparent 34%),
    linear-gradient(180deg, #060813, #111728);
  filter: blur(0);
}
.pomodoro-screen > *:not(.pomodoro-bg) {
  position: relative;
  z-index: 1;
}
.pomodoro-screen h2 {
  max-width: 420px;
  margin: 10px 0 24px;
  font-size: clamp(30px, 9vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.06em;
}
.pomodoro-time {
  font-size: clamp(82px, 25vw, 150px);
  line-height: .9;
  font-weight: 920;
  letter-spacing: -0.1em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 46px rgba(142,167,255,.48);
}
#pomodoroMeta {
  margin: 24px 0 28px;
  color: rgba(255,255,255,.68);
}
.pomodoro-screen-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: min(100%, 360px);
}
