* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #1d1d1f;
  background: #f5f5f3;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 52px;
  padding: 0 20px;
  color: #fff;
  background: #263238;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: flex-end;
  min-width: 0;
  width: 100%;
  gap: 4px;
}

.nav-links a,
.logout-form button {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 12px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.group-context-form {
  display: flex;
  align-items: center;
  margin: 0 auto 0 0;
  padding: 7px 0;
}

.group-context-form select {
  min-height: 38px;
  width: min(210px, 24vw);
  border-color: #7e8d94;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.logout-form button:hover,
.logout-form button:focus-visible {
  background: #3b4a51;
}

.page {
  padding: 20px;
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.message {
  padding: 10px 12px;
  border: 1px solid #b8c7d9;
  background: #eef5ff;
}

.toolbar,
.empty-state {
  padding: 16px;
  border: 1px solid #d7d7d2;
  background: #fff;
}

.selector-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

label {
  display: grid;
  gap: 5px;
  min-width: 220px;
}

label span {
  font-weight: 700;
}

select,
button {
  min-height: 36px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid #9ea4a8;
  background: #fff;
  font: inherit;
}

button {
  color: #fff;
  border-color: #2f5f8f;
  background: #2f5f8f;
  cursor: pointer;
}

.logout-form {
  display: flex;
  margin: 0;
}

.logout-form button {
  width: 100%;
  border: 0;
  background: transparent;
}

.choice-header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 12px;
}

h1 {
  margin: 0 0 4px;
  font-size: 22px;
}

p {
  margin: 0;
  color: #555;
}

.table-wrap {
  max-height: calc(100vh - 190px);
  overflow: auto;
  border: 1px solid #c9c9c4;
  background: #fff;
}

.choices-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
}

.choices-table th,
.choices-table td {
  padding: 7px 8px;
  border: 1px solid #d0d0cc;
  text-align: left;
  vertical-align: middle;
}

.choices-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #d9d9d6;
}

.choices-table tbody tr:nth-child(even) {
  background: #ededeb;
}

.show-col {
  min-width: 320px;
}

.attendees-col {
  min-width: 260px;
}

.show-col span {
  display: block;
  margin-top: 2px;
  color: #555;
  font-size: 12px;
}

.person-col,
.check-cell {
  width: 86px;
  text-align: center;
}

.overview-table {
  min-width: 1500px;
}

.overview-table tfoot th {
  background: #d9d9d6;
}

.overview-totals {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #c9c9c4;
}

.overview-totals h2,
.overview-totals h3 {
  margin: 0;
}

.mark-cell {
  width: 86px;
  text-align: center;
}

.mark-cell.selected {
  background: #7fbf7b;
}

.check-cell input {
  width: 18px;
  height: 18px;
}

.paid-choice {
  background: #d8ead3;
}

.paid-choice span {
  display: block;
  margin-top: 4px;
  color: #355f35;
  font-size: 12px;
}

.historical-choice {
  background: #ece8df;
}

.historical-choice span {
  display: block;
  margin-top: 4px;
  color: #6a604f;
  font-size: 12px;
}

.totals-grid {
  display: grid;
  gap: 24px;
  margin-top: 20px;
}

.totals-grid > div {
  min-width: 0;
}

.totals-table {
  min-width: 520px;
}

.totals-table-wrap {
  max-height: none;
  margin-top: 10px;
  overflow-x: auto;
  overflow-y: visible;
}

.next-show {
  display: grid;
  grid-template-columns: minmax(280px, 44%) 1fr;
  min-height: 420px;
  border: 1px solid #c9c9c4;
  background: #fff;
}

.next-show-image,
.next-show-placeholder {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  background: #d9d9d6;
}

.next-show-content {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 32px;
}

.eyebrow {
  color: #64717a;
  font-weight: 700;
  text-transform: uppercase;
}

.company {
  color: #263238;
  font-size: 18px;
}

.show-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 14px;
  margin: 0;
}

.show-meta div {
  padding: 12px;
  border: 1px solid #d7d7d2;
  background: #f7f7f5;
}

.show-meta dt {
  color: #64717a;
  font-size: 12px;
  font-weight: 700;
}

