/*
  Galactic Conquest — Theme System
  ---------------------------------
  Defines CSS custom properties for the three themes and
  supplies base typography + body chrome. Loaded after main.css
  so it can override legacy body/html/link defaults.

  Themes are selected via [data-theme] on <body>.
    - nebula   (default): modern space-minimal
    - classic            : legacy dark red / gold
    - daylight           : high-contrast light mode
*/

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');


/* ---------- Nebula (default) ---------- */
:root,
body[data-theme="nebula"] {
  /* Surfaces — slightly deeper, bluer to match banner navy */
  --bg-base:        #0c1018;
  --bg-surface:     #1f2842;
  --bg-elevated:    #2a365a;
  --bg-overlay:     rgba(21, 28, 49, 0.92);

  /* Text */
  --text-primary:   #f1eee8;
  --text-secondary: #b7bdd1;
  --text-muted:     #8890a8;
  --text-inverse:   #151c31;

  /* Accents — amber stays primary (warm, readable) */
  --accent:         #e8b563;       /* warm amber — text / data highlights */
  --accent-hover:   #f2c57a;
  --accent-hot:     #ec6262;       /* coral — danger / legacy red */
  --accent-cool:    #7dbff2;       /* electric banner blue — structural */
  --accent-steel:   #5a9fd4;       /* deeper banner blue — borders/chrome */
  --accent-good:    #7fc592;       /* success */
  --accent-gold:    #f5d98f;       /* premium / gold */

  /* Stats */
  --stat-cash:      #7fc592;
  --stat-food:      #e8b563;
  --stat-power:     #7dbff2;
  --stat-turns:     #f5d98f;

  /* Borders & shadows — shifted toward banner steel */
  --border:         #334b75;
  --border-strong:  #4e74b0;
  --ring:           rgba(125, 191, 242, 0.35);
  --shadow-sm:      0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md:      0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg:      0 12px 40px rgba(0, 0, 0, 0.5);

  /* Link colors (legacy main.css override targets) */
  --link:           #e8b563;
  --link-visited:   #e8b563;
  --link-hover:     #f2c57a;

  /* Typography */
  --font-display:   'Fraunces', Georgia, serif;
  --font-body:      Arial, Helvetica, sans-serif;
  --font-mono:      'IBM Plex Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  /* Radii */
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      16px;
  --radius-pill:    999px;

  /* Motion */
  --ease:           cubic-bezier(.2, .7, .3, 1);
  --dur-fast:       120ms;
  --dur-base:       220ms;
}

