:root {
  --bg: #08111f;
  --bg-accent: #0f172a;
  --panel: rgba(10, 18, 33, 0.95);
  --panel-strong: #13203a;
  --line: rgba(148, 163, 184, 0.24);
  --line-strong: rgba(34, 211, 238, 0.38);
  --text: #f8fafc;
  --muted: #b8c4d9;
  --accent: #22d3ee;
  --accent-dark: #67e8f9;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #fb7185;
  --shadow: 0 18px 40px rgba(2, 8, 23, 0.42);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Aptos", "Segoe UI Variable", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.18), transparent 26%),
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.14), transparent 22%),
    radial-gradient(circle at bottom right, rgba(244, 114, 182, 0.14), transparent 28%),
    linear-gradient(180deg, var(--bg), #0d1528);
  min-height: 100vh;
}

.page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px;
}

.deployment-timestamp {
  margin: 2px 0 10px;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.auth-gate {
  max-width: 620px;
  margin: 40px auto 0;
  padding: 24px;
  text-align: center;
}

.auth-gate h1 {
  margin-bottom: 10px;
}

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

.auth-gate-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

.auth-locked-email {
  width: min(320px, 100%);
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #091221;
  color: var(--text);
  padding: 0.7rem 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.auth-gate-note {
  min-height: 1.4rem;
  margin-top: 12px;
  color: var(--accent-dark);
  font-size: 0.82rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

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

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

button {
  border: 0;
  border-radius: 999px;
  padding: 0.58rem 0.9rem;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

button:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: var(--accent);
  color: #04111d;
  font-weight: 800;
}

.ghost-button {
  background: rgba(103, 232, 249, 0.08);
  color: var(--text);
  border: 1px solid var(--line-strong);
}

.small-button {
  padding: 0.36rem 0.7rem;
  font-size: 0.82rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: "summary";
  gap: 10px;
}

.summary-panel { grid-area: summary; }

.panel {
  padding: 10px;
}

.done-history-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  padding: 7px 10px;
  list-style: none;
  font-weight: 800;
  color: var(--accent-dark);
}

.done-history-summary::-webkit-details-marker {
  display: none;
}

.done-history-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  background: rgba(34, 211, 238, 0.14);
  color: var(--accent-dark);
  font-size: 0.74rem;
}

.done-history-body {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

.done-history-inline {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(103, 232, 249, 0.08);
}

.done-history-inline .done-history-summary {
  padding: 0.36rem 0.72rem;
  font-size: 0.82rem;
  white-space: nowrap;
}

.done-history-inline .done-history-body {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 280px;
  max-width: min(420px, 80vw);
  max-height: 320px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 17, 31, 0.98);
  box-shadow: var(--shadow);
  z-index: 20;
}

.done-history-inline:not([open]) .done-history-body {
  display: none;
}

.done-history-day {
  display: grid;
  gap: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.done-history-day:first-child {
  border-top: 0;
  padding-top: 0;
}

.done-history-date {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.done-history-items {
  display: grid;
  gap: 3px;
}

.done-history-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
}

.done-history-item-number {
  color: var(--accent-dark);
  font-weight: 800;
}

.done-history-item-title {
  color: var(--text);
}

.done-history-empty {
  color: var(--muted);
  font-size: 0.8rem;
}

.task-search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px 10px;
  align-items: end;
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(103, 232, 249, 0.08);
}

.task-search-bar label {
  grid-column: 1 / -1;
  color: var(--accent-dark);
  font-weight: 800;
}

.task-search-bar input {
  grid-column: 1 / 2;
}

.task-search-count {
  grid-column: 3 / 4;
  margin: 0 0 0.42rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.starred-filter-toggle {
  grid-column: 2 / 3;
  align-self: center;
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: rgba(248, 250, 252, 0.04);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  padding: 0.42rem 0.72rem;
  white-space: nowrap;
}

.starred-filter-toggle.active {
  border-color: rgba(251, 191, 36, 0.72);
  background: rgba(251, 191, 36, 0.18);
  color: #fcd34d;
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.18);
}

.empty-task-results {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
  background: rgba(15, 23, 42, 0.62);
}

.focus-list,
.subtask-list {
  display: grid;
  gap: 6px;
}

.focus-card,
.subtask-item {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.focus-card {
  padding: 0;
}

.focus-card[data-category-color="admin"] {
  border-left: 4px solid #67e8f9;
}

.focus-card[data-category-color="dadbods"] {
  border-left: 4px solid #f472b6;
}

.focus-card[data-category-color="dadbods-treasury"] {
  border-left: 4px solid #60a5fa;
}

.focus-card[data-category-color="swig"] {
  border-left: 4px solid #fbbf24;
}

.focus-card[data-category-color="finance"] {
  border-left: 4px solid #4ade80;
}

.focus-card[data-category-color="operations"] {
  border-left: 4px solid #fb7185;
}

.focus-card[data-category-color="systems"] {
  border-left: 4px solid #a78bfa;
}

.focus-card[data-category-color="personal"] {
  border-left: 4px solid #38bdf8;
}

.focus-card[data-category-color="tech"] {
  border-left: 4px solid #22c55e;
}

.focus-card[data-category-color="home"] {
  border-left: 4px solid #fb923c;
}

.focus-card[data-category-color="home-improvement"] {
  border-left: 4px solid #84cc16;
}

.focus-card[data-category-color="routine"] {
  border-left: 4px solid #94a3b8;
}

.focus-card[data-category-color="kids"] {
  border-left: 4px solid #14b8a6;
}

.focus-card[data-category-color="experiments"] {
  border-left: 4px solid #c084fc;
}

.focus-card[data-category-color="friends-family"] {
  border-left: 4px solid #e879f9;
}

.focus-card[data-category-color="comms"] {
  border-left: 4px solid #2dd4bf;
}

.focus-card[data-category-color="low-pressure"] {
  border-left: 4px solid #fde68a;
}

.focus-card[data-category-color="inbox"] {
  border-left: 4px solid #e5e7eb;
}

.focus-card h3 {
  font-size: 0.96rem;
  margin-bottom: 0;
}

.task-title-input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #091221;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.38rem 0.5rem;
}

.ai-edited {
  font-style: italic;
}

.meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.pill,
.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.pill {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text);
}

.score-pill {
  background: rgba(34, 211, 238, 0.15);
  color: var(--accent-dark);
}

.filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

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

label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.76rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #091221;
  padding: 0.42rem 0.56rem;
  color: var(--text);
}

