:root {
  color: #1a2c3d;
  background: #f3f8fc;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --bg: #f3f8fc;
  --panel: #ffffff;
  --panel-soft: #f8fbfd;
  --line: #e1edf8;
  --line-strong: #b2daf8;
  --text: #1a2c3d;
  --muted: #607b96;
  --blue: #2b8cdb;
  --blue-soft: #e6f4fe;
  --danger: #ff6b6b;
  --shadow: 0 16px 42px rgba(43, 140, 219, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 32px;
}

.topbar,
.brand,
.install,
.tabs,
.capture,
.captureActions,
.meta,
.panelHeader {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 12px;
}

.brand {
  gap: 10px;
}

.brand img {
  width: 36px;
  height: 36px;
}

.brand p,
.brand span,
.panelHeader h1,
.panelHeader p,
.task h2 {
  margin: 0;
}

.brand p {
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
}

.brand span,
.panelHeader p,
.meta,
.emptyState {
  color: var(--muted);
}

.install,
.primary,
.secondary,
.taskActions button,
.tabs button {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 12px;
  gap: 7px;
}

.install,
.secondary,
.taskActions button,
.tabs button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}

.appSurface {
  display: block;
  margin-top: 16px;
}

.topTabs {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 8px auto 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px;
  width: fit-content;
  box-shadow: var(--shadow);
}

.topTabs button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  transition: all 0.2s ease;
}

.topTabs button:hover {
  background: var(--panel-soft);
  color: var(--text);
}

.topTabs button.selected {
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: 0 2px 8px rgba(43, 140, 219, 0.15);
}

.topTabs svg {
  width: 20px;
  height: 20px;
}

.tabs button {
  width: 100%;
  justify-content: flex-start;
}

.tabs button.selected {
  border-color: var(--line-strong);
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 760;
}

.workspacePanel {
  min-width: 0;
}

.panelHeader {
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 14px;
}

.panelHeader h1 {
  color: var(--text);
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.panelHeader p {
  padding-top: 5px;
  line-height: 1.45;
}

.panelHeader > span {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 750;
}

.cobiWelcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 10px 0 32px;
  position: relative;
  text-align: center;
}

.cobiMascotLarge {
  width: 160px;
  height: 160px;
  object-fit: contain;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 5px rgba(255, 255, 255, 0.7));
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}

.cobiSpeech {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 16px 24px;
  border-radius: 20px;
  font-size: 1.15rem;
  font-weight: 700;
  max-width: 90%;
  text-align: center;
  box-shadow: var(--shadow);
  margin-top: 20px;
}

.cobiSpeech::after, .cobiSpeech::before {
  bottom: 100%;
  left: 50%;
  border: solid transparent;
  content: "";
  height: 0;
  width: 0;
  position: absolute;
  pointer-events: none;
}

.cobiSpeech::after {
  border-color: rgba(255, 255, 255, 0);
  border-bottom-color: var(--panel);
  border-width: 10px;
  margin-left: -10px;
}

.cobiSpeech::before {
  border-color: rgba(225, 237, 248, 0);
  border-bottom-color: var(--line);
  border-width: 11px;
  margin-left: -11px;
}

.capture {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  padding: 24px;
  box-shadow: var(--shadow);
}

.micContainer {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mic {
  display: grid;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 999px;
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(43, 140, 219, 0.35);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mic:hover {
  transform: scale(1.06);
  background: #1b7ecf;
  box-shadow: 0 6px 20px rgba(43, 140, 219, 0.45);
}

.mic.active {
  background: var(--danger);
  box-shadow: 0 4px 14px rgba(255, 107, 107, 0.4);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4);
    transform: scale(1);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(255, 107, 107, 0);
    transform: scale(1.05);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 107, 107, 0);
    transform: scale(1);
  }
}

