:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --bg-strong: #ffffff;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-soft: #eef4ff;
  --border: rgba(20, 35, 58, 0.11);
  --border-strong: rgba(0, 82, 204, 0.24);
  --text: #101828;
  --muted: #667085;
  --muted-strong: #475467;
  --brand: #0052cc;
  --brand-soft: rgba(0, 82, 204, 0.1);
  --success: #12b76a;
  --warning: #f79009;
  --danger: #f04438;
  --shadow: 0 20px 54px rgba(16, 24, 40, 0.12);
  --small-shadow: 0 10px 30px rgba(16, 24, 40, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --sidebar: 280px;
  --font: ui-rounded, "SF Pro Rounded", "Avenir Next", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050912;
  --bg-strong: #0b1220;
  --surface: rgba(16, 24, 40, 0.88);
  --surface-solid: #111827;
  --surface-soft: #0f1f3a;
  --border: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(86, 154, 255, 0.38);
  --text: #f8fafc;
  --muted: #a6b1c2;
  --muted-strong: #cbd5e1;
  --brand: #5aa2ff;
  --brand-soft: rgba(90, 162, 255, 0.15);
  --shadow: 0 22px 58px rgba(0, 0, 0, 0.34);
  --small-shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(0, 82, 204, 0.1), transparent 30%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-strong) 100%);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

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

img {
  max-width: 100%;
  display: block;
}

.icon {
  font-family: "Material Symbols Rounded", var(--font);
  font-size: 1.08rem;
  line-height: 1;
}

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

.hidden {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: color-mix(in srgb, var(--surface-solid) 86%, transparent);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 18px;
}

.brand-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  box-shadow: 0 14px 28px rgba(0, 82, 204, 0.2);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.02rem;
}

.brand small {
  color: var(--muted);
  margin-top: 2px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 16px;
  color: var(--muted-strong);
  font-weight: 700;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-item:hover,
.nav-item.is-active {
  background: var(--brand-soft);
  color: var(--brand);
}

.sidebar-card,
.panel {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--small-shadow);
  backdrop-filter: blur(18px);
}

.sidebar-card {
  padding: 18px;
  border-radius: 20px;
}

.muted-card {
  margin-top: auto;
}

.mini-label {
  display: block;
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 5px;
}

.sidebar-card strong {
  font-size: 1.08rem;
}

.sidebar-card p,
.helper-text,
.setting-row small {
  color: var(--muted);
  line-height: 1.45;
}

.progress-track {
  height: 9px;
  margin-top: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 14%, transparent);
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 0.24s ease;
}

.workspace {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.date-line {
  margin: 0 0 5px;
  color: var(--muted);
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: 1.18rem;
  line-height: 1.15;
}

.account-bar,
.command-actions,
.task-meta,
.task-actions,
.time-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.apple-button,
.primary-button,
.secondary-button,
.ghost-button,
.text-button,
.icon-button {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.apple-button:hover,
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.text-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.apple-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  background: #050505;
  color: #ffffff;
  box-shadow: var(--small-shadow);
}

.apple-button.large {
  width: 100%;
  min-height: 54px;
  font-size: 1rem;
}

.apple-mark {
  width: 16px;
  height: 19px;
  background: currentColor;
  mask: radial-gradient(circle at 58% 12%, transparent 0 20%, #000 21%) top / 100% 100%;
  clip-path: path("M11.7 0c-.9.1-2 .7-2.6 1.4-.6.7-1.1 1.8-.9 2.8 1 .1 2-.5 2.7-1.2.6-.7 1-1.7.8-3ZM16 13.5c-.4.9-.6 1.3-1.1 2.1-.7 1.1-1.8 2.5-3.1 2.5-1.2 0-1.5-.8-3.1-.8s-2 .8-3.1.8c-1.3 0-2.3-1.3-3.1-2.4C.3 12.4.1 8.7 1.5 6.6c1-1.5 2.5-2.3 4-2.3 1.5 0 2.5.8 3.1.8.6 0 1.8-.9 3.1-.8.5 0 2 .2 3 1.6-2.6 1.4-2.2 5.1 1.3 6.6Z");
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
}

.primary-button {
  background: var(--brand);
  color: white;
  box-shadow: 0 16px 30px color-mix(in srgb, var(--brand) 24%, transparent);
}

.secondary-button {
  border: 1px solid var(--border-strong);
  background: var(--brand-soft);
  color: var(--brand);
}

.ghost-button,
.icon-button {
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--muted-strong);
}

.ghost-button {
  padding: 0 14px;
}

.text-button {
  background: transparent;
  color: var(--brand);
  padding: 0 8px;
}

.compact {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.88rem;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
  padding: 26px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, var(--surface-solid), color-mix(in srgb, var(--surface-soft) 80%, transparent)),
    var(--surface);
  box-shadow: var(--shadow);
}

[data-auth="ready"] .login-panel {
  display: none;
}

.login-logo {
  width: min(220px, 46%);
  margin-bottom: 16px;
}

