:root {
  --bg: #f4f8fd;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-soft: rgba(238, 245, 253, 0.86);
  --text: #111827;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2378d8;
  --primary-soft: #e5f1ff;
  --green: #3c9f6f;
  --green-soft: #e8f7ee;
  --blue: #2f7fd6;
  --blue-soft: #e8f2ff;
  --rose: #d94c7b;
  --rose-soft: #fdeaf1;
  --amber: #c47b17;
  --amber-soft: #fff3d8;
  --shadow: 0 18px 42px rgba(25, 72, 118, 0.09);
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.35;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

body.dark {
  --bg: #151922;
  --panel: #1f2530;
  --panel-soft: #252d3a;
  --text: #f8fafc;
  --muted: #a5b4c6;
  --line: #344052;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(100%, 420px);
}

.login-panel {
  display: grid;
  gap: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-brand {
  padding-bottom: 6px;
}

.login-panel h1 {
  margin: 0;
  font-size: 28px;
}

.login-error {
  margin: 0;
  border: 1px solid var(--rose);
  border-radius: var(--radius);
  background: var(--rose-soft);
  color: var(--rose);
  padding: 10px 12px;
  font-weight: 700;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 12px;
  outline: none;
}

.login-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(18px);
  padding: 22px 14px;
}

body.dark .sidebar {
  background: rgba(31, 37, 48, 0.78);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 18px;
  border-bottom: 1px solid var(--line);
}

.brand-mark,
.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

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

.brand strong {
  font-size: 22px;
  letter-spacing: 0;
}

.brand span,
.user-card label,
small,
.eyebrow,
.widget-head span,
.calendar-toolbar span {
  color: var(--muted);
}

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

.nav-item,
.ghost-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  padding: 13px 14px;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
}

.nav-item:hover,
.ghost-button:hover,
.nav-item.active,
.ghost-button.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-icon {
  display: grid;
  width: 22px;
  min-width: 22px;
  height: 22px;
  place-items: center;
  font-weight: 800;
}

.nav-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sidebar-footer {
  display: grid;
  gap: 14px;
  margin-top: auto;
}

.user-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 16px 10px 0;
}

.user-card select {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 700;
}

.logout-button {
  width: 100%;
  justify-content: center;
}

.main-shell {
  min-width: 0;
  padding: 18px 22px 26px;
}

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

.voice-box {
  display: grid;
  grid-template-columns: 28px minmax(220px, 560px) 44px;
  align-items: center;
  width: min(720px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 8px 10px 8px 16px;
}

.voice-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.mic-button,
.icon-button,
.primary-button,
.secondary-button,
.secondary-link,
.widget-head button {
  min-height: 38px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.mic-button {
  border: 0;
  background: var(--primary);
  color: white;
  font-size: 18px;
}

.mic-button.recording {
  animation: pulse 0.8s infinite alternate;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  width: 40px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.workspace {
  min-width: 0;
}

.view-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.view-heading h1,
.panel h2,
.widget h2,
.meal-day h2,
.note-card h2 {
  margin: 0;
}

.view-heading h1 {
  font-size: 28px;
  font-weight: 760;
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 5px;
  font-size: 14px;
}

.view-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.primary-button,
.secondary-button {
  padding: 0 14px;
}

.segmented-control {
  display: inline-flex;
  overflow: hidden;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.segmented-control button {
  min-width: 74px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 0 12px;
}

.segmented-control button:last-child {
  border-right: 0;
}

.segmented-control button.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

.primary-button {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.primary-button:disabled,
.secondary-button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.inline-form {
  display: flex;
  gap: 8px;
}

.inline-form input,
.inline-form select {
  width: 220px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: 0 12px;
}

.inline-form select {
  width: 180px;
}

.main-view {
  min-width: 0;
}

.bottom-widget-row {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.8fr);
  gap: 14px;
  margin-top: 14px;
}

.calendar-card,
.panel,
.widget,
.meal-day,
.note-card,
.weather-hero {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.calendar-card {
  overflow: hidden;
}

.calendar-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 16px;
}

.calendar-toolbar strong,
.calendar-toolbar span {
  display: block;
}

.calendar-source-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.calendar-loading {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  padding: 10px 16px;
}

.calendar-event-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 0.8fr) minmax(96px, 0.55fr) minmax(96px, 0.55fr) minmax(160px, 0.9fr) auto auto;
  align-items: end;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  padding: 12px 16px;
}

.calendar-event-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.calendar-event-form input,
.calendar-event-form select {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
}

.calendar-event-title input {
  font-weight: 750;
}

.calendar-event-form .calendar-event-check {
  display: inline-flex;
  grid-auto-flow: column;
  grid-template-columns: auto auto;
  align-items: center;
  align-self: center;
  gap: 8px;
  white-space: nowrap;
}

.calendar-event-check input {
  width: 18px;
  min-height: 18px;
}

.calendar-event-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.source-chip,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.status-pill {
  background: var(--primary-soft);
  color: var(--primary);
}

.source-chip.green,
.event-card.green {
  background: var(--green-soft);
  color: #1f704a;
}

.source-chip.blue,
.event-card.blue {
  background: var(--blue-soft);
  color: #1e5d9c;
}

.source-chip.rose,
.event-card.rose {
  background: var(--rose-soft);
  color: #9f2e55;
}

.source-chip.amber,
.event-card.amber {
  background: var(--amber-soft);
  color: #8d5710;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(104px, 1fr));
  min-height: 350px;
  overflow-x: auto;
}

.calendar-day {
  min-width: 104px;
  border-right: 1px solid var(--line);
  background: linear-gradient(to bottom, transparent 0, transparent 51px, rgba(148, 163, 184, 0.12) 52px);
  background-size: 100% 52px;
}

.calendar-day:last-child {
  border-right: 0;
}

.calendar-day.today {
  background-color: rgba(97, 85, 245, 0.05);
}

.day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 12px;
}

.day-head strong {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--panel-soft);
}

