/* Shared look for the sandbox pages under /try/: the revenue desk, the booking sites, housekeeping and
 * the day's takings. One stylesheet for all of them, because they are the same kind of thing - a score
 * strip, a board of rows, and a panel of reasons - and four copies of that would drift apart.
 *
 * Every colour here is a theme token, so the boards follow light and dark with the rest of the site.
 * The boards stretch to the width they are given: no empty band down the side of a sandbox.
 */

/* ---------------------------------------------------------------- shell */

.sbx-plain { max-width: 62ch; }
.js .sbx-plain { display: none; }

.sbx { display: grid; gap: var(--s-4); }

.sbx-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}
.sbx-place { margin: 0; font-weight: 600; display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.sbx-tools { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.sbx-note { margin: 0; color: var(--muted); font-size: var(--fs--1); }
.sbx-foot { margin: 0; color: var(--muted); font-size: var(--fs--1); max-width: 70ch; }
.sbx-msg { margin: 0; font-size: var(--fs--1); color: var(--muted); min-height: 1.3em; }

/* ---------------------------------------------------------------- the score strip, above the board */

.sbx-score {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: var(--s-3) var(--s-4);
  display: grid;
  gap: var(--s-2);
}
.sbx-score__grid {
  margin: 0;
  display: grid;
  gap: var(--s-3);
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}
.sbx-score__grid > div { display: grid; gap: 0.15rem; align-content: start; }
.sbx-score dt { color: var(--muted); font-size: var(--fs--1); }
.sbx-score dd { margin: 0; font-size: 1.3rem; font-weight: 650; line-height: 1.15; }
.sbx-score__move { font-size: var(--fs--1) !important; font-weight: 600 !important; color: var(--muted); }
.sbx-score__move.is-up { color: var(--live-fg); }
.sbx-score__move.is-down { color: var(--built-fg); }

/* ---------------------------------------------------------------- a board of rows */

.sbx-nights { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }

.sbx-night {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: var(--s-3);
  display: grid;
  gap: var(--s-3);
  grid-template-columns: 5rem minmax(0, 1fr) minmax(0, 16rem);
  align-items: start;
}
.sbx-night.is-done { background: var(--surface-2); }

.sbx-night__when { display: grid; gap: 0.1rem; }
.sbx-night__day { font-weight: 700; }
.sbx-night__nth { color: var(--muted); font-size: var(--fs--1); }

.sbx-night__facts {
  margin: 0;
  display: grid;
  gap: var(--s-2) var(--s-3);
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  align-items: start;
}
.sbx-fact { display: grid; gap: 0.1rem; align-content: start; }
.sbx-fact b { color: var(--muted); font-size: var(--fs--1); font-weight: 500; }
.sbx-fact span { font-weight: 600; }
.sbx-fact--wide { grid-column: 1 / -1; }

.sbx-bar { height: 0.4rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; margin-top: 0.3rem; }
.sbx-bar > i { display: block; height: 100%; background: var(--accent); }

.sbx-chip {
  display: inline-block;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: var(--fs--1);
  font-weight: 600;
  border: 1px solid var(--planned-line);
  background: var(--planned-bg);
  color: var(--planned-fg);
}
.sbx-chip--event { border-color: var(--built-line); background: var(--built-bg); color: var(--built-fg); }
.sbx-chip--ahead { border-color: var(--live-line); background: var(--live-bg); color: var(--live-fg); }
.sbx-chip--full { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-hover); }

/* ---------------------------------------------------------------- the idea, on the right of the row */

.sbx-idea { display: grid; gap: var(--s-2); }
.sbx-idea__head { display: flex; align-items: baseline; gap: var(--s-2); flex-wrap: wrap; }
.sbx-idea__to { font-size: 1.2rem; font-weight: 700; }
.sbx-idea__from { color: var(--muted); font-size: var(--fs--1); text-decoration: line-through; }
.sbx-idea__none { color: var(--muted); font-size: var(--fs--1); margin: 0; }
.sbx-idea__row { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: end; }
.sbx-idea__price { display: grid; gap: 0.2rem; }
.sbx-idea__price span { color: var(--muted); font-size: var(--fs--1); }
.sbx-idea__price input { width: 6.5rem; }
.sbx-idea__said { margin: 0; font-size: var(--fs--1); color: var(--muted); }

.sbx-why { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.35rem; }
.sbx-why li { font-size: var(--fs--1); color: var(--muted); padding-left: 0.9rem; position: relative; }
.sbx-why li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 0.3rem;
  height: 0.3rem;
  border-radius: 999px;
  background: var(--line-strong);
}

