/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
:root {
  --bg: #f4f1ea;
  --panel: #fffdf8;
  --input-bg: #ffffff;
  --ink: #23201b;
  --muted: #8b8477;
  --line: #ddd6c8;
  --accent: #2c6e63;
  --accent-ink: #fff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 6px 20px rgba(0, 0, 0, 0.04);
}

[data-theme='dark'] {
  --bg: #17150f;
  --panel: #221e17;
  --input-bg: #2b261d;
  --ink: #ece7db;
  --muted: #9a927f;
  --line: #3a3327;
  --accent: #4caf7d;
  --accent-ink: #0c0f0d;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* Make all form controls follow the theme (covers inline-styled inputs too). */
input,
select,
textarea {
  background: var(--input-bg);
  color: var(--ink);
  border-color: var(--line);
}
input[type='color'] {
  padding: 2px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

input,
select {
  font-family: inherit;
  font-size: inherit;
}

.btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 8px;
  padding: 7px 12px;
  transition: background 0.12s, border-color 0.12s;
}
.btn:hover {
  border-color: var(--accent);
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-primary:hover {
  filter: brightness(1.06);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.field label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field input,
.field select {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--ink);
}

/* ---- layout ---- */
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 8px;
}
.icon-btn:hover {
  border-color: var(--accent);
}
.mobile-only {
  display: none;
}
.mobile-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 12px;
  z-index: 60;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}
.mobile-menu .btn {
  width: 100%;
  text-align: left;
}
.brand {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 20px;
}
.brand span {
  color: var(--accent);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 18px;
}
.topnav {
  display: flex;
  gap: 4px;
}
.topnav-link {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.topnav-link:hover {
  color: var(--ink);
}
.topnav-link.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px;
}
.wrap.wrap-wide {
  max-width: 1440px;
}

/* 6-month overview: 2 rows of 3 */
.six-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 16px;
  gap: 16px;
}
@media (max-width: 980px) {
  .six-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .six-grid {
    grid-template-columns: 1fr;
  }
}
.grid-month-title {
  padding: 7px 10px;
  font-weight: 700;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.02);
}

/* compact month (overview) */
.grid-compact {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.grid-compact .grid-weekdays div {
  padding: 3px 0;
  text-align: center;
  font-size: 9px;
}
.grid-compact .cell {
  min-height: 38px;
  padding: 2px 3px;
  cursor: pointer;
}
.grid-compact .num {
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  font-size: 10px;
  border-radius: 8px;
  font-weight: 600;
}
.grid-compact .manual-flag {
  top: 2px;
  right: 3px;
  font-size: 8px;
}
.note-dots {
  position: absolute;
  bottom: 3px;
  left: 4px;
  display: flex;
  gap: 2px;
  z-index: 2;
}
.note-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6);
}

