/* Full-width responsive layout. */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--gap);
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar__brand { display: flex; align-items: center; gap: 8px; }
.topbar__logo { width: 26px; height: 26px; display: block; flex: none; }
.topbar__title { font-size: 1.05rem; margin: 0; }
.topbar__nav { display: flex; gap: var(--gap-sm); }
.topbar__nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-dim);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
}
.topbar__nav a.is-active { background: var(--accent); color: #fff; }
.tabicon {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tabicon__fill { fill: currentColor; stroke: none; }
.topbar__status {
  margin: 0 0 0 auto;
  font-size: var(--fs-xs);
  color: var(--text-dim);
  max-width: 40ch;
  text-align: right;
}
.topbar__acct {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.topbar__acct .acct-name { color: var(--text); font-size: var(--fs-sm); }
.topbar__acct .acct-initials { display: none; color: var(--text); font-size: var(--fs-sm); font-weight: 600; }
/* Sync status dot: green saved, amber saving/offline, red conflict/error. */
.sync { font-size: 0.7rem; line-height: 1; }
.sync--saved { color: #2e9e5b; }
.sync--saving, .sync--loading { color: #d99a2e; }
.sync--offline { color: #d99a2e; }
.sync--error { color: #c0392b; }
.sync--conflict { color: #c0392b; font-size: var(--fs-xs); }
.linkbtn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: var(--fs-xs);
  padding: 2px 4px;
}
.linkbtn:hover { text-decoration: underline; }
.app { padding: 16px; width: 100%; }

/* Offline / view-only banner. */
.ro-banner {
  background: #8a4b00;
  color: #fff;
  text-align: center;
  padding: 6px 12px;
  font-size: var(--fs-sm);
}
.ro-banner[hidden] { display: none; }

/* Sign-in screen (shown before an account is available). */
.signin {
  max-width: 30rem;
  margin: 12vh auto 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.signin__btn {
  align-self: center;
  padding: 10px 18px;
  font-size: var(--fs);
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.signin__btn:hover { filter: brightness(1.05); }

/* View header with prev/next nav */
.viewhead {
  display: flex;
  align-items: center;
  gap: var(--gap);
  margin-bottom: 12px;
}
.viewhead h2 { margin: 0; font-size: 1.15rem; min-width: 12ch; }
.viewhead button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  cursor: pointer;
  font-size: 1rem;
}
.viewhead button:hover { background: var(--surface-2); }
.viewhead .spacer { flex: 1; }
.viewhead__chk { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-sm); color: var(--text-dim); cursor: pointer; }

/* Monthly calendar grid: 7 day columns + trailing location column */
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr) 46px;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal__dow, .cal__loc-h {
  background: var(--surface-2);
  padding: 6px 4px;
  font-size: var(--fs-xs);
  text-align: center;
  font-weight: 600;
  color: var(--text-dim);
}
.cal__cell {
  background: var(--surface);
  min-height: 92px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cal__cell.is-free { background: var(--free-week); }
.cal__daynum { font-size: var(--fs-xs); color: var(--text-dim); }
.cal__loc {
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 640px) {
  .cal { grid-template-columns: repeat(7, 1fr) 30px; }
  .cal__cell { min-height: 64px; }
  .topbar__status { display: none; }
  /* Compact top bar: icon-only tabs, initials instead of the full name. */
  .tablabel { display: none; }
  .topbar__nav a { padding: 6px 8px; }
  .topbar__acct .acct-name { display: none; }
  .topbar__acct .acct-initials { display: inline; }
}