/* =========================================================
   EVENTS FEED (f_com_empire, cm=4)
   ---------------------------------------------------------
   Nebula/Daylight: modernized event feed with unified toolbar,
   card-like rows on narrow screens, and compact pagination.
   ========================================================= */

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-page {
  max-width: 980px;
  width: 100%;
  margin: 0 auto 12px;
  padding: 0 2px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-page__title {
  margin: 4px 0 0;
  color: var(--text-primary);
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 10px;
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-page__title img {
  margin-left: 6px;
  vertical-align: -2px;
  opacity: 0.88;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-filter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 2px;
  flex-wrap: wrap;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-filter__label {
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-filter__select {
  min-height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  padding: 4px 8px;
  font-family: var(--font-body);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-panel {
  width: 100%;
  box-sizing: border-box;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table {
  width: 100%;
  margin: 0;
  table-layout: fixed;
  border-collapse: collapse;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__row {
  border-bottom: 1px solid var(--border);
  transition: background var(--dur-fast) var(--ease);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__row:last-child {
  border-bottom: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__row:hover {
  background: var(--bg-elevated);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__time {
  width: 30%;
  min-width: 120px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: top;
  padding: 10px 12px !important;
  padding-right: 12px !important;
}


body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__time .gc-events-table__date {
  display: block;
  color: var(--text-secondary);
  text-transform: none;
  font-size: 9px;
  letter-spacing: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body {
  min-width: 0;
  color: var(--text-primary);
  line-height: 1.42;
  font-size: 13px;
  vertical-align: top;
  padding: 10px 12px !important;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Time column must stay table-cell; flex lives on .gc-events-table__time-inner (see
   desktop non-battle rules) so table-layout:fixed 30%|70% applies to all row types. */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__time-inner {
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body-inner {
  display: block;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__tools {
  display: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__content {
  padding-right: 0;
  overflow-x: auto;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__empty {
  text-align: center;
  color: var(--text-muted);
  padding: 14px 12px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-right: 0;
  margin-top: -1px;
  color: var(--text-muted);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-pagination__spacer {
  color: var(--text-muted);
}

/* Empire events (cm=4), desktop: compact meta *only* for non-battle rows (filter views).
   Battle rows keep the default stacked copy / time / date in the 30% column. */
@media (min-width: 641px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__row:not(:has(.gc-events-table__body--battle)) .gc-events-table__time-inner {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__row:not(:has(.gc-events-table__body--battle)) .gc-events-table__time .gc-events-table__date {
    display: inline;
    margin-top: 0;
    white-space: nowrap;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__row:not(:has(.gc-events-table__body--battle)) .gc-events-table__time .gc-event-copy-btn--time {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    width: auto;
    margin-bottom: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__row:not(:has(.gc-events-table__body--battle)) .gc-events-table__time .gc-events-table__time-text {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__row:not(:has(.gc-events-table__body--battle)) .gc-events-table__time,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__row:not(:has(.gc-events-table__body--battle)) .gc-events-table__body {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
  }

  /* ---- Battle rows: keep a real table layout (2 columns). Stops odd first-paint / cache
     cases where block-level rules leave time stacked above or tables shoved to one side. */
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table {
    display: table !important;
    table-layout: fixed !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__row {
    display: table-row !important;
  }

  /* Stored attack events wrap markup in <div align="center"> — that centers block tables
     in the 70% column and makes fleet/colonies + inline 50% look “empty left / pinched right.” */
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body--battle .gc-events-table__content {
    text-align: start;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body--battle .gc-events-table__content div[align="center"] {
    text-align: start !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  /* In the feed, let battle tables use the full body column (700px cap reads as a narrow band) */
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body--battle .gc-events-table__content table.Default,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body--battle .gc-events-table__content table.gc-battle-table,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body--battle .gc-events-table__content table.gc-battle-colonies {
    max-width: 100% !important;
  }
}

/* =========================================================
   COMPACT EVENT ROW (Nebula / Daylight — modern div layout)
   ========================================================= */

/* Block container — rows stack naturally; no flex needed here */
.gc-event-list {
  display: flex;
  flex-direction: column;
  width: 100%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-row {
  display: flex;
  align-items: flex-start;
  flex: 0 0 auto;
  gap: 10px;
  padding: 7px 12px;
  width: 100%;
  box-sizing: border-box;
  clear: both;
  border-bottom: 1px solid var(--border);
  transition: background var(--dur-fast) var(--ease);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-row:last-child {
  border-bottom: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-row:hover {
  background: var(--bg-elevated);
}

/* Event body: fills remaining width, allows battle tables to expand */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-body {
  display: flow-root;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.45;
  overflow-x: auto;
}

/* Compact meta block: timestamp + copy button, pinned to top-right */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-meta {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  line-height: 1.35;
  white-space: nowrap;
  padding-top: 2px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-date {
  display: block;
  font-size: 9px;
  opacity: 0.7;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 28px;
  min-height: 28px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  line-height: 1;
  opacity: 1;
  flex-shrink: 0;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-copy-btn span {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Time-cell variant (e.g. compact .gc-event-row). Empire events .gc-events-table
   overrides on min-width:641px to keep copy+time+date on one line. */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-copy-btn--time {
  display: flex;
  width: fit-content;
  margin-bottom: 4px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-row:hover .gc-event-copy-btn {
  opacity: 1;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-copy-btn.gc-copied {
  color: var(--accent-good);
  opacity: 1;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__row:hover .gc-event-copy-btn {
  opacity: 1;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 14px 12px;
  margin: 0;
}

/* Battle-report tables embedded in event rows.
   Desktop keeps them comfortably capped; mobile restores full width. */
.gc-events-table__body table,
.gc-event-body table {
  width: auto;
  max-width: 100%;
  float: none !important;
  box-sizing: border-box;
  clear: both;
  display: table;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Nebula/Daylight: battle table header rows */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body .Header td,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body .Header th,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-body .Header td,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-body .Header th {
  background: var(--bg-elevated);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  padding: 5px 6px;
  border-bottom: 1px solid var(--border-strong);
}

/* Fleet-name section rows */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body table.gc-battle-table tr > td[colspan],
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-body table.gc-battle-table tr > td[colspan] {
  background: var(--bg-base);
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 4px 6px 2px;
  border-top: 1px solid var(--border);
}

/* Data rows in battle tables */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body table.gc-battle-table td,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-body table.gc-battle-table td {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 3px 6px;
}

/* Override any inline width on all Default tables inside event content (covers legacy stored events) */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__content table.Default,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-body table.Default {
  width: 100% !important;
  max-width: 700px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body table.gc-battle-table,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-body table.gc-battle-table {
  width: 100% !important;
  max-width: 700px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body table.gc-battle-colonies,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-body table.gc-battle-colonies {
  width: 100% !important;
  max-width: 700px;
}

/* Colonies table: top gap from fleet table */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body table.gc-battle-colonies,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-body table.gc-battle-colonies {
  margin-top: 6px !important;
}

@media (max-width: 767.98px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-page {
    margin: 0 0 10px;
    padding: 0;
    gap: 6px;
    max-width: none;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-page__title {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-filter {
    justify-content: space-between;
    margin-bottom: 4px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-filter__label {
    display: none;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table tbody,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__row,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__time,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__row {
    padding: 3px 6px;
    position: relative;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__time {
    min-width: 0;
    padding: 0 0 2px !important;
    border-bottom: 1px solid var(--border);
    display: block;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__time-inner {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 6px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-copy-btn--time {
    display: inline-flex;
    width: auto;
    margin-bottom: 0;
    order: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__time-text {
    order: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__time .gc-events-table__date {
    flex-basis: auto;
    order: 0;
    margin-top: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body {
    font-size: 12px;
    padding: 4px 0 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-copy-btn {
    opacity: 1;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__time {
    padding-right: 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body-inner,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__content {
    width: 100%;
    box-sizing: border-box;
    padding-right: 0;
    overflow-x: auto;
  }

  /* Legacy event HTML often inlines width/padding on table.Default (e.g. Colonies
     Captured) without gc-battle-colonies — mirror desktop !important fixes here. */
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__content table.Default,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-body table.Default {
    display: table !important;
    width: 100% !important;
    max-width: none !important;
    table-layout: auto !important;
    box-sizing: border-box;
    /* Beat stored inline % padding that wastes horizontal space on narrow viewports */
    padding-left: 4px !important;
    padding-right: 4px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body table.gc-battle-table,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-body table.gc-battle-table {
    width: 100% !important;
    max-width: none;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body table.gc-battle-colonies,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-body table.gc-battle-colonies {
    display: table;
    width: 100% !important;
    max-width: none;
    table-layout: auto !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body table.gc-battle-colonies tbody,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-body table.gc-battle-colonies tbody,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__content table.Default tbody,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-body table.Default tbody {
    display: table-row-group;
    width: 100%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body table.gc-battle-colonies tr,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-body table.gc-battle-colonies tr,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__content table.Default tr,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-body table.Default tr {
    display: table-row;
    width: 100%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body table.gc-battle-colonies tr > td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-body table.gc-battle-colonies tr > td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__content table.Default tr > td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-body table.Default tr > td {
    display: table-cell;
    width: auto !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body table.gc-battle-table .Header td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-body table.gc-battle-table .Header td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__body table.gc-battle-colonies .Header td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-body table.gc-battle-colonies .Header td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-table__content table.Default .Header td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-event-body table.Default .Header td {
    white-space: nowrap;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-events-pagination {
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
  }
}

/* Classic: battle tables fill the event body cell (all screen sizes) */
body[data-theme="classic"] .gc-event-body table {
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Classic: mobile — stack timestamp above event body */
@media (max-width: 767.98px) {
  body[data-theme="classic"] table.gc-events-classic > tbody > tr {
    display: block;
    width: 100%;
  }

  body[data-theme="classic"] table.gc-events-classic > tbody > tr > td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  body[data-theme="classic"] table.gc-events-classic > tbody > tr > td.gc-event-time {
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  /* Nested battle/Colonies tables: stored inline width/padding (same as nebula fixes above) */
  body[data-theme="classic"] .gc-event-body table.Default {
    display: table !important;
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto !important;
    box-sizing: border-box;
    padding-left: 4px !important;
    padding-right: 4px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body[data-theme="classic"] .gc-event-body table.Default tbody {
    display: table-row-group !important;
    width: 100%;
  }

  body[data-theme="classic"] .gc-event-body table.Default tr {
    display: table-row !important;
    width: 100%;
  }

  body[data-theme="classic"] .gc-event-body table.Default tr > td {
    display: table-cell !important;
    width: auto !important;
  }

  body[data-theme="classic"] .gc-event-body table.Default .Header td {
    white-space: nowrap;
  }
}


/* ---------- Classic (preserves legacy look) ---------- */
body[data-theme="classic"] {
  --bg-base:        #000000;
  --bg-surface:     rgba(0, 0, 0, 0.99);
  --bg-elevated:    #141418;
  --bg-overlay:     rgba(18, 18, 24, 0.96);

  --text-primary:   #e0ddd7;
  --text-secondary: #b0b0b0;
  --text-muted:     #8a8a8a;
  --text-inverse:   #ffffff;

  --accent:         #b41837;       /* legacy crimson */
  --accent-hover:   #d4324f;
  --accent-hot:     #b41837;
  --accent-cool:    #9edcfe;
  --accent-good:    #117A65;
  --accent-gold:    gold;

  --stat-cash:      #117A65;
  --stat-food:      #e8b563;
  --stat-power:     #9edcfe;
  --stat-turns:     gold;

  --border:         #2a2a36;
  --border-strong:  #3f5f6f;
  --ring:           rgba(180, 24, 55, 0.4);
  --shadow-sm:      0 1px 2px rgba(0, 0, 0, 0.6);
  --shadow-md:      0 4px 12px rgba(0, 0, 0, 0.7);
  --shadow-lg:      0 12px 40px rgba(0, 0, 0, 0.8);

  --link:           #9edcfe;
  --link-visited:   #9edcfe;
  --link-hover:     #008a8a;

  --font-display:   Arial, Helvetica, sans-serif;
  --font-body:      Arial, Helvetica, sans-serif;
  --font-mono:      ui-monospace, Consolas, monospace;
}


/* ---------- Daylight (high-contrast light) ---------- */
body[data-theme="daylight"] {
  --bg-base:        #e7dfcb;
  --bg-surface:     #ffffff;
  --bg-elevated:    #fafaf7;
  --bg-overlay:     rgba(255, 255, 255, 0.96);

  --text-primary:   #1a1f2e;
  --text-secondary: #4a5068;
  --text-muted:     #7a8196;
  --text-inverse:   #ffffff;

  --accent:         #1e3a8a;       /* deep indigo */
  --accent-hover:   #2a4ba0;
  --accent-hot:     #b91c1c;
  --accent-cool:    #0f766e;
  --accent-good:    #15803d;
  --accent-gold:    #a16207;
  --accent-nebula:  #8f5b35;       /* warm bronze — section labels, dividers */

  --stat-cash:      #15803d;
  --stat-food:      #a16207;
  --stat-power:     #0369a1;
  --stat-turns:     #7c2d12;

  --border:         #d4d0c7;
  --border-strong:  #a9a499;
  --ring:           rgba(30, 58, 138, 0.25);
  --shadow-sm:      0 1px 2px rgba(26, 31, 46, 0.08);
  --shadow-md:      0 4px 16px rgba(26, 31, 46, 0.10);
  --shadow-lg:      0 12px 40px rgba(26, 31, 46, 0.15);

  --link:           #1e3a8a;
  --link-visited:   #5b21b6;
  --link-hover:     #2a4ba0;

  --font-body:      Arial, Helvetica, sans-serif;
}


/* ------------------------------------------------------------------ */
/*  Base body / typography — uses tokens                              */
/*  Loaded after main.css so these override legacy Arial + bg-image.  */
/*  Classic theme intentionally keeps legacy look (see overrides).    */
/* ------------------------------------------------------------------ */

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Preserve the legacy starfield background only on Classic theme. */
body[data-theme="classic"] {
  background-image: url(i/TestBG22.jpg);
  background-size: cover;
  background-attachment: fixed;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 18px;
  color: lightgrey;
}

/* =========================================================
   LEGACY CONTENT TABLES (Nebula / Daylight mobile)
   ---------------------------------------------------------
   Many in-game pages still render fixed-width table.Default
   markup. On narrow screens, normalize those tables inside
   the main content column so they fill the viewport and wrap
   instead of pushing content off-screen.
   display:block is only for scrollable wrappers — real data tables
   (e.g. .gc-fed-war-table, .gc-fed-member-table, .gc-fed-list) must stay
   display:table or they collapse to content width inside the content column.
   ========================================================= */
@media (max-width: 640px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 table.Default:not(.gc-battle-table):not(.gc-battle-colonies):not(.gc-events-classic):not(.gc-fed-war-table):not(.gc-fed-member-table):not(.gc-fed-list):not(.gc-market-detail-table--available-modern):not(.gc-explore-table):not(.gc-rtree-table):not(.gc-rtreed-table):not(.gc-artifacts-table):not(.gc-linkbtn-table):not(.gc-battle-prev-table):not(.gc-cart-products-table):not(.gc-ship-aux-table):not(.gc-pm__list):not(.gc-colony-build-result-table) {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 table.Default:not(.gc-battle-table):not(.gc-battle-colonies):not(.gc-events-classic):not(.gc-fed-war-table):not(.gc-fed-member-table):not(.gc-fed-list):not(.gc-market-detail-table--available-modern):not(.gc-explore-table):not(.gc-rtree-table):not(.gc-rtreed-table):not(.gc-artifacts-table):not(.gc-linkbtn-table):not(.gc-battle-prev-table):not(.gc-cart-products-table):not(.gc-ship-aux-table):not(.gc-pm__list):not(.gc-colony-build-result-table) td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 table.Default:not(.gc-battle-table):not(.gc-battle-colonies):not(.gc-events-classic):not(.gc-fed-war-table):not(.gc-fed-member-table):not(.gc-fed-list):not(.gc-market-detail-table--available-modern):not(.gc-explore-table):not(.gc-rtree-table):not(.gc-rtreed-table):not(.gc-artifacts-table):not(.gc-linkbtn-table):not(.gc-battle-prev-table):not(.gc-cart-products-table):not(.gc-ship-aux-table):not(.gc-pm__list):not(.gc-colony-build-result-table) th {
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
  }

  /* Link-button tables stretch full-width on mobile so their single
     centered cell reads as a proper tap target. Desktop keeps content width. */
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-linkbtn-table {
    width: 100% !important;
  }

  /* Cart row's Bootstrap default -15px side margins overflow the
     mobile content column (only 6px margin); force flush. */
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-cart-row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-cart-row > [class^="col-"] {
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  /* Cart products table has 6 columns on desktop; mobile uses a 2-col
     variant. Tighten cells/inputs/buttons so everything fits viewport. */
  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 .mobileShow > table.Default.gc-cart-products-table,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 .mobileShow table.Default.gc-cart-products-table,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-cart-products-table {
    width: calc(100% - 12px) !important;
    max-width: calc(100% - 12px) !important;
    margin: 1% auto !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md, 6px);
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
    font-size: 0.85em;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-cart-products-table--mobile {
    table-layout: fixed;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-cart-products-table--mobile > tbody > tr > td:first-child,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-cart-products-table--mobile > tr > td:first-child {
    width: 45%;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-cart-products-table--mobile > tbody > tr > td:last-child,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-cart-products-table--mobile > tr > td:last-child {
    width: 55%;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-cart-products-table td {
    padding: 4px 4px !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-cart-products-table .sc-product-item {
    white-space: nowrap;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-cart-products-table .sc-cart-item-qty {
    width: 46px;
    max-width: 46px;
    padding: 2px 0 2px 4px;
    box-sizing: border-box;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-cart-products-table .sc-add-to-cart {
    padding: 2px 8px;
    font-size: 0.85em;
  }
}

/* Cart layout needs to hold across the full mobile layout range
   (.mobileShow activates at <=767.98px, not just <=640px). */
@media (max-width: 767.98px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-cart-row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-cart-row > [class^="col-"] {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 .mobileShow > table.Default.gc-cart-products-table,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 .mobileShow table.Default.gc-cart-products-table {
    display: block;
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
    margin: 6px 12px !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md, 6px);
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
  }
}

/* =========================================================
   RESEARCH PAGE (Nebula / Daylight) — desktop + mobile shared
   ========================================================= */
/* Header cells should be centered and the currently-researching row
   carries a dynamic tech name, so it stays in normal case. */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-research-page .gc-research-status .Header td,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-research-page .gc-research-infra .Header td,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-research-page .gc-research-tree .Header td {
  text-align: center !important;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-research-page .gc-research-status .Header td,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-ship-detail-table .Header td {
  text-transform: none !important;
}

/* Ship detail page uses .kv which force-uppercases all label cells;
   keep these in natural case so abilities/weapon names read cleanly. */
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.kv.gc-ship-detail-table tbody td:first-child,
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.kv.gc-ship-detail-table td:first-child {
  text-transform: none !important;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: normal;
  color: inherit;
}

/* Ship build interruption alert. Both desktop and mobile render this inside
   existing ship containers, so keep the component self-centering and fluid. */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-alert {
  position: relative;
  width: min(100%, 44rem);
  margin: 0.65rem auto 0.9rem;
  padding: 1rem 1.15rem 1.05rem;
  box-sizing: border-box;
  overflow: hidden;
  text-align: center;
  border: 1px solid color-mix(in srgb, var(--accent-hot) 52%, var(--border));
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--accent-hot) 14%, transparent) 0%,
      transparent 48%),
    var(--bg-surface);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 14px 36px color-mix(in srgb, var(--accent-hot) 16%, transparent);
  color: var(--text-primary);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-builder-message:has(.gc-attack-alert) {
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-alert::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-hot), var(--accent), transparent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-alert__eyebrow {
  margin-bottom: 0.25rem;
  color: var(--accent-hot);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-alert__title {
  margin-bottom: 0.35rem;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  font-weight: 600;
  line-height: 1.1;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-alert p {
  margin: 0.25rem auto;
  max-width: 32rem;
  color: var(--text-secondary);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-alert__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin: 0.55rem auto 0.35rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--accent-hot) 64%, var(--border));
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent-hot) 18%, var(--bg-elevated));
  color: var(--text-primary) !important;
  font-weight: 600;
  text-decoration: none !important;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-alert__action:hover {
  border-color: var(--accent-hot);
  background: color-mix(in srgb, var(--accent-hot) 28%, var(--bg-elevated));
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-alert__note {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
}

body[data-theme="classic"] .gc-attack-alert {
  width: 30%;
  min-width: 250px;
  margin: 0.65rem auto;
  padding: 0.75rem;
  text-align: center;
  border: 1px solid red;
}

body[data-theme="classic"] .gc-attack-alert__eyebrow,
body[data-theme="classic"] .gc-attack-alert__note {
  display: none;
}

body[data-theme="classic"] .gc-attack-alert__title {
  color: red;
  font-weight: bold;
}

/* =========================================================
   RESEARCH PAGE (Nebula / Daylight mobile)
   ========================================================= */
@media (max-width: 640px) {
  body[data-theme="nebula"] .gc-research-page,
  body[data-theme="classic"] .gc-research-page,
  body[data-theme="daylight"] .gc-research-page {
    box-sizing: border-box;
  }

  body[data-theme="nebula"] .gc-research-page .row,
  body[data-theme="classic"] .gc-research-page .row,
  body[data-theme="daylight"] .gc-research-page .row {
    margin-left: 0;
    margin-right: 0;
  }

  body[data-theme="nebula"] .gc-research-page .gc-research-status,
  body[data-theme="classic"] .gc-research-page .gc-research-status,
  body[data-theme="nebula"] .gc-research-page .gc-research-infra,
  body[data-theme="classic"] .gc-research-page .gc-research-infra,
  body[data-theme="nebula"] .gc-research-page .gc-research-tree,
  body[data-theme="classic"] .gc-research-page .gc-research-tree,
  body[data-theme="daylight"] .gc-research-page .gc-research-status,
  body[data-theme="daylight"] .gc-research-page .gc-research-infra,
  body[data-theme="daylight"] .gc-research-page .gc-research-tree {
    display: table !important;
    overflow-x: visible;
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto;
    box-sizing: border-box;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  body[data-theme="nebula"] .gc-research-page .gc-research-status td,
  body[data-theme="nebula"] .gc-research-page .gc-research-infra td,
  body[data-theme="nebula"] .gc-research-page .gc-research-tree td,
  body[data-theme="classic"] .gc-research-page .gc-research-status td,
  body[data-theme="classic"] .gc-research-page .gc-research-infra td,
  body[data-theme="classic"] .gc-research-page .gc-research-tree td,
  body[data-theme="daylight"] .gc-research-page .gc-research-status td,
  body[data-theme="daylight"] .gc-research-page .gc-research-infra td,
  body[data-theme="daylight"] .gc-research-page .gc-research-tree td {
    padding-left: 6px;
    padding-right: 6px;
  }

  body[data-theme="nebula"] .gc-research-page .gc-research-status .Header td,
  body[data-theme="nebula"] .gc-research-page .gc-research-infra .Header td,
  body[data-theme="nebula"] .gc-research-page .gc-research-tree .Header td,
  body[data-theme="classic"] .gc-research-page .gc-research-status .Header td,
  body[data-theme="classic"] .gc-research-page .gc-research-infra .Header td,
  body[data-theme="classic"] .gc-research-page .gc-research-tree .Header td,
  body[data-theme="daylight"] .gc-research-page .gc-research-status .Header td,
  body[data-theme="daylight"] .gc-research-page .gc-research-infra .Header td,
  body[data-theme="daylight"] .gc-research-page .gc-research-tree .Header td {
    font-size: 10px;
    letter-spacing: 0.1em;
    text-align: center !important;
  }

  /* Currently-researching header carries a dynamic tech name (e.g. "Agriculture")
     — don't shout it. Keep normal case for this row only. */
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-research-page .gc-research-status .Header td {
    text-transform: none !important;
  }

  body[data-theme="nebula"] .gc-research-page .gc-research-status__label,
  body[data-theme="classic"] .gc-research-page .gc-research-status__label,
  body[data-theme="daylight"] .gc-research-page .gc-research-status__label {
    width: 58% !important;
    white-space: nowrap;
  }

  body[data-theme="nebula"] .gc-research-page .gc-research-infra__level,
  body[data-theme="classic"] .gc-research-page .gc-research-infra__level,
  body[data-theme="daylight"] .gc-research-page .gc-research-infra__level {
    width: 32%;
    min-width: 72px;
    font-size: 12px;
    white-space: nowrap;
  }

  body[data-theme="nebula"] .gc-research-page .gc-research-tree td,
  body[data-theme="classic"] .gc-research-page .gc-research-tree td,
  body[data-theme="daylight"] .gc-research-page .gc-research-tree td {
    font-size: 12px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-research-page .gc-research-detail {
    display: table !important;
    overflow-x: visible;
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* =========================================================
   LEGACY MOBILE TABLE/FORM NORMALIZATION (Nebula / Daylight)
   ---------------------------------------------------------
   Many pages still use mobileShow + inline-width Default tables.
   Normalize those cards and two-column form layouts so they fill
   the content column on mobile without requiring per-page fixes.
   ========================================================= */
@media (max-width: 767.98px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .mobileShow table.Default {
    display: table !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .mobileShow table.Default thead {
    display: table-header-group !important;
    width: 100%;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .mobileShow table.Default tbody {
    display: table-row-group !important;
    width: 100%;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .mobileShow table.Default tr {
    display: table-row !important;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .mobileShow table.Default td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .mobileShow table.Default th {
    display: table-cell !important;
    box-sizing: border-box;
    min-width: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 .mobileShow > table.Default.gc-fed-list-lite-mobile {
    width: calc(100% - 8px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-list-lite-mobile-wrap {
    width: 100%;
    padding-left: 4px;
    padding-right: 4px;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-list-lite-mobile-wrap > table.Default.gc-fed-list-lite-mobile {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    table-layout: fixed;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-list-lite-mobile > tbody > tr > td:nth-child(1),
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-list-lite-mobile > tr > td:nth-child(1) {
    width: 44%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-list-lite-mobile > tbody > tr > td:nth-child(2),
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-list-lite-mobile > tr > td:nth-child(2) {
    width: 12%;
    text-align: center;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-list-lite-mobile > tbody > tr > td:nth-child(3),
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-list-lite-mobile > tr > td:nth-child(3) {
    width: 44%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 .mobileShow form > table.Default {
    table-layout: fixed;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 .mobileShow form > table.Default tr > td:first-child {
    width: 34%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 .mobileShow form > table.Default tr > td:last-child {
    width: 66%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 .mobileShow form > table.Default td {
    padding-left: 8px;
    padding-right: 8px;
    box-sizing: border-box;
    overflow-wrap: break-word;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 .mobileShow form > table.Default td[nowrap] {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: normal;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 .mobileShow form > table.Default td[nowrap] select {
    flex: 0 0 auto;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 .mobileShow form > table.Default td[nowrap] input[type="text"] {
    flex: 1 1 auto;
    min-width: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 .mobileShow form > table.Default input[type="text"],
  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 .mobileShow form > table.Default input[type="number"],
  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 .mobileShow form > table.Default select {
    max-width: 100%;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 .mobileShow form > table.Default input[type="submit"],
  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 .mobileShow form > table.Default input[type="button"] {
    min-width: 96px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-page .gc-market-detail-table tr > td:first-child {
    width: 34%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-page .gc-market-detail-table tr > td:last-child {
    width: 66%;
  }

  /* Available-for-purchase (modern) is a data grid, not a label/control form —
     opt it out of the 34%/66% form-table rule so it fills the panel. */
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-page .gc-market-detail-table--available-modern tr > td:first-child,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-page .gc-market-detail-table--available-modern tr > td:last-child {
    width: 50%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-page .gc-market-detail-table .gc-market-detail-cell {
    width: 66%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-page .gc-market-detail-table td[nowrap] {
    width: 66%;
    white-space: normal;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-page .gc-market-detail-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-page .gc-market-detail-controls select {
    flex: 0 0 auto;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-page .gc-market-detail-controls input[type="text"] {
    flex: 1 1 auto;
    width: 100% !important;
    min-width: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-page .gc-market-detail-table td:not([nowrap]) > input[type="text"] {
    width: 100% !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-page .gc-market-detail-help {
    display: block;
    width: 100%;
    margin-top: 4px;
    color: var(--text-muted);
    text-align: left;
    line-height: 1.3;
  }
}

/* =========================================================
   MARKET PAGE (Nebula / Daylight)
   ========================================================= */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-modern {
  max-width: 980px;
  margin: 0 auto;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-modern__back,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-modern__summary,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-panel {
  border: 1px solid var(--border);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-modern__back {
  margin-top: 8px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-modern__backlink {
  display: block;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-modern__summary {
  margin-top: 10px;
  padding: 10px 12px;
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-modern__summary-title,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-panel__title {
  margin: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-modern__summary-copy {
  margin-top: 8px;
  color: var(--text-secondary);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-modern-form {
  margin-top: 10px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-modern-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-panel {
  padding: 10px 12px 12px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-field {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-field:first-of-type {
  margin-top: 10px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-field__label {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: right;
  padding-top: 8px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-field__value {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-weight: 600;
  color: var(--text-primary);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-field__muted,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-panel__disabled {
  color: var(--text-muted);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-field__control {
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-field__control--inline {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-field__control input[type="text"],
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-field__control select {
  min-height: 40px;
  box-sizing: border-box;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-field__control input[type="text"] {
  width: 100%;
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-field__control--inline select {
  flex: 0 0 64px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-field__control--inline input[type="text"] {
  flex: 1 1 auto;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-field__hint {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-panel__actions {
  padding-top: 10px;
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-panel__actions input[type="submit"] {
  min-width: 112px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-panel--available {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 10px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-table--available-modern {
  width: 100% !important;
  max-width: 100% !important;
  margin-top: 10px !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  table-layout: fixed;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-table--available-modern > tbody > tr > td,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-table--available-modern > tr > td {
  width: 50%;
}

@media (min-width: 700px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-modern-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-field {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 8px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-field__label {
    font-size: 10px;
  }
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-page {
  max-width: 980px;
  margin: 0 auto;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-num-abbrev,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-hdr-mobile {
  display: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-grid {
  max-width: 820px;
  margin: 14px auto 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-col {
  padding-left: 6px;
  padding-right: 6px;
  box-sizing: border-box;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-table {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  table-layout: fixed;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-table--goods td:nth-child(1) {
  width: 42%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-table--goods td:nth-child(2) {
  width: 18%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-table--goods td:nth-child(3) {
  width: 40%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-combined-wrap {
  max-width: 900px;
  margin: 14px auto 0;
}

body[data-theme="classic"] .gc-market-combined-wrap {
  max-width: 620px;
  margin: 14px auto 0;
}

body[data-theme="classic"] .gc-market-num-abbrev,
body[data-theme="classic"] .gc-market-hdr-mobile {
  display: none;
}

@media (max-width: 767.98px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .mobileShow > table.Default.gc-market-use-form-table {
    display: table !important;
    clear: both;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
    table-layout: fixed;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .mobileShow > table.Default.gc-market-use-form-table tr > td:first-child {
    width: 38%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .mobileShow > table.Default.gc-market-use-form-table tr > td:last-child {
    width: 62%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .mobileShow > table.Default.gc-market-use-form-table input[type="text"] {
    width: 100%;
    box-sizing: border-box;
  }
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-table--combined td:nth-child(1) {
  width: 31%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-table--combined td:nth-child(2) {
  width: 17%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-table--combined td:nth-child(3) {
  width: 26%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-table--combined td:nth-child(4) {
  width: 26%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-table .Header td {
  height: 34px;
  vertical-align: middle;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-table tr:not(.Header) td {
  height: 30px;
  padding-top: 4px;
  padding-bottom: 4px;
  vertical-align: middle;
  white-space: nowrap;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-action,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-help-toggle,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-help {
  width: auto !important;
  max-width: 640px;
}

@media (min-width: 641px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-grid {
    display: flex;
    gap: 14px;
    align-items: start;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-pane--desktop {
    display: block;
    min-width: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-pane--desktop.gc-market-pane--goods {
    flex: 1.35 1 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-pane--desktop.gc-market-pane--stores {
    flex: 0.62 1 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-pane--desktop .gc-market-col {
    width: 100%;
    max-width: 100%;
    float: none;
    flex: none;
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 640px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 8px;
    margin-top: 12px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-pane--mobile {
    display: block;
    min-width: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-col {
    width: 100%;
    max-width: 100%;
    flex: none;
    float: none;
    padding-left: 0;
    padding-right: 0;
    margin: 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-col--goods {
    min-width: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-col--stores {
    min-width: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-table tr:not(.Header) td {
    height: 28px;
    font-size: 12px;
    line-height: 1.15;
    padding-left: 6px;
    padding-right: 6px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-table .Header td {
    padding-left: 6px;
    padding-right: 6px;
    font-size: 10px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-table--goods td:nth-child(1) {
    width: 34%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-table--goods td:nth-child(2) {
    width: 18%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-table--goods td:nth-child(3) {
    width: 48%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-combined-wrap {
    margin-top: 12px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-table--combined td:nth-child(1) {
    width: 29%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-table--combined td:nth-child(2) {
    width: 14%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-table--combined td:nth-child(3) {
    width: 27%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-table--combined td:nth-child(4) {
    width: 30%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-page .gc-market-detail-table {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    table-layout: auto;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-page .gc-market-detail-back {
    margin-left: 0;
    margin-right: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-page .gc-market-detail-table td {
    padding-left: 8px;
    padding-right: 8px;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-detail-page input[type="text"] {
    max-width: 100%;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-combined-wrap {
    padding-left: 8px;
    padding-right: 8px;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-market-table--combined {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-market-table--combined td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-market-table--combined th {
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-market-table--combined td:nth-child(1) {
    width: 33%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-market-table--combined td:nth-child(2) {
    width: 11%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-market-table--combined td:nth-child(3) {
    width: 24%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-market-table--combined td:nth-child(4) {
    width: 32%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-good-link {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-num-full,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-hdr-full {
    display: none;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-num-abbrev,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-market-hdr-mobile {
    display: inline;
  }
}

/* -------- Nebula body: lighter deep-space base + solar bloom + offset starfields --------
   Multiple star layers use different tile sizes/positions so the field reads as organic
   instead of a visible grid on mobile. The warm sun is intentionally faded and off-axis.
------------------------------------------------------------------------------------------- */
body[data-theme="nebula"] {
  background-color: var(--bg-base);
  background-image:
    /* 1 — faded sun + corona */
    radial-gradient(circle at 84% 12%, rgba(190, 164, 128, 0.11) 0, rgba(190, 164, 128, 0.045) 7%, rgba(190, 164, 128, 0.014) 14%, transparent 28%),
    radial-gradient(circle at 84% 12%, rgba(232, 221, 201, 0.03) 0, transparent 9%),
    /* 2 — upper atmosphere wash */
    radial-gradient(ellipse 130% 78% at 50% -16%, rgba(88, 104, 122, 0.03), transparent 56%),
    /* 3 — ionized teal cloud */
    radial-gradient(ellipse 72% 54% at 8% 24%, rgba(82, 112, 118, 0.018), transparent 70%),
    /* 4 — blue-black mid-space haze */
    radial-gradient(ellipse 68% 54% at 86% 70%, rgba(73, 92, 114, 0.04), transparent 72%),
    /* 5 — subtle neutral lift */
    radial-gradient(ellipse 52% 38% at 42% 48%, rgba(226, 232, 240, 0.016), transparent 74%),
    /* 6 — warm dust reflection */
    radial-gradient(ellipse 40% 30% at 74% 30%, rgba(190, 164, 128, 0.018), transparent 68%),
    /* 7 — milky dust lane */
    linear-gradient(121deg,
      transparent 0%,
      transparent 34%,
      rgba(255, 255, 255, 0.006) 45%,
      rgba(125, 140, 149, 0.008) 52%,
      rgba(78, 92, 110, 0.008) 58%,
      transparent 69%,
      transparent 100%),
    /* 8 — small sharp stars */
    radial-gradient(circle at 32px 46px, rgba(255, 248, 239, 0.96) 0 1px, transparent 1.65px),
    radial-gradient(circle at 168px 118px, rgba(120, 191, 197, 0.78) 0 0.95px, transparent 1.6px),
    radial-gradient(circle at 284px 84px, rgba(255, 226, 194, 0.72) 0 1px, transparent 1.7px),
    radial-gradient(circle at 412px 212px, rgba(188, 220, 235, 0.62) 0 0.9px, transparent 1.5px),
    radial-gradient(circle at 96px 236px, rgba(255, 252, 245, 0.8) 0 1px, transparent 1.6px),
    /* 9 — cool, dimmer stars */
    radial-gradient(circle at 74px 42px, rgba(83, 166, 162, 0.54) 0 0.85px, transparent 1.45px),
    radial-gradient(circle at 232px 168px, rgba(255, 255, 255, 0.5) 0 0.9px, transparent 1.5px),
    radial-gradient(circle at 382px 286px, rgba(150, 192, 225, 0.5) 0 0.8px, transparent 1.45px),
    radial-gradient(circle at 520px 112px, rgba(214, 196, 166, 0.44) 0 0.95px, transparent 1.55px),
    /* 10 — brighter stars with halos */
    radial-gradient(circle at 212px 126px, rgba(255, 250, 235, 0.98) 0 1.45px, transparent 2.3px),
    radial-gradient(circle at 212px 126px, rgba(190, 164, 128, 0.11) 0 8px, transparent 18px),
    radial-gradient(circle at 618px 92px, rgba(232, 250, 255, 0.92) 0 1.35px, transparent 2.2px),
    radial-gradient(circle at 618px 92px, rgba(57, 115, 169, 0.12) 0 9px, transparent 18px),
    radial-gradient(circle at 802px 328px, rgba(255, 239, 213, 0.84) 0 1.3px, transparent 2.1px),
    radial-gradient(circle at 802px 328px, rgba(190, 164, 128, 0.09) 0 8px, transparent 16px),
    /* 11 — distant silhouettes */
    radial-gradient(ellipse 42vmin 36vmin at -8% 108%, rgba(8, 12, 20, 0.52), transparent 52%),
    radial-gradient(ellipse 52vmin 18vmin at -4% 96%, rgba(103, 121, 126, 0.012), transparent 58%),
    radial-gradient(ellipse 36vmin 30vmin at 108% 92%, rgba(10, 15, 24, 0.48), transparent 50%),
    radial-gradient(ellipse 44vmin 14vmin at 104% 88%, rgba(74, 89, 110, 0.012), transparent 55%),
    /* 12 — edge vignette */
    radial-gradient(ellipse 100% 100% at 50% 50%, transparent 32%, rgba(0, 0, 0, 0.7) 100%);
  background-size:
    auto, auto, auto, auto, auto, auto, auto, auto,
    517px 389px, 517px 389px, 517px 389px, 517px 389px, 517px 389px,
    743px 521px, 743px 521px, 743px 521px, 743px 521px,
    977px 683px, 977px 683px, 977px 683px, 977px 683px, 977px 683px, 977px 683px,
    auto, auto, auto, auto, auto;
  background-repeat:
    no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat,
    repeat, repeat, repeat, repeat, repeat,
    repeat, repeat, repeat, repeat,
    repeat, repeat, repeat, repeat, repeat, repeat,
    no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  background-position:
    0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0,
    0 0, 0 0, 0 0, 0 0, 0 0,
    58px 34px, 58px 34px, 58px 34px, 58px 34px,
    -96px 18px, -96px 18px, -96px 18px, -96px 18px, -96px 18px, -96px 18px,
    0 0, 0 0, 0 0, 0 0, 0 0;
  background-attachment: fixed;
}

@media (max-width: 640px) {
  body[data-theme="nebula"] {
    background-attachment: scroll;
    background-position:
      0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0,
      0 0, 0 0, 0 0, 0 0, 0 0,
      42px 26px, 42px 26px, 42px 26px, 42px 26px,
      -72px 14px, -72px 14px, -72px 14px, -72px 14px, -72px 14px, -72px 14px,
      70% 15%, 70% 15%, 16% 68%, 16% 68%,
      0 0, 0 0, 0 0, 0 0, 0 0;
    background-size:
      auto, auto, auto, auto, auto, auto, auto, auto,
      372px 282px, 372px 282px, 372px 282px, 372px 282px, 372px 282px,
      544px 388px, 544px 388px, 544px 388px, 544px 388px,
      736px 512px, 736px 512px, 736px 512px, 736px 512px, 736px 512px, 736px 512px,
      auto, auto, auto, auto, auto;
  }
}

/* -------- Daylight body: warm parchment + faint dot grid + center wash + edge vignette -------- */
body[data-theme="daylight"] {
  background-color: var(--bg-base);
  background-image:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(30, 58, 138, 0.06), transparent 70%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(161, 98, 7, 0.05), transparent 60%),
    /* Soft center-lit wash — brightens mid-viewport so panels sit in a "page light". */
    radial-gradient(ellipse 70% 55% at 50% 45%, rgba(255, 252, 240, 0.55), transparent 75%),
    /* 28px dot grid — indigo pinpricks at ~20% alpha, star-chart aesthetic. */
    radial-gradient(circle 1.3px at 1px 1px, rgba(30, 58, 138, 0.2), transparent 100%),
    /* Edge vignette — warm umber darkening the far corners. */
    radial-gradient(ellipse 100% 100% at 50% 50%,
      transparent 50%, rgba(80, 50, 10, 0.10) 100%);
  background-size:
    auto, auto,
    auto,
    28px 28px,
    auto;
  background-repeat:
    no-repeat, no-repeat,
    no-repeat,
    repeat,
    no-repeat;
  background-attachment: fixed;
}

/* Display type */
h1, h2, h3, h4, h5, h6,
.display-font {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

/* Tabular numerals — important for stats bar */
.stats, .statsM,
.tabular,
.font-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Links — only non-classic themes override, classic keeps legacy blue. */
body:is([data-theme="nebula"], [data-theme="daylight"]) a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
body:is([data-theme="nebula"], [data-theme="daylight"]) a:visited {
  color: var(--link-visited);
}
body:is([data-theme="nebula"], [data-theme="daylight"]) a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Nebula table headers: warmer steel-grey than body copy or links. */

/* Form inputs inherit tokens on modern themes */
body:is([data-theme="nebula"], [data-theme="daylight"]) input,
body:is([data-theme="nebula"], [data-theme="daylight"]) select,
body:is([data-theme="nebula"], [data-theme="daylight"]) textarea {
  font-family: var(--font-body);
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1px 3px;
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
body:is([data-theme="nebula"], [data-theme="daylight"]) input:focus,
body:is([data-theme="nebula"], [data-theme="daylight"]) select:focus,
body:is([data-theme="nebula"], [data-theme="daylight"]) textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}


/* ------------------------------------------------------------------ */
/*  Theme-selector UI (used on f_option_screen.cfm)                    */
/* ------------------------------------------------------------------ */

.theme-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  max-width: 820px;
  margin: 24px auto;
  padding: 0 16px;
}

.theme-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-base) var(--ease),
              transform var(--dur-base) var(--ease);
}
.theme-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.theme-card[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--ring);
}

.theme-card__swatches {
  display: flex;
  height: 44px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.theme-card__swatches span { flex: 1; }

.theme-card__name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.theme-card__desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}
.theme-card__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--text-inverse);
}


/* ================================================================== */
/*  LEGACY SURFACE OVERRIDES — modern themes only                     */
/*  --------------------------------------------------------------    */
/*  Many in-game panels use inline styles: black rgba backgrounds,    */
/*  `6px ridge #020C1C` borders, hardcoded reds/golds. They're wired  */
/*  into dozens of .cfm files so we override from CSS rather than     */
/*  editing each template. Classic theme is exempt — it keeps the     */
/*  original look (by design — that's why Classic exists).            */
/* ================================================================== */

/* Use a shared selector list that matches both modern themes.
   Panels get a lit-from-above treatment: inset top highlight + bottom shadow.
   The subtle gradient shifts ~3% from top to bottom so the surface has
   dimension without looking busy. */
body[data-theme="nebula"] .col-lg-8.col-sm-12 {
  background:
    linear-gradient(180deg,
      rgba(255, 240, 210, 0.03) 0%,
      rgba(255, 255, 255, 0.01) 22%,
      rgba(255, 255, 255, 0) 52%),
    var(--bg-surface) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius-md);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 2px 4px rgba(0, 0, 0, 0.45),
    0 14px 40px rgba(0, 0, 0, 0.5);
}
body[data-theme="daylight"] .col-lg-8.col-sm-12 {
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.7) 0%,
      rgba(255, 255, 255, 0) 45%),
    var(--bg-surface) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius-md);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 2px 5px rgba(26, 31, 46, 0.08),
    0 14px 36px rgba(26, 31, 46, 0.14);
}

/* Nested .col-lg-8.col-sm-12 (e.g. inside empire/intel pages) should not
   inherit the outer content-panel border treatment. */
body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8.col-sm-12 .col-lg-8.col-sm-12 {
  background: transparent !important;
  border: none !important;
  border-radius: 0;
  box-shadow: none;
}

/*
  .icon-bar2 vertical gaps: <br> is a void element — browsers ignore height/line-height on it.
  Use <div class="gc-lnav-gap gc-lnav-gap--N"> for reliable pixel gaps.
*/
.gc-lnav-gap {
  display: block;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  font-size: 0;
  line-height: 0;
}
.gc-lnav-gap--2 { height: 2px; }
.gc-lnav-gap--3 { height: 3px; }
.gc-lnav-gap--4 { height: 4px; }
.gc-lnav-gap--6 { height: 6px; }

/* Left nav panels (.icon-bar2) and the store button box below them.
   Same lit-from-above treatment as the main content panel, scaled down. */
body[data-theme="nebula"] .icon-bar2 {
  background:
    linear-gradient(180deg,
      rgba(255, 240, 210, 0.025) 0%,
      rgba(255, 255, 255, 0.008) 22%,
      rgba(255, 255, 255, 0) 52%),
    var(--bg-surface) !important;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 7px 7px 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 2px 4px rgba(0, 0, 0, 0.4),
    0 10px 28px rgba(0, 0, 0, 0.4);
}
body[data-theme="daylight"] .icon-bar2 {
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.65) 0%,
      rgba(255, 255, 255, 0) 50%),
    var(--bg-surface) !important;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 7px 7px 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 2px 4px rgba(26, 31, 46, 0.07),
    0 10px 24px rgba(26, 31, 46, 0.11);
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .icon-bar2 a {
  display: block;
  padding: 6px 8px;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (min-width: 992px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .icon-bar2 a {
    padding: 3px 8px;
  }
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .icon-bar2 a:hover {
  color: var(--accent);
  background: var(--bg-elevated);
  text-decoration: none;
}
body[data-theme="nebula"] .icon-bar2 a.gc-lnav-link--unseen,
body[data-theme="nebula"] .icon-bar2 a.gc-lnav-link--unseen:link,
body[data-theme="nebula"] .icon-bar2 a.gc-lnav-link--unseen:visited,
body[data-theme="nebula"] .icon-bar2 a.gc-lnav-link--unseen:hover,
body[data-theme="nebula"] .dropdown-menu a.gc-lnav-link--unseen,
body[data-theme="nebula"] .dropdown-menu a.gc-lnav-link--unseen:link,
body[data-theme="nebula"] .dropdown-menu a.gc-lnav-link--unseen:visited,
body[data-theme="nebula"] .dropdown-menu a.gc-lnav-link--unseen:hover {
  color: #1a1a2e;
  background: #f5c518;
  box-shadow: 0 0 0 2px rgba(245, 197, 24, 0.7), 0 0 18px 4px rgba(245, 197, 24, 0.35);
  font-weight: 700;
}
body[data-theme="daylight"] .icon-bar2 a.gc-lnav-link--unseen,
body[data-theme="daylight"] .icon-bar2 a.gc-lnav-link--unseen:link,
body[data-theme="daylight"] .icon-bar2 a.gc-lnav-link--unseen:visited,
body[data-theme="daylight"] .icon-bar2 a.gc-lnav-link--unseen:hover,
body[data-theme="daylight"] .dropdown-menu a.gc-lnav-link--unseen,
body[data-theme="daylight"] .dropdown-menu a.gc-lnav-link--unseen:link,
body[data-theme="daylight"] .dropdown-menu a.gc-lnav-link--unseen:visited,
body[data-theme="daylight"] .dropdown-menu a.gc-lnav-link--unseen:hover {
  color: var(--text-inverse);
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-hover) 100%);
  box-shadow: 0 8px 18px rgba(30, 58, 138, 0.12), 0 0 0 1px rgba(185, 28, 28, 0.28);
  font-weight: 700;
}
/* Section headings inside left nav — currently <span style="color:#b41837"> */
body:is([data-theme="nebula"], [data-theme="daylight"]) .icon-bar2 span[style*="b41837"] {
  color: var(--accent) !important;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  display: inline-block;
  margin: 3px 2px 3px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border);
  width: calc(100% - 4px);
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .icon-bar2 span[style*="b41837"]:first-child {
  margin-top: 0;
}

/* Classic left nav: same spacing as Nebula/Daylight; keeps legacy bg, border, font. */
body[data-theme="classic"] .icon-bar2 {
  padding: 7px 7px 8px !important;
  line-height: 1.3;
  box-sizing: border-box;
}
/* Collapse plain <br> tags — section gaps use .gc-lnav-gap divs */
body[data-theme="classic"] .icon-bar2 br {
  display: block;
  line-height: 0;
  margin: 0;
  padding: 0;
}
body[data-theme="classic"] .icon-bar2 a {
  display: block;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: 0;
  color: var(--link);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}
body[data-theme="classic"] .icon-bar2 a:visited {
  color: var(--link-visited);
}
@media (min-width: 992px) {
  body[data-theme="classic"] .icon-bar2 a {
    padding: 3px 8px;
  }
}
body[data-theme="classic"] .icon-bar2 a:hover {
  color: var(--link-hover);
  background: var(--bg-elevated);
  text-decoration: none;
}
body[data-theme="classic"] .icon-bar2 a.gc-lnav-link--unseen,
body[data-theme="classic"] .icon-bar2 a.gc-lnav-link--unseen:link,
body[data-theme="classic"] .icon-bar2 a.gc-lnav-link--unseen:visited,
body[data-theme="classic"] .icon-bar2 a.gc-lnav-link--unseen:hover,
body[data-theme="classic"] .dropdown-menu a.gc-lnav-link--unseen,
body[data-theme="classic"] .dropdown-menu a.gc-lnav-link--unseen:link,
body[data-theme="classic"] .dropdown-menu a.gc-lnav-link--unseen:visited,
body[data-theme="classic"] .dropdown-menu a.gc-lnav-link--unseen:hover {
  color: #fff2d5;
  background: linear-gradient(180deg, #7b132a 0%, #4e0b1a 100%);
  box-shadow: inset 0 1px 0 rgba(255, 214, 145, 0.18), inset 0 -1px 0 rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(180, 24, 55, 0.52), 0 0 14px rgba(180, 24, 55, 0.24);
  font-weight: 700;
}
/* Store link still uses <font color=yellow> — keep gold on hover background */
body[data-theme="classic"] .icon-bar2 a font {
  color: var(--accent-gold) !important;
}
/* Section titles: same spacing as Nebula, keeps legacy font (no mono/uppercase) */
body[data-theme="classic"] .icon-bar2 span[style*="b41837"] {
  color: var(--accent) !important;
  font-weight: bold;
  display: inline-block;
  margin: 3px 2px 3px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border-strong);
  width: calc(100% - 4px);
}
body[data-theme="classic"] .icon-bar2 span[style*="b41837"]:first-child {
  margin-top: 0;
}

/* Right sidebar panels (chat + news). Hidden on mobile, themed on desktop. */
body:is([data-theme="nebula"], [data-theme="daylight"]) .sidebar-item {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin: 0 8px 12px !important;
  padding: 12px !important;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .sidebar-item h3 {
  color: var(--accent) !important;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
}

/* Generic Bootstrap cards used for the desktop stats + income/PM row. */
body:is([data-theme="nebula"], [data-theme="daylight"]) .card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .card-body {
  color: var(--text-primary);
}

/* Stats spans (desktop row: Cash/Food/PR/Turns) — legacy had no styling.
   Make them tabular, evenly spaced, color-coded. */
body:is([data-theme="nebula"], [data-theme="daylight"]) .stats {
  display: inline-block;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 13px;
  padding: 4px 7px;
  margin-left: 4px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
body[data-theme="nebula"] #Cash, body[data-theme="daylight"] #Cash { color: var(--stat-cash); }
body[data-theme="nebula"] #Food, body[data-theme="daylight"] #Food { color: var(--stat-food); }
body[data-theme="nebula"] #PR,   body[data-theme="daylight"] #PR   { color: var(--stat-power); }
body[data-theme="nebula"] #Turns,body[data-theme="daylight"] #Turns{ color: var(--stat-turns); }

/* Top nav button group on desktop (Command / Federation / Rankings / etc). */
body:is([data-theme="nebula"], [data-theme="daylight"]) .buttonN.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 6px 16px;
  min-height: 32px;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
/* Nebula: idle pills read cool/steel to tie into the banner;
   hover switches to warm amber so the action pops. */
body[data-theme="nebula"] .buttonN.pill {
  background:
    linear-gradient(180deg,
      rgba(255, 240, 210, 0.025) 0%,
      rgba(255, 255, 255, 0.008) 32%,
      rgba(255, 255, 255, 0) 100%),
    var(--bg-surface);
  border-color: var(--border-strong);
  color: var(--text-primary);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 6px 18px rgba(0, 0, 0, 0.2);
}
body[data-theme="nebula"] .buttonN.pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background:
    linear-gradient(180deg,
      rgba(212, 162, 78, 0.07) 0%,
      rgba(255, 255, 255, 0.015) 42%,
      rgba(255, 255, 255, 0) 100%),
    var(--bg-surface);
  box-shadow: 0 0 0 2px rgba(212, 162, 78, 0.1);
  text-decoration: none;
}
body[data-theme="daylight"] .buttonN.pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .buttonN-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 0 auto;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .buttonN-group li {
  list-style: none;
}

/* Yellow announcement bar. Keep the yellow concept but detune. */
body:is([data-theme="nebula"], [data-theme="daylight"]) #topnavbar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  list-style: none;
  margin: 4px auto;
  max-width: 900px;
}
body[data-theme="nebula"] #topnavbar {
  background:
    linear-gradient(180deg,
      rgba(212, 162, 78, 0.06) 0%,
      rgba(255, 255, 255, 0.012) 38%,
      rgba(255, 255, 255, 0) 100%),
    var(--bg-surface);
  border-color: var(--border-strong);
}

/* Legacy helper class used for headings inside content. */
body:is([data-theme="nebula"], [data-theme="daylight"]) .yellowfont {
  color: var(--accent) !important;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* Form buttons — main.css sets a legacy blue gradient, too loud here. */
body:is([data-theme="nebula"], [data-theme="daylight"]) input[type=button],
body:is([data-theme="nebula"], [data-theme="daylight"]) input[type=submit] {
  background: var(--accent);
  color: var(--text-inverse);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
body:is([data-theme="nebula"], [data-theme="daylight"]) input[type=button]:hover,
body:is([data-theme="nebula"], [data-theme="daylight"]) input[type=submit]:hover {
  background: var(--accent-hover);
}

/* Tables — many pages use plain <table> with inline bgcolor/font tags.
   Give them a readable baseline without breaking the layout. */
body:is([data-theme="nebula"], [data-theme="daylight"]) table {
  color: var(--text-primary);
}
body:is([data-theme="nebula"], [data-theme="daylight"]) table th {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}

/* Nebula: let legacy Default tables sit one step deeper than the surrounding panel
   so content blocks don't visually merge into a single flat slab. */
body[data-theme="nebula"] table.Default {
  background: #242b31;
  border: 1px solid #64717b;
  border-radius: var(--radius-md);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    inset 0 0 0 1px rgba(12, 18, 24, 0.24),
    0 6px 14px rgba(0, 0, 0, 0.14);
  overflow: hidden;
}
body[data-theme="nebula"] table.Default .Header td,
body[data-theme="nebula"] table.Default .Header th,
body[data-theme="nebula"] table.Default th {
  background: #384149;
  color: #d8c7aa;
  border-bottom-color: #73808b;
}
body[data-theme="nebula"] table.Default td {
  background: transparent;
}
body[data-theme="nebula"] table.Default tr:not(.Header):nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}
body[data-theme="nebula"] table.Default tr:not(.Header):nth-child(odd) td {
  background: rgba(0, 0, 0, 0.04);
}
body[data-theme="nebula"] table.Default tr:not(.Header):hover td {
  background: rgba(83, 166, 162, 0.06);
}

/* Horizontal rules and small-font text */
body:is([data-theme="nebula"], [data-theme="daylight"]) hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 12px 0;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .smallfont {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Scrollbar styling on WebKit — subtle and thematic. */
body:is([data-theme="nebula"], [data-theme="daylight"]) ::-webkit-scrollbar { width: 10px; height: 10px; }
body:is([data-theme="nebula"], [data-theme="daylight"]) ::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 10px;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) ::-webkit-scrollbar-track {
  background: var(--bg-base);
}


/* =========================================================
   DESKTOP RESOURCE BAR (.gc-resourcebar)
   Replaces the old desktop Cash/Food/Power/Turns + Income/PM card row.
   Mobile is hidden via .mobileHide; mobile uses app-shell stats strip.
   ========================================================= */

.gc-resourcebar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "actions stats" "meta meta";
  gap: 4px 12px;
  align-items: center;
  width: auto;
  padding: 0;
  margin: 2px 5px 5px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
body[data-theme="classic"] .gc-resourcebar {
  background: linear-gradient(180deg, rgba(36, 44, 72, 0.34) 0%, rgba(0, 0, 0, 0) 100%);
  color: #fff;
  box-shadow: none;
}

.gc-resourcebar__stats {
  grid-area: stats;
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  gap: 4px;
  min-width: 0;
  justify-self: end;
}

.gc-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  min-width: 0;
  text-align: center;
}
body[data-theme="classic"] .gc-stat {
  background: linear-gradient(180deg, #101318 0%, #060708 100%);
  border-color: #2a4566;
  box-shadow: inset 0 1px 0 rgba(158, 220, 254, 0.12), inset 0 -1px 0 rgba(0, 0, 0, 0.55);
}
.gc-stat__label {
  display: block;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1;
  text-align: center;
}
body[data-theme="classic"] .gc-stat__label {
  color: #8da2b7;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
}
.gc-stat__value {
  display: block;
  width: 100%;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
  margin-top: 2px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: center;
}
body[data-theme="classic"] .gc-stat__value {
  color: #f0f4fb;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.65);
}
.gc-stat--cash  .gc-stat__value { color: var(--stat-cash); }
.gc-stat--food  .gc-stat__value { color: var(--stat-food); }
.gc-stat--power .gc-stat__value { color: var(--stat-power); }
.gc-stat--turns .gc-stat__value { color: var(--stat-turns); }

/* Turn bank full: whole pill lights up (no size change); --stat-turns tints all themes */
@keyframes gc-turns-capped-pulse {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}
.gc-stat--turns.gc-stat--turns-capped {
  position: relative;
  isolation: isolate;
  border-color: color-mix(in srgb, var(--stat-turns) 48%, var(--border));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--stat-turns) 22%, transparent),
    0 0 12px 1px color-mix(in srgb, var(--stat-turns) 30%, transparent),
    0 0 24px 3px color-mix(in srgb, var(--stat-turns) 16%, transparent);
}
.gc-stat--turns.gc-stat--turns-capped::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 110% 95% at 50% 78%,
    color-mix(in srgb, var(--stat-turns) 38%, transparent) 0%,
    color-mix(in srgb, var(--stat-turns) 14%, transparent) 42%,
    transparent 72%
  );
  animation: gc-turns-capped-pulse 2.6s ease-in-out infinite;
}
.gc-stat--turns.gc-stat--turns-capped .gc-stat__label,
.gc-stat--turns.gc-stat--turns-capped .gc-stat__value {
  position: relative;
  z-index: 1;
}
.gc-stat--turns.gc-stat--turns-capped .gc-stat__value {
  text-shadow:
    0 0 4px var(--stat-turns),
    0 0 10px color-mix(in srgb, var(--stat-turns) 55%, transparent);
}
body[data-theme="classic"] .gc-stat--turns.gc-stat--turns-capped {
  border-color: color-mix(in srgb, var(--stat-turns) 55%, #2a4566);
  box-shadow:
    inset 0 1px 0 rgba(158, 220, 254, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.55),
    0 0 0 1px color-mix(in srgb, var(--stat-turns) 28%, transparent),
    0 0 16px 2px color-mix(in srgb, var(--stat-turns) 35%, transparent),
    0 0 32px 5px color-mix(in srgb, var(--stat-turns) 18%, transparent);
}
body[data-theme="classic"] .gc-stat--turns.gc-stat--turns-capped .gc-stat__value {
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.65),
    0 0 4px var(--stat-turns),
    0 0 10px color-mix(in srgb, var(--stat-turns) 50%, transparent);
}
body[data-theme="nebula"] .gc-stat--turns.gc-stat--turns-capped {
  border-color: color-mix(in srgb, var(--stat-turns) 42%, var(--border));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 8px 20px rgba(0, 0, 0, 0.22),
    0 0 0 1px color-mix(in srgb, var(--stat-turns) 20%, transparent),
    0 0 18px 2px color-mix(in srgb, var(--stat-turns) 32%, transparent),
    0 0 36px 5px color-mix(in srgb, var(--stat-turns) 18%, transparent);
}
body[data-theme="nebula"] .gc-stat--turns.gc-stat--turns-capped::before {
  background: radial-gradient(
    ellipse 115% 100% at 50% 85%,
    color-mix(in srgb, var(--stat-turns) 45%, transparent) 0%,
    color-mix(in srgb, var(--stat-turns) 16%, transparent) 48%,
    transparent 78%
  );
}
@media (prefers-reduced-motion: reduce) {
  .gc-stat--turns.gc-stat--turns-capped::before {
    animation: none;
    opacity: 0.9;
  }
}

.gc-resourcebar__actions {
  grid-area: actions;
  display: flex;
  gap: 4px;
  align-items: stretch;
}
.gc-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 2px 10px;
  min-height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 0;
  color: var(--text-primary);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}
.gc-action i {
  font-size: 14px;
  color: var(--text-secondary);
}
.gc-action:link,
.gc-action:visited {
  color: var(--text-primary);
  text-decoration: none;
}
.gc-action:link i,
.gc-action:visited i {
  color: var(--text-secondary);
}
.gc-action:hover {
  color: var(--accent);
  text-decoration: none;
}
.gc-action:hover i { color: var(--accent); }
.gc-action--primary {
  font-weight: 500;
}
.gc-action--primary:link,
.gc-action--primary:visited,
.gc-action--primary i,
.gc-action--primary:link i,
.gc-action--primary:visited i,
.gc-action--primary:hover,
.gc-action--primary:hover i {
  color: inherit;
}
.gc-action--unseen,
.gc-action--unseen:link,
.gc-action--unseen:visited,
.gc-action--unseen:hover {
  color: var(--text-inverse);
}
.gc-action--unseen i,
.gc-action--unseen:link i,
.gc-action--unseen:visited i,
.gc-action--unseen:hover i {
  color: var(--text-inverse);
}
.gc-action--unseen {
  border-color: var(--accent-hot);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35), 0 0 18px rgba(239, 68, 68, 0.16);
}
body[data-theme="nebula"] .gc-action--primary {
  background:
    linear-gradient(180deg,
      rgba(14, 165, 233, 0.1) 0%,
      rgba(20, 27, 38, 0.96) 100%);
  border-color: var(--border-strong);
}
body[data-theme="daylight"] .gc-action--primary {
  background: linear-gradient(180deg, rgba(75, 92, 146, 0.14) 0%, rgba(255, 255, 255, 0.92) 100%);
  color: var(--text-primary);
}
body[data-theme="daylight"] .gc-action--unseen {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-hover) 100%);
  box-shadow: 0 8px 18px rgba(30, 58, 138, 0.12), 0 0 0 1px rgba(185, 28, 28, 0.28);
}
body[data-theme="classic"] .gc-action {
  background: linear-gradient(180deg, #1d2f4b 0%, #0e1726 100%);
  color: #f4f7fd;
  box-shadow: inset 0 1px 0 rgba(158, 220, 254, 0.16), inset 0 -1px 0 rgba(0, 0, 0, 0.45);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
}
body[data-theme="classic"] .gc-action i {
  color: #d4d8e1;
}
body[data-theme="classic"] .gc-action:hover {
  color: #9edcfe;
  background: linear-gradient(180deg, #274266 0%, #101b2d 100%);
}
body[data-theme="classic"] .gc-action:hover i {
  color: #9edcfe;
}
body[data-theme="classic"] .gc-action--primary {
  background: linear-gradient(180deg, #1d2f4b 0%, #0e1726 100%);
  color: #f4f7fd;
  box-shadow: inset 0 1px 0 rgba(158, 220, 254, 0.16), inset 0 -1px 0 rgba(0, 0, 0, 0.45);
}
body[data-theme="classic"] .gc-action--unseen {
  background: linear-gradient(180deg, #7b132a 0%, #4e0b1a 100%);
  box-shadow: inset 0 1px 0 rgba(255, 214, 145, 0.18), inset 0 -1px 0 rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(180, 24, 55, 0.52), 0 0 14px rgba(180, 24, 55, 0.24);
}
body[data-theme="classic"] .gc-action--primary:link,
body[data-theme="classic"] .gc-action--primary:visited,
body[data-theme="classic"] .gc-action--primary i,
body[data-theme="classic"] .gc-action--primary:link i,
body[data-theme="classic"] .gc-action--primary:visited i,
body[data-theme="classic"] .gc-action--primary:hover,
body[data-theme="classic"] .gc-action--primary:hover i {
  color: #f4f7fd;
}
body[data-theme="classic"] .gc-action--unseen:link,
body[data-theme="classic"] .gc-action--unseen:visited,
body[data-theme="classic"] .gc-action--unseen i,
body[data-theme="classic"] .gc-action--unseen:link i,
body[data-theme="classic"] .gc-action--unseen:visited i,
body[data-theme="classic"] .gc-action--unseen:hover,
body[data-theme="classic"] .gc-action--unseen:hover i {
  color: #fff2d5;
}
body[data-theme="classic"] .gc-action__dot {
  box-shadow: 0 0 0 2px #111720;
}
body[data-theme="daylight"] .gc-resourcebar {
  background: rgba(233, 238, 252, 0.55);
  border: 0;
  box-shadow: none;
}
body[data-theme="daylight"] .gc-stat {
  background: linear-gradient(180deg, rgba(75, 92, 146, 0.14) 0%, rgba(255, 255, 255, 0.9) 100%);
  border-color: #6d7db1;
}
body[data-theme="daylight"] .gc-action {
  background: linear-gradient(180deg, rgba(75, 92, 146, 0.14) 0%, rgba(255, 255, 255, 0.92) 100%);
  box-shadow: none;
}
body[data-theme="nebula"] .gc-action {
  background:
    linear-gradient(180deg,
      rgba(255, 240, 210, 0.02) 0%,
      rgba(255, 255, 255, 0.008) 36%,
      rgba(255, 255, 255, 0) 100%),
    var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 22px rgba(0, 0, 0, 0.22);
}
body[data-theme="nebula"] .gc-action:hover {
  color: var(--accent-cool);
  border-color: var(--border-strong);
  background:
    linear-gradient(180deg,
      rgba(14, 165, 233, 0.08) 0%,
      rgba(255, 255, 255, 0.02) 42%,
      rgba(255, 255, 255, 0) 100%),
    var(--bg-elevated);
}
body[data-theme="nebula"] .gc-action:hover i {
  color: var(--accent-cool);
}
body[data-theme="nebula"] .gc-action--unseen,
body[data-theme="nebula"] .gc-action--unseen:hover {
  background: #f5c518;
  border-color: #f5c518;
  box-shadow: 0 0 0 2px rgba(245, 197, 24, 0.7), 0 0 18px 4px rgba(245, 197, 24, 0.35);
}
body[data-theme="nebula"] .gc-action--unseen,
body[data-theme="nebula"] .gc-action--unseen:link,
body[data-theme="nebula"] .gc-action--unseen:visited,
body[data-theme="nebula"] .gc-action--unseen:hover,
body[data-theme="nebula"] .gc-action--unseen i,
body[data-theme="nebula"] .gc-action--unseen:link i,
body[data-theme="nebula"] .gc-action--unseen:visited i,
body[data-theme="nebula"] .gc-action--unseen:hover i {
  color: #1a1a2e;
}
.gc-action__dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-hot);
  box-shadow: 0 0 0 2px var(--bg-surface);
}

.gc-resourcebar__meta {
  grid-area: meta;
  display: flex;
  justify-content: flex-end;
  padding: 0 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

@media (max-width: 991.98px) {
  .gc-resourcebar { grid-template-columns: 1fr; grid-template-areas: "actions" "stats" "meta"; }
  .gc-resourcebar__actions { justify-content: flex-start; }
}

/* The main layout container has padding:0 which leaves Bootstrap's .row negative
   margins uncompensated, causing 15px horizontal overflow on mobile. Clip at body
   level — internal scroll containers (display:block overflow:auto tables) are
   unaffected because they create their own scroll context. */
@media (max-width: 767.98px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) {
    overflow-x: hidden;
  }
}


/* =========================================================
   DEFAULT TABLES
   Nearly every game page uses <table class="Default"> plus
   <tr class="Header"> for the caption row. Retheme both so
   modern themes get a clean readable data grid. Classic keeps
   its original dark gradient (untouched).
   ========================================================= */

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default {
  background: var(--bg-surface) !important;
  background-image: none !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  margin: 0 auto 4px !important;
  max-width: 100%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default th,
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default td {
  border: 0;
  border-bottom: 1px solid rgba(var(--border-rgb, 31, 45, 60), 0.5);
  padding: 1px 6px;
  vertical-align: middle;
  color: var(--text-primary);
}
body[data-theme="nebula"] table.Default th,
body[data-theme="nebula"] table.Default td {
  border-bottom-color: rgba(31, 45, 60, 0.5);
}
body[data-theme="daylight"] table.Default th,
body[data-theme="daylight"] table.Default td {
  border-bottom-color: rgba(212, 208, 199, 0.6);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default tr:last-child td,
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default tr:last-child th {
  border-bottom: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default thead td,
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default thead th {
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  padding: 5px 8px 4px;
}
body[data-theme="nebula"] table.Default thead td,
body[data-theme="nebula"] table.Default thead th {
  border-bottom: 1px solid rgba(212, 162, 78, 0.18);
}
body[data-theme="daylight"] table.Default thead td,
body[data-theme="daylight"] table.Default thead th {
  border-bottom: 1px solid rgba(30, 58, 138, 0.15);
}

/* The .Header tr is used as a caption/section row inside tables. */
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default tr.Header td,
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default tr.Header th {
  background: transparent !important;
  background-image: none !important;
  color: var(--accent) !important;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 5px 8px 4px;
}
body[data-theme="nebula"] table.Default tr.Header td,
body[data-theme="nebula"] table.Default tr.Header th {
  border-bottom: 1px solid rgba(212, 162, 78, 0.18);
}
body[data-theme="daylight"] table.Default tr.Header td,
body[data-theme="daylight"] table.Default tr.Header th {
  border-bottom: 1px solid rgba(30, 58, 138, 0.15);
}

/* Excavation dig form: keep the shared Default table skin, but refine the small
   action form so it reads like a centered control panel in modern themes. */
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-col-find-form {
  width: min(100%, 34rem) !important;
  margin: 0.85rem auto 0 !important;
  box-shadow: var(--shadow-md);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-col-find-form td {
  padding: 6px 10px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-col-find-form__batch {
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.01em;
  background: rgba(125, 191, 242, 0.06);
}

body[data-theme="daylight"] .gc-col-find-form__batch {
  background: rgba(30, 58, 138, 0.05);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-col-find-form__batch .redFont {
  color: var(--accent-cool);
  font-weight: 600;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-col-find-form tr:not(:first-child) td:first-child {
  width: 70%;
  text-align: right;
  color: var(--text-secondary);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-col-find-form tr:not(:first-child) td:last-child {
  width: 30%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-col-find-form input[type="text"] {
  width: 74px;
  max-width: 100%;
  text-align: center;
  font-family: var(--font-mono);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-col-find-form__actions {
  width: auto !important;
  text-align: center !important;
  padding-top: 8px !important;
  padding-bottom: 10px !important;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-col-find-form__actions input[type="button"] {
  min-width: 120px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-col-find-notes {
  width: min(100%, 34rem) !important;
  margin: 1.1rem auto 0 !important;
  padding: 10px 12px 12px;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  color: var(--text-secondary);
  line-height: 1.55;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-col-find-notes .yellowfont {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  text-align: center;
}

@media (max-width: 640px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-col-find-form,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-col-find-notes {
    width: calc(100% - 12px) !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-col-find-form tr:not(:first-child) td:first-child {
    width: 64%;
    text-align: left;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-col-find-form tr:not(:first-child) td:last-child {
    width: 36%;
  }
}

/* Vacation mode options: use shared Default table chrome, with a compact modern
   control layout for the explanatory copy and day selector. */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-vacation-page {
  padding-bottom: 1.25rem;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-vacation-status,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-vacation-form {
  width: min(100%, 36rem) !important;
  margin: 0.85rem auto 0 !important;
  box-shadow: var(--shadow-md);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-vacation-status td,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-vacation-form td {
  padding: 7px 10px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-vacation-status tr > td:first-child {
  width: 42%;
  color: var(--text-secondary);
  text-align: right;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-vacation-warning {
  color: var(--text-secondary);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-vacation-warning font[color="yellow"] {
  color: var(--accent) !important;
  font-family: var(--font-display);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-vacation-copy {
  width: min(100%, 42rem);
  margin: 1rem auto 0 !important;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  color: var(--text-secondary);
  line-height: 1.55;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-vacation-copy .yellowfont {
  display: block;
  margin: 0.35rem 0 0.2rem;
  color: var(--accent);
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-vacation-copy .yellowfont:first-child {
  margin-top: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-vacation-form td {
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-vacation-form select {
  min-width: 9rem;
  margin: 0 0.35rem;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-vacation-form input[type="button"] {
  min-width: 110px;
}

@media (max-width: 640px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-vacation-status,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-vacation-form,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-vacation-copy {
    width: calc(100% - 12px) !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-vacation-status tr > td:first-child {
    width: 45%;
    text-align: left;
  }
}

/* Mission pages include many legacy act/mission templates with Default2 tables.
   Retheme them from the wrapper so Classic stays untouched and each mission file
   does not need its own class edits. */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-page {
  padding-bottom: 1.25rem;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-page > p:first-child {
  margin-bottom: 0.85rem !important;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-reward-note {
  width: min(100%, 56rem);
  margin: 0 auto 0.95rem;
  padding: 0.8rem 1rem;
  text-align: center;
  color: var(--accent-good);
  background: color-mix(in srgb, var(--bg-surface) 88%, var(--accent-good) 12%);
  border: 1px solid color-mix(in srgb, var(--accent-good) 42%, transparent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

body[data-theme="daylight"] .gc-mission-reward-note {
  background: color-mix(in srgb, white 90%, var(--accent-good) 10%);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-page table.Default2,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-notice {
  width: min(100%, 56rem) !important;
  margin: 0.85rem auto 0 !important;
  background: var(--bg-surface) !important;
  background-image: none !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 12px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-page table.Default2 td,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-notice td {
  border: 0;
  border-bottom: 1px solid rgba(31, 45, 60, 0.5);
  padding: 8px 10px;
  color: var(--text-primary);
  line-height: 1.42;
}

body[data-theme="daylight"] .gc-mission-page table.Default2 td,
body[data-theme="daylight"] .gc-mission-notice td {
  border-bottom-color: rgba(212, 208, 199, 0.6);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-page table.Default2 tr:last-child td,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-notice tr:last-child td {
  border-bottom: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-page table.Default2 tr.Header td {
  color: var(--accent) !important;
  text-align: center;
  font-weight: 600;
  background: rgba(125, 191, 242, 0.06) !important;
}

body[data-theme="daylight"] .gc-mission-page table.Default2 tr.Header td {
  background: rgba(30, 58, 138, 0.05) !important;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-page table.Default2 > tbody > tr > td {
  text-align: center;
}

/* Mission completion templates use an unclassed nested 90% table for
   image + text. Convert only that legacy media row in modern themes. */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-page table.Default2 table[width="90%"] {
  width: min(100%, 50rem) !important;
  margin: 0.35rem auto 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-page table.Default2 table[width="90%"] > tbody > tr {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(280px, 1.4fr);
  align-items: center;
  gap: 1.25rem;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-page table.Default2 table[width="90%"] td {
  display: block;
  padding: 0 !important;
  border: 0 !important;
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-page table.Default2 table[width="90%"] td:last-child {
  max-width: 30rem;
  margin: 0 auto;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-page table.Default2 table[width="90%"] td:has(> img[src*="sp_.gif"]) {
  display: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-page table.Default2 table[width="90%"] img:not([src*="sp_.gif"]) {
  display: block;
  width: min(100%, 260px);
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-page table.Default2 form {
  display: block;
  width: 100%;
  margin-top: 0.6rem;
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-page table.Default2 form input[type="submit"] {
  display: block;
  width: auto;
  min-width: 150px;
  max-width: 16rem;
  margin: 0 auto 0.35rem;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-reward {
  display: inline-block;
  margin-top: 0.15rem;
  color: var(--accent-good);
  font-weight: 700;
  text-shadow: 0 0 14px rgba(127, 197, 146, 0.18);
}

body[data-theme="daylight"] .gc-mission-reward {
  text-shadow: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-page .gc-found-planet-title {
  margin: 0.95rem auto 0.45rem !important;
  color: var(--accent-good) !important;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.01em;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-page table.Default.gc-found-planet-table {
  width: min(100%, 20rem) !important;
  margin: 0 auto 1rem !important;
  box-shadow: var(--shadow-sm);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-page table.Default.gc-found-planet-table td {
  padding: 5px 10px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-notice {
  width: min(100%, 26rem) !important;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-notice td {
  text-align: center;
}

@media (max-width: 640px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-page table.Default2,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-notice {
    width: calc(100% - 12px) !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-page table.Default2 td {
    padding: 7px 8px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-page table.Default2 table[width="90%"] > tbody > tr {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-page table.Default2 table[width="90%"] img:not([src*="sp_.gif"]) {
    width: min(100%, 220px);
  }
}

@media (min-width: 992px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-mission-page table.Default2 {
    width: 92% !important;
  }
}

/* f_rank2: PR Ratio — muted reference column (Classic-style), all breakpoints */
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-results-table tbody td.rank-table__pr-ratio,
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-results-table-mobile tbody td.rank-table__pr-ratio {
  color: var(--text-secondary) !important;
  font-family: var(--font-body) !important;
  font-variant-numeric: normal !important;
  font-feature-settings: normal !important;
  letter-spacing: normal !important;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-results-table tbody td.rank-table__pr-ratio--vm,
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-results-table-mobile tbody td.rank-table__pr-ratio--vm {
  color: #5c5c5c !important;
  font-style: italic;
}

body[data-theme="nebula"] .rank-s-table__power-full,
body[data-theme="classic"] .rank-s-table__power-full,
body[data-theme="daylight"] .rank-s-table__power-full {
  display: inline !important;
}

body[data-theme="nebula"] .rank-s-table__power-abbrev,
body[data-theme="classic"] .rank-s-table__power-abbrev,
body[data-theme="daylight"] .rank-s-table__power-abbrev {
  display: none !important;
}

@media (max-width: 991.98px) {
  body[data-theme="nebula"] table.rank-page-table .rank-s-table__power-full,
  body[data-theme="classic"] table.rank-page-table .rank-s-table__power-full,
  body[data-theme="daylight"] table.rank-page-table .rank-s-table__power-full {
    display: none !important;
  }

  body[data-theme="nebula"] table.rank-page-table .rank-s-table__power-abbrev,
  body[data-theme="classic"] table.rank-page-table .rank-s-table__power-abbrev,
  body[data-theme="daylight"] table.rank-page-table .rank-s-table__power-abbrev {
    display: inline !important;
  }
}

@media (max-width: 767.98px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-s-table {
    display: table !important;
    width: calc(100% - 8px) !important;
    max-width: calc(100% - 8px) !important;
    margin-left: 4px !important;
    margin-right: 4px !important;
    table-layout: fixed;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-s-table td {
    padding-left: 2px !important;
    padding-right: 2px !important;
    box-sizing: border-box;
    min-width: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-s-table tr.Header td {
    padding-left: 1px !important;
    padding-right: 1px !important;
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-s-table tr > td:nth-child(1) {
    width: 7%;
    text-align: right;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-s-table tr > td:nth-child(2) {
    width: 32%;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-s-table tr > td:nth-child(3) {
    width: 18%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-s-table tr > td:nth-child(4) {
    width: 13%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-s-table tr > td:nth-child(5) {
    width: 18%;
    white-space: nowrap;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-s-table tr > td:nth-child(6) {
    width: 12%;
    white-space: nowrap;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-s-table--type8 tr > td:nth-child(2) {
    width: 34%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-s-table--type8 tr > td:nth-child(3) {
    width: 18%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-s-table--type8 tr > td:nth-child(4) {
    width: 13%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-s-table--type8 tr > td:nth-child(5) {
    width: 28%;
  }
}

/* Hover: elevated bg + gold left accent strip. */
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default tbody tr {
  transition: background var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default tbody tr:hover td {
  background: var(--bg-elevated);
}
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default tbody tr:hover td:first-child {
  /* no left-border accent on hover */
}

/* First column: mildly muted so values stand out. */
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default tbody tr td:first-child {
  color: var(--text-secondary);
}

/* Links inside tables should use the theme accent, not legacy blue. */
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default a {
  color: var(--accent);
  text-decoration: none;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default a:hover {
  text-decoration: underline;
}

/* Numeric cells — tabular figures for alignment. */
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default td[align="right"],
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default td.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

/* Row-stripe helper classes used sporadically across pages. */
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default .table_row1 {
  background: var(--bg-surface) !important;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default .table_row2 {
  background: var(--bg-elevated) !important;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default .tr1_header {
  background: var(--bg-elevated) !important;
  color: var(--accent) !important;
}

/* Mobile: full-width, tighter cells, smaller type. */
@media (max-width: 640px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 0;
    font-size: 12px;
  }
  /* The scroll rule sets display:block on table.Default. Explicitly restoring
     internal table display values keeps tbody/tr/td filling the full width
     whether the outer table is display:table or display:block. */
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default thead {
    display: table-header-group !important;
    width: 100%;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default tbody {
    display: table-row-group !important;
    width: 100%;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default tr {
    display: table-row !important;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default th,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default td {
    display: table-cell !important;
    padding: 2px 4px;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default thead td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default thead th,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default tr.Header td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default tr.Header th {
    padding: 5px 8px 4px;
  }
}

/* Rank pages (f_rank / f_rank2): mobile gutters — Nebula + Daylight beat generic table.Default td padding */
@media (max-width: 767.98px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-page-table--your-rank,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-page-table--top50,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-results-table-mobile {
    table-layout: auto;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-page-table--your-rank td.rank-table__rank-cell {
    padding: 1px 0 !important;
    text-align: center;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-page-table--top50 td.rank-table__rank-cell {
    padding: 1px 0.38rem 1px 0 !important;
    text-align: right;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-page-table--your-rank td.rank-table__empire-cell {
    padding: 1px 1px 1px 0 !important;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-page-table--top50 td.rank-table__empire-cell {
    padding: 1px 1px 1px 0 !important;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-page-table--your-rank td:last-child,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-page-table--top50 td:last-child {
    padding-left: 1px !important;
    padding-right: 1px !important;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-page-table--top50 tr.Header td.rank-table__rank-hdr {
    padding: 1px 0.38rem 1px 0 !important;
    text-align: right !important;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-page-table--your-rank tr.Header td.rank-table__rank-hdr {
    padding: 1px 0 !important;
    text-align: center !important;
  }
  /* f_rank2 mobile: fit viewport — tighter than generic table.Default; drop mono numerics (narrower) */
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-results-table-mobile {
    font-size: 11px !important; /* ~10% over 10px */
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-results-table-mobile td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-results-table-mobile th {
    padding: 1px 1px !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-results-table-mobile tr.Header td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-results-table-mobile tr.Header th {
    padding: 2px 1px !important;
    font-size: 10px !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-results-table-mobile tr.Header td.rank-table__pr-ratio-hdr {
    padding: 2px 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-results-table-mobile td.rank-table__pr-ratio,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-results-table-mobile td.rank-table__pr-ratio--vm {
    padding: 1px 0 !important;
    letter-spacing: 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.rank-results-table-mobile td[align="right"] {
    font-family: var(--font-body) !important;
    font-variant-numeric: normal !important;
    font-feature-settings: normal !important;
    letter-spacing: normal !important;
  }
}

/* =========================================================
   KEY-VALUE MODIFIER (.kv)
   Add class="Default kv" to 2-column label:value tables.
   Turns them into instrument-readout cards: mono labels,
   shrink-to-fit label column, emphasized values.
   ========================================================= */

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.kv thead td,
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.kv thead th,
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.kv tr.Header td,
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.kv tr.Header th {
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.kv tbody td {
  padding: 2px 8px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.kv tbody td:first-child {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  width: 1%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.kv tbody td:last-child {
  color: var(--text-primary);
  font-size: 14px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.kv.gc-pm-detail tbody td.gc-pm-detail__body {
  font-family: inherit;
  font-size: 14px;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text-primary);
  white-space: normal;
  width: auto;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.kv.gc-colupgrade-options tbody td,
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.kv.gc-colupgrade-options td {
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text-primary);
  white-space: normal;
  width: auto;
}

@media (max-width: 767.98px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 table.Default.gc-colupgrade-minerals,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colupgrade-minerals {
    display: table !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
  }
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-detail-page__image-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-detail-page__image {
  display: block;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-itech-reset-note {
  width: min(100% - 16px, 560px);
  box-sizing: border-box;
  margin: 4px auto 12px !important;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--bg-elevated) 54%, transparent);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 767.98px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-detail-content {
    display: block !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-invest-spacer {
    display: none !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-invest-summary {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    display: block !important;
    min-height: 0 !important;
    height: auto !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-action-panel {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-invest-summary__intro {
    margin-top: 4px !important;
    margin-bottom: 6px !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-invest-summary__table {
    margin-bottom: 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-invest-summary > form {
    margin: 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-invest-summary__table + br,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-invest-summary form:empty {
    display: none !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-itech-reset-note {
    margin-top: 4px !important;
    margin-bottom: 6px !important;
    padding: 8px 10px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-itech-redistribution-form {
    margin: 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-itech-redistribution-table {
    margin-top: 0 !important;
  }
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab {
  width: 100%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab__title {
  margin: 0 0 12px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab__grid {
  align-items: flex-start;
  margin-left: -8px;
  margin-right: -8px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab__left,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab__right {
  padding-left: 8px;
  padding-right: 8px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab__form,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab__stocks,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab__recipes {
  margin-left: auto;
  margin-right: auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab__form tr.Header td,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab__stocks tr.Header td,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab__recipes tr.Header td {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab__form td,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab__stocks td,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab__recipes td {
  padding: 6px 10px;
  color: var(--text-primary);
  vertical-align: middle;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab__form select {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 4px 10px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab input[type="submit"],
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab input[type="button"].ArtifactFuser {
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent) 72%, var(--bg-elevated)) !important;
  color: var(--text-inverse) !important;
  box-shadow: none;
  font-family: var(--font-body);
  font-weight: 600;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab input[type="button"].ArtifactFuser {
  width: 100% !important;
  font-size: 12px !important;
  line-height: 1.2;
  padding: 6px 10px !important;
  white-space: normal;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab__stocks-wrap {
  margin-top: 14px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab__stocks td:nth-child(2),
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab__stocks td:nth-child(3) {
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab__recipes td {
  vertical-align: top;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab__help {
  margin: 14px 0 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab__help a {
  color: var(--accent);
}

@media (max-width: 767.98px) {
  /* On narrow screens the desktop shrink-to-fit label column makes intel/profile
     tables collapse into a thin strip. Give labels a real share of the row and
     let them wrap so the value column still fills the remaining space. */
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-intel-page,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-page,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-page,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-detail-page {
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-intel-page .row,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-detail-page .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-intel-page .mobileShow,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-page .mobileShow,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-page .mobileShow {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab__grid {
    margin-left: 0;
    margin-right: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab__left,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-capsule-lab__right {
    padding-left: 0;
    padding-right: 0;
  }

  .gc-capsule-lab__stocks-wrap {
    display: none !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-intel-page .gc-intel-page__content {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    float: none;
  }

  /* Tables across the whole intel page (both search form and empire detail) need
     display:table to override the scroll rule's display:block — the search form
     is outside .mobileShow so the general mobileShow rule doesn't reach it. */
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-intel-page table.Default {
    display: table !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-intel-page table.Default tbody {
    display: table-row-group !important;
    width: 100%;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-intel-page table.Default tr {
    display: table-row !important;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-intel-page table.Default td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-intel-page table.Default th {
    display: table-cell !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-intel-page .gc-intel-page__content--mobile,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-page .gc-colony-page__mobile,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-page .gc-project-page__mobile,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-detail-page {
    padding-left: 4px !important;
    padding-right: 4px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-detail-page table.Default {
    display: table !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-detail-page table.Default thead {
    display: table-header-group !important;
    width: 100% !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-detail-page table.Default tbody {
    display: table-row-group !important;
    width: 100% !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-detail-page table.Default tr {
    display: table-row !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-detail-page table.Default th,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-detail-page table.Default td {
    display: table-cell !important;
    box-sizing: border-box;
    min-width: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.kv.gc-intel-kv {
    table-layout: fixed;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.kv tbody td {
    padding: 2px 4px;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.kv.gc-intel-kv tbody td:first-child {
    font-size: 9px;
    letter-spacing: 0.08em;
    width: 38%;
    min-width: 0;
    white-space: normal;
    line-height: 1.3;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.kv.gc-intel-kv tbody td:last-child {
    width: 62%;
    overflow-wrap: anywhere;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.kv tbody td:last-child {
    font-size: 13px;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.kv.gc-pm-detail tbody td.gc-pm-detail__body {
    font-size: 13px;
  }
}

/* =========================================================
   FEDERATION JOIN LIST
   Keeps Classic untouched. Modern themes keep the legacy
   table shape, but with tighter spacing and fixed column
   widths so the list stays inside the container.
   ========================================================= */

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-list {
  width: calc(100% - 8px) !important;
  max-width: 100%;
  margin: 0 auto;
  table-layout: fixed;
}

body[data-theme="nebula"] table.Default.gc-fed-list td,
body[data-theme="nebula"] table.Default.gc-fed-list th,
body[data-theme="daylight"] table.Default.gc-fed-list td {
  vertical-align: middle;
}

body[data-theme="daylight"] table.Default.gc-fed-list th {
  vertical-align: middle;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-list tr.Header td {
  font-size: 10px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-list tr:not(.Header) td {
  padding: 4px 6px;
  line-height: 1.15;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-list td:nth-child(1) {
  width: 28%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-list td:nth-child(2) {
  width: 22%;
  font-variant-numeric: tabular-nums;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-list td:nth-child(3) {
  width: 10%;
  font-variant-numeric: tabular-nums;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-list td:nth-child(4) {
  width: 12%;
  font-variant-numeric: tabular-nums;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-list td:nth-child(5) {
  width: 28%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-list__power-full {
  display: inline;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-list__power-abbrev {
  display: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-list__hdr-full {
  display: inline;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-list__hdr-mobile {
  display: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-list td:nth-child(1),
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-list td:nth-child(5) {
  overflow-wrap: anywhere;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-prev-table {
  width: calc(100% - 8px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  table-layout: fixed;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-member-table {
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  table-layout: fixed;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-member-table--mobile {
  width: calc(100% - 8px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  table-layout: fixed !important;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-member-table td {
  vertical-align: middle;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-member-table__empire {
  width: 34%;
  min-width: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-member-table__empire a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-member-table__race {
  width: 14%;
  overflow-wrap: anywhere;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-member-table__numeric {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-member-table__action {
  width: 16%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-member-table tr.gc-fed-member-table__empty td {
  width: 100% !important;
  text-align: center !important;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-detail-notice {
  margin-left: auto !important;
  margin-right: auto !important;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-detail-notice__body {
  width: 100%;
  box-sizing: border-box;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-detail-notice__body table {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  table-layout: auto !important;
  box-sizing: border-box;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-detail-notice__body td,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-detail-notice__body th {
  overflow-wrap: break-word;
  word-break: normal;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-member-empty {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
  text-align: left;
  margin-left: auto;
  margin-right: auto;
  padding: 20px 14px;
  box-sizing: border-box;
}

/* main.css sets .mobileHide { display: inline } on desktop — a block child with
   width:100% then shrink-wraps. Establish a real column-width box for empty state.
   ONLY >=768px: on mobile, app-shell sets .mobileHide { display:none !important } and
   a global display:block here would override that (higher specificity) and duplicate
   the empty card next to .mobileShow. */
@media (min-width: 768px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 .mobileHide:has(.gc-fed-member-empty) {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box;
  }
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-member-empty--desktop {
  width: 100% !important;
  max-width: 100% !important;
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-member-empty--mobile {
  width: 100% !important;
  max-width: 100% !important;
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-desktop {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-desktop__list {
  display: grid;
  gap: 10px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-desktop__card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 32%),
    var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-desktop__identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-desktop__name {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  overflow-wrap: anywhere;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-desktop__badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-desktop__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-desktop__stats div {
  min-width: 0;
  padding: 3px 7px 4px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--bg-elevated) 66%, transparent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-desktop__stats dt {
  margin: 0 0 2px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-desktop__stats dd {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-desktop__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-desktop__actions input[type="button"] {
  min-width: 96px;
  margin: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-desktop__note {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-align: right;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-desktop__summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-desktop__summary-card {
  padding: 7px 10px 8px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  background: color-mix(in srgb, var(--bg-surface) 90%, transparent);
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-desktop__summary-card span {
  display: block;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-desktop__summary-card strong {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-desktop__reminder {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-desktop__reminder p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-desktop__reminder p + p {
  margin-top: 10px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-desktop__reminder span {
  display: block;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}

/* =========================================================
   Mobile full-width: f_fed_member apply list + f_fed_war tables
   Legacy inline widths (90%/98%) left these tables narrow on
   phones. Force them to fill the column in Nebula/Daylight.
   ========================================================= */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-war-grid table.Default.gc-fed-war-table {
  width: 90%;
}

/* Federation forum action alignment applies at every modern viewport. */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-forum-action {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 10px auto 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-forum-action__button {
  flex: 0 0 auto;
  max-width: 100%;
}

@media (max-width: 767.98px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 .mobileShow {
    width: 100% !important;
    box-sizing: border-box;
  }

  /* Nested .col-sm-12 (f_fed_join → f_fed_member) doubles Bootstrap horizontal padding;
     bleed the fed member mobile block to the outer column so it matches kv / list width. */
  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 .col-sm-12 > .mobileShow:has(.gc-fed-member-empty, .gc-fed-member-table--mobile) {
    margin-left: -15px !important;
    margin-right: -15px !important;
    width: calc(100% + 30px) !important;
    max-width: none !important;
    box-sizing: border-box;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8 .col-sm-12 .col-sm-12 > .mobileShow:has(.gc-fed-member-empty, .gc-fed-member-table--mobile) {
    margin-left: -15px !important;
    margin-right: -15px !important;
    width: calc(100% + 30px) !important;
    max-width: none !important;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .mobileShow > table.Default.gc-fed-member-table--mobile {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-detail-notice {
    display: table !important;
    width: calc(100% + 30px) !important;
    max-width: none !important;
    margin-left: -15px !important;
    margin-right: -15px !important;
    table-layout: fixed !important;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-detail-notice tbody {
    display: table-row-group !important;
    width: 100% !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-detail-notice tr {
    display: table-row !important;
    width: 100% !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-detail-notice > tbody > tr > td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-detail-notice > tr > td {
    display: table-cell !important;
    width: 100% !important;
    box-sizing: border-box;
    white-space: normal;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-forum-page {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding-left: 6px;
    padding-right: 6px;
    box-sizing: border-box;
    overflow-x: clip;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-forum-compose {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    table-layout: fixed !important;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-forum-compose td {
    box-sizing: border-box;
    max-width: 100% !important;
    overflow-wrap: anywhere;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-forum-compose textarea {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-forum-compose input[name="remLen2"] {
    width: 58px !important;
    max-width: 100%;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-forum-compose input[type="button"],
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-forum-compose input[type="reset"],
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-forum-compose input[type="submit"] {
    max-width: 100%;
    white-space: normal;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-forum-pager {
    display: table !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    table-layout: fixed !important;
    box-sizing: border-box;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-forum-list {
    display: table !important;
    width: 95% !important;
    max-width: 95% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    table-layout: fixed !important;
    box-sizing: border-box;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-forum-list tbody,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-forum-pager tbody {
    display: table-row-group !important;
    width: 100% !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-forum-list tr,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-forum-pager tr {
    display: table-row !important;
    width: 100% !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-forum-list > tbody > tr > td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-forum-list > tr > td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-forum-pager > tbody > tr > td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-forum-pager > tr > td {
    display: table-cell !important;
    box-sizing: border-box;
    white-space: normal;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-forum-list tbody {
    display: block !important;
    width: 100% !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-forum-list tr {
    display: grid !important;
    grid-template-columns: 76px minmax(0, 1fr);
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-forum-list > tbody > tr > td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-forum-list > tr > td {
    display: block !important;
    min-width: 0;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-forum-action {
    text-align: center;
    margin: 10px auto 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-forum-action__button {
    display: inline-flex;
    width: auto;
    max-width: 100%;
    justify-content: center;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-forum-list__meta {
    width: auto !important;
    min-width: 0 !important;
    max-width: 76px !important;
    white-space: normal !important;
    vertical-align: top;
    padding-left: 4px;
    padding-right: 4px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-forum-list__body {
    width: 100% !important;
    min-width: 0;
    max-width: 100% !important;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal !important;
    overflow: visible;
    padding-left: 6px;
    padding-right: 6px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-forum-list__user {
    display: block;
    white-space: nowrap;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-forum-list__stamp {
    display: inline-block;
    white-space: nowrap;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-forum-pager {
    float: none !important;
    margin-top: 6px !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-detail-notice__body table {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    table-layout: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow-x: visible !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-detail-notice__body table tbody {
    display: block !important;
    width: 100% !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-detail-notice__body table tr {
    display: block !important;
    width: 100% !important;
    margin-bottom: 8px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-detail-notice__body td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-detail-notice__body th {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0;
    padding-right: 0;
    white-space: normal;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-detail-notice__body table colgroup,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-detail-notice__body table col {
    display: none !important;
    width: auto !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-detail-notice__body table[width],
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-detail-notice__body td[width],
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-detail-notice__body th[width] {
    width: 100% !important;
    max-width: 100% !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-detail-notice__body table tr > td:first-child,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-detail-notice__body table tr > th:first-child {
    width: 100% !important;
    vertical-align: top;
    margin-bottom: 4px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-detail-notice__body table tr > td:last-child,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-detail-notice__body table tr > th:last-child {
    width: 100% !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-detail-notice__body table tr:has(> td:last-child:empty) > td:last-child,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-detail-notice__body table tr:has(> th:last-child:empty) > th:last-child {
    display: none !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-detail-notice__body table tr:has(> td:last-child:empty) > td:first-child,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-detail-notice__body table tr:has(> th:last-child:empty) > th:first-child {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 8px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-member-table--mobile.gc-fed-member-table--applicants td {
    padding: 3px 3px;
    vertical-align: middle;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-member-table--mobile td {
    padding: 3px 3px;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-member-table--mobile .gc-fed-member-table__empire {
    width: 32%;
    font-size: 11px;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-member-table--mobile .gc-fed-member-table__race {
    width: 14%;
    font-size: 11px;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-member-table--mobile .gc-fed-member-table__numeric {
    width: 12%;
    font-size: 11px;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-member-table--mobile .gc-fed-member-table__action {
    width: 18%;
    padding: 2px 4px;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-member-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: stretch;
    width: 100%;
    min-width: 0;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-member-actions__note {
    display: block;
    font-size: 9px;
    line-height: 1.2;
    color: var(--text-muted);
    text-align: center;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-member-actions input[type="button"] {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 5px 6px;
    font-size: 11px;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-member-table--mobile.gc-fed-member-table--applicants .gc-fed-member-table__empire {
    width: 29%;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-member-table--mobile.gc-fed-member-table--applicants .gc-fed-member-table__action {
    width: 29%;
  }

  body[data-theme="nebula"] .gc-fed-applicants-mobile,
  body[data-theme="nebula"] .gc-fed-members-mobile,
  body[data-theme="daylight"] .gc-fed-applicants-mobile {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    padding: 0 4px;
    box-sizing: border-box;
  }
  body[data-theme="daylight"] .gc-fed-members-mobile {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    padding: 0 4px;
    box-sizing: border-box;
  }

  body[data-theme="nebula"] .gc-fed-applicants-mobile__list,
  body[data-theme="nebula"] .gc-fed-members-mobile__list,
  body[data-theme="daylight"] .gc-fed-applicants-mobile__list {
    display: grid;
    gap: 8px;
  }
  body[data-theme="daylight"] .gc-fed-members-mobile__list {
    display: grid;
    gap: 8px;
  }

  body[data-theme="nebula"] .gc-fed-applicants-mobile__card,
  body[data-theme="nebula"] .gc-fed-members-mobile__card,
  body[data-theme="daylight"] .gc-fed-applicants-mobile__card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 40%),
      var(--bg-surface);
    box-shadow: var(--shadow-sm);
    padding: 10px 11px 11px;
  }
  body[data-theme="daylight"] .gc-fed-members-mobile__card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 40%),
      var(--bg-surface);
    box-shadow: var(--shadow-sm);
    padding: 10px 11px 11px;
  }

  body[data-theme="nebula"] .gc-fed-applicants-mobile__head,
  body[data-theme="nebula"] .gc-fed-members-mobile__head,
  body[data-theme="daylight"] .gc-fed-applicants-mobile__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
  }
  body[data-theme="daylight"] .gc-fed-members-mobile__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
  }

  body[data-theme="nebula"] .gc-fed-applicants-mobile__identity,
  body[data-theme="nebula"] .gc-fed-members-mobile__identity,
  body[data-theme="daylight"] .gc-fed-applicants-mobile__identity {
    min-width: 0;
  }
  body[data-theme="daylight"] .gc-fed-members-mobile__identity {
    min-width: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-mobile__eyebrow {
    display: block;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 3px;
  }

  body[data-theme="nebula"] .gc-fed-applicants-mobile__name,
  body[data-theme="nebula"] .gc-fed-members-mobile__name,
  body[data-theme="daylight"] .gc-fed-applicants-mobile__name {
    display: block;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.24;
    padding-bottom: 2px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body[data-theme="daylight"] .gc-fed-members-mobile__name {
    display: block;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.24;
    padding-bottom: 2px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body[data-theme="nebula"] .gc-fed-applicants-mobile__badges,
  body[data-theme="nebula"] .gc-fed-members-mobile__badges,
  body[data-theme="daylight"] .gc-fed-applicants-mobile__badges {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex: 0 0 auto;
    padding-top: 0;
    white-space: nowrap;
  }
  body[data-theme="daylight"] .gc-fed-members-mobile__badges {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex: 0 0 auto;
    padding-top: 0;
    white-space: nowrap;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-members-mobile__table {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-members-mobile__header {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.9fr) 44px 56px 26px auto;
    gap: 5px;
    align-items: center;
    padding: 6px 7px;
    background: color-mix(in srgb, var(--bg-elevated) 72%, transparent);
    border-bottom: 1px solid var(--border);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-members-mobile__header span:nth-child(4) {
    text-align: center;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-members-mobile__row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.9fr) 44px 56px 26px auto;
    gap: 5px;
    align-items: center;
    padding: 6px 7px;
    border-bottom: 1px solid var(--border);
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-members-mobile__row:last-child {
    border-bottom: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-members-mobile__empire {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-bottom: 1px;
    min-width: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-members-mobile__status {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex: 0 0 auto;
    min-width: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-members-mobile__status input[type="button"] {
    min-height: 22px;
    margin: 0;
    padding: 2px 6px;
    font-size: 10px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-members-mobile__status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--accent-good) 16%, transparent);
    color: var(--accent-good);
    font-family: var(--font-mono);
    font-size: 7px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-members-mobile__status-pill {
    font-size: 0;
    letter-spacing: 0;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-members-mobile__status-pill::before {
    content: "L";
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-mobile__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 10px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-mobile__stats div {
    min-width: 0;
    padding: 7px 8px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--bg-elevated) 64%, transparent);
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-mobile__stats dt {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 8.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin: 0 0 4px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-mobile__stats dd {
    margin: 0;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-members-mobile__cell {
    min-width: 0;
    color: var(--text-primary);
    font-size: 10px;
    line-height: 1.2;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-members-mobile__cell--race {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-members-mobile__cell--numeric {
    font-family: var(--font-mono);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    text-align: right;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-members-mobile__row > .gc-fed-members-mobile__cell--numeric:nth-child(4) {
    text-align: center;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-mobile__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    align-items: stretch;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-mobile__actions input[type="button"] {
    width: 100%;
    min-height: 34px;
    margin: 0;
    padding: 6px 8px;
    box-sizing: border-box;
    font-size: 12px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-mobile__note {
    grid-column: 1 / -1;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    text-align: center;
    padding: 4px 6px 0;
  }

  body[data-theme="nebula"] .gc-fed-applicants-mobile__summary,
  body[data-theme="nebula"] .gc-fed-members-mobile__summary,
  body[data-theme="daylight"] .gc-fed-applicants-mobile__summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
  body[data-theme="daylight"] .gc-fed-members-mobile__summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  body[data-theme="nebula"] .gc-fed-applicants-mobile__summary-card,
  body[data-theme="nebula"] .gc-fed-members-mobile__summary-card,
  body[data-theme="daylight"] .gc-fed-applicants-mobile__summary-card {
    padding: 9px 8px;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
    background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
    text-align: center;
  }
  body[data-theme="daylight"] .gc-fed-members-mobile__summary-card {
    padding: 9px 8px;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
    background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
    text-align: center;
  }

  body[data-theme="nebula"] .gc-fed-applicants-mobile__summary-card span,
  body[data-theme="nebula"] .gc-fed-members-mobile__summary-card span,
  body[data-theme="daylight"] .gc-fed-applicants-mobile__summary-card span {
    display: block;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 8.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 4px;
  }
  body[data-theme="daylight"] .gc-fed-members-mobile__summary-card span {
    display: block;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 8.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 4px;
  }

  body[data-theme="nebula"] .gc-fed-applicants-mobile__summary-card strong,
  body[data-theme="nebula"] .gc-fed-members-mobile__summary-card strong,
  body[data-theme="daylight"] .gc-fed-applicants-mobile__summary-card strong {
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
  }
  body[data-theme="daylight"] .gc-fed-members-mobile__summary-card strong {
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-mobile__reminder {
    width: calc(100% - 8px);
    margin: 0 auto;
    padding: 12px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-mobile__reminder p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-mobile__reminder p + p {
    margin-top: 10px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-applicants-mobile__reminder span {
    display: block;
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 3px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-war-grid table.Default.gc-fed-war-table {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
  }
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-prev-table tr > td:nth-child(1) {
  width: 30%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-prev-table tr > td:nth-child(2) {
  width: 27%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-prev-table tr > td:nth-child(3) {
  width: 27%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-prev-table tr > td:nth-child(4) {
  width: 16%;
  white-space: nowrap;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-prev-pager {
  margin-right: 4px !important;
}

/* =========================================================
   COLONY LIST (f_com_col)
   ========================================================= */
body[data-theme="classic"] .gc-colony-page {
  width: auto;
  max-width: none;
  padding: 0;
}

body[data-theme="classic"] .gc-colony-build-form {
  display: block;
  width: auto;
  max-width: none;
  margin: 0;
}

body[data-theme="classic"] .gc-colony-list-page,
body[data-theme="classic"] .gc-colony-detail-modern {
  display: none !important;
}

body[data-theme="classic"] table.Default.gc-colony-list-table,
body[data-theme="classic"] table.Default.gc-colony-list-mobile-table,
body[data-theme="classic"] table.Default.gc-colony-detail-table,
body[data-theme="classic"] table.Default.gc-colony-mobile-table,
body[data-theme="classic"] table.Default.gc-colony-build-result-table {
  display: table !important;
  width: auto;
  max-width: none;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
}

body[data-theme="classic"] table.Default.gc-colony-list-table thead,
body[data-theme="classic"] table.Default.gc-colony-list-mobile-table thead,
body[data-theme="classic"] table.Default.gc-colony-detail-table thead,
body[data-theme="classic"] table.Default.gc-colony-mobile-table thead,
body[data-theme="classic"] table.Default.gc-colony-build-result-table thead {
  display: table-header-group !important;
}

body[data-theme="classic"] table.Default.gc-colony-list-table tbody,
body[data-theme="classic"] table.Default.gc-colony-list-mobile-table tbody,
body[data-theme="classic"] table.Default.gc-colony-detail-table tbody,
body[data-theme="classic"] table.Default.gc-colony-mobile-table tbody,
body[data-theme="classic"] table.Default.gc-colony-build-result-table tbody {
  display: table-row-group !important;
}

body[data-theme="classic"] table.Default.gc-colony-list-table tfoot,
body[data-theme="classic"] table.Default.gc-colony-list-mobile-table tfoot,
body[data-theme="classic"] table.Default.gc-colony-detail-table tfoot,
body[data-theme="classic"] table.Default.gc-colony-mobile-table tfoot,
body[data-theme="classic"] table.Default.gc-colony-build-result-table tfoot {
  display: table-footer-group !important;
}

body[data-theme="classic"] table.Default.gc-colony-list-table tr,
body[data-theme="classic"] table.Default.gc-colony-list-mobile-table tr,
body[data-theme="classic"] table.Default.gc-colony-detail-table tr,
body[data-theme="classic"] table.Default.gc-colony-mobile-table tr,
body[data-theme="classic"] table.Default.gc-colony-build-result-table tr {
  display: table-row !important;
  height: auto !important;
}

body[data-theme="classic"] table.Default.gc-colony-list-table th,
body[data-theme="classic"] table.Default.gc-colony-list-table td,
body[data-theme="classic"] table.Default.gc-colony-list-mobile-table th,
body[data-theme="classic"] table.Default.gc-colony-list-mobile-table td,
body[data-theme="classic"] table.Default.gc-colony-detail-table th,
body[data-theme="classic"] table.Default.gc-colony-detail-table td,
body[data-theme="classic"] table.Default.gc-colony-mobile-table th,
body[data-theme="classic"] table.Default.gc-colony-mobile-table td,
body[data-theme="classic"] table.Default.gc-colony-build-result-table th,
body[data-theme="classic"] table.Default.gc-colony-build-result-table td {
  display: table-cell !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  vertical-align: middle;
}

body[data-theme="classic"] table.Default.gc-colony-list-table img,
body[data-theme="classic"] table.Default.gc-colony-list-mobile-table img,
body[data-theme="classic"] table.Default.gc-colony-detail-table img,
body[data-theme="classic"] table.Default.gc-colony-mobile-table img,
body[data-theme="classic"] table.Default.gc-colony-build-result-table img {
  display: inline-block;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
}

body[data-theme="classic"] .gc-colony-detail-classic,
body[data-theme="classic"] .gc-colony-detail-classic__left,
body[data-theme="classic"] .gc-colony-detail-classic__right {
  box-sizing: border-box;
  min-width: 0;
}

body[data-theme="classic"] .gc-colony-detail-classic {
  width: 100% !important;
  max-width: 100% !important;
}

body[data-theme="classic"] .gc-colony-detail-classic__left,
body[data-theme="classic"] .gc-colony-detail-classic__right {
  overflow: hidden;
}

body[data-theme="classic"] .gc-colony-detail-classic table.Default.gc-colony-detail-table {
  width: 100% !important;
  max-width: 100% !important;
}

body[data-theme="classic"] .gc-colony-detail-classic table.Default.gc-colony-detail-table--form,
body[data-theme="classic"] .gc-colony-detail-classic__right table.Default.gc-colony-detail-table {
  table-layout: fixed;
}

body[data-theme="classic"] .gc-colony-detail-classic table.Default.gc-colony-detail-table td {
  max-width: 100% !important;
  overflow-wrap: anywhere;
}

body[data-theme="classic"] .gc-colony-detail-classic__infra-row > td:nth-child(1) {
  width: 69% !important;
}

body[data-theme="classic"] .gc-colony-detail-classic__infra-row > td:nth-child(2) {
  width: 1% !important;
  white-space: nowrap;
  text-align: left;
}

body[data-theme="classic"] .gc-colony-detail-classic__infra-row > td:nth-child(3) {
  width: 30% !important;
  text-align: right;
}

body[data-theme="classic"] .gc-colony-detail-classic__right table.Default.gc-colony-detail-table img.pic {
  max-width: 100% !important;
  height: auto !important;
}

@media (max-width: 767.98px) {
}

@media (min-width: 768px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-table tbody tr > td:nth-child(3),
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-table thead tr > td:nth-child(3),
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-table tbody tr > td:nth-child(4),
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-table thead tr > td:nth-child(4),
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-table tbody tr > td:last-child,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-table thead tr > td:last-child {
    white-space: nowrap;
  }
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-detail-table tr.Header td,
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-detail-table thead td,
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-mobile-table tr.Header td,
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-mobile-table thead td {
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-detail-table tbody td,
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-detail-table tbody td * {
  letter-spacing: 0 !important;
  text-transform: none !important;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-detail-table .gc-colony-manage-title {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-build-form {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-build-form > table.Default.gc-colony-detail-table,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-build-form > table.Default.gc-colony-mobile-table {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box;
}

@media (max-width: 767.98px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.kv.gc-colony-mobile-table {
    table-layout: fixed;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.kv.gc-colony-mobile-table tbody td:first-child {
    width: 42%;
    min-width: 0;
    white-space: normal;
    line-height: 1.2;
    text-align: left;
    letter-spacing: 0;
    text-transform: none;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-mobile-table tbody td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-mobile-table tbody td * {
    letter-spacing: 0 !important;
    text-transform: none !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.kv.gc-colony-mobile-table tbody td:last-child {
    width: 58%;
    overflow-wrap: anywhere;
    text-align: left;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-mobile-table--actions td {
    text-align: center;
  }
}

/* =========================================================
   INTEL / COLONY / PROJECT MOBILE TABLES
   Target the actual legacy tables, not just their wrappers,
   so auto-inserted thead/tbody sections do not shrink to content.
   Mirrors the direct-table strategy used by research.
   ========================================================= */
@media (max-width: 767.98px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-page .gc-colony-page__mobile {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-intel-mobile-table,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-mobile-table,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-build-result-table,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-disband-mobile-table,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-project-mobile-table,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-project-detail-mobile-table,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table {
    display: table !important;
    overflow-x: visible;
    width: calc(100vw - 16px) !important;
    max-width: calc(100% - 16px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
    table-layout: auto;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-project-mobile-table,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-project-detail-mobile-table,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-build-result-table,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-mobile-table {
    width: calc(100% - 16px) !important;
    max-width: calc(100% - 16px) !important;
    margin-left: 4px !important;
    margin-right: 4px !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-disband-mobile-table {
    width: calc(100% - 8px) !important;
    max-width: calc(100% - 8px) !important;
    margin-left: 2px !important;
    margin-right: 2px !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-intel-mobile-table thead,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-mobile-table thead,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-build-result-table thead,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-disband-mobile-table thead,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-project-mobile-table thead,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-project-detail-mobile-table thead,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table thead {
    display: table-header-group !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-intel-mobile-table tbody,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-mobile-table tbody,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-build-result-table tbody,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-disband-mobile-table tbody,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-project-mobile-table tbody,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-project-detail-mobile-table tbody,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table tbody {
    display: table-row-group !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-intel-mobile-table tr,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-mobile-table tr,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-build-result-table tr,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-disband-mobile-table tr,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-project-mobile-table tr,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-project-detail-mobile-table tr,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table tr {
    display: table-row !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-intel-mobile-table th,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-intel-mobile-table td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-mobile-table th,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-mobile-table td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-build-result-table th,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-build-result-table td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-disband-mobile-table th,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-disband-mobile-table td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-project-mobile-table th,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-project-mobile-table td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-project-detail-mobile-table th,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-project-detail-mobile-table td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table th,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table td {
    display: table-cell !important;
    box-sizing: border-box;
    min-width: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-project-mobile-table--list,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-project-detail-mobile-table,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-mobile-table--form {
    table-layout: fixed;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-project-mobile-table--list tr > td:nth-child(1) {
    width: 44%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-project-mobile-table--list tr > td:nth-child(2) {
    width: 24%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-project-mobile-table--list tr > td:nth-child(3) {
    width: 32%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-mobile-table--form tr > td:nth-child(1) {
    width: 62%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-mobile-table--form tr > td:nth-child(2) {
    width: 12%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-mobile-table--form tr > td:nth-child(3) {
    width: 26%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-mobile-table {
    width: calc(100% - 14px) !important;
    max-width: calc(100% - 14px) !important;
    margin-left: 7px !important;
    margin-right: 7px !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-page .gc-colony-page__mobile > table.Default.gc-colony-mobile-table,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-page .gc-colony-page__mobile > .gc-colony-build-form > table.Default.gc-colony-mobile-table {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-page table.Default.gc-colony-build-result-table {
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
    margin-left: 10px !important;
    margin-right: 10px !important;
    display: table !important;
    overflow-x: visible;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-mobile-table .gc-colony-manage-title {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-project-detail-mobile-table tr > td:nth-child(1) {
    width: 20%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-project-detail-mobile-table tr > td:nth-child(2) {
    width: 40%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-project-detail-mobile-table tr > td:nth-child(3) {
    width: 40%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table {
    table-layout: fixed;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table th {
    padding-left: 3px !important;
    padding-right: 3px !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table tbody tr > td:nth-child(1) {
    width: 8px;
    padding-left: 1px !important;
    padding-right: 1px !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table tbody tr > td:nth-child(2) {
    width: 12px;
    padding-left: 1px !important;
    padding-right: 1px !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table tbody tr > td:nth-child(3) {
    width: 10%;
    text-align: left;
    font-size: 12px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table tbody tr > td:nth-child(4) {
    width: 14%;
    text-align: left;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table tbody tr > td:nth-child(5) {
    width: 16%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table tbody tr > td:nth-child(6) {
    width: 25%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table tbody tr > td:nth-child(7) {
    width: 16%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table thead tr > td:first-child {
    width: 40px;
    padding-left: 1px !important;
    padding-right: 1px !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table thead tr > td:nth-child(2) {
    width: 26%;
    text-align: left;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table thead tr > td:nth-child(3) {
    width: 21%;
    text-align: left;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table thead tr > td:nth-child(4) {
    width: 10%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table thead tr > td:nth-child(5) {
    width: 15%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table thead tr > td:nth-child(6) {
    width: 8%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-colony-list-mobile-table tbody tr > td:nth-child(6) {
    width: 13%;
  }
}

/* =========================================================
   MULTIPLE PLUNDER PREVIEW (f_com_col_plunder2)
   Nebula/Daylight get a compact summary and a dedicated
   mobile table that drops non-critical columns instead of
   forcing horizontal scroll. Classic stays untouched.
   ========================================================= */

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-plunder-page {
  padding-bottom: 12px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-plunder-summary {
  width: min(80%, 980px);
  margin: 0 auto 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: 8px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-plunder-summary__card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-surface) 92%, transparent), color-mix(in srgb, var(--bg-surface-2) 94%, transparent));
  box-shadow: var(--shadow-sm);
  text-align: left;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-plunder-summary__card--credit {
  border-color: color-mix(in srgb, var(--accent-good) 42%, var(--border));
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-plunder-summary__card--turns {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--border));
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-plunder-summary__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-plunder-summary__value {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 31px);
  line-height: 1;
  color: var(--text-primary);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-plunder-summary__card--credit .gc-plunder-summary__value {
  color: var(--accent-good);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-plunder-summary__hint {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-muted);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-plunder-list-table {
  width: min(80%, 980px) !important;
  max-width: 100%;
  margin-left: auto !important;
  margin-right: auto !important;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-plunder-list-table tr.Header td,
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-plunder-list-mobile-table tr.Header td {
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-plunder-note {
  width: min(80%, 980px) !important;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-plunder-actions {
  margin-bottom: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-plunder-confirm-page {
  padding-bottom: 12px;
}

@media (max-width: 767.98px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-plunder-summary,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-plunder-note {
    width: calc(100% - 14px) !important;
    max-width: calc(100% - 14px) !important;
    margin-left: 7px !important;
    margin-right: 7px !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-plunder-summary {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
    gap: 8px;
    margin-bottom: 10px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-plunder-summary__card {
    min-width: 0;
    padding: 10px 12px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-plunder-summary__value {
    font-size: clamp(18px, 6.4vw, 26px);
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-plunder-summary__hint {
    font-size: 10px;
    line-height: 1.2;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-plunder-confirm-page table.Default.gc-plunder-confirm-table {
    display: table !important;
    overflow-x: visible;
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
    margin-left: 10px !important;
    margin-right: 10px !important;
    box-sizing: border-box;
    table-layout: auto;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-plunder-confirm-page table.Default.gc-plunder-confirm-table tbody {
    display: table-row-group !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-plunder-confirm-page table.Default.gc-plunder-confirm-table tr {
    display: table-row !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-plunder-confirm-page table.Default.gc-plunder-confirm-table td {
    display: table-cell !important;
    box-sizing: border-box;
    min-width: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-plunder-list-mobile-table {
    table-layout: fixed;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-plunder-list-mobile-table td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-plunder-list-mobile-table th {
    padding-left: 3px !important;
    padding-right: 3px !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-plunder-list-mobile-table tbody tr > td:nth-child(1) {
    width: 26px;
    padding-left: 2px !important;
    padding-right: 2px !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-plunder-list-mobile-table tbody tr > td:nth-child(2) {
    width: 28%;
    text-align: left;
    font-size: 12px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-plunder-list-mobile-table tbody tr > td:nth-child(3) {
    width: 24%;
    font-size: 11px;
    line-height: 1.15;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-plunder-list-mobile-table tbody tr > td:nth-child(4),
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-plunder-list-mobile-table tbody tr > td:nth-child(5),
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-plunder-list-mobile-table tbody tr > td:nth-child(6) {
    width: 16%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-plunder-list-mobile-table thead tr > td:nth-child(1) {
    width: 26px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-plunder-list-mobile-table thead tr > td:nth-child(2) {
    width: 28%;
    text-align: left;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-plunder-list-mobile-table thead tr > td:nth-child(3) {
    width: 24%;
    text-align: left;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-plunder-list-mobile-table thead tr > td:nth-child(4),
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-plunder-list-mobile-table thead tr > td:nth-child(5),
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-plunder-list-mobile-table thead tr > td:nth-child(6) {
    width: 16%;
  }
}

@media (max-width: 640px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-list tr.Header td {
    font-size: 7px;
    letter-spacing: 0.06em;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-list tr:not(.Header) td {
    padding: 3px 2px;
    font-size: 10px;
    line-height: 1.05;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-list td:nth-child(1) {
    width: 30%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-list td:nth-child(2) {
    width: 18%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-list td:nth-child(3) {
    width: 11%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-list td:nth-child(4) {
    width: 13%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-fed-list td:nth-child(5) {
    width: 28%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-list__power-full {
    display: none;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-list__power-abbrev {
    display: inline;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-list__hdr-full {
    display: none;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-list__hdr-mobile {
    display: inline;
    color: inherit;
    line-height: 1;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-fed-list__hdr-mobile svg {
    display: block;
    width: 10px;
    height: 10px;
    margin: 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
}

/* Strip legacy inline ridge/solid borders applied on the page via style=""
   (common pattern: style="border: 3px solid rgba(38,35,53,0.5)"). We win
   via specificity + !important without editing 80+ .cfm files. */
body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default[style*="border"] {
  border: 1px solid var(--border) !important;
}


/* =========================================================
   INCOME / UPKEEP LEDGER
   Modern template used on f_com_income.cfm for Nebula and
   Daylight only. Classic keeps the legacy table layout.

   Layout: mobile-first, single-viewport target.
     1. Hero P/L (2 stat cards, color-coded by sign)
     2. Income / Expenses side-by-side (stack on narrow)
     3. Each row: label + bold total, calc breakdown below
        in muted mono. No redundant empty cells.
   ========================================================= */

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-page {
  display: grid;
  gap: 10px;
  max-width: 900px;
  margin: 0 auto 8px;
}

/* -------- Hero P/L -------- */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 8px;
}
@media (max-width: 520px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-hero {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-hero__card {
  position: relative;
  overflow: hidden;
  padding: 10px 14px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* Sign accent strip on the leading edge */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-hero__card::before {
  content: none;
}
/* Atmospheric glow in the corner — dimmer on Daylight */
body[data-theme="nebula"] .gc-income-hero__card::after {
  content: "";
  position: absolute;
  top: -60px; right: -60px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.06), transparent 70%);
  pointer-events: none;
}
body[data-theme="daylight"] .gc-income-hero__card::after {
  content: "";
  position: absolute;
  top: -60px; right: -60px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30, 58, 138, 0.05), transparent 70%);
  pointer-events: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-hero__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-nebula);
  line-height: 1.2;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-hero__value {
  font-family: var(--font-display);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: clamp(22px, 4.2vw, 34px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--text-primary);
  word-break: break-all;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-hero__card--primary .gc-income-hero__value {
  font-size: clamp(26px, 5.2vw, 40px);
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-hero__card--positive .gc-income-hero__value {
  color: var(--accent-good);
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-hero__card--negative .gc-income-hero__value {
  color: var(--accent-hot);
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-hero__hint {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* -------- Ledger sections -------- */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-ledger {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 640px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-ledger {
    grid-template-columns: 1fr;
  }
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-section {
  position: relative;
  padding: 10px 12px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-section--credits {
  border-top: 1px solid var(--border);
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-section--debits {
  border-top: 1px solid var(--border);
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-section--resources {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
}

body[data-theme="nebula"] .gc-income-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 6px;
  padding: 0 0 6px;
  border-bottom: 1px dashed var(--border-strong);
}
body[data-theme="daylight"] .gc-income-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 6px;
  padding: 0 0 6px;
  border-bottom: 1px dashed rgba(143, 91, 53, 0.35);
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-section__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--text-primary);
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-section__total {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-section--credits .gc-income-section__total {
  color: var(--accent-good);
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-section--debits .gc-income-section__total {
  color: var(--accent-hot);
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-section--resources .gc-income-section__total {
  color: var(--accent-good);
}

/* -------- Rows -------- */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-ledger {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-ledger__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 10px;
  row-gap: 0;
  margin: 0;
  padding: 5px 0 5px;
  border-bottom: 1px solid var(--border);
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-ledger__row:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-ledger__label {
  grid-column: 1;
  margin: 0;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.25;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-ledger__actual {
  grid-column: 2;
  margin: 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  white-space: nowrap;
  text-align: right;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-ledger__calc {
  grid-column: 1 / -1;
  margin: 1px 0 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  line-height: 1.3;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-ledger__calc em {
  font-style: normal;
  color: var(--text-secondary);
  margin: 0 3px;
  opacity: 0.8;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-ledger__pct {
  margin-left: 1px;
  opacity: 0.65;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-ledger__empty {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  font-style: italic;
  color: var(--text-muted);
  letter-spacing: 0;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-ledger__row--mineral-detail {
  border-bottom: 0;
  padding-top: 2px;
  padding-bottom: 2px;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-ledger__row--mineral-detail .gc-ledger__label {
  padding-left: 10px;
  color: var(--text-secondary);
}

tr.gc-resource-mineral-row td {
  border-top: 0 !important;
  border-bottom: 0 !important;
}

/* Footer helper text under the ledger */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-page + .smallfont {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Mobile tightening — trim hero padding so everything fits one view */
@media (max-width: 520px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-hero__card {
    padding: 8px 12px 9px;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-income-section {
    padding: 8px 10px 9px;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-ledger__row {
    padding: 4px 0;
  }
}


/* =========================================================
   NEBULA HEADER BAND — tighter vertical rhythm + shrunk logo
   ---------------------------------------------------------
   Scoped to nebula so Classic keeps its original dimensions.
   Collapses the inline margin-tops coming from s_loadbar.cfm
   and caps the banner image height so the nav feels compact.
   ========================================================= */

/* Kill the 1% top margin on <section id="blog"> inline style. */
body[data-theme="nebula"] #blog {
  margin-top: 0 !important;
}

/* Tighten the .icon-bar wrappers (banner + pill nav). Both carry
   an inline margin-top: 0.5% from s_loadbar.cfm — collapse those. */
body[data-theme="nebula"] .icon-bar {
  margin-top: 0 !important;
}

/* The banner img lives inside <ul class="icon-bar gc-header-logo">.
   Default ul padding from main.css is 0 already, but browsers vary;
   make the header logo row compact and centered. */
body[data-theme="nebula"] ul.gc-header-logo {
  padding: 8px 0 2px !important;
  margin-bottom: 0 !important;
  min-height: 0;
  height: auto;
  background:
    radial-gradient(ellipse 50% 80% at 50% 100%,
      rgba(14, 165, 233, 0.05),
      transparent 70%);
}

/* Shrunk logo on Nebula — natural is 797×67, cap to ~44px tall. */
body[data-theme="nebula"] img.gc-logo {
  max-height: 44px;
  width: auto;
  height: auto;
  display: inline-block;
  filter: drop-shadow(0 2px 10px rgba(14, 165, 233, 0.15));
}

/* Pull the pill nav flush against the logo band. */
body[data-theme="nebula"] ul.buttonN-group {
  margin: 6px auto 0 !important;
}

/* Main content column: the inline rule is
   padding-top:5px; min-height:77.5vh; border:6px ridge #020C1C;
   theme.css already rewrites the border. Tighten pad / min-height
   so short pages don't feel bottom-heavy on Nebula. */
body[data-theme="nebula"] .col-lg-8.col-sm-12 {
  padding-top: 2px !important;
  min-height: 60vh !important;
}
body[data-theme="nebula"] .col-lg-8.col-sm-12 .col-lg-8.col-sm-12 {
  padding-top: 0 !important;
  min-height: 0 !important;
}

/* Sidebar (right column) also carried that min-height feel via
   its inline ridge border; theme.css restyles it. No change needed. */

/* Tighten the yellow msg header wrapper vertical. */
body[data-theme="nebula"] #header {
  margin: 0 auto !important;
}
body[data-theme="nebula"] #header .navbar {
  margin-bottom: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
body[data-theme="nebula"] #topnavbar {
  margin: 2px auto !important;
  padding: 4px 12px !important;
}

/* Resource bar sits inside the content column — on Nebula we want
   the stat/action pills to feel like they float in the main div
   instead of living in a bordered card. Kill the container chrome
   but keep display/grid intact; inner .gc-stat and .gc-action keep
   their own pill styling so they look like individual floating chips. */
body[data-theme="nebula"] .gc-resourcebar {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0;
  /* Inner .row (i_f_800.cfm) has Bootstrap's -15px gutters which would
     otherwise push pills past .col-lg-8's 6px ridge border. Add side
     margins to absorb the negative row gutter so the bar stays inside
     the container (invisibly — no bg/border). Also ensure the bar
     spans the available width so stats + actions lay out edge-to-edge. */
  margin: 2px 5px 5px;
  width: auto;
  flex: 1 1 auto;
  /* Let stats shrink properly so actions column doesn't squeeze them. */
  grid-template-columns: minmax(0, 1fr) auto;
}
/* Inner stats grid: enforce a per-column minimum so pills can't
   collapse and overlap when the main column is narrower. */
body[data-theme="nebula"] .gc-resourcebar__stats {
  grid-template-columns: repeat(4, minmax(72px, 1fr)) !important;
  gap: 4px;
  min-width: 0;
}
body[data-theme="classic"] .gc-resourcebar__stats,
body[data-theme="daylight"] .gc-resourcebar__stats {
  gap: 4px;
  min-width: 0;
}
/* Tighten individual stat pills on Nebula so 4 still fit comfortably,
   and center label/value like the mobile stats strip does. */
body[data-theme="nebula"] .gc-stat {
  background:
    linear-gradient(180deg,
      rgba(255, 240, 210, 0.02) 0%,
      rgba(255, 255, 255, 0.006) 32%,
      rgba(255, 255, 255, 0) 100%),
    var(--bg-elevated);
  border-color: var(--border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 8px 20px rgba(0, 0, 0, 0.22);
  padding: 2px 4px;
  align-items: center;
  text-align: center;
}
body[data-theme="nebula"] .gc-stat__value {
  font-size: 15px;
}
body[data-theme="classic"] .gc-stat__value,
body[data-theme="daylight"] .gc-stat__value {
  font-size: 15px;
}

/* Abbreviation vs. full-number display.
   - Default (tablet + mobile-visible card range): show the abbreviated form.
   - Desktop (>= 992px, where col-lg-8 is wide enough): show the full
     grouped number up to 5T (e.g. "5,000,000,000,000"), shrink the
     font so it fits inside a stat pill without ellipsis. */
.gc-stat__num-full { display: none; }
.gc-stat__num-abbrev { display: inline; }

@media (min-width: 992px) {
  .gc-stat__num-full { display: inline; }
  .gc-stat__num-abbrev { display: none; }

  body[data-theme="nebula"] .gc-stat__value,
  body[data-theme="classic"] .gc-stat__value,
  body[data-theme="daylight"] .gc-stat__value {
    font-size: 13px;
    letter-spacing: 0.02em;
    margin-top: 1px;
  }
  body[data-theme="nebula"] .gc-stat__label,
  body[data-theme="classic"] .gc-stat__label,
  body[data-theme="daylight"] .gc-stat__label {
    font-size: 10px;
    letter-spacing: 0.14em;
  }

  /* Weighted columns based on each stat's realistic max digit count:
       Cash   5T   (17 chars) → widest
       Food   25B  (14 chars)
       Power  1.2B (13 chars)
       Turns  1000 (5 chars)  → narrowest
       */
  .gc-resourcebar__stats {
    grid-template-columns:
      minmax(168px, 1.75fr)
      minmax(128px, 1.3fr)
      minmax(104px, 1.0fr)
      minmax(56px, 0.5fr);
  }

  .gc-stat {
    padding: 2px 4px;
  }

  .gc-resourcebar__actions {
    gap: 3px;
  }

  .gc-action {
    gap: 8px;
    padding: 2px 8px;
  }

  body[data-theme="nebula"] .gc-stat {
    padding: 2px 6px;
  }

  body[data-theme="nebula"] .gc-resourcebar__stats {
    grid-template-columns:
      minmax(168px, 1.75fr)
      minmax(128px, 1.3fr)
      minmax(104px, 1.0fr)
      minmax(56px, 0.5fr)
      !important;
  }

  body[data-theme="nebula"] .gc-stat--turns .gc-stat__value {
    color: var(--stat-turns);
    font-weight: 600;
    font-size: 14px;
  }

  body[data-theme="nebula"] .gc-resourcebar {
    margin: 2px 6px 6px;
  }
}


/* =========================================================
   NEBULA — UNIFORM PILL NAV
   ---------------------------------------------------------
   main.css gives the first/last .buttonN in a .buttonN-group
   flat inner corners (the classic "segmented button" look).
   For Nebula we want every pill identical — each one a
   discrete rounded chip. Classic keeps the segmented look.
   ========================================================= */
body[data-theme="nebula"] .buttonN-group > .buttonN,
body[data-theme="nebula"] .buttonN-group > li > .buttonN,
body[data-theme="nebula"] .buttonN-group li:first-child .buttonN,
body[data-theme="nebula"] .buttonN-group li:last-child .buttonN,
body[data-theme="nebula"] .buttonN-group > .buttonN:first-child,
body[data-theme="nebula"] .buttonN-group > .buttonN:last-child {
  border-radius: var(--radius-md) !important;
  margin-left: 0 !important;
}


/* =========================================================
   NEBULA — BANNER BLEND (top atmospheric wash)
   ---------------------------------------------------------
   Extend the banner's palette (indigo / ion / gas / gold) into the space around logo + pill nav so
   the image doesn't feel dropped on a plain page. Kept subtle
   and fades out well before the content column so pages below
   the fold stay neutral.
   ========================================================= */

/* Drop the small local glow on the logo ul — it's replaced
   by a larger gradient on #blog below. */
body[data-theme="nebula"] ul.gc-header-logo {
  background: none;
}

/* Atmospheric wash behind the top header band. */
body[data-theme="nebula"] #blog {
  position: relative;
}
body[data-theme="nebula"] #blog::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 180px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 62% 132px at 50% 0%,
      rgba(14, 165, 233, 0.05), transparent 76%),
    radial-gradient(ellipse 40% 100px at 18% 8%,
      rgba(91, 155, 181, 0.04), transparent 72%),
    radial-gradient(ellipse 28% 84px at 76% 14%,
      rgba(212, 162, 78, 0.035), transparent 72%),
    radial-gradient(ellipse 30% 88px at 24% 18%,
      rgba(255, 255, 255, 0.025), transparent 74%);
}
/* Keep header band content above the gradient. */
body[data-theme="nebula"] #blog > * {
  position: relative;
  z-index: 1;
}

/* Hairline gradient divider below the pill nav — subtle warm/cool. */
body[data-theme="nebula"] ul.buttonN-group {
  padding-bottom: 10px;
  background:
    linear-gradient(90deg,
      transparent 10%,
      rgba(91, 155, 181, 0.1) 32%,
      rgba(14, 165, 233, 0.16) 50%,
      rgba(91, 155, 181, 0.1) 68%,
      transparent 90%) no-repeat bottom / 100% 1px;
}


/* =========================================================
   NEBULA — WIDER LEFT NAV COLUMN
   ---------------------------------------------------------
   Default Bootstrap col-lg-2 = 16.67%. Links like "Manage
   Colonies" and "Important Events" wrap at that width. The
   left-nav .col-lg-2 is nested inside a .mobileHide wrapper
   which IS the flex item in .row — so we size the wrapper
   and let the inner column fill it. Classic grid stays 2/8/2.
   ========================================================= */
@media (min-width: 992px) {
  /* Left nav wrapper (.mobileHide around the .col-lg-2).
     Scope via :has() so sibling .gc-resourcebar.mobileHide (also a
     direct child of .row) is NOT sized to 19%. */
  body[data-theme="nebula"] .row > .mobileHide:has(> .col-lg-2) {
    flex: 0 0 19%;
    max-width: 19%;
  }
  body[data-theme="nebula"] .row > .mobileHide:has(> .col-lg-2) > .col-lg-2 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  /* Main column shrinks to compensate. */
  body[data-theme="nebula"] .col-lg-8.col-sm-12 {
    flex: 0 0 64%;
    max-width: 64%;
  }
  body[data-theme="nebula"] .col-lg-8.col-sm-12 .col-lg-8.col-sm-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  /* Right sidebar shrinks slightly. */
  body[data-theme="nebula"] .col-lg-2.app-desktop-only {
    flex: 0 0 17%;
    max-width: 17%;
  }
}

/* =========================================================
   ATTACK PAGE (Nebula / Daylight)
   Keep legacy tables readable without the global instrument
   header treatment used by other modernized pages.
   ========================================================= */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page table.Default tr.Header td,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page table.Default tr.Header th,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page table.Default thead td,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page table.Default thead th {
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page table.Default.kv tbody td:first-child,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page table.Default.kv td:first-child {
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

@media (max-width: 767.98px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8.col-sm-12:has(.gc-attack-page) {
    width: calc(100% - 16px) !important;
    max-width: calc(100% - 16px) !important;
    margin-left: 8px !important;
    margin-right: 8px !important;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    float: none !important;
    width: calc(100% - 32px) !important;
    max-width: calc(100% - 32px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0;
    padding-right: 0;
    overflow-x: hidden;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page .com-attack-title {
    margin-top: 2px !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    line-height: 1;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page .com-attack-title .yellowfont {
    line-height: 1;
    display: inline-block;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page .com-attack-controls-row {
    order: 1;
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: -28px !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page .com-attack-controls {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
    box-sizing: border-box;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page .com-attack-fleet-wrap {
    order: 2;
    width: 100%;
    max-width: 100%;
    margin: 10px auto 0;
    padding: 0;
    align-self: center;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page .com-attack-fleet-note {
    order: 3;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page .com-attack-help {
    order: 4;
    display: table !important;
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px);
    margin-left: auto !important;
    margin-right: auto !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page .com-attack-image,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page .com-attack-desktop-spacer {
    display: none;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page .com-attack-controls table.Default {
    display: table !important;
    width: 100% !important;
    max-width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page .com-attack-controls table.Default:first-of-type {
    margin-top: 0 !important;
    margin-bottom: 4px !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page .com-attack-controls table.Default:first-of-type td {
    padding-top: 4px;
    padding-bottom: 4px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page .com-attack-fleet-table {
    display: table !important;
    width: 100% !important;
    max-width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
    table-layout: fixed;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page .com-attack-fleet-table td {
    padding-left: 3px;
    padding-right: 3px;
    overflow-wrap: anywhere;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page .com-attack-fleet-table td:nth-child(2) {
    width: 40%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page .com-attack-fleet-table td:nth-child(3) {
    width: 18%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page .com-attack-fleet-table td:nth-child(4) {
    width: 20%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page .com-attack-fleet-table td:nth-child(6) {
    width: 22%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-page .com-attack-fleet__power-unit {
    display: none;
  }
}

/* =========================================================
   CONFIRM ATTACK PAGE (Nebula / Daylight)
   Compact confirmation tables with natural-case labels.
   ========================================================= */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page table.Default tr.Header td,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page table.Default tr.Header th {
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page table.Default.kv tbody td:first-child,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page table.Default.kv td:first-child {
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page .com-attack-confirm-table {
  width: 82% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-bottom: 8px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page .com-attack-confirm-table td {
  padding-top: 4px;
  padding-bottom: 4px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page .com-attack-confirm-actions {
  margin-top: 2px !important;
}

@media (max-width: 767.98px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8.col-sm-12:has(.gc-attack-confirm-page) {
    width: calc(100% - 16px) !important;
    max-width: calc(100% - 16px) !important;
    margin-left: 8px !important;
    margin-right: 8px !important;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page {
    box-sizing: border-box;
    float: none !important;
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0;
    padding-right: 0;
    overflow-x: hidden;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page .com-attack-confirm-title {
    margin-top: 0 !important;
    margin-bottom: 2px !important;
    padding: 0 !important;
    line-height: 1;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page .com-attack-confirm-title .yellowfont {
    display: inline-block;
    line-height: 1;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page .com-attack-confirm-row {
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page .com-attack-confirm-main {
    width: 100%;
    max-width: 100%;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page .com-attack-confirm-table {
    display: table !important;
    width: 100% !important;
    max-width: 100%;
    margin: 0 auto 4px !important;
    table-layout: fixed;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page .com-attack-confirm-table td {
    padding: 2px 6px;
    line-height: 1.15;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page .com-attack-confirm-table tr.Header td {
    padding-top: 3px;
    padding-bottom: 3px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page .com-attack-confirm-table td:first-child {
    width: 42% !important;
    white-space: nowrap;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page .com-attack-confirm-table td:last-child {
    width: 58% !important;
    overflow-wrap: anywhere;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page .com-attack-confirm-actions {
    margin-top: 0 !important;
    margin-bottom: 4px !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page .com-attack-confirm-actions input[type="button"],
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page .com-attack-confirm-actions input[type="submit"] {
    padding-top: 3px;
    padding-bottom: 3px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page .com-attack-confirm-side {
    width: 100%;
    max-width: 100%;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page .com-attack-confirm-side img.pic {
    display: none;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page .com-attack-confirm-spacer {
    display: none;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page .com-attack-confirm-notes {
    width: 100%;
    margin-top: 0 !important;
    line-height: 1.2;
    text-align: center;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-confirm-page .com-attack-confirm-notes br {
    display: none;
  }
}

/* =========================================================
   ATTACK RESULT PAGE (Nebula / Daylight)
   Modern result-first battle report; detailed log is last.
   ========================================================= */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page table.Default tr.Header td,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page table.Default tr.Header th {
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-title {
  display: table;
  width: auto !important;
  margin: 0 auto 10px !important;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--text-primary);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-title td {
  padding: 5px 12px;
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-fleets {
  margin-left: 0;
  margin-right: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-fleet-table,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .gc-battle-table,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-log {
  margin-left: auto !important;
  margin-right: auto !important;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-fleet-table td,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .gc-battle-table td {
  padding-top: 4px;
  padding-bottom: 4px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-log-row {
  margin-left: 0;
  margin-right: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-log {
  width: 82% !important;
  max-width: 820px;
  text-align: left !important;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-log td {
  padding: 10px 12px;
  line-height: 1.35;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-log b:first-child {
  display: block;
  margin-bottom: 6px;
  text-align: center;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-actions {
  margin-top: 8px !important;
}

@media (min-width: 768px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .gc-battle-table {
    width: min(88%, 700px) !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-fleets {
    width: min(96%, 980px);
    margin-left: auto;
    margin-right: auto;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-fleet-col {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-fleet-table {
    width: 100% !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-log {
    width: min(92%, 860px) !important;
    max-width: 860px;
  }
}

@media (max-width: 767.98px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .col-lg-8.col-sm-12:has(.gc-attack-result-page) {
    width: calc(100% - 16px) !important;
    max-width: calc(100% - 16px) !important;
    margin-left: 8px !important;
    margin-right: 8px !important;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page {
    box-sizing: border-box;
    float: none !important;
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 4px !important;
    padding-left: 0;
    padding-right: 0;
    overflow-x: hidden;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-title {
    display: table !important;
    width: 100% !important;
    max-width: 100%;
    margin: 0 auto 6px !important;
    table-layout: fixed;
    font-size: 13px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-title td {
    padding: 4px 6px;
    text-align: center !important;
    overflow-wrap: anywhere;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-fleets {
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-fleet-col {
    width: 100%;
    max-width: 100%;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-fleet-table,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .gc-battle-table {
    display: table !important;
    width: 100% !important;
    max-width: 100%;
    margin: 0 auto 6px !important;
    table-layout: fixed;
    box-sizing: border-box;
    font-size: 12px !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-fleet-table td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .gc-battle-table td {
    padding: 2px 3px;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-fleet-table tr.Header td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .gc-battle-table tr.Header td {
    padding-top: 3px;
    padding-bottom: 3px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-actions {
    margin-top: 2px !important;
    margin-bottom: 4px !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-actions input[type="button"] {
    padding-top: 3px;
    padding-bottom: 3px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-log-row {
    margin: 6px 0 0 !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-log {
    display: table !important;
    width: 100% !important;
    max-width: 100%;
    margin: 0 auto !important;
    font-size: 11px;
    table-layout: fixed;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-attack-result-page .com-attack-result-log td {
    padding: 6px 7px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
}

/* Attack range/protection errors render before attack3's page wrapper exists. */
@media (max-width: 767.98px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-attack-range-table {
    display: table !important;
    width: 100% !important;
    max-width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
    table-layout: fixed;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-attack-range-table td {
    padding-left: 3px;
    padding-right: 3px;
    overflow-wrap: anywhere;
  }
}

/* =========================================================
   PRIVATE MESSAGES — LIST (f_pm.cfm) + DETAIL (f_pm_d.cfm)
   + COMPOSER (f_pm_p.cfm / pop_msguser.cfm)
   Nebula + Daylight modern themes only. Classic untouched.
   ========================================================= */

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-sidechat,
body[data-theme="classic"] .gc-sidechat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-sidechat__controls,
body[data-theme="classic"] .gc-sidechat__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  line-height: 1.2;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-sidechat__controls a,
body[data-theme="classic"] .gc-sidechat__controls a {
  display: inline-block;
  padding: 2px 4px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-sidechat__controls span,
body[data-theme="classic"] .gc-sidechat__controls span {
  color: var(--text-muted);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-sidechat__feed,
body[data-theme="classic"] .gc-sidechat__feed {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 340px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  text-align: left;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-sidechat__feed::-webkit-scrollbar,
body[data-theme="classic"] .gc-sidechat__feed::-webkit-scrollbar {
  width: 8px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-sidechat__feed::-webkit-scrollbar-track,
body[data-theme="classic"] .gc-sidechat__feed::-webkit-scrollbar-track {
  background: transparent;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-sidechat__feed::-webkit-scrollbar-thumb,
body[data-theme="classic"] .gc-sidechat__feed::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--border-strong), var(--border));
  border-radius: 999px;
  border: 1px solid rgba(12, 16, 24, 0.35);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-sidechat__feed::-webkit-scrollbar-thumb:hover,
body[data-theme="classic"] .gc-sidechat__feed::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent-cool), var(--border-strong));
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-sidechat__entry,
body[data-theme="classic"] .gc-sidechat__entry {
  margin: 0 0 6px;
  line-height: 1.3;
  color: #aaaaaa;
  overflow-wrap: anywhere;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-sidechat__name,
body[data-theme="classic"] .gc-sidechat__name {
  display: inline;
  font-weight: 700;
  color: #c3bbc3;
  text-decoration: underline;
  margin-right: 4px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-sidechat__text,
body[data-theme="classic"] .gc-sidechat__text {
  color: inherit;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm,
body[data-theme="classic"] .gc-pm {
  width: min(100%, 940px);
  margin: 0 auto 14px;
  padding: 0 10px;
  box-sizing: border-box;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm__title,
body[data-theme="classic"] .gc-pm__title,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose-title {
  margin: 2px 0 6px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-primary);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-page-nav,
body[data-theme="classic"] .gc-pm-page-nav {
  display: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-page-nav__btn,
body[data-theme="classic"] .gc-pm-page-nav__btn {
  flex: 1 1 calc(16.66% - 4px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 3px 5px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(125, 191, 242, 0.08), rgba(125, 191, 242, 0)),
    var(--bg-elevated);
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition:
    border-color var(--dur-base) var(--ease),
    color var(--dur-base) var(--ease),
    transform var(--dur-base) var(--ease);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-page-nav__btn:hover,
body[data-theme="classic"] .gc-pm-page-nav__btn:hover,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-page-nav__btn--active,
body[data-theme="classic"] .gc-pm-page-nav__btn--active {
  color: var(--accent);
  border-color: var(--border-strong);
  text-decoration: none;
  transform: translateY(-1px);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-page-nav__btn i,
body[data-theme="classic"] .gc-pm-page-nav__btn i {
  font-size: 12px;
}

body[data-theme="classic"] .gc-pm__tablewrap {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

body[data-theme="classic"] table.Default.gc-pm__list,
body[data-theme="classic"] table.Default.gc-pm__toolbar,
body[data-theme="classic"] table.Default.gc-pm__legend {
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
}

body[data-theme="classic"] table.Default.gc-pm__list {
  table-layout: fixed;
}

body[data-theme="classic"] table.Default.gc-pm__list td,
body[data-theme="classic"] table.Default.gc-pm__list th {
  padding-top: 2px !important;
  padding-bottom: 2px !important;
}

body[data-theme="classic"] .gc-pm__col--chk { width: 30px; }
body[data-theme="classic"] .gc-pm__col--icn { width: 32px; }
body[data-theme="classic"] .gc-pm__col--time { width: 184px; }
body[data-theme="classic"] .gc-pm__col--from { width: 135px; }

body[data-theme="classic"] .gc-pm__td--subj a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-shell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-bulk {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 2px 0 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-detail-card__eyebrow,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__eyebrow {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-bulk__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-bulk__note {
  color: var(--text-muted);
  font-size: 11px;
  text-align: left;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 11px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-button {
  appearance: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--text-inverse);
  padding: 6px 12px;
  min-height: 30px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-button--danger {
  background: transparent;
  color: var(--accent-hot);
  border-color: rgba(236, 98, 98, 0.45);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-button--ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card {
  position: relative;
  display: grid;
  grid-template-columns: 20px 20px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card--new {
  border-color: rgba(125, 191, 242, 0.5);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card--replied {
  border-color: rgba(127, 197, 146, 0.45);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card__select,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card__status {
  padding-top: 2px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card__status img {
  display: block;
  width: auto;
  max-height: 13px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card__status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(125, 191, 242, 0.3);
  margin-top: 3px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card__body {
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card__row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card__meta {
  display: block;
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card__senderline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card__sender {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card__sender img {
  width: auto;
  max-height: 14px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card__system {
  color: var(--accent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card__ghost {
  color: var(--text-muted);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card__stamp {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card__preview {
  display: block;
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card__preview:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-empty {
  padding: 12px 10px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0;
  flex-wrap: wrap;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm__pager {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text-muted);
  font-style: italic;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm__pager a {
  text-decoration: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm__pager-disabled,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm__pager-divider {
  color: var(--text-muted);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-legend {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 11px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-legend__title {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-legend__item img {
  max-height: 14px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-detail-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
  margin-top: 2px;
  box-shadow: var(--shadow-sm);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-detail-card {
  background: var(--bg-surface);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-detail-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 9px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  align-items: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-detail-card__actions a {
  font-size: 10px;
  color: var(--text-secondary);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-detail-card__actions a:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-detail-card__actions a.gc-pm-action--primary {
  color: var(--accent);
  border-color: var(--accent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-actions-back {
  margin-right: 4px;
  padding-right: 10px;
  border-right: 1px solid var(--border) !important;
  border-color: var(--border) !important;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-detail-card__meta {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 10px;
  align-items: baseline;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-detail-card__meta-label {
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-detail-card__meta-value {
  color: var(--text-primary);
  font-size: 12px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-detail-card__status {
  font-size: 9px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  margin-left: 6px;
  vertical-align: middle;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-detail-card__body {
  padding: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-primary);
  word-break: break-word;
  overflow-wrap: anywhere;
  min-height: 0;
  text-align: left;
  border-top: 1px solid var(--border);
  background: var(--bg-base);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-thread {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-thread__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 82%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-thread__item--self {
  align-self: flex-end;
  text-align: right;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-thread__item--other,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-thread__item--system {
  align-self: flex-start;
  text-align: left;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-thread__hdr {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-thread__author {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-thread__bubble {
  padding: 6px 9px;
  border-radius: 12px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-thread__item--self .gc-pm-thread__author {
  color: var(--accent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-thread__item--self .gc-pm-thread__bubble {
  background: rgba(232, 181, 99, 0.12);
  border: 1px solid rgba(232, 181, 99, 0.28);
  color: var(--text-primary);
  border-bottom-right-radius: 6px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-thread__item--other .gc-pm-thread__author,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-thread__item--system .gc-pm-thread__author {
  color: var(--accent-cool);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-thread__item--other .gc-pm-thread__bubble {
  background: rgba(125, 191, 242, 0.12);
  border: 1px solid rgba(125, 191, 242, 0.26);
  color: var(--text-primary);
  border-bottom-left-radius: 6px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-thread__item--system .gc-pm-thread__bubble {
  background: rgba(127, 197, 146, 0.12);
  border: 1px solid rgba(127, 197, 146, 0.24);
  color: var(--text-primary);
  border-bottom-left-radius: 6px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-thread__stamp {
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--text-muted);
}

/* Grouped quoted-message blocks (consecutive > lines) */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-quote-block {
  border-left: 3px solid var(--accent-cool);
  background: rgba(125, 191, 242, 0.08);
  padding: 7px 10px;
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-quote-gap {
  height: 6px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-quote-block__hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-style: normal;
  margin-bottom: 6px;
  opacity: 0.75;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-quote-block__label {
  color: var(--text-muted);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-quote-block__body {
  line-height: 1.4;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-quote-block__author {
  font-weight: 700;
  letter-spacing: 0.04em;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-quote-block--self {
  border-left-color: rgba(232, 181, 99, 0.95);
  background: rgba(232, 181, 99, 0.08);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-quote-block--self .gc-pm-quote-block__author {
  color: var(--accent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-quote-block--other {
  border-left-color: rgba(125, 191, 242, 0.95);
  background: rgba(125, 191, 242, 0.08);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-quote-block--other .gc-pm-quote-block__author {
  color: var(--accent-cool);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-quote-block--depth-2 {
  filter: saturate(0.92);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-quote-block--depth-3,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-quote-block--depth-4,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-quote-block--depth-5 {
  filter: saturate(0.84) brightness(0.96);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(100%, 980px);
  margin: 0 auto;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__panel,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__quote {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__panel {
  padding: 16px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__title {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.1;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__field > span {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__field input[type="text"],
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__field select,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-base);
  color: var(--text-primary);
  padding: 10px 12px;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__textarea {
  min-height: 220px;
  resize: vertical;
  line-height: 1.5;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__counter input {
  width: 58px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 6px 8px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__quote {
  padding: 14px 16px;
  background:
    linear-gradient(180deg, rgba(125, 191, 242, 0.08), transparent),
    var(--bg-surface);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__quote-label {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__quote-body {
  border-left: 3px solid var(--accent-cool);
  padding-left: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-book {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-book__alert {
  width: min(100%, 940px);
  margin: 0 auto 8px;
  padding: 10px 12px;
  border: 1px solid rgba(232, 181, 99, 0.34);
  border-radius: var(--radius-md);
  background: rgba(232, 181, 99, 0.1);
  color: var(--text-primary);
  box-sizing: border-box;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-book__panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-book__heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-book__title {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.1;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-book__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-book__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-book__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-book__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-book__identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-book__intel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  flex: 0 0 auto;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-book__name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-book__name a {
  color: var(--text-primary);
  text-decoration: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-book__name a:hover {
  color: var(--accent);
  text-decoration: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-book__item-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm,
  body[data-theme="classic"] .gc-pm {
    width: calc(100% - 16px);
    margin-left: auto;
    margin-right: auto;
    padding: 0 4px;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm__title,
  body[data-theme="classic"] .gc-pm__title,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose-title {
    margin-bottom: 6px;
    font-size: 14px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-page-nav,
  body[data-theme="classic"] .gc-pm-page-nav {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 6px;
    width: 100%;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-page-nav__btn,
  body[data-theme="classic"] .gc-pm-page-nav__btn {
    padding: 5px 1px 4px;
    font-size: 7px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-bulk,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-footer,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__footer {
    flex-direction: column;
    align-items: stretch;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-bulk {
    padding: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-shell,
  body[data-theme="classic"] .gc-pm__tablewrap,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-list,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-footer {
    width: 100%;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-bulk__note {
    text-align: left;
  }

  body[data-theme="classic"] table.Default.gc-pm__list {
    table-layout: fixed;
    font-size: 12px;
  }

  body[data-theme="classic"] table.Default.gc-pm__list tr.Header td {
    font-size: 10px;
    white-space: nowrap;
  }

  body[data-theme="classic"] .gc-pm__col--time { width: 118px; }
  body[data-theme="classic"] .gc-pm__col--from { width: 112px; }

  body[data-theme="classic"] .gc-pm__td--time,
  body[data-theme="classic"] .gc-pm__td--from,
  body[data-theme="classic"] .gc-pm__td--subj {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body[data-theme="classic"] .gc-pm__td--time {
    font-size: 11px;
  }

  body[data-theme="classic"] .gc-pm__td--subj a {
    white-space: normal;
  }

  body[data-theme="classic"] table.Default.gc-pm__toolbar,
  body[data-theme="classic"] table.Default.gc-pm__legend {
    width: 100% !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card {
    grid-template-columns: 18px 18px minmax(0, 1fr);
    gap: 6px;
    padding: 4px 7px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-list {
    padding-inline: 2px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card__row {
    display: block;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card__meta {
    margin-bottom: 3px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card__senderline {
    flex-wrap: wrap;
    gap: 3px 6px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card__stamp {
    align-items: flex-start;
    gap: 6px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card__sender,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-card__preview {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-detail-card {
    border-radius: var(--radius-md);
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-detail-card {
    margin-top: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__panel,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__quote {
    padding: 12px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__title {
    font-size: 18px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-detail-card__body {
    padding: 12px 10px;
    font-size: 13px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-thread__item {
    max-width: 92%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-thread__hdr {
    gap: 5px;
    flex-wrap: wrap;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-detail-card__meta {
    gap: 4px 8px;
    padding: 8px 10px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-detail-card__actions {
    padding: 7px 10px;
    gap: 5px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-detail-card__actions a {
    flex-shrink: 0;
    font-size: 10px;
    padding: 3px 8px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-quote-block__hdr {
    gap: 6px;
    flex-wrap: wrap;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__grid {
    grid-template-columns: 1fr;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__textarea {
    min-height: 170px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__actions {
    width: 100%;
    justify-content: stretch;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-compose__actions .gc-pm-button {
    width: 100%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-book__panel,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-book__alert {
    padding: 12px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-book__grid {
    grid-template-columns: 1fr;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-book__item {
    flex-direction: column;
    align-items: stretch;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-book__item-actions {
    justify-content: stretch;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-pm-book__item-actions .gc-pm-button {
    width: 100%;
    text-align: center;
  }
}

/* =========================================================
   REDEEM PROJECT TOOLTIPS (f_com_donate_redeem)
   ========================================================= */

table.Default.gc-redeem-projects {
  overflow: visible;
}

.gc-redeem-projects td {
  overflow: visible;
}

.gc-redeem-projects__project {
  position: relative;
}

.gc-redeem-projects__cost {
  text-align: right;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.gc-project-tooltip__link {
  text-decoration: none;
}

.gc-project-tooltip__link:hover,
.gc-project-tooltip__link:focus {
  text-decoration: none;
}

.gc-project-tooltip__float {
  position: fixed;
  z-index: 10000;
  width: max-content;
  max-width: min(340px, calc(100vw - 16px));
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  text-align: left;
  white-space: normal;
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-3px);
  transition:
    opacity var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease),
    visibility var(--dur-fast) var(--ease);
}

.gc-project-tooltip__float--active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.gc-project-tooltip__float::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -5px;
  width: 9px;
  height: 9px;
  transform: translateX(-50%) rotate(45deg);
}

.gc-project-tooltip__float--above::before {
  top: auto;
  bottom: -5px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-redeem-projects {
  width: min(100%, 380px) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md);
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-surface);
  color: var(--text-primary) !important;
  box-shadow: var(--shadow-sm);
  table-layout: auto;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-redeem-projects__header td {
  padding: 7px 10px !important;
  background:
    linear-gradient(180deg, rgba(125, 191, 242, 0.12), rgba(125, 191, 242, 0)),
    var(--bg-elevated) !important;
  color: var(--accent) !important;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-strong);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-redeem-projects__row td {
  padding: 7px 10px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  transition:
    background var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-redeem-projects__row:nth-child(even) td {
  background: rgba(125, 191, 242, 0.035);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-redeem-projects__row:hover td {
  background: var(--bg-elevated);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-redeem-projects__project a {
  color: var(--accent);
  font-weight: 500;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-redeem-projects__project a:hover,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-redeem-projects__project a:focus {
  color: var(--accent-hover);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-redeem-projects__cost {
  color: var(--text-primary);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-tooltip__float {
  border: 1px solid var(--border-strong);
  background:
    linear-gradient(135deg, rgba(232, 181, 99, 0.13), transparent 58%),
    var(--bg-overlay);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-body);
  font-size: 12px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-project-tooltip__float::before {
  border-left: 1px solid var(--border-strong);
  border-top: 1px solid var(--border-strong);
  background: var(--bg-overlay);
}

body[data-theme="classic"] .gc-redeem-projects__cost {
  color: var(--text-primary);
}

body[data-theme="classic"] .gc-project-tooltip__link:hover,
body[data-theme="classic"] .gc-project-tooltip__link:focus {
  color: var(--link-hover);
}

body[data-theme="classic"] .gc-project-tooltip__float {
  border: 1px solid var(--accent);
  background: var(--bg-base);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-body);
  font-size: 12px;
}

body[data-theme="classic"] .gc-project-tooltip__float::before {
  border-left: 1px solid var(--accent);
  border-top: 1px solid var(--accent);
  background: var(--bg-base);
}

/* Redeem credit transfer form. Classic keeps the legacy Default2 table skin;
   modern themes use the shared Default table chrome with a compact form layout. */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-redeem-transfer {
  width: min(100%, 32rem) !important;
  margin: 0 auto !important;
  box-shadow: var(--shadow-md);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-redeem-transfer td {
  padding: 12px 14px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-redeem-transfer__form {
  display: grid;
  grid-template-columns: 1fr 1.35fr auto;
  align-items: end;
  gap: 10px;
  margin: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-redeem-transfer__field {
  display: grid;
  gap: 4px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
  text-align: left;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-redeem-transfer__field span {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-redeem-transfer__field input[type="text"] {
  width: 100% !important;
  box-sizing: border-box;
  text-align: center;
  font-family: var(--font-mono);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-redeem-transfer__submit {
  min-width: 96px;
}

@media (max-width: 640px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-redeem-transfer {
    width: calc(100% - 12px) !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-redeem-transfer__form {
    grid-template-columns: 1fr;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-redeem-transfer__submit {
    justify-self: center;
  }
}

/* -------------------------------------------------------------------------
   Users online popup (`pop_useronline.cfm`) + sidebar subtitle (`i_f_800`)
-------------------------------------------------------------------------- */

body:is([data-theme="nebula"], [data-theme="daylight"]) .modern-public.is-popup .modern-content {
  padding: 10px 12px 14px !important;
  max-width: 32rem;
  margin: 0 auto;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-sidebar-online-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-useronline-popup {
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-useronline-popup__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-useronline-popup__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-useronline-popup__close {
  appearance: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  background: var(--bg-overlay);
  color: var(--accent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-useronline-popup__close:hover {
  border-color: var(--accent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-useronline-popup__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

@media (max-width: 520px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-useronline-popup__stats {
    grid-template-columns: 1fr;
  }
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-useronline-popup__stat {
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: var(--bg-overlay);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-useronline-popup__stat--live {
  border-top: 3px solid var(--accent-good);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-useronline-popup__stat--day {
  border-top: 3px solid var(--accent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-useronline-popup__stat-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-useronline-popup__stat-value {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-primary);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-useronline-popup__stat-hint {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-muted);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-useronline-popup__list-head {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-useronline-popup__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
}

@media (min-width: 520px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-useronline-popup__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-useronline-popup__cell {
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-useronline-popup__name {
  display: block;
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-useronline-popup__name:hover {
  color: var(--link-hover);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-useronline-popup__server {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-useronline-popup__trunc,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-useronline-popup__empty {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* =========================================================
   RESEARCHED TECHNOLOGY ARCHIVE (f_com_rtreed)
   Modern replacement for the legacy two-column fixed table.
   ========================================================= */

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-rtreed-page {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 4px 0 16px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-rtreed-hero {
  width: min(100%, 980px);
  margin: 0 auto 14px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 18%, transparent), transparent 30%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg-surface) 94%, transparent), color-mix(in srgb, var(--bg-surface-2) 96%, transparent));
  box-shadow: var(--shadow-md);
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-rtreed-hero__eyebrow {
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-rtreed-hero__title {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1;
  color: var(--accent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-rtreed-hero__meta {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-rtreed-table {
  width: min(100%, 980px) !important;
  margin: 0 auto;
  table-layout: fixed;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-rtreed-table tr.Header td {
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-rtreed-table tbody td {
  padding-top: 6px;
  padding-bottom: 6px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-rtreed-table tbody tr > td:nth-child(1) {
  width: 52%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-rtreed-table tbody tr > td:nth-child(2) {
  width: 28%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-rtreed-table tbody tr > td:nth-child(3) {
  width: 20%;
  text-align: right;
  font-family: var(--font-mono);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-rtreed-table__link {
  color: var(--link);
  font-weight: 700;
  text-decoration: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-rtreed-table__link:hover {
  color: var(--link-hover);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-rtreed-empty {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-rtreed-actions {
  margin: 16px 0 0;
  text-align: center;
}

@media (max-width: 767.98px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-rtreed-page {
    padding-bottom: 12px;
    overflow-x: hidden;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-rtreed-hero,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-rtreed-table {
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
    margin-left: 10px !important;
    margin-right: 10px !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-rtreed-hero {
    padding: 14px 14px 15px;
    margin-bottom: 10px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-rtreed-hero__title {
    font-size: clamp(16px, 5.5vw, 20px);
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-rtreed-table {
    display: table !important;
    overflow-x: visible;
    table-layout: fixed;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-rtreed-table thead {
    display: table-header-group !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-rtreed-table tbody {
    display: table-row-group !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-rtreed-table tr {
    display: table-row !important;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-rtreed-table td,
  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-rtreed-table th {
    display: table-cell !important;
    box-sizing: border-box;
    min-width: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-rtreed-table tr.Header td {
    font-size: 10px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-rtreed-table tbody td {
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 4px;
    padding-right: 4px;
    font-size: 11px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-rtreed-table tbody tr > td:nth-child(1) {
    width: 50%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-rtreed-table tbody tr > td:nth-child(2) {
    width: 28%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) table.Default.gc-rtreed-table tbody tr > td:nth-child(3) {
    width: 22%;
    font-size: 10px;
  }
}

body[data-theme="classic"] .gc-rtreed-page {
  width: min(100%, 1080px);
  margin: 0 auto;
}

body[data-theme="classic"] .gc-rtreed-hero {
  margin: 0 auto 12px;
  text-align: center;
}

body[data-theme="classic"] .gc-rtreed-actions {
  text-align: center;
}

body[data-theme="classic"] table.Default.gc-rtreed-table {
  margin-left: auto;
  margin-right: auto;
}

/* =========================================================
   COLONY LIST MODERN (s_show_colony / f_com_col)
   ========================================================= */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 4px 0 10px;
  overflow-x: hidden;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page__toolbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 12px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page__toolbar::before,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page__toolbar::after {
  content: "";
  flex: 1 1 auto;
  max-width: 140px;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 22%, transparent));
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page__toolbar::after {
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, transparent), transparent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page__tabs {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin: 0 12px;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: 999px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg-surface-alt) 96%, white 4%), color-mix(in srgb, var(--bg-surface) 96%, transparent)),
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 62%);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 5%, transparent),
    0 8px 18px rgba(4, 10, 26, 0.12);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page__tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 14px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-muted);
  transition: transform 160ms ease, color 160ms ease, background 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  border: 1px solid transparent;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page__tab:hover,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page__tab.is-active {
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page__tab:hover {
  transform: translateY(-1px);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page__tab.is-active {
  color: #18213a;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, white 12%), color-mix(in srgb, var(--accent) 72%, black 6%));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 22%, transparent),
    0 4px 10px color-mix(in srgb, var(--accent) 14%, transparent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-form {
  display: grid;
  gap: 8px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page__desktop {
  display: block;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table {
  width: 100%;
  max-width: 100%;
  table-layout: auto;
  border-collapse: collapse !important;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, white 8%, transparent);
  border-radius: calc(var(--radius-md) + 2px);
  background: color-mix(in srgb, white 5%, var(--bg-surface));
  box-shadow:
    0 1px 0 color-mix(in srgb, white 4%, transparent) inset,
    0 8px 24px rgba(0, 0, 0, 0.28);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table thead,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table tbody,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table tfoot,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table tr {
  border: 0 !important;
  background: transparent;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table th,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table td {
  padding: 2px 3px;
  border: 0 !important;
  vertical-align: middle;
  font-size: 12px;
}

/* Subtle row separator — one near-invisible hairline matching the reference */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table tbody tr + tr td {
  border-top: 1px solid color-mix(in srgb, white 5%, transparent) !important;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table th {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 80%, var(--text-muted));
  background: color-mix(in srgb, var(--bg-surface-alt) 55%, transparent);
  text-align: left;
  text-shadow: none;
  border-bottom: 1px solid color-mix(in srgb, white 7%, transparent) !important;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table th.gc-colony-modern-table__metric {
  text-align: right;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table tbody tr:hover td {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table tbody tr:nth-child(odd) td {
  background: transparent;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, white 3%, transparent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table tfoot td {
  border-top: 1px solid color-mix(in srgb, white 7%, transparent) !important;
  background: color-mix(in srgb, var(--bg-surface-alt) 35%, transparent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table__select {
  width: 20px;
  min-width: 20px;
  text-align: center;
  padding: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table__select input {
  inline-size: 16px;
  block-size: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table__colony {
  display: flex;
  align-items: center;
  gap: 6px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table__colony img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table__colony-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table__colony-copy a {
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  font-size: 11px;
  color: var(--accent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table__badge,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__badge,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page__legend-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  height: 14px;
  padding: 0 1px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-hot) 28%, transparent);
  color: var(--accent-hot);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table__class {
  white-space: nowrap;
  font-weight: 600;
  font-size: 11px;
  color: color-mix(in srgb, var(--text) 94%, white 6%);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table__mineral {
  width: 28px;
  min-width: 28px;
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table__mineral-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  vertical-align: middle;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table__mineral-icon {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table__metric {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  font-size: 11px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table tbody td.gc-colony-modern-table__metric {
  font-size: 14px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table td.gc-colony-modern-table__name {
  background-image: linear-gradient(90deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 72%);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table tfoot .gc-colony-modern-table__total-row td {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg-surface-alt) 96%, white 3%), color-mix(in srgb, var(--bg-surface-alt) 92%, transparent));
  border-top: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table .is-good,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__stats .is-good {
  color: var(--accent-good);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table .is-bad,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__stats .is-bad {
  color: var(--accent-hot);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-cards {
  display: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card {
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: var(--radius-md);
  padding: 8px 9px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg-surface) 96%, white 4%), color-mix(in srgb, var(--bg-surface-alt) 95%, transparent)),
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 11%, transparent), transparent 58%);
  box-shadow: 0 8px 16px rgba(5, 10, 24, 0.14);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__top {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 20px;
  min-height: 20px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__select input {
  inline-size: 16px;
  block-size: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__planet {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__identity {
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__identity-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: nowrap;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__name {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  flex: 0 1 auto;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__class {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex: 0 0 auto;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px 6px;
  margin: 8px 0 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__stats div {
  padding: 0;
  border: none;
  background: transparent;
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__stats dt {
  margin: 0 0 2px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__stats dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__mineral-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__mineral-icon {
  display: block;
  width: 15px;
  height: 15px;
  object-fit: contain;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page__actions {
  display: flex;
  justify-content: flex-start;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page__submit {
  min-height: 28px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  border-radius: 7px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 86%, white 14%), color-mix(in srgb, var(--accent) 70%, black 10%));
  color: #1b2138;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 10px color-mix(in srgb, var(--accent) 16%, transparent);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--accent) 22%, transparent);
}


body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page__legend {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 2%;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-surface-alt) 86%, transparent), color-mix(in srgb, var(--bg-surface) 92%, transparent));
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.5;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-modern-table tfoot td {
  padding-top: 7px;
  padding-bottom: 7px;
  font-size: 12px;
  font-weight: 700;
  background: color-mix(in srgb, var(--bg-surface-alt) 92%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
}

@media (max-width: 767.98px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page {
    padding-left: 6px;
    padding-right: 6px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page__toolbar {
    margin-bottom: 8px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page__tabs {
    width: 100%;
    border-radius: 16px;
    padding: 4px;
    gap: 4px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page__tab {
    flex: 1 1 30%;
    min-width: 0;
    padding-left: 6px;
    padding-right: 6px;
    min-height: 24px;
    font-size: 9px;
    letter-spacing: 0.08em;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page__desktop {
    display: none;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-cards {
    display: grid;
    gap: 2px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Shared column tracks so population / land / mineral line up on every row */
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-cards:has(.gc-colony-cards__head--summary) {
    grid-template-columns: minmax(0, max-content) repeat(4, minmax(44px, 1fr));
    column-gap: 8px;
    row-gap: 2px;
    align-items: center;
  }

  @supports not (grid-template-columns: subgrid) {
    body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card--summary,
    body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-cards__head--summary {
      grid-column: auto;
      grid-template-columns: minmax(0, max-content) repeat(4, minmax(44px, 1fr));
    }
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-cards__head {
    display: none;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card {
    padding: 3px 4px;
    border-radius: 8px;
    border-color: color-mix(in srgb, var(--accent) 14%, transparent);
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--bg-surface-alt) 92%, white 2%), color-mix(in srgb, var(--bg-surface) 96%, transparent));
    box-shadow: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    cursor: pointer;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__top {
    grid-template-columns: 20px 20px minmax(0, 1fr);
    gap: 5px;
    align-items: center;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card--summary {
    position: relative;
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    align-items: center;
    padding: 1px 4px;
    overflow: visible;
    cursor: pointer;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card--summary .gc-colony-card__lead {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card--summary .gc-colony-card__top {
    display: contents;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__select input {
    inline-size: 16px;
    block-size: 16px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__planet {
    width: 18px;
    height: 18px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card--summary .gc-colony-card__select input {
    inline-size: 16px;
    block-size: 16px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card--summary .gc-colony-card__planet {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card--summary .gc-colony-card__identity {
    min-width: 0;
    flex: 1 1 auto;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__name {
    font-size: 11px;
    line-height: 1.1;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__identity-line {
    gap: 5px;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__resource {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    color: var(--text-muted);
    text-transform: uppercase;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card--summary .gc-colony-card__resource {
    grid-column: 4;
    grid-row: 1;
    position: static;
    width: auto;
    margin-left: 0;
    justify-self: center;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__class {
    min-height: auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__badge {
    min-width: 14px;
    height: 14px;
    padding: 0 2px;
    font-size: 8px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px 3px;
    margin-top: 2px;
    padding-top: 2px;
    border-top: 1px solid color-mix(in srgb, var(--accent) 10%, transparent);
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__stat--pair {
    grid-column: span 2;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__stats--summary {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 1px 6px;
    align-items: center;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card--summary .gc-colony-card__stats {
    display: contents;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-cards__head--summary {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    padding: 0 4px 2px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.1;
    text-transform: uppercase;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-cards__head--summary .gc-colony-cards__head__lead {
    grid-column: 1;
    grid-row: 1;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-cards__head--summary span:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    justify-self: stretch;
    text-align: center;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-cards__head--summary span:nth-child(3) {
    grid-column: 3;
    grid-row: 1;
    justify-self: stretch;
    text-align: center;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-cards__head--summary span:nth-child(4) {
    grid-column: 4;
    grid-row: 1;
    justify-self: stretch;
    text-align: center;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card--summary .gc-colony-card__stats > div:nth-child(1) {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    width: 100%;
    justify-content: center;
    justify-self: stretch;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card--summary .gc-colony-card__stats > div:nth-child(2) {
    grid-column: 3;
    grid-row: 1;
    min-width: 0;
    width: 100%;
    justify-content: center;
    justify-self: stretch;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card--summary .gc-colony-card__stats div {
    display: flex;
    align-items: center;
    min-height: 16px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__stats div {
    min-width: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__stats dd {
    font-size: 10px;
    line-height: 1.1;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__stats dt {
    margin-bottom: 1px;
    font-size: 7px;
    letter-spacing: 0.08em;
    line-height: 1.1;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__stats--summary dt {
    display: none;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__stats--summary dd {
    font-size: 12px;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card--summary .gc-colony-card__stats > div:nth-child(1) dd,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card--summary .gc-colony-card__stats > div:nth-child(2) dd {
    width: 100%;
    text-align: center;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__resource .gc-colony-card__mineral-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 100%;
    flex: 0 0 18px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__resource .gc-colony-card__mineral-icon {
    width: 18px;
    height: 100%;
    max-height: 28px;
    object-fit: contain;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__stats div:last-child {
    grid-column: span 2;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__stats--infrastructure {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__stats--consumption {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__stats--infrastructure div:last-child,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__stats--consumption div:last-child {
    grid-column: auto;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card--summary .gc-colony-card__stats div:last-child {
    grid-column: 3;
    grid-row: 1;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card--summary .gc-colony-card__tooltip {
    grid-column: 5;
    grid-row: 1;
    justify-self: center;
    margin-left: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__tooltip-toggle {
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg-surface-alt) 88%, transparent);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
    appearance: none;
    transform: translateZ(0);
    vertical-align: middle;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card--summary .gc-colony-card__tooltip-toggle {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__tooltip-mark {
    display: block;
    line-height: 1;
    transform: translateY(-0.5px);
    pointer-events: none;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card--summary .gc-colony-card__tooltip-mark {
    transform: none;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__tooltip-toggle:active {
    transform: translateZ(0);
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__tooltip-toggle[aria-expanded="true"],
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__tooltip-toggle:focus-visible {
    outline: none;
    border-color: color-mix(in srgb, var(--accent) 55%, transparent);
    background: color-mix(in srgb, var(--accent) 14%, var(--bg-surface-alt));
    color: var(--text-primary);
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__tooltip-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: -2px;
    z-index: 12;
    width: min(212px, calc(100vw - 24px));
    padding: 9px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background:
      linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 62%),
      var(--bg-overlay);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__tooltip-panel::before {
    content: "";
    position: absolute;
    top: -5px;
    right: 9px;
    width: 9px;
    height: 9px;
    transform: rotate(45deg);
    border-left: 1px solid var(--border-strong);
    border-top: 1px solid var(--border-strong);
    background: var(--bg-overlay);
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__tooltip-grid {
    display: grid;
    gap: 6px;
    margin: 0;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__tooltip-grid > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: baseline;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__tooltip-grid dt {
    margin: 0;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.15;
    text-transform: uppercase;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-card__tooltip-grid dd {
    margin: 0;
    text-align: right;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
  }


  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page__legend {
    padding: 6px 8px;
    gap: 8px;
    font-size: 10px;
    line-height: 1.35;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page__actions {
    justify-content: flex-start;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-list-page__submit {
    width: auto;
  }
}

/* =========================================================
   COLONY DETAIL MODERN (f_com_col&colid)
   ---------------------------------------------------------
   Sci-fi command-console aesthetic. Dense data grids,
   notched/clipped panel corners, HUD corner brackets,
   scanline overlays, monospace telemetry, tight padding.
   ========================================================= */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern {
  display: grid;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  padding: 0 0 6px;
  --gc-cdm-accent: var(--accent);
  --gc-cdm-accent-soft: color-mix(in srgb, var(--accent) 18%, transparent);
  --gc-cdm-accent-line: color-mix(in srgb, var(--accent) 32%, transparent);
  --gc-cdm-grid-line: color-mix(in srgb, var(--accent) 6%, transparent);
  --gc-cdm-surface: color-mix(in srgb, var(--bg-surface) 96%, black 4%);
  --gc-cdm-tile: color-mix(in srgb, var(--bg-surface-alt) 70%, transparent);
}

/* ----- Panel chassis: notched corner + scanline + corner brackets ----- */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-card,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__panel {
  position: relative;
  isolation: isolate;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: 4px;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--bg-surface) 96%, white 2%) 0%,
      var(--gc-cdm-surface) 100%);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 4%, transparent),
    0 2px 0 rgba(0, 0, 0, 0.18),
    0 0 0 1px color-mix(in srgb, var(--accent) 4%, transparent);
  clip-path: polygon(
    0 0,
    calc(100% - 12px) 0,
    100% 12px,
    100% 100%,
    12px 100%,
    0 calc(100% - 12px)
  );
}

/* Scanline + grid texture overlay (sci-fi data panel feel) */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-card::before,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    linear-gradient(transparent 49.5%, color-mix(in srgb, var(--accent) 4%, transparent) 50%, transparent 50.5%) 0 0 / 100% 3px,
    linear-gradient(90deg, var(--gc-cdm-grid-line) 1px, transparent 1px) 0 0 / 22px 100%,
    linear-gradient(180deg, var(--gc-cdm-grid-line) 1px, transparent 1px) 0 0 / 100% 22px;
  opacity: 0.55;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.8), rgba(0,0,0,0.25));
}

/* ----- HERO BAR (identity card + stats card) ----- */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 8px;
  align-items: stretch;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 9px 12px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-card--single {
  clip-path: none;
  overflow: visible;
  padding: 9px 14px;
  z-index: 8;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-card--identity {
  padding: 9px 14px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-identity {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-pop-full {
  display: inline;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-pop-abbrev {
  display: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-icon {
  position: relative;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  padding: 2px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 62%),
    color-mix(in srgb, var(--bg-surface-alt) 88%, transparent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 38%, transparent),
    0 0 18px color-mix(in srgb, var(--accent) 14%, transparent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(118px, max-content);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-heading {
  display: grid;
  gap: 2px;
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__title {
  margin: 0;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1;
  letter-spacing: 0;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 22%, transparent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-chips {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__type-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__type-chip {
  min-height: 17px;
  padding: 0 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  color: color-mix(in srgb, var(--accent) 75%, var(--text-primary));
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__type-label {
  display: inline-block;
  min-width: 0;
  white-space: nowrap;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__type-chip .gc-colony-help__toggle {
  width: 13px;
  height: 13px;
  border-color: color-mix(in srgb, var(--accent) 34%, transparent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  font-size: 7px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-chips > .gc-colony-detail-modern__chip,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__type-group > .gc-colony-detail-modern__chip {
  flex: 0 0 auto;
  white-space: nowrap;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-chips > .gc-colony-detail-modern__chip--muted {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  line-height: 17px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__chip {
  display: inline-flex;
  align-items: center;
  min-height: 17px;
  padding: 0 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  color: color-mix(in srgb, var(--accent) 75%, var(--text-primary));
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__chip--muted {
  border-color: color-mix(in srgb, var(--text-muted) 28%, transparent);
  background: color-mix(in srgb, var(--bg-surface-alt) 70%, transparent);
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: none;
  font-weight: 500;
  font-family: var(--font-body);
  font-size: 10px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__chip--border {
  border-color: color-mix(in srgb, var(--accent-hot) 50%, transparent);
  background: color-mix(in srgb, var(--accent-hot) 18%, transparent);
  color: color-mix(in srgb, var(--accent-hot) 75%, white 25%);
  gap: 5px;
  padding-left: 6px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__border-icon {
  display: inline-block;
  height: 11px;
  width: auto;
  vertical-align: middle;
}

/* Hero stat tiles */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-stat {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: start;
  gap: 1px;
  padding: 5px 8px;
  background: color-mix(in srgb, var(--bg-surface-alt) 60%, transparent);
  border-radius: 3px;
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-stat > span {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  line-height: 1.2;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-stat > strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  white-space: nowrap;
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-stat > strong em {
  color: var(--text-muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 500;
  margin-left: 1px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-mineral {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  width: 100%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-aside {
  display: inline-flex;
  align-items: stretch;
  justify-self: end;
  gap: 6px;
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__profile-land,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__profile-mineral {
  display: inline-grid;
  gap: 6px;
  align-items: center;
  min-width: 0;
  padding: 4px 7px 4px 5px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 3px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 72%),
    color-mix(in srgb, var(--bg-surface-alt) 58%, transparent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__profile-land {
  align-content: center;
  min-width: 86px;
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__profile-land strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  white-space: nowrap;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__profile-mineral {
  grid-template-columns: auto minmax(0, 1fr);
  max-width: 172px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__mineral-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__profile-mineral-label {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__mineral-name {
  display: block;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__mineral-chip {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 3px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  border-radius: 50%;
  flex: 0 0 auto;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__mineral-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--accent) 35%, transparent));
}

/* ----- BODY LAYOUT ----- */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(248px, 0.9fr);
  gap: 6px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__column {
  display: grid;
  gap: 6px;
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__panel {
  padding: 9px 12px 10px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  padding-bottom: 5px;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 12%, transparent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__panel-headings {
  display: grid;
  gap: 1px;
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__panel-head--tabs {
  align-items: center;
  display: block;
  gap: 0;
  padding-bottom: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__panel-kicker {
  color: color-mix(in srgb, var(--accent) 72%, var(--text-muted));
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__panel-title {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

/* Extra spacing above the secondary metrics group when stacked in one panel */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__metrics--spaced {
  margin-top: 8px;
}


/* ----- MODIFIER CARDS ----- */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__modifier-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__modifier-card {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  background: color-mix(in srgb, var(--bg-surface-alt) 60%, transparent);
  border-radius: 3px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__modifier-label {
  color: var(--text-muted);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__modifier-value {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__modifier-bar {
  display: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__modifier-card.is-good .gc-colony-detail-modern__modifier-value {
  color: var(--accent-good);
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__modifier-card.is-bad .gc-colony-detail-modern__modifier-value {
  color: var(--accent-hot);
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__modifier-card.is-disabled {
  opacity: 0.55;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__modifier-card.is-disabled .gc-colony-detail-modern__modifier-value {
  color: var(--text-muted);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern .is-good {
  color: var(--accent-good);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern .is-bad {
  color: var(--accent-hot);
}

/* ----- METRICS (compact data tiles) ----- */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__metrics.gc-colony-detail-modern__metrics--empire {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__metrics.gc-colony-detail-modern__metrics--empire > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  padding: 5px 10px;
  background: transparent;
  border-radius: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 8%, transparent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__metrics.gc-colony-detail-modern__metrics--empire > div:last-child {
  border-bottom: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__metrics.gc-colony-detail-modern__metrics--empire dt {
  font-size: 10px;
  letter-spacing: 0.12em;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__metrics.gc-colony-detail-modern__metrics--empire dd {
  text-align: right;
  font-size: 13px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__metrics.gc-colony-detail-modern__metrics--profile {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__num--abbrev {
  display: none;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__num--full {
  display: inline;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__metrics > div {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 5px 8px 6px;
  background: color-mix(in srgb, var(--bg-surface-alt) 60%, transparent);
  border-radius: 3px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__metrics dt {
  margin: 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__metrics dd {
  margin: 0;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__metrics dd em {
  color: var(--text-muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 500;
}

/* ----- PROFILE TABS ----- */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__profile-tabs {
  position: relative;
  display: grid;
  gap: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__tab-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__tab-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  width: 100%;
  gap: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__tab-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px 5px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__tab-label:hover {
  color: var(--text-primary);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__tab-input--main:checked ~ .gc-colony-detail-modern__panel-head--tabs .gc-colony-detail-modern__tab-label--main,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__tab-input--mods:checked ~ .gc-colony-detail-modern__panel-head--tabs .gc-colony-detail-modern__tab-label--mods {
  border-bottom-color: color-mix(in srgb, var(--accent) 72%, transparent);
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent) 9%, transparent));
  color: color-mix(in srgb, var(--accent) 82%, var(--text-primary));
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__tab-panel {
  display: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__tab-input--main:checked ~ .gc-colony-detail-modern__tab-panel--main,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__tab-input--mods:checked ~ .gc-colony-detail-modern__tab-panel--mods {
  display: block;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__modifier-note {
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__modifier-grid--tab .gc-colony-detail-modern__modifier-label {
  letter-spacing: 0;
  text-transform: none;
}

/* ----- BUILD FORM ----- */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__form {
  display: grid;
  gap: 5px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__form-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 38px 64px;
  gap: 4px 4px;
  padding: 0 8px;
  color: color-mix(in srgb, var(--accent) 65%, var(--text-muted));
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__form-head > span:nth-child(2) {
  text-align: center;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__form-head > span:nth-child(3) {
  text-align: right;
}
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__form-head > span:nth-child(4) {
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__form-head-stat {
  color: color-mix(in srgb, var(--text-primary) 72%, var(--text-muted));
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 0;
  text-align: right;
  white-space: nowrap;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__form-grid {
  display: grid;
  gap: 3px;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 38px 64px;
  gap: 4px;
  align-items: center;
  padding: 4px 8px;
  background: color-mix(in srgb, var(--bg-surface-alt) 60%, transparent);
  border-radius: 3px;
  transition: background 0.15s ease;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__form-row:hover {
  background: color-mix(in srgb, var(--bg-surface-alt) 80%, transparent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__max-btn {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: 22px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: color-mix(in srgb, var(--accent) 85%, var(--text-primary));
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 20px;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__max-btn:hover {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  color: var(--text-primary);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__form-row.is-disabled {
  opacity: 0.55;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__form-row span {
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__form-row em {
  color: var(--text-muted);
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 10px;
  text-align: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__form-row strong {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  min-width: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__form-row input {
  width: 100%;
  min-width: 0;
  padding: 3px 5px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 2px;
  background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__form-row input:focus {
  outline: none;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-surface));
  box-shadow:
    0 0 0 1px var(--accent),
    0 0 12px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* ----- ACTIONS (buttons / links) ----- */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__actions--form {
  margin-top: 6px;
  justify-content: flex-end;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__actions-spacer {
  flex: 1;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__action--done {
  flex: 0 0 auto;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__actions--stack {
  flex-direction: column;
  align-items: stretch;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__action,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__action[type="submit"] {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--accent) 14%, transparent),
      color-mix(in srgb, var(--bg-surface-alt) 70%, transparent));
  color: color-mix(in srgb, var(--accent) 80%, var(--text-primary));
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__action:hover,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__action[type="submit"]:hover {
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--accent) 28%, transparent),
      color-mix(in srgb, var(--accent) 12%, transparent));
  color: var(--text-primary);
  transform: translateY(-1px);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__action--submit {
  flex: 0 0 108px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent) 92%, white 8%),
    color-mix(in srgb, var(--accent) 70%, black 6%));
  color: #1b2138;
  border-color: var(--accent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 30%, transparent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__action--submit:hover {
  background: linear-gradient(180deg,
    var(--accent),
    color-mix(in srgb, var(--accent) 80%, black 4%));
  color: #1b2138;
  box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 50%, transparent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__action--subtle {
  background: color-mix(in srgb, var(--bg-surface-alt) 80%, transparent);
  border-color: color-mix(in srgb, var(--text-muted) 30%, transparent);
  color: var(--text-muted);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__action--warn {
  border-color: color-mix(in srgb, var(--accent-hot) 45%, transparent);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent-hot) 16%, transparent),
    color-mix(in srgb, var(--bg-surface-alt) 70%, transparent));
  color: color-mix(in srgb, var(--accent-hot) 86%, white 14%);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__action--warn:hover {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent-hot) 32%, transparent),
    color-mix(in srgb, var(--accent-hot) 14%, transparent));
  color: white;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__action--disabled {
  opacity: 0.48;
  pointer-events: none;
}

/* ----- SURFACE PANEL ----- */
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__panel--surface {
  padding: 0;
  overflow: hidden;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__panel--surface::before,
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__panel--surface::after {
  z-index: 2;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__surface-link {
  position: relative;
  display: block;
  text-decoration: none;
  overflow: hidden;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__surface-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 8;
  object-fit: cover;
  filter: brightness(0.85) saturate(1.1);
  transition: filter 0.25s ease, transform 0.4s ease;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__surface-link:hover .gc-colony-detail-modern__surface-image {
  filter: brightness(1.0) saturate(1.2);
  transform: scale(1.04);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__surface-overlay {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: linear-gradient(180deg,
    transparent,
    color-mix(in srgb, var(--bg-surface) 88%, black));
  z-index: 1;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__surface-cta {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-help__toggle {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-surface-alt) 88%, transparent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-help__mark {
  display: block;
  line-height: 1;
  transform: translateY(-0.5px);
  pointer-events: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-help__toggle[aria-expanded="true"],
body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-help__toggle:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-surface-alt));
  color: var(--text-primary);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-help__panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1000;
  width: min(240px, calc(100vw - 24px));
  padding: 7px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 62%),
    var(--bg-overlay);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-help__panel::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 9px;
  width: 9px;
  height: 9px;
  transform: rotate(45deg);
  border-left: 1px solid var(--border-strong);
  border-top: 1px solid var(--border-strong);
  background: var(--bg-overlay);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-help__panel p {
  margin: 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-help__panel--mods {
  width: min(280px, calc(100vw - 24px));
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__modifier-tooltip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 7px 0 0;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__modifier-tooltip > div {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 5px 6px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--bg-surface-alt) 62%, transparent);
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__modifier-tooltip dt {
  margin: 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__modifier-tooltip dd {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__modifier-tooltip dd.is-disabled {
  color: var(--text-muted);
}

@media (max-width: 767.98px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern {
    padding-left: 4px;
    padding-right: 4px;
    gap: 5px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-bar {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-card {
    padding: 8px 10px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-pop-full {
    display: none;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-pop-abbrev {
    display: inline;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-stat--pop > strong {
    font-size: 11px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__layout {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Treasury: horizontal 3-up tile layout on mobile (overrides desktop vertical) */
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__metrics.gc-colony-detail-modern__metrics--empire {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__metrics.gc-colony-detail-modern__metrics--empire > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
    padding: 5px 8px 6px;
    background: color-mix(in srgb, var(--bg-surface-alt) 60%, transparent);
    border-bottom: 0;
    border-radius: 3px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__metrics.gc-colony-detail-modern__metrics--empire dd {
    text-align: left;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__metrics.gc-colony-detail-modern__metrics--empire dt {
    font-size: 7.5px;
    letter-spacing: 0.14em;
  }

  /* Use the abbreviated form on mobile so big numbers fit the tile */
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__metrics.gc-colony-detail-modern__metrics--empire .gc-colony-detail-modern__num--full {
    display: none;
  }
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__metrics.gc-colony-detail-modern__metrics--empire .gc-colony-detail-modern__num--abbrev {
    display: inline;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__panel {
    padding: 8px 11px 9px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-identity {
    grid-template-columns: 44px minmax(0, 1fr) minmax(112px, 0.62fr);
    gap: 8px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-aside {
    grid-column: 3;
    grid-row: 1;
    align-self: stretch;
    justify-self: stretch;
    flex-direction: column;
    gap: 4px;
    max-width: 100%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__profile-land,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__profile-mineral {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__profile-land {
    justify-items: center;
    text-align: center;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__profile-mineral {
    grid-template-columns: 22px minmax(0, 1fr);
    max-width: 100%;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__mineral-chip {
    width: 22px;
    height: 22px;
    padding: 2px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-icon {
    width: 44px;
    height: 44px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__title {
    font-size: clamp(18px, 5.2vw, 22px);
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__modifier-grid,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__metrics:not(.gc-colony-detail-modern__metrics--empire) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__metrics.gc-colony-detail-modern__metrics--profile .gc-colony-detail-modern__num--full {
    display: none;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__metrics.gc-colony-detail-modern__metrics--profile .gc-colony-detail-modern__num--abbrev {
    display: inline;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__form-head {
    display: none;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__form-head-stat {
    font-size: 8.5px;
    white-space: normal;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__form-row {
    grid-template-columns: minmax(0, 1fr) 58px 32px 64px;
    gap: 5px;
    padding: 5px 7px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__action,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__action[type="submit"] {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    min-height: 30px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__actions--form .gc-colony-detail-modern__action {
    flex: 1 1 0;
    padding: 0 6px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__actions--stack .gc-colony-detail-modern__action {
    flex: 1 1 100%;
  }
}

@media (max-width: 480px) {
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-stats {
    gap: 3px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-profile {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-aside {
    grid-column: 3;
    flex-wrap: nowrap;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__profile-land,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__profile-mineral {
    flex: 1 1 auto;
    padding: 4px 5px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__profile-land strong,
  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__mineral-name {
    font-size: 10px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__profile-mineral-label {
    font-size: 6px;
    letter-spacing: 0.1em;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-stat {
    padding: 4px 5px;
  }

  body:is([data-theme="nebula"], [data-theme="daylight"]) .gc-colony-detail-modern__hero-stat > span {
    font-size: 6.5px;
    letter-spacing: 0.1em;
  }
}
