:root {
  --page: #fbfaf8;
  --surface: #ffffff;
  --surface-soft: #f4f0eb;
  --surface-muted: #efede9;
  --ink: #111111;
  --ink-soft: #2c2c2c;
  --muted: #696661;
  --faint: #9a9690;
  --line: #ded9d2;
  --line-strong: #c8c2ba;
  --inverse: #0b0b0b;
  --success: #2f7a3f;
  --success-soft: #e8f4ea;
  --warning: #8b6515;
  --warning-soft: #f7f0dd;
  --danger: #a23a33;
  --danger-soft: #f8e8e6;
  --sidebar-width: 264px;
  --header-height: 68px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --shadow-menu: 0 18px 45px rgba(17, 17, 17, 0.14);
  --shadow-dialog: 0 28px 80px rgba(17, 17, 17, 0.24);
  --sans: Arial, Helvetica, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

body.drawer-open {
  overflow: hidden;
}

body.viewer-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid rgba(17, 17, 17, 0.22);
  outline-offset: 2px;
}

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

.clipboard-fallback {
  position: fixed;
  top: 0;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

.button,
.icon-button,
.text-button {
  border-radius: var(--radius-md);
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.button:hover {
  border-color: var(--ink);
  background: var(--surface-soft);
}

.button-primary {
  border-color: var(--inverse);
  background: var(--inverse);
  color: #ffffff;
}

.button-primary:hover {
  border-color: #262626;
  background: #262626;
}

.button-danger {
  border-color: #d8b0ac;
  color: var(--danger);
}

.button-danger:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.button-small {
  min-height: 38px;
  padding: 0 13px;
  font-size: 13px;
}

.button-full {
  width: 100%;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  color: var(--ink);
}

.text-button {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 6px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--inverse);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
}

.brand-name {
  display: block;
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1;
  letter-spacing: 0;
}

.brand-context {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

/* Authentication */
.auth-body {
  min-height: 100vh;
  background: var(--surface);
  overflow-x: hidden;
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(500px, 1fr) minmax(480px, 1fr);
}

.auth-form-panel {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 48px 56px;
  position: relative;
}

.auth-back {
  position: absolute;
  top: 46px;
  left: max(40px, calc(50% - 360px));
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.auth-back:hover {
  color: var(--ink);
}

.auth-form-wrap {
  width: min(100%, 460px);
  margin: auto 0;
  padding: 86px 0 40px;
}

.auth-brand-mobile {
  display: none;
}

.auth-form-wrap h1 {
  margin: 0 0 7px;
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 400;
  line-height: 1.15;
}

.auth-intro {
  margin: 0 0 34px;
  color: var(--muted);
}

.auth-alert {
  margin: -10px 0 22px;
  padding: 13px 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 13px;
}

.auth-alert-error {
  border-color: #e7aaa5;
  background: var(--danger-soft);
  color: var(--danger);
}

.auth-alert ul {
  margin: 0;
  padding-left: 20px;
}

.auth-alert li + li {
  margin-top: 4px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 18px;
}

.field label,
.permission-group legend {
  font-weight: 700;
}

.required {
  color: var(--danger);
}

.field-control {
  position: relative;
}

.field-control input,
.media-search input,
.command-search input,
.select-control select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.field-control input {
  height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 0 14px;
}

.field-control input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
}

.field-control input::placeholder,
.media-search input::placeholder,
.command-search input::placeholder {
  color: var(--faint);
}

.password-input {
  padding-right: 48px !important;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.password-toggle.is-showing {
  color: var(--ink);
}

.form-options {
  margin: 2px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.check-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink-soft);
}

.check-label input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--inverse);
  flex: 0 0 auto;
}

.terms-check {
  margin: 2px 0 22px;
}

