/* Page layouts: event page, the hosted (organiser + series) pages, the
   public timeline, the series calendar and the composer. */

.page {
  display: block;
  width: 100%;
}
.page-col {
  margin: 0 auto;
  width: 100%;
  max-width: 56rem; /* max-w-4xl — organiser + series */
  padding: 2.5rem 1rem;
}
.page-col-wide {
  margin: 0 auto;
  width: 100%;
  max-width: 64rem; /* max-w-5xl — event page + composer */
  padding: 2.5rem 1rem;
}
@media (min-width: 640px) {
  .page-col,
  .page-col-wide {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}
@media (min-width: 1024px) {
  .page-col,
  .page-col-wide {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}
.stack-10 > * + * {
  margin-top: 2.5rem;
}
.stack-8 > * + * {
  margin-top: 2rem;
}
.stack-6 > * + * {
  margin-top: 1.5rem;
}
.stack-5 > * + * {
  margin-top: 1.25rem;
}
.stack-4 > * + * {
  margin-top: 1rem;
}
.stack-3 > * + * {
  margin-top: 0.75rem;
}
.stack-2 > * + * {
  margin-top: 0.5rem;
}
.stack-1 > * + * {
  margin-top: 0.25rem;
}

/* ===========================================================================
   Event page — two columns: cover + host on the left, everything else right
   ======================================================================== */
.event-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 2.5rem;
  row-gap: 1.5rem;
}
.event-main {
  min-width: 0;
}
@media (min-width: 768px) {
  .event-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr);
    grid-template-rows: auto 1fr;
  }
  .event-cover {
    grid-column: 1;
    grid-row: 1;
  }
  .event-main {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
  .event-aside {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
  }
  .event-grid.no-cover .event-aside {
    grid-row: 1;
  }
}
@media (min-width: 1024px) {
  .event-grid {
    grid-template-columns: 340px minmax(0, 1fr);
  }
}

.title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.event-title {
  min-width: 0;
  flex: 1;
  font-size: 2.25rem;
  line-height: 2.5rem;
  font-weight: 600;
  color: var(--foreground);
}

.series-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, currentColor 40%, transparent);
  text-underline-offset: 4px;
}
.series-toggle svg {
  width: 0.875rem;
  height: 0.875rem;
  transition: transform 150ms;
}
.series-toggle[aria-expanded='true'] svg {
  transform: rotate(90deg);
}
.series-dates {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.series-tile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 0.625rem;
  transition: background-color 150ms;
}
.series-tile:hover {
  background: color-mix(in oklab, var(--muted) 40%, transparent);
}
.series-tile.current {
  border-color: var(--foreground);
  background: color-mix(in oklab, var(--muted) 60%, transparent);
}
.mini-chip {
  display: flex;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--muted);
  align-items: center;
  justify-content: center;
}
.mini-chip .dc-day {
  font-size: 1rem;
}
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.arrow-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.arrow-link svg {
  width: 1rem;
  height: 1rem;
}

/* Registration */
.ticket-rows {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.ticket-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
}
.legal-line {
  font-size: 0.75rem;
  line-height: 1.625;
  color: var(--muted-foreground);
}
.going-card {
  display: flex;
  gap: 0.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--muted) 40%, transparent);
  padding: 1rem;
}
.going-card > svg {
  width: 1rem;
  height: 1rem;
  margin-top: 0.3125rem;
  color: var(--muted-foreground);
  flex-shrink: 0;
}
.going-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.625rem;
  margin-top: 0.75rem;
}
.inline-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--foreground) 30%, transparent);
  text-underline-offset: 4px;
}
.inline-link svg {
  width: 1rem;
  height: 1rem;
}
.response-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.response-row .btn[aria-pressed='true'] {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

/* A stand-in for the Google map: a quiet street grid and a pin. */
.map-placeholder {
  position: relative;
  height: 14rem;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background-color: color-mix(in oklab, var(--muted) 70%, var(--background));
  background-image:
    linear-gradient(color-mix(in oklab, var(--foreground) 9%, transparent) 2px, transparent 2px),
    linear-gradient(90deg, color-mix(in oklab, var(--foreground) 9%, transparent) 2px, transparent 2px),
    linear-gradient(28deg, transparent 47%, color-mix(in oklab, var(--foreground) 14%, transparent) 47% 53%, transparent 53%);
  background-size:
    48px 48px,
    64px 64px,
    100% 100%;
}
.map-placeholder .map-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -100%);
  color: oklch(0.6 0.2 27);
  filter: drop-shadow(0 2px 2px rgb(0 0 0 / 0.25));
}
.map-placeholder .map-pin svg {
  width: 2rem;
  height: 2rem;
  fill: currentColor;
  stroke: oklch(0.35 0.12 27);
  stroke-width: 1.2;
}
.map-note {
  position: absolute;
  right: 0.5rem;
  bottom: 0.375rem;
  font-size: 0.6875rem;
  color: var(--muted-foreground);
}
.directions {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
}
.directions:hover {
  text-decoration: underline;
}
.directions svg {
  width: 0.875rem;
  height: 0.875rem;
}

