:root {
  --background: #fbfaf8;
  --surface: #ffffff;
  --text: #1c1a17;
  --muted: #6b6560;
  --border: #e2ded8;
  --star: #c08a2c;
  --drop: #a8402c;
  --change: #a97b1e;
  --add: #4a7c3f;
  --clash: #a8402c;
  --hover: #efece7;
  --pressed: #e2ded8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

/*
 * The bar holds a plan for every plan there is, so it wraps rather than running
 * off the side once there are a few.
 */
nav {
  align-items: baseline;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  padding: 0.75rem 1.5rem;
}

nav a {
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
}

nav a + a {
  font-weight: 400;
}

nav a.here {
  text-decoration: underline;
  text-underline-offset: 0.35rem;
}

/*
 * A plan is made by asking the server for one, so the control that does it is a
 * button. It reads as the link beside it.
 */
nav form {
  background: none;
  border: 0;
  padding: 0;
}

nav button {
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  letter-spacing: 0.02em;
  padding: 0;
}

nav button:hover {
  color: var(--text);
}

/*
 * The account sits at the far end of the bar, away from the plans.
 */
nav .account {
  align-items: baseline;
  display: flex;
  gap: 1rem;
  margin-left: auto;
}

nav .account a {
  font-weight: 400;
}

nav .account span {
  color: var(--muted);
}

main {
  margin: 0 auto;
  max-width: 72rem;
  padding: 2rem 1.5rem;
}

h1 {
  font-size: 1.75rem;
  margin: 0 0 1rem;
}

p {
  color: var(--muted);
  margin: 0 0 1rem;
}

form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  display: grid;
  gap: 0.5rem;
  justify-items: start;
  max-width: 28rem;
  padding: 1.25rem;
}

label {
  font-weight: 600;
}

label + input {
  margin-bottom: 0.75rem;
}

input {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  color: var(--text);
  font: inherit;
  padding: 0.4rem 0.5rem;
}

button {
  background: var(--text);
  border: 1px solid var(--text);
  border-radius: 0.25rem;
  color: var(--surface);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0.4rem 1rem;
}

/*
 * The page is a sentence and a button, so the form carries none of the box a
 * form with fields would, and the line stops short of the width of the page.
 */
.landing p {
  max-width: 34rem;
}

.landing form {
  background: none;
  border: 0;
  margin: 0 0 1.5rem;
  padding: 0;
}

/*
 * The offer to sign in reads as part of the sentence above it rather than as a
 * control, so only the words that go somewhere carry the underline.
 */
.landing .signin a {
  color: inherit;
}

/*
 * The name leads and the controls sit against the far edge, so the pair reads
 * as one line about the plan rather than a heading with buttons after it.
 */
