:root {
  --bg: #f5f2ea;
  --panel: #fff9ef;
  --ink: #24211c;
  --muted: #4f493f;
  --accent: #126b58;
  --accent-soft: #deefe9;
  --line: #cdbfae;
  --event: #d85f3d;
  --task: #1f5c7a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  line-height: 1.45;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 15%, #fef5d4 0%, #f7efdd 35%, transparent 65%),
    radial-gradient(circle at 80% 20%, #f3e4c8 0%, #efe5d3 30%, transparent 65%),
    linear-gradient(145deg, #f8f4eb, #ebe2d1);
  min-height: 100vh;
}

.layout {
  width: min(1200px, 100% - 2rem);
  margin: 1rem auto;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(12, 1fr);
}

.hidden {
  display: none;
}

.auth-gate {
  width: min(560px, 100% - 2rem);
  margin: 5rem auto;
}

.auth-card {
  text-align: center;
  padding: 2rem;
}

.auth-card h1 {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-card p {
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 10px 28px rgba(34, 28, 22, 0.08);
}

.intro {
  grid-column: span 12;
  text-align: left;
}

.intro h1 {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: clamp(1.8rem, 3.2vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.intro-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: nowrap;
}

.auth-chip-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  flex-wrap: nowrap;
  min-width: 0;
}

.user-badge {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: #264653;
  border: 1px solid #1d3440;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  flex-shrink: 0;
  min-width: fit-content;
}

.intro p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  max-width: 62ch;
  display: none;
}

.controls {
  grid-column: span 4;
}

.controls h2,
.dial-header h2 {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.controls p {
  color: var(--muted);
}

.ms-import {
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px dashed #c8c1b4;
}

.ms-import h2,
.ms-import h3 {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.ms-import p {
  margin: 0.35rem 0 0.55rem;
  font-size: 0.92rem;
}

#loadCalendarBtn {
  margin-top: 0.55rem;
}

textarea {
  width: 100%;
  min-height: 430px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffefb;
  color: var(--ink);
  padding: 0.75rem;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 0.9rem;
  line-height: 1.4;
}

.button-row {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(18, 107, 88, 0.2);
}

button:active {
  transform: translateY(0);
}

#resetBtn {
  background: transparent;
  color: var(--accent);
}

button.secondary {
  background: rgba(18, 107, 88, 0.07);
  color: var(--accent);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(18, 107, 88, 0.45);
  outline-offset: 2px;
}

.status {
  min-height: 1.3rem;
  margin-top: 0.5rem;
}

.dial-wrap {
  grid-column: span 12;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.dial-cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.75rem;
  align-items: start;
  min-width: 0;
}

.dial-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* New event confirmation panel (shown after dropping a task on the dial) */
.new-event-panel {
  background: #fffdf8;
  border: 1.5px solid #d4a01a;
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  box-shadow: 0 4px 20px rgba(180, 130, 0, 0.18);
}

.new-event-panel.hidden {
  display: none;
}

.new-event-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.new-event-panel-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1a1a1a;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.new-event-panel-title-input {
  flex: 1;
  min-width: 0;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1a1a1a;
  background: #fffdf8;
  border: 1px solid #c9b870;
  border-radius: 8px;
  padding: 0.28rem 0.55rem;
  outline-offset: 2px;
}

.new-event-panel-title-input::placeholder {
  color: #a8976a;
  font-weight: 400;
}

/* Cursor hints on the dial SVG */
#chronodex {
  cursor: crosshair;
}

#chronodex .dial-event-node {
  cursor: pointer;
}

