/* when-2-meet-global — one accent colour, thin lines, lots of white space. */

:root {
  --bg: #ffffff;
  --ink: #14161a;
  --muted: #6f757e;
  --faint: #9aa1aa;
  --line: #e9ebef;
  --line-mid: #dcdfe5;
  --line-strong: #c8ccd4;
  --accent: #2f6bea;
  --accent-ink: #1b4bb5;
  --accent-8: rgba(47, 107, 234, 0.08);
  --accent-14: rgba(47, 107, 234, 0.14);
  --accent-22: rgba(47, 107, 234, 0.22);
  --now: #e0483b;
  --radius: 6px;
  --gutter: 104px;
  --row: 11px;          /* 15 minutes */
  --hour: 44px;
  --shadow: 0 1px 2px rgba(16, 20, 28, 0.05), 0 8px 28px rgba(16, 20, 28, 0.09);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}

button { font: inherit; color: inherit; }
input { font: inherit; color: inherit; }

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 28px 64px;
}

/* ------------------------------------------------------------------ header */

.hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

h1 {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.017em;
  margin: 0;
}

.hd-actions { display: flex; align-items: center; gap: 12px; }

.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.live i {
  width: 6px; height: 6px; border-radius: 50%;
  background: #2fae66;
  box-shadow: 0 0 0 3px rgba(47, 174, 102, 0.16);
}
.live.off i { background: var(--faint); box-shadow: none; }