textarea {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  color: var(--text);
  padding: 14px;
  line-height: 1.5;
  outline: none;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

textarea:focus {
  border-color: var(--line-strong);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(43, 140, 219, 0.1);
}

.brainDumpRow {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: stretch;
  gap: 8px;
}

.brainDumpRow textarea {
  min-height: 92px;
}

.submitThought {
  display: grid;
  width: 44px;
  height: 100%;
  min-height: 92px;
  align-self: stretch;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(43, 140, 219, 0.22);
}

.submitThought:hover:not(:disabled) {
  background: #1b7ecf;
  transform: translateY(-1px);
}

.speechTools {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.speechTools label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.speechTools select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 0 34px 0 10px;
  font: inherit;
  font-size: 0.9rem;
}

.captureActions {
  display: flex;
  width: 100%;
  gap: 10px;
  justify-content: flex-end;
}

.primary {
  display: flex;
  align-items: center;
  background: var(--blue);
  color: #ffffff;
}

.secondary {
  display: flex;
}

.error {
  flex-basis: 100%;
  margin: 0;
  color: #b42318;
}

.weeklyStrip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-top: 20px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.weeklyDayColumn {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 280px;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

.weeklyDayColumn.today {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.weeklyDayHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  font-weight: 700;
}

.dayName {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dayNumber {
  font-size: 1.15rem;
  color: var(--text);
}

.weeklyDayTasks {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.weeklyTaskMini {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(43, 140, 219, 0.03);
  transition: all 0.2s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.weeklyTaskMini:hover {
  background: var(--blue-soft);
  border-color: var(--line-strong);
  text-decoration: line-through;
  opacity: 0.8;
  transform: translateY(-1px);
}

.weeklyEmpty {
  text-align: center;
  color: var(--muted);
  opacity: 0.25;
  font-size: 1.2rem;
  padding: 12px 0;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  cursor: default;
}

/* Monthly Calendar styles */
.monthlyCalendar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-top: 20px;
  margin-bottom: 24px;
}

.monthlyHeader {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.85rem;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.monthlyGrid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(100px, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.monthlyCell {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--panel-soft);
  transition: all 0.2s ease;
  min-width: 0;
  color: var(--text);
  text-align: left;
}

.monthlyCell.current {
  background: #ffffff;
}

.monthlyCell.today {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.monthlyCell.other {
  opacity: 0.45;
}

.monthlyCell:hover {
  border-color: var(--line-strong);
  background: #ffffff;
  transform: translateY(-1px);
}

.cellDayNumber {
  font-size: 0.8rem;
  font-weight: 750;
  color: var(--text);
}

.cellTasks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  flex: 1;
}

.monthlyTaskMini {
  background: var(--blue-soft);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 0.72rem;
  color: var(--blue);
  font-weight: 700;
  transition: all 0.2s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monthlyTaskMini:hover {
  opacity: 0.75;
  background: #dbeafe;
}

.taskList {
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

.task {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px;
}

.task.high {
  border-color: #fecaca;
}

.task.medium {
  border-color: var(--line-strong);
}

.task.low {
  border-color: #d8e7f5;
}

.check {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  border: 2px solid var(--line-strong);
  background: #ffffff;
  color: var(--blue);
}

.check.checked {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.taskBody {
  min-width: 0;
}

.taskHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.task h2 {
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.priorityPicker {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: 0 2px 8px rgba(43, 140, 219, 0.08);
}

.priorityPicker select {
  min-width: 66px;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--blue);
  border-radius: 999px;
  padding: 0 26px 0 12px;
  font-size: 0.9rem;
  font-weight: 900;
  outline: none;
  appearance: none;
}

.priorityPicker::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  pointer-events: none;
  transform: translateY(-65%) rotate(45deg);
}

.task.high .priorityPicker {
  background: #fff1f1;
  color: #b42318;
}

.task.medium .priorityPicker {
  background: var(--blue-soft);
  color: var(--blue);
}

.task.low .priorityPicker {
  background: #eef7ff;
  color: var(--blue);
}

.task.none .priorityPicker {
  background: var(--panel-soft);
  color: var(--muted);
}

.task.high .priorityPicker select {
  color: #b42318;
}

.task.none .priorityPicker select {
  color: var(--muted);
}

.taskHead > span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 3px 7px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.task.high .taskHead span {
  background: #fff1f1;
  color: #b42318;
}

.meta {
  gap: 5px;
  padding-top: 6px;
  font-size: 0.82rem;
}

.meta svg {
  color: #8aa5c4;
}

.dateButton {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  margin-top: 2px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 3px 0;
  font-size: 0.82rem;
  text-align: left;
}

.dateButton:hover {
  color: var(--blue);
}

.dateButton svg {
  flex: 0 0 auto;
  color: #8aa5c4;
}

.nextStep {
  margin: 6px 0 0;
  color: #314057;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.subtasks {
  grid-column: 2 / -1;
  display: grid;
  gap: 6px;
  padding-top: 6px;
}

.subtask {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: #314057;
  padding: 5px 8px;
  text-align: left;
}

.subtask:hover {
  background: var(--blue-soft);
}

.subtask.done {
  color: var(--muted);
  text-decoration: line-through;
}

.subtask.archived {
  color: var(--muted);
  background: #f3f6f9;
}

.subtask.editing {
  background: #ffffff;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.subtaskCheck {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #ffffff;
  color: var(--blue);
  padding: 0;
}

.subtaskCheck svg {
  width: 13px;
  height: 13px;
}

.subtaskEditInput {
  min-width: 0;
  min-height: 32px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 0 9px;
  outline: none;
}

.subtaskEditInput:focus {
  box-shadow: 0 0 0 3px rgba(43, 140, 219, 0.12);
}

.subtaskActions {
  display: flex;
  gap: 4px;
}

.subtaskActions button {
  display: grid;
  width: 28px;
  height: 28px;
  min-height: 28px;
  place-items: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.subtaskActions button:hover {
  color: var(--blue);
  background: var(--blue-soft);
}

.subtaskActions button[data-action="step-delete"]:hover {
  color: #b42318;
  background: #fff1f1;
}

.subtaskActions svg {
  width: 15px;
  height: 15px;
}

.taskActions {
  display: flex;
  gap: 4px;
  align-items: flex-start;
}

.taskActions button {
  display: grid;
  width: 28px;
  height: 28px;
  min-height: 28px;
  place-items: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.taskActions button:hover {
  color: var(--blue);
  background: var(--blue-soft);
}

.taskActions button[data-action="delete"]:hover {
  color: #b42318;
  background: #fff1f1;
}

.modalScrim {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(26, 44, 61, 0.22);
  padding: 18px;
}

.datePicker {
  width: min(340px, 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 20px 60px rgba(26, 44, 61, 0.16);
  padding: 14px;
}

.datePickerTop {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 8px;
}

.datePickerTop strong {
  text-align: center;
}

.datePickerTop button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
}

.datePickerTop button:first-child svg {
  transform: rotate(180deg);
}

.dateWeekdays,
.dateGrid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.dateWeekdays {
  gap: 4px;
  padding: 14px 0 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.dateGrid {
  gap: 4px;
}

.dateGrid button {
  display: grid;
  aspect-ratio: 1;
  min-width: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 0.86rem;
}

.dateGrid button.other {
  color: var(--muted);
  opacity: 0.45;
}

.dateGrid button.today {
  border-color: var(--line-strong);
}

.dateGrid button.selected {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
  font-weight: 800;
}

.datePickerActions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
}

.dayTaskModal {
  width: min(720px, 100%);
  max-height: min(78vh, 720px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 22px 70px rgba(26, 44, 61, 0.18);
  padding: 14px;
}

.dayTaskTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
}

.dayTaskTop strong {
  font-size: 1rem;
}

.dayTaskTop button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 0;
  transform: rotate(45deg);
}

.dayTaskTop button:hover {
  color: var(--blue);
  background: var(--blue-soft);
}

.dayTaskList {
  display: grid;
  gap: 10px;
}

.emptyState {
  display: grid;
  min-height: 132px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 620px);
    padding-top: 14px;
  }

  .install span {
    display: none;
  }

  .appSurface {
    grid-template-columns: 1fr;
    margin-top: 20px;
  }

  .sideChooser {
    padding: 7px;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .tabs button {
    justify-content: center;
    padding: 0 8px;
  }

  .tabs span {
    display: none;
  }

  .panelHeader {
    align-items: flex-start;
  }

  .weeklyStrip {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 12px;
  }

  .weeklyDayColumn {
    flex: 0 0 150px;
    scroll-snap-align: start;
    min-height: 250px;
  }

  .monthlyGrid {
    grid-auto-rows: minmax(80px, 1fr);
    gap: 4px;
  }

  .monthlyCell {
    padding: 4px;
  }

  .monthlyTaskMini {
    font-size: 0.65rem;
    padding: 2px 4px;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 16px, 480px);
  }

  .panelHeader {
    display: grid;
  }

  .panelHeader > span {
    width: fit-content;
  }

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

  .taskActions {
    grid-column: 2;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .subtask {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .subtaskActions {
    grid-column: 2;
    justify-content: end;
  }

  .taskHead {
    flex-direction: column;
    align-items: flex-start;
  }
}