.new-event-panel-time {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 0.83rem;
  color: #3d380e;
  background: #fef3c7;
  border: 1px solid #d4a01a;
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.new-event-panel-hint {
  margin: 0;
  font-size: 0.78rem;
  color: #6a6356;
}

.new-event-panel-actions {
  display: flex;
  gap: 0.45rem;
}

/* Past events on the dial (today only, fully ended) */
.event-group.event-past {
  opacity: 0.38;
  filter: saturate(0.25);
}

/* Restore normal appearance when the user hovers over a past event */
.event-group.event-past:hover {
  opacity: 0.72;
  filter: saturate(0.6);
}

/* SVG overlay elements */
.new-event-handle {
  cursor: grab;
}

.new-event-handle:active {
  cursor: grabbing;
}

.agenda-col,
.tasks-col {
  min-width: 0;
  max-height: 82vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: stretch;
  text-align: left;
}

.agenda-col h3,
.tasks-col h3 {
  margin: 0 0 0.35rem;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #2b261f;
  position: sticky;
  top: 0;
  background: var(--panel);
  padding-bottom: 0.2rem;
  z-index: 1;
  text-align: left;
}

.dial-header p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.day-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.day-title-wrap {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
}

.day-nav h2 {
  margin: 0;
}

.day-title-clickable {
  cursor: pointer;
  user-select: none;
  font-weight: 800;
  letter-spacing: -0.02em;
  transition: color 0.15s;
}

.day-title-clickable:hover {
  color: var(--accent);
}

.date-picker-hidden {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  border: none;
  padding: 0;
}

.today-btn {
  white-space: nowrap;
}

.week-dial-toggle-btn {
  white-space: nowrap;
  font-size: 0.78rem;
}

.week-dial-toggle-btn.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.week-strip {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.week-strip-nav {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.week-strip-nav .week-strip {
  flex: 1;
  margin-top: 0;
}

.week-shift-btn {
  border-radius: 10px;
  padding: 0.35rem 0.55rem;
  font-size: 0.76rem;
  white-space: nowrap;
}

.week-day-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.4rem 0.2rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1;
}

.week-day-btn:hover:not(.is-selected) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.week-day-btn .wk-day {
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.week-day-btn .wk-num {
  font-size: 1rem;
  font-weight: 800;
}

.wk-pending-dot {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e07820;
  margin: 1px auto 0;
  flex-shrink: 0;
}

.week-day-btn.is-selected .wk-pending-dot {
  background: rgba(255, 255, 255, 0.85);
}

.week-day-btn.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.week-day-btn.is-today:not(.is-selected) {
  border-color: var(--accent);
  color: var(--accent);
}

.week-day-btn.is-today:not(.is-selected) .wk-num::after {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  margin: 2px auto 0;
}

.week-day-btn.is-drop-target {
  border-color: #1f5c7a;
  box-shadow: 0 0 0 2px rgba(31, 92, 122, 0.2) inset;
}

/* ── Month calendar popover ── */
.dial-header { position: relative; }

.month-cal-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 120;
  background: #fffdf8;
  border: 1.5px solid #c9b870;
  border-radius: 14px;
  padding: 0.65rem 0.75rem;
  box-shadow: 0 6px 28px rgba(120, 100, 0, 0.16);
  min-width: 280px;
}

.month-cal-popover.hidden { display: none; }

.month-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}

.month-cal-title {
  font-weight: 800;
  font-size: 0.9rem;
  color: #2b271f;
}

.month-cal-nav-btn {
  padding: 0.2rem 0.5rem;
  font-size: 0.76rem;
  border-radius: 8px;
}

.month-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.month-cal-dow {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-align: center;
  padding-bottom: 0.25rem;
}

.month-cal-day {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 600;
  color: #2b271f;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  position: relative;
}

.month-cal-day:hover:not(.is-selected) {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.month-cal-day.is-today:not(.is-selected) {
  color: var(--accent);
  border-color: var(--accent);
}

.month-cal-day.is-selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.month-cal-day.has-pending-task::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #e07820;
}

.month-cal-day.is-selected.has-pending-task::after {
  background: rgba(255, 255, 255, 0.85);
}

#chronodex {
  width: 100%;
  aspect-ratio: 1;
  max-height: 80vh;
  background: #e9e9ea;
  border: 1px solid #c8c9cc;
  border-radius: 14px;
}

.legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* .agenda-block kept for legacy; replaced by .agenda-col/.tasks-col */

.task-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  padding: 0.7rem;
  border: 1px solid #ddd3c4;
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.85);
  align-items: stretch;
  text-align: left;
}

.task-add-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

#newTaskTitle,
#newTaskListSelect {
  border: 1px solid #c9c1b2;
  border-radius: 10px;
  background: #fffefb;
  color: #2b271f;
  padding: 0.42rem 0.55rem;
  font-size: 0.86rem;
}

#newTaskNotes {
  width: 100%;
  border: 1px solid #c9c1b2;
  border-radius: 10px;
  background: #fffefb;
  color: #2b271f;
  padding: 0.5rem 0.55rem;
  font-size: 0.86rem;
  line-height: 1.35;
  resize: vertical;
  min-height: 72px;
}

