:root {
  --bg: #f2f5fa;
  --surface: #fcfdff;
  --surface-strong: #ffffff;
  --soft: #e5ebf5;
  --soft-2: #eef2f8;
  --primary: #526c99;
  --primary-strong: #405b8b;
  --ink: #1f2420;
  --muted: #69716b;
  --line: #d9ded7;
  --amber: #d3a64c;
  --amber-soft: #fff2cc;
  --danger: #d85b58;
  --shadow: 0 2px 8px rgba(48, 62, 53, .09);
  --shadow-float: 0 14px 34px rgba(49, 61, 73, .2);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.mi {
  font-family: "Material Icons Round";
  font-weight: normal;
  font-style: normal;
  font-size: 21px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

.shell {
  width: min(700px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 14px calc(116px + env(safe-area-inset-bottom));
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 2px 5px 4px;
}
.topbar h1 {
  margin: 0;
  font-size: clamp(28px, 5.6vw, 36px);
  line-height: 1.1;
  letter-spacing: -1.2px;
  font-weight: 800;
}
.topbar.center-title { justify-content: center; position: relative; }
.topbar.center-title h1 { font-size: 30px; }
.topbar.center-title .top-actions { position: absolute; right: 0; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 42px; height: 42px; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: transparent; color: var(--ink);
  padding: 0; transition: background .16s ease, transform .16s ease;
}
.icon-btn:hover { background: rgba(255, 255, 255, .72); }
.icon-btn:active { transform: scale(.94); }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill, .ghost, .primary, .danger {
  border: 0; border-radius: 13px; padding: 9px 13px; transition: transform .14s ease, opacity .14s ease;
}
.pill:active, .ghost:active, .primary:active, .danger:active { transform: scale(.97); }
.pill:disabled, .primary:disabled { opacity: .52; }
.pill { color: var(--ink); background: var(--soft); font-weight: 700; }
.pill, .ghost, .primary, .danger { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.pill .mi, .ghost .mi, .primary .mi, .danger .mi { font-size: 17px; }
.ghost { color: var(--ink); background: var(--soft-2); }
.primary { color: white; background: var(--primary); font-weight: 700; box-shadow: 0 5px 13px rgba(82, 108, 153, .22); }
.danger { color: white; background: var(--danger); }

.section-head {
  margin: 22px 6px 10px;
  display: flex; align-items: end; justify-content: space-between; gap: 12px;
}
.section-head h2 { margin: 0; font-size: 16px; letter-spacing: -.1px; }
.section-head span { color: var(--muted); font-size: 12px; }
.empty {
  min-height: 430px; display: grid; align-content: center; justify-items: center;
  text-align: center; color: var(--muted); padding-bottom: 48px;
}
.empty-logo { width: 78px; height: 78px; object-fit: contain; opacity: .38; margin-bottom: 15px; }
.empty b { color: var(--ink); font-size: 18px; }
.empty p { margin: 8px 0 0; font-size: 13px; }

.plan-list { display: grid; gap: 9px; }
.plan {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 20px;
  padding: 13px 12px;
  box-shadow: 0 1px 3px rgba(34, 48, 39, .065);
}
.plan-main, .task-row { display: flex; align-items: flex-start; gap: 8px; }
.check {
  flex: 0 0 auto; width: 25px; height: 25px; margin-top: 1px; border-radius: 5px;
  border: 2px solid #858d87; background: transparent; display: grid; place-items: center;
  color: white; padding: 0; transition: all .18s ease;
}
.check .mi { font-size: 17px; }
.check.done { background: #8b928d; border-color: #8b928d; }
.plan-copy { min-width: 0; flex: 1; padding: 1px 0 0 3px; }
.plan-title { font-size: 17px; font-weight: 720; line-height: 1.42; word-break: break-word; letter-spacing: -.1px; }
.plan-description { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.meta { margin-top: 7px; display: flex; gap: 10px; flex-wrap: wrap; color: #777f79; font-size: 11px; }
.meta span { display: inline-flex; align-items: center; gap: 3px; }
.meta .mi { font-size: 15px; color: #8b928d; }
.meta .date-meta.today, .meta .date-meta.today .mi { color: #5178b7; font-weight: 760; }
.meta .date-meta.overdue, .meta .date-meta.overdue .mi { color: #c75e57; font-weight: 760; }
.overdue-banner { display: flex; align-items: center; gap: 7px; margin: 4px 0 10px; padding: 10px 12px; border-radius: 17px; background: #fff5ee; color: #a95847; }
.overdue-banner > div { min-width: 0; flex: 1; display: grid; gap: 2px; }
.overdue-banner b { font-size: 13px; }
.overdue-banner small { color: #9b8279; font-size: 10px; line-height: 1.35; }
.overdue-banner .pill, .overdue-banner .ghost { flex: 0 0 auto; padding: 7px 8px; border-radius: 11px; font-size: 11px; }
.expand { border: 0; background: transparent; color: #858d87; padding: 2px; margin: -1px -2px 0 0; }
.expand .mi { font-size: 21px; }
.task-list { margin: 9px 0 0 35px; display: grid; gap: 3px; }
.task-row { min-height: 38px; padding: 6px 5px; border-radius: 11px; background: transparent; align-items: center; }
.task-row:hover { background: var(--soft-2); }
.task-row .check { width: 21px; height: 21px; border-radius: 4px; margin: 0; }
.task-title { flex: 1; font-size: 14px; line-height: 1.42; }
.done-text { color: var(--muted); text-decoration: line-through; }

.board { display: grid; gap: 12px; }
.board-groups { display: flex; align-items: center; gap: 7px; overflow-x: auto; padding: 2px 1px 5px; scrollbar-width: none; }
.board-groups::-webkit-scrollbar { display: none; }
.board-group, .board-group-add, .board-group-manage {
  flex: 0 0 auto; min-height: 34px; border: 1px solid transparent; border-radius: 17px; background: var(--surface);
  color: var(--muted); display: inline-flex; align-items: center; gap: 5px; padding: 0 12px; font-size: 13px;
  box-shadow: 0 1px 3px rgba(34,48,39,.04);
}
.board-group small { color: inherit; font-size: 10px; opacity: .75; }
.board-group.active { color: var(--primary); background: var(--soft); border-color: color-mix(in srgb, var(--primary) 16%, transparent); font-weight: 760; }
.board-group-add, .board-group-manage { width: 34px; padding: 0; justify-content: center; color: var(--primary); }
.board-group-manage { color: var(--muted); }
.board-group-add .mi, .board-group-manage .mi { font-size: 18px; }
.board-column { min-width: 0; }
.board-empty { padding: 33px 18px; text-align: center; color: var(--muted); background: var(--surface); border-radius: 19px; font-size: 13px; }
.board-title { display: flex; align-items: center; justify-content: space-between; padding: 4px 7px 10px; }
.board-title b { font-size: 14px; }
.board-title span { color: var(--muted); font-size: 12px; }
.calendar {
  background: var(--surface); border-radius: 22px; padding: 16px 14px 18px;
  box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.85);
}
.calendar-head, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.calendar-grid { align-items: start; }
.calendar-head { color: var(--muted); font-size: 11px; margin-bottom: 8px; }
.day {
  position: relative; width: 100%; min-width: 0; min-height: 0; aspect-ratio: 1 / 1; border: 0; border-radius: 10px; padding: 0; font: inherit;
  font-size: 12px; color: var(--ink); background: transparent;
  display: block;
}
.day-date {
  position: absolute; inset: 0; border-radius: 9px; display: grid; place-items: center;
  background: transparent;
}
.day.in-range .day-date::before {
  content: ""; position: absolute; width: 28px; height: 28px; border-radius: 8px;
  background: color-mix(in srgb, var(--range-color) 12%, transparent);
}
.day.highlighted .day-date::before { display: none; }
.day-date b {
  position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; line-height: 1; font-weight: 600;
}
.day.highlighted .day-date b {
  color: white; background: var(--primary); font-weight: 800;
}
.day.empty-day { visibility: hidden; }
.calendar-special { position: absolute; left: 0; right: 0; bottom: 12px; display: block; height: 9px; overflow: hidden; color: #b27c3f; font-size: 7px; line-height: 9px; white-space: nowrap; text-align: center; }
.day.highlighted .calendar-special { color: var(--primary); }
.date-dots { position: absolute; left: 0; right: 0; bottom: 3px; display: flex; justify-content: center; gap: 2px; height: 4px; }
.date-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--primary); }
.timeline-month-head { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 7px; }
.timeline-month-head b { min-width: 130px; text-align: center; font-size: 17px; }
.timeline-month-head .icon-btn { width: 32px; height: 32px; }
.timeline-today { border: 0; border-radius: 10px; background: var(--soft); color: var(--primary); padding: 6px 7px; font-size: 11px; font-weight: 760; }
.timeline-gantt { margin-top: 12px; background: var(--surface); border-radius: 22px; padding: 6px 13px 12px; box-shadow: 0 1px 3px rgba(34,48,39,.06); }
.timeline-gantt .section-head { padding-inline: 3px; margin: 7px 0 2px; }
.timeline-section-actions { display: flex; align-items: center; gap: 9px; }
.timeline-hint { margin: 0 3px 6px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.timeline-gantt-row { width: 100%; border: 0; background: transparent; text-align: left; padding: 10px 3px; border-top: 1px solid var(--line); }
.timeline-gantt-row:first-of-type { border-top: 0; }
.timeline-gantt-copy { display: flex; gap: 8px; min-width: 0; align-items: center; }
.timeline-gantt-copy b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.timeline-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; }
.timeline-range-copy { display: block; margin: 4px 0 5px 17px; font-size: 11px; font-weight: 760; }
.timeline-axis { position: relative; height: 18px; margin: 0 2px 3px; color: var(--muted); font-size: 9px; line-height: 13px; overflow: visible; }
.timeline-axis span { position: absolute; left: var(--axis-position); top: 0; min-width: 22px; transform: translateX(-50%); white-space: nowrap; text-align: center; }
.timeline-axis span.axis-start { transform: none; }
.timeline-axis span.axis-end { transform: translateX(-100%); }
.timeline-axis span.axis-near-end { transform: translateX(-100%); }
.timeline-track {
  position: relative; height: 30px; border-radius: 9px;
  background-color: color-mix(in srgb, var(--primary) 10%, var(--surface));
  background-image: repeating-linear-gradient(to right, rgba(113,122,117,.10) 0 1px, transparent 1px calc(100% / var(--timeline-columns)));
  overflow: hidden;
}
.timeline-track i { position: absolute; top: 5px; bottom: 5px; left: var(--timeline-left); width: var(--timeline-width); min-width: 12px; border-radius: 9px; background: var(--timeline-color); opacity: .9; display: grid; place-items: center; color: white; font-style: normal; }
.timeline-track i span { font-size: 10px; font-weight: 800; white-space: nowrap; }
.timeline-track i.single-day { width: 38px; min-width: 38px; transform: translateX(-50%); }
.timeline-track i.single-day.edge-start { transform: none; }
.timeline-track i.single-day.edge-end { left: auto; right: 0; transform: none; }

.fab {
  position: fixed; z-index: 20;
  right: max(24px, calc((100vw - 700px) / 2 + 24px));
  bottom: calc(103px + env(safe-area-inset-bottom));
  width: 60px; height: 60px; border: 0; border-radius: 50%; color: white;
  background: var(--primary); display: grid; place-items: center;
  box-shadow: var(--shadow-float); transition: transform .15s ease;
}
.fab:active { transform: scale(.94); }
.fab .mi { font-size: 34px; }
.tabbar {
  position: fixed; z-index: 15; left: 50%; transform: translateX(-50%);
  bottom: max(12px, env(safe-area-inset-bottom));
  width: min(670px, calc(100% - 28px)); height: 79px;
  display: flex; gap: 5px; padding: 7px;
  background: rgba(252, 253, 255, .97); backdrop-filter: blur(18px);
  border-radius: 31px; box-shadow: 0 6px 24px rgba(62, 72, 66, .09);
}
.tab {
  flex: 1; border: 0; border-radius: 25px; color: #7d8680; background: transparent;
  display: grid; place-content: center; justify-items: center; gap: 4px; font-size: 12px;
}
.tab img { width: 28px; height: 28px; object-fit: contain; opacity: .62; filter: grayscale(.35); }
.tab .tab-mi { font-size: 29px; color: #8a918a; }
.tab.active { color: var(--primary); background: var(--soft); font-weight: 750; }
.tab.active img { opacity: 1; filter: none; }
.tab.active .tab-mi { color: var(--primary); }

.focus-topbar {
  min-height: 66px; display: flex; align-items: center; justify-content: space-between;
  padding: 2px 4px 5px;
}
.focus-tabs { display: flex; align-items: center; height: 50px; }
.focus-tabs strong {
  align-self: stretch; display: flex; align-items: center; position: relative;
  font-size: 24px; letter-spacing: -.7px;
}
.focus-tabs strong::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 4px; border-radius: 4px; background: var(--primary);
}
.focus-screen {
  min-height: calc(100dvh - 194px); display: flex; flex-direction: column;
  align-items: center; padding: 22px 8px 14px;
}
.focus-target {
  border: 0; background: transparent; color: var(--ink); min-height: 48px;
  display: flex; align-items: center; justify-content: center; gap: 2px;
  max-width: 92%; font-size: 19px; font-weight: 650; text-align: center;
}
.focus-target:not(.selected) { color: var(--muted); }
.focus-target .mi { color: #b2b8b4; }
.focus-clock {
  width: clamp(246px, 62vw, 410px); aspect-ratio: 1; margin: 30px 0 28px;
  border: 8px solid rgba(105, 113, 107, .08); border-radius: 50%;
  display: grid; place-items: center; position: relative; background: transparent; padding: 0; cursor: pointer;
}
.focus-clock:disabled { cursor: default; }
.focus-clock:not(:disabled):active { transform: scale(.992); }
.focus-clock.running::after {
  content: ""; position: absolute; width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary); top: -10px; left: calc(50% - 6px);
}
.focus-clock span {
  color: #111512; font-size: clamp(54px, 14vw, 82px);
  font-weight: 350; letter-spacing: -3px; font-variant-numeric: tabular-nums;
}
.focus-clock small { position: absolute; top: 61%; color: var(--muted); font-size: 14px; font-weight: 650; }
.focus-actions { min-height: 82px; display: flex; align-items: center; justify-content: center; gap: 28px; width: 100%; }
.focus-start {
  width: min(66%, 330px); height: 60px; border: 0; border-radius: 31px;
  background: var(--primary); color: white; font-size: 19px; font-weight: 700;
}
.focus-start:disabled { opacity: .38; }
.focus-primary, .focus-secondary {
  width: 80px; height: 80px; display: grid; place-items: center; border-radius: 50%;
}
.focus-primary {
  border: 0; color: white; background: var(--primary);
}
.focus-primary .mi { font-size: 39px; }
.focus-secondary {
  border: 2px solid #9ba19d; color: #9ba19d; background: transparent;
}
.focus-secondary .mi { font-size: 29px; }
.focus-note {
  margin-top: auto; border: 0; background: transparent; color: #a8aeaa;
  font-size: 13px; padding: 10px;
}
.focus-note:disabled { cursor: default; }
.group-ai-button {
  width: 100%; min-height: 43px; margin-top: 4px; border: 0; border-radius: 14px;
  background: var(--soft); color: var(--ink); display: flex; align-items: center;
  justify-content: center; gap: 7px; font-size: 13px; font-weight: 720;
}
.group-ai-button .mi { color: var(--primary); font-size: 18px; }
.group-ai-button:disabled { opacity: .58; }
.ai-group-suggestions { margin-top: 10px; padding: 11px; border-radius: 15px; background: var(--soft-2); }
.ai-group-suggestions small { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.ai-group-suggestions > div { display: flex; flex-wrap: wrap; gap: 7px; }
.ai-group-suggestions button { border: 0; border-radius: 14px; padding: 7px 11px; color: var(--primary); background: var(--surface); font-size: 12px; font-weight: 720; }
.focus-break-offer { padding-top: 3px; }
.focus-break-reward { width: min(48vw, 220px); height: min(48vw, 220px); object-fit: contain; margin-top: 2px; }
.focus-break-offer h1 { margin: 4px 0 0; color: var(--ink); font-size: clamp(23px, 5.8vw, 29px); letter-spacing: -.7px; text-align: center; }
.focus-break-offer > p { margin: 8px 0 24px; color: var(--muted); font-size: 16px; }
.focus-break-offer-actions { display: flex; align-items: center; justify-content: center; gap: 14px; width: 100%; }
.focus-break-offer-actions .focus-start { width: min(46%, 210px); display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.focus-break-skip { height: 52px; border: 1px solid var(--line); border-radius: 27px; padding: 0 20px; background: transparent; color: var(--muted); font-size: 14px; }
.focus-break-tip { min-height: 24px; margin: -1px 0 10px; color: var(--muted); font-size: 16px; }
.focus-stats-head { position: relative; }
.focus-stats-head .focus-back { position: absolute; left: 0; }
.focus-stat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 11px;
}
.focus-stat {
  min-height: 96px; background: var(--surface); border-radius: 18px; padding: 12px;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 1px 4px rgba(34,48,39,.05);
}
.focus-stat b { font-size: 14px; }
.focus-stat strong { color: var(--primary); font-size: 26px; line-height: 1; }
.focus-records {
  background: var(--surface); border-radius: 18px; padding: 5px 14px 10px; margin-top: 10px;
}
.focus-record-swipe { position: relative; overflow: hidden; border-top: 1px solid var(--line); }
.focus-record-swipe:first-of-type { border-top: 0; }
.focus-record { position: relative; z-index: 1; width: 100%; min-height: 80px; border: 0; background: var(--surface); display: grid; grid-template-columns: 40px 1fr auto;
  align-items: center; gap: 10px; padding: 8px 0; text-align: left; transform: translateX(0); transition: transform .2s ease; color: var(--ink); }
.focus-record-swipe.revealed .focus-record { transform: translateX(-78px); }
.focus-record-delete { position: absolute; z-index: 0; top: 0; right: 0; bottom: 0; width: 78px; border: 0; color: white; background: var(--danger); display: grid; place-items: center; gap: 1px; font-size: 12px; font-weight: 750; }
.focus-record-delete .mi { font-size: 19px; }
.focus-record > .mi {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  color: white; background: var(--primary);
}
.focus-record > .mi.focus-type-plan { background: #718aa9; }
.focus-record > .mi.focus-type-task { background: #6f9278; }
.focus-record > .mi.focus-type-free { background: #8a7ead; }
.focus-record b, .focus-record small { display: block; }
.focus-record small { color: var(--muted); margin-top: 4px; font-size: 11px; }
.focus-record em { display: block; color: var(--primary); margin-top: 3px; font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.focus-record > strong { color: var(--muted); font-size: 14px; }
.focus-target-summary { background: var(--surface); border-radius: 18px; padding: 5px 14px 10px; margin-top: 10px; }
.focus-target-summary .section-head { margin: 7px 0 3px; }
.focus-target-summary .section-head span { color: var(--muted); font-size: 11px; }
.focus-target-summary-row { min-height: 61px; display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 9px; border-top: 1px solid var(--line); }
.focus-target-summary-row > .mi { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 11px; background: var(--soft); color: var(--primary); font-size: 19px; }
.focus-target-summary-row b, .focus-target-summary-row small { display: block; }
.focus-target-summary-row b { font-size: 14px; }
.focus-target-summary-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.focus-empty { color: var(--muted); text-align: center; padding: 32px 18px; line-height: 1.6; }
.focus-picker-list { display: grid; gap: 4px; }
.focus-picker-list > small { color: var(--muted); padding: 11px 8px 4px; }
.focus-picker-list > button {
  min-height: 52px; width: 100%; border: 0; border-radius: 14px; background: transparent;
  color: var(--ink); display: flex; align-items: center; gap: 11px; text-align: left; padding: 8px 10px;
}
.focus-duration-sheet { padding: 12px 2px 2px; }
.focus-duration-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.focus-duration-preset { min-height: 62px; border: 0; border-radius: 17px; background: var(--soft-2); color: var(--ink); font-size: 22px; font-weight: 620; }
.focus-duration-preset.selected { color: var(--ink); background: var(--soft-2); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary) 70%, transparent); font-weight: 780; }
.focus-duration-preset.add { max-width: calc(50% - 7px); font-size: 28px; font-weight: 350; }
.focus-duration-sheet p { margin: 18px 0 2px; color: var(--muted); font-size: 13px; }
.focus-minute-dialog { padding: 4px 2px; }
.focus-minute-dialog h2 { margin: 0 0 18px; font-size: 23px; letter-spacing: -.35px; }
.focus-minute-wheel { display: flex; justify-content: center; align-items: center; gap: 12px; min-height: 142px; }
.focus-minute-values { width: 150px; min-height: 126px; display: grid; align-content: center; outline: 0; }
.focus-minute-value { height: 38px; border: 0; background: transparent; color: color-mix(in srgb, var(--ink) 25%, transparent); font-size: 25px; line-height: 38px; }
.focus-minute-value.current { color: var(--ink); font-size: 31px; font-weight: 760; }
.focus-minute-wheel span { color: var(--muted); font-size: 16px; }
.focus-note-editor textarea { min-height: 132px; }
.focus-picker-list > button:hover { background: var(--soft-2); }
.focus-picker-list .mi { color: var(--muted); }
.focus-picker-list button span:last-child { display: grid; gap: 2px; }
.focus-picker-list button small { color: var(--muted); font-size: 11px; }

.overlay {
  position: fixed; z-index: 50; inset: 0; padding: 12px;
  background: rgba(25, 31, 27, .38); backdrop-filter: blur(2px);
  display: flex; align-items: flex-end; justify-content: center;
}
.overlay.focus-duration-overlay,
.overlay.focus-minute-overlay,
.overlay.focus-stop-overlay { align-items: center; padding: 24px; }
.focus-duration-overlay .sheet,
.focus-minute-overlay .sheet,
.focus-stop-overlay .sheet {
  width: min(450px, 100%); max-height: min(80vh, 640px); overflow: visible;
  border-radius: 28px; padding: 20px 24px 18px;
  box-shadow: 0 18px 48px rgba(24, 34, 27, .22);
  animation: focus-dialog-in .2s ease-out;
}
.focus-minute-overlay .sheet { width: min(480px, 100%); padding: 28px 28px 22px; }
.focus-stop-overlay .sheet { width: min(430px, 100%); border-radius: 26px; padding: 20px 22px; }
@keyframes focus-dialog-in { from { transform: scale(.97) translateY(10px); opacity: .45; } to { transform: scale(1) translateY(0); opacity: 1; } }
.sheet {
  width: min(680px, 100%); max-height: min(91vh, 800px); overflow: auto;
  background: var(--surface); border-radius: 27px 27px 17px 17px;
  padding: 11px 18px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -7px 38px rgba(24, 34, 27, .17);
  animation: sheet-in .2s ease-out;
}
@keyframes sheet-in { from { transform: translateY(18px); opacity: .5; } to { transform: translateY(0); opacity: 1; } }
.sheet-head { min-height: 50px; display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.sheet-head h2 { flex: 1; margin: 0; font-size: 21px; letter-spacing: -.4px; }
.sheet .close { border: 0; background: transparent; width: 40px; height: 40px; border-radius: 50%; color: var(--ink); display: grid; place-items: center; }
.sheet .close:hover { background: var(--soft-2); }
.sheet-copy { margin: 5px 2px 10px; color: var(--muted); line-height: 1.6; }
.field { display: grid; gap: 6px; margin: 11px 0; }
.field label { color: var(--muted); font-size: 12px; font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); background: #fbfcfe; color: var(--ink);
  border-radius: 15px; padding: 12px 13px; outline: 0; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(82, 108, 153, .12);
}
.title-input {
  border: 0 !important; background: transparent !important; padding-inline: 2px !important;
  box-shadow: none !important; font-size: 22px; font-weight: 750;
}
.field textarea { resize: vertical; min-height: 78px; line-height: 1.55; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.schedule-trigger { width: 100%; min-height: 56px; display: grid; grid-template-columns: 28px 1fr 24px; align-items: center; gap: 8px; border: 0; border-radius: 16px; padding: 8px 12px; color: var(--ink); background: var(--soft-2); text-align: left; }
.schedule-trigger > .mi { color: var(--primary); font-size: 19px; }
.schedule-trigger span:nth-child(2) { display: grid; gap: 2px; }
.schedule-trigger small { color: var(--muted); font-size: 11px; }
.schedule-trigger b { font-size: 14px; }
.schedule-head { display: grid; grid-template-columns: 42px auto auto 1fr 42px; align-items: center; gap: 2px; min-height: 56px; }
.schedule-head .close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); display: grid; place-items: center; }
.schedule-tab { position: relative; border: 0; background: transparent; min-height: 46px; padding: 0 13px; color: #a8aca9; font-size: 19px; font-weight: 720; }
.schedule-tab.active { color: var(--primary); }
.schedule-tab.active::after { content: ""; position: absolute; height: 3px; left: 13px; right: 13px; bottom: 1px; border-radius: 4px; background: var(--primary); }
.schedule-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; padding: 8px 0 15px; }
.schedule-quick button { border: 0; border-radius: 14px; background: transparent; color: var(--muted); padding: 8px 2px; font-size: 11px; display: grid; justify-items: center; gap: 4px; }
.schedule-quick .mi { color: var(--primary); font-size: 29px; }
.schedule-month { display: flex; align-items: center; justify-content: space-between; margin: 5px 2px 4px; }
.schedule-month b { font-size: 19px; }
.schedule-month .icon-btn { width: 32px; height: 32px; }
.schedule-week, .schedule-calendar { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.schedule-week { color: var(--muted); font-size: 11px; padding: 3px 0 5px; }
.schedule-day { min-height: 39px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); margin: 1px; font-size: 14px; }
.schedule-day.selected { color: white; background: var(--primary); font-weight: 750; }
.schedule-day.between { border-radius: 4px; background: color-mix(in srgb, var(--primary) 13%, transparent); color: var(--primary); }
.schedule-day.empty { visibility: hidden; }
.schedule-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 8px 0 11px; }
.schedule-summary { display: grid; gap: 5px; min-height: 104px; padding: 13px; border: 0; border-radius: 17px; background: var(--soft-2); color: var(--ink); text-align: left; }
.schedule-summary small, .schedule-summary span { color: var(--muted); font-size: 11px; }
.schedule-summary b { color: var(--primary); font-size: 17px; line-height: 1.3; }
.schedule-all-day { margin: 0; min-height: 55px; border-radius: 16px; background: var(--soft-2); display: flex; align-items: center; padding: 0 14px; }
.schedule-all-day span { flex: 1; font-weight: 700; }
.schedule-all-day input { width: 18px; height: 18px; accent-color: var(--primary); }
.schedule-time-grid { margin: 9px 0 0; }
.schedule-options { margin-top: 12px; border-radius: 18px; overflow: hidden; background: var(--soft-2); }
.schedule-options label { min-height: 49px; padding: 0 13px; display: grid; grid-template-columns: 23px 1fr auto; align-items: center; gap: 7px; border-top: 1px solid rgba(108,122,113,.08); }
.schedule-options label:first-child { border-top: 0; }
.schedule-options .mi { color: var(--muted); font-size: 18px; }
.schedule-options select { max-width: 130px; border: 0; color: var(--muted); background: transparent; outline: 0; text-align: right; }
.schedule-clear { display: block; margin: 12px auto 1px; border: 0; background: transparent; color: var(--primary); font-size: 14px; font-weight: 700; padding: 9px 18px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.subtasks-editor { display: grid; gap: 7px; }
.subtask-edit {
  display: flex; gap: 5px; align-items: center; background: var(--soft-2);
  border-radius: 14px; padding: 4px 5px 4px 11px;
}
.subtask-edit input { flex: 1; border: 0; background: transparent; outline: 0; min-width: 0; }

.review-card {
  min-height: 540px; background: var(--surface); border-radius: 25px;
  padding: 22px; box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.8);
}
.review-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-bottom: 18px; }
.review-tag { color: var(--primary); background: var(--soft); border-radius: 12px; padding: 8px 11px; font-weight: 750; }
.review-hero { background: var(--amber-soft); border-radius: 21px; padding: 18px 17px; margin-bottom: 22px; }
.review-kicker { color: #875e0c; font-size: 14px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.review-kicker .mi { width: 29px; height: 29px; border-radius: 50%; display: grid; place-items: center; background: #ffd062; font-size: 19px; }
.review-card h2 { font-size: 25px; line-height: 1.35; margin: 12px 0 0; letter-spacing: -.4px; }
.review-answer { padding: 14px 0; margin: 0; border-bottom: 1px solid var(--line); }
.review-answer:last-child { border-bottom: 0; }
.review-answer small { color: var(--primary); font-size: 13px; font-weight: 800; }
.review-answer-muted small { color: var(--muted); }
.review-answer > p { margin: 8px 0 0; line-height: 1.65; font-size: 16px; }
.review-answer-text { margin: 8px 0 0; line-height: 1.65; font-size: 16px; white-space: pre-wrap; }
.review-answer-text.is-clamped { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
.review-expand { display: block; margin: 3px 0 0; padding: 0; border: 0; background: transparent; color: #4778e8; font: inherit; font-size: 16px; line-height: 1.65; cursor: pointer; }
.review-mode-switch { display: flex; align-items: center; gap: 16px; margin: -3px 0 1px; }
.review-mode-switch button { padding: 5px 0; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 650; cursor: pointer; }
.review-mode-switch button.active { color: var(--primary); font-weight: 850; }
.review-ai-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.completion-outcomes { margin: 14px 0; padding: 12px; border-radius: 15px; background: var(--soft); }
.completion-outcomes small { color: var(--primary); font-size: 11px; font-weight: 800; }
.completion-outcomes p { display: flex; gap: 7px; align-items: flex-start; margin: 8px 0 0; color: var(--ink); font-size: 13px; line-height: 1.45; }
.completion-outcomes .mi { color: var(--primary); font-size: 16px; line-height: 1.25; }
.review-ai-preview { margin-top: 10px; padding: 12px; border-radius: 14px; background: var(--soft-2); }
.review-ai-preview > div { display: flex; align-items: center; gap: 10px; }
.review-ai-preview small { flex: 1; color: var(--primary); font-size: 11px; font-weight: 800; }
.review-ai-preview button { border: 0; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.review-ai-preview p { margin: 7px 0 0; color: var(--ink); font-size: 13px; line-height: 1.5; }
.review-ai-preview p:empty { display: none; }

.settings-card {
  background: var(--surface); border-radius: 20px; padding: 5px 15px; margin: 10px 0;
  box-shadow: 0 1px 3px rgba(34,48,39,.05);
}
.settings-row {
  min-height: 56px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--line); color: var(--ink);
}
.settings-row:last-child { border-bottom: 0; }
.settings-row span:first-child { flex: 1; }
.settings-row small { color: var(--muted); }

.login {
  min-height: 100vh; padding: 24px 18px; display: grid; place-items: center;
  background: var(--bg);
}
.login-card {
  width: min(430px, 100%); background: var(--surface); padding: 27px 24px 25px;
  border-radius: 28px; box-shadow: 0 12px 38px rgba(60, 74, 91, .13);
}
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 23px; }
.brand-mark { width: 56px; height: 56px; object-fit: contain; border-radius: 18px; }
.brand h1 { margin: 0; font-size: 24px; letter-spacing: -.4px; }
.brand p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.login-card .primary { width: 100%; padding-block: 13px; margin-top: 7px; }
.error { color: var(--danger); min-height: 20px; font-size: 13px; }

.admin-shell { max-width: 1160px; margin: 0 auto; padding: 24px; }
.admin-grid { display: grid; grid-template-columns: 330px 1fr; gap: 16px; }
.panel { background: var(--surface); border-radius: 22px; padding: 17px; box-shadow: var(--shadow); }
.user-item {
  display: flex; align-items: center; gap: 9px; width: 100%; border: 0; border-radius: 14px;
  background: transparent; padding: 11px; text-align: left; color: var(--ink);
}
.user-item:hover, .user-item.active { background: var(--soft); }
.user-copy { min-width: 0; flex: 1; }
.user-copy b, .user-copy small { display: block; overflow: hidden; text-overflow: ellipsis; }
.user-copy small { color: var(--muted); margin-top: 3px; }
.badge { padding: 4px 7px; border-radius: 8px; color: var(--primary); background: var(--soft); font-size: 10px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.admin-table th { color: var(--muted); font-size: 12px; }
.admin-table input { width: 100%; border: 0; background: transparent; color: var(--ink); }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.toast {
  position: fixed; z-index: 90; left: 50%; bottom: 112px; transform: translateX(-50%);
  color: white; background: #28312b; border-radius: 13px; padding: 10px 14px;
  box-shadow: var(--shadow-float); font-size: 13px; white-space: nowrap;
}

@media (min-width: 760px) {
  .shell { padding-left: 22px; padding-right: 22px; }
  .plan { padding: 15px 14px; }
  .review-card { min-height: 590px; }
}
@media (max-width: 760px) {
  .admin-grid { grid-template-columns: 1fr; }
  .admin-shell { padding: 14px; }
  .form-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 430px) {
  .shell { padding-left: 13px; padding-right: 13px; }
  .topbar { min-height: 70px; }
  .sheet { padding-inline: 16px; }
  .review-card { min-height: 520px; padding: 19px; }
}
