/* ── Reset & variables ─────────────────────────────────────────── */
:root {
  --bg:         #0d1117;
  --panel:      #161b22;
  --panel2:     #1f2937;
  --border:     #30363d;
  --text:       #e6edf3;
  --muted:      #8b949e;
  --accent:     #d35400;
  --accent-h:   #e65c00;
  --weekend-bg: #1c2130;
  --today-ring: #d35400;
  --event-bg:   #1e3a5f;
  --event-text: #79b8ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── App shell ─────────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

/* ── Header ────────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
}

.tagline {
  margin-top: 0.15rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.today-seth {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

.today-greg {
  font-size: 0.82rem;
  color: #555e6e;
  font-weight: 400;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid #2b3442;
  border-radius: 9px;
  background: linear-gradient(160deg, #141a23 0%, #10151d 100%);
  min-width: 138px;
}

.clock-seth {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: #e7edf7;
  letter-spacing: 0.02em;
  line-height: 1;
}

.clock-greg {
  font-size: 0.74rem;
  color: #718096;
  line-height: 1.2;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.btn {
  display: inline-block;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-h); }

.btn-secondary {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #2d3748; }

.btn-small {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

/* ── Login wall ────────────────────────────────────────────────── */
.login-wall {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
}

.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  max-width: 460px;
  width: 100%;
  text-align: center;
}

.login-card h2 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}

.login-card p {
  color: var(--muted);
  margin-bottom: 1.75rem;
  font-size: 0.95rem;
}

.login-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ── Calendar app layout ───────────────────────────────────────── */
#calendarApp {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 0;
}

/* ── Sidebar ───────────────────────────────────────────────────── */
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 1rem 0.75rem;
  overflow-y: auto;
}

.sidebar-create-btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.sidebar-create-btn:hover {
  background: var(--accent-h);
}

.sidebar-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
  padding: 0 0.25rem;
}

.calendar-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.cal-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.88rem;
  transition: background 0.12s;
}

.cal-item:hover { background: var(--panel2); }
.cal-item.disabled { opacity: 0.4; }

.cal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cal-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.cal-loading { color: var(--muted); font-size: 0.88rem; padding: 0.25rem 0.5rem; }

/* ── Mini month navigator ───────────────────────────────────────── */
.mini-nav {
  padding: 0.5rem 0.25rem 0.25rem;
}

.mini-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.mini-nav-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  flex: 1;
}

.mini-nav-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  line-height: 1;
  transition: background 0.1s, color 0.1s;
}
.mini-nav-btn:hover { background: var(--panel2); color: var(--text); }