.show-meta dd {
  margin: 4px 0 0;
  font-size: 18px;
}

.notes {
  line-height: 1.5;
}

.show-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.show-actions a {
  padding: 9px 12px;
  color: #fff;
  background: #2f5f8f;
  text-decoration: none;
}

.show-actions button {
  min-height: auto;
  padding: 9px 12px;
}

.ticket-dialog {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid #9ea4a8;
}

.ticket-dialog::backdrop {
  background: rgb(0 0 0 / 0.45);
}

.dialog-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #d0d0cc;
  background: #fff;
}

.dialog-header h2 {
  margin: 0;
}

.ticket-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.ticket-item {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 16px;
  padding: 12px;
  border: 1px solid #d0d0cc;
}

.ticket-item-code-only {
  grid-template-columns: 1fr;
}

.ticket-item img {
  width: 100%;
  height: auto;
}

.ticket-item h3 {
  margin: 0 0 10px;
}

.ticket-item dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
  margin: 0;
}

.ticket-item dt {
  color: #64717a;
  font-size: 12px;
  font-weight: 700;
}

.ticket-item dd {
  margin: 2px 0 0;
}

.upcoming {
  margin-top: 28px;
}

.upcoming h2 {
  margin: 0 0 12px;
}

.upcoming-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.show-card {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  min-height: 110px;
  padding: 10px;
  border: 1px solid #d0d0cc;
  background: #fff;
}

.show-card img {
  width: 90px;
  height: 90px;
  object-fit: cover;
}

.show-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.expandable-show-card {
  align-items: start;
}

.expandable-show-card.is-open {
  grid-column: 1 / -1;
  grid-template-columns: minmax(120px, 220px) 1fr;
}

.expandable-show-card.is-open img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
}

.expandable-show-card details {
  min-width: 0;
}

.expandable-show-card summary {
  cursor: pointer;
  list-style-position: outside;
}

.expandable-show-card summary h3 {
  display: inline-block;
  margin-bottom: 6px;
  color: #1d4f7d;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.summary-line {
  display: block;
  color: #555;
}

.show-card-details {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #d7d7d2;
}

.compact-show-meta {
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 8px;
}

.compact-show-meta div {
  padding: 9px;
}

.compact-show-meta dd {
  font-size: 15px;
}

.show-card p,
.show-card span,
.muted {
  display: block;
  color: #555;
}

.expandable-show-card.is-open .summary-date-value,
.expandable-show-card.is-open .summary-time-value,
.expandable-show-card details[open] .summary-date-value,
.expandable-show-card details[open] .summary-time-value {
  display: inline;
}

.expandable-show-card.is-open .summary-time-value,
.expandable-show-card details[open] .summary-time-value {
  margin-left: 0.35em;
}

.login-panel {
  max-width: 420px;
  padding: 20px;
  border: 1px solid #d7d7d2;
  background: #fff;
}

.auth-panel form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.auth-panel form p {
  margin: 0;
}

.auth-panel input {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #9ea4a8;
  font: inherit;
}

.auth-panel .auth-copy {
  margin-top: 12px;
  line-height: 1.5;
}

.auth-panel > .form-actions {
  margin-top: 16px;
}

.account-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 520px));
  gap: 20px;
  align-items: start;
}

.account-sections .login-panel {
  width: 100%;
  max-width: none;
}

.account-panel label {
  display: block;
  margin-bottom: 5px;
  font-weight: 700;
}

.account-panel input {
  box-sizing: border-box;
  width: 100%;
}

.account-panel input[type="checkbox"] {
  width: auto;
}

.account-panel .errorlist {
  margin: 6px 0 0;
  padding: 0;
  color: #a32121;
  list-style: none;
}

.push-panel {
  display: grid;
  gap: 14px;
}

.push-panel h2 {
  margin: 0;
  font-size: 22px;
}

.push-install-hint {
  padding: 10px 12px;
  border-left: 4px solid #7e8d94;
  background: #f5f5f3;
}

.push-settings-form {
  display: grid;
  gap: 14px;
}

.push-days {
  margin: 0;
  padding: 12px;
  border: 1px solid #d7d7d2;
}

