/* Modeled on Google Calendar's 2024+ (Material 3) look: pale blue-grey page,
   the week sitting in a white card with big rounded corners, Google Sans. */
:root {
  --page: #f8fafd;
  --card: #fff;
  --text: #1f1f1f;
  --text-2: #444746;
  --muted: #70757a;
  --line: #dde3ea;
  --blue: #0b57d0;
  --blue-soft: #c2e7ff;
  --hover: rgba(68, 71, 70, .08);
  --red: #ea4335;
  --font: 'Google Sans', Roboto, Arial, sans-serif;
  --font-text: Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
button { font-family: inherit; color: inherit; }
svg { fill: currentColor; }
a { color: inherit; }

/* ---------- top bar ---------- */
.topbar {
  height: 64px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 16px 8px 12px;
}
.icon-btn {
  width: 40px; height: 40px;
  border: 0; background: none; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-2); cursor: pointer; flex: none;
}
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn.small { width: 32px; height: 32px; }
.icon-btn.small svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--hover); }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 40px 0 12px; }
.logo {
  width: 36px; height: 36px; border-radius: 8px;
  background: linear-gradient(135deg, #4285f4, #1a73e8);
  display: grid; place-items: center;
  font: 500 17px/1 var(--font); color: #fff;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12);
}
.brand-name { font-size: 22px; color: var(--text-2); letter-spacing: -.2px; }
.pill {
  height: 40px; padding: 0 24px;
  border: 1px solid #747775; border-radius: 20px;
  background: transparent; font-weight: 500; font-size: 14px; cursor: pointer; margin-right: 16px;
}
.pill:hover { background: var(--hover); }
.pill.select { display: flex; align-items: center; gap: 6px; padding: 0 12px 0 18px; margin: 0 8px; }
.pill.select svg { width: 20px; height: 20px; }
h1 { font-size: 22px; font-weight: 400; margin: 0 0 0 12px; white-space: nowrap; color: var(--text); }
.spacer { flex: 1; }
.seg { display: flex; border: 1px solid #747775; border-radius: 20px; overflow: hidden; margin: 0 12px 0 4px; }
.seg button { width: 52px; height: 38px; border: 0; background: none; display: grid; place-items: center; color: var(--text-2); }
.seg button + button { border-left: 1px solid #747775; }
.seg button.on { background: var(--blue-soft); color: #001d35; }
.seg svg { width: 20px; height: 20px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #f4511e; color: #fff;
  display: grid; place-items: center; font-weight: 500; margin-left: 8px; flex: none;
}

/* ---------- layout ---------- */
.body { flex: 1; display: flex; min-height: 0; }
.sidebar { width: 256px; flex: none; padding: 8px 12px 0 16px; overflow: hidden; display: flex; flex-direction: column; }
.create {
  display: flex; align-items: center; gap: 12px; align-self: flex-start;
  height: 56px; padding: 0 16px 0 16px;
  border: 0; border-radius: 16px;
  background: #fff; cursor: pointer;
  box-shadow: 0 1px 3px 0 rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
  font-weight: 500; font-size: 14px; color: var(--text);
}
.create svg { width: 24px; height: 24px; }
.create svg:last-child { width: 18px; height: 18px; margin-left: 4px; color: var(--text-2); }
.create:hover { background: #f0f4f9; }

.mini { margin: 26px 0 14px 4px; user-select: none; }
.mini-head { display: flex; align-items: center; padding: 0 0 6px 4px; font-weight: 500; font-size: 14px; }
.mini-head .spacer { flex: 1; }
.mini-head svg { width: 20px; height: 20px; color: var(--text-2); margin-left: 10px; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; font-size: 10px; text-align: center; font-weight: 500; }
.mini-grid span { width: 24px; height: 24px; line-height: 24px; border-radius: 50%; margin: 0 auto; color: var(--text); }
.mini-grid .dow { color: var(--text-2); }
.mini-grid .other { color: var(--muted); font-weight: 400; }
.mini-grid .today { background: var(--blue); color: #fff; }

.people {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 16px;
  background: #e9eef6; border-radius: 4px; color: var(--text-2); margin: 8px 0 14px;
}
.people svg { width: 20px; height: 20px; }
.side-head { display: flex; align-items: center; gap: 4px; font-weight: 500; font-size: 16px; padding: 10px 0 8px 12px; }
.side-head span { margin-left: auto; display: grid; place-items: center; color: var(--text-2); }
.side-head span + span { margin-left: 8px; }
.side-head svg { width: 22px; height: 22px; }
.cal-list label { display: flex; align-items: center; gap: 14px; height: 32px; padding-left: 12px; font-size: 14px; font-family: var(--font-text); }
.check {
  width: 18px; height: 18px; border-radius: 3px; background: var(--c);
  position: relative; flex: none;
}
.check::after {
  content: ''; position: absolute; left: 6px; top: 2px; width: 4px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.side-foot { margin-top: auto; padding: 10px 12px 12px; font-size: 12px; color: var(--text-2); line-height: 1.8; }

/* ---------- week card ---------- */
.week {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  background: var(--card); border-radius: 28px; margin: 0 0 16px; overflow: hidden;
}
.week-head { display: flex; flex: none; padding-top: 8px; }
.gutter { width: 64px; flex: none; display: flex; align-items: flex-end; padding: 0 8px 4px 0; justify-content: flex-end; }
.gutter span { font-size: 10px; color: var(--text-2); }
.days { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); margin-right: 12px; }
.day-head { text-align: center; padding: 6px 0 10px; position: relative; }
.day-head::after { content: ''; position: absolute; left: 0; bottom: 0; height: 12px; border-left: 1px solid var(--line); }
.day-head .dow { font-size: 11px; font-weight: 500; color: var(--text-2); letter-spacing: .8px; }
.day-head .num {
  width: 46px; height: 46px; margin: 4px auto 0; border-radius: 50%;
  display: grid; place-items: center; font-size: 26px; color: var(--text);
}
.day-head.today .dow { color: var(--blue); }
.day-head.today .num { background: var(--blue); color: #fff; }
.day-head.past .num { color: var(--text-2); }

.grid { flex: 1; min-height: 0; display: flex; position: relative; margin: 0 12px 12px 0; }
.hours { width: 64px; flex: none; position: relative; }
.hours span {
  position: absolute; right: 16px; font-size: 10px; color: var(--text-2);
  transform: translateY(-50%);
}
.cols { flex: 1; position: relative; }
.lines { position: absolute; inset: 0; pointer-events: none; }
.lines .h { position: absolute; left: -8px; right: 0; border-top: 1px solid var(--line); }
.lines .v { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); }
#layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.now { position: absolute; height: 2px; background: var(--red); pointer-events: none; z-index: 3; }
.now-dot {
  position: absolute; left: -6px; top: -5px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--red);
}

/* ---------- side rail ---------- */
.rail { width: 56px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 22px; padding-top: 18px; }
.rail .app { width: 22px; height: 22px; color: var(--c); display: grid; place-items: center; }
.rail .app svg { width: 22px; height: 22px; }
.rail-sep { width: 20px; border-top: 1px solid #c4c7c5; }

@media (max-width: 1000px) {
  .sidebar, .rail, .brand-name, h1, .pill.select, .seg { display: none; }
  .week { margin: 0 8px 8px; }
}

/* ---------- invite / play button ---------- */
.invite {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 16px;
  background: #fff; border-radius: 12px; padding: 14px 14px 14px 18px;
  box-shadow: 0 4px 8px 3px rgba(60,64,67,.15), 0 1px 3px rgba(60,64,67,.3);
  z-index: 20; min-width: 380px;
  transition: opacity .3s, transform .3s;
}
.invite.gone { opacity: 0; transform: translate(-50%, 20px); pointer-events: none; }
.invite-icon { width: 40px; height: 40px; border-radius: 50%; background: #e8f0fe; color: var(--blue); display: grid; place-items: center; }
.invite-icon svg { width: 22px; height: 22px; }
.invite-text { flex: 1; }
.invite-title { font-weight: 500; font-size: 15px; }
.invite-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.invite-join {
  border: 0; background: var(--blue); color: #fff; font-weight: 500;
  height: 36px; padding: 0 24px; border-radius: 18px; cursor: pointer;
}
.invite-join:hover { background: #1765cc; }
.invite-join:disabled { background: #dadce0; color: #80868b; cursor: default; }

/* ---------- notification toasts ---------- */
.toasts { position: fixed; right: 20px; top: 76px; display: flex; flex-direction: column; gap: 10px; z-index: 30; }
.toast {
  width: 340px; background: #fff; border-radius: 10px; padding: 12px 14px;
  box-shadow: 0 4px 8px 3px rgba(60,64,67,.15), 0 1px 3px rgba(60,64,67,.3);
  display: flex; gap: 12px; align-items: flex-start;
  animation: toast-in .35s cubic-bezier(.2,.8,.2,1);
}
.toast.out { animation: toast-out .35s forwards; }
.toast .ti { width: 24px; height: 24px; flex: none; border-radius: 5px; background: #fff; border: 2px solid #4285f4; border-top-width: 6px; }
.toast .tt { font-size: 12px; color: var(--muted); }
.toast .tb { font-size: 14px; margin-top: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px); } }

/* ---------- settings ---------- */
.settings {
  position: fixed; right: 80px; top: 60px; z-index: 40;
  width: 300px; background: #fff; border-radius: 8px; padding: 12px 16px;
  box-shadow: 0 4px 8px 3px rgba(60,64,67,.15), 0 1px 3px rgba(60,64,67,.3);
  font-size: 13px;
}
.settings-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; }
.settings-row label { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: space-between; }
.settings-row input[type=range] { width: 120px; }
.dim { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.file-btn { justify-content: center !important; border: 1px solid var(--line); border-radius: 16px; padding: 6px; cursor: pointer; }
.file-btn:hover { background: var(--hover); }
.detail-hint { padding: 0 0 4px 96px; font-size: 11px; max-width: none; }
.hint { color: var(--muted); font-size: 12px; padding-top: 6px; }
.stats { font-size: 11px; padding-top: 4px; max-width: none; }

.drop {
  position: fixed; inset: 0; z-index: 50; background: rgba(26,115,232,.12);
  border: 4px dashed var(--blue); display: grid; place-items: center;
  font-size: 28px; color: var(--blue); font-weight: 500;
}

@media (max-width: 900px) {
  .sidebar, .brand-name, h1, .pill.select { display: none; }
  .invite { min-width: 0; width: calc(100% - 32px); }
}
