@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/inter-latin-variable.woff2") format("woff2");
}

@font-face {
  font-family: "Oswald";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/oswald-700.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/barlow-condensed-600.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/barlow-condensed-700.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --red: #ee1c24;
  --red-deep: #c8141b;
  --red-soft: #fce3e5;
  --black: #0a0a0a;
  --ink: #1a1a1a;
  --graphite: #2b2b2b;
  --white: #fff;
  --paper: #fafafa;
  --fog: #f2f2f2;
  --line: #e5e5e5;
  --muted: #6b6b6b;
  --success: #1f8a4c;
  --warning: #8a5700;
  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-sub: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --container: 1240px;
  --gutter: clamp(20px, 4vw, 56px);
  --shadow-1: 0 1px 2px rgb(10 10 10 / 6%);
  --shadow-2: 0 6px 18px rgb(10 10 10 / 10%);
  --shadow-3: 0 18px 40px rgb(10 10 10 / 16%);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 88px;
  padding: 12px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  background: var(--black);
  color: var(--white);
  border-bottom: 3px solid var(--red);
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--white);
  text-decoration: none;
}

.brand:hover {
  color: var(--white);
}

.brand-logo {
  display: block;
  width: 190px;
  height: auto;
}

.brand-app {
  padding-left: 18px;
  border-left: 1px solid #555;
  font-family: var(--font-sub);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-header nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}

.site-header nav a {
  padding: 8px 0;
  color: #ddd;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 120ms ease-out, border-color 120ms ease-out;
}

.site-header nav a:hover {
  color: var(--white);
  border-bottom-color: var(--red);
}

.container {
  flex: 1;
  width: min(var(--container), calc(100% - (2 * var(--gutter))));
  margin: 48px auto 64px;
}

.site-footer {
  padding: 24px var(--gutter);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--black);
  color: #aaa;
  font-size: 13px;
}

.site-footer strong {
  color: var(--white);
  font-weight: 500;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--black);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.05;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(40px, 5.5vw, 64px);
}

h2 {
  font-size: 28px;
}

h3 {
  font-size: 22px;
}

a {
  color: var(--ink);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--red);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--red);
  font-family: var(--font-sub);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 36px;
  height: 3px;
  flex: 0 0 auto;
  background: var(--red);
}

.lead {
  font-size: 18px;
  line-height: 1.5;
}

.muted {
  color: var(--muted);
}

button,
.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 20px;
  border: 2px solid var(--red);
  border-radius: 4px;
  background: var(--red);
  color: var(--white);
  font-family: var(--font-sub);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
}

button:hover,
.button:hover {
  border-color: var(--red-deep);
  background: var(--red-deep);
  color: var(--white);
}

button:active,
.button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.secondary {
  border-color: var(--black);
  background: var(--white);
  color: var(--black);
}

.secondary:hover {
  border-color: var(--black);
  background: var(--black);
  color: var(--white);
}

.danger {
  border-color: var(--red);
  background: var(--white);
  color: var(--red);
}

.danger:hover {
  border-color: var(--red);
  background: var(--red);
  color: var(--white);
}

.small {
  padding: 7px 11px;
  font-size: 12px;
}

.link-button {
  padding: 8px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: #ddd;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.link-button:hover {
  border-bottom-color: var(--red);
  background: none;
  color: var(--white);
}

.inline-form {
  display: inline;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #b5b5b5;
  border-radius: 2px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  line-height: 1.2;
}

select {
  height: 46px;
}

input[type="color"] {
  padding: 4px;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgb(238 28 36 / 32%);
  outline-offset: 2px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--red);
}

label {
  display: block;
  color: var(--black);
  font-family: var(--font-sub);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

label input,
label select {
  margin-top: 6px;
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.stack {
  display: grid;
  gap: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.align-end {
  align-items: end;
}

.notice {
  margin-bottom: 24px;
  padding: 14px 16px;
  border-left: 4px solid var(--black);
  border-radius: 2px;
  background: var(--fog);
}

.notice.success {
  border-left-color: var(--success);
  background: #e7f4ec;
  color: #145c37;
}

.notice.error {
  border-left-color: var(--red);
  background: var(--red-soft);
  color: #8d1016;
}

.notice.development {
  border-left-color: var(--red);
  background: var(--fog);
  color: var(--ink);
}

.development-code {
  font-family: var(--font-display);
  font-size: 1.4em;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

.login-card {
  max-width: 640px;
  margin: 6vh auto;
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid var(--line);
  border-top: 4px solid var(--black);
  border-radius: 0;
  background: var(--white);
  box-shadow: var(--shadow-1);
}

.login-card .lead {
  margin-bottom: 0;
  color: var(--muted);
}

.login-form {
  margin-top: 32px;
}

.login-form input[readonly] {
  border-color: var(--line);
  background: var(--fog);
  color: var(--muted);
}

.login-form a {
  justify-self: start;
  font-size: 14px;
}

.page-heading {
  margin-bottom: 32px;
  padding-bottom: 24px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.page-heading h1 {
  margin-bottom: 0;
}

.page-heading .eyebrow {
  margin-bottom: 14px;
}

.calendar-toolbar {
  margin-bottom: 20px;
  padding: 16px;
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  background: var(--white);
}

.calendar-toolbar label {
  margin: 0 12px 0 0;
  justify-self: end;
}

.calendar-toolbar input {
  width: auto;
  min-width: 180px;
  justify-self: start;
}

#previous-week {
  justify-self: start;
}

#today,
#next-week {
  justify-self: end;
}

.calendar-grid {
  overflow-x: auto;
  border: 1px solid var(--black);
  background: var(--white);
}

.calendar-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  table-layout: fixed;
}

.calendar-table th,
.calendar-table td {
  padding: 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.calendar-table th {
  position: sticky;
  top: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-sub);
  font-size: 15px;
  letter-spacing: 0.06em;
}

.calendar-table th:first-child,
.calendar-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 130px;
  background: var(--fog);
  font-weight: 700;
}

.calendar-table th:first-child {
  z-index: 2;
  background: var(--black);
}

.day-heading {
  display: block;
  color: #bbb;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
}

.busy-block {
  margin: 6px 0;
  padding: 7px 9px;
  border-left: 3px solid var(--red);
  background: var(--red-soft);
  color: var(--ink);
  font-size: 12px;
}

.free-label {
  color: var(--muted);
  font-size: 12px;
}

.cell-book {
  margin-top: 10px;
  padding: 6px 9px;
  border-width: 1px;
  border-color: var(--black);
  background: var(--white);
  color: var(--black);
  font-size: 11px;
}

.cell-book:hover {
  border-color: var(--black);
  background: var(--black);
}

.empty-state,
.panel,
.booking-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--white);
  box-shadow: var(--shadow-1);
}

