.ra-root {
  --ra-surface: var(--surface, #fff);
  --ra-text: var(--text, #182e3d);
  --ra-border: var(--border, #c6d1d8);
  color: var(--ra-text);
  font:
    1rem/1.5 system-ui,
    sans-serif;
}
.ra-dialog {
  width: min(60rem, calc(100vw - 2rem));
  max-height: 90dvh;
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--ra-border);
  border-radius: 1rem;
  background: var(--ra-surface);
  color: var(--ra-text);
}
.ra-dialog::backdrop {
  background: #0007;
}
.ra-head,
.ra-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 0.75rem 0;
}
.ra-head h2 {
  flex: 1;
  margin: 0;
  font-size: 1.2rem;
}
.ra-button {
  border: 1px solid var(--ra-border);
  border-radius: 0.65rem;
  background: var(--ra-surface);
  color: inherit;
  padding: 0.6rem 0.8rem;
  min-height: 44px;
  cursor: pointer;
  white-space: nowrap;
}
.ra-button:disabled {
  opacity: 0.6;
  cursor: wait;
}
.ra-form {
  display: grid;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--ra-border);
}
.ra-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 0.75rem;
}
.ra-field {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}
.ra-field input,
.ra-field select {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 0.5rem;
  color: inherit;
  background: var(--ra-surface);
  border: 1px solid var(--ra-border);
  border-radius: 0.5rem;
}
.ra-picks {
  border: 1px solid var(--ra-border);
  border-radius: 0.6rem;
  padding: 0.5rem;
  max-height: 13rem;
  overflow: auto;
}
.ra-picks label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.35rem;
}
.ra-feedback {
  padding: 0.5rem 0;
  min-height: 1.5rem;
  overflow-wrap: anywhere;
}
.ra-table-wrap {
  overflow: auto;
  max-height: 24rem;
}
.ra-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.ra-table th,
.ra-table td {
  padding: 0.5rem;
  border-bottom: 1px solid var(--ra-border);
  vertical-align: top;
}
.ra-table summary {
  cursor: pointer;
  white-space: nowrap;
}
.ra-table details[open] {
  display: grid;
  gap: 0.4rem;
}
.ra-secret {
  border: 1px solid var(--ra-border);
  padding: 0.75rem;
  margin-top: 0.75rem;
  border-radius: 0.6rem;
}
.ra-secret svg {
  width: min(15rem, 100%);
  height: auto;
}
.ra-page {
  max-width: 60rem;
  margin: auto;
  padding: 1rem;
}
.ra-page h1 {
  font-size: 1.4rem;
}
.ra-section {
  padding: 1rem 0;
  border-top: 1px solid var(--ra-border);
}
.ra-body {
  margin: 0;
  background: #edf3f7;
}
@media (prefers-color-scheme: dark) {
  .ra-body {
    background: #101b24;
  }
  .ra-body .ra-root {
    --ra-surface: #162630;
    --ra-text: #e7eef4;
    --ra-border: #536572;
  }
}
@media (max-width: 600px) {
  .ra-dialog {
    padding: 0.75rem;
  }
  .ra-dialog,
  .ra-page {
    font-size: 0.9rem;
  }
}
html[data-theme-mode='dark'] .ra-root {
  --ra-surface: #162630;
  --ra-text: #e7eef4;
  --ra-border: #536572;
}
.ra-form > details,
.ra-dialog > div > details {
  margin-block: 0.75rem;
  padding-block: 0.75rem;
  border-top: 1px solid var(--ra-border);
}
.ra-table details[open] {
  max-height: 16rem;
  overflow: auto;
}
.ra-root p,
.ra-table td {
  overflow-wrap: anywhere;
}
.ra-root .ra-section article p {
  white-space: pre-wrap;
}
.ra-dialog {
  box-sizing: border-box;
}
.ra-root [hidden] {
  display: none !important;
}

.ra-root input[type='checkbox'] {
  appearance: auto;
  width: 1.1rem;
  height: 1.1rem;
  min-height: 0;
  padding: 0;
  flex-shrink: 0;
}
.ra-grid > label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ra-page > .ra-button {
  margin-inline-end: 0.6rem;
  margin-block: 0.35rem;
}