.today .day-head strong {
  background: var(--primary);
  color: white;
}

.day-events {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 8px;
}

.week-all-day {
  display: grid;
  gap: 6px;
  min-height: 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(226, 232, 240, 0.28);
  padding: 5px 8px 7px;
}

.week-all-day .event-card {
  display: block;
  min-height: 0;
  border-radius: 7px;
  padding: 5px 8px;
  line-height: 1.15;
}

.week-all-day .event-card::before,
.week-all-day .event-card::after {
  display: none;
}

.week-all-day .event-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.1;
}

.week-all-day .event-card small {
  display: none;
}

.week-all-day + .day-events {
  padding-top: 8px;
}

.event-card {
  position: relative;
  display: grid;
  gap: 3px;
  min-height: 54px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--radius);
  padding: 8px;
}

.event-card-content {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.event-card.multi-day {
  position: relative;
  border-left-width: 3px;
  box-shadow: inset 0 -2px 0 rgba(15, 23, 42, 0.06);
}

.event-card.multi-day:not(.span-start) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.event-card.multi-day:not(.span-end) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.event-card.multi-day:not(.span-start)::before,
.event-card.multi-day:not(.span-end)::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 10px;
  height: 2px;
  background: currentColor;
  opacity: 0.35;
}

.event-card.multi-day:not(.span-start)::before {
  left: -10px;
}

.event-card.multi-day:not(.span-end)::after {
  right: -10px;
}

.event-card strong {
  line-height: 1.08;
  hyphens: auto;
  overflow-wrap: break-word;
}

.event-card span,
.event-card small {
  font-size: 12px;
}

.day-view {
  display: grid;
  gap: 0;
  min-height: 350px;
  padding: 18px;
  background: var(--panel);
}

.day-view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.day-view-head span {
  color: var(--muted);
  font-weight: 800;
}

.day-view-head strong {
  font-size: 24px;
}

.day-all-day {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  max-width: 760px;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
  background: rgba(226, 232, 240, 0.38);
  margin-top: 14px;
  padding: 12px;
}

.day-all-day > span {
  display: grid;
  align-self: stretch;
  place-items: center start;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.day-all-day > div {
  display: grid;
  gap: 8px;
}

.day-agenda {
  display: grid;
  align-content: start;
  gap: 10px;
  max-width: 760px;
  padding-top: 14px;
}

.agenda-event {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto 26px;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--radius);
  padding: 12px;
}

.agenda-event.multi-day {
  border-left-width: 4px;
}

.agenda-event.all-day {
  grid-template-columns: minmax(0, 1fr) auto 26px;
  padding: 10px 12px;
}

.agenda-event.all-day > span {
  display: none;
}