#newTaskTitle {
  flex: 1 1 240px;
}

#newTaskListSelect {
  flex: 0 0 190px;
}

#addTaskBtn {
  padding-inline: 0.75rem;
}

.task-filter-row {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.task-search-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #c9c1b2;
  border-radius: 10px;
  background: #fffefb;
  color: #2b271f;
  padding: 0.38rem 0.55rem;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 0.86rem;
}

.task-search-input::placeholder {
  color: #a09688;
}

.task-sort-select {
  flex: 0 0 auto;
  border: 1px solid #c9c1b2;
  border-radius: 10px;
  background: #fffefb;
  color: #2b271f;
  padding: 0.38rem 0.5rem;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
}

.task-lists-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.task-lists-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6d665a;
  font-weight: 700;
}

.todo-list-selector {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.todo-list-chip {
  border: 1px solid #b9b1a3;
  background: #f8f0df;
  color: #524b3f;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.77rem;
  font-weight: 600;
  line-height: 1.2;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.todo-list-chip:hover:not(.is-selected) {
  background: #efe5d0;
  border-color: #9f9585;
}

.todo-list-chip.is-selected {
  background: #1f5c7a;
  color: #fff;
  border-color: #1f5c7a;
}

.todo-list-empty {
  color: var(--muted);
  font-size: 0.83rem;
}

.legend li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.94rem;
  text-align: left;
}

.task-list .agenda-item,
.task-list .task-section-heading,
.task-list .agenda-empty,
.task-list .agenda-error {
  width: 100%;
}

.task-list .task-section-heading,
.task-list .agenda-empty,
.task-list .agenda-error {
  display: block;
  text-align: left;
}

.task-list .agenda-details,
.task-list .agenda-title,
.task-list .agenda-meta {
  width: 100%;
  text-align: left;
}

.agenda-item {
  border: 1px solid #d8d1c2;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(251, 246, 237, 0.96));
  padding: 0.65rem 0.75rem;
  box-shadow: 0 2px 10px rgba(48, 39, 28, 0.04);
  align-items: flex-start;
  text-align: left;
}

.agenda-clickable {
  cursor: pointer;
}

.agenda-clickable:hover {
  border-color: #b4aa95;
  box-shadow: 0 8px 18px rgba(39, 33, 27, 0.1);
}

.agenda-time {
  min-width: 82px;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 0.83rem;
  color: #524b3e;
}

.agenda-details {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  flex: 1;
}

.agenda-title {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #2a261f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agenda-meta {
  font-size: 0.75rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #6f675a;
}

.agenda-debug {
  font-size: 0.7rem;
  color: #8a3f2f;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
}

.agenda-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  flex: 0 0 auto;
}