.ra-review-editor {
  min-width: min(21rem, 70vw);
  display: grid;
  gap: 0.7rem;
  margin-top: 0.5rem;
}
.ra-review-editor p,
.ra-review-editor li,
.ra-table td {
  overflow-wrap: anywhere;
}
.ra-review-fields {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.7rem;
  min-width: 0;
}
.ra-review-fields textarea {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  color: inherit;
  background: var(--ra-surface);
  border: 1px solid var(--ra-border);
  border-radius: 0.5rem;
  padding: 0.5rem;
  font: inherit;
}
.ra-review-fields label:has(input[type='checkbox']) {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}
.ra-review-fields input[type='checkbox'] {
  flex: 0 0 auto;
  margin-top: 0.35rem;
}

/* Preserve readable words; narrow screens scroll inside the table wrapper. */
.ra-reviews-table {
  min-width: 44rem;
}
.ra-reviews-table th,
.ra-reviews-table td {
  min-width: 9rem;
  overflow-wrap: normal;
  word-break: normal;
}
.ra-reviews-table th:first-child,
.ra-reviews-table td:first-child {
  min-width: 10rem;
  overflow-wrap: anywhere;
}
.ra-reviews-table th:last-child,
.ra-reviews-table td:last-child {
  min-width: 7rem;
}

.ra-review-picks {
  min-width: 0;
  display: grid;
  gap: 0.6rem;
  max-height: 18rem;
  overflow: auto;
  border: 1px solid var(--ra-border);
  border-radius: 0.5rem;
  padding: 0.6rem;
}
.ra-review-picks label {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}
.ra-review-picks input {
  flex: 0 0 auto;
}
.ra-review-choice {
  display: grid;
  gap: 0.4rem;
  border-top: 1px solid var(--ra-border);
  padding-top: 0.5rem;
}
.ra-review-preview {
  max-height: 18rem;
  overflow: auto;
  padding: 0.6rem;
  border: 1px solid var(--ra-border);
  border-radius: 0.5rem;
}
.ra-review-preview h3 {
  font-size: 1rem;
  margin: 0 0 0.6rem;
}
.ra-review-preview p {
  margin: 0.5rem 0;
}

.ra-preview-ledger {
  min-width: 22rem;
}

/* Keep account projections compact and local to their own renderer wrapper. */
.ra-account-view {
  display: grid;
  align-content: start;
  gap: 0.65rem;
  min-width: 0;
}
.ra-account-view > h2,
.ra-account-view .ra-section > h3 {
  margin: 0;
  font-size: 1.1rem;
}
.ra-account-view > .ra-feedback:empty {
  display: none;
}
.ra-account-view .ra-section {
  padding-block: 0.75rem;
  margin: 0;
}

.ra-location-picks,
.ra-location-section {
  overflow-wrap: anywhere;
}
.ra-location-picks label {
  min-width: 0;
}

.ra-sport-event {
  display: grid;
  min-width: 0;
  gap: 0.6rem;
  overflow-wrap: anywhere;
  border-top: 1px solid var(--ra-border);
  padding-block: 0.8rem;
}
.ra-sport-event h3,
.ra-sport-event p {
  margin: 0;
}
.ra-sport-event details {
  min-width: 0;
}
.ra-sport-event summary {
  cursor: pointer;
  padding-block: 0.35rem;
}
.ra-sport-event .ra-table-wrap {
  max-width: 100%;
  margin-top: 0.4rem;
}
.ra-sport-event th {
  white-space: nowrap;
}
.ra-sport-event td {
  min-width: 4rem;
  max-width: 18rem;
}

.ra-website-view {
  display: grid;
  min-width: 0;
  gap: 0.65rem;
  overflow-wrap: anywhere;
}
.ra-website-view p {
  white-space: pre-wrap;
}
.ra-website-view h3,
.ra-website-view h4,
.ra-website-view p {
  margin: 0;
}
.ra-website-view section {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

.ra-attachment-preview {
  display: grid;
  min-width: 0;
  gap: 0.6rem;
}
.ra-attachment-preview:empty {
  display: none;
}
.ra-attachment-preview pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 24rem;
  overflow: auto;
}
.ra-attachment-preview img {
  max-width: 100%;
  max-height: 32rem;
  object-fit: contain;
}

/* Keep adjacent scope explanations and empty-state messages separate. */
.ra-picks > small {
  display: block;
  margin-block: 0.25rem;
}

.ra-scorecard .ra-table-wrap {
  max-height: min(42vh, 24rem);
  overflow: auto;
}
.ra-scorecard th {
  position: sticky;
  top: 0;
  background: var(--ra-surface);
  z-index: 1;
}