/* Aside */
.host-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.host-link {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.75rem;
}
.host-link:hover .host-name {
  text-decoration: underline;
}
.socials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin-left: -0.375rem;
}
.socials a {
  border-radius: var(--radius-md);
  padding: 0.375rem;
  color: var(--muted-foreground);
}
.socials a:hover {
  color: var(--foreground);
}
.socials svg {
  width: 1rem;
  height: 1rem;
}
.aside-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-left: -0.5rem;
}

/* ===========================================================================
   Hosted pages (organiser, series)
   ======================================================================== */
.org-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.org-head-logo {
  position: relative;
  margin-top: -2rem;
  margin-left: 1.5rem;
  border-radius: var(--radius-xl) !important;
  box-shadow: 0 0 0 4px var(--background);
}
@media (min-width: 640px) {
  .org-head-logo {
    margin-top: -2.5rem;
    margin-left: 2rem;
    width: 5rem !important;
    height: 5rem !important;
    font-size: 30px !important;
  }
}
.head-actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.5rem;
}
.hosted-title {
  font-size: 1.875rem;
  line-height: 2.25rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--foreground);
}
.series-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}
.series-title-row > :first-child {
  min-width: 0;
  flex: 1 1 16rem;
}

.series-body {
  display: grid;
  gap: 2rem;
}
@media (min-width: 1024px) {
  .series-body {
    grid-template-columns: minmax(0, 1fr) 15rem;
  }
  .series-body > aside {
    position: sticky;
    top: 1.5rem;
    order: 2;
    align-self: start;
  }
}

/* Public timeline */
.month-group > * + * {
  margin-top: 0.5rem;
}
.date-card {
  display: flex;
  gap: 1rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--card);
  padding: 1rem;
  transition: background-color 150ms;
}
.date-card:hover {
  background: color-mix(in oklab, var(--muted) 40%, var(--card));
}
.date-card .card-chip {
  display: flex;
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--muted);
}
.date-card .card-text {
  min-width: 0;
  flex: 1;
}
.date-card .card-text > * + * {
  margin-top: 0.25rem;
}
.date-card .thumb {
  width: 5rem;
  height: 5rem;
  flex-shrink: 0;
  border-radius: var(--radius-lg);
  object-fit: cover;
}
.more-row {
  display: block;
  border-radius: var(--radius-lg);
  padding: 0.5rem 0.75rem 0.5rem 5rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.more-row:hover {
  background: color-mix(in oklab, var(--muted) 40%, transparent);
  color: var(--foreground);
}
.past-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: var(--radius-lg);
  padding: 0.5rem 0.75rem;
}
.past-row:hover {
  background: color-mix(in oklab, var(--muted) 40%, transparent);
}
.past-row img {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  object-fit: cover;
}
.empty-box {
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
  padding: 2rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* ===========================================================================
   Series calendar — a rolling 5-week window from a Monday
   ======================================================================== */
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cal-nav {
  display: flex;
  gap: 0.25rem;
}
.cal-nav .btn {
  color: var(--muted-foreground);
}
.cal-nav .btn:hover {
  color: var(--foreground);
}
.cal-row {
  display: flex;
  width: 100%;
  gap: 0.25rem;
  margin-top: 0.25rem;
}
.cal-weekday {
  min-width: 0;
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: var(--muted-foreground);
}
.cal-day {
  position: relative;
  display: flex;
  height: 2.5rem;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
}
.cal-day .cal-digit {
  opacity: 0.4;
}
.cal-day .cal-month {
  font-size: 0.625rem;
  line-height: 1;
  font-weight: 600;
  text-transform: uppercase;
  opacity: 0.7;
}
.cal-day.has-event {
  border-color: var(--border);
  background: color-mix(in oklab, var(--muted) 30%, transparent);
  color: var(--foreground);
}
.cal-day.has-event .cal-digit {
  opacity: 1;
}
.cal-day.has-event:hover {
  background: color-mix(in oklab, var(--muted) 50%, transparent);
}
.cal-day.sold-out {
  border-color: color-mix(in oklab, var(--border) 60%, transparent);
  background: transparent;
  color: var(--muted-foreground);
}
.cal-day.sold-out .cal-digit {
  text-decoration: line-through;
}
.cal-day.current {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-foreground);
}
.cal-day.today {
  font-weight: 700;
}
.cal-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.cal-fold {
  width: 100%;
  justify-content: flex-start;
}
.cal-fold .chev {
  margin-left: auto;
  transition: transform 150ms;
}
.cal-fold[aria-expanded='true'] .chev {
  transform: rotate(180deg);
}
@media (min-width: 1024px) {
  .cal-fold {
    display: none;
  }
  .cal-panel {
    display: block !important;
  }
}
@media (max-width: 1023.98px) {
  .cal-heading {
    display: none;
  }
}

