:root {
  color-scheme: light;
  --navy: #0f172a;
  --navy-soft: #1e293b;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --green: #15803d;
  --green-soft: #f0fdf4;
  --orange: #c2410c;
  --surface: #ffffff;
  --background: #f6f7fb;
  --line: #e5e7eb;
  --muted: #64748b;
  --text: #111827;
  --radius: 22px;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--background); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 2px;
}
[hidden] { display: none !important; }

.offline-banner {
  position: fixed;
  z-index: 100;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 999px;
  color: #fff;
  background: var(--navy);
  box-shadow: var(--shadow);
  font-size: 13px;
}

.auth-view {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(28px + env(safe-area-inset-top)) 22px calc(28px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 15% 5%, rgba(37, 99, 235, 0.16), transparent 34%),
    linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}
.auth-card {
  width: min(100%, 420px);
  position: relative;
  padding: 32px 26px 26px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 16px;
  color: #fff;
  background: var(--navy);
  font-size: 23px;
  font-weight: 800;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1, h2, p { margin-top: 0; }
.auth-card h1 {
  margin-bottom: 9px;
  font-size: clamp(28px, 7vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}
.muted { color: var(--muted); }
.stack { display: grid; gap: 16px; margin-top: 26px; }
label > span, legend {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}
input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 12px 14px;
  color: var(--text);
  background: #fff;
  font-size: 16px;
}
input:focus { border-color: #93c5fd; }
.field-hint {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.button {
  min-height: 50px;
  border: 0;
  border-radius: 15px;
  padding: 12px 18px;
  font-weight: 750;
  cursor: pointer;
}
.button:disabled { opacity: 0.55; cursor: wait; }
.button-primary { color: #fff; background: var(--blue); }
.button-light { color: var(--navy); background: rgba(255,255,255,0.9); }
.button-danger-ghost { color: var(--red); background: var(--red-soft); }
.full-width { width: 100%; }
.text-button, .language-button {
  border: 0;
  color: var(--blue);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}
.text-button { display: block; margin: 18px auto 0; }
.language-button { position: absolute; top: 18px; right: 18px; }
.form-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  color: #991b1b;
  background: var(--red-soft);
  font-size: 13px;
}

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--background);
}
.app-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top)) 20px 14px;
  background: rgba(246, 247, 251, 0.88);
  backdrop-filter: blur(18px);
}
.app-header h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.03em;
}
.avatar-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  background: var(--navy);
  font-weight: 800;
  cursor: pointer;
}
.app-content { padding: 4px 18px calc(110px + env(safe-area-inset-bottom)); }
.time-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 10px 0 16px;
}
.time-selector p { margin: 0; color: #475569; font-size: 14px; font-weight: 650; }
.chip-row { display: flex; gap: 6px; }
.chip {
  min-width: 42px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #475569;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}
.chip.is-active { border-color: var(--navy); color: #fff; background: var(--navy); }

.recommendation-card {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 22px;
  border-radius: 26px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 15%, rgba(96, 165, 250, 0.5), transparent 36%),
    linear-gradient(145deg, #0f172a, #1d4ed8);
  box-shadow: 0 18px 34px rgba(30, 64, 175, 0.22);
}
.recommendation-card::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -50px;
  width: 150px;
  height: 150px;
  border: 22px solid rgba(255,255,255,0.08);
  border-radius: 50%;
}
.recommendation-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.soft-badge {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  letter-spacing: 0;
  text-transform: none;
}
.recommendation-card h2 {
  position: relative;
  z-index: 1;
  max-width: 88%;
  margin-bottom: 9px;
  font-size: clamp(23px, 6vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}
.recommendation-card p { position: relative; z-index: 1; max-width: 88%; color: #dbeafe; }
.recommendation-card .button { position: relative; z-index: 1; margin-top: 8px; min-height: 42px; }

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 20px 0 12px;
  padding: 5px;
  border-radius: 16px;
  background: #e9edf5;
}
.tab {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 750;
}
.tab span { margin-left: 3px; font-size: 12px; }
.tab.is-active { color: var(--navy); background: #fff; box-shadow: 0 3px 10px rgba(15,23,42,0.08); }
.task-list { display: grid; gap: 9px; }
.task-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 12px 13px;
  border: 1px solid #edf0f5;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15,23,42,0.035);
}
.task-check {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 2px solid #cbd5e1;
  border-radius: 9px;
  color: transparent;
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
}
.task-item.is-done .task-check { border-color: var(--green); color: #fff; background: var(--green); }
.task-content { min-width: 0; cursor: pointer; }
.task-title {
  margin: 0 0 5px;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-item.is-done .task-title { color: #94a3b8; text-decoration: line-through; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; color: var(--muted); font-size: 12px; }
.task-meta .is-overdue { color: var(--red); font-weight: 750; }
.task-priority {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
}
.task-priority.is-high { background: var(--red); }
.task-chevron { color: #cbd5e1; font-size: 24px; }
.empty-state { padding: 56px 22px; text-align: center; }
.empty-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 20px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 25px;
  font-weight: 900;
}
.empty-state h2 { margin-bottom: 6px; font-size: 19px; }

.fab {
  position: fixed;
  z-index: 25;
  right: max(22px, calc((100vw - 760px) / 2 + 22px));
  bottom: calc(22px + env(safe-area-inset-bottom));
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 20px;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 14px 30px rgba(37,99,235,0.34);
  cursor: pointer;
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
}
.sheet-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  background: rgba(15,23,42,0.42);
  backdrop-filter: blur(4px);
}
.bottom-sheet {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 0;
  width: min(100%, 760px);
  max-height: 94dvh;
  transform: translateX(-50%);
  overflow: auto;
  border-radius: 28px 28px 0 0;
  background: #fff;
  box-shadow: 0 -18px 50px rgba(15,23,42,0.2);
  padding-bottom: env(safe-area-inset-bottom);
}
.compact-sheet { max-height: 78dvh; }
.sheet-handle { width: 44px; height: 5px; margin: 10px auto 4px; border-radius: 999px; background: #dbe1ea; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px 8px; }
.sheet-header h2 { margin: 0; font-size: 22px; letter-spacing: -0.025em; }
.icon-button { width: 38px; height: 38px; border: 0; border-radius: 12px; color: #64748b; background: #f1f5f9; cursor: pointer; font-size: 25px; }
.sheet-body { display: grid; gap: 20px; padding: 14px 20px 22px; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.option-grid { display: grid; gap: 8px; }
.option-grid-3 { grid-template-columns: repeat(3, 1fr); }
.option-grid-4 { grid-template-columns: repeat(4, 1fr); }
.option {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: #475569;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}
.option.is-active { border-color: var(--navy); color: #fff; background: var(--navy); }
.date-input { margin-top: 8px; min-height: 44px; }
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row small { margin-top: 4px; color: var(--muted); }
.toggle-row input {
  appearance: none;
  width: 48px;
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  padding: 3px;
  background: #cbd5e1;
  transition: 0.18s ease;
}
.toggle-row input::after {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(15,23,42,0.2);
  transition: 0.18s ease;
}
.toggle-row input:checked { background: var(--red); }
.toggle-row input:checked::after { transform: translateX(20px); }
.sheet-actions { display: flex; gap: 10px; }
.sheet-actions .button:last-child { flex: 1; }
.account-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; background: #f8fafc; }
.account-avatar { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; color: #fff; background: var(--navy); font-weight: 850; }
.account-card p { margin: 4px 0 0; font-size: 13px; }
.settings-row { display: flex; justify-content: space-between; width: 100%; min-height: 52px; border: 0; border-bottom: 1px solid var(--line); color: var(--text); background: transparent; cursor: pointer; }
.install-note { padding: 15px; border-radius: 16px; color: #334155; background: var(--blue-soft); }
.install-note p { margin: 5px 0 0; color: #64748b; font-size: 13px; }
.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100% - 40px);
  padding: 11px 15px;
  border-radius: 999px;
  color: #fff;
  background: rgba(15,23,42,0.94);
  box-shadow: var(--shadow);
  font-size: 13px;
  text-align: center;
}

@media (min-width: 760px) {
  body { padding: 22px 0; }
  .app-shell { min-height: calc(100dvh - 44px); border-radius: 30px; box-shadow: var(--shadow); overflow: hidden; }
  .app-header { top: 22px; }
  .fab { bottom: 42px; }
  .bottom-sheet { bottom: 22px; border-radius: 28px; max-height: calc(100dvh - 44px); }
}

@media (max-width: 430px) {
  .time-selector { align-items: flex-start; flex-direction: column; }
  .chip-row { width: 100%; }
  .chip { flex: 1; }
  .recommendation-card { min-height: 205px; }
  .recommendation-card h2, .recommendation-card p { max-width: 100%; }
}

.task-next {
  margin: 0 0 6px;
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-item.is-done .task-next { color: #94a3b8; }
.more-details {
  margin-top: -4px;
  border-radius: 14px;
  background: #f8fafc;
}
.more-details summary {
  padding: 12px 14px;
  color: #475569;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}
.more-details[open] { padding: 0 12px 12px; }
.more-details[open] summary { padding-inline: 2px; }

.build-version{margin:14px 0 0;text-align:center;font-size:11px;color:#94a3b8;letter-spacing:.08em}