input::placeholder,
textarea::placeholder {
  color: #8da2c3;
}

.date-input,
.quick-add-date {
  color-scheme: dark;
}

.quick-add-category {
  min-width: 128px;
}

.date-input::-webkit-calendar-picker-indicator,
.quick-add-date::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(1) brightness(1.4);
  opacity: 0.95;
}

textarea {
  resize: vertical;
  min-height: 56px;
}

.task-card-header,
.detail-header,
.subtasks-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.focus-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.detail-category {
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  font-weight: 800;
  margin-bottom: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.full-width {
  margin-bottom: 14px;
}

.subtasks-section {
  margin-top: 6px;
}

.focus-editor {
  display: grid;
  gap: 6px;
}

.focus-intro {
  margin-bottom: 0;
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

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

.subtask-item {
  padding: 5px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.subtask-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
}

.subtask-item input[type="text"] {
  border: 0;
  padding: 0;
  background: transparent;
  min-width: 0;
  font-size: 0.82rem;
}

.subtask-item button {
  margin-left: auto;
  background: transparent;
  color: var(--danger);
  padding: 0.08rem 0.3rem;
}

.task-summary {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1.7fr) auto auto;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  cursor: pointer;
  list-style: none;
}

.task-summary::-webkit-details-marker {
  display: none;
}

.task-summary-main {
  min-width: 0;
}

.task-summary-number,
.task-summary-category {
  display: flex;
  align-items: center;
}

.task-summary-number {
  gap: 6px;
}

.task-done-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.task-done-toggle input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  cursor: pointer;
}

.task-summary-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
  min-width: 0;
}

.task-star-toggle,
.needs-breakdown-marker {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  padding: 0;
}

.task-star-toggle {
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: transparent;
  color: rgba(184, 196, 217, 0.62);
  text-shadow: none;
}

.task-star-toggle.active {
  border-color: rgba(251, 191, 36, 0.72);
  background: rgba(251, 191, 36, 0.16);
  color: #facc15;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.45);
}

.needs-breakdown-marker {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  border: 1px solid rgba(125, 211, 252, 0.45);
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
}

.task-title-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-number-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(248, 250, 252, 0.06);
  color: var(--muted-strong);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.task-summary-sub {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-meta {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.summary-category-select {
  min-width: 98px;
  width: auto;
  padding: 0.14rem 1.35rem 0.14rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #13203a;
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 700;
}

.summary-category-select option {
  background: #13203a;
  color: #f8fafc;
}

.summary-category-select[data-category-color="admin"] {
  background: rgba(103, 232, 249, 0.14);
  border-color: rgba(103, 232, 249, 0.5);
}

.summary-category-select[data-category-color="dadbods"] {
  background: rgba(244, 114, 182, 0.16);
  border-color: rgba(244, 114, 182, 0.48);
}

.summary-category-select[data-category-color="dadbods-treasury"] {
  background: rgba(96, 165, 250, 0.16);
  border-color: rgba(96, 165, 250, 0.48);
}

.summary-category-select[data-category-color="swig"] {
  background: rgba(251, 191, 36, 0.16);
  border-color: rgba(251, 191, 36, 0.5);
}

.summary-category-select[data-category-color="finance"] {
  background: rgba(74, 222, 128, 0.16);
  border-color: rgba(74, 222, 128, 0.46);
}

.summary-category-select[data-category-color="operations"] {
  background: rgba(251, 113, 133, 0.16);
  border-color: rgba(251, 113, 133, 0.46);
}

.summary-category-select[data-category-color="systems"] {
  background: rgba(167, 139, 250, 0.16);
  border-color: rgba(167, 139, 250, 0.46);
}

.summary-category-select[data-category-color="personal"] {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.46);
}

.summary-category-select[data-category-color="tech"] {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.46);
}

.summary-category-select[data-category-color="home"] {
  background: rgba(251, 146, 60, 0.18);
  border-color: rgba(251, 146, 60, 0.46);
}

.summary-category-select[data-category-color="home-improvement"] {
  background: rgba(132, 204, 22, 0.18);
  border-color: rgba(132, 204, 22, 0.46);
}

.summary-category-select[data-category-color="routine"] {
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.42);
}

.summary-category-select[data-category-color="kids"] {
  background: rgba(20, 184, 166, 0.18);
  border-color: rgba(20, 184, 166, 0.46);
}

.summary-category-select[data-category-color="experiments"] {
  background: rgba(192, 132, 252, 0.16);
  border-color: rgba(192, 132, 252, 0.46);
}

.summary-category-select[data-category-color="friends-family"] {
  background: rgba(232, 121, 249, 0.18);
  border-color: rgba(232, 121, 249, 0.46);
}

.summary-category-select[data-category-color="comms"] {
  background: rgba(45, 212, 191, 0.16);
  border-color: rgba(45, 212, 191, 0.46);
}

.summary-category-select[data-category-color="low-pressure"] {
  background: rgba(253, 230, 138, 0.18);
  border-color: rgba(253, 230, 138, 0.42);
  color: #f8fafc;
}

.summary-category-select[data-category-color="inbox"] {
  background: rgba(229, 231, 235, 0.14);
  border-color: rgba(229, 231, 235, 0.38);
}

.task-expand {
  font-size: 0.68rem;
  color: var(--accent-dark);
  font-weight: 700;
}

.task-details {
  border-top: 1px solid var(--line);
  padding: 7px 8px 8px;
}

.controls-panel {
  margin-bottom: 8px;
  background: rgba(7, 14, 27, 0.72);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
}

.controls-summary {
  list-style: none;
  cursor: pointer;
  padding: 7px 10px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.controls-summary-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.inline-view-tabs {
  gap: 6px;
  margin: 0;
}

.controls-summary::-webkit-details-marker {
  display: none;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.18);
  color: var(--text);
}

.sync-status[data-mode="synced"] {
  background: rgba(74, 222, 128, 0.18);
  color: #bbf7d0;
}

.sync-status[data-mode="saving"] {
  background: rgba(251, 191, 36, 0.18);
  color: #fde68a;
}

.sync-status[data-mode="local"] {
  background: rgba(251, 113, 133, 0.18);
  color: #fecdd3;
}

.controls-body {
  border-top: 1px solid var(--line);
  padding: 8px;
}

.controls-toolbar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.quick-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 64px 64px 64px minmax(128px, 0.55fr) 145px auto;
  gap: 6px;
  margin-bottom: 8px;
}

