:root {
  --charcoal: #3d3d3d;
  --green: #43a550;
  --warm: #f3ebe3;
  --ink: #3d3d3d;
  --secondary: #595959;
  --line: #e5e0d8;
  --paper: #fff;
  --font: "Inter", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--warm);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
}

.skip {
  position: absolute;
  left: 1rem;
  top: 0;
  z-index: 2;
  transform: translateY(-120%);
  background: var(--paper);
  color: var(--ink);
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  transform: translateY(0.75rem);
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.logo {
  display: block;
  width: 8.5rem;
  height: auto;
  margin: 0 0 0.85rem;
}

.minimise,
.show-list {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.2rem 0;
  cursor: pointer;
}

.minimise:hover,
.show-list:hover {
  color: var(--green);
}

.minimise:focus-visible,
.show-list:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.minimise {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-top: 0.15rem;
  padding: 0;
}

.minimise svg,
.show-list svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.show-list {
  display: none;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
}

.workspace.sidebar-hidden {
  grid-template-columns: minmax(0, 1fr);
}

.workspace.sidebar-hidden .sidebar {
  display: none;
}

.workspace.sidebar-hidden .show-list {
  display: grid;
}

.workspace {
  display: grid;
  grid-template-columns: 22rem minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}

.sidebar {
  overflow: auto;
  background: var(--warm);
  padding: 1.15rem 1rem 1.5rem;
}

.search {
  margin: 0.9rem 0 0.75rem;
}

.search input {
  width: 100%;
  border: 1px solid #d9d0c6;
  border-radius: 0.45rem;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  padding: 0.55rem 0.75rem;
}

.search input::placeholder {
  color: #8a8178;
}

.search input:focus {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-color: transparent;
}

.search-empty {
  margin: 0 0 0.75rem;
  color: var(--secondary);
}

.directory {
  list-style: none;
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
}

.directory li[hidden] {
  display: none;
}

#site-list > li {
  position: relative;
}

.site-menu {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  z-index: 4;
  display: none;
  grid-template-rows: repeat(3, 3px);
  align-content: center;
  justify-content: center;
  justify-items: center;
  gap: 2px;
  width: 0.7rem;
  height: 1.4rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}

.site-menu span {
  width: 3px;
  height: 3px;
  min-width: 3px;
  min-height: 3px;
  justify-self: center;
  align-self: center;
  border-radius: 50%;
  background: var(--charcoal);
}

#site-list > li:hover .site-menu,
#site-list > li:focus-within .site-menu {
  display: grid;
}

.site-menu:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.add-title {
  margin: 0;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.add-form input[type="file"] {
  font-size: 0.85rem;
  font-weight: 400;
}

.add-site {
  display: grid;
  place-items: center;
  width: 100%;
  height: 2.15rem;
  margin-top: 0.6rem;
  border: 1px solid #c8c8c8;
  border-radius: 0.45rem;
  background: #d9d9d9;
  color: #4a4a4a;
  font: inherit;
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.add-site:hover {
  background: #d0d0d0;
}

.add-site:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.add-dialog {
  width: min(32rem, calc(100% - 2rem));
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.add-dialog::backdrop {
  background: rgb(61 61 61 / 0.45);
}

.add-form {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 1.15rem 1.1rem 1rem;
  border: 1px solid #d9d0c6;
  border-radius: 0.55rem;
  background: var(--paper);
}

.add-form label {
  display: grid;
  gap: 0.25rem;
  color: var(--secondary);
  font-size: 0.8rem;
  font-weight: 600;
}

.add-form input {
  border: 1px solid #d9d0c6;
  border-radius: 0.4rem;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  padding: 0.5rem 0.7rem;
}

.add-form input:focus {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.add-hint {
  margin: 0;
  color: var(--secondary);
  font-size: 0.8rem;
  line-height: 1.35;
}

.add-actions {
  display: flex;
  gap: 0.5rem;
}

.add-save,
.add-cancel {
  border: 0;
  border-radius: 0.4rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}

.add-save {
  background: var(--green);
  color: #fff;
}

.add-save:hover {
  background: #3a8f45;
}

.add-cancel {
  background: transparent;
  color: var(--secondary);
}

.add-save:focus-visible,
.add-cancel:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.site {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  border: 1px solid #d9d0c6;
  border-radius: 0.45rem;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  text-align: left;
  padding: 0.45rem 0.75rem 0.45rem 0.45rem;
  cursor: pointer;
}

.site-photo {
  width: 3.6rem;
  height: 2.5rem;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 0.3rem;
}

.photo-lms {
  object-position: 62% center;
}

.photo-test {
  object-position: 78% 42%;
}

.photo-value {
  object-position: 68% center;
}

.photo-rrfd {
  object-position: right center;
}

.site-copy {
  min-width: 0;
}

.site:has(.site-photo) {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 4.6rem;
  padding: 0;
  overflow: hidden;
  border-color: transparent;
  color: #fff;
  text-align: left;
  background: var(--charcoal);
}

.site:has(.site-photo) .site-photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
}

.site:has(.site-photo)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.91) 0%,
    rgba(0, 0, 0, 0.78) 31%,
    rgba(0, 0, 0, 0.35) 58%,
    rgba(0, 0, 0, 0) 82%
  );
}