.login-copy h2 {
  max-width: 640px;
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1;
}

.login-copy p {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.6;
}

.login-actions {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  border: 1px solid var(--border);
}

.local-name-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.local-name-field input {
  width: 100%;
}

#auth-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.72fr);
  gap: 22px;
  opacity: 0.44;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

[data-auth="ready"] .content-grid {
  opacity: 1;
  pointer-events: auto;
}

.primary-column,
.secondary-column {
  display: grid;
  align-content: start;
  gap: 22px;
}

.panel {
  border-radius: var(--radius-xl);
  padding: 20px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.status-pill,
.priority-pill,
.time-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
}

textarea,
select,
input[type="text"],
input[type="number"],
input[type="time"] {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-solid) 92%, transparent);
  color: var(--text);
  outline: none;
}

textarea:focus,
select:focus,
input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

textarea {
  width: 100%;
  min-height: 142px;
  padding: 14px;
  resize: vertical;
  line-height: 1.5;
}

select,
input[type="text"],
input[type="number"],
input[type="time"] {
  padding: 0 10px;
}

.helper-text {
  min-height: 22px;
  margin: 14px 0 0;
  font-size: 0.92rem;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.timeline-time {
  padding-top: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: right;
}

.timeline-block {
  position: relative;
  min-height: 58px;
  padding: 13px 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
}

.timeline-block::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 0;
  width: 2px;
  height: calc(100% + 12px);
  background: color-mix(in srgb, var(--brand) 20%, transparent);
}

.timeline-row:last-child .timeline-block::before {
  height: 100%;
}

.timeline-task {
  border-color: color-mix(in srgb, var(--brand) 30%, var(--border));
  background:
    linear-gradient(135deg, var(--brand-soft), transparent),
    color-mix(in srgb, var(--surface-solid) 86%, transparent);
}

.timeline-task strong,
.timeline-empty strong {
  display: block;
  margin-bottom: 4px;
}

.timeline-task span,
.timeline-empty span {
  color: var(--muted);
  font-size: 0.9rem;
}

.stats-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 14px;
}

.stat {
  padding: 14px;
  border-radius: 18px;
  background: var(--surface-soft);
}

.stat span,
.stat strong {
  display: block;
}

.stat span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.stat strong {
  margin-top: 3px;
  font-size: 1.55rem;
}

.task-list {
  display: grid;
  gap: 12px;
}

.task-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface-solid) 86%, transparent);
}

.task-card[data-completed="true"] {
  opacity: 0.7;
}

.task-card[data-completed="true"] .task-title {
  text-decoration: line-through;
}

.done-toggle {
  width: 28px;
  height: 28px;
  margin-top: 7px;
  border-radius: 999px;
  border: 2px solid var(--border-strong);
  background: transparent;
}

.task-card[data-completed="true"] .done-toggle {
  border-color: var(--success);
  background: var(--success);
  box-shadow: inset 0 0 0 5px var(--surface-solid);
}

.task-body {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.task-title {
  width: 100%;
  font-weight: 800;
}

.task-meta {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.84rem;
}

.task-meta label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.task-minutes {
  width: 72px;
}

.task-actions {
  grid-column: 2;
  justify-content: flex-end;
  gap: 6px;
}

.icon-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
}

.empty-state {
  padding: 24px;
  border: 1px dashed var(--border-strong);
  border-radius: 20px;
  color: var(--muted);
  background: var(--brand-soft);
}

.settings-grid {
  display: grid;
  gap: 12px;
}

.setting-row,
.range-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-solid) 84%, transparent);
}

.setting-row span,
.setting-row strong,
.setting-row small {
  display: block;
}

.setting-row strong {
  margin-bottom: 3px;
}

input[type="checkbox"] {
  width: 44px;
  height: 26px;
  margin: 0;
  appearance: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 25%, transparent);
  position: relative;
  transition: background 0.18s ease;
}

input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
  transition: transform 0.18s ease;
}

input[type="checkbox"]:checked {
  background: var(--brand);
}

input[type="checkbox"]:checked::after {
  transform: translateX(18px);
}

.time-row {
  align-items: stretch;
}

.time-row label {
  flex: 1;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.range-row {
  display: grid;
  grid-template-columns: auto 1fr 60px;
  color: var(--muted-strong);
  font-size: 0.9rem;
}

.range-row input {
  width: 100%;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px 18px;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }

  .nav-list {
    display: flex;
  }

  .sidebar-card {
    display: none;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .sidebar {
    flex-wrap: wrap;
    gap: 12px;
    overflow-x: visible;
  }

  .brand {
    width: 100%;
  }

  .nav-list {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-item {
    justify-content: center;
    padding: 0 8px;
  }

  .workspace {
    padding: 18px;
  }

  .topbar,
  .panel-heading,
  .command-actions,
  .account-bar,
  .time-row {
    align-items: stretch;
    flex-direction: column;
  }

  .login-panel {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .stats-panel {
    grid-template-columns: 1fr;
  }

  .task-card {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .timeline-row {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
