:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7f4;
  color: #1c2520;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(34, 95, 93, 0.08), transparent 34rem),
    #f6f7f4;
}

.page {
  min-height: 100vh;
  padding: 2rem;
}

.auth-panel {
  width: min(100%, 24rem);
  margin: min(12vh, 6rem) auto 0;
  padding: 2rem;
  border: 1px solid #d7ded9;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(28, 37, 32, 0.08);
}

h1 {
  margin: 0 0 1.5rem;
  font-size: 1.75rem;
  line-height: 1.15;
}

.login-form {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.35rem;
  color: #425049;
  font-size: 0.95rem;
}

input,
select {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid #b8c4bd;
  border-radius: 6px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  color: #1c2520;
  background: #ffffff;
}

input[type="file"] {
  padding: 0.6rem 0.8rem;
}

input:focus {
  outline: 3px solid rgba(12, 117, 104, 0.18);
  border-color: #0c7568;
}

select:focus {
  outline: 3px solid rgba(12, 117, 104, 0.18);
  border-color: #0c7568;
}

button {
  min-height: 2.75rem;
  border: 0;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font: inherit;
  font-weight: 700;
  color: #ffffff;
  background: #0c7568;
  cursor: pointer;
}

button:hover {
  background: #095f55;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button.secondary {
  color: #0c7568;
  background: #e8f1ee;
}

button.secondary:hover {
  background: #d8e7e3;
}

button.danger {
  background: #9d2f2f;
}

button.danger:hover {
  background: #7f2424;
}

button.compact,
.button-link {
  min-height: 2.2rem;
  padding: 0.45rem 0.7rem;
  font-size: 0.86rem;
}

.form-error {
  margin: 0;
  padding: 0.75rem;
  border-radius: 6px;
  color: #7a1f1f;
  background: #fde8e8;
}

.top-nav {
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 2rem;
  border-bottom: 1px solid #d7ded9;
  background: rgba(255, 255, 255, 0.86);
}

.brand {
  color: #1c2520;
  font-weight: 800;
  text-decoration: none;
}

.top-nav nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.team-switcher,
.invite-form {
  display: flex;
  align-items: end;
  gap: 0.5rem;
}

.team-switcher label {
  min-width: 10rem;
}

.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;
}

.auth-action {
  margin-top: 0.75rem;
}

.top-nav a:not(.brand),
.link-button {
  min-height: 2.4rem;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  color: #425049;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  background: transparent;
}

.top-nav a.active,
.top-nav a:not(.brand):hover,
.link-button:hover {
  color: #0c7568;
  background: #e8f1ee;
}

.link-button {
  border: 0;
  cursor: pointer;
}

.dashboard {
  width: min(100%, 72rem);
  margin: 0 auto;
}

.page-header,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin-bottom: 0;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: #5c6961;
  font-size: 0.95rem;
}

.dashboard-meta {
  margin: 0.5rem 0 0;
  color: #425049;
}

.panel,
.sessions-section {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #d7ded9;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 38px rgba(28, 37, 32, 0.06);
}

.panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 28rem);
  align-items: end;
  gap: 1rem;
}

h2 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.2;
}

.panel-meta {
  margin: 0.4rem 0 0;
  color: #5c6961;
  font-size: 0.95rem;
}

.upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.75rem;
}

.flash {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
}

.flash-success {
  color: #14583e;
  background: #e4f5ec;
}

.flash-notice {
  color: #4e4520;
  background: #f8efd0;
}

.flash-error {
  color: #7a1f1f;
  background: #fde8e8;
}

.table-wrap {
  width: 100%;
  margin-top: 1rem;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 0.75rem;
  border-bottom: 1px solid #e4e9e5;
  text-align: left;
  vertical-align: top;
}

th {
  color: #425049;
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.table-actions form {
  margin: 0;
}

.button-link {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  color: #0c7568;
  font-weight: 700;
  text-decoration: none;
  background: #e8f1ee;
}

.button-link:hover {
  background: #d8e7e3;
}

.empty-state {
  margin: 1rem 0 0;
  color: #5c6961;
}

.profile-panel {
  display: block;
}

.profile-panel dl {
  display: grid;
  gap: 1rem;
  margin: 0;
}

.profile-panel dl div {
  display: grid;
  gap: 0.25rem;
}

.profile-panel dt {
  color: #5c6961;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.profile-panel dd {
  margin: 0;
}

.session-detail {
  width: min(100%, 76rem);
  margin: 0 auto;
}

.session-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.session-summary > div {
  min-width: 0;
  padding: 0.9rem 1rem;
  border: 1px solid #d7ded9;
  border-radius: 8px;
  background: #ffffff;
}

.summary-label {
  display: block;
  margin-bottom: 0.3rem;
  color: #5c6961;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.session-summary strong {
  display: block;
  overflow-wrap: anywhere;
}

.replay-panel {
  padding: 1rem;
  border: 1px solid #d7ded9;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 38px rgba(28, 37, 32, 0.06);
}

.replay-header,
.replay-controls,
.replay-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.replay-header {
  justify-content: space-between;
  margin-bottom: 1rem;
}

.replay-position {
  color: #425049;
  font-weight: 800;
}

.replay-chart-wrap {
  position: relative;
  height: clamp(30rem, 68vh, 48rem);
  min-height: 30rem;
  padding: 0.5rem;
  border: 1px solid #e4e9e5;
  border-radius: 8px;
}

.replay-chart-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.replay-controls {
  margin-top: 1rem;
}

.replay-slider-label {
  flex: 1;
  min-width: 14rem;
}

.replay-slider-label input {
  min-height: 2rem;
  padding: 0;
}

.replay-meta {
  align-items: stretch;
  flex-wrap: wrap;
  margin: 1rem 0 0;
}

.replay-meta div {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.75rem;
  border-radius: 6px;
  background: #f6f7f4;
}

.replay-meta dt {
  margin-bottom: 0.25rem;
  color: #5c6961;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.replay-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 42rem) {
  .page {
    padding: 1rem;
  }

  .auth-panel {
    padding: 1.25rem;
  }

  .top-nav,
  .page-header,
  .section-heading,
  .panel,
  .upload-form {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav,
  .panel,
  .upload-form,
  .invite-form {
    display: flex;
  }

  .top-nav {
    padding: 0.75rem 1rem;
  }

  .top-nav nav {
    flex-wrap: wrap;
  }

  .upload-form,
  .upload-form button,
  .invite-form,
  .invite-form button {
    width: 100%;
  }

  .session-summary {
    grid-template-columns: 1fr;
  }

  .replay-header,
  .replay-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .replay-controls button,
  .replay-slider-label {
    width: 100%;
  }

  .replay-chart-wrap {
    height: 28rem;
    min-height: 28rem;
  }
}