.push-days legend {
  padding: 0 5px;
  font-weight: 700;
}

.push-day-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.push-day-options label {
  display: flex;
  gap: 7px;
  align-items: center;
  min-width: 0;
  margin: 0;
  font-weight: 400;
}

.push-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.push-status,
.push-device-count {
  min-height: 20px;
}

.push-status[data-state="success"] {
  color: #23652f;
}

.push-status[data-state="error"] {
  color: #a32121;
}

.time-machine-heading {
  margin: 28px 0 16px;
}

.time-machine-heading h1 {
  margin-top: 4px;
  font-size: 30px;
}

.time-machine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.time-machine-card {
  display: block;
  border: 1px solid #c9c9c4;
  color: inherit;
  background: #fff;
  text-decoration: none;
  transition: border-color 120ms ease, transform 120ms ease;
}

.time-machine-card:hover,
.time-machine-card:focus-visible {
  border-color: #2f5f8f;
  transform: translateY(-2px);
}

.time-machine-card-content {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
}

.time-machine-card h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
}

.time-machine-date {
  color: #64717a;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.time-machine-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid #e1e1dd;
  color: #555;
}

.time-machine-detail {
  display: grid;
  gap: 20px;
  width: min(1080px, 100%);
  margin: 0 auto;
}

.narrow-detail {
  width: min(760px, 100%);
}

.back-link {
  width: fit-content;
  color: #1d4f7d;
  font-weight: 700;
  text-underline-offset: 3px;
}

.time-machine-section,
.discussion-post {
  padding: 20px;
  border: 1px solid #d0d0cc;
  background: #fff;
}

.time-machine-section h2,
.time-machine-section h3 {
  margin: 0 0 10px;
}

.time-machine-intro .next-show-image,
.time-machine-intro .next-show-placeholder {
  align-self: center;
  width: 100%;
  max-width: 474px;
  height: auto;
  min-height: 0;
  max-height: 496px;
  aspect-ratio: 474 / 496;
  object-fit: cover;
}

.time-machine-intro .notes,
.discussion-body {
  color: #333;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.section-heading,
.discussion-post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.rating-summary {
  display: grid;
  justify-items: end;
  width: fit-content;
  margin-left: auto;
}

.rating-summary strong {
  color: #9b6500;
  font-size: 24px;
}

.rating-summary span,
.discussion-count,
.discussion-post-header time,
.discussion-label,
.helptext {
  color: #64717a;
  font-size: 12px;
}

.rating-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(300px, 1.2fr);
  gap: 20px;
  margin-top: 18px;
}

.rating-layout-readonly {
  grid-template-columns: 1fr;
}

.panel-form {
  padding: 16px;
  border: 1px solid #d7d7d2;
  background: #f7f7f5;
}

.panel-form form {
  display: grid;
  gap: 10px;
}

.panel-form textarea {
  width: 100%;
  min-height: 150px;
  padding: 10px;
  border: 1px solid #9ea4a8;
  resize: vertical;
  font: inherit;
  line-height: 1.5;
}

.rating-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.rating-fieldset legend {
  margin-bottom: 8px;
  font-weight: 700;
}

.star-rating {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: clamp(1px, 0.5vw, 4px);
  width: min(400px, 100%);
  padding: 2px;
}

.star-rating > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.star-choice {
  min-width: 0;
  padding: 3px 0;
  border-radius: 3px;
  color: #b5b1a9;
  cursor: pointer;
}

.star-icon {
  display: block;
  font-size: clamp(18px, 2.4vw, 30px);
  line-height: 1;
  text-align: center;
  transition: color 100ms ease, transform 100ms ease;
}

.star-rating > input:checked + .star-choice,
.star-choice:has(~ input:checked) {
  color: #c48100;
}

.star-rating:hover .star-choice {
  color: #b5b1a9;
}

.star-rating .star-choice:hover,
.star-rating .star-choice:has(~ .star-choice:hover) {
  color: #c48100;
}

.star-choice:hover .star-icon {
  transform: scale(1.08);
}

