:root {
  color-scheme: light;
  --ink: #152421;
  --muted: #5d6865;
  --line: #d8e1de;
  --soft: #eef5f2;
  --panel: #ffffff;
  --green: #0f766e;
  --green-strong: #0b5f59;
  --gold: #d79922;
  --red: #b42318;
  --blue: #1d4ed8;
  --shadow: 0 18px 48px rgba(18, 36, 32, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f7faf8;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.admin-dot {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 20;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: transparent;
}

.admin-dot:focus-visible {
  outline: 2px solid var(--gold);
  background: var(--gold);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 18px clamp(18px, 4vw, 52px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand-lockup,
.meet-status,
.workspace-top,
.browser-head,
.dialog-actions,
.top-actions,
.row-actions,
.announcement-card,
.status-pill {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 12px;
}

.mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.kicker {
  margin: 0 0 2px;
  color: var(--green-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
}

h3 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.meet-status {
  gap: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

main {
  padding: clamp(18px, 4vw, 48px);
}

.hero {
  position: relative;
  min-height: calc(100vh - 132px);
  display: grid;
  align-content: center;
  gap: 28px;
  overflow: hidden;
  padding: clamp(22px, 6vw, 72px);
  border-radius: 8px;
  background: #eaf3ef;
  box-shadow: var(--shadow);
}

.track-visual {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0.55;
}

.track-line {
  position: absolute;
  inset: 10% -10% auto;
  height: 58%;
  border: 34px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  transform: rotate(-8deg);
}

.lane {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 10px rgba(215, 153, 34, 0.14);
}

.lane-a {
  top: 26%;
  left: 28%;
}

.lane-b {
  top: 48%;
  right: 22%;
  background: var(--blue);
}

.lane-c {
  bottom: 22%;
  left: 58%;
  background: var(--green);
}

.hero-copy,
.role-grid {
  position: relative;
  z-index: 1;
}

.hero-copy h2 {
  max-width: 760px;
  font-size: clamp(2.6rem, 8vw, 6.5rem);
  line-height: 0.96;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(145px, 1fr));
  gap: 12px;
}

.role-card {
  min-height: 118px;
  padding: 18px;
  text-align: left;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(18, 36, 32, 0.08);
}

.role-card span {
  display: block;
  margin-bottom: 10px;
  font-size: 1.05rem;
  font-weight: 800;
}

.role-card small {
  color: var(--muted);
  line-height: 1.4;
}

.workspace,
.admin-view {
  display: grid;
  gap: 18px;
}

.workspace-top {
  justify-content: space-between;
  gap: 16px;
}

.top-actions {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(240px, 330px) 1fr;
  gap: 18px;
  min-height: 620px;
}

.race-browser,
.race-detail,
.admin-grid > section,
.closed-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(18, 36, 32, 0.06);
}

.race-browser {
  padding: 14px;
}

.browser-head {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.race-list {
  display: grid;
  gap: 8px;
}

.race-file {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  width: 100%;
  min-height: 70px;
  padding: 12px;
  text-align: left;
  border-radius: 8px;
  background: #f8fbfa;
  color: var(--ink);
  border: 1px solid transparent;
}

.race-file.active {
  border-color: var(--green);
  background: var(--soft);
}

.file-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 42px;
  border-radius: 5px;
  background: #dbeafe;
  color: var(--blue);
  font-weight: 900;
}

.race-file strong,
.race-file small {
  display: block;
}

.race-file small {
  margin-top: 4px;
  color: var(--muted);
}

.race-detail {
  overflow: hidden;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.status-pill {
  gap: 6px;
  width: max-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--green-strong);
  font-size: 0.82rem;
  font-weight: 800;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 830px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  background: #fbfdfc;
  color: #35423f;
  font-size: 0.8rem;
  text-transform: uppercase;
}

td input,
td select,
.dialog-card input,
.dialog-card select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
}

.row-actions {
  gap: 6px;
}

button,
.ghost-button {
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 7px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.ghost-button,
.small-button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.small-button {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 0.84rem;
}

.danger {
  background: var(--red);
}

.empty-state {
  padding: 38px;
  color: var(--muted);
}

.closed-panel {
  padding: 18px;
  color: var(--red);
  font-weight: 800;
}

.announcement-stack {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.announcement-card {
  justify-content: space-between;
  gap: 18px;
  padding: clamp(18px, 3vw, 30px);
  border: 2px solid var(--gold);
  border-radius: 8px;
  background: #fff9e8;
}

.announcement-card strong {
  display: block;
  font-size: clamp(1.6rem, 4vw, 3rem);
}

.announcement-card span {
  display: block;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.4rem);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(250px, 360px) 1fr;
  gap: 18px;
}

.admin-grid > section {
  padding: 18px;
}

.access-list,
.audit-log {
  display: grid;
  gap: 10px;
}

.access-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.audit-log {
  max-height: 560px;
  overflow: auto;
}

.audit-item {
  padding: 12px;
  border-left: 4px solid var(--green);
  background: #f8fbfa;
}

.audit-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(21, 36, 33, 0.34);
}

.dialog-card {
  min-width: min(620px, calc(100vw - 28px));
  padding: 22px;
}

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

label {
  display: grid;
  gap: 6px;
  color: #36423f;
  font-weight: 750;
}

.dialog-actions {
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.error {
  margin: 10px 0 0;
  color: var(--red);
  font-weight: 800;
}

@media (max-width: 950px) {
  .role-grid,
  .workspace-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

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

  .workspace-layout {
    min-height: auto;
  }
}

@media (max-width: 620px) {
  .app-header,
  .workspace-top,
  .detail-head {
    align-items: flex-start;
    flex-direction: column;
  }

  main {
    padding: 12px;
  }

  .hero {
    min-height: auto;
    padding: 24px;
  }

  .role-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .role-card {
    min-height: 92px;
  }
}