.text-link {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-switch {
  margin: 22px 0 0;
  text-align: center;
  color: var(--muted);
}

.auth-brand-panel {
  min-height: 100vh;
  background: var(--inverse);
  color: #ffffff;
  display: grid;
  place-items: center;
  padding: 72px;
  position: relative;
  overflow: hidden;
}

.auth-brand-panel::before,
.auth-brand-panel::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 240px;
  height: 240px;
}

.auth-brand-panel::before {
  top: -80px;
  right: -60px;
}

.auth-brand-panel::after {
  bottom: -110px;
  left: -80px;
}

.auth-brand-content {
  width: min(100%, 520px);
  text-align: center;
  position: relative;
  z-index: 1;
}

.brand-lockup-inverse {
  color: #ffffff;
}

.brand-lockup-inverse .brand-mark {
  background: #ffffff;
  color: var(--inverse);
}

.auth-brand-content .brand-lockup {
  justify-content: center;
}

.auth-brand-content .brand-name {
  font-size: 34px;
}

.auth-brand-content p {
  margin: 28px auto 16px;
  max-width: 470px;
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.3;
}

.auth-brand-note {
  color: #aaa7a2;
  font-size: 12px;
  text-transform: uppercase;
}

/* Workspace shell */
.workspace-body {
  min-height: 100vh;
  background: var(--page);
  overflow-x: hidden;
}

.workspace-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 60;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  transition: transform 180ms ease;
}

.sidebar-head {
  min-height: var(--header-height);
  border-bottom: 1px solid var(--line);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-close {
  display: none;
}

.sidebar-nav {
  padding: 22px 14px;
  overflow-y: auto;
}

.nav-label {
  margin: 0 10px 8px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-label:not(:first-child) {
  margin-top: 28px;
}

.nav-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}

.nav-link {
  min-height: 44px;
  border-radius: var(--radius-md);
  padding: 0 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
}

.workspace-logout-form {
  margin: 0;
}

.nav-link-button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}

.nav-link:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.nav-link.is-active {
  background: var(--inverse);
  color: #ffffff;
}

.nav-link .nav-count {
  margin-left: auto;
  color: inherit;
  font-size: 11px;
  opacity: 0.72;
}

.sidebar-overlay {
  position: fixed;
  z-index: 50;
  inset: 0;
  border: 0;
  background: rgba(17, 17, 17, 0.46);
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.sidebar-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.workspace-main {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  min-width: 0;
}

.topbar {
  height: var(--header-height);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 248, 0.96);
  display: flex;
  align-items: center;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 35;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mobile-menu-button,
.mobile-brand {
  display: none;
}

.command-search {
  width: min(440px, 42vw);
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
}

.command-search input {
  min-width: 0;
  flex: 1;
}

.key-hint {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  color: var(--faint);
  font-size: 10px;
}

.workspace-content {
  min-width: 0;
  padding: 28px 30px 52px;
}

.restricted-workspace-content {
  min-height: calc(100vh - var(--header-height));
  display: grid;
  place-items: center;
}

.account-status-panel {
  width: min(100%, 620px);
  padding: 48px;
  text-align: center;
}

.account-status-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--warning-soft);
  color: var(--warning);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.account-status-icon .icon {
  width: 27px;
  height: 27px;
}

.account-status-panel h1 {
  margin: 4px 0 12px;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 400;
  line-height: 1.2;
}

.account-status-panel > p:not(.eyebrow) {
  max-width: 500px;
  margin: 0 auto 26px;
  color: var(--muted);
}

.restricted-account {
  margin: 0 auto 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px 14px;
  text-align: left;
}