.agenda-event {
  border-left: 4px solid var(--agenda-event-color, #d85f3d);
  box-shadow:
    inset 0 0 0 1px rgba(17, 24, 39, 0.24),
    0 2px 10px rgba(48, 39, 28, 0.04);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  row-gap: 0.45rem;
}

.agenda-event.is-active {
  box-shadow:
    inset 0 0 0 1.4px rgba(17, 24, 39, 0.58),
    0 10px 20px rgba(23, 31, 46, 0.2);
}

.agenda-event.is-dimmed {
  opacity: 0.42;
}

.agenda-event .agenda-details {
  grid-column: 1;
}

.agenda-event .agenda-dot {
  grid-column: 2;
  grid-row: 1;
  margin-top: 0.18rem;
}

.agenda-event .agenda-meta {
  white-space: normal;
}

.dial-event-node {
  transition: opacity 150ms ease, filter 150ms ease;
}

.dial-event-node.is-dimmed {
  opacity: 0.2;
}

.dial-event-node.is-active {
  opacity: 1;
  filter: saturate(1.08);
}

.agenda-task {
  border-left: 4px solid #1f5c7a;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: stretch;
}

.agenda-task .agenda-title {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.agenda-task .agenda-dot {
  display: none;
}

.agenda-task .task-row-actions {
  margin-left: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding-top: 0.42rem;
  border-top: 1px solid rgba(205, 191, 174, 0.75);
}

.agenda-task.priority-low {
  border-left-color: #4a9e6e;
}

.agenda-task.priority-medium {
  border-left-color: #1f5c7a;
}

.agenda-task.priority-high {
  border-left-color: #c94040;
}

.agenda-task.dragging {
  opacity: 0.55;
}

.task-section-heading {
  padding: 0.2rem 0 0;
  border: none;
  background: transparent;
  border-radius: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6d665a;
  justify-content: flex-start;
}

.task-row-actions {
  display: flex;
  gap: 0.35rem;
  margin-left: auto;
  align-items: center;
}

.task-priority-btn {
  border: 1px solid #7b7467;
  background: transparent;
  color: #534d41;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}


.task-complete-btn,
.task-delete-btn {
  background: transparent;
  border-radius: 999px;
  padding: 0.25rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms ease;
  box-sizing: border-box;
}

.task-complete-btn {
  border: 1px solid #2f8f6e;
  color: #2f8f6e;
}

.task-complete-btn .material-symbols-outlined {
  font-size: 1rem;
  line-height: 1;
  color: #2f8f6e;
  pointer-events: none;
}

.task-delete-btn .material-symbols-outlined {
  font-size: 1rem;
  line-height: 1;
  color: #c94040;
  pointer-events: none;
}

.task-complete-btn:hover:not(:disabled) {
  background: rgba(47, 143, 110, 0.1);
  transform: scale(1.1);
}

.task-delete-btn {
  color: #c94040;
  border-color: #c94040;
}

.task-delete-btn:hover:not(:disabled) {
  background: rgba(201, 64, 64, 0.1);
  transform: scale(1.1);
}

.agenda-task.task-completed {
  opacity: 0.6;
}

.agenda-task.task-completed .agenda-title {
  text-decoration: line-through;
  color: #8a7a70;
}

.task-completed-label {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a7a70;
  background: rgba(138, 122, 112, 0.15);
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
}

.task-recurring-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #8a7a3e;
  color: #6b5f31;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.agenda-free-slot {
  border-left: 4px solid #2f8f6e;
  color: #245d4b;
  font-weight: 600;
}

.event-row-actions {
  display: flex;
  gap: 0.35rem;
  margin-left: 0;
  padding-top: 0.42rem;
  border-top: 1px solid rgba(205, 191, 174, 0.75);
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
}

.agenda-event .event-row-actions {
  grid-column: 1 / -1;
}

.event-join-link {
  display: inline-flex;
  align-self: flex-start;
  width: fit-content;
  align-items: center;
  border: 1px solid #126b58;
  color: #126b58;
  border-radius: 999px;
  text-decoration: none;
  padding: 0.2rem 0.55rem;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  white-space: nowrap;
}

.event-delete-btn {
  border: 1px solid #c94040;
  background: transparent;
  color: #c94040;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  white-space: nowrap;
}

.event-delete-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.event-popover {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.event-popover-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 14, 10, 0.46);
}

.event-popover-panel {
  position: relative;
  width: min(680px, calc(100% - 1.5rem));
  margin: 5vh auto 0;
  background: #fffdf8;
  border: 1px solid #cfc6b5;
  border-radius: 14px;
  box-shadow: 0 24px 48px rgba(22, 18, 12, 0.22);
  padding: 0.9rem;
  text-align: left;
}

.event-popover-close {
  margin-left: auto;
  display: block;
}

.event-popover-panel h3 {
  margin: 0.2rem 0 0;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
}

.event-popover-time {
  margin: 0.35rem 0 0;
  color: #3f3b32;
  font-weight: 700;
}

.event-popover-meta {
  margin: 0.25rem 0 0;
  color: #6a6356;
  font-size: 0.88rem;
}

.event-popover-body {
  margin: 0.45rem 0 0;
  color: #322d25;
  line-height: 1.4;
  white-space: pre-wrap;
}

.event-popover-actions {
  margin-top: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.event-attendees {
  border: 1px solid #ddd3c4;
  border-radius: 10px;
  background: linear-gradient(180deg, #fffefb, #fbf6ed);
  padding: 0.6rem 0.7rem;
}

.event-attendees-title {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5d564a;
}

.event-attendees-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.event-attendees-group-chat {
  display: inline-flex;
  align-items: center;
  border: 1px solid #126b58;
  color: #126b58;
  border-radius: 999px;
  text-decoration: none;
  padding: 0.2rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
}

.event-attendees-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.event-attendee-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.event-attendee-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  border: 1px solid #b9af9f;
  background: #efe6d8;
  color: #564f43;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background-size: cover;
  background-position: center;
  cursor: pointer;
}

.event-attendee-avatar.has-photo {
  border-color: #9f9585;
  background-color: #ddd7cb;
}

.event-attendee-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.event-attendee-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: #2d2821;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-attendee-email {
  font-size: 0.74rem;
  color: #6a6356;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-attendee-hover-card {
  position: absolute;
  left: 38px;
  top: calc(100% + 4px);
  z-index: 3;
  min-width: 230px;
  max-width: 320px;
  padding: 0.5rem 0.55rem;
  border-radius: 10px;
  border: 1px solid #cbbfae;
  background: #fffdf8;
  box-shadow: 0 10px 24px rgba(23, 18, 12, 0.2);
  display: none;
}

.event-attendee-hover-card.is-visible {
  display: block;
}

.event-attendee-hover-loading {
  margin: 0;
  font-size: 0.8rem;
  color: #6a6356;
}

.event-attendee-hover-header {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  padding-bottom: 0.42rem;
  border-bottom: 1px solid #e3d9ca;
  margin-bottom: 0.42rem;
}

.event-attendee-hover-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid #b9af9f;
  background: #efe6d8;
  color: #564f43;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.86rem;
  font-weight: 800;
  background-size: cover;
  background-position: center;
  flex: 0 0 44px;
}

