:root {
  --brand: #0f6cbd;
  --brand-hover: #115ea3;
  --brand-tint: #ebf3fc;
  --event: #d6e9f8;
  --event-edge: #0f6cbd;
  --text: #242424;
  --text-2: #616161;
  --stroke: #e0e0e0;
  --line: #edebe9;
  --line-soft: #f3f2f1;
  --off: #faf9f8;
  --now: #d13438;
  --gutter: 76px;
  --hour: 64px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.16), 0 0 2px rgba(0, 0, 0, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #fff;
  color: var(--text);
  font-family: "Segoe UI", "Segoe UI Web (West European)", SegoeUI, -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
}

button, input { font-family: inherit; }

button {
  color: inherit;
}

button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.topbar {
  height: 48px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 12px 0 14px;
  border-bottom: 1px solid var(--stroke);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 148px;
  color: var(--brand);
}

.brand-mark { display: flex; }

.wordmark {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 560px;
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 8px;
  color: var(--text-2);
}

.search-wrap input {
  width: 100%;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #f5f5f5;
  padding: 0 12px 0 34px;
  font-size: 14px;
  color: var(--text);
}

.search-wrap input::placeholder { color: #707070; }

.search-wrap input:hover { background: #f0f0f0; }

.search-wrap input:focus {
  outline: none;
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

.avatar {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.workspace {
  flex: 1;
  min-height: 0;
  display: flex;
}

.rail {
  width: 48px;
  flex: none;
  border-right: 1px solid var(--stroke);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-top: 8px;
}

.rail-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #424242;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.rail-btn.is-current {
  background: var(--brand-tint);
  color: var(--brand);
}

.folder-pane {
  width: 248px;
  flex: none;
  border-right: 1px solid var(--stroke);
  padding: 16px 16px 20px;
  overflow: auto;
}

.pane-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 12px;
}

.mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
}

.mini-dow,
.mini-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.mini-dow span {
  text-align: center;
  font-size: 11px;
  color: var(--text-2);
  height: 24px;
  line-height: 24px;
}

.mini-day {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.mini-day span {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.mini-day.is-out { color: #a0a0a0; }

.mini-day.is-today span {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}

.cal-group {
  margin: 22px 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.cal-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  cursor: pointer;
  position: relative;
  user-select: none;
}

.cal-item input {
  position: absolute;
  opacity: 0;
  width: 16px;
  height: 16px;
}

.fake-check {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  background: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.fake-check::after {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(0, -1px);
}

.cal-item input:not(:checked) + .fake-check {
  background: #fff;
  box-shadow: inset 0 0 0 1px #616161;
}

.cal-item input:not(:checked) + .fake-check::after { content: none; }

.cal-item input:focus-visible + .fake-check {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.cal-name { font-size: 14px; }

.calendar-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.command-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.new-event {
  height: 32px;
  border: 0;
  border-radius: 4px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.new-event:hover { background: var(--brand-hover); }

.view-switch {
  display: flex;
  align-items: center;
  margin-left: 4px;
}

.view-btn,
.today-btn {
  height: 32px;
  border: 0;
  background: transparent;
  border-radius: 4px;
  padding: 0 10px;
  font-size: 14px;
  cursor: pointer;
}

.view-btn[aria-disabled="true"] { cursor: default; }

.view-btn.is-selected {
  background: var(--brand-tint);
  color: var(--brand);
  font-weight: 600;
}

.view-btn:hover:not(.is-selected),
.today-btn:hover { background: #f5f5f5; }

.today-btn { margin-left: auto; font-weight: 600; }

.cal-heading-bar {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px 12px;
}

.cal-heading-copy h1 {
  margin: 0;
  font-size: 28px;
  line-height: 34px;
  font-weight: 600;
  letter-spacing: -0.4px;
}

.subhead {
  margin: 2px 0 0;
  color: var(--text-2);
  font-size: 13px;
}

.sep { margin: 0 6px; }

.live-line {
  margin: 4px 0 0;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-line[hidden] { display: none; }

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--now);
  flex: none;
}

#clock {
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  font-size: 14px;
  padding-top: 8px;
}

.day-header,
.all-day {
  flex: none;
  display: flex;
  border-bottom: 1px solid var(--line);
}

.day-header .gutter {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding-bottom: 6px;
}

.gutter {
  width: var(--gutter);
  flex: none;
  color: var(--text-2);
  font-size: 11px;
  text-align: right;
  padding-right: 8px;
}

.day-header-date {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0 10px;
}

#dow {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
}

#dom {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.all-day { min-height: 32px; align-items: center; }

.all-day-label { line-height: 32px; }

.grid-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  position: relative;
}

.time-grid {
  position: relative;
  display: flex;
}

.time-col {
  width: var(--gutter);
  flex: none;
  position: relative;
  border-right: 1px solid var(--line);
}

.time-label {
  position: absolute;
  left: 0;
  width: 100%;
  padding-right: 8px;
  text-align: right;
  font-size: 12px;
  color: #424242;
  line-height: 16px;
  transform: translateY(-50%);
}

.time-label.is-first { transform: none; top: 2px; }

.time-label.is-covered { opacity: 0; }

.day-col {
  position: relative;
  flex: 1;
  min-width: 0;
}

#hour-rows { position: absolute; inset: 0; }

.hour-row {
  position: relative;
  border-top: 1px solid #e1dfdd;
}

.hour-row.is-off { background: var(--off); }

.hour-row::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid #e7e5e4;
}

#event-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.event {
  position: absolute;
  left: 4px;
  right: 4px;
  display: block;
  text-align: left;
  border: 0;
  border-radius: 4px;
  background: var(--event);
  box-shadow: inset 4px 0 0 var(--event-edge);
  color: var(--text);
  padding: 2px 8px 2px 10px;
  overflow: hidden;
  cursor: pointer;
  pointer-events: auto;
  z-index: 2;
}

.event:hover { background: #c7e1f6; }

.event.is-selected {
  background: #c5e0f6;
  outline: 1px solid var(--brand);
  outline-offset: -1px;
}

.event-title,
.event-time,
.event-by {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}

.event-time,
.event-by {
  font-size: 12px;
  line-height: 16px;
  color: #323130;
}

.event.size-s .event-time,
.event.size-s .event-by,
.event.size-m .event-by { display: none; }

#slot-ghost {
  position: absolute;
  left: 4px;
  right: 4px;
  z-index: 1;
  border-radius: 4px;
  background: rgba(15, 108, 189, 0.14);
  box-shadow: inset 0 0 0 1px var(--brand);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  pointer-events: none;
  overflow: hidden;
}

#slot-ghost[hidden] { display: none; }

.now-marker {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  pointer-events: none;
  transform: translateY(-50%);
}

.now-time {
  width: var(--gutter);
  flex: none;
  padding-right: 8px;
  text-align: right;
  color: var(--now);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  background: #fff;
}

.now-rule {
  position: relative;
  flex: 1;
  height: 2px;
  background: var(--now);
}

.now-rule::before {
  content: "";
  position: absolute;
  left: -1px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--now);
}

.peek {
  position: fixed;
  z-index: 30;
  width: 320px;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px 16px 14px;
  border-top: 4px solid var(--brand);
}

.peek[hidden] { display: none; }

.peek-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #424242;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.peek-close:hover { background: #f5f5f5; }

.peek h2 {
  margin: 0 28px 0 0;
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
}

.peek-badge {
  display: inline-block;
  margin: 8px 0 0;
  padding: 2px 8px;
  border-radius: 4px;
  background: #f0f0f0;
  font-size: 12px;
  font-weight: 600;
}

.peek-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.peek-list li {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 18px;
}

#peek-by { font-weight: 600; }

.noscript {
  padding: 16px;
}

@media (max-width: 980px) {
  .rail, .folder-pane { display: none; }
  .cal-heading-copy h1 { font-size: 24px; }
}
