/* Look: blue enamel street signs and house-number plates */
:root {
  --ink: #15181d;
  --muted: #5b6270;
  --line: #c9ced8;
  --blue: #173f8f;
  --blue-dark: #0f2d6b;
  --soft: #f1f4fa;
  --plate: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  /* the white line just inside the edge of an enamel plate */
  --inset: inset 0 0 0 2px var(--blue), inset 0 0 0 3.5px rgba(255, 255, 255, .9);
  --pad: 14px;
  --wall: 6px;
  /* how far Shiny dims an output while the server works: 1 = not at all */
  --shiny-fade-opacity: 1;
}

body {
  margin: 0;
  background: #e9ecf1;
  color: var(--ink);
  font-family: "Barlow", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.kicker, .control-label {
  display: block;
  color: var(--muted);
  font-family: var(--plate);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.muted, .sub, .tokens { color: var(--muted); font-size: 14px; font-weight: 400; }
.sub { margin: 0 0 10px; }
.tokens { margin: 0; }

/* The sheet and its sign at the top */
.wrap {
  max-width: 880px;
  margin: 24px auto 48px;
  padding: 0 36px 36px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 14px rgba(20, 30, 60, .12);
  overflow: hidden;
}
.top {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 16px;
  margin: 0 -36px;
  padding: 28px 40px 24px;
  background: var(--blue);
  color: #fff;
}
.top::after, .login::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 5px;
  pointer-events: none;
}
.org { font-family: var(--plate); font-size: 16px; font-weight: 500; letter-spacing: .04em; opacity: .9; }
.display { margin: 0 0 8px; font-family: var(--plate); font-size: 38px; font-weight: 700; letter-spacing: .01em; line-height: 1.05; }
.stage {
  display: inline-block;
  padding: 0 8px;
  border: 1.5px solid #fff;
  border-radius: 3px;
  font-family: var(--plate);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.top .who { text-align: right; }
.top .kicker { color: rgba(255, 255, 255, .8); }
.top .flat { font-family: var(--plate); font-size: 28px; font-weight: 700; letter-spacing: .04em; line-height: 1.15; }
.links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 14px; margin-top: 4px; }
.top .link { color: #fff; }
.note {
  margin-top: 20px;
  padding: 10px 14px;
  background: var(--soft);
  border-left: 4px solid var(--blue);
  border-radius: 0 4px 4px 0;
  font-size: 15px;
}
/* section titles are street-name plates */
.sect {
  display: inline-block;
  margin: 30px 0 14px;
  padding: 4px 16px 5px;
  background: var(--blue);
  border-radius: 4px;
  box-shadow: var(--inset);
  color: #fff;
  font-family: var(--plate);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .03em;
}

/* Buttons and inputs */
/* no wait for a possible double tap on touch screens */
button { touch-action: manipulation; }
.btn { border-radius: 4px; font-family: var(--plate); font-size: 16px; font-weight: 600; letter-spacing: .03em; padding: 5px 16px; }
.btn-outline, .btn-default { background: #fff; border: 1.5px solid var(--blue); color: var(--blue); }
.btn-outline:hover, .btn-default:hover { background: var(--soft); border-color: var(--blue); color: var(--blue-dark); }
.btn-primary { background: var(--blue); border: 1.5px solid var(--blue); color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.link { background: none; border: 0; padding: 0; color: var(--blue); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--blue-dark); }
.form-control { border: 1.5px solid var(--blue); border-radius: 4px; background: #fff; }
.form-control:focus { border-color: var(--blue-dark); box-shadow: 0 0 0 3px rgba(23, 63, 143, .2); }

/* Fill stages: all free, a quarter taken, more, full */
.s0 { background: #fff; }
.s1 { background: #dfe7f6; }
.s2 { background: #a8bde6; }
.s3 { background: var(--blue); color: #fff; }

/* When: day strip and slots */
.days { position: relative; display: flex; overflow-x: auto; margin: 4px 0 12px; border: 1.5px solid var(--blue); border-radius: 4px; }
.day {
  flex: 0 0 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 0;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--plate);
  font-size: 15px;
}
.day:last-child { border-right: 0; }
.day .wd { font-weight: 600; }
.day span + span { font-size: 14px; }
.day.s3 { color: #fff; }
.day.on { box-shadow: inset 0 0 0 3px var(--ink); }
.seg {
  display: flex;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  margin: 4px 0 10px;
  border: 1.5px solid var(--blue);
  border-radius: 4px;
  overflow: hidden;
}
.seg button {
  padding: 7px 14px;
  background: #fff;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--plate);
  font-size: 16px;
  font-weight: 500;
}
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--blue); color: #fff; }
.seg button:disabled { color: #b4bac6; text-decoration: line-through; cursor: default; }

/* Search hits */
.hit {
  display: grid;
  grid-template-columns: 11em 1fr auto;
  align-items: center;
  gap: 6px 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.hit:last-child { border-bottom: 0; }
.hit-room { font-family: var(--plate); font-size: 18px; font-weight: 600; }
.hit-free { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip {
  padding: 4px 10px;
  background: #fff;
  border: 1.5px solid var(--blue);
  border-radius: 4px;
  color: var(--blue);
  font-family: var(--plate);
  font-size: 15px;
  font-weight: 600;
}
/* the machine just clicked, until the server's rendering takes it off the list */
.chip.mine { background: var(--blue); box-shadow: var(--inset); color: #fff; pointer-events: none; }
/* only where a pointer can hover: on touch screens the chip that moves under
   the finger would otherwise take the hover colour */
@media (hover: hover) {
  .chip:hover { background: var(--blue); color: #fff; }
}
.link.hide { padding: 0 4px; color: var(--muted); font-size: 18px; line-height: 1; text-decoration: none; }
.hidden-rooms { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; color: var(--muted); font-size: 14px; }

/* Calendar of one machine */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 8px; }
.cal-head { color: var(--muted); font-family: var(--plate); font-size: 13px; font-weight: 600; letter-spacing: .06em; text-align: center; text-transform: uppercase; }
.cal-day {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1.5px solid var(--blue);
  border-radius: 5px;
  color: var(--blue);
  font-family: var(--plate);
  font-size: 17px;
  font-weight: 600;
}
.cal-day.s2 { color: var(--blue-dark); }
.cal-day.s3 { color: #fff; }
.cal-day.off { background: none; border-color: transparent; color: #c2c8d4; font-weight: 500; }
.cal-day.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 12px 0 16px; color: var(--muted); font-size: 13px; }
.cal-legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 3px;
  vertical-align: -1px;
  border: 1.5px solid var(--blue);
  border-radius: 2px;
}
.cal-slots { margin-top: 6px; }
.slot-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  margin-top: 6px;
  padding: 6px 12px;
  border: 1.5px solid var(--blue);
  border-radius: 5px;
}
.slot-time { font-family: var(--plate); font-size: 18px; font-weight: 600; }
.slot-row.free .slot-time { color: var(--blue); }
.slot-who { font-weight: 500; }
.slot-row.free .slot-who { color: var(--muted); font-weight: 400; }
.slot-row.taken, .slot-row.mine { background: var(--blue); box-shadow: var(--inset); color: #fff; }
.slot-row.mine .slot-who::after { content: " · Ihre Reservation"; font-weight: 400; }

/* Login: one big sign */
.login {
  position: relative;
  width: calc(100% - 32px);
  max-width: 440px;
  margin: 10vh auto 0;
  padding: 34px 36px 30px;
  background: var(--blue);
  border-radius: 10px;
  box-shadow: 0 2px 14px rgba(20, 30, 60, .2);
  color: #fff;
}
.login .stage { margin-bottom: 22px; }
.login .control-label { color: rgba(255, 255, 255, .85); }
.login .shiny-input-container { width: 100%; }
.login .form-control { border-color: #fff; font-family: var(--plate); font-size: 24px; font-weight: 600; letter-spacing: .04em; }
.login .btn-primary { background: #fff; border-color: #fff; color: var(--blue); font-size: 18px; }
.login .btn-primary:hover, .login .btn-primary:focus { background: var(--soft); border-color: var(--soft); color: var(--blue-dark); }
.hint { margin: 14px 0 0; color: rgba(255, 255, 255, .85); font-size: 14px; }

/* My reservations */
.mine-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 6px 18px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.mine-row:last-child { border-bottom: 0; }
.big { min-width: 3.4em; font-family: var(--plate); font-size: 36px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.mine-what { font-weight: 600; }
.mine-actions { display: flex; gap: 8px; }

/* Rooms */
.rooms {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(124px, 1fr);
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 22px;
  padding: 2px;
}
.room {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 12px;
  background: #fff;
  border: 1.5px solid var(--blue);
  border-radius: 6px;
  color: var(--ink);
  text-align: left;
}
.room:hover { background: var(--soft); }
.room-name { color: var(--blue); font-family: var(--plate); font-size: 19px; font-weight: 700; }
.room .free { color: var(--muted); font-size: 14px; }
.room.active { background: var(--blue); box-shadow: var(--inset); color: #fff; }
.room.active .room-name { color: #fff; }
.room.active .free { color: #d5def2; }
.dots { display: grid; grid-template-columns: repeat(var(--cols), 8px); gap: 2px; margin: 2px 0; }
.dots i { width: 8px; height: 8px; border: 1px solid currentColor; border-radius: 1px; }
.dots i.on { background: var(--blue); border-color: var(--blue); }
.room.active .dots i.on { background: #fff; border-color: #fff; }

/* Floor plan */
.room-title { margin: 0 0 2px; font-family: var(--plate); font-size: 21px; font-weight: 700; }
.access { margin-left: 10px; color: var(--muted); font-family: "Barlow", sans-serif; font-size: 14px; font-weight: 400; }
.plan {
  position: relative;
  width: fit-content;
  max-width: 100%;
  padding: var(--pad);
  background: var(--soft);
  border: var(--wall) solid #2b3038;
  border-radius: 2px;
}
.plan-row { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 84px)); gap: 12px; }
.aisle { position: relative; height: 76px; }
/* door in the right wall: leaf, swing arc, gap in the wall */
.door {
  position: absolute;
  right: calc(-1 * var(--pad));
  top: 10px;
  width: 56px;
  height: 56px;
  border-top: 2px solid #2b3038;
  border-left: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  border-bottom-left-radius: 100%;
}
.door::after {
  content: "";
  position: absolute;
  right: calc(-1 * var(--wall));
  top: -2px;
  width: var(--wall);
  height: 58px;
  background: var(--soft);
}
/* machines are house-number plates */
.machine {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0 0 5px;
  background: #fff;
  border: 2px solid var(--blue);
  border-radius: 8px;
  color: var(--blue);
  line-height: 1.2;
}
.machine .nr {
  position: absolute;
  top: 6%;
  left: 50%;
  width: 54%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  font-family: var(--plate);
  font-size: 30px;
  font-weight: 700;
}
.machine .state { color: var(--muted); font-size: 12px; font-weight: 500; }
.machine .who { font-family: var(--mono); font-size: 10.5px; font-weight: 500; }
.machine.taken, .machine.mine { background: var(--blue); box-shadow: var(--inset); color: #fff; }
.machine.mine { outline: 3px solid var(--ink); outline-offset: 2px; }
.machine:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 3px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0; font-size: 14px; }
.legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  vertical-align: -1px;
  background: #fff;
  border: 2px solid var(--blue);
  border-radius: 3px;
}
.legend i.taken, .legend i.mine { background: var(--blue); }
.legend i.mine { outline: 2px solid var(--ink); outline-offset: 1px; }
.room-foot { max-width: 560px; }
.queue { margin-top: 18px; }
.queue ol { padding-left: 20px; margin: 6px 0 0; font-family: var(--mono); font-size: 14px; }

/* A row the user just removed, until the server's rendering arrives */
.gone { display: none; }
/* A button whose click is already shown as done */
.done { pointer-events: none; }

/* Usage table */
.report-scroll { overflow-x: auto; border-radius: 5px; }
.report { width: 100%; border-collapse: collapse; }
.report th, .report td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.report th {
  background: var(--blue);
  border-bottom: 0;
  color: #fff;
  font-family: var(--plate);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .03em;
  vertical-align: bottom;
  white-space: normal;
}
.report td { font-family: var(--mono); font-size: 13px; }
.report th:first-child, .report td:first-child { text-align: left; }
.report-scroll + .muted { margin-top: 10px; }

/* Dialogs and notifications */
.modal-content { border: 0; border-radius: 8px; overflow: hidden; }
.modal-header { background: var(--blue); border-bottom: 0; color: #fff; }
.modal-title { font-family: var(--plate); font-size: 22px; font-weight: 700; letter-spacing: .02em; }
.modal-footer { border-top: 1px solid var(--line); }
.shiny-notification {
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  opacity: 1;
  box-shadow: 0 2px 10px rgba(20, 30, 60, .15);
}

@media (max-width: 600px) {
  :root { --pad: 8px; }
  .container-fluid { padding: 0; }
  .wrap { margin: 0; padding: 0 16px 32px; border-radius: 0; box-shadow: none; }
  .top { grid-template-columns: 1fr; align-items: start; gap: 10px; margin: 0 -16px; padding: 24px 26px 20px; }
  .top .who { text-align: left; }
  .links { justify-content: flex-start; }
  .display { font-size: 29px; }
  .big { font-size: 30px; }
  .plan-row { gap: 6px; }
  .mine-row { grid-template-columns: auto 1fr; }
  .mine-actions { grid-column: 1 / -1; }
  .hit { grid-template-columns: 1fr auto; }
  /* fingers need more room than a mouse pointer: five machines per row,
     each as tall as a fingertip */
  .hit-free { display: grid; grid-template-columns: repeat(5, 1fr); grid-column: 1 / -1; grid-row: 2; }
  .hit-free > .muted { grid-column: span 3; align-self: center; }
  .chip { min-height: 44px; padding: 4px 2px; font-size: 16px; }
  .chip[data-action="wait"] { grid-column: span 2; }
  .link.hide { min-width: 44px; min-height: 36px; font-size: 22px; text-align: right; }
  .links { gap: 0 18px; }
  .links .link { padding: 8px 0; font-size: 15px; }
  .mine-actions .btn { flex: 1; min-height: 44px; }
  .slot-row .btn, .modal-footer .btn { min-height: 44px; }
  .machine { border-radius: 6px; }
  .machine .nr { font-size: 20px; }
  .machine .who, .machine .state { font-size: 10px; }
  .seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .seg button:nth-child(even) { border-right: 0; }
  .seg button:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .cal-day { font-size: 15px; }
  .login { padding: 30px 28px 26px; }
}