.sbx-x {
  border: 1px solid var(--line-strong);
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.55rem;
  font: inherit;
  font-size: var(--fs--1);
  cursor: pointer;
  color: var(--muted);
}
.sbx-x:hover { color: var(--ink); border-color: var(--ink-2); }

/* ---------------------------------------------------------------- the rules, and the strip of sandboxes */

.sbx-rules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-3);
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}
.sbx-rules li {
  display: grid;
  gap: 0.25rem;
  align-content: start;
  border-top: 2px solid var(--accent);
  padding-top: var(--s-2);
}
.sbx-rules b { font-size: var(--fs--1); text-transform: uppercase; letter-spacing: 0.04em; }
.sbx-rules span { color: var(--muted); }

.sbx-more__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-3);
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}
.sbx-more__item > a,
.sbx-more__item > div {
  display: grid;
  gap: 0.3rem;
  height: 100%;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s-3);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
}
.sbx-more__item > a:hover { border-color: var(--accent); }
.sbx-more__item b { font-weight: 650; }
.sbx-more__item span { color: var(--muted); font-size: var(--fs--1); }
.sbx-more__item.is-here > div { background: var(--surface-2); border-style: dashed; }

/* ---------------------------------------------------------------- narrow screens */

@media (max-width: 860px) {
  .sbx-night { grid-template-columns: 4.5rem minmax(0, 1fr); gap: var(--s-2); }
  .sbx-idea { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: var(--s-2); }
}
@media (max-width: 480px) {
  .sbx-night { grid-template-columns: minmax(0, 1fr); }
  .sbx-night__when { display: flex; gap: var(--s-2); align-items: baseline; }
}

.sbx-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }

/* ---------------------------------------------------------------- the running account */

.sbx-log { display: grid; gap: var(--s-2); }
.sbx-log h3 { margin: 0; font-size: var(--fs-1); }
.sbx-logs { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.sbx-logline {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: var(--s-2);
  align-items: baseline;
  font-size: var(--fs--1);
  border-left: 3px solid var(--line);
  padding: 0.25rem var(--s-2);
}
.sbx-logline b { color: var(--muted); font-weight: 600; }
.sbx-logline--ok { border-left-color: var(--live-line); }
.sbx-logline--warn { border-left-color: var(--built-line); }
.sbx-logline--you { border-left-color: var(--accent); }

/* ---------------------------------------------------------------- the arrival: checks and the code */

.sbx-check { grid-template-columns: 4rem minmax(0, 1fr); align-items: start; }
.sbx-check__body { display: grid; gap: 0.2rem; }
.sbx-check__body b { font-weight: 650; }
.sbx-check__body span { color: var(--muted); font-size: var(--fs--1); }

.sbx-key {
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
  padding: var(--s-4);
  display: grid;
  gap: var(--s-2);
}
.sbx-key h3 { margin: 0; font-size: var(--fs-1); }
.sbx-key__code { margin: 0; font-size: 2.2rem; font-weight: 700; letter-spacing: 0.12em; line-height: 1.1; }
.sbx-key__opens { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.sbx-key__opens li {
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: var(--fs--1);
  font-weight: 600;
  background: var(--surface);
}

@media (max-width: 480px) {
  .sbx-check { grid-template-columns: minmax(0, 1fr); }
}

/* A booking site's name is longer than a weekday, so its board gets a wider first column. */
.sbx-night--site { grid-template-columns: 9.5rem minmax(0, 1fr) minmax(0, 13rem); }
@media (max-width: 860px) {
  .sbx-night--site { grid-template-columns: 9.5rem minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .sbx-night--site { grid-template-columns: minmax(0, 1fr); }
}