.site:has(.site-photo) .site-copy {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 0.7rem 0.55rem;
}

.site:has(.site-photo) .name {
  text-shadow:
    -1px -1px 0 #000,
    -1px 0 0 #000,
    -1px 1px 0 #000,
    0 -1px 0 #000,
    0 1px 0 #000,
    1px -1px 0 #000,
    1px 0 0 #000,
    1px 1px 0 #000;
}

.site:has(.site-photo) .detail {
  color: #b7b7b7;
}

.site:has(.site-photo)[aria-pressed="true"] {
  border-color: var(--green);
  box-shadow: none;
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.site:hover {
  border-color: #c4b5a5;
}

.site:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.site[aria-pressed="true"] {
  border-color: var(--green);
  box-shadow: inset 3px 0 0 var(--green);
}

.name {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.detail {
  display: block;
  margin-top: 0.2rem;
  color: var(--secondary);
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.35;
}

.stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--paper);
}

.stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex: 0 0 auto;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--warm);
}

.stage-start {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.back-list {
  display: none;
}

.stage-bar h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.open-site {
  flex: 0 0 auto;
  background: var(--green);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  padding: 0.55rem 0.85rem;
  border-radius: 0.4rem;
}

.open-site:hover {
  background: #3a8f45;
}

.open-site:focus-visible {
  outline: 2px solid var(--charcoal);
  outline-offset: 2px;
}

.stage-note {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border-left: 1px solid #e4d9ce;
  background: #1c1c1c;
  color: #fff;
}

.stage-picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.stage-message[hidden] {
  display: none;
}

.stage-message {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 2.4rem;
  background: linear-gradient(to right, rgb(0 0 0 / 0.92) 0%, rgb(0 0 0 / 0.84) 34%, rgb(0 0 0 / 0.46) 100%);
  text-align: left;
}

.stage-message h3 {
  margin: 0 0 0.9rem;
  max-width: 40rem;
  font-size: 3.15rem;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.stage-message p {
  margin: 0;
  max-width: 34rem;
  color: #b7b7b7;
  font-size: 1.2rem;
  line-height: 1.4;
}

.stage-note[hidden],
.stage-frame[hidden] {
  display: none;
}

.stage-frame {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  border-left: 1px solid #e4d9ce;
  background: var(--paper);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 800px) {
  .shell {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    max-height: none;
  }

  .minimise,
  .show-list,
  .workspace.sidebar-hidden .show-list {
    display: none;
  }

  .workspace.sidebar-hidden .sidebar {
    display: block;
  }

  .workspace:not(.view-site) .stage {
    display: none;
  }

  .workspace.view-site .sidebar {
    display: none;
  }

  .workspace.view-site .stage {
    min-height: 0;
    height: 100%;
  }

  .workspace.view-site .stage-bar h2 {
    display: none;
  }

  .workspace.view-site .back-list {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0.35rem 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
  }

  .workspace.view-site .back-list:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
  }
}