.star-rating > input:focus-visible + .star-choice {
  outline: 2px solid #2f5f8f;
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.inline-danger-form {
  margin-top: 10px;
}

button.danger-button {
  color: #8a2020;
  border-color: #c99;
  background: #fff;
}

.named-ratings h3 {
  margin-top: 0;
}

.named-ratings ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.named-ratings li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid #e1e1dd;
  background: #f7f7f5;
}

.named-ratings strong {
  color: #9b6500;
  white-space: nowrap;
}

.discussion-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.discussion-post-identity {
  display: grid;
  gap: 4px;
}

.discussion-author-line,
.discussion-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.discussion-author {
  color: #263238;
  font-weight: 700;
}

.discussion-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.discussion-actions form {
  margin: 0;
}

.discussion-icon-actions {
  flex-wrap: nowrap;
  gap: 3px;
}

.discussion-icon-actions a,
.discussion-icon-actions button {
  display: inline-grid;
  place-items: center;
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: 3px;
  text-decoration: none;
}

.discussion-icon-actions a:hover,
.discussion-icon-actions a:focus-visible,
.discussion-icon-actions button:hover,
.discussion-icon-actions button:focus-visible {
  background: #e7ecef;
}

.discussion-action-icon {
  font-size: 18px;
  line-height: 1;
}

.discussion-actions a,
.link-button,
.form-actions a {
  color: #1d4f7d;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

button.link-button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

button.danger-link {
  color: #9a2727;
}

.discussion-body {
  margin-top: 14px;
}

.new-post-form {
  margin-top: 24px;
  padding: 24px;
}

.new-post-form h3,
.new-post-form .discussion-form {
  width: min(960px, 100%);
  margin-right: auto;
  margin-left: auto;
}

.new-post-form textarea {
  display: block;
  min-height: 220px;
}

.new-post-form .helptext {
  display: block;
}

.new-post-form button {
  justify-self: start;
}

.form-actions {
  margin-top: 4px;
}

.errorlist {
  margin: 0;
  padding-left: 20px;
  color: #a32121;
}

@media (max-width: 720px) {
  .topbar {
    min-height: 0;
    padding: 0;
  }

  .nav-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
  }

  .group-context-form {
    grid-column: 1 / -1;
    margin: 0;
    padding: 7px 8px;
  }

  .group-context-form select {
    width: 100%;
  }

  .nav-links a,
  .logout-form button {
    justify-content: center;
    min-width: 0;
    min-height: 44px;
    padding: 0 8px;
    text-align: center;
  }

  .logout-form {
    width: 100%;
  }

  .page {
    padding: 12px;
  }

  .account-sections {
    grid-template-columns: minmax(0, 1fr);
  }

  .toolbar {
    padding: 12px;
  }

  .selector-form > * {
    width: 100%;
  }

  select {
    width: 100%;
  }

  .choice-header {
    align-items: stretch;
    flex-direction: column;
  }

  .next-show {
    grid-template-columns: 1fr;
  }

  .next-show-image,
  .next-show-placeholder {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .next-show-content {
    padding: 20px;
  }

  .show-meta {
    grid-template-columns: 1fr;
  }

  .show-meta dd,
  .summary-line,
  .notes,
  .ticket-item dd {
    overflow-wrap: anywhere;
  }

  .upcoming-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .show-card,
  .expandable-show-card.is-open {
    grid-template-columns: 1fr;
  }

  .show-card img,
  .expandable-show-card.is-open img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .compact-show-meta {
    grid-template-columns: 1fr;
  }

  .ticket-dialog {
    max-height: calc(100dvh - 24px);
  }

  .dialog-header {
    padding: 10px 12px;
  }

  .ticket-list {
    gap: 10px;
    padding: 10px;
  }

  .ticket-item,
  .ticket-item dl {
    grid-template-columns: 1fr;
  }

  label {
    min-width: 100%;
  }

  .time-machine-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .rating-layout {
    grid-template-columns: 1fr;
  }

  .named-ratings ul {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .discussion-post-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .rating-summary {
    justify-items: start;
    margin-left: 0;
  }

  .discussion-actions {
    width: 100%;
  }

  .discussion-icon-actions {
    width: auto;
  }

  .new-post-form {
    padding: 16px;
  }
}