.booking-list {
  display: grid;
  gap: 16px;
}

.booking-card {
  transition: border-color 120ms ease-out, box-shadow 120ms ease-out;
}

.booking-card:hover {
  border-color: var(--black);
  box-shadow: var(--shadow-2);
}

.booking-summary {
  display: flex;
  justify-content: space-between;
}

.booking-summary h2 {
  margin: 12px 0 8px;
}

.booking-summary p {
  margin: 0;
  color: var(--muted);
}

.status {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 2px;
  background: var(--fog);
  color: var(--ink);
  font-family: var(--font-sub);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-confirmed {
  background: #e7f4ec;
  color: #145c37;
}

.status-pending {
  background: #fff1d6;
  color: var(--warning);
}

.status-declined,
.status-error {
  background: var(--red-soft);
  color: #8d1016;
}

.status-cancelled {
  background: var(--fog);
  color: var(--muted);
}

details {
  margin-top: 20px;
}

summary {
  color: var(--black);
  font-family: var(--font-sub);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

summary::marker {
  color: var(--red);
}

.compact-form {
  max-width: 780px;
  margin-top: 20px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.panel {
  margin-bottom: 24px;
  overflow: hidden;
}

.panel > h2 {
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--black);
}

.admin-room-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
}

.table-wrap {
  margin-top: 20px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--black);
  font-family: var(--font-sub);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.room-admin-list details {
  margin-top: 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.room-admin-list summary {
  margin-bottom: 18px;
}

dialog {
  width: min(600px, 92vw);
  max-height: 90vh;
  padding: 0;
  overflow-y: auto;
  border: 0;
  border-top: 4px solid var(--black);
  border-radius: 4px;
  box-shadow: var(--shadow-3);
}

dialog::backdrop {
  background: rgb(10 10 10 / 65%);
}

dialog form {
  padding: 28px;
}

.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dialog-heading h2 {
  margin: 0;
}

.icon-button {
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
}

.icon-button:hover {
  background: transparent;
  color: var(--red);
}

.mobile-nav {
  display: none;
}

@media (max-width: 900px) {
  .site-header {
    position: static;
    align-items: center;
    flex-direction: row;
    gap: 16px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .site-header .desktop-nav {
    display: none;
  }

  .brand {
    flex: 1;
    min-width: 0;
  }

  .brand-logo {
    width: 160px;
  }

  .mobile-nav {
    position: relative;
    display: block;
    flex: 0 0 auto;
    margin-top: 0;
  }

  .mobile-nav summary {
    padding: 10px 14px;
    border: 1px solid #777;
    border-radius: 4px;
    color: var(--white);
    cursor: pointer;
    list-style: none;
  }

  .mobile-nav summary::marker,
  .mobile-nav summary::-webkit-details-marker {
    display: none;
  }

  .mobile-nav[open] summary {
    border-color: var(--red);
    color: var(--red);
  }

  .mobile-nav nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 50;
    display: grid;
    gap: 0;
    min-width: 230px;
    padding: 8px 16px;
    border: 1px solid #444;
    border-top: 3px solid var(--red);
    background: var(--black);
    box-shadow: var(--shadow-2);
  }

  .mobile-nav nav a,
  .mobile-nav nav .link-button {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    padding: 14px 0;
    border-bottom: 1px solid #333;
    text-align: left;
  }

  .mobile-nav nav .inline-form {
    display: block;
  }

  .mobile-nav nav .link-button {
    border-bottom: 0;
  }

  .container {
    margin-top: 32px;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .brand {
    gap: 12px;
  }

  .brand-logo {
    width: 132px;
  }

  .brand-app {
    padding-left: 12px;
    font-size: 14px;
  }

  .site-header nav {
    gap: 14px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .calendar-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .calendar-toolbar label {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: start;
    margin: 0;
  }

  .calendar-toolbar input {
    grid-column: 1 / -1;
    grid-row: 2;
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-self: stretch;
  }

  .calendar-toolbar button {
    min-height: 40px;
    padding: 8px 4px;
    font-size: 12px;
    letter-spacing: 0.04em;
  }

  #previous-week {
    grid-column: 1;
    grid-row: 3;
    justify-self: stretch;
  }

  #next-week {
    grid-column: 3;
    grid-row: 3;
    justify-self: stretch;
  }

  #today {
    grid-column: 2;
    grid-row: 3;
    justify-self: stretch;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .empty-state,
  .panel,
  .booking-card,
  dialog form {
    padding: 20px;
  }

  .site-footer {
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