.event-attendee-hover-avatar.has-photo {
  border-color: #9f9585;
  background-color: #ddd7cb;
}

.event-attendee-hover-headline {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.event-attendee-hover-name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
  color: #231f19;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-attendee-hover-role {
  margin: 0;
  font-size: 0.78rem;
  color: #6a6356;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-attendee-hover-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.24rem;
}

.event-attendee-hover-line {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem;
  font-size: 0.78rem;
  line-height: 1.35;
}

.event-attendee-hover-key {
  font-weight: 700;
  color: #5d564a;
}

.event-attendee-hover-value {
  color: #2c271f;
  min-width: 0;
  overflow-wrap: anywhere;
}

.event-attendee-hover-actions {
  margin-top: 0.42rem;
  padding-top: 0.42rem;
  border-top: 1px solid #e3d9ca;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.event-attendee-hover-action {
  display: inline-flex;
  align-self: flex-start;
  width: fit-content;
  align-items: center;
  border: 1px solid #126b58;
  color: #126b58;
  border-radius: 999px;
  text-decoration: none;
  padding: 0.18rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
}

.event-attendee-hover-action.secondary,
.event-attendees-group-chat.secondary {
  background: rgba(18, 107, 88, 0.08);
}

.task-edit-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #ddd3c4;
  border-radius: 10px;
  background: linear-gradient(180deg, #fffefb, #fbf6ed);
}

.task-notes-editor {
  min-width: 0;
}

.task-notes-label {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5d564a;
}

.task-notes-input {
  width: 100%;
  border: 1px solid #c9c1b2;
  border-radius: 10px;
  background: #fffefb;
  color: #2b271f;
  padding: 0.5rem 0.6rem;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 0.88rem;
  line-height: 1.35;
  resize: vertical;
  min-height: 110px;
}

.task-notes-save-btn {
  align-self: flex-start;
}

.task-title-input {
  width: 100%;
  border: 1px solid #c9c1b2;
  border-radius: 10px;
  background: #fffefb;
  color: #2b271f;
  padding: 0.45rem 0.6rem;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
}

.task-title-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.task-autosave-status {
  margin: 0;
  font-size: 0.76rem;
  color: #6a6356;
  letter-spacing: 0.01em;
}

.task-autosave-status.is-disabled {
  color: #857e70;
}

.task-schedule-editor {
  min-width: 0;
}