.restricted-account > span:first-child {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.restricted-account strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.restricted-status {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.page-heading,
.section-heading,
.panel-heading,
.dialog-heading,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.page-heading {
  margin-bottom: 24px;
  align-items: flex-end;
}

.page-heading h1,
.section-heading h2,
.panel-heading h2,
.event-feature-copy h2,
.dialog-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.18;
}

.page-heading h1 {
  font-size: 30px;
}

.page-heading > div > p:last-child,
.section-heading > div > p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.workspace-view {
  min-width: 0;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card {
  min-height: 158px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.metric-icon,
.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.metric-label {
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  margin-top: 2px;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 400;
  line-height: 1.2;
}

.metric-note {
  margin-top: 4px;
  color: var(--faint);
  font-size: 11px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
  min-width: 0;
}

.event-feature {
  grid-column: span 8;
  min-height: 390px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(260px, 0.92fr) minmax(310px, 1.08fr);
}

.event-feature-image {
  min-height: 100%;
  position: relative;
  overflow: hidden;
}

.event-feature-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-feature-image .status {
  position: absolute;
  top: 16px;
  left: 16px;
}

.event-feature-copy {
  padding: 28px;
  display: flex;
  flex-direction: column;
}

.event-feature-copy h2 {
  font-size: 30px;
}

.event-feature-copy > div:first-child > p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
}

.event-stats {
  margin: auto 0 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.event-stats div {
  padding: 17px 12px;
}

.event-stats div:first-child {
  padding-left: 0;
}

.event-stats div + div {
  border-left: 1px solid var(--line);
}

.event-stats dt {
  color: var(--muted);
  font-size: 11px;
}

.event-stats dd {
  margin: 3px 0 0;
  font-weight: 700;
}

.button-row {
  display: flex;
  gap: 10px;
}

.access-panel {
  grid-column: span 4;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.panel-heading {
  align-items: flex-start;
}

.panel-heading h2 {
  font-size: 22px;
}

.access-panel > p {
  margin: 18px 0;
  color: var(--muted);
}

.access-code {
  margin: auto 0 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.access-code span {
  color: var(--muted);
}

.access-code strong {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
}

.privacy-note {
  margin-top: 15px;
  color: var(--muted);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  font-size: 11px;
}

.activity-panel {
  grid-column: span 5;
  padding: 24px;
}

.activity-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.activity-list li {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.activity-list li + li {
  border-top: 1px solid var(--line);
}

.activity-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}

.activity-list strong,
.activity-list span {
  display: block;
}

.activity-list span {
  color: var(--muted);
  font-size: 11px;
}

.recent-media-panel {
  grid-column: span 7;
  padding: 24px;
}

.recent-media-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.recent-media-grid > img,
.recent-video {
  width: 100%;
  aspect-ratio: 1 / 1.12;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.recent-media-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recent-video {
  position: relative;
}

.recent-video span,
.video-badge,
.media-kind {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-height: 24px;
  border-radius: 4px;
  background: rgba(11, 11, 11, 0.82);
  color: #ffffff;
  padding: 3px 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
}

.section-heading {
  margin-bottom: 20px;
  align-items: flex-end;
}

.section-heading h2 {
  font-size: 28px;
}

.overview-section-heading {
  margin-top: 4px;
}

/* Events */
.event-list {
  overflow: hidden;
}

.event-row {
  min-height: 112px;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: minmax(190px, 1.7fr) repeat(3, minmax(72px, 0.68fr)) 65px minmax(240px, auto);
  align-items: center;
  gap: 16px;
}

.event-row + .event-row {
  border-top: 1px solid var(--line);
}

.event-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
}

.event-identity img {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex: 0 0 auto;
}

.event-identity strong,
.event-identity span,
.event-data strong,
.event-data span {
  display: block;
}

.event-identity strong {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
}

.event-identity span,
.event-data span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.event-data strong {
  font-size: 13px;
}

.status {
  width: max-content;
  min-height: 25px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 3px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

.status-live {
  border-color: #a8cfb0;
  background: var(--success-soft);
  color: var(--success);
}

.status-active {
  border-color: #d8c68f;
  background: var(--warning-soft);
  color: var(--warning);
}

.status-ended {
  background: var(--surface-soft);
  color: var(--muted);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.row-actions .icon-button {
  width: 38px;
  height: 38px;
}

/* Media */
.gallery-heading {
  align-items: flex-end;
}

.event-picker {
  min-width: 250px;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.event-picker .select-control {
  width: 100%;
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
}

.gallery-toolbar {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.media-toolbar {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.select-control,
.media-search {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  display: flex;
  align-items: center;
}

.select-control {
  min-width: 205px;
  position: relative;
}

.select-control select {
  height: 100%;
  appearance: none;
  padding: 0 40px 0 13px;
}

.select-control .icon {
  position: absolute;
  right: 12px;
  pointer-events: none;
}

.media-search {
  width: min(300px, 30vw);
  color: var(--muted);
  gap: 9px;
  padding: 0 12px;
}

.media-search input {
  min-width: 0;
  flex: 1;
}

.segmented-control {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 3px;
  display: inline-flex;
  align-items: center;
}

.segmented-control button {
  min-height: 34px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  padding: 0 13px;
  font-weight: 700;
}

.segmented-control button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line);
}

.media-toolbar > .button {
  margin-left: auto;
}

.selection-bar {
  min-height: 56px;
  margin-bottom: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 8px 10px 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.selection-bar > div {
  display: flex;
  gap: 7px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.gallery-grid {
  gap: 5px;
}

.media-item {
  min-width: 0;
  aspect-ratio: 1 / 1.08;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  overflow: hidden;
  position: relative;
}

.gallery-grid .media-item {
  aspect-ratio: 1 / 1.08;
  border-radius: 4px;
}

.media-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-radius: inherit;
  pointer-events: none;
}

.media-item.is-selected::after {
  border-color: var(--inverse);
}

.media-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.media-open {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  display: block;
  overflow: hidden;
  cursor: zoom-in;
}

.media-item:hover img {
  transform: scale(1.02);
}

.media-select {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  background: rgba(11, 11, 11, 0.54);
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.media-select:hover,
.media-select[aria-pressed="true"] {
  background: #ffffff;
  color: var(--ink);
}

.media-kind {
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.empty-state {
  margin: 40px 0;
  color: var(--muted);
  text-align: center;
}

/* Fullscreen gallery viewer */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  min-width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #0b0b0b;
  color: #ffffff;
  padding: 0;
  overflow: hidden;
}

.gallery-lightbox::backdrop {
  background: #0b0b0b;
}

.lightbox-shell {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 66px minmax(0, 1fr) auto;
  transition: grid-template-rows 180ms ease;
}

.lightbox-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  padding: 0 20px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 14px;
  overflow: hidden;
  transition: opacity 150ms ease;
}

.lightbox-event {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--serif);
  font-size: 18px;
}

.lightbox-icon-button,
.lightbox-nav {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lightbox-icon-button {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
}

.lightbox-icon-button:hover,
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.18);
}

.lightbox-download {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

.lightbox-header [data-lightbox-close] {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.lightbox-stage {
  min-width: 0;
  min-height: 0;
  padding: 24px 76px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: pan-y;
  transition: padding 180ms ease;
}

.lightbox-media {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  will-change: transform, opacity;
}

.lightbox-media img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
}

.lightbox-video-indicator {
  position: absolute;
  left: 50%;
  top: 50%;
  min-width: 76px;
  min-height: 76px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(11, 11, 11, 0.72);
  color: #ffffff;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
}

.lightbox-video-indicator .icon {
  width: 30px;
  height: 30px;
}

.lightbox-video-indicator span {
  position: absolute;
  top: calc(100% + 10px);
  width: max-content;
  font-size: 11px;
}

.lightbox-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-info {
  min-height: 82px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(11, 11, 11, 0.94);
  padding: 15px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  overflow: hidden;
  transition: opacity 150ms ease;
}

.lightbox-info h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
}

.lightbox-info p {
  margin: 4px 0 0;
  color: #b9b6b1;
  font-size: 11px;
}

.lightbox-info > span {
  color: #d4d1cc;
  white-space: nowrap;
}

.gallery-lightbox.is-immersive .lightbox-shell {
  grid-template-rows: 0 minmax(0, 1fr) 0;
}

.gallery-lightbox.is-immersive .lightbox-header,
.gallery-lightbox.is-immersive .lightbox-info,
.gallery-lightbox.is-immersive .lightbox-nav,
.gallery-lightbox.is-immersive .lightbox-video-indicator {
  opacity: 0;
  pointer-events: none;
}

.gallery-lightbox.is-immersive .lightbox-stage {
  padding: 0;
}

/* Dialog and feedback */
.event-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-dialog);
  padding: 0;
  overflow: auto;
}

.event-dialog::backdrop {
  background: rgba(17, 17, 17, 0.54);
}

.event-form {
  margin: 0;
}

.dialog-heading,
.dialog-actions {
  min-height: 78px;
  padding: 16px 22px;
}

.dialog-heading {
  border-bottom: 1px solid var(--line);
}

.dialog-heading h2 {
  font-size: 25px;
}

.dialog-body {
  padding: 22px;
}

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

.permission-group {
  margin: 5px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 4px 16px;
}

.permission-group legend {
  padding: 0 6px;
}

.toggle-row {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.toggle-row + .toggle-row {
  border-top: 1px solid var(--line);
}

.toggle-row strong,
.toggle-row small {
  display: block;
}

.toggle-row small {
  margin-top: 2px;
  color: var(--muted);
}

.toggle-row input {
  width: 42px;
  height: 24px;
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-muted);
  position: relative;
  flex: 0 0 auto;
  transition: background 150ms ease, border-color 150ms ease;
}

.toggle-row input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(17, 17, 17, 0.22);
  transition: transform 150ms ease;
}

.toggle-row input:checked {
  border-color: var(--inverse);
  background: var(--inverse);
}

.toggle-row input:checked::after {
  transform: translateX(18px);
}

.dialog-actions {
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 32px));
  min-height: 48px;
  border: 1px solid #333333;
  border-radius: var(--radius-md);
  background: var(--inverse);
  color: #ffffff;
  box-shadow: var(--shadow-menu);
  padding: 13px 16px;
}

@media (max-width: 1199px) {
  :root {
    --sidebar-width: 248px;
  }

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

  .event-feature,
  .access-panel,
  .activity-panel,
  .recent-media-panel {
    grid-column: 1 / -1;
  }

  .event-feature {
    min-height: 350px;
  }

  .event-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .event-identity {
    grid-column: 1;
  }

  .event-row > .event-data {
    display: none;
  }

  .event-row > .status {
    grid-column: 2;
    grid-row: 1;
  }

  .row-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    padding-top: 12px;
  }

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

  .media-toolbar > .button {
    margin-left: 0;
  }
}

@media (max-width: 899px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-brand-panel {
    display: none;
  }

  .auth-brand-mobile {
    margin-bottom: 40px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
  }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-menu);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: inline-flex;
  }

  .workspace-main {
    margin-left: 0;
  }

  .topbar {
    height: 66px;
    padding: 0 16px;
  }

  .mobile-menu-button,
  .mobile-brand {
    display: inline-flex;
  }

  .mobile-brand .brand-name {
    font-size: 20px;
  }

  .mobile-brand .brand-mark {
    width: 32px;
    height: 32px;
  }

  .command-search {
    display: none;
  }

  .workspace-content {
    padding: 22px 18px 40px;
  }

  .event-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .event-identity {
    grid-column: 1;
  }

  .event-row > .event-data {
    display: none;
  }

  .event-row > .status {
    grid-column: 2;
    grid-row: 1;
  }

  .row-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    padding-top: 12px;
  }

  .media-search {
    width: min(300px, 48vw);
  }

  .gallery-heading {
    align-items: flex-end;
  }
}