/* ===========================================================================
   Composer
   ======================================================================== */
.composer {
  margin: 0 auto;
  width: 100%;
  max-width: 64rem;
  padding: 2rem 1rem;
}
.composer > * + * {
  margin-top: 1.5rem;
}
@media (min-width: 640px) {
  .composer {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}
@media (min-width: 1024px) {
  .composer {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.back-link:hover {
  color: var(--foreground);
}
.back-link svg {
  width: 1rem;
  height: 1rem;
}
.composer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 2.5rem;
  row-gap: 1.5rem;
}
@media (min-width: 768px) {
  .composer-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr);
    align-items: start;
  }
}
@media (min-width: 1024px) {
  .composer-grid {
    grid-template-columns: 340px minmax(0, 1fr);
  }
}
.composer-left > * + * {
  margin-top: 0.75rem;
}
.composer-right {
  min-width: 0;
}
.composer-right > * + * {
  margin-top: 1.25rem;
}

/* ===========================================================================
   Cover on the right (v2, Style → Cover): the event page's and the
   composer's columns swap from tablet width up, widths and all. Phones keep
   one column in the same order.
   ======================================================================== */
@media (min-width: 768px) {
  .shell[data-cover='right'] :is(.event-grid, .composer-grid) {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  }
  .shell[data-cover='right'] :is(.event-cover, .event-aside) {
    grid-column: 2;
  }
  .shell[data-cover='right'] .event-main {
    grid-column: 1;
  }
  .shell[data-cover='right'] .composer-left {
    grid-column: 2;
    grid-row: 1;
  }
  .shell[data-cover='right'] .composer-right {
    grid-column: 1;
    grid-row: 1;
  }
}
@media (min-width: 1024px) {
  .shell[data-cover='right'] :is(.event-grid, .composer-grid) {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
}

.cover-edit {
  cursor: pointer;
}
.cover-edit .cover-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgb(0 0 0 / 0.5);
  color: #fff;
  opacity: 0;
  transition: opacity 150ms;
  font-size: 0.875rem;
  font-weight: 500;
}
.cover-edit:hover .cover-overlay {
  opacity: 1;
}
.cover-overlay svg {
  width: 1.5rem;
  height: 1.5rem;
}
.hint {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.hint svg {
  width: 1rem;
  height: 1rem;
  color: color-mix(in oklab, var(--muted-foreground) 50%, transparent);
}
.theme-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.theme-row .btn-theme {
  flex: 1;
  justify-content: flex-start;
}
.theme-row .btn svg {
  color: var(--muted-foreground);
}
.links-row {
  width: 100%;
  justify-content: flex-start;
}
.links-row .links-icons {
  display: flex;
  gap: 0.375rem;
  margin-left: auto;
  color: var(--muted-foreground);
}
.links-row .links-icons svg {
  width: 0.875rem;
  height: 0.875rem;
}

.top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.top-pill {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(var(--panel-blur));
  -webkit-backdrop-filter: blur(var(--panel-blur));
  color: var(--foreground);
}
.org-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
}
.org-pill .org-logo {
  border-radius: 999px;
  font-size: 9px !important;
}
.visibility-btn {
  height: 2rem;
  gap: 0.5rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
}
.visibility-btn:hover {
  background: color-mix(in oklab, var(--muted) 40%, var(--panel));
}
.vis-item {
  align-items: flex-start;
}
.vis-item svg {
  margin-top: 0.125rem;
}
.vis-item .check {
  margin-left: auto;
  color: var(--foreground);
}