.heading {
  align-items: center;
  column-gap: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.heading h1 {
  margin: 0;
}

.heading form {
  align-items: center;
  background: none;
  border: 0;
  display: flex;
  gap: 0.5rem;
  padding: 0;
}

/*
 * Solve is the one thing on the page worth pressing, so nothing beside the name
 * takes the weight that would compete with it.
 */
.heading button {
  background: none;
  border-color: var(--border);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 400;
}

.heading .quiet {
  border-color: transparent;
  color: var(--muted);
}

.heading .question {
  font-size: 0.875rem;
}

.name input {
  font-size: 1.75rem;
  padding: 0.1rem 0.35rem;
}

/*
 * The name is pressed to open the field, so it carries none of the marks a
 * button would otherwise bring with it.
 */
.name .rename {
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  padding: 0;
  text-align: left;
}

.name .rename:hover {
  text-decoration: underline;
  text-underline-offset: 0.35rem;
}

.heading .controls {
  align-items: center;
  display: flex;
  gap: 0.5rem;
}

/*
 * The row is reversed so the side column, which leads the markup, sits on the
 * right. flex-end is the left edge of a reversed row, which is where a line
 * holding one wrapped column belongs.
 */
.columns {
  align-items: start;
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: flex-end;
  margin-bottom: 1.5rem;
}

.columns .itinerary {
  flex: 1 1 30rem;
}

.columns .side {
  flex: 0 1 16rem;
  position: sticky;
  top: 1.5rem;
}

/*
 * Stacked, a sticky side column would pin itself over the itinerary. The
 * columns wrap where the two flex bases and the gap stop fitting the viewport
 * less main's padding, at 30rem + 2rem + 16rem + 3rem.
 */
@media (width < 51rem) {
  .columns .side {
    position: static;
  }
}

.side {
  font-size: 0.875rem;
}

.side .solved {
  margin: 0.5rem 0 1.5rem;
}

.settings h2 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

.settings h3,
.settings summary {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}

.settings summary {
  cursor: pointer;
}

.days,
.options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.day,
.option,
.premium {
  background: none;
  border-color: var(--border);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 400;
}

.day.unavailable,
.option.chosen,
.premium.excluded {
  background: var(--text);
  border-color: var(--text);
  color: var(--surface);
}

.option {
  min-width: 3.5rem;
}

/*
 * Venue names run to different lengths, so a grid keeps the marks in a column
 * down the right of them.
 */
.venues {
  align-items: center;
  display: grid;
  gap: 0.25rem 0.5rem;
  grid-template-columns: 1fr auto;
}

.itinerary h2 {
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
}

.itinerary h3 {
  font-size: 1rem;
  margin: 1.25rem 0 0.5rem;
}

.itinerary .films {
  font-size: 0.875rem;
  margin: 0 0 0.75rem;
}

.itinerary .films a {
  color: var(--muted);
}

.itinerary .films.prompt,
.itinerary .films.prompt a {
  color: var(--text);
}

.itinerary .unscheduled ul {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0;
  padding-left: 1.25rem;
}

.entry {
  align-items: baseline;
  border-left: 3px solid var(--border);
  column-gap: 0.75rem;
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 0.5rem 0 0.5rem 0.75rem;
}

.entry.locked {
  border-left-color: var(--text);
}

.entry h4 {
  font-size: 1rem;
  margin: 0;
}

.entry .showing,
.entry .marks {
  color: var(--muted);
  font-size: 0.875rem;
  grid-column: 1;
  margin: 0;
}

.entry .controls {
  display: flex;
  gap: 0.5rem;
  grid-column: 2;
  grid-row: 1 / span 2;
}

.entry .lock,
.entry .exclude,
.entry .take {
  background: none;
  border-color: var(--border);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 400;
}

.entry .lock {
  align-items: center;
  display: flex;
  justify-content: center;
}

.entry.locked .lock {
  background: var(--text);
  border-color: var(--text);
  color: var(--surface);
}

/*
 * The padlock sits at the size of the text on the controls beside it.
 */
.entry .lock svg {
  display: block;
  height: 1rem;
  width: 1rem;
}

/*
 * The button holds both padlocks and one shows at a time. Hovering shows the
 * padlock the click would leave behind, so the button says what it does while
 * keeping the colour that says where the screening stands.
 */
.entry:not(.locked) .lock:not(:hover) .closed,
.entry:not(.locked) .lock:hover .open,
.entry.locked .lock:not(:hover) .open,
.entry.locked .lock:hover .closed {
  display: none;
}

.entry .other-screenings {
  grid-column: 1 / -1;
  margin-top: 0.25rem;
}

/*
 * The toggle reads as a line of text rather than a button, the way the one on
 * the films page does.
 */
.entry .other-screenings .toggle {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 400;
  padding: 0;
}

.entry .other-screenings .none,
.entry .other-screenings ul {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0;
}

.entry .other-screenings ul {
  list-style: none;
  padding: 0;
}

/*
 * The lines are of different lengths, so the cost and the button sit at the end
 * of the row rather than after the text they belong to. The tray of changes
 * takes the row underneath, spanning it.
 */
.entry .other-screenings > ul > li {
  align-items: center;
  column-gap: 0.75rem;
  display: grid;
  grid-template-columns: 1fr auto auto;
  padding: 0.15rem 0;
}

/*
 * The details gives up its own box so its summary and its tray each take a
 * place of their own on the row's grid.
 */
.entry .other-screenings details.cost {
  display: contents;
}

.entry .other-screenings .cost summary {
  border-radius: 0.25rem;
  cursor: pointer;
  display: flex;
  gap: 0.5rem;
  grid-column: 2;
  grid-row: 1;
  padding: 0.15rem 0.4rem;
}

/*
 * The counts carry no border of their own, so a background is what says they
 * can be pressed.
 */
.entry .other-screenings .cost summary:hover {
  background: var(--hover);
}

.entry .other-screenings .cost summary:active {
  background: var(--pressed);
}

/*
 * A count is its icon and its number together, so the two sit closer to each
 * other than to the count beside them.
 */
.entry .other-screenings .cost summary span {
  align-items: center;
  display: flex;
  gap: 0.35rem;
}

.entry .other-screenings .take {
  grid-column: 3;
  grid-row: 1;
}

/*
 * The tray takes the row underneath, spanning it. A browser that wraps the tray
 * in ::details-content places that box, and one without it places the list.
 */
.entry .other-screenings .cost::details-content {
  grid-column: 1 / -1;
  grid-row: 2;
}

.entry .other-screenings .cost ul {
  grid-column: 1 / -1;
  grid-row: 2;
  padding-top: 0.15rem;
}

/*
 * A change in the tray is a line of its own, led by the icon that names it,
 * rather than the row of screening and button the list around it holds.
 */
.entry .other-screenings .cost li {
  align-items: center;
  display: flex;
  gap: 0.35rem;
  padding: 0;
}

.entry .other-screenings .cost svg {
  display: block;
  height: 1rem;
  width: 1rem;
}

.entry .other-screenings .cost .drop {
  color: var(--drop);
}

.entry .other-screenings .cost .change {
  color: var(--change);
}

.entry .other-screenings .cost .add {
  color: var(--add);
}

.entry .other-screenings .cost .clash {
  color: var(--clash);
}

.gap {
  font-size: 0.8125rem;
  font-style: italic;
  margin: 0;
  padding-left: 0.75rem;
}

.gap.tight {
  color: var(--text);
  font-weight: 600;
}

ul.warnings {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  margin: 0.75rem 0 0;
  padding: 0.75rem 0.75rem 0.75rem 2rem;
}

ul.warnings li {
  color: var(--text);
  font-size: 0.875rem;
}

form.filters {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  max-width: none;
}

form.filters label {
  display: grid;
  font-size: 0.875rem;
  gap: 0.2rem;
}

form.filters label.check {
  align-items: center;
  display: flex;
  font-weight: 400;
  gap: 0.35rem;
}

form.filters select {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  color: var(--text);
  font: inherit;
  max-width: 14rem;
  padding: 0.4rem 0.5rem;
}

form.filters a {
  color: var(--muted);
  font-size: 0.875rem;
}

.film {
  align-items: baseline;
  border-bottom: 1px solid var(--border);
  column-gap: 0.75rem;
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 0.75rem 0;
}

.film:first-of-type {
  border-top: 1px solid var(--border);
}

.film h2 {
  font-size: 1.1rem;
  margin: 0;
}

.film .credits,
.film .none,
.film .toggle,
.film table.screenings {
  grid-column: 1 / -1;
}

.film .credits {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0;
}

.film .credits .directors + .programme::before {
  content: " · ";
}

.film .none {
  font-size: 0.875rem;
  margin: 0.5rem 0 0;
}

/*
 * The toggle reads as a line of text rather than a button, and justify-self keeps
 * it to its own width in the row it spans.
 */
.film .toggle {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 400;
  justify-self: start;
  margin-top: 0.5rem;
  padding: 0;
}

.interest {
  display: flex;
  gap: 0.1rem;
}

.interest button {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  padding: 0 0.1rem;
}

.interest button.filled {
  color: var(--star);
}

/*
 * The three marks are not the same width, so a min-width keeps the column still
 * as one button swaps state.
 */
.preference {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  min-width: 1.5rem;
  padding: 0 0.1rem;
}

.preference.preferred,
.preference.excluded {
  color: var(--text);
}

.preference:disabled {
  color: var(--border);
  cursor: default;
}

table.screenings {
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  width: 100%;
}

table.screenings th,
table.screenings td {
  border-bottom: 1px solid var(--border);
  padding: 0.35rem 0.5rem 0.35rem 0;
  text-align: left;
}

table.screenings th {
  color: var(--muted);
  font-weight: 600;
}

ul.errors,
ul.summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  margin: 0 0 1.5rem;
  padding: 0.75rem 0.75rem 0.75rem 2rem;
}

ul.errors li {
  color: var(--text);
  font-family: ui-monospace, monospace;
  font-size: 0.875rem;
}

p.rejected {
  color: var(--drop);
}