@media (max-width: 599px) {
  .auth-form-panel {
    padding: 26px 22px;
  }

  .auth-back {
    top: 24px;
    left: 22px;
  }

  .auth-form-wrap {
    padding-top: 82px;
  }

  .auth-brand-mobile {
    margin-bottom: 34px;
  }

  .auth-form-wrap h1 {
    font-size: 31px;
  }

  .account-status-panel {
    padding: 32px 22px;
  }

  .account-status-panel h1 {
    font-size: 29px;
  }

  .form-options {
    align-items: flex-start;
  }

  .topbar {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 10px;
    width: 100%;
    min-width: 0;
  }

  .topbar-left {
    display: contents;
  }

  .mobile-menu-button {
    grid-column: 1;
    justify-self: start;
  }

  .mobile-brand {
    grid-column: 2;
    justify-self: center;
    min-width: 0;
    gap: 8px;
  }

  .mobile-brand .brand-mark {
    width: 30px;
    height: 30px;
  }

  .mobile-brand .brand-name {
    font-size: 18px;
  }

  .workspace-content {
    padding: 18px 14px 34px;
  }

  .page-heading,
  .section-heading {
    display: block;
  }

  .event-picker {
    width: 100%;
    min-width: 0;
    margin-top: 16px;
  }

  .page-heading h1 {
    font-size: 25px;
  }

  .page-heading > .button,
  .section-heading > .button {
    width: 100%;
    margin-top: 15px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metric-card {
    min-height: 148px;
    padding: 16px;
  }

  .metric-value {
    font-size: 23px;
  }

  .event-feature {
    display: block;
    min-height: 0;
  }

  .event-feature-image {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .event-feature-copy {
    padding: 20px;
  }

  .event-feature-copy h2 {
    font-size: 26px;
  }

  .event-stats {
    margin: 24px 0 20px;
  }

  .event-stats div {
    padding: 13px 8px;
  }

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

  .access-panel,
  .activity-panel,
  .recent-media-panel {
    padding: 20px;
  }

  .recent-media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recent-media-grid > img,
  .recent-video {
    aspect-ratio: 1 / 1;
  }

  .event-row {
    padding: 14px;
    gap: 12px;
  }

  .event-identity img {
    width: 58px;
    height: 58px;
  }

  .event-identity strong {
    font-size: 16px;
  }

  .row-actions .button {
    flex: 1;
  }

  .media-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .select-control,
  .media-search {
    width: 100%;
    min-width: 0;
  }

  .segmented-control {
    width: 100%;
  }

  .segmented-control button {
    flex: 1;
    padding: 0 8px;
  }

  .media-toolbar > .button {
    width: 100%;
  }

  .selection-bar {
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  .selection-bar > div {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .selection-bar .button {
    padding: 0 7px;
    gap: 5px;
  }

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

  .media-item {
    aspect-ratio: 1 / 1.12;
  }

  .media-select {
    top: 7px;
    left: 7px;
    width: 27px;
    height: 27px;
  }

  .lightbox-shell {
    grid-template-rows: 56px minmax(0, 1fr) auto;
  }

  .gallery-lightbox {
    inset: 0;
    width: 100%;
    min-width: 100%;
    height: 100%;
    min-height: 100%;
  }

  .lightbox-header {
    padding: 0 10px;
  }

  .lightbox-stage {
    padding: 12px 42px;
  }

  .lightbox-nav {
    width: 36px;
    height: 36px;
  }

  .lightbox-prev {
    left: 5px;
  }

  .lightbox-next {
    right: 5px;
  }

  .lightbox-info {
    min-height: 96px;
    padding: 14px 16px;
    align-items: flex-start;
  }

  .lightbox-info h2 {
    font-size: 16px;
  }

  .lightbox-info p {
    max-width: 240px;
  }

  .dialog-heading,
  .dialog-actions {
    padding: 14px 16px;
  }

  .dialog-body {
    padding: 18px 16px;
  }

  .dialog-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .dialog-actions .button {
    flex: 1;
  }

  .toast {
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 370px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .selection-bar > div {
    grid-template-columns: 1fr;
  }
}