.quick-add-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0.48rem 0;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(148, 163, 184, 0.08);
  color: rgba(184, 196, 217, 0.72);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.quick-add-star.active {
  border-color: rgba(251, 191, 36, 0.72);
  background: rgba(251, 191, 36, 0.16);
  color: #facc15;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.45);
}

.quick-add-row select {
  min-width: 0;
  padding: 0.48rem 0.45rem;
  font-weight: 800;
}

.controls-summary-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.subtasks-header {
  align-items: center;
  margin-bottom: 4px;
}

.subtasks-header h4 {
  margin-bottom: 0;
  font-size: 0.84rem;
}

.drag-handle {
  color: var(--muted);
  font-size: 0.85rem;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.subtask-item.dragging {
  opacity: 0.45;
}

.subtask-item.drop-target {
  outline: 1px dashed var(--accent);
}

.status-todo { color: var(--accent-dark); }
.status-in-progress { color: var(--warning); }
.status-waiting { color: #6d56b8; }
.status-done { color: var(--success); }

.view-tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0 10px;
  flex-wrap: wrap;
}

.controls-summary .view-tabs {
  margin: 0;
}

.view-tab {
  background: rgba(15, 23, 42, 0.8);
  color: var(--muted);
  border: 1px solid var(--line);
  font-weight: 800;
}

.view-tab.active {
  background: rgba(34, 211, 238, 0.14);
  border-color: rgba(34, 211, 238, 0.4);
  color: var(--accent-dark);
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

.chatgpt-export-panel {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(10, 18, 33, 0.74);
  padding: 10px;
}

.chatgpt-export-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.chatgpt-export-actions {
  display: flex;
  gap: 8px;
}

.chatgpt-export-panel h3 {
  margin: 0;
  font-size: 0.92rem;
  color: var(--accent-dark);
}

#chatgpt-task-export-json {
  min-height: 220px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

#chatgpt-suggestions-import-json {
  min-height: 160px;
  width: 100%;
  margin-top: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.chatgpt-suggestions-controls {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.chatgpt-suggestions-status {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.suggestion-task-group {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
}

.suggestion-task-group h4 {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 0.85rem;
}

.suggestion-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  margin-top: 8px;
  background: rgba(19, 32, 58, 0.6);
}

.suggestion-meta {
  font-size: 0.76rem;
  color: var(--muted);
}

.suggestion-preview {
  white-space: pre-wrap;
  margin: 6px 0;
  font-size: 0.8rem;
}

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

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

.schedule-sidebar {
  display: grid;
  gap: 8px;
  align-content: start;
}

.schedule-sidebar-card,
.schedule-stage {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(10, 18, 33, 0.74);
}

.schedule-sidebar-card {
  padding: 10px;
}

.schedule-sidebar-heading {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.schedule-zoom-caption {
  color: var(--muted);
  font-size: 0.72rem;
}

.schedule-template-list,
.schedule-task-pool {
  display: grid;
  gap: 6px;
}

.schedule-template-button,
.schedule-task-chip {
  width: 100%;
  display: grid;
  gap: 3px;
  justify-items: start;
  text-align: left;
  border-radius: 12px;
  padding: 0.52rem 0.68rem;
  background: rgba(19, 32, 58, 0.9);
  color: var(--text);
  border: 1px solid rgba(34, 211, 238, 0.22);
}

.schedule-template-button span:last-child,
.schedule-task-chip-number {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.schedule-task-chip {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 6px;
}

.schedule-task-chip-title {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.8rem;
  font-weight: 700;
}

.schedule-task-chip[data-category-color="admin"] { border-left: 4px solid #67e8f9; }
.schedule-task-chip[data-category-color="dadbods"] { border-left: 4px solid #f472b6; }
.schedule-task-chip[data-category-color="dadbods-treasury"] { border-left: 4px solid #60a5fa; }
.schedule-task-chip[data-category-color="swig"] { border-left: 4px solid #fbbf24; }
.schedule-task-chip[data-category-color="finance"] { border-left: 4px solid #4ade80; }
.schedule-task-chip[data-category-color="operations"] { border-left: 4px solid #fb7185; }
.schedule-task-chip[data-category-color="systems"] { border-left: 4px solid #a78bfa; }
.schedule-task-chip[data-category-color="personal"] { border-left: 4px solid #38bdf8; }
.schedule-task-chip[data-category-color="tech"] { border-left: 4px solid #22c55e; }
.schedule-task-chip[data-category-color="home"] { border-left: 4px solid #fb923c; }
.schedule-task-chip[data-category-color="home-improvement"] { border-left: 4px solid #84cc16; }
.schedule-task-chip[data-category-color="routine"] { border-left: 4px solid #94a3b8; }
.schedule-task-chip[data-category-color="kids"] { border-left: 4px solid #14b8a6; }
.schedule-task-chip[data-category-color="friends-family"] { border-left: 4px solid #e879f9; }
.schedule-task-chip[data-category-color="comms"] { border-left: 4px solid #2dd4bf; }
.schedule-task-chip[data-category-color="low-pressure"] { border-left: 4px solid #fde68a; }
.schedule-task-chip[data-category-color="inbox"] { border-left: 4px solid #e5e7eb; }

.schedule-stage {
  padding: 10px;
  min-width: 0;
}

.schedule-stage-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.schedule-stage-header h3 {
  margin-bottom: 2px;
  font-size: 1rem;
}

.schedule-stage-header p,
.schedule-stage-summary {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.schedule-scroll {
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(8, 17, 31, 0.94), rgba(9, 18, 33, 0.98));
  max-height: 74vh;
  overflow: auto;
}

.schedule-timeline {
  position: relative;
  min-height: 720px;
}

.schedule-hour-row {
  position: absolute;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
}

.schedule-hour-label {
  padding: 4px 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.schedule-hour-track {
  position: relative;
  border-left: 1px solid rgba(148, 163, 184, 0.16);
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  background:
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent calc(var(--step-height) - 1px),
      rgba(148, 163, 184, 0.08) calc(var(--step-height) - 1px),
      rgba(148, 163, 184, 0.08) var(--step-height)
    );
}

.schedule-items-layer {
  position: absolute;
  inset: 0;
}

.schedule-item {
  position: absolute;
  left: 72px;
  right: 10px;
  border-radius: 14px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  background: rgba(19, 32, 58, 0.96);
  box-shadow: 0 10px 26px rgba(2, 8, 23, 0.28);
  padding: 6px 10px 12px;
  display: grid;
  gap: 4px;
  touch-action: none;
  user-select: none;
}

.schedule-item.compact {
  gap: 2px;
  padding-bottom: 10px;
}

.schedule-item[data-category-color="admin"] { border-left: 4px solid #67e8f9; }
.schedule-item[data-category-color="dadbods"] { border-left: 4px solid #f472b6; }
.schedule-item[data-category-color="dadbods-treasury"] { border-left: 4px solid #60a5fa; }
.schedule-item[data-category-color="swig"] { border-left: 4px solid #fbbf24; }
.schedule-item[data-category-color="finance"] { border-left: 4px solid #4ade80; }
.schedule-item[data-category-color="operations"] { border-left: 4px solid #fb7185; }
.schedule-item[data-category-color="systems"] { border-left: 4px solid #a78bfa; }
.schedule-item[data-category-color="personal"] { border-left: 4px solid #38bdf8; }
.schedule-item[data-category-color="tech"] { border-left: 4px solid #22c55e; }
.schedule-item[data-category-color="home"] { border-left: 4px solid #fb923c; }
.schedule-item[data-category-color="home-improvement"] { border-left: 4px solid #84cc16; }
.schedule-item[data-category-color="routine"] { border-left: 4px solid #94a3b8; }
.schedule-item[data-category-color="kids"] { border-left: 4px solid #14b8a6; }
.schedule-item[data-category-color="friends-family"] { border-left: 4px solid #e879f9; }
.schedule-item[data-category-color="comms"] { border-left: 4px solid #2dd4bf; }
.schedule-item[data-category-color="low-pressure"] { border-left: 4px solid #fde68a; }
.schedule-item[data-category-color="inbox"] { border-left: 4px solid #e5e7eb; }

.schedule-item-bar,
.schedule-item-footer,
.schedule-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.schedule-item-time,
.schedule-item-link,
.schedule-item-footer {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.schedule-item-title {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  font-size: 0.84rem;
  font-weight: 800;
  min-width: 0;
}

.schedule-item-title:focus {
  outline: none;
}

.schedule-item-delete {
  background: transparent;
  color: var(--danger);
  padding: 0;
  min-width: 1rem;
}

.schedule-resize-handle {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 2px;
  height: 8px;
  padding: 0;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.24);
  cursor: ns-resize;
}

.schedule-draft-popup {
  position: absolute;
  z-index: 4;
  width: 252px;
  border-radius: 16px;
  border: 1px solid rgba(34, 211, 238, 0.4);
  background: rgba(8, 17, 31, 0.98);
  box-shadow: 0 18px 38px rgba(2, 8, 23, 0.38);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.schedule-draft-heading {
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 800;
}

.schedule-draft-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
}

.schedule-draft-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 760px) {
  .page-shell {
    padding: 16px;
  }

  .hero {
    padding: 20px;
    flex-direction: column;
  }

  .dashboard-grid,
  .stats-grid,
  .task-search-bar,
  .filters,
  .detail-grid,
  .card-grid,
  .filters-inline,
  .quick-add-row {
    grid-template-columns: 1fr;
  }

  .schedule-shell,
  .schedule-draft-row {
    grid-template-columns: 1fr;
  }

  .task-search-bar label,
  .task-search-bar input,
  .starred-filter-toggle,
  .task-search-count {
    grid-column: 1;
  }

  .task-search-count {
    margin-bottom: 0;
  }

  .schedule-scroll {
    max-height: 68vh;
  }

  .schedule-item {
    left: 58px;
    right: 6px;
  }

  .schedule-hour-row {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .task-summary {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  h1 {
    max-width: 100%;
  }
}

.calendar-day-shell {
  display: block;
}

.schedule-day-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.98);
  color: #0f172a;
  padding: 8px;
}

.schedule-day-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.schedule-day-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.schedule-date-badge {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #2563eb;
  color: white;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.16);
}

.schedule-date-weekday {
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.schedule-date-number {
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1;
}

.schedule-day-heading-copy h3 {
  color: #0f172a;
  margin-bottom: 0;
  font-size: 0.9rem;
}

.schedule-day-heading-copy p {
  color: #64748b;
  margin-bottom: 0;
  font-size: 0.68rem;
}

.schedule-day-heading-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.schedule-inline-collapse {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  padding: 1px 4px;
  flex: 0 0 auto;
}

.schedule-inline-collapse summary {
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 700;
  color: #334155;
  user-select: none;
}

.schedule-inline-collapse[open] {
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

.schedule-inline-collapse .schedule-ribbon-scroll {
  margin-top: 4px;
}

.schedule-day-controls {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.schedule-day-nav {
  display: inline-flex;
  gap: 6px;
}

.schedule-day-card .ghost-button {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.22);
}

.schedule-inline-field {
  display: grid;
  gap: 1px;
  color: #64748b;
  font-size: 0.6rem;
  min-width: 112px;
}

.schedule-inline-field input,
.schedule-inline-field select {
  background: white;
  color: #0f172a;
  border-color: #cbd5e1;
}

.schedule-inline-range {
  min-width: 148px;
}

.schedule-inline-range input[type="range"] {
  padding: 0;
  border: 0;
  background: transparent;
}

.schedule-task-ribbon {
  display: grid;
  gap: 6px;
  margin-bottom: 6px;
}

.schedule-ribbon-group {
  display: grid;
  gap: 3px;
}

.schedule-ribbon-label {
  color: #64748b;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.schedule-inline-dropdown summary {
  cursor: pointer;
  font-size: 0.78rem;
  color: #64748b;
}

.schedule-duration-slider,
.schedule-duration-defaults {
  display: grid;
  gap: 0.35rem;
  margin: 0.35rem 0;
}

.schedule-duration-defaults > span {
  color: #9bb0d1;
  font-size: 0.72rem;
}

.schedule-duration-default-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.schedule-duration-default {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.35rem 0.5rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.schedule-duration-default:hover,
.schedule-duration-default:focus-visible,
.schedule-duration-default.is-selected {
  background: #1d75f0;
  border-color: #1d75f0;
  color: #ffffff;
}

.schedule-ribbon-scroll {
  display: flex;
  gap: 5px;
  overflow: auto;
  padding-bottom: 1px;
  align-items: flex-start;
}

.calendar-chip {
  flex: 0 0 auto;
  width: auto;
  min-width: 120px;
  max-width: 200px;
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #dbeafe;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.compact-template-chip {
  min-width: 100px;
  max-width: 160px;
  padding: 0.24rem 0.38rem;
  gap: 1px;
}

.compact-dropdown-list {
  display: grid;
  gap: 3px;
  max-height: 140px;
  overflow: auto;
  padding-right: 1px;
}

.compact-choice-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px;
}

.compact-choice {
  min-width: 0;
  max-width: 100%;
  padding: 0.24rem 0.35rem;
  font-size: 0.72rem;
  line-height: 1.2;
  text-align: left;
}

.compact-choice-title {
  display: block;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-choice-sub {
  display: block;
  color: #64748b;
  font-size: 0.62rem;
  margin-top: 1px;
}

.compact-choice-delete {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #64748b;
  border-radius: 999px;
  width: 20px;
  height: 20px;
  line-height: 1;
  padding: 0;
}

.schedule-task-dropdown summary {
  cursor: pointer;
  font-size: 0.72rem;
  color: #334155;
  user-select: none;
}

.schedule-template-pill {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 3px;
}

.schedule-template-add {
  flex: 0 0 auto;
  border: 1px dashed #93c5fd;
  background: #eff6ff;
  color: #2563eb;
  font-weight: 800;
  padding: 0.24rem 0.42rem;
}

.schedule-template-delete {
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid #fecaca;
  background: white;
  color: #dc2626;
  padding: 0.02rem 0.28rem;
  line-height: 1;
  min-height: 1.15rem;
}

.schedule-template-form {
  flex: 0 0 auto;
  display: grid;
  gap: 4px;
  min-width: 216px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid #bfdbfe;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.schedule-template-form input,
.schedule-template-form select {
  background: white;
  color: #0f172a;
  border-color: #cbd5e1;
}

.schedule-template-form-row {
  display: grid;
  grid-template-columns: 80px 64px;
  gap: 4px;
  align-items: center;
}

.schedule-template-form-row:last-child {
  grid-template-columns: minmax(0, 1fr) auto;
}

.schedule-template-form-actions {
  display: inline-flex;
  gap: 4px;
  justify-content: flex-end;
}

.calendar-chip span:last-child,
.calendar-chip .schedule-task-chip-number {
  color: #64748b;
  font-size: 0.68rem;
}

.calendar-chip .schedule-task-chip-title,
.compact-template-chip span:first-child {
  font-size: 0.76rem;
}

.schedule-day-card .small-button,
.schedule-template-add,
.schedule-template-delete {
  min-height: 1.3rem;
  font-size: 0.72rem;
}

.schedule-board-frame {
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  overflow: hidden;
  background: white;
}

.calendar-day-scroll {
  max-height: 81vh;
  background: white;
  overscroll-behavior: contain;
  touch-action: none;
}

.calendar-day-timeline {
  background: white;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.calendar-hour-row {
  grid-template-columns: 54px minmax(0, 1fr);
}

.calendar-hour-row .schedule-hour-label {
  color: #334155;
  padding-top: 0;
  transform: translateY(-0.5rem);
  font-size: 0.76rem;
  user-select: none;
  -webkit-user-select: none;
}

.calendar-hour-row .schedule-hour-track {
  border-left: 1px solid #dbe3ef;
  border-top: 1px solid #e2e8f0;
  background:
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent calc(var(--step-height) - 1px),
      rgba(148, 163, 184, 0.1) calc(var(--step-height) - 1px),
      rgba(148, 163, 184, 0.1) var(--step-height)
    );
}


.elastic-zoom-nib-wrap {
  position: sticky;
  top: calc(50dvh - 70px);
  left: 7px;
  width: 40px;
  height: 0;
  z-index: 8;
  pointer-events: none;
}

.elastic-zoom-nib {
  position: absolute;
  top: 0;
  left: 6px;
  width: 32px;
  min-height: 86px;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  align-items: center;
  justify-items: center;
  padding: 8px 0;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  background: rgba(255, 255, 255, 0.94);
  color: #2563eb;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
  transform: translateY(var(--nib-offset, 0px));
  pointer-events: auto;
  touch-action: none;
  cursor: ns-resize;
}

.elastic-zoom-nib:hover {
  transform: translateY(var(--nib-offset, 0px));
}

.elastic-zoom-nib-dot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.12);
}

.elastic-zoom-nib-chevron {
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  color: #1d4ed8;
  opacity: 0.78;
}

.elastic-zoom-nib-chevron.disabled {
  opacity: 0.22;
}

.elastic-zoom-label {
  position: absolute;
  top: 28px;
  left: 44px;
  padding: 0.22rem 0.46rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
  pointer-events: none;
}

.schedule-now-line {
  position: absolute;
  left: 54px;
  right: 0;
  height: 2px;
  background: #ef4444;
  z-index: 3;
}

.schedule-now-dot {
  position: absolute;
  left: -6px;
  top: -5px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ef4444;
}

.schedule-now-label {
  position: absolute;
  left: auto;
  right: calc(100% + 8px);
  top: -11px;
  color: #ef4444;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1;
  background: white;
  padding: 1px 3px;
  border-radius: 3px;
  white-space: nowrap;
}

.calendar-day-timeline .schedule-items-layer {
  left: 54px;
  right: 6px;
  top: 3px;
}

.schedule-scroll-dragging,
.schedule-scroll-dragging *,
.schedule-pinch-zooming,
.schedule-pinch-zooming * {
  user-select: none !important;
  -webkit-user-select: none !important;
  cursor: grabbing !important;
}

.calendar-day-timeline .schedule-item {
  left: calc(8px + var(--item-left, 0%));
  width: calc(((100% - 16px) * var(--item-width, 100) / 100) - 2px);
  max-width: calc(100% - 16px);
  min-height: 21px;
  background: #d96d66;
  border: 1px solid #cf6058;
  box-shadow: none;
  color: #3f0d0c;
  border-left-width: 4px;
  border-radius: 6px;
  padding: 3px 18px 9px 8px;
  display: grid;
  align-items: flex-start;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.45);
}

.calendar-day-timeline .schedule-item.compact {
  min-height: 17px;
  padding: 1px 16px 3px 8px;
}

.calendar-day-timeline .schedule-item.done {
  background: #e9b1ad;
  border-color: #dc8e88;
}

.calendar-day-timeline .schedule-item.selected {
  background: #fbbf24;
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.35);
}

.schedule-info-bubble {
  z-index: 12;
  width: min(420px, calc(100vw - 32px));
  border: 1px solid #dbe4f0;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
  padding: 16px 18px 14px;
  gap: 12px;
}

.schedule-info-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.schedule-info-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #d96d66;
  flex: 0 0 auto;
}

.schedule-info-dot[data-category-color="admin"] { background: #67e8f9; }
.schedule-info-dot[data-category-color="dadbods"] { background: #f472b6; }
.schedule-info-dot[data-category-color="dadbods-treasury"] { background: #60a5fa; }
.schedule-info-dot[data-category-color="swig"] { background: #fbbf24; }
.schedule-info-dot[data-category-color="finance"] { background: #4ade80; }
.schedule-info-dot[data-category-color="operations"] { background: #fb7185; }
.schedule-info-dot[data-category-color="systems"] { background: #a78bfa; }
.schedule-info-dot[data-category-color="personal"] { background: #38bdf8; }
.schedule-info-dot[data-category-color="tech"] { background: #22c55e; }
.schedule-info-dot[data-category-color="home"] { background: #fb923c; }
.schedule-info-dot[data-category-color="home-improvement"] { background: #84cc16; }
.schedule-info-dot[data-category-color="routine"] { background: #94a3b8; }
.schedule-info-dot[data-category-color="kids"] { background: #14b8a6; }
.schedule-info-dot[data-category-color="friends-family"] { background: #e879f9; }
.schedule-info-dot[data-category-color="comms"] { background: #2dd4bf; }
.schedule-info-dot[data-category-color="low-pressure"] { background: #fde68a; }
.schedule-info-dot[data-category-color="inbox"] { background: #d96d66; }

.schedule-info-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.schedule-info-bubble .small-button {
  min-height: 30px;
}

.schedule-info-content {
  display: grid;
  gap: 6px;
}

.schedule-info-title {
  background: transparent;
  border: 0;
  padding: 0;
  color: #1f2937;
  font-size: 1.05rem;
  font-weight: 700;
}

.schedule-info-title:focus {
  outline: none;
}

.schedule-info-meta {
  display: grid;
  gap: 2px;
  color: #4b5563;
  font-size: 0.9rem;
  line-height: 1.35;
}

.schedule-info-bubble .schedule-info-row {
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 8px;
}

.schedule-info-bubble input,
.schedule-info-bubble select {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}

.schedule-info-bubble .schedule-info-close {
  min-width: 1.25rem;
  color: #475569;
}

.calendar-day-timeline .schedule-item-time,
.calendar-day-timeline .schedule-item-link,
.calendar-day-timeline .schedule-item-footer,
.calendar-day-timeline .schedule-item-title,
.calendar-day-timeline .schedule-item-delete {
  color: #3f0d0c;
}

.schedule-item-title-row {
  --schedule-item-content-indent: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  justify-items: stretch;
  gap: 1px;
  min-width: 0;
  width: 100%;
  text-align: left;
}

.calendar-day-timeline .schedule-item-title {
  font-size: 0.82rem;
  line-height: 1.05;
  padding-left: var(--schedule-item-content-indent);
  padding-right: 0;
  min-width: 0;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.schedule-item-generated-meta {
  justify-self: stretch;
  min-width: 0;
  border-radius: 0;
  background: transparent;
  color: #3f0d0c;
  padding: 0 0 0 var(--schedule-item-content-indent);
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.calendar-day-timeline .schedule-item.compact .schedule-item-title-row {
  --schedule-item-content-indent: 12px;
}

.calendar-day-timeline .schedule-item.compact .schedule-item-title {
  font-size: clamp(0.46rem, 0.85vw, 0.58rem);
  line-height: 1;
}

.calendar-day-timeline .schedule-item.compact .schedule-item-generated-meta {
  display: block;
  font-size: clamp(0.42rem, 0.78vw, 0.5rem);
  line-height: 1;
}

.calendar-day-timeline .schedule-item.done .schedule-item-title {
  text-decoration: line-through;
  opacity: 0.8;
}

.calendar-day-timeline .schedule-item-done-toggle {
  position: absolute;
  top: 4px;
  left: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.calendar-day-timeline .schedule-item-done-toggle input[type="checkbox"] {
  width: 13px;
  height: 13px;
  margin: 0;
  cursor: pointer;
}

.calendar-day-timeline .schedule-item.compact .schedule-item-done-toggle {
  top: 2px;
}

.calendar-day-timeline .schedule-item.compact .schedule-item-done-toggle input[type="checkbox"] {
  width: 8px;
  height: 8px;
}

.calendar-day-timeline .schedule-item-delete-inline {
  position: absolute;
  top: 4px;
  right: 6px;
  min-width: 14px;
  line-height: 1;
  font-size: 0.85rem;
  font-weight: 700;
  color: #7f1d1d;
}

.calendar-day-timeline .schedule-item.compact .schedule-item-delete-inline {
  top: 1px;
  right: 4px;
  min-width: 10px;
  font-size: 0.5rem;
}

.calendar-day-timeline .schedule-resize-handle {
  left: 6px;
  right: 6px;
  bottom: 2px;
  height: 7px;
  background: rgba(127, 29, 29, 0.2);
}

.calendar-day-timeline .schedule-item.compact .schedule-resize-handle {
  left: 4px;
  right: 4px;
  bottom: 1px;
  height: 2px;
}

.schedule-item-title-only {
  align-self: flex-start;
}

.calendar-day-timeline .schedule-draft-popup {
  background: white;
  border-color: #93c5fd;
  color: #0f172a;
}

.calendar-day-timeline .schedule-draft-heading {
  color: #2563eb;
}

.calendar-day-timeline .schedule-draft-popup input,
.calendar-day-timeline .schedule-draft-popup select {
  background: white;
  color: #0f172a;
  border-color: #cbd5e1;
}

.schedule-info-popup {
  position: absolute;
  z-index: 5;
  width: 240px;
  border-radius: 14px;
  border: 1px solid #fca5a5;
  background: white;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.schedule-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #991b1b;
  font-size: 0.72rem;
  font-weight: 800;
}

.schedule-info-close {
  background: transparent;
  color: #991b1b;
  padding: 0;
  min-width: 1rem;
}

.schedule-info-popup input,
.schedule-info-popup select {
  background: white;
  color: #0f172a;
  border-color: #cbd5e1;
}

.schedule-info-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 6px;
}

.schedule-info-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.schedule-danger-button {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fff1f2;
}


@media (max-width: 760px) {
  .calendar-day-timeline .schedule-draft-popup,
  .schedule-info-popup.schedule-info-bubble {
    position: fixed;
    left: 12px !important;
    right: 12px !important;
    bottom: max(12px, env(safe-area-inset-bottom)) !important;
    top: auto !important;
    width: auto;
    max-width: none;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    z-index: 80;
    border-radius: 18px 18px 14px 14px;
    box-shadow: 0 24px 70px rgba(2, 8, 23, 0.35);
  }

  .calendar-day-timeline .schedule-draft-popup {
    padding: 14px;
  }

  .calendar-day-timeline .schedule-draft-popup input,
  .calendar-day-timeline .schedule-draft-popup select,
  .schedule-info-popup.schedule-info-bubble input,
  .schedule-info-popup.schedule-info-bubble select {
    min-height: 44px;
    font-size: 1rem;
  }

  .schedule-draft-row,
  .schedule-info-bubble .schedule-info-row {
    grid-template-columns: 1fr;
  }

  .schedule-draft-actions,
  .schedule-info-toolbar-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  .schedule-day-card {
    padding: 10px;
  }

  .schedule-day-toolbar,
  .schedule-day-controls {
    align-items: stretch;
  }

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

  .calendar-hour-row {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .schedule-now-line {
    left: 56px;
  }

  .calendar-day-timeline .schedule-items-layer {
    left: 56px;
    right: 4px;
  }

  .schedule-info-row {
    grid-template-columns: 1fr;
  }
}

.schedule-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  flex: 0 0 auto;
}

.schedule-view-toggle-button {
  min-height: 1.4rem;
  padding: 0.22rem 0.48rem;
  border-radius: 999px;
  background: transparent;
  color: #475569;
  font-size: 0.66rem;
  font-weight: 800;
}

.schedule-view-toggle-button.active {
  background: #2563eb;
  color: #ffffff;
}

.schedule-list-view {
  display: grid;
  gap: 10px;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: #ffffff;
  padding: 10px;
  max-height: 81vh;
  overflow: auto;
}

.schedule-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
}

.schedule-list-header h4 {
  margin-bottom: 2px;
  color: #0f172a;
  font-size: 0.95rem;
}

.schedule-list-header p {
  margin-bottom: 0;
  color: #64748b;
  font-size: 0.72rem;
}

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

.schedule-list-item {
  display: grid;
  grid-template-columns: auto 64px minmax(180px, 1fr) minmax(210px, 0.7fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-left: 5px solid #d96d66;
  border-radius: 14px;
  background: #f8fafc;
  color: #0f172a;
}

.schedule-list-item.done {
  opacity: 0.72;
}

.schedule-list-item.done .schedule-list-title {
  text-decoration: line-through;
}

.schedule-list-item[data-category-color="admin"] { border-left-color: #67e8f9; }
.schedule-list-item[data-category-color="dadbods"] { border-left-color: #f472b6; }
.schedule-list-item[data-category-color="dadbods-treasury"] { border-left-color: #60a5fa; }
.schedule-list-item[data-category-color="swig"] { border-left-color: #fbbf24; }
.schedule-list-item[data-category-color="finance"] { border-left-color: #4ade80; }
.schedule-list-item[data-category-color="operations"] { border-left-color: #fb7185; }
.schedule-list-item[data-category-color="systems"] { border-left-color: #a78bfa; }
.schedule-list-item[data-category-color="personal"] { border-left-color: #38bdf8; }
.schedule-list-item[data-category-color="tech"] { border-left-color: #22c55e; }
.schedule-list-item[data-category-color="home"] { border-left-color: #fb923c; }
.schedule-list-item[data-category-color="home-improvement"] { border-left-color: #84cc16; }
.schedule-list-item[data-category-color="routine"] { border-left-color: #94a3b8; }
.schedule-list-item[data-category-color="kids"] { border-left-color: #14b8a6; }
.schedule-list-item[data-category-color="friends-family"] { border-left-color: #e879f9; }
.schedule-list-item[data-category-color="comms"] { border-left-color: #2dd4bf; }
.schedule-list-item[data-category-color="low-pressure"] { border-left-color: #fde68a; }
.schedule-list-item[data-category-color="inbox"] { border-left-color: #d96d66; }

.schedule-list-check input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.schedule-list-time-stack {
  display: grid;
  gap: 3px;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 800;
}

.schedule-list-time {
  width: 100%;
  padding: 0.32rem 0.38rem;
  color: #0f172a;
  background: #ffffff;
  border-color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 800;
}

.schedule-list-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.schedule-list-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.schedule-list-title {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  border: 0;
  background: transparent;
  color: #111827;
  padding: 0;
  font-size: 0.95rem;
  font-weight: 850;
}

.schedule-list-generated-meta {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 0.12rem 0.45rem;
  font-size: 0.64rem;
  font-weight: 900;
  white-space: nowrap;
}

.schedule-list-title:focus {
  outline: none;
}

.schedule-list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.schedule-list-pill {
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  padding: 0.12rem 0.45rem;
  font-size: 0.64rem;
  font-weight: 800;
}

.schedule-list-edit-grid {
  display: grid;
  grid-template-columns: 88px minmax(110px, 1fr);
  gap: 8px;
  align-items: end;
}

.schedule-list-edit-grid label {
  display: grid;
  gap: 2px;
  color: #64748b;
  font-size: 0.62rem;
  font-weight: 800;
}

.schedule-list-edit-grid input,
.schedule-list-edit-grid select {
  width: 100%;
  padding: 0.32rem 0.42rem;
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
  font-size: 0.72rem;
}

.schedule-list-delete {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #b91c1c;
  font-size: 1rem;
  font-weight: 900;
}

.schedule-list-empty {
  display: grid;
  gap: 4px;
  padding: 24px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  color: #64748b;
  text-align: center;
}

.schedule-list-empty strong {
  color: #0f172a;
}

@media (max-width: 900px) {
  .schedule-list-item {
    grid-template-columns: auto 62px minmax(0, 1fr) auto;
  }

  .schedule-list-title-row {
    flex-wrap: wrap;
  }

  .schedule-list-edit-grid {
    grid-column: 3 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
  }
}

@media (max-width: 560px) {
  .page-shell {
    padding: 8px;
  }

  .summary-panel,
  .panel {
    padding: 8px;
  }

  .schedule-day-card {
    padding: 8px;
    border-radius: 18px;
  }

  .schedule-day-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .schedule-day-heading {
    min-width: 0;
    align-items: flex-start;
  }

  .schedule-date-badge {
    width: 36px;
    height: 46px;
    border-radius: 14px;
    flex: 0 0 auto;
  }

  .schedule-day-heading-copy {
    min-width: 0;
  }

  .schedule-day-heading-copy h3 {
    font-size: 1.05rem;
    line-height: 1.05;
  }

  .schedule-day-heading-row {
    gap: 6px;
    flex-wrap: wrap;
    overflow: visible;
  }

  .schedule-view-toggle {
    order: 2;
  }

  .schedule-view-toggle-button {
    min-height: 1.55rem;
    padding: 0.24rem 0.52rem;
    font-size: 0.72rem;
  }

  .schedule-inline-collapse {
    order: 3;
    padding: 2px 6px;
  }

  .schedule-inline-collapse summary {
    font-size: 0.68rem;
  }

  .schedule-day-controls {
    width: 100%;
  }

  .schedule-list-view {
    gap: 8px;
    padding: 8px;
    border-radius: 14px;
    max-height: calc(100svh - 230px);
  }

  .schedule-list-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding-bottom: 7px;
  }

  .schedule-list-header h4 {
    font-size: 0.94rem;
    line-height: 1.1;
  }

  .schedule-list-header p {
    font-size: 0.68rem;
    line-height: 1.25;
  }

  .schedule-list-header .small-button {
    padding: 0.42rem 0.58rem;
    white-space: nowrap;
  }

  .schedule-list-items {
    gap: 7px;
  }

  .schedule-list-item {
    grid-template-columns: 46px 20px minmax(0, 1fr) 24px;
    grid-template-areas:
      "time check main delete"
      "time edit edit edit";
    align-items: start;
    gap: 5px 7px;
    padding: 8px 7px;
    border-left-width: 4px;
    border-radius: 12px;
  }

  .schedule-list-check {
    grid-area: check;
    justify-self: center;
    padding-top: 2px;
  }

  .schedule-list-check input {
    width: 18px;
    height: 18px;
  }

  .schedule-list-time-stack {
    grid-area: time;
    gap: 2px;
    padding-top: 1px;
    font-size: 0.58rem;
    line-height: 1.05;
    text-align: right;
  }

  .schedule-list-time {
    width: 46px;
    border: 0;
    background: transparent;
    padding: 0;
    color: #64748b;
    font-size: 0.7rem;
    line-height: 1;
    text-align: right;
    letter-spacing: -0.04em;
  }

  .schedule-list-time::-webkit-calendar-picker-indicator {
    display: none;
  }

  .schedule-list-main {
    grid-area: main;
    gap: 4px;
    padding-top: 1px;
  }

  .schedule-list-title {
    min-width: 0;
    font-size: 0.92rem;
    line-height: 1.12;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .schedule-list-meta {
    gap: 4px;
    overflow: hidden;
  }

  .schedule-list-pill {
    max-width: 100%;
    padding: 0.1rem 0.35rem;
    font-size: 0.58rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .schedule-list-edit-grid {
    grid-area: edit;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 5px;
    width: 100%;
    padding-top: 1px;
  }

  .schedule-list-edit-grid label {
    gap: 1px;
    font-size: 0.54rem;
    line-height: 1.1;
  }

  .schedule-list-edit-grid input,
  .schedule-list-edit-grid select {
    min-height: 1.78rem;
    padding: 0.24rem 0.34rem;
    font-size: 0.68rem;
  }

  .schedule-list-delete {
    grid-area: delete;
    justify-self: end;
    width: 24px;
    height: 24px;
    font-size: 0.92rem;
  }
}

@media (max-width: 390px) {
  .schedule-list-header p {
    display: none;
  }

  .schedule-list-view {
    max-height: calc(100svh - 190px);
  }

  .schedule-list-item {
    grid-template-columns: 42px 18px minmax(0, 1fr) 22px;
    gap: 4px 6px;
    padding: 7px 6px;
  }

  .schedule-list-time,
  .schedule-list-time-stack {
    width: 42px;
  }

  .schedule-list-title {
    font-size: 0.88rem;
  }

  .schedule-list-edit-grid {
    grid-template-columns: 56px minmax(0, 1fr);
  }
}

.schedule-mobile-chrome-toggle {
  display: none;
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid #cbd5e1;
  background: #0f172a;
  color: #f8fafc;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.schedule-mobile-chrome-toggle small {
  color: #bae6fd;
  font-size: 0.58rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.schedule-mobile-fullscreen {
  overflow: hidden;
  background: #ffffff;
}

body.schedule-mobile-fullscreen .page-shell {
  max-width: none;
  min-height: 100dvh;
  padding: 0;
}

body.schedule-mobile-fullscreen .deployment-timestamp,
body.schedule-mobile-fullscreen .controls-panel,
body.schedule-mobile-fullscreen .chatgpt-export-panel {
  display: none;
}

body.schedule-mobile-fullscreen .dashboard-grid,
body.schedule-mobile-fullscreen .summary-panel,
body.schedule-mobile-fullscreen #schedule-view,
body.schedule-mobile-fullscreen #schedule-root,
body.schedule-mobile-fullscreen .calendar-day-shell {
  min-height: 100dvh;
}

body.schedule-mobile-fullscreen .summary-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  backdrop-filter: none;
}

body.schedule-mobile-fullscreen .schedule-shell {
  display: flex;
  flex-direction: column;
  gap: 0;
}

body.schedule-mobile-fullscreen .schedule-mobile-chrome-toggle {
  display: flex;
  flex: 0 0 24px;
}

body.schedule-mobile-fullscreen .schedule-day-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 0;
  border-radius: 0;
}

body.schedule-mobile-fullscreen .schedule-day-toolbar,
body.schedule-mobile-fullscreen .schedule-list-header {
  display: none;
}

body.schedule-mobile-fullscreen .schedule-board-frame {
  flex: 1 1 auto;
  min-height: 0;
  border: 0;
  border-radius: 0;
}

body.schedule-mobile-fullscreen .calendar-day-scroll,
body.schedule-mobile-fullscreen .schedule-list-view {
  height: calc(100dvh - 24px);
  max-height: none;
  border: 0;
  border-radius: 0;
}

body.schedule-mobile-fullscreen .schedule-list-view {
  padding: 8px;
}

body.schedule-mobile-chrome-visible .schedule-mobile-chrome-toggle {
  display: flex;
}