.btn {
  border: 1px solid var(--line-mid);
  background: #fff;
  border-radius: var(--radius);
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.btn:hover { border-color: var(--line-strong); background: #fcfcfd; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 500;
}
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-quiet {
  border-color: transparent;
  color: var(--muted);
  padding: 5px 8px;
  background: none;
}
.btn-quiet:hover { background: #f4f5f7; border-color: transparent; color: var(--ink); }

/* ------------------------------------------------------------------- join */

.joinbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
  border: 1px solid var(--line-mid);
  border-radius: var(--radius);
  background: #fbfcfe;
}
.joinbar-label { color: var(--muted); }
.joinbar-label b { color: var(--ink); font-weight: 600; }
.joinbar .youdot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.joinbar .grow { flex: 1; }
.joinbar.joined { background: #fff; }
.joinbar.shake { animation: shake .3s; border-color: var(--accent); }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.input {
  border: 1px solid var(--line-mid);
  border-radius: var(--radius);
  padding: 7px 10px;
  min-width: 160px;
  outline: none;
  background: #fff;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-8); }

/* --------------------------------------------------------------- controls */

.controls {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.spacer { flex: 1 1 12px; }
.tzgroup { display: flex; align-items: flex-end; gap: 10px; min-width: 0; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label {
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--faint);
}

.fbtn {
  border: 1px solid var(--line-mid);
  background: #fff;
  border-radius: var(--radius);
  padding: 8px 12px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color .12s;
}
.fbtn:hover:not(:disabled) { border-color: var(--line-strong); }
.fbtn:disabled, .ibtn:disabled { color: var(--faint); background: #fafbfc; cursor: default; }
.fbtn[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-8); }
.fbtn .flag { margin-right: 7px; }
.fbtn .sub { color: var(--faint); margin-left: 8px; font-size: 12px; }

.nav { display: flex; align-items: stretch; gap: 0; }
.ibtn {
  border: 1px solid var(--line-mid);
  background: #fff;
  cursor: pointer;
  padding: 8px 11px;
  line-height: 1;
  color: var(--muted);
}
.ibtn:hover:not(:disabled) { background: #f7f8fa; color: var(--ink); }
.ibtn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.ibtn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.ibtn + .ibtn { border-left: 0; }
.ibtn-wide { padding-left: 14px; padding-right: 14px; }

.swap {
  align-self: flex-end;
  width: 34px; height: 34px;
  border: 1px solid var(--line-mid);
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  color: var(--muted);
  margin-bottom: 1px;
  transition: transform .18s, color .12s, border-color .12s;
}
.swap:hover { color: var(--accent); border-color: var(--accent); transform: rotate(180deg); }

/* ------------------------------------------------------------ timezone bar */

.tzbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fcfcfd;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tzside { min-width: 0; }
.tzside .city { font-size: 16px; font-weight: 550; letter-spacing: -0.01em; }
.tzside .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tzside .meta b { font-weight: 500; color: var(--ink); }
.tzrel {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 0 4px; min-width: 128px;
}
.tzrel .arrow { color: var(--accent); letter-spacing: .1em; font-size: 13px; line-height: 1; }
.tzrel .phrase { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tzbar .tzside:last-child { text-align: right; margin-left: auto; }

/* ------------------------------------------------------------------- grid */

.gridcard {
  border: 1px solid var(--line-mid);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.gridscroll {
  overflow: auto;
  max-height: min(64vh, 660px);
  overscroll-behavior: contain;
}
.gridinner { --tpl: var(--gutter) repeat(var(--n), minmax(76px, 1fr)); min-width: max-content; }

.ghead {
  display: grid;
  grid-template-columns: var(--tpl);
  position: sticky;
  top: 0;
  z-index: 4;
  background: #fff;
  border-bottom: 1px solid var(--line-mid);
}
.gbody {
  display: grid;
  grid-template-columns: var(--tpl);
  position: relative;
}

.corner {
  position: sticky; left: 0; z-index: 5;
  background: #fff;
  border-right: 1px solid var(--line-mid);
  padding: 8px 10px 8px 12px;
  display: flex; flex-direction: column; gap: 1px; justify-content: flex-end;
}
.corner .c1 { font-size: 11px; font-weight: 550; color: var(--ink); }
.corner .c2 { font-size: 11px; color: var(--accent); }
.corner .c2::before { content: "↳ "; color: var(--faint); }

.dhead {
  padding: 9px 10px 8px;
  border-left: 1px solid var(--line);
  text-align: center;
  min-width: 0;
}
.dhead .dow { font-size: 11px; color: var(--faint); letter-spacing: .04em; text-transform: uppercase; }
.dhead .dnum { font-size: 14px; font-weight: 550; margin-top: 1px; }
.dhead.today .dnum { color: var(--accent); }
.dhead.today .dow { color: var(--accent); }
.dhead.weekend { background: #fcfcfd; }

.gutter {
  position: sticky; left: 0; z-index: 3;
  background: #fff;
  border-right: 1px solid var(--line-mid);
}
.hr {
  position: absolute;
  right: 10px;
  transform: translateY(-8px);
  text-align: right;
  pointer-events: none;
  white-space: nowrap;
}
.hr .t1 { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.hr .t2 { display: block; font-size: 11px; color: var(--accent); opacity: .8; line-height: 1.2; }
.hr .t2 .shift { font-size: 9px; opacity: .75; margin-left: 2px; }
.hr.work .t1 { color: var(--ink); }
.hr.cwork .t2 { opacity: 1; font-weight: 500; }

.col {
  position: relative;
  border-left: 1px solid var(--line);
  touch-action: none;
  background-image:
    repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--hour));
  background-position: 0 0;
}
.col::after { /* quarter-hour hairlines, kept very light */
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(to bottom, rgba(0,0,0,.035) 0 1px, transparent 1px var(--row));
  opacity: .55;
}
.col.weekend { background-color: #fcfcfd; }

.band { position: absolute; left: 0; right: 0; pointer-events: none; }
.band.work { background: #fafbfc; box-shadow: inset 0 0 0 0 transparent; }
.band.cwork { left: 0; width: 3px; background: var(--accent-14); }
.band.gap {
  background-image: repeating-linear-gradient(135deg, #f2f3f5 0 4px, #fff 4px 8px);
  border-top: 1px dashed var(--line-strong);
  border-bottom: 1px dashed var(--line-strong);
  z-index: 1;
}
.band.now {
  height: 0; border-top: 1px solid var(--now); z-index: 6;
}
.band.now::before {
  content: ""; position: absolute; left: -3px; top: -3px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--now);
}

.heat { position: absolute; left: 0; right: 0; background: var(--accent); pointer-events: none; }
.lane { position: absolute; pointer-events: none; border-radius: 1px; }

.blk {
  position: absolute; left: 3px; right: 3px;
  background: var(--accent-14);
  border: 1px solid rgba(47,107,234,.42);
  border-radius: 4px;
  z-index: 2;
  padding: 3px 6px;
  overflow: hidden;
  pointer-events: none;
  cursor: pointer;
}
.blk .b1 { font-size: 11px; font-weight: 550; color: var(--accent-ink); line-height: 1.25; }
.blk .b2 { font-size: 10.5px; color: var(--accent); opacity: .85; line-height: 1.25; }
.blk .b1, .blk .b2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.blk.grp { background: none; border-width: 1.5px; }
.blk.grp .b1, .blk.grp .b2 {
  display: inline-block; background: rgba(255,255,255,.86);
  border-radius: 3px; padding: 0 3px; margin-left: -3px;
}
.blk.tiny { padding: 0 5px; }
.blk.tiny .b1 { font-size: 10px; line-height: 1.5; }
.blk.pending { border-style: dashed; }
.blk.erasing { background: #fff; border-color: var(--line-strong); }

.allfree {
  position: absolute; left: 2px; right: 2px;
  border: 1.5px solid #1f9d5c;
  background: rgba(31,157,92,.08);
  border-radius: 4px; z-index: 1; pointer-events: none;
}
.allfree .lbl {
  position: absolute; bottom: 2px; right: 5px;
  font-size: 10px; font-weight: 600; color: #157a46; white-space: nowrap;
  background: rgba(255,255,255,.86); border-radius: 3px; padding: 0 3px;
}

.hoverbox {
  position: absolute;
  background: rgba(47,107,234,.12);
  box-shadow: inset 0 0 0 1px rgba(47,107,234,.5);
  z-index: 5; pointer-events: none;
}
.rowline {
  position: absolute; right: 0; height: 0;
  border-top: 1px dashed rgba(47,107,234,.35);
  z-index: 4; pointer-events: none;
}
.railmark {
  position: absolute; z-index: 4;
  width: calc(var(--gutter) - 12px);
  text-align: right;
  pointer-events: none;
}
.railmark i {
  display: inline-block; font-style: normal;
  background: var(--accent); color: #fff;
  border-radius: 3px; padding: 1px 5px;
  font-size: 10.5px; line-height: 1.35; white-space: nowrap;
  box-shadow: 0 1px 4px rgba(47,107,234,.35);
}
.railmark i span { display: block; opacity: .82; font-size: 10px; }

/* --------------------------------------------------------------- below grid */

.note {
  margin: 10px 2px 0;
  font-size: 12px;
  color: var(--muted);
}
.note b { font-weight: 550; color: var(--ink); }

.below {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 26px;
  margin-top: 28px;
  align-items: start;
}
.below:has(.panel[hidden]) { grid-template-columns: minmax(0, 1fr); }

.panel { min-width: 0; }
.panel h2 {
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  margin: 0 0 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.panel h2 .tools { display: flex; gap: 2px; text-transform: none; letter-spacing: 0; }

.slots { display: flex; flex-direction: column; }
.slotrow {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 12px;
  padding: 9px 2px;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.slotrow:last-child { border-bottom: 1px solid var(--line); }
.slotrow .day { color: var(--muted); font-size: 13px; }
.slotrow .times { min-width: 0; }
.slotrow .p { font-variant-numeric: tabular-nums; }
.slotrow .c {
  color: var(--accent); font-size: 12.5px; margin-top: 1px;
  font-variant-numeric: tabular-nums;
}
.slotrow .c .z { color: var(--muted); }
.slotrow .dur { color: var(--faint); font-size: 12px; margin-left: 8px; }

.empty {
  color: var(--muted);
  border: 1px dashed var(--line-mid);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  font-size: 13px;
}
.total { margin-top: 10px; font-size: 12.5px; color: var(--muted); }

.people { display: flex; flex-direction: column; gap: 2px; }
.person {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: 5px; cursor: default;
}
.person:hover { background: #f7f8fa; }
.person .dot { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.person .nm { font-weight: 500; }
.person .tz { color: var(--muted); font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .amt { margin-left: auto; color: var(--faint); font-size: 12px; white-space: nowrap; }
.person.me .nm::after { content: " (you)"; color: var(--faint); font-weight: 400; }

.overlaps { display: flex; flex-direction: column; }
.ovrow { padding: 9px 2px; border-top: 1px solid var(--line); }
.ovrow:last-child { border-bottom: 1px solid var(--line); }
.ovrow .hdr { font-weight: 550; }
.ovrow .ln { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ovrow .ln b { color: var(--ink); font-weight: 500; }

.ft {
  margin-top: 40px;
  color: var(--faint);
  font-size: 12px;
  display: flex; gap: 8px; flex-wrap: wrap;
}
.ft-dot { opacity: .6; }

/* ---------------------------------------------------------------- overlays */

.tip {
  position: fixed;
  z-index: 60;
  background: #1b1e24;
  color: #fff;
  border-radius: 5px;
  padding: 7px 9px;
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: 0 6px 20px rgba(10, 14, 20, .22);
  white-space: nowrap;
}
.tip .r { display: flex; gap: 8px; justify-content: space-between; }
.tip .r + .r { margin-top: 1px; }
.tip .z { opacity: .62; }
.tip .who { margin-top: 5px; padding-top: 5px; border-top: 1px solid rgba(255,255,255,.16); opacity: .85; white-space: normal; max-width: 220px; }

.pop {
  position: fixed;
  z-index: 50;
  background: #fff;
  border: 1px solid var(--line-mid);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 12px;
  width: 320px;
  max-height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
}
.pop h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.pop .hint { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; }
.pop .row { display: flex; gap: 8px; align-items: center; }
.pop .row + .row { margin-top: 8px; }
.pop .sep { height: 1px; background: var(--line); margin: 12px -12px; }

.zsearch { width: 100%; margin-bottom: 8px; }
.zlist { overflow: auto; margin: 0 -6px; }
.zitem {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border-radius: 5px; cursor: pointer; width: 100%;
  border: 0; background: none; text-align: left;
}
.zitem:hover, .zitem.on { background: var(--accent-8); }
.zitem .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zitem .nm i { font-style: normal; color: var(--faint); font-size: 12px; margin-left: 6px; }
.zitem .tm { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.zitem.sel { box-shadow: inset 0 0 0 1px var(--accent-22); }
.znone { color: var(--muted); padding: 12px 8px; font-size: 13px; }

.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip {
  border: 1px solid var(--line-mid); background: #fff;
  border-radius: 20px; padding: 4px 11px; font-size: 12.5px; cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }

.cal { user-select: none; }
.calhd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.calhd .m { font-weight: 550; font-size: 13px; }
.calgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.cald { text-align: center; font-size: 10.5px; color: var(--faint); padding: 3px 0; }
.calc {
  border: 0; background: none; cursor: pointer;
  padding: 6px 0; font-size: 12.5px; border-radius: 4px; color: var(--ink);
}
.calc:hover { background: #f2f4f7; }
.calc.out { color: var(--faint); opacity: .55; }
.calc.in { background: var(--accent-8); border-radius: 0; }
.calc.edge { background: var(--accent); color: #fff; }
.calc.edge.s { border-radius: 4px 0 0 4px; }
.calc.edge.e { border-radius: 0 4px 4px 0; }
.calc.edge.s.e { border-radius: 4px; }
.calc.today { box-shadow: inset 0 0 0 1px var(--accent-22); }

.boards { display: flex; flex-direction: column; margin: 0 -6px; }
.boardrow {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border-radius: 5px; text-decoration: none; color: inherit;
}
.boardrow:hover { background: var(--accent-8); }
.boardrow .dot { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.boardrow .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boardrow .rg { color: var(--muted); font-size: 12px; white-space: nowrap; }

.linkrow { display: flex; gap: 8px; }
.linkrow .input { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); }

.toast {
  position: fixed;
  left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #1b1e24; color: #fff;
  padding: 9px 15px; border-radius: 6px; font-size: 13px;
  z-index: 70; box-shadow: 0 8px 26px rgba(10,14,20,.24);
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 720px) {
  .page { padding: 24px 14px 48px; }
  h1 { font-size: 21px; }
  :root { --gutter: 84px; }
  .below { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .tzbar { gap: 10px; }
  .tzrel { min-width: 92px; }
  .slotrow { grid-template-columns: 104px 1fr; }
  .pop { width: min(320px, calc(100vw - 24px)); }
}