.title-input {
  display: block;
  width: calc(100% + 0.5em);
  margin: -0.5em -0.25em;
  padding: 0.5em 0.25em;
  border: none;
  outline: none;
  resize: none;
  overflow: hidden;
  font-size: 2.25rem;
  line-height: 2.5rem;
  font-weight: 600;
  color: var(--foreground);
  background: transparent;
}
.title-input::placeholder {
  color: color-mix(in oklab, var(--muted-foreground) 40%, transparent);
}
.title-wrap {
  position: relative;
}
.title-pen {
  position: absolute;
  top: calc(var(--pen-y, 0.5rem) + var(--layout-card-pad, 0px));
  left: calc(var(--pen-x, 0px) + var(--layout-card-pad, 0px));
  pointer-events: none;
  color: color-mix(in oklab, var(--muted-foreground) 40%, transparent);
}
.title-pen svg {
  width: 1.25rem;
  height: 1.25rem;
}

.date-row {
  padding: 0.75rem;
}
.date-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.date-line + .date-line {
  margin-top: 0.25rem;
}
.dot {
  width: 0.625rem;
  height: 0.625rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--foreground);
}
.dot.hollow {
  background: transparent;
  border: 2px solid var(--muted-foreground);
}
.date-label {
  width: 2.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.date-controls {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}
.chip-btn {
  height: 2rem;
  border: 1px solid var(--input);
  background: color-mix(in oklab, var(--card) 60%, transparent);
  box-shadow: var(--shadow-xs);
  padding: 0 0.625rem;
  font-size: 0.875rem;
  font-weight: 400;
  position: relative;
}
[data-appearance='dark'] .chip-btn {
  background: color-mix(in oklab, var(--input) 50%, transparent);
}
.chip-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.tz-btn {
  align-self: flex-end;
  height: auto;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}
.dates-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.collapsed-row {
  height: auto;
  width: 100%;
  justify-content: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  text-align: left;
  white-space: normal;
}
.collapsed-row > svg {
  width: 1.25rem !important;
  height: 1.25rem !important;
  color: var(--muted-foreground);
}
.collapsed-row .row-text {
  display: flex;
  flex-direction: column;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.125rem;
  border-bottom: 1px solid var(--border);
  padding: 0.25rem 0.5rem;
}
.editor-toolbar .btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
}
.editor {
  min-height: 9rem;
  padding: 0.75rem 1rem;
  outline: none;
}
.editor:empty::before {
  content: attr(data-placeholder);
  white-space: pre-line;
  color: var(--muted-foreground);
}

.option-row {
  display: flex;
  min-height: 2rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  box-sizing: content-box;
}
.option-row .opt-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
}
.option-row .opt-label svg {
  width: 1rem;
  height: 1rem;
  color: var(--muted-foreground);
}
.option-row.clickable {
  cursor: pointer;
}
.value-btn {
  height: 2rem;
  gap: 0.375rem;
  padding: 0 0.5rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.value-btn svg {
  width: 0.875rem;
  height: 0.875rem;
}
.value-btn .value-icon {
  width: 1rem;
  height: 1rem;
}

/* ===========================================================================
   Testbed page switcher (not part of the app)
   ======================================================================== */
.testbed-nav {
  /* Bottom right: bottom left is a photo background's credit. */
  position: fixed;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.125rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--popover) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
  padding: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}
