:root {
  --maxw: 1200px;
  --gap: 16px;
}

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

body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f6f7f9;
  color: #222;
}

.container {
  max-width: var(--maxw);
  margin: 24px auto;
  padding: 16px;
}

h1,h2,h3 {
  margin: 0 0 12px;
}

hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 16px 0;
}

.small {
  font-size: 13px;
  color: #444;
}

.muted {
  color: #555;
  font-size: 14px;
}

/* ---------- Forms ---------- */
.form {
  display: grid;
  gap: 12px;
  max-width: 620px;
}

label {
  display: grid;
  gap: 6px;
}

input,
select,
textarea {
  padding: 10px;
  font-size: 16px;
  width: 100%;
}

button {
  padding: 10px;
  font-size: 16px;
}



button {
  cursor: pointer;
}

.inline {
  display: inline-block;
  margin-right: 8px;
  margin-bottom: 6px;
}

/* ---------- Notices ---------- */
.notice {
  padding: 12px;
  border-radius: 8px;
  margin: 12px 0;
}

.notice.error { background: #ffe6e6; }
.notice.success { background: #e6ffea; }
.notice.info { background: #e8f1ff; }
.form-status {
  margin-top: 8px;
}

/* ---------- Cards / Layout ---------- */
.card {
  background: #fff;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
  margin: 12px 0;
}

.card ul {
  margin-left: 18px;
}

.card li {
  margin-bottom: 8px;
}
/* Tighter list spacing inside cards */
.card ul {
  margin-top: 6px;
  margin-bottom: 6px;
  line-height: 1.3;
}

/* Main list items */
.card > ul > li {
  margin-bottom: 6px;
}

/* Nested lists (sub-points) */
.card ul ul {
  margin-top: 4px;
  margin-bottom: 4px;
  padding-left: 16px;
  line-height: 1.25;
}

.card ul ul li {
  margin-bottom: 3px;
}

.sticky-card {
  position: sticky;
  top: 12px;
  z-index: 20;
}

.toolbar {
  margin: 12px 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}

@media (min-width: 1000px) {
  .grid2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Buttons ---------- */
.button {
  display: inline-block;
  padding: 10px 12px;
  background: #222;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  text-align: center;
  border: none;
  appearance: none;
}

/* ---------- Tables ---------- */
/*.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}*/

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.table th,
.table td {
  border: 1px solid #ddd;
  padding: 8px;
  vertical-align: top;
  white-space: normal;
}

.actions-hidden .actions-cell,
.actions-hidden .actions-header {
  display: none;
}

.actions-hidden [data-modify-control] {
  opacity: .65;
}

.actions-hidden [data-modify-control] select,
.actions-hidden [data-modify-control] button {
  cursor: not-allowed;
}

.registrations-view .modify-readonly {
  display: none;
}

.actions-hidden .modify-readonly {
  display: inline;
}

.actions-hidden [data-modify-control] {
  display: none;
}

/* optional: only if table really needs width */
.table.wide {
  min-width: 900px;
}

/* ---------- Core marker ---------- */
.core-row {
  font-weight: 700;
}

.core-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 12px;
}

/* ---------- Details / Summary ---------- */
details.card > summary {
  cursor: pointer;
  font-weight: 700;
  user-select: none;
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  body {
    margin: 0;
  }

  .container {
    margin: 0;
    padding: 14px;
  }

  h1 { font-size: 22px; }
  h2 { font-size: 18px; }

  .toolbar {
    gap: 8px;
  }

  .row {
    flex-direction: column;
    align-items: stretch;
  }

  button,
  .button {
    width: 100%;
  }
}

.autocomplete {
  position: relative;
}

.suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.10);
  z-index: 1000;
  overflow: hidden;
}

.suggestion-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.suggestion-item:last-child {
  border-bottom: 0;
}

.suggestion-item:active {
  background: #f3f5f7;
}

/* ---------------- Roster fixes ---------------- */

/* Roster pages: prevent wide tables from stretching the whole layout */
.roster-card {
  overflow: hidden;
}

/* Wrapper makes tables scrollable on mobile (and desktop if needed) */
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Roster starter table: keep cell text on one line (no wrap) */
.table.roster {
  width: 100%;
  table-layout: auto;
}

.table.roster th,
.table.roster td {
  white-space: nowrap; /* prevents "Oil Refinery" + "(Friendly Side)" line break */
}

/* Roster page: always single column (Team card should be as wide as Operational Notes) */
.roster-page .grid2 {
  grid-template-columns: 1fr !important;
}

.table.roster th { 
  text-align:left; 
}

/* Roster: keep viewport stable; scroll inside wrapper */
.roster-page { overflow-x: hidden; }               /* prevent body horizontal scroll */

.roster-page .table-wrap {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* Ensure roster cells never wrap (override global td/th rules) */
.roster-page .table.roster th,
.roster-page .table.roster td {
  white-space: nowrap !important;
}

/* Make roster table wide enough so the wrapper actually scrolls */
.roster-page .table.roster {
  width: max-content;   /* can be wider than card -> scroll */
  min-width: 100%;      /* but at least fill card on desktop */
  table-layout: auto;
}