.task-schedule-fields {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.task-schedule-input {
  border: 1px solid #c9c1b2;
  border-radius: 10px;
  background: #fffefb;
  color: #2b271f;
  padding: 0.45rem 0.55rem;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 0.86rem;
}

.task-subtasks-editor {
  min-width: 0;
}

.task-subtasks-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.task-subtasks-add-row {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.task-subtask-new-input {
  flex: 1;
  border: 1px solid #c9c1b2;
  border-radius: 10px;
  background: #fffefb;
  color: #2b271f;
  padding: 0.45rem 0.55rem;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 0.86rem;
}

.task-subtask-add-btn {
  white-space: nowrap;
}

.task-subtasks-empty {
  margin: 0;
  color: #6a6356;
  font-size: 0.86rem;
}

.task-subtask-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: #2b271f;
  padding: 0.2rem 0;
}

.task-subtask-check-label {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  flex: 1;
  cursor: pointer;
}

.task-subtask-check {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.task-subtask-title {
  line-height: 1.3;
}

.task-subtask-row.is-checked .task-subtask-title {
  text-decoration: line-through;
  color: #767062;
}

.task-subtask-edit-btn,
.task-subtask-save-btn,
.task-subtask-cancel-btn {
  flex-shrink: 0;
  padding: 0.15rem 0.25rem;
  font-size: 0.78rem;
  line-height: 1;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: #6a6356;
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}

.task-subtask-edit-btn .material-symbols-outlined,
.task-subtask-save-btn .material-symbols-outlined,
.task-subtask-cancel-btn .material-symbols-outlined {
  font-size: 0.95rem;
}

.task-subtask-row:hover .task-subtask-edit-btn,
.task-subtask-row.is-editing .task-subtask-save-btn,
.task-subtask-row.is-editing .task-subtask-cancel-btn {
  opacity: 1;
}

.task-subtask-edit-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.task-subtask-save-btn {
  color: #1f7a5c;
}

.task-subtask-save-btn:hover {
  border-color: #1f7a5c;
  background: rgba(31, 122, 92, 0.09);
}

.task-subtask-cancel-btn:hover {
  color: #9d2a20;
  border-color: #9d2a20;
  background: rgba(157, 42, 32, 0.08);
}

.task-subtask-title-input {
  flex: 1;
  border: 1px solid #c9c1b2;
  border-radius: 8px;
  background: #fffefb;
  color: #2b271f;
  padding: 0.25rem 0.45rem;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 0.88rem;
  line-height: 1.3;
  min-width: 0;
}

.agenda-empty {
  color: var(--muted);
  font-style: italic;
  padding: 0.35rem 0;
}

.agenda-empty-secondary {
  padding-top: 0;
}

.agenda-error {
  color: #9d2a20;
  background: #fff0ee;
  border: 1px solid #e6b7b2;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
}

.task-complete-btn:disabled,
.task-delete-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Icon-only button (gear, close) ── */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.3rem;
  cursor: pointer;
  color: #4a4540;
  line-height: 1;
  transition: background 150ms ease;
  transform: none;
  box-shadow: none;
}

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.07);
  transform: none;
  box-shadow: none;
}

.icon-btn .material-symbols-outlined {
  font-size: 1.25rem;
  line-height: 1;
}

/* ── Settings overlay & panel ── */
.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(30, 25, 18, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.settings-overlay.hidden {
  display: none;
}

.settings-panel {
  background: #fffefb;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
  padding: 1.5rem;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.settings-panel-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #2b271f;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.settings-fieldset {
  border: 1px solid #d0c8b8;
  border-radius: 10px;
  padding: 0.7rem 0.9rem 0.8rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.settings-fieldset legend {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #6a6356;
  padding: 0 0.25rem;
}

.settings-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #4a4540;
}

.settings-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #c9c1b2;
  border-radius: 8px;
  background: #fffefb;
  color: #2b271f;
  padding: 0.38rem 0.55rem;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 0.9rem;
}

.settings-time-row {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 0.4rem;
  align-items: center;
}

.settings-time-row .settings-label {
  white-space: nowrap;
}

.settings-hint {
  font-size: 0.74rem;
  color: #7a7060;
  margin: 0;
}

.settings-status {
  font-size: 0.8rem;
  color: #126b58;
  min-height: 1.2em;
  margin: 0;
}

.settings-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ── Day summary bar ── */
.day-summary-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.4rem 0.5rem;
  border: 1px solid #d0c8b8;
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.9);
  margin-top: 0.35rem;
}

.day-summary-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
  flex: 1 1 0;
  min-width: 4.5rem;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  background: rgba(111, 136, 184, 0.08);
  text-align: center;
}

.day-summary-chip .material-symbols-outlined {
  font-size: 1rem;
  color: #6f88b8;
  line-height: 1;
}