.testbed-nav a {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.625rem;
  color: var(--muted-foreground);
}
.testbed-nav a:hover {
  color: var(--foreground);
}
.testbed-nav a.active {
  background: var(--secondary);
  color: var(--secondary-foreground);
}
.testbed-nav svg {
  width: 0.875rem;
  height: 0.875rem;
}
@media (max-width: 640px) {
  .nav-wide {
    display: none;
  }
}
@media print {
  .testbed-nav,
  .navbar,
  .footer {
    display: none;
  }
}

/* ===========================================================================
   Testbed hub (index.html)
   ======================================================================== */
.hub-grid {
  display: grid;
  gap: 0.5rem;
}
@media (min-width: 640px) {
  .hub-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.hub-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--card);
  padding: 1rem;
  transition: background-color 150ms;
}
.hub-card:hover {
  background: color-mix(in oklab, var(--muted) 40%, var(--card));
}
.hub-card > svg {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.125rem;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

/* ===========================================================================
   Theme surface style (v2). The engine's surface tokens reach the outer
   surfaces here, after their own recipes so these win. Unthemed, every
   token falls back to the app's look (1px hairline, no shadow).
   ======================================================================== */
.panel,
.date-card,
.top-pill {
  border-width: var(--surface-border-width);
  border-color: var(--surface-border, var(--border));
}
.panel,
.date-card {
  box-shadow: var(--surface-shadow);
}
.btn-outline,
.btn-panel {
  border-width: var(--surface-border-width);
}

/* ===========================================================================
   Cards layout (v2). Every block of content sits in a card that carries its
   own colours: the engine's `--cs-*` tokens (engine.js `cardSurface`) are
   mapped onto the shadcn set inside it, so everything in a card reads them
   without knowing. A card is a `.layout-card` block, or one of the app's own
   outer surfaces (panels, panel buttons, the top pills) that isn't inside
   one. On the page, or unthemed, `.layout-card` does nothing.
   ======================================================================== */
.shell[data-layout='cards'] > :is(.navbar, .page, .footer) :is(.layout-card, .panel, .btn-panel, .top-pill):not(:is(.layout-card, .panel, .btn-panel, .top-pill) *) {
  --background: var(--cs-background);
  --foreground: var(--cs-foreground);
  --card: var(--cs-card);
  --card-foreground: var(--cs-card-foreground);
  --popover: var(--cs-popover);
  --popover-foreground: var(--cs-popover-foreground);
  --primary: var(--cs-primary);
  --primary-foreground: var(--cs-primary-foreground);
  --secondary: var(--cs-secondary);
  --secondary-foreground: var(--cs-secondary-foreground);
  --muted: var(--cs-muted);
  --muted-foreground: var(--cs-muted-foreground);
  --accent: var(--cs-accent);
  --accent-foreground: var(--cs-accent-foreground);
  --destructive: var(--cs-destructive);
  --border: var(--cs-border);
  --input: var(--cs-input);
  --ring: var(--cs-ring);
  /* Panels inside a card are a veil on it, without a blur of their own. */
  --panel: var(--cs-panel);
  --panel-blur: 0px;
  --surface-border: var(--cs-surface-border);
  color: var(--foreground);
  color-scheme: var(--cs-scheme);
  background: var(--cs-fill);
  backdrop-filter: blur(var(--cs-blur));
  -webkit-backdrop-filter: blur(var(--cs-blur));
  border: var(--surface-border-width) solid var(--surface-border);
  box-shadow: var(--surface-shadow);
  /* The card backs its own text: no Floaties halo. */
  text-shadow: none;
}
/* Glass (Cards → Material → Glass, js/theme/liquid-glass.js): the rim bends what's behind
   (`--lg-filter`, Chromium only, set per card), then frost and a lift in colour with the highlight;
   the rim's light and the host's shadow are `--lg-box-shadow`. Elsewhere the same, without the bending. */
.shell[data-layout='cards'][data-glass='liquid'] > :is(.navbar, .page, .footer) :is(.layout-card, .panel, .btn-panel, .top-pill):not(:is(.layout-card, .panel, .btn-panel, .top-pill) *) {
  -webkit-backdrop-filter: blur(var(--cs-blur)) saturate(var(--lg-saturate));
  backdrop-filter: var(--lg-filter, ) blur(var(--cs-blur)) saturate(var(--lg-saturate));
  box-shadow: var(--lg-box-shadow);
}
/* Reduce transparency or more contrast: every card solid, in its own colour. */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .shell[data-layout='cards'] > :is(.navbar, .page, .footer) :is(.layout-card, .panel, .btn-panel, .top-pill):not(:is(.layout-card, .panel, .btn-panel, .top-pill) *),
  .shell[data-layout='cards'][data-glass='liquid'] > :is(.navbar, .page, .footer) :is(.layout-card, .panel, .btn-panel, .top-pill):not(:is(.layout-card, .panel, .btn-panel, .top-pill) *) {
    background: var(--cs-background);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
/* Hovered panel buttons and pills thicken toward the muted tone, never thinner than the card. */
.shell[data-layout='cards'] > :is(.navbar, .page, .footer) :is(.btn-panel, .top-pill.btn, .layout-card.btn):not(:is(.layout-card, .panel, .btn-panel, .top-pill) *):hover {
  background: color-mix(in oklab, var(--muted) 45%, var(--cs-fill));
}
.shell[data-layout='cards'] .layout-card {
  border-radius: var(--radius-lg);
}
.shell[data-layout='cards'] :is(.layout-card:not(.layout-pill, .btn), .panel) {
  --layout-card-pad: 1rem;
}
.shell[data-layout='cards'] .layout-card:not(.layout-pill, .btn) {
  padding: var(--layout-card-pad);
}
@media (min-width: 640px) {
  .shell[data-layout='cards'] :is(.layout-card:not(.layout-pill, .btn), .panel) {
    --layout-card-pad: 1.25rem;
  }
}
/* A card's heading (`.layout-card-head`) is a header across its top, as a panel's is: a full-width line under it. */
.shell[data-layout='cards'] .layout-card-head {
  margin: calc(-1 * var(--layout-card-pad)) calc(-1 * var(--layout-card-pad)) 0;
  padding: 0.75rem var(--layout-card-pad);
  border-bottom: 1px solid var(--border);
}
.shell[data-layout='cards'] .layout-card-head + * {
  margin-top: var(--layout-card-pad);
}
.shell[data-layout='cards'] .panel-head {
  padding: 0.75rem var(--layout-card-pad);
}
.shell[data-layout='cards'] .panel-head + .panel-body {
  padding: var(--layout-card-pad);
}
.shell[data-layout='cards'] .layout-pill {
  border-radius: 999px;
}
.shell[data-layout='cards'] .layout-pill:not(.btn) {
  width: fit-content;
  padding: 0.375rem 0.75rem;
}
.shell[data-layout='cards'] .nav-right.layout-pill {
  padding: 0.25rem 0.25rem 0.25rem 0.375rem;
}
.shell[data-layout='cards'] .nav-right .nav-avatar {
  width: 1.75rem;
  height: 1.75rem;
}
.shell[data-layout='cards'] .team-strip.layout-card {
  padding: 0.625rem 0.75rem;
}
.shell[data-layout='cards'] .empty-box.layout-card {
  padding: 2rem;
}
.shell[data-layout='cards'] .footer-inner.layout-card {
  margin: 0 1rem 1rem;
}
/* The event page's side column: Hosted by, then who's going and the host links, a card each, spaced as the main column's. */
.shell[data-layout='cards'] .event-aside > .separator {
  display: none;
}
.shell[data-layout='cards'] .event-aside > * + * {
  margin-top: 2rem;
}
@media (min-width: 640px) {
  .shell[data-layout='cards'] .footer-inner.layout-card {
    margin: 0 1.5rem 1.5rem;
  }
}
/* The organiser's logo sits in its card rather than over the banner. */
.shell[data-layout='cards'] .org-head-card {
  margin-top: 1rem;
}
.shell[data-layout='cards'] .org-head-card .org-head-logo {
  margin: 0;
  box-shadow: none;
}