.agenda-event span,
.agenda-event small {
  font-size: 13px;
}

.month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.month-weekdays span {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(94px, 1fr));
  min-height: 520px;
  overflow-x: auto;
}

.month-day {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 104px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.month-day:nth-child(7n) {
  border-right: 0;
}

.month-day.outside {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.08);
}

.month-day-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
}

.month-day.today > .month-day-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: white;
}

.month-day div {
  display: grid;
  gap: 4px;
}

.month-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  border-radius: 6px;
  padding: 3px 5px;
}

.month-event small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-event.multi-day {
  font-weight: 800;
}

.month-event.green { background: var(--green-soft); color: #1f704a; }
.month-event.blue { background: var(--blue-soft); color: #1e5d9c; }
.month-event.rose { background: var(--rose-soft); color: #9f2e55; }
.month-event.amber { background: var(--amber-soft); color: #8d5710; }

.calendar-delete-button {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.66);
  color: currentColor;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.16s ease, background 0.16s ease;
}

.event-card .calendar-delete-button {
  position: absolute;
  top: 5px;
  right: 5px;
}

.event-card:hover .calendar-delete-button,
.agenda-event:hover .calendar-delete-button,
.month-event:hover .calendar-delete-button,
.calendar-delete-button:focus-visible {
  opacity: 1;
}

.calendar-delete-button:hover {
  background: rgba(239, 68, 68, 0.16);
}

.calendar-delete-button:disabled {
  cursor: not-allowed;
  opacity: 0;
}

@media (hover: none) {
  .calendar-delete-button {
    opacity: 0.55;
  }
}

.empty-state {
  color: var(--muted);
  font-size: 13px;
}

.widget-column {
  display: grid;
  gap: 12px;
}

.widget,
.panel,
.note-card,
.weather-hero {
  padding: 14px;
}

.widget-head,
.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget h2 {
  font-size: 19px;
  font-weight: 760;
  line-height: 1.05;
}

.widget-head button {
  min-height: 30px;
  padding: 0 9px;
  color: var(--primary);
}

.weather-now {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 6px 0 12px;
}

.weather-icon {
  position: relative;
  display: inline-grid;
  width: 42px;
  min-width: 42px;
  height: 42px;
  place-items: center;
}

.weather-icon::before,
.weather-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.weather-icon.large {
  width: 96px;
  height: 96px;
}

.weather-icon.small {
  width: 34px;
  min-width: 34px;
  height: 34px;
  margin-bottom: 8px;
}

.weather-icon.tiny {
  width: 26px;
  min-width: 26px;
  height: 26px;
}

.weather-icon.sunny::before {
  width: 58%;
  height: 58%;
  border-radius: 50%;
  background: #ffc02e;
  box-shadow: 0 0 0 7px rgba(255, 192, 46, 0.18), 0 0 18px rgba(255, 192, 46, 0.36);
}

.weather-icon.partly-cloudy::before,
.weather-icon.cloudy::before,
.weather-icon.rain::before,
.weather-icon.storm::before,
.weather-icon.fog::before,
.weather-icon.weather::before {
  width: 70%;
  height: 42%;
  left: 18%;
  top: 38%;
  border-radius: 999px;
  background: #d8e1ed;
  box-shadow: -12px -4px 0 -2px #e9eef5, 12px -7px 0 -1px #c6d4e4;
}

.weather-icon.partly-cloudy::after {
  width: 42%;
  height: 42%;
  left: 8%;
  top: 12%;
  border-radius: 50%;
  background: #ffc02e;
  box-shadow: 0 0 0 5px rgba(255, 192, 46, 0.16);
}

.weather-icon.rain::after {
  width: 4px;
  height: 16px;
  left: 33%;
  top: 66%;
  border-radius: 999px;
  background: #4299e1;
  box-shadow: 12px 4px 0 #4299e1, 24px 0 0 #4299e1;
  transform: rotate(14deg);
}

.weather-icon.storm::after {
  width: 18px;
  height: 26px;
  left: 44%;
  top: 60%;
  background: #f5b21b;
  clip-path: polygon(42% 0, 100% 0, 62% 42%, 90% 42%, 20% 100%, 38% 54%, 8% 54%);
}

.weather-icon.fog::after {
  width: 76%;
  height: 3px;
  left: 12%;
  top: 70%;
  border-radius: 999px;
  background: #a7b5c8;
  box-shadow: 0 8px 0 #c2ccd9;
}

.weather-icon.large::before {
  transform: scale(1.25);
}

.weather-icon.large.partly-cloudy::after {
  transform: scale(1.18);
}

.weather-now strong {
  display: block;
  font-size: 40px;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 0.95;
}

.weather-now span {
  color: var(--muted);
}

.weather-timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 4px 0 10px;
  padding: 10px 0;
}

.weather-timeline span {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  text-align: center;
}

.weather-timeline small {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.weather-timeline strong {
  font-size: 13px;
  line-height: 1;
}

.weather-warnings {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.weather-warnings.compact {
  margin-top: 10px;
}

.weather-warning {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(224, 132, 26, 0.28);
  border-left: 4px solid #e0841a;
  border-radius: var(--radius);
  background: #fff7e8;
  color: #6f3d04;
  padding: 10px 12px;
}

.weather-warning.level-4,
.weather-warning.level-5 {
  border-color: rgba(204, 45, 45, 0.36);
  border-left-color: #cc2d2d;
  background: #fff0f0;
  color: #7d1f1f;
}

.weather-warning strong {
  font-size: 0.9rem;
}

.weather-warning span,
.weather-warning small {
  color: inherit;
  opacity: 0.78;
  line-height: 1.35;
}

.mini-row,
.integration-row,
.list-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 8px 0;
}

.mini-row strong,
.integration-row strong,
.list-row strong {
  overflow-wrap: anywhere;
}

.mini-row small,
.list-row small,
.integration-row small {
  display: block;
}

.compact-meal-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

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

.meal-mini-list button {
  display: grid;
  grid-template-columns: 42px 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--text);
  padding: 7px;
  text-align: left;
}

.meal-mini-list .mini-meal-thumb {
  height: 38px;
  max-height: 38px;
}

.meal-mini-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.meal-mini-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shopping-dashboard-widget {
  min-width: 0;
}

.shopping-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
}

.compact-meal-strip button {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.mini-meal-thumb {
  width: 100%;
  max-height: 42px;
  border-radius: 6px;
  object-fit: cover;
}

.meal-image-placeholder {
  object-fit: contain;
  opacity: 0.78;
}

.meal-image-generating {
  object-fit: contain;
  opacity: 0.72;
  animation: imagePulse 1.6s ease-in-out infinite;
}

.meal-image-ready {
  object-fit: cover;
}

.compact-meal-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-meal-strip strong {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.15;
  overflow-wrap: break-word;
  font-size: 14px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.compact-task-list {
  display: grid;
  grid-template-columns: 1fr;
}

.panel.compact {
  margin-top: 16px;
}

.item-list {
  display: grid;
}

.list-row {
  grid-template-columns: 20px minmax(0, 1fr);
  cursor: pointer;
}

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

.item-thumb,
.mini-thumb {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  object-fit: cover;
}

.item-thumb {
  width: 42px;
  height: 42px;
}

.mini-row.with-thumb {
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

.mini-thumb {
  width: 30px;
  height: 30px;
}

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

.todo-tabs {
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  margin-bottom: 16px;
  padding: 4px;
}

.todo-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-weight: 800;
}

.todo-tabs button.active {
  background: var(--panel);
  color: var(--primary);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.todo-tabs span {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--panel-soft);
  color: inherit;
  font-size: 12px;
}

.todo-group {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.todo-group:last-child {
  margin-bottom: 0;
}

.todo-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.todo-group-head h2 {
  font-size: 18px;
}

.todo-group-head span {
  display: grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 800;
}

.todo-group.completed {
  opacity: 0.82;
}

.todo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(142px, 180px) 38px;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.todo-row .list-row {
  border-top: 0;
}

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

.todo-owner-select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0 28px 0 10px;
}

.todo-owner-select:disabled {
  color: var(--muted);
  background: var(--panel-soft);
}

.icon-only {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
}

.icon-only:hover {
  color: var(--text);
  background: var(--panel-soft);
}

.icon-only.danger:hover {
  border-color: var(--rose);
  color: var(--rose);
  background: var(--rose-soft);
}

.icon-only:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.trash-symbol {
  position: relative;
  display: block;
  width: 14px;
  height: 15px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 3px 3px;
}

.trash-symbol::before {
  content: "";
  position: absolute;
  left: -3px;
  top: -5px;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.trash-symbol::after {
  content: "";
  position: absolute;
  left: 4px;
  top: -8px;
  width: 6px;
  height: 3px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
}

.meal-grid,
.settings-grid {
  display: grid;
  gap: 16px;
}

.meal-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.meal-day {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.meal-thumb {
  width: 100%;
  height: 96px;
  border-radius: var(--radius);
  background: var(--panel-soft);
  object-fit: cover;
}

@keyframes imagePulse {
  0%, 100% { filter: saturate(0.82) brightness(1); }
  50% { filter: saturate(0.9) brightness(1.06); }
}

.meal-day label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.meal-day input {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--text);
  padding: 0 10px;
}

.notes-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 16px;
}

.notes-board {
  display: grid;
  gap: 12px;
}

.notes-board.grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-content: start;
}

.notes-board.list {
  grid-template-columns: 1fr;
}

.note-card {
  display: grid;
  gap: 10px;
  min-height: 160px;
  padding: 14px;
}

.notes-board.list .note-card {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.note-card-main {
  display: grid;
  gap: 8px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.note-card-main h2,
.note-editor-panel h2,
.note-editor-placeholder h2 {
  margin: 0;
  font-size: 1.05rem;
}

.note-card-main p,
.note-editor-placeholder p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.note-card-main small {
  color: var(--muted);
  font-weight: 700;
}

.note-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.note-pin {
  width: fit-content;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.note-card.pinned .note-pin {
  background: rgba(110, 86, 207, 0.14);
  color: var(--accent);
}

.note-editor-panel,
.note-editor-placeholder {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
}

.note-editor-panel form {
  display: grid;
  gap: 12px;
}

.note-editor-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.note-editor-panel input,
.note-editor-panel textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--text);
  padding: 10px;
  font: inherit;
}

.note-editor-panel textarea {
  min-height: 220px;
  resize: vertical;
}

.weather-hero {
  display: grid;
  grid-template-columns: 110px 220px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.weather-hero h2 {
  margin: 0;
  font-size: 72px;
}

.weather-hero p,
.weather-hero span {
  color: var(--muted);
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.forecast-grid article {
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 14px;
}

.forecast-grid strong,
.forecast-grid span,
.forecast-grid small {
  display: block;
}

.forecast-grid span {
  margin: 10px 0;
  font-size: 28px;
  font-weight: 800;
}

.weather-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.weather-morning strong {
  display: block;
  margin-bottom: 8px;
  font-size: 32px;
}

.weather-morning span,
.weather-morning small,
.weather-radar-card small,
.weather-notes p,
.weather-notes small {
  color: var(--muted);
}

.weather-hourly,
.weather-notes {
  grid-column: 1 / -1;
}

.rain-bars {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  min-height: 82px;
}

.rain-bars span {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.rain-bars i {
  display: block;
  width: 100%;
  max-width: 18px;
  min-height: 8px;
  border-radius: 999px 999px 4px 4px;
  background: var(--blue);
  opacity: 0.72;
}

.rain-bars small {
  color: var(--muted);
  font-size: 11px;
}

.radar-preview {
  position: relative;
  overflow: hidden;
  height: 150px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(47, 127, 214, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(47, 127, 214, 0.08) 1px, transparent 1px),
    var(--panel-soft);
  background-size: 28px 28px;
  margin-bottom: 10px;
}

.radar-preview span {
  position: absolute;
  display: block;
  border-radius: 999px;
  background: rgba(47, 127, 214, 0.2);
  filter: blur(1px);
}

.radar-preview span:nth-child(1) {
  width: 96px;
  height: 42px;
  left: 12%;
  top: 24%;
}

.radar-preview span:nth-child(2) {
  width: 130px;
  height: 54px;
  right: 12%;
  top: 40%;
  background: rgba(60, 159, 111, 0.18);
}

.radar-preview span:nth-child(3) {
  width: 70px;
  height: 70px;
  left: 42%;
  bottom: 10%;
  background: rgba(196, 123, 23, 0.16);
}

.radar-map {
  position: relative;
  overflow: hidden;
  height: 190px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(47, 127, 214, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(47, 127, 214, 0.08) 1px, transparent 1px),
    #eaf1f5;
  background-size: 32px 32px;
}

.radar-tile-layer {
  position: absolute;
  left: calc(50% - var(--radar-offset-x));
  top: calc(50% - var(--radar-offset-y));
  display: grid;
  grid-template-columns: repeat(3, 256px);
  grid-template-rows: repeat(3, 256px);
  width: 768px;
  height: 768px;
}

.radar-base-layer {
  z-index: 1;
}

.radar-tile-layer img {
  width: 256px;
  height: 256px;
  object-fit: cover;
}

.radar-rain-layer {
  z-index: 2;
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 180ms ease;
}

.radar-rain-layer.active {
  opacity: 0.72;
}

.radar-crosshair {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  border: 2px solid #e84f4f;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.72);
  transform: translate(-50%, -50%);
}

.radar-crosshair::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #e84f4f;
  transform: translate(-50%, -50%);
}

.radar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0;
}

.radar-controls strong {
  font-size: 0.9rem;
}

.radar-steps {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 10px;
}

.radar-steps button {
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  padding: 0;
}

.radar-steps button.active {
  background: var(--accent);
}

.integration-list,
.diagnostics-list,
.settings-table {
  display: grid;
}

.diagnostic-row,
.integration-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.diagnostic-row,
.integration-row {
  display: grid;
  align-items: center;
  gap: 12px;
  border-top: 0;
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
}

.diagnostic-row small {
  display: block;
}

.diagnostic-row:last-child,
.integration-row:last-child {
  border-bottom: 0;
}

.integration-row em {
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 6px 10px;
  font-style: normal;
  font-weight: 800;
}

.diagnostic-status {
  border-radius: 999px;
  padding: 6px 10px;
  font-style: normal;
  font-weight: 800;
}

.diagnostic-status.ok {
  background: var(--green-soft);
  color: var(--green);
}

.diagnostic-status.bad {
  background: var(--rose-soft);
  color: var(--rose);
}

.diagnostic-status.neutral {
  background: var(--panel-soft);
  color: var(--muted);
}

.settings-table {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.settings-table label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 10;
}

.toast {
  max-width: 360px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 12px 14px;
}

@keyframes pulse {
  from {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(97, 85, 245, 0.35);
  }
  to {
    transform: scale(1.04);
    box-shadow: 0 0 0 12px rgba(97, 85, 245, 0);
  }
}

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

  .calendar-event-form {
    grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(116px, 0.45fr)) minmax(170px, 0.75fr);
  }

  .calendar-event-title,
  .calendar-event-actions {
    grid-column: span 2;
  }

  .widget-column {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bottom-widget-row {
    grid-template-columns: 1fr;
  }
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-item,
  .ghost-button {
    justify-content: center;
    padding: 10px;
  }

  .nav-item {
    font-size: 13px;
  }

  .sidebar-footer {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }

  .user-card {
    border-top: 0;
    padding: 0;
  }

  .main-shell {
    padding: 16px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .view-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .view-actions {
    justify-content: flex-start;
  }

  .calendar-event-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-event-title,
  .calendar-event-actions {
    grid-column: 1 / -1;
  }

  .weather-hero {
    grid-template-columns: 1fr;
  }

  .weather-detail-grid {
    grid-template-columns: 1fr;
  }

  .forecast-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notes-shell {
    grid-template-columns: 1fr;
  }

  .widget-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-meal-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .todo-row {
    grid-template-columns: minmax(0, 1fr) 38px;
  }

  .todo-owner-select {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .todo-row .icon-only {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 560px) {
  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar-footer {
    grid-template-columns: 1fr;
  }

  .voice-box {
    grid-template-columns: 22px minmax(0, 1fr) 40px;
  }

  .inline-form {
    width: 100%;
    flex-direction: column;
  }

  .inline-form input,
  .inline-form select {
    width: 100%;
  }

  .calendar-event-form {
    grid-template-columns: 1fr;
  }

  .calendar-event-title,
  .calendar-event-actions {
    grid-column: auto;
  }

  .calendar-event-actions {
    flex-direction: column-reverse;
  }

  .calendar-event-actions button {
    width: 100%;
  }

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

  .widget-column,
  .compact-meal-strip {
    grid-template-columns: 1fr;
  }

  .notes-board.grid {
    grid-template-columns: 1fr;
  }

  .notes-board.list .note-card {
    grid-template-columns: 1fr;
  }
}
