:root {
  /* Colors */
  --color-bg: #fbfaf7;
  --color-text: #1f2a2e;
  --color-text-muted: #5d6b6f;
  --color-border: #cfd2ca;
  --color-success: #2c6e4b;
  --color-success-bg: #e6efe6;
  --color-danger: #8c2f45;

  /* Layout */
  --content-width: 54rem;
  --text-width: 62ch;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;

  /* Typography */
  --font-sans: "Segoe UI", system-ui, Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;

  background: var(--color-bg);
  color: var(--color-text);

  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* Typography */

h1,
h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

h1 {
  font-size: 1.75rem;
}

p,
ol {
  max-width: var(--text-width);
  margin: 0 0 1rem;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

ol li {
  margin-bottom: 0.6rem;
}

a {
  color: inherit;
}

dd {
  margin: 0;
  font-weight: 600;
}

label {
  display: block;
  margin-bottom: 0.3rem;
}

summary {
  cursor: pointer;
  list-style: none;
}

/* Accessibility */

:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;

  width: 1px;
  height: 1px;
  margin: -1px;

  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;

  padding: 0.5rem 1rem;

  background: var(--color-bg);
  border: 1px solid var(--color-text);
}

.skip-link:focus {
  top: 1rem;
}

/* Layout */

.wrap {
  width: min(100%, var(--content-width));
  margin-inline: auto;
  padding-inline: 1.5rem;
}

main.wrap {
  flex: 1;
  padding-block: 3rem 4rem;
}

header {
  border-bottom: 1px solid var(--color-border);
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;

  gap: 0.5rem 1.5rem;
  padding-block: 1.25rem;
}

.logo {
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: 1.375rem;
  text-decoration: none;
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1.25rem;
}

nav a {
  padding-bottom: 0.15rem;

  border-bottom: 1px solid transparent;

  color: var(--color-text-muted);
  font-size: 0.9375rem;
  text-decoration: none;
}

nav a:is(:hover, [aria-current="page"]) {
  border-bottom-color: var(--color-text);
  color: var(--color-text);
}

.user {
  margin-left: auto;
  white-space: nowrap;
}

footer {
  padding-block: 1.25rem;

  border-top: 1px solid var(--color-border);

  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

/* Utilities */

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.meta {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* Buttons */

.button {
  display: inline-block;
  padding: 0.6rem 1.25rem;

  background: var(--color-text);
  border: 1px solid var(--color-text);

  color: var(--color-bg);
  font: inherit;
  font-size: 0.9375rem;
  text-decoration: none;
}

.button:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.button-quiet {
  padding: 0.35rem 0.8rem;

  background: transparent;
  border-color: var(--color-border);

  color: var(--color-text);
  font-size: 0.875rem;
}

/* Forms */

:is(
  input[type="date"],
  input[type="time"],
  input[type="text"],
  select,
  textarea
) {
  width: min(100%, 34rem);
  padding: 0.5rem 0.6rem;

  background: var(--color-bg);
  border: 1px solid var(--color-border);

  color: var(--color-text);
  font: inherit;
  font-size: 0.9375rem;
}

fieldset {
  margin: 0 0 1.75rem;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.option {
  display: flex;
  align-items: center;
  gap: 0.6rem;

  margin-bottom: 0.5rem;

  accent-color: var(--color-text);
  cursor: pointer;
}

/* Messages */

.note {
  max-width: var(--text-width);
  margin: 0 0 1.5rem;
  padding-left: 1rem;

  border-left: 2px solid var(--color-border);
}

.success {
  max-width: var(--text-width);
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;

  background: var(--color-success-bg);
  border: 1px solid var(--color-success);
}

/* Desks */

.desks {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.desks-compact {
  grid-template-columns: repeat(2, 1fr);
}

.desk {
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-success);
}

.desk-partial {
  border-left-style: dashed;
}

.desk-full {
  border-left-color: var(--color-danger);
}

.desk-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;

  gap: 0.4rem 1.5rem;
  padding: 0.9rem 1.1rem;
}

.desk-name {
  flex: 0 0 5.5rem;
  font-weight: 600;
}

.desk-action {
  margin-left: auto;
  text-decoration: underline;
}

.desk-form {
  padding: 1.25rem 1.1rem;
  border-top: 1px solid var(--color-border);
}

.status {
  color: var(--color-success);
  font-size: 0.875rem;
  font-weight: 600;
}

.status-taken {
  color: var(--color-danger);
}

/* Bookings */

.bookings {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.booking {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;

  gap: 0.5rem 1.5rem;
  padding: 1.25rem 0;

  border-top: 1px solid var(--color-border);
}

.booking h2 {
  margin: 0;
}

.booking-when {
  flex: 1 1 12rem;
}

.booking-actions,
.booking-note {
  flex-basis: 100%;
}

.booking-actions {
  align-items: flex-start;
}

/* Facts */

.facts {
  max-width: 26rem;
}

.facts div {
  display: flex;
  justify-content: space-between;
  gap: 2rem;

  padding: 0.6rem 0;

  border-bottom: 1px solid var(--color-border);
}

/* Tables */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

th,
td {
  padding: 0.75rem 1rem 0.75rem 0;

  border-bottom: 1px solid var(--color-border);

  text-align: left;
}