.day-summary-chip-value {
  font-size: 0.82rem;
  font-weight: 800;
  color: #2b271f;
  line-height: 1.15;
  white-space: nowrap;
}

.day-summary-chip-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #7a7060;
  line-height: 1;
}

/* ── All-day event banner ── */
.all-day-banner {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.3rem 0.5rem;
  border: 1px solid #d0c8b8;
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.9);
  margin-bottom: 0.3rem;
}

.all-day-banner-label {
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #7a7060;
  white-space: nowrap;
  flex-shrink: 0;
}

.all-day-chip {
  background: var(--chip-color, #6f88b8);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.18rem 0.65rem;
  font-size: 0.77rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 150ms ease;
  transform: none;
  box-shadow: none;
}

.all-day-chip:hover {
  opacity: 0.82;
  transform: none;
  box-shadow: none;
}

/* ── Conflict badge on agenda event rows ── */
.event-conflict-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.3rem;
  vertical-align: middle;
  color: #c94040;
}

.event-conflict-badge .material-symbols-outlined {
  font-size: 0.95rem;
  line-height: 1;
}

/* ── All-day flag on agenda list item ── */
.agenda-event-allday {
  opacity: 0.92;
}

/* ── Event RSVP section ── */
.event-rsvp-section {
  margin-top: 0.5rem;
}

.event-rsvp-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

