:root { --accent: #8e1eec; }

/* Light is default */
html[data-theme="light"] {
  --bg: #f4f6fb;
  --text: #0e1320;
  --muted: #51607a;
  --border: rgba(14, 19, 32, 0.12);

  --panelBg: #ffffff;
  --headerBg: #ffffff;

  --modalBg: #ffffff;
  --modalBorder: rgba(14, 19, 32, 0.18);

  --btnBg: rgba(14, 19, 32, 0.06);
  --btnBgHover: rgba(14, 19, 32, 0.10);
  --btnBorder: rgba(14, 19, 32, 0.16);
}

html[data-theme="dark"] {
  --bg: #0b0f1a;
  --text: #e7eaf0;
  --muted: #a7b0c0;
  --border: rgba(255, 255, 255, 0.10);

  --panelBg: #111827;
  --headerBg: #0f172a;

  --modalBg: #111827;
  --modalBorder: rgba(255, 255, 255, 0.12);

  --btnBg: rgba(255,255,255,0.08);
  --btnBgHover: rgba(255,255,255,0.12);
  --btnBorder: rgba(255,255,255,0.14);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg); /* SOLID ONLY */
}

a { color: inherit; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 24px; }

header.site {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--headerBg); /* SOLID */
  border-bottom: 1px solid var(--border);
}

header.site .inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.brand .brand-logo {
  width: auto;
  height: clamp(48px, 6vw, 64px);
  object-fit: contain;
}

.brand .title { line-height: 1.1; }
.brand .title strong { display: block; font-size: 15px; letter-spacing: 0.3px; }
.brand .title span { display: block; font-size: 12px; color: var(--muted); }

header.site .right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.iconBtn {
  border: 1px solid var(--btnBorder);
  background: var(--btnBg);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
}

.iconBtn:hover { background: var(--btnBgHover); }

.pill {
  border: 1px solid var(--btnBorder);
  background: var(--btnBg); /* SOLID */
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
}

h1 { margin: 0 0 6px; font-size: 42px; }
.sub { margin: 0 0 18px; color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
}

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

  .brand {
    min-width: 0;
    flex: 1;
  }

  .brand .title strong { font-size: 13px; }
  .brand .title span { font-size: 11px; }
}

.panel {
  background: var(--panelBg); /* SOLID */
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.panel .hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.panel .hd h2 { margin: 0; font-size: 18px; }

.panel .bd {
  padding: 14px 16px 16px;
}

.small { font-size: 12px; color: var(--muted); }

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

.calMonth {
  font-size: 12px;
  color: var(--muted);
  min-width: 120px;
  text-align: center;
}

/* Native calendar styles (for the JS calendar renderer) */
.cal .calGrid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.cal .dow {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 6px 0;
}

.cal .cell {
  min-height: 92px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cal .date {
  font-size: 12px;
  color: var(--muted);
}

.cal .pillEvent {
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list .row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

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

.list .row .t { font-weight: 650; }
.list .row .m { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Modal */
.modalOverlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  z-index: 50;
  padding: 18px;
}

.modal {
  width: min(720px, 100%);
  max-height: 85vh;
  overflow: auto;
  background: var(--modalBg); /* SOLID */
  border: 1px solid var(--modalBorder);
  border-radius: 16px;
  padding: 16px;
}

.modal .top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.modal h3 { margin: 0; font-size: 18px; }
.modal .subline { margin: 4px 0 0; font-size: 12px; color: var(--muted); }

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