.mini-dow-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin-bottom: 0.2rem;
}
.mini-dow-row > div {
  font-size: 0.62rem;
  font-weight: 700;
  text-align: center;
  color: var(--muted);
  text-transform: uppercase;
  padding: 0.1rem 0;
}
.mini-dow-row .mini-weekend { color: #6273a3; }

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

.mini-cell {
  font-size: 0.68rem;
  text-align: center;
  padding: 0.22rem 0.1rem;
  border-radius: 50%;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.1s, color 0.1s;
  line-height: 1;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mini-cell:hover    { background: var(--panel2); color: var(--text); }
.mini-cell.weekend  { color: #6273a3; }
.mini-cell.today    { background: var(--accent); color: #fff; }
.mini-cell.selected { outline: 1px solid var(--accent); color: var(--accent); }
.mini-cell.today.selected { outline: none; }
.mini-cell.holiday  { color: var(--accent); font-weight: 700; font-size: 0.58rem; border-radius: 4px; }
.mini-cell.has-dot::after {
  content: "";
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  margin: 1px auto 0;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 0.6rem 0;
}

/* ── Main area ─────────────────────────────────────────────────── */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Nav bar ───────────────────────────────────────────────────── */
.nav-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.nav-btn {
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.12s;
  line-height: 1;
}
.nav-btn:hover { background: #2d3748; }
.nav-today { font-size: 0.82rem; font-weight: 600; }
.nav-create { font-size: 0.82rem; font-weight: 700; }

.nav-center {
  flex: 1;
  text-align: center;
}

.nav-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
}

.nav-title-btn {
  background: none;
  border: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
}
.nav-title-btn:hover { background: var(--panel2); }

.nav-title-caret {
  color: var(--muted);
  font-size: 0.75rem;
  transform: translateY(1px);
}

.nav-search-wrap {
  min-width: 180px;
  position: relative;
}

.nav-search {
  width: 100%;
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  font-size: 0.82rem;
}

.nav-search::placeholder { color: var(--muted); }
.nav-search:focus { outline: 1px solid var(--accent); border-color: var(--accent); }

.nav-install {
  font-size: 0.78rem;
  font-weight: 600;
}

.icon-btn {
  font-size: 0.92rem;
  padding: 0.26rem 0.5rem;
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 1200;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

.search-empty {
  padding: 0.6rem 0.7rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.search-result-row {
  width: 100%;
  border: none;
  background: none;
  color: inherit;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  border-bottom: 1px solid #232a34;
}
.search-result-row:last-child { border-bottom: none; }
.search-result-row:hover { background: var(--panel2); }

.search-color {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 0.45rem;
  flex-shrink: 0;
}

.search-main { min-width: 0; display: flex; flex-direction: column; gap: 0.12rem; }
.search-title {
  font-size: 0.82rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-meta {
  font-size: 0.72rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── View switcher ─────────────────────────────────────────────── */
.view-switcher {
  display: flex;
  gap: 0.2rem;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.2rem;
}

.view-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}
.view-btn:hover  { background: var(--border); color: var(--text); }
.view-btn.active { background: var(--accent); color: #fff; }

/* ── Day-of-week header ────────────────────────────────────────── */
.dow-header {
  display: grid;
  grid-template-columns: var(--gutter-w, 36px) repeat(6, 1fr);
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.dow-gutter {
  background: var(--panel);
  border-right: 1px solid var(--border);
}

.dow-header > div {
  padding: 0.4rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  border-left: 1px solid var(--border);
}

.dow-header > div:first-child { border-left: none; }
.weekend-label { color: #6273a3 !important; }

:root {
  --gutter-w: 36px;
  --greg-weekend-bg: #161d28;
}

/* ── View containers ───────────────────────────────────────────── */
.view-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* ── Month grid ────────────────────────────────────────────────── */
#monthGrid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
}

#monthGrid.has-week-gutter {
  grid-template-columns: var(--gutter-w) repeat(6, 1fr);
}

/* ── Week gutter ───────────────────────────────────────────────── */
.week-gutter-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-weight: 700;
  color: var(--muted);
  background: var(--panel);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.4rem 0.2rem;
}

.day-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0.5rem;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  cursor: default;
  transition: background 0.1s;
  position: relative;
}

.create-target {
  cursor: cell;
}

.create-target.create-selected {
  box-shadow: inset 0 0 0 2px rgba(211, 84, 0, 0.95);
  background: rgba(211, 84, 0, 0.16) !important;
}

/* With week gutter, each row is 7 columns (gutter + 6 days) */
#monthGrid.has-week-gutter .day-cell:nth-child(7n) { border-right: none; }
.week-row.has-week-gutter .day-cell:last-child { border-right: none; }

.day-cell.weekend { background: var(--weekend-bg); }
.day-cell.today { outline: 2px solid var(--today-ring); outline-offset: -2px; }
.day-cell.other-month { opacity: 0.35; }

/* ── Cell header (day-num + moon + greg label) ─────────────────── */
.cell-header {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.15rem;
  min-height: 20px;
  padding-right: 18px;
}

.day-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
  flex-shrink: 0;
}

.day-cell.today .day-num {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cell-moon {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  flex-shrink: 0;
  opacity: 0.75;
  display: block;
  border-radius: 50%;
}
.cell-moon:hover { opacity: 1; }

.cell-greg-label {
  font-size: 0.64rem;
  color: #445060;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* legacy (used in holiday strip) */
.greg-date {
  font-size: 0.68rem;
  color: #555e6e;
  line-height: 1;
}

/* ── Gregorian weekend shading ─────────────────────────────────── */
.day-cell.greg-weekend:not(.weekend) {
  background: var(--greg-weekend-bg);
}
.day-cell.greg-weekend.weekend {
  /* already has seth weekend bg; blend slightly darker */
  background: #181f2d;
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.1rem;
}

.event-chip {
  background: var(--event-bg);
  color: var(--event-text);
  border-radius: 3px;
  padding: 0.1rem 0.3rem;
  font-size: 0.7rem;
  line-height: 1.3;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: filter 0.1s;
}

.event-chip:hover { filter: brightness(1.2); }

.event-chip.span-start,
.event-chip.span-mid,
.event-chip.span-end {
  border-radius: 0;
}

.event-chip.span-start {
  border-radius: 4px 0 0 4px;
}

.event-chip.span-end {
  border-radius: 0 4px 4px 0;
}

.event-chip.span-mid {
  min-height: 16px;
  color: transparent !important;
}

/* ── Leap day split cell ───────────────────────────────────────── */
.leap-wrapper {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.leap-half {
  flex: 1;
  padding: 0.3rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  background: var(--weekend-bg);
  border: 1px solid #1a2a4a;
  overflow: hidden;
  position: relative;
}

.leap-half + .leap-half {
  border-top: 1px dashed #2a3a5a;
}

.leap-half.today { outline: 2px solid var(--today-ring); outline-offset: -2px; }

.leap-day-label {
  color: var(--accent) !important;
  font-size: 0.65rem !important;
}

/* ── Holiday strip ─────────────────────────────────────────────── */
.holiday-strip {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--panel2);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.holiday-cell {
  flex: 1;
  min-width: 80px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  position: relative;
}

.holiday-cell.today { outline: 2px solid var(--today-ring); }

.holiday-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Event panel ───────────────────────────────────────────────── */
.event-panel {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.event-panel-inner {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem 1.5rem;
  max-width: 480px;
  width: 100%;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
}
.close-btn:hover { background: var(--panel2); color: var(--text); }

.settings-btn {
  right: 2.5rem;
  font-size: 0.9rem;
}

#panelTitle {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  padding-right: 1.5rem;
}

#panelMeta {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

#panelDesc {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

#panelMeta a {
  color: var(--accent);
  text-decoration: none;
}
#panelMeta a:hover { text-decoration: underline; }

.panel-actions {
  margin-top: 0.85rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}

/* ── Moon panel ────────────────────────────────────────────────── */
.moon-panel-inner {
  max-width: 620px;
}

.moon-display-inline {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0.3rem 0 0.9rem;
}

.moon-glyph-inline {
  font-size: 2rem;
  line-height: 1;
}

.moon-name-inline {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.moon-pct-inline {
  font-size: 0.82rem;
  color: var(--muted);
}

.moon-astro-head {
  display: grid;
  grid-template-columns: 140px 1fr 1fr;
  gap: 0.35rem 0.9rem;
  font-size: 0.72rem;
  color: #6d7784;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.moon-astro-grid {
  display: grid;
  grid-template-columns: 140px 1fr 1fr;
  gap: 0.35rem 0.9rem;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.9rem;
}
.astro-label { color: var(--text); font-weight: 600; }

.moon-event-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow: auto;
  font-size: 0.84rem;
  color: var(--muted);
}

.moon-event-list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid #2a2a2a;
}
.moon-event-list li:last-child { border-bottom: none; }

.event-dual-date {
  display: flex;
  flex-direction: column;
  text-align: right;
  gap: 0.05rem;
  font-size: 0.75rem;
}
.event-dual-date span:first-child { color: var(--text); }

/* ── Date Picker ───────────────────────────────────────────────── */
.date-picker-inner {
  max-width: 520px;
}

.dp-year-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel2);
  margin: 0.5rem 0 0.8rem;
}

.dp-year-title {
  padding: 0.45rem 0.6rem;
  font-size: 0.82rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.dp-year-list {
  max-height: 180px;
  overflow-y: auto;
  padding: 0.35rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 0.28rem;
}

.dp-year-btn {
  background: #121821;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 0.35rem 0.4rem;
  cursor: pointer;
  font-size: 0.8rem;
}
.dp-year-btn:hover { border-color: #526178; color: var(--text); }
.dp-year-btn.active { border-color: var(--accent); color: var(--accent); }

.dp-month-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.35rem;
}

.dp-month-btn {
  background: #121821;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 0.38rem 0.25rem;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
}
.dp-month-btn:hover { border-color: #526178; color: var(--text); }
.dp-month-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.dp-actions {
  margin-top: 0.75rem;
  display: flex;
  justify-content: flex-end;
}

/* ── Location panel ────────────────────────────────────────────── */
.location-panel-inner {
  max-width: 460px;
}

.location-note {
  color: var(--muted);
  font-size: 0.84rem;
  margin: 0.2rem 0 0.8rem;
}

.location-form {
  display: grid;
  gap: 0.65rem;
}

.location-form label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.location-form input {
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 0.42rem 0.55rem;
  font-size: 0.86rem;
}

.location-zip-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
}

.location-form input:focus {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
}

.location-actions {
  margin-top: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.location-status {
  color: var(--muted);
  font-size: 0.8rem;
}

/* ── Create panels ─────────────────────────────────────────────── */
.create-panel-inner {
  max-width: 760px;
}

.full-create-panel-inner {
  max-width: 860px;
  max-height: 92vh;
  overflow-y: auto;
}

.create-grid {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

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

.create-grid.seth-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.seth-sections {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.5rem;
}

.seth-section {
  border: 1px solid #253247;
  border-radius: 8px;
  padding: 0.55rem;
  background: #0f1622;
}

.create-field {
  display: grid;
  gap: 0.2rem;
  font-size: 0.78rem;
  color: var(--muted);
  min-width: 0;
}

.create-field input,
.create-field select,
.create-field textarea {
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 0.42rem 0.55rem;
  font-size: 0.86rem;
  width: 100%;
  min-width: 0;
}

.create-field input:focus,
.create-field select:focus,
.create-field textarea:focus {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
}

.create-field input:disabled,
.create-field select:disabled,
.create-field textarea:disabled {
  background: #1a202c;
  color: #677285;
  border-color: #2a3344;
  cursor: not-allowed;
  opacity: 0.85;
}

.create-wide {
  grid-column: 1 / -1;
}

.create-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text);
}

.create-seth-block {
  margin-top: 0.7rem;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #101821;
}

.create-greg-block {
  margin-top: 0.7rem;
  padding: 0.6rem;
  border: 1px solid #253247;
  border-radius: 8px;
  background: #111722;
}

.create-seth-head {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  font-weight: 700;
}

.create-greg-head {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8fa0ba;
  font-weight: 700;
}

.create-subhead {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7f8ea8;
  font-weight: 700;
  align-self: end;
  margin-bottom: 0.45rem;
}

.create-status {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
  min-height: 1rem;
}

.create-actions {
  margin-top: 0.55rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}

/* ── Footer ────────────────────────────────────────────────────── */
.app-footer {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.55rem 0.8rem;
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.app-footer a {
  color: #9aa5b1;
  text-decoration: none;
}

.app-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ── Week / 3-Weeks grid ───────────────────────────────────────── */
#weekGrid, #threeWeeksGrid {
  display: flex;
  flex-direction: column;
}

#threeDayGrid {
  display: flex;
  flex-direction: column;
}

.time-grid-wrap {
  display: grid;
  grid-template-columns: 56px repeat(6, minmax(0, 1fr));
  grid-auto-rows: minmax(34px, auto);
  overflow: auto;
  border-top: 1px solid var(--border);
}

.time-grid-wrap.cols-3 {
  grid-template-columns: 56px repeat(3, minmax(0, 1fr));
}

.time-grid-wrap.cols-1 {
  grid-template-columns: 56px minmax(0, 1fr);
}

.time-grid-corner {
  background: var(--panel);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.time-grid-day-head {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 0.35rem 0.45rem;
}

.time-grid-seth {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
}

.time-grid-greg {
  font-size: 0.68rem;
  color: var(--muted);
}

.time-grid-time-label {
  background: var(--panel);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.67rem;
  color: var(--muted);
  padding: 0.35rem 0.35rem 0.15rem;
  text-align: right;
}

.time-grid-slot {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.1rem 0.2rem;
  min-height: 34px;
  overflow: hidden;
}

.time-grid-chip {
  margin-top: 0.08rem;
  margin-bottom: 0.08rem;
}

.time-grid-chip-continued {
  min-height: 16px;
  border-left-width: 2px;
  opacity: 0.85;
}

.week-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  flex: 1;
  min-height: 120px;
  border-bottom: 1px solid var(--border);
}
.week-row.has-week-gutter {
  grid-template-columns: var(--gutter-w) repeat(6, 1fr);
}
.week-row:last-child { border-bottom: none; }

.holiday-row .day-cell { min-height: 80px; }

.holiday-day-num {
  color: var(--accent) !important;
}

/* ── Day view ──────────────────────────────────────────────────── */
#dayView {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.day-allday-strip {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--panel2);
  border-bottom: 1px solid var(--border);
}

.day-allday-label {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 0.1rem;
  white-space: nowrap;
  min-width: 50px;
}

.day-allday-events {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  flex: 1;
}

.day-time-grid {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.day-hour-row {
  display: flex;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  min-height: 60px;
}

.day-hour-row:last-child { border-bottom: none; }

.day-hour-label {
  width: 50px;
  min-width: 50px;
  padding: 0.35rem 0.5rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  border-right: 1px solid var(--border);
  text-align: right;
  background: var(--panel);
}

.day-hour-slot {
  flex: 1;
  padding: 0.3rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

/* ── Year view ─────────────────────────────────────────────────── */
#yearView {
  overflow-y: auto;
  padding: 1rem;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.year-mini-month {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.5rem;
}

.year-mini-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
  padding: 0 0.15rem;
}
.year-mini-title:hover { text-decoration: underline; }

.year-mini-dow {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin-bottom: 0.2rem;
}
.year-mini-dow > div {
  font-size: 0.6rem;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
}

.year-mini-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
}

.year-mini-holiday-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
}

.year-mini-cell {
  font-size: 0.68rem;
  text-align: center;
  padding: 0.18rem 0.1rem;
  border-radius: 3px;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.1s;
  line-height: 1.4;
}
.year-mini-cell:hover    { background: var(--panel2); color: var(--text); }
.year-mini-cell.weekend  { color: #6273a3; }
.year-mini-cell.today    { background: var(--accent); color: #fff; border-radius: 50%; }
.year-mini-cell.has-events::after {
  content: "";
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  margin: 1px auto 0;
}
.year-mini-cell.today::after { background: #fff; }

.year-mini-half {
  font-size: 0.62rem;
  text-align: center;
  padding: 0.1rem;
  color: var(--muted);
  cursor: pointer;
  line-height: 1.4;
}
.year-mini-half.today    { background: var(--accent); color: #fff; }
.year-mini-half.has-events::after {
  content: "";
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  margin: 0 auto;
}
.leap-accent { color: var(--accent) !important; }

/* ── Schedule view ─────────────────────────────────────────────── */
#scheduleView {
  overflow-y: auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.schedule-empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 2rem;
  text-align: center;
}

.schedule-date-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.75rem 0 0.3rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}
.schedule-date-header:first-child { border-top: none; margin-top: 0; }

.schedule-seth-date {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}
.schedule-seth-date.today-label { color: var(--accent); }

.schedule-greg-date {
  font-size: 0.78rem;
  color: var(--muted);
}

.schedule-event-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.35rem 0.5rem 0.35rem 0.75rem;
  margin: 0.15rem 0;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.1s;
}
.schedule-event-row:hover { background: var(--panel2); }

.schedule-time {
  font-size: 0.78rem;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  white-space: nowrap;
  min-width: 120px;
}

.schedule-title {
  font-size: 0.9rem;
  color: var(--text);
  flex: 1;
}

/* ── Utilities ─────────────────────────────────────────────────── */
.hidden { display: none !important; }

@media (max-width: 640px) {
  #calendarApp { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--border); max-height: 160px; }
  .day-cell { min-height: 60px; }
  .view-switcher { order: 3; width: 100%; justify-content: center; }
  .nav-search-wrap { order: 2; width: 100%; }
  .year-grid { grid-template-columns: repeat(2, 1fr); }
  .header-right { width: 100%; justify-content: space-between; }
  .header-clock { align-items: flex-start; min-width: 0; flex: 1; }
  .create-grid.two-col,
  .create-grid.seth-grid {
    grid-template-columns: 1fr;
  }
}