.event-rsvp-btn {
  border: 1px solid #8a8278;
  color: #524b42;
  background: transparent;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.event-rsvp-btn.is-active-rsvp {
  background: var(--accent, #6f88b8);
  color: #fff;
  border-color: var(--accent, #6f88b8);
}

.event-rsvp-btn:hover:not(:disabled):not(.is-active-rsvp) {
  background: var(--accent-soft, #eef1f8);
  border-color: var(--accent, #6f88b8);
  color: var(--accent, #6f88b8);
}

.event-rsvp-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Event edit section (inside <details>) ── */
.event-edit-section {
  margin-top: 0.5rem;
}

.event-edit-summary {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5d564a;
  cursor: pointer;
  user-select: none;
}

.event-edit-form {
  margin-top: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.event-edit-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6a6356;
  display: block;
  margin-bottom: 0.1rem;
}

.event-edit-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #c9c1b2;
  border-radius: 8px;
  background: #fffefb;
  color: #2b271f;
  padding: 0.38rem 0.55rem;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 0.86rem;
}

.event-edit-time-row {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 0.35rem;
  align-items: center;
}

/* ── Responsive: medium screens (≤900px) — dial full-width, columns below ── */
@media (max-width: 900px) {
  .intro-head {
    flex-direction: row;
    align-items: center;
  }

  .dial-cols {
    grid-template-columns: 1fr 1fr;
  }

  .dial-col {
    grid-column: span 2;
  }

  .agenda-col,
  .tasks-col {
    max-height: 60vh;
  }

  .agenda-item {
    padding: 0.6rem 0.65rem;
  }

  .event-join-link,
  .event-delete-btn {
    padding: 0.18rem 0.5rem;
    font-size: 0.72rem;
  }

  .week-strip {
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  .week-day-btn {
    min-width: 52px;
  }

  textarea {
    min-height: 260px;
  }

  .week-strip-nav {
    flex-wrap: wrap;
  }

  .week-strip-nav .week-strip {
    order: 3;
    flex: 0 0 100%;
  }
}

/* ── Responsive: mobile (≤600px) — single column stack ── */
@media (max-width: 600px) {
  body {
    line-height: 1.38;
  }

  button {
    padding: 0.48rem 0.82rem;
    font-size: 0.92rem;
  }

  .layout {
    width: calc(100% - 1rem);
    margin: 0.5rem auto;
  }

  .intro {
    padding: 0.5rem;
  }

  .intro h1 {
    font-size: clamp(1.3rem, 2.5vw, 1.7rem);
    margin-bottom: 0.2rem;
  }

  .intro p {
    display: none;
  }

  .intro-head {
    gap: 0.2rem;
    margin-bottom: -0.05rem;
  }

  .auth-chip-row {
    width: 100%;
    justify-content: flex-end;
    gap: 0.25rem;
  }

  .user-badge {
    font-size: 0.72rem;
    padding: 0.25rem 0.5rem;
  }

  .auth-chip-row button {
    padding: 0.38rem 0.6rem;
    font-size: 0.8rem;
  }

  .intro p,
  .auth-card p,
  .agenda-meta,
  .event-popover-meta {
    font-size: 0.82rem;
  }

  .dial-cols {
    grid-template-columns: 1fr;
  }

  .dial-col {
    grid-column: auto;
  }

  .agenda-col,
  .tasks-col {
    max-height: none;
    overflow-y: visible;
  }

  #chronodex {
    max-height: none;
  }

  .day-nav {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .auth-chip-row,
  .task-row-actions,
  .event-row-actions {
    width: 100%;
  }

  .task-row-actions,
  .event-row-actions {
    justify-content: flex-start;
    gap: 0.2rem;
    flex-wrap: wrap;
  }

  .event-join-link,
  .event-delete-btn {
    padding: 0.08rem 0.32rem;
    font-size: 0.6rem;
    border-radius: 3px;
    border-width: 0.75px;
    min-width: fit-content;
    line-height: 1.2;
  }

  .task-priority-btn {
    padding: 0.1rem 0.3rem;
    font-size: 0.6rem;
    border-width: 0.75px;
  }

  .task-complete-btn,
  .task-delete-btn {
    padding: 0.1rem 0.3rem;
    font-size: 0.6rem;
    border-width: 0.75px;
  }

  .task-complete-btn .material-symbols-outlined,
  .task-delete-btn .material-symbols-outlined {
    font-size: 0.85rem;
  }

  .task-completed-label {
    font-size: 0.6rem;
    padding: 0.1rem 0.25rem;
  }

  .agenda-item {
    padding: 0.5rem 0.55rem;
  }

  .agenda-event {
    display: flex;
    flex-direction: column;
    grid-template-columns: auto;
    row-gap: 0.2rem;
  }

  .agenda-event .agenda-details {
    grid-column: auto;
    min-width: 0;
  }

  .agenda-event .agenda-dot {
    grid-column: auto;
    grid-row: auto;
    align-self: flex-start;
    margin-top: 0;
    margin-left: auto;
    order: -1;
  }

  .agenda-event .event-row-actions {
    grid-column: auto;
  }

  .day-title-wrap {
    order: -1;
    width: 100%;
    justify-content: flex-start;
  }

  .week-strip {
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  .week-day-btn {
    min-width: 44px;
  }

  #newTaskListSelect {
    flex-basis: 100%;
  }

  .task-add-row {
    flex-direction: column;
  }

  #newTaskTitle,
  #newTaskNotes,
  #newTaskListSelect,
  #addTaskBtn {
    flex-basis: auto;
    width: 100%;
  }

  .panel {
    border-radius: 10px;
    padding: 0.75rem;
  }

  .task-controls,
  .agenda-item {
    border-radius: 10px;
  }

  .event-popover-panel {
    margin-top: 2vh;
  }
}

/* ── Print styles ── */
@media print {
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    background: white !important;
    margin: 0;
  }

  /* Hide everything that isn't the dial panel */
  .intro,
  #authGate,
  .auth-chip-row,
  .week-strip-nav,
  #monthCalPopover,
  .day-nav button,
  #newEventPanel,
  .event-popover-panel,
  .tasks-col {
    display: none !important;
  }

  /* Let dial-wrap fill the page */
  .panel {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }

  .dial-cols {
    display: block !important;
  }

  .dial-col {
    width: 100% !important;
  }

  /* Include agenda beneath the dial in print output */
  .agenda-col {
    display: block !important;
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    margin-top: 0.75rem;
    break-inside: avoid;
  }

  .agenda-col h3 {
    position: static;
    background: transparent;
    padding-bottom: 0;
    margin: 0.6rem 0 0.35rem;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
  }

  #legend {
    margin: 0;
    padding: 0;
  }

  .agenda-item {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none;
  }

  .agenda-clickable {
    cursor: default;
  }

  .event-row-actions,
  .task-row-actions,
  .agenda-task .task-checkbox,
  .agenda-task .task-priority-btn,
  .agenda-task .task-date-badge,
  .event-delete-btn,
  .event-join-link {
    display: none !important;
  }

  /* Day title stays as the print heading */
  #dayTitle {
    display: block !important;
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 0.5rem;
  }

  /* Dial fills the printable width */
  #chronodex {
    max-height: none !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Keep summary bar if visible */
  .day-summary-bar {
    display: flex !important;
  }
}