/* ---- calendar ---- */
.cal-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.todo-screen {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.todo-screen .add-todo {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.todo-screen .todo-list {
  max-height: none;
}

@media (max-width: 768px) {
  /* Add-todo controls stack instead of overflowing. */
  .todo-screen .add-todo {
    flex-direction: column;
    align-items: stretch;
  }
  .todo-screen .add-todo .field {
    flex: none;
    width: 100%;
  }
  .todo-screen .add-todo > .btn {
    width: 100%;
  }
  /* Todo rows wrap their controls onto a second line rather than overflow. */
  .todo-row {
    flex-wrap: wrap;
  }
  .todo-title {
    flex-basis: 55%;
  }
  .todo-due {
    flex: 1 1;
    width: auto;
  }
  .todo-prio {
    flex: 1 1;
  }
}
.cal-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.cal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.nav-basic,
.nav-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Mobile: title on top, prev/today/next below, everything else in the hamburger. */
@media (max-width: 768px) {
  .topbar {
    padding: 12px 14px;
  }
  .wrap {
    padding: 14px;
  }
  .cal-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .cal-title {
    text-align: center;
    font-size: 21px;
  }
  .cal-nav {
    flex-wrap: nowrap;
  }
  .nav-basic {
    flex: 1 1;
    flex-wrap: nowrap;
  }
  .nav-basic .btn {
    flex: 1 1;
  }
  .nav-extra {
    display: none;
  }
  .mobile-only {
    display: inline-flex;
  }
}
@media (min-width: 769px) {
  .mobile-menu {
    display: none;
  }
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 14px;
  align-items: center;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
}
.swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.grid {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.grid-weekdays,
.grid-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.grid-weekdays {
  border-bottom: 1px solid var(--line);
}
.grid-weekdays div {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.grid-weekdays div:nth-child(6),
.grid-weekdays div:nth-child(7) {
  color: #b98a5a;
}

.cell {
  position: relative;
  min-height: 92px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
  padding-bottom: calc(6px + var(--event-band, 0px));
  cursor: pointer;
  transition: box-shadow 0.1s;
}
.cell:nth-child(7n) {
  border-right: none;
}
.cell:hover {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.cell.out {
  opacity: 0.4;
}
.cell.today .num {
  background: var(--accent);
  color: #fff;
}
.num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  position: relative;
  z-index: 2;
}
.party-name {
  position: absolute;
  left: 8px;
  bottom: calc(6px + var(--event-band, 0px));
  font-size: 11px;
  font-weight: 600;
  z-index: 2;
  color: rgba(0, 0, 0, 0.55);
}

/* week-row layout + event spans */
.grid-body {
  display: flex;
  flex-direction: column;
}
.week-row {
  position: relative;
}
.week-cells {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.week-events {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.event-bar {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.event-bar .ev-title {
  flex: 1 1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}
.event-bar .ev-arrow {
  flex: none;
  font-size: 10px;
  opacity: 0.85;
}
.grid-compact .cell {
  padding-bottom: calc(2px + var(--event-band, 0px));
}
.grid-compact .event-bar {
  border-radius: 2px;
  box-shadow: none;
}
.manual-flag {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  font-weight: 800;
  color: #c0392b;
  z-index: 2;
  letter-spacing: 0.03em;
}

.cell-notes {
  position: absolute;
  top: 30px;
  left: 5px;
  right: 5px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.note-chip {
  font-size: 10px;
  line-height: 1.3;
  padding: 1px 4px 1px 5px;
  border-radius: 4px;
  border-left: 3px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: #23201b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.note-chip.more {
  background: transparent;
  border: none;
  color: rgba(0, 0, 0, 0.55);
  font-weight: 700;
  padding-left: 5px;
}

/* ---- modal ---- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 26, 20, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal {
  background: var(--panel);
  border-radius: 14px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 22px;
}
/* Wider variant for the dense, multi-column editors. */
.modal-wide {
  max-width: 840px;
}
/* Let dense field rows wrap instead of overflowing on narrow viewports. */
.modal .row {
  flex-wrap: wrap;
}
.modal h2 {
  margin: 0 0 16px;
  font-size: 19px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.row {
  display: flex;
  gap: 12px;
}
.row > * {
  flex: 1 1;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-gap: 6px;
  gap: 6px;
  margin-top: 6px;
}
.slot {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.slot span {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
}
.slot select {
  padding: 5px 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
}
.week-label {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 8px;
}
.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.error {
  color: #c0392b;
  font-size: 13px;
  margin-top: 8px;
}

/* ---- login ---- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 30px;
  width: 100%;
  max-width: 360px;
}
.login-card .brand {
  margin-bottom: 6px;
}
.login-sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 20px;
}

/* ---- todos ---- */
.todo-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 52vh;
  overflow: auto;
}
.todo-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 2px;
}
.todo-row input[type='checkbox'] {
  width: 17px;
  height: 17px;
  flex: none;
}
.prio-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}
.todo-title {
  flex: 1 1;
  min-width: 60px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
}
.todo-title:hover {
  border-color: var(--line);
}
.todo-title:focus {
  border-color: var(--accent);
  background: var(--input-bg);
  outline: none;
}
.todo-title.done {
  text-decoration: line-through;
  color: var(--muted);
}
.todo-count {
  font-size: 11px;
  color: var(--muted);
  flex: none;
}
.todo-due {
  width: 140px;
  flex: none;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
}
.todo-prio {
  width: 84px;
  flex: none;
  padding: 5px 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
}
.todo-act {
  flex: none;
  width: 26px;
  height: 28px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1;
}
.todo-act:hover {
  border-color: var(--accent);
}

/* todo due chip on a calendar cell */
.todo-chip {
  font-size: 10px;
  line-height: 1.3;
  padding: 1px 4px 1px 5px;
  border-radius: 4px;
  border-left: 3px solid #7c3aed;
  background: rgba(255, 255, 255, 0.82);
  color: #23201b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.affect-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.affect-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
}
.affect-item .swatch {
  width: 20px;
  height: 20px;
  flex: none;
}

.party-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 8px;
}
.party-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--input-bg);
}
.party-chip.active {
  border-color: var(--accent);
}

/* ============ Dashboard (fullscreen HUD) ============ */
.dash {
  height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  box-sizing: border-box;
}
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 20px;
}
.dash-clock .clock-time {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.dash-clock .clock-date {
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
}
.dash-custody {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}
.dash-weather {
  display: flex;
  align-items: center;
  gap: 12px;
}
.wx-icon {
  font-size: 40px;
  line-height: 1;
}
.wx-temp {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}
.wx-loc {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.dash-cols {
  flex: 1 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 1fr;
  grid-gap: 12px;
  gap: 12px;
}
.dash-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.dash-panel h2 {
  margin: 0 0 10px;
  font-size: 16px;
}
.dash-panel h3 {
  margin: 12px 0 6px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dash-scroll {
  flex: 1 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mini-cal {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.mini-week,
.mini-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.mini-week div {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  padding: 3px 0;
}
.mini-cell {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  border-top: 1px solid var(--line);
}
.mini-cell.out {
  opacity: 0.35;
}
.mini-cell.today {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 4px;
}
.sched-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.sched-time {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 12px;
  min-width: 84px;
}
.mail-item {
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.mail-item.unread {
  border-left: 3px solid var(--accent);
}
.mail-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.mail-from {
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-subj {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-item.unread .mail-subj {
  font-weight: 700;
}
.mail-snip {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-todo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.dash-todo-title {
  flex: 1 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-due {
  font-size: 11px;
  color: var(--muted);
  flex: none;
}
.dash-due.overdue {
  color: #dc2626;
  font-weight: 700;
}
.dash-due.today {
  color: var(--accent);
  font-weight: 700;
}
.dash-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-gap: 8px;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}
.strip-day {
  border-right: 1px solid var(--line);
  padding-right: 8px;
  min-height: 70px;
}
.strip-day:last-child {
  border-right: none;
}
.strip-day.today .strip-date {
  color: var(--accent);
}
.strip-date {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
}
.strip-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
}

/* ============ Email screen ============ */
.email-wrap {
  height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
}
.email-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.email-accounts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.email-acct-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.email-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.email-banner {
  padding: 8px 16px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.email-body {
  flex: 1 1;
  min-height: 0;
  display: flex;
}
.email-list {
  width: 380px;
  flex: none;
  overflow-y: auto;
  border-right: 1px solid var(--line);
}
.email-item {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.email-item:hover {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.email-item.active {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.email-item-main {
  min-width: 0;
  flex: 1 1;
}
.email-item-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.email-from {
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-date {
  color: var(--muted);
  font-size: 12px;
  flex: none;
}
.email-subject {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-item.unread .email-subject {
  font-weight: 700;
}
.email-snippet {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-reader {
  flex: 1 1;
  min-width: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.email-message {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.email-msg-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.email-msg-head h3 {
  margin: 0 0 4px;
}
.email-msg-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.email-atts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
.email-frame {
  flex: 1 1;
  width: 100%;
  border: none;
  background: #fff;
}
@media (max-width: 900px) {
  .dash-cols {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .email-list {
    width: 100%;
  }
}

/* ---- Dashboard v2 layout: email 2/3 (list+preview), calendar+todos 1/3 ---- */
.dash-main {
  flex: 1 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-gap: 12px;
  gap: 12px;
}
.dash-email {
  min-height: 0;
  display: grid;
  grid-template-columns: 320px 1fr;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.dash-maillist {
  overflow-y: auto;
  border-right: 1px solid var(--line);
  min-height: 0;
}
.dash-mailview {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.dash-right {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dash-cal {
  flex: none;
}
.dash-cal .grid {
  box-shadow: none;
}
.dash-todos {
  flex: 1 1;
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}
.dash-todos h2 {
  margin: 0 0 8px;
  font-size: 15px;
}
.dash-todos .dash-todo input[type='checkbox'] {
  width: 15px;
  height: 15px;
  flex: none;
}
@media (max-width: 1100px) {
  .dash-main {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .dash-email {
    grid-template-columns: 1fr;
    min-height: 420px;
  }
  .dash-maillist {
    max-height: 240px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
}

