/*
  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[data-theme="nebula"] .gc-events-page,
body[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[data-theme="nebula"] .gc-events-page__title,
body[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[data-theme="nebula"] .gc-events-page__title img,
body[data-theme="daylight"] .gc-events-page__title img {
  margin-left: 6px;
  vertical-align: -2px;
  opacity: 0.88;
}

body[data-theme="nebula"] .gc-events-filter,
body[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[data-theme="nebula"] .gc-events-filter__label,
body[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[data-theme="nebula"] .gc-events-filter__select,
body[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[data-theme="nebula"] .gc-events-panel,
body[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[data-theme="nebula"] .gc-events-table,
body[data-theme="daylight"] .gc-events-table {
  width: 100%;
  margin: 0;
  table-layout: fixed;
  border-collapse: collapse;
}

body[data-theme="nebula"] .gc-events-table__row,
body[data-theme="daylight"] .gc-events-table__row {
  border-bottom: 1px solid var(--border);
  transition: background var(--dur-fast) var(--ease);
}

body[data-theme="nebula"] .gc-events-table__row:last-child,
body[data-theme="daylight"] .gc-events-table__row:last-child {
  border-bottom: 0;
}

body[data-theme="nebula"] .gc-events-table__row:hover,
body[data-theme="daylight"] .gc-events-table__row:hover {
  background: var(--bg-elevated);
}

body[data-theme="nebula"] .gc-events-table__time,
body[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[data-theme="nebula"] .gc-events-table__time .gc-events-table__date,
body[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[data-theme="nebula"] .gc-events-table__body,
body[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[data-theme="nebula"] .gc-events-table__time-inner,
body[data-theme="daylight"] .gc-events-table__time-inner {
  min-width: 0;
}

body[data-theme="nebula"] .gc-events-table__body-inner,
body[data-theme="daylight"] .gc-events-table__body-inner {
  display: block;
}

body[data-theme="nebula"] .gc-events-table__tools,
body[data-theme="daylight"] .gc-events-table__tools {
  display: none;
}

body[data-theme="nebula"] .gc-events-table__content,
body[data-theme="daylight"] .gc-events-table__content {
  padding-right: 0;
  overflow-x: auto;
}

body[data-theme="nebula"] .gc-events-table__empty,
body[data-theme="daylight"] .gc-events-table__empty {
  text-align: center;
  color: var(--text-muted);
  padding: 14px 12px;
}

body[data-theme="nebula"] .gc-events-pagination,
body[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[data-theme="nebula"] .gc-events-pagination__spacer,
body[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[data-theme="nebula"] .gc-events-table__row:not(:has(.gc-events-table__body--battle)) .gc-events-table__time-inner,
  body[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[data-theme="nebula"] .gc-events-table__row:not(:has(.gc-events-table__body--battle)) .gc-events-table__time .gc-events-table__date,
  body[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[data-theme="nebula"] .gc-events-table__row:not(:has(.gc-events-table__body--battle)) .gc-events-table__time .gc-event-copy-btn--time,
  body[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[data-theme="nebula"] .gc-events-table__row:not(:has(.gc-events-table__body--battle)) .gc-events-table__time .gc-events-table__time-text,
  body[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[data-theme="nebula"] .gc-events-table__row:not(:has(.gc-events-table__body--battle)) .gc-events-table__time,
  body[data-theme="daylight"] .gc-events-table__row:not(:has(.gc-events-table__body--battle)) .gc-events-table__time,
  body[data-theme="nebula"] .gc-events-table__row:not(:has(.gc-events-table__body--battle)) .gc-events-table__body,
  body[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[data-theme="nebula"] .gc-events-table,
  body[data-theme="daylight"] .gc-events-table {
    display: table !important;
    table-layout: fixed !important;
  }

  body[data-theme="nebula"] .gc-events-table__row,
  body[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[data-theme="nebula"] .gc-events-table__body--battle .gc-events-table__content,
  body[data-theme="daylight"] .gc-events-table__body--battle .gc-events-table__content {
    text-align: start;
  }

  body[data-theme="nebula"] .gc-events-table__body--battle .gc-events-table__content div[align="center"],
  body[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[data-theme="nebula"] .gc-events-table__body--battle .gc-events-table__content table.Default,
  body[data-theme="nebula"] .gc-events-table__body--battle .gc-events-table__content table.gc-battle-table,
  body[data-theme="nebula"] .gc-events-table__body--battle .gc-events-table__content table.gc-battle-colonies,
  body[data-theme="daylight"] .gc-events-table__body--battle .gc-events-table__content table.Default,
  body[data-theme="daylight"] .gc-events-table__body--battle .gc-events-table__content table.gc-battle-table,
  body[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[data-theme="nebula"] .gc-event-row,
body[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[data-theme="nebula"] .gc-event-row:last-child,
body[data-theme="daylight"] .gc-event-row:last-child {
  border-bottom: 0;
}

body[data-theme="nebula"] .gc-event-row:hover,
body[data-theme="daylight"] .gc-event-row:hover {
  background: var(--bg-elevated);
}

/* Event body: fills remaining width, allows battle tables to expand */
body[data-theme="nebula"] .gc-event-body,
body[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[data-theme="nebula"] .gc-event-meta,
body[data-theme="daylight"] .gc-event-meta {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

body[data-theme="nebula"] .gc-event-time,
body[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[data-theme="nebula"] .gc-event-date,
body[data-theme="daylight"] .gc-event-date {
  display: block;
  font-size: 9px;
  opacity: 0.7;
}

body[data-theme="nebula"] .gc-event-copy-btn,
body[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[data-theme="nebula"] .gc-event-copy-btn span,
body[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[data-theme="nebula"] .gc-event-copy-btn--time,
body[data-theme="daylight"] .gc-event-copy-btn--time {
  display: flex;
  width: fit-content;
  margin-bottom: 4px;
}

body[data-theme="nebula"] .gc-event-row:hover .gc-event-copy-btn,
body[data-theme="daylight"] .gc-event-row:hover .gc-event-copy-btn {
  opacity: 1;
}

body[data-theme="nebula"] .gc-event-copy-btn:hover,
body[data-theme="daylight"] .gc-event-copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

body[data-theme="nebula"] .gc-event-copy-btn.gc-copied,
body[data-theme="daylight"] .gc-event-copy-btn.gc-copied {
  color: var(--accent-good);
  opacity: 1;
}

body[data-theme="nebula"] .gc-events-table__row:hover .gc-event-copy-btn,
body[data-theme="daylight"] .gc-events-table__row:hover .gc-event-copy-btn {
  opacity: 1;
}

body[data-theme="nebula"] .gc-events-empty,
body[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[data-theme="nebula"] .gc-events-table__body .Header td,
body[data-theme="nebula"] .gc-events-table__body .Header th,
body[data-theme="nebula"] .gc-event-body .Header td,
body[data-theme="nebula"] .gc-event-body .Header th,
body[data-theme="daylight"] .gc-events-table__body .Header td,
body[data-theme="daylight"] .gc-events-table__body .Header th,
body[data-theme="daylight"] .gc-event-body .Header td,
body[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[data-theme="nebula"] .gc-events-table__body table.gc-battle-table tr > td[colspan],
body[data-theme="nebula"] .gc-event-body table.gc-battle-table tr > td[colspan],
body[data-theme="daylight"] .gc-events-table__body table.gc-battle-table tr > td[colspan],
body[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[data-theme="nebula"] .gc-events-table__body table.gc-battle-table td,
body[data-theme="nebula"] .gc-event-body table.gc-battle-table td,
body[data-theme="daylight"] .gc-events-table__body table.gc-battle-table td,
body[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[data-theme="nebula"] .gc-events-table__content table.Default,
body[data-theme="nebula"] .gc-event-body table.Default,
body[data-theme="daylight"] .gc-events-table__content table.Default,
body[data-theme="daylight"] .gc-event-body table.Default {
  width: 100% !important;
  max-width: 700px;
}

body[data-theme="nebula"] .gc-events-table__body table.gc-battle-table,
body[data-theme="nebula"] .gc-event-body table.gc-battle-table,
body[data-theme="daylight"] .gc-events-table__body table.gc-battle-table,
body[data-theme="daylight"] .gc-event-body table.gc-battle-table {
  width: 100% !important;
  max-width: 700px;
}

body[data-theme="nebula"] .gc-events-table__body table.gc-battle-colonies,
body[data-theme="nebula"] .gc-event-body table.gc-battle-colonies,
body[data-theme="daylight"] .gc-events-table__body table.gc-battle-colonies,
body[data-theme="daylight"] .gc-event-body table.gc-battle-colonies {
  width: 100% !important;
  max-width: 700px;
}

/* Colonies table: top gap from fleet table */
body[data-theme="nebula"] .gc-events-table__body table.gc-battle-colonies,
body[data-theme="nebula"] .gc-event-body table.gc-battle-colonies,
body[data-theme="daylight"] .gc-events-table__body table.gc-battle-colonies,
body[data-theme="daylight"] .gc-event-body table.gc-battle-colonies {
  margin-top: 6px !important;
}

@media (max-width: 767.98px) {
  body[data-theme="nebula"] .gc-events-page,
  body[data-theme="daylight"] .gc-events-page {
    margin: 0 0 10px;
    padding: 0;
    gap: 6px;
    max-width: none;
  }

  body[data-theme="nebula"] .gc-events-page__title,
  body[data-theme="daylight"] .gc-events-page__title {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
  }

  body[data-theme="nebula"] .gc-events-filter,
  body[data-theme="daylight"] .gc-events-filter {
    justify-content: space-between;
    margin-bottom: 4px;
  }

  body[data-theme="nebula"] .gc-events-filter__label,
  body[data-theme="daylight"] .gc-events-filter__label {
    display: none;
  }

  body[data-theme="nebula"] .gc-events-table,
  body[data-theme="daylight"] .gc-events-table,
  body[data-theme="nebula"] .gc-events-table tbody,
  body[data-theme="daylight"] .gc-events-table tbody,
  body[data-theme="nebula"] .gc-events-table__row,
  body[data-theme="daylight"] .gc-events-table__row,
  body[data-theme="nebula"] .gc-events-table__time,
  body[data-theme="daylight"] .gc-events-table__time,
  body[data-theme="nebula"] .gc-events-table__body,
  body[data-theme="daylight"] .gc-events-table__body {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  body[data-theme="nebula"] .gc-events-table__row,
  body[data-theme="daylight"] .gc-events-table__row {
    padding: 3px 6px;
    position: relative;
  }

  body[data-theme="nebula"] .gc-events-table__time,
  body[data-theme="daylight"] .gc-events-table__time {
    min-width: 0;
    padding: 0 0 2px !important;
    border-bottom: 1px solid var(--border);
    display: block;
  }

  body[data-theme="nebula"] .gc-events-table__time-inner,
  body[data-theme="daylight"] .gc-events-table__time-inner {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 6px;
  }

  body[data-theme="nebula"] .gc-event-copy-btn--time,
  body[data-theme="daylight"] .gc-event-copy-btn--time {
    display: inline-flex;
    width: auto;
    margin-bottom: 0;
    order: 0;
  }

  body[data-theme="nebula"] .gc-events-table__time-text,
  body[data-theme="daylight"] .gc-events-table__time-text {
    order: 0;
  }

  body[data-theme="nebula"] .gc-events-table__time .gc-events-table__date,
  body[data-theme="daylight"] .gc-events-table__time .gc-events-table__date {
    flex-basis: auto;
    order: 0;
    margin-top: 0;
  }

  body[data-theme="nebula"] .gc-events-table__body,
  body[data-theme="daylight"] .gc-events-table__body {
    font-size: 12px;
    padding: 4px 0 0 !important;
  }

  body[data-theme="nebula"] .gc-event-copy-btn,
  body[data-theme="daylight"] .gc-event-copy-btn {
    opacity: 1;
  }

  body[data-theme="nebula"] .gc-events-table__time,
  body[data-theme="daylight"] .gc-events-table__time {
    padding-right: 0 !important;
  }

  body[data-theme="nebula"] .gc-events-table__body-inner,
  body[data-theme="daylight"] .gc-events-table__body-inner,
  body[data-theme="nebula"] .gc-events-table__content,
  body[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[data-theme="nebula"] .gc-events-table__content table.Default,
  body[data-theme="nebula"] .gc-event-body table.Default,
  body[data-theme="daylight"] .gc-events-table__content table.Default,
  body[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[data-theme="nebula"] .gc-events-table__body table.gc-battle-table,
  body[data-theme="nebula"] .gc-event-body table.gc-battle-table,
  body[data-theme="daylight"] .gc-events-table__body table.gc-battle-table,
  body[data-theme="daylight"] .gc-event-body table.gc-battle-table {
    width: 100% !important;
    max-width: none;
  }

  body[data-theme="nebula"] .gc-events-table__body table.gc-battle-colonies,
  body[data-theme="nebula"] .gc-event-body table.gc-battle-colonies,
  body[data-theme="daylight"] .gc-events-table__body table.gc-battle-colonies,
  body[data-theme="daylight"] .gc-event-body table.gc-battle-colonies {
    display: table;
    width: 100% !important;
    max-width: none;
    table-layout: auto !important;
  }

  body[data-theme="nebula"] .gc-events-table__body table.gc-battle-colonies tbody,
  body[data-theme="nebula"] .gc-event-body table.gc-battle-colonies tbody,
  body[data-theme="daylight"] .gc-events-table__body table.gc-battle-colonies tbody,
  body[data-theme="daylight"] .gc-event-body table.gc-battle-colonies tbody,
  body[data-theme="nebula"] .gc-events-table__content table.Default tbody,
  body[data-theme="nebula"] .gc-event-body table.Default tbody,
  body[data-theme="daylight"] .gc-events-table__content table.Default tbody,
  body[data-theme="daylight"] .gc-event-body table.Default tbody {
    display: table-row-group;
    width: 100%;
  }

  body[data-theme="nebula"] .gc-events-table__body table.gc-battle-colonies tr,
  body[data-theme="nebula"] .gc-event-body table.gc-battle-colonies tr,
  body[data-theme="daylight"] .gc-events-table__body table.gc-battle-colonies tr,
  body[data-theme="daylight"] .gc-event-body table.gc-battle-colonies tr,
  body[data-theme="nebula"] .gc-events-table__content table.Default tr,
  body[data-theme="nebula"] .gc-event-body table.Default tr,
  body[data-theme="daylight"] .gc-events-table__content table.Default tr,
  body[data-theme="daylight"] .gc-event-body table.Default tr {
    display: table-row;
    width: 100%;
  }

  body[data-theme="nebula"] .gc-events-table__body table.gc-battle-colonies tr > td,
  body[data-theme="nebula"] .gc-event-body table.gc-battle-colonies tr > td,
  body[data-theme="daylight"] .gc-events-table__body table.gc-battle-colonies tr > td,
  body[data-theme="daylight"] .gc-event-body table.gc-battle-colonies tr > td,
  body[data-theme="nebula"] .gc-events-table__content table.Default tr > td,
  body[data-theme="nebula"] .gc-event-body table.Default tr > td,
  body[data-theme="daylight"] .gc-events-table__content table.Default tr > td,
  body[data-theme="daylight"] .gc-event-body table.Default tr > td {
    display: table-cell;
    width: auto !important;
  }

  body[data-theme="nebula"] .gc-events-table__body table.gc-battle-table .Header td,
  body[data-theme="nebula"] .gc-event-body table.gc-battle-table .Header td,
  body[data-theme="daylight"] .gc-events-table__body table.gc-battle-table .Header td,
  body[data-theme="daylight"] .gc-event-body table.gc-battle-table .Header td,
  body[data-theme="nebula"] .gc-events-table__body table.gc-battle-colonies .Header td,
  body[data-theme="nebula"] .gc-event-body table.gc-battle-colonies .Header td,
  body[data-theme="daylight"] .gc-events-table__body table.gc-battle-colonies .Header td,
  body[data-theme="daylight"] .gc-event-body table.gc-battle-colonies .Header td,
  body[data-theme="nebula"] .gc-events-table__content table.Default .Header td,
  body[data-theme="nebula"] .gc-event-body table.Default .Header td,
  body[data-theme="daylight"] .gc-events-table__content table.Default .Header td,
  body[data-theme="daylight"] .gc-event-body table.Default .Header td {
    white-space: nowrap;
  }

  body[data-theme="nebula"] .gc-events-pagination,
  body[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[data-theme="nebula"] .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),
  body[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[data-theme="nebula"] .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[data-theme="nebula"] .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,
  body[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[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[data-theme="nebula"] .gc-linkbtn-table,
  body[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[data-theme="nebula"] .gc-cart-row,
  body[data-theme="daylight"] .gc-cart-row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  body[data-theme="nebula"] .gc-cart-row > [class^="col-"],
  body[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[data-theme="nebula"] .col-lg-8 .mobileShow > table.Default.gc-cart-products-table,
  body[data-theme="nebula"] .col-lg-8 .mobileShow table.Default.gc-cart-products-table,
  body[data-theme="daylight"] .col-lg-8 .mobileShow > table.Default.gc-cart-products-table,
  body[data-theme="daylight"] .col-lg-8 .mobileShow table.Default.gc-cart-products-table,
  body[data-theme="nebula"] table.Default.gc-cart-products-table,
  body[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[data-theme="nebula"] .gc-cart-products-table--mobile,
  body[data-theme="daylight"] .gc-cart-products-table--mobile {
    table-layout: fixed;
  }
  body[data-theme="nebula"] .gc-cart-products-table--mobile > tbody > tr > td:first-child,
  body[data-theme="daylight"] .gc-cart-products-table--mobile > tbody > tr > td:first-child,
  body[data-theme="nebula"] .gc-cart-products-table--mobile > tr > td:first-child,
  body[data-theme="daylight"] .gc-cart-products-table--mobile > tr > td:first-child {
    width: 45%;
  }
  body[data-theme="nebula"] .gc-cart-products-table--mobile > tbody > tr > td:last-child,
  body[data-theme="daylight"] .gc-cart-products-table--mobile > tbody > tr > td:last-child,
  body[data-theme="nebula"] .gc-cart-products-table--mobile > tr > td:last-child,
  body[data-theme="daylight"] .gc-cart-products-table--mobile > tr > td:last-child {
    width: 55%;
  }
  body[data-theme="nebula"] .gc-cart-products-table td,
  body[data-theme="daylight"] .gc-cart-products-table td {
    padding: 4px 4px !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body[data-theme="nebula"] .gc-cart-products-table .sc-product-item,
  body[data-theme="daylight"] .gc-cart-products-table .sc-product-item {
    white-space: nowrap;
  }
  body[data-theme="nebula"] .gc-cart-products-table .sc-cart-item-qty,
  body[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[data-theme="nebula"] .gc-cart-products-table .sc-add-to-cart,
  body[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[data-theme="nebula"] .gc-cart-row,
  body[data-theme="daylight"] .gc-cart-row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  body[data-theme="nebula"] .gc-cart-row > [class^="col-"],
  body[data-theme="daylight"] .gc-cart-row > [class^="col-"] {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  body[data-theme="nebula"] .col-lg-8 .mobileShow > table.Default.gc-cart-products-table,
  body[data-theme="nebula"] .col-lg-8 .mobileShow table.Default.gc-cart-products-table,
  body[data-theme="daylight"] .col-lg-8 .mobileShow > table.Default.gc-cart-products-table,
  body[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[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="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 {
  text-align: center !important;
}

body[data-theme="nebula"] .gc-research-page .gc-research-status .Header td,
body[data-theme="daylight"] .gc-research-page .gc-research-status .Header td,
body[data-theme="nebula"] .gc-ship-detail-table .Header td,
body[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[data-theme="nebula"] table.Default.kv.gc-ship-detail-table tbody td:first-child,
body[data-theme="nebula"] table.Default.kv.gc-ship-detail-table td:first-child,
body[data-theme="daylight"] table.Default.kv.gc-ship-detail-table tbody td:first-child,
body[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[data-theme="nebula"] .gc-attack-alert,
body[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[data-theme="nebula"] .gc-builder-message:has(.gc-attack-alert),
body[data-theme="daylight"] .gc-builder-message:has(.gc-attack-alert) {
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body[data-theme="nebula"] .gc-attack-alert::before,
body[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[data-theme="nebula"] .gc-attack-alert__eyebrow,
body[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[data-theme="nebula"] .gc-attack-alert__title,
body[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[data-theme="nebula"] .gc-attack-alert p,
body[data-theme="daylight"] .gc-attack-alert p {
  margin: 0.25rem auto;
  max-width: 32rem;
  color: var(--text-secondary);
}

body[data-theme="nebula"] .gc-attack-alert__action,
body[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[data-theme="nebula"] .gc-attack-alert__action:hover,
body[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[data-theme="nebula"] .gc-attack-alert__note,
body[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[data-theme="nebula"] .gc-research-page .gc-research-status .Header td,
  body[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[data-theme="nebula"] .gc-research-page .gc-research-detail,
  body[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: 640px) {
  body[data-theme="nebula"] .col-lg-8 .mobileShow > table.Default,
  body[data-theme="nebula"] .col-lg-8 .mobileShow > p > table.Default,
  body[data-theme="nebula"] .col-lg-8 .mobileShow form > table.Default,
  body[data-theme="daylight"] .col-lg-8 .mobileShow > table.Default,
  body[data-theme="daylight"] .col-lg-8 .mobileShow > p > table.Default,
  body[data-theme="daylight"] .col-lg-8 .mobileShow form > table.Default {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
  }

  body[data-theme="nebula"] .col-lg-8 .mobileShow > table.Default.gc-fed-list-lite-mobile,
  body[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[data-theme="nebula"] .gc-fed-list-lite-mobile-wrap,
  body[data-theme="daylight"] .gc-fed-list-lite-mobile-wrap {
    width: 100%;
    padding-left: 4px;
    padding-right: 4px;
    box-sizing: border-box;
  }

  body[data-theme="nebula"] .gc-fed-list-lite-mobile-wrap > table.Default.gc-fed-list-lite-mobile,
  body[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[data-theme="nebula"] .gc-fed-list-lite-mobile > tbody > tr > td:nth-child(1),
  body[data-theme="daylight"] .gc-fed-list-lite-mobile > tbody > tr > td:nth-child(1),
  body[data-theme="nebula"] .gc-fed-list-lite-mobile > tr > td:nth-child(1),
  body[data-theme="daylight"] .gc-fed-list-lite-mobile > tr > td:nth-child(1) {
    width: 44%;
  }

  body[data-theme="nebula"] .gc-fed-list-lite-mobile > tbody > tr > td:nth-child(2),
  body[data-theme="daylight"] .gc-fed-list-lite-mobile > tbody > tr > td:nth-child(2),
  body[data-theme="nebula"] .gc-fed-list-lite-mobile > tr > td:nth-child(2),
  body[data-theme="daylight"] .gc-fed-list-lite-mobile > tr > td:nth-child(2) {
    width: 12%;
    text-align: center;
  }

  body[data-theme="nebula"] .gc-fed-list-lite-mobile > tbody > tr > td:nth-child(3),
  body[data-theme="daylight"] .gc-fed-list-lite-mobile > tbody > tr > td:nth-child(3),
  body[data-theme="nebula"] .gc-fed-list-lite-mobile > tr > td:nth-child(3),
  body[data-theme="daylight"] .gc-fed-list-lite-mobile > tr > td:nth-child(3) {
    width: 44%;
  }

  body[data-theme="nebula"] .col-lg-8 .mobileShow form > table.Default,
  body[data-theme="daylight"] .col-lg-8 .mobileShow form > table.Default {
    table-layout: fixed;
  }

  body[data-theme="nebula"] .col-lg-8 .mobileShow form > table.Default tr > td:first-child,
  body[data-theme="daylight"] .col-lg-8 .mobileShow form > table.Default tr > td:first-child {
    width: 34%;
  }

  body[data-theme="nebula"] .col-lg-8 .mobileShow form > table.Default tr > td:last-child,
  body[data-theme="daylight"] .col-lg-8 .mobileShow form > table.Default tr > td:last-child {
    width: 66%;
  }

  body[data-theme="nebula"] .col-lg-8 .mobileShow form > table.Default td,
  body[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[data-theme="nebula"] .col-lg-8 .mobileShow form > table.Default td[nowrap],
  body[data-theme="daylight"] .col-lg-8 .mobileShow form > table.Default td[nowrap] {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: normal;
  }

  body[data-theme="nebula"] .col-lg-8 .mobileShow form > table.Default td[nowrap] select,
  body[data-theme="daylight"] .col-lg-8 .mobileShow form > table.Default td[nowrap] select {
    flex: 0 0 auto;
  }

  body[data-theme="nebula"] .col-lg-8 .mobileShow form > table.Default td[nowrap] input[type="text"],
  body[data-theme="daylight"] .col-lg-8 .mobileShow form > table.Default td[nowrap] input[type="text"] {
    flex: 1 1 auto;
    min-width: 0;
  }

  body[data-theme="nebula"] .col-lg-8 .mobileShow form > table.Default input[type="text"],
  body[data-theme="nebula"] .col-lg-8 .mobileShow form > table.Default input[type="number"],
  body[data-theme="nebula"] .col-lg-8 .mobileShow form > table.Default select,
  body[data-theme="daylight"] .col-lg-8 .mobileShow form > table.Default input[type="text"],
  body[data-theme="daylight"] .col-lg-8 .mobileShow form > table.Default input[type="number"],
  body[data-theme="daylight"] .col-lg-8 .mobileShow form > table.Default select {
    max-width: 100%;
    box-sizing: border-box;
  }

  body[data-theme="nebula"] .col-lg-8 .mobileShow form > table.Default input[type="submit"],
  body[data-theme="nebula"] .col-lg-8 .mobileShow form > table.Default input[type="button"],
  body[data-theme="daylight"] .col-lg-8 .mobileShow form > table.Default input[type="submit"],
  body[data-theme="daylight"] .col-lg-8 .mobileShow form > table.Default input[type="button"] {
    min-width: 96px;
  }

  body[data-theme="nebula"] .gc-market-detail-page .gc-market-detail-table tr > td:first-child,
  body[data-theme="daylight"] .gc-market-detail-page .gc-market-detail-table tr > td:first-child {
    width: 34%;
  }

  body[data-theme="nebula"] .gc-market-detail-page .gc-market-detail-table tr > td:last-child,
  body[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[data-theme="nebula"] .gc-market-detail-page .gc-market-detail-table--available-modern tr > td:first-child,
  body[data-theme="daylight"] .gc-market-detail-page .gc-market-detail-table--available-modern tr > td:first-child,
  body[data-theme="nebula"] .gc-market-detail-page .gc-market-detail-table--available-modern tr > td:last-child,
  body[data-theme="daylight"] .gc-market-detail-page .gc-market-detail-table--available-modern tr > td:last-child {
    width: 50%;
  }

  body[data-theme="nebula"] .gc-market-detail-page .gc-market-detail-table .gc-market-detail-cell,
  body[data-theme="daylight"] .gc-market-detail-page .gc-market-detail-table .gc-market-detail-cell {
    width: 66%;
  }

  body[data-theme="nebula"] .gc-market-detail-page .gc-market-detail-table td[nowrap],
  body[data-theme="daylight"] .gc-market-detail-page .gc-market-detail-table td[nowrap] {
    width: 66%;
    white-space: normal;
  }

  body[data-theme="nebula"] .gc-market-detail-page .gc-market-detail-controls,
  body[data-theme="daylight"] .gc-market-detail-page .gc-market-detail-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  body[data-theme="nebula"] .gc-market-detail-page .gc-market-detail-controls select,
  body[data-theme="daylight"] .gc-market-detail-page .gc-market-detail-controls select {
    flex: 0 0 auto;
  }

  body[data-theme="nebula"] .gc-market-detail-page .gc-market-detail-controls input[type="text"],
  body[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[data-theme="nebula"] .gc-market-detail-page .gc-market-detail-table td:not([nowrap]) > input[type="text"],
  body[data-theme="daylight"] .gc-market-detail-page .gc-market-detail-table td:not([nowrap]) > input[type="text"] {
    width: 100% !important;
  }

  body[data-theme="nebula"] .gc-market-detail-page .gc-market-detail-help,
  body[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[data-theme="nebula"] .gc-market-detail-modern,
body[data-theme="daylight"] .gc-market-detail-modern {
  max-width: 980px;
  margin: 0 auto;
}

body[data-theme="nebula"] .gc-market-detail-modern__back,
body[data-theme="daylight"] .gc-market-detail-modern__back,
body[data-theme="nebula"] .gc-market-detail-modern__summary,
body[data-theme="daylight"] .gc-market-detail-modern__summary,
body[data-theme="nebula"] .gc-market-panel,
body[data-theme="daylight"] .gc-market-panel {
  border: 1px solid var(--border);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

body[data-theme="nebula"] .gc-market-detail-modern__back,
body[data-theme="daylight"] .gc-market-detail-modern__back {
  margin-top: 8px;
}

body[data-theme="nebula"] .gc-market-detail-modern__backlink,
body[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[data-theme="nebula"] .gc-market-detail-modern__summary,
body[data-theme="daylight"] .gc-market-detail-modern__summary {
  margin-top: 10px;
  padding: 10px 12px;
  text-align: center;
}

body[data-theme="nebula"] .gc-market-detail-modern__summary-title,
body[data-theme="daylight"] .gc-market-detail-modern__summary-title,
body[data-theme="nebula"] .gc-market-panel__title,
body[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[data-theme="nebula"] .gc-market-detail-modern__summary-copy,
body[data-theme="daylight"] .gc-market-detail-modern__summary-copy {
  margin-top: 8px;
  color: var(--text-secondary);
}

body[data-theme="nebula"] .gc-market-detail-modern-form,
body[data-theme="daylight"] .gc-market-detail-modern-form {
  margin-top: 10px;
}

body[data-theme="nebula"] .gc-market-detail-modern-grid,
body[data-theme="daylight"] .gc-market-detail-modern-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

body[data-theme="nebula"] .gc-market-panel,
body[data-theme="daylight"] .gc-market-panel {
  padding: 10px 12px 12px;
}

body[data-theme="nebula"] .gc-market-field,
body[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[data-theme="nebula"] .gc-market-field:first-of-type,
body[data-theme="daylight"] .gc-market-field:first-of-type {
  margin-top: 10px;
}

body[data-theme="nebula"] .gc-market-field__label,
body[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[data-theme="nebula"] .gc-market-field__value,
body[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[data-theme="nebula"] .gc-market-field__muted,
body[data-theme="daylight"] .gc-market-field__muted,
body[data-theme="nebula"] .gc-market-panel__disabled,
body[data-theme="daylight"] .gc-market-panel__disabled {
  color: var(--text-muted);
}

body[data-theme="nebula"] .gc-market-field__control,
body[data-theme="daylight"] .gc-market-field__control {
  min-width: 0;
}

body[data-theme="nebula"] .gc-market-field__control--inline,
body[data-theme="daylight"] .gc-market-field__control--inline {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

body[data-theme="nebula"] .gc-market-field__control input[type="text"],
body[data-theme="nebula"] .gc-market-field__control select,
body[data-theme="daylight"] .gc-market-field__control input[type="text"],
body[data-theme="daylight"] .gc-market-field__control select {
  min-height: 40px;
  box-sizing: border-box;
}

body[data-theme="nebula"] .gc-market-field__control input[type="text"],
body[data-theme="daylight"] .gc-market-field__control input[type="text"] {
  width: 100%;
  min-width: 0;
}

body[data-theme="nebula"] .gc-market-field__control--inline select,
body[data-theme="daylight"] .gc-market-field__control--inline select {
  flex: 0 0 64px;
}

body[data-theme="nebula"] .gc-market-field__control--inline input[type="text"],
body[data-theme="daylight"] .gc-market-field__control--inline input[type="text"] {
  flex: 1 1 auto;
}

body[data-theme="nebula"] .gc-market-field__hint,
body[data-theme="daylight"] .gc-market-field__hint {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

body[data-theme="nebula"] .gc-market-panel__actions,
body[data-theme="daylight"] .gc-market-panel__actions {
  padding-top: 10px;
  text-align: center;
}

body[data-theme="nebula"] .gc-market-panel__actions input[type="submit"],
body[data-theme="daylight"] .gc-market-panel__actions input[type="submit"] {
  min-width: 112px;
}

body[data-theme="nebula"] .gc-market-panel--available,
body[data-theme="daylight"] .gc-market-panel--available {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 10px;
}

body[data-theme="nebula"] .gc-market-detail-table--available-modern,
body[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[data-theme="nebula"] .gc-market-detail-table--available-modern > tbody > tr > td,
body[data-theme="daylight"] .gc-market-detail-table--available-modern > tbody > tr > td,
body[data-theme="nebula"] .gc-market-detail-table--available-modern > tr > td,
body[data-theme="daylight"] .gc-market-detail-table--available-modern > tr > td {
  width: 50%;
}

@media (min-width: 700px) {
  body[data-theme="nebula"] .gc-market-detail-modern-grid,
  body[data-theme="daylight"] .gc-market-detail-modern-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  body[data-theme="nebula"] .gc-market-field,
  body[data-theme="daylight"] .gc-market-field {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 8px;
  }

  body[data-theme="nebula"] .gc-market-field__label,
  body[data-theme="daylight"] .gc-market-field__label {
    font-size: 10px;
  }
}

body[data-theme="nebula"] .gc-market-page,
body[data-theme="daylight"] .gc-market-page {
  max-width: 980px;
  margin: 0 auto;
}

body[data-theme="nebula"] .gc-market-num-abbrev,
body[data-theme="daylight"] .gc-market-num-abbrev,
body[data-theme="nebula"] .gc-market-hdr-mobile,
body[data-theme="daylight"] .gc-market-hdr-mobile {
  display: none;
}

body[data-theme="nebula"] .gc-market-grid,
body[data-theme="daylight"] .gc-market-grid {
  max-width: 820px;
  margin: 14px auto 0;
}

body[data-theme="nebula"] .gc-market-col,
body[data-theme="daylight"] .gc-market-col {
  padding-left: 6px;
  padding-right: 6px;
  box-sizing: border-box;
}

body[data-theme="nebula"] .gc-market-table,
body[data-theme="daylight"] .gc-market-table {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  table-layout: fixed;
}

body[data-theme="nebula"] .gc-market-table--goods td:nth-child(1),
body[data-theme="daylight"] .gc-market-table--goods td:nth-child(1) {
  width: 42%;
}

body[data-theme="nebula"] .gc-market-table--goods td:nth-child(2),
body[data-theme="daylight"] .gc-market-table--goods td:nth-child(2) {
  width: 18%;
}

body[data-theme="nebula"] .gc-market-table--goods td:nth-child(3),
body[data-theme="daylight"] .gc-market-table--goods td:nth-child(3) {
  width: 40%;
}

body[data-theme="nebula"] .gc-market-combined-wrap,
body[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[data-theme="nebula"] .mobileShow > table.Default.gc-market-use-form-table,
  body[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[data-theme="nebula"] .mobileShow > table.Default.gc-market-use-form-table tr > td:first-child,
  body[data-theme="daylight"] .mobileShow > table.Default.gc-market-use-form-table tr > td:first-child {
    width: 38%;
  }

  body[data-theme="nebula"] .mobileShow > table.Default.gc-market-use-form-table tr > td:last-child,
  body[data-theme="daylight"] .mobileShow > table.Default.gc-market-use-form-table tr > td:last-child {
    width: 62%;
  }

  body[data-theme="nebula"] .mobileShow > table.Default.gc-market-use-form-table input[type="text"],
  body[data-theme="daylight"] .mobileShow > table.Default.gc-market-use-form-table input[type="text"] {
    width: 100%;
    box-sizing: border-box;
  }
}

body[data-theme="nebula"] .gc-market-table--combined td:nth-child(1),
body[data-theme="daylight"] .gc-market-table--combined td:nth-child(1) {
  width: 31%;
}

body[data-theme="nebula"] .gc-market-table--combined td:nth-child(2),
body[data-theme="daylight"] .gc-market-table--combined td:nth-child(2) {
  width: 17%;
}

body[data-theme="nebula"] .gc-market-table--combined td:nth-child(3),
body[data-theme="daylight"] .gc-market-table--combined td:nth-child(3) {
  width: 26%;
}

body[data-theme="nebula"] .gc-market-table--combined td:nth-child(4),
body[data-theme="daylight"] .gc-market-table--combined td:nth-child(4) {
  width: 26%;
}

body[data-theme="nebula"] .gc-market-table .Header td,
body[data-theme="daylight"] .gc-market-table .Header td {
  height: 34px;
  vertical-align: middle;
}

body[data-theme="nebula"] .gc-market-table tr:not(.Header) td,
body[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[data-theme="nebula"] .gc-market-action,
body[data-theme="nebula"] .gc-market-help-toggle,
body[data-theme="nebula"] .gc-market-help,
body[data-theme="daylight"] .gc-market-action,
body[data-theme="daylight"] .gc-market-help-toggle,
body[data-theme="daylight"] .gc-market-help {
  width: auto !important;
  max-width: 640px;
}

@media (min-width: 641px) {
  body[data-theme="nebula"] .gc-market-grid,
  body[data-theme="daylight"] .gc-market-grid {
    display: flex;
    gap: 14px;
    align-items: start;
  }

  body[data-theme="nebula"] .gc-market-pane--desktop,
  body[data-theme="daylight"] .gc-market-pane--desktop {
    display: block;
    min-width: 0;
  }

  body[data-theme="nebula"] .gc-market-pane--desktop.gc-market-pane--goods,
  body[data-theme="daylight"] .gc-market-pane--desktop.gc-market-pane--goods {
    flex: 1.35 1 0;
  }

  body[data-theme="nebula"] .gc-market-pane--desktop.gc-market-pane--stores,
  body[data-theme="daylight"] .gc-market-pane--desktop.gc-market-pane--stores {
    flex: 0.62 1 0;
  }

  body[data-theme="nebula"] .gc-market-pane--desktop .gc-market-col,
  body[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[data-theme="nebula"] .gc-market-grid,
  body[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[data-theme="nebula"] .gc-market-pane--mobile,
  body[data-theme="daylight"] .gc-market-pane--mobile {
    display: block;
    min-width: 0;
  }

  body[data-theme="nebula"] .gc-market-col,
  body[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[data-theme="nebula"] .gc-market-col--goods,
  body[data-theme="daylight"] .gc-market-col--goods {
    min-width: 0;
  }

  body[data-theme="nebula"] .gc-market-col--stores,
  body[data-theme="daylight"] .gc-market-col--stores {
    min-width: 0;
  }

  body[data-theme="nebula"] .gc-market-table,
  body[data-theme="daylight"] .gc-market-table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
  }

  body[data-theme="nebula"] .gc-market-table tr:not(.Header) td,
  body[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[data-theme="nebula"] .gc-market-table .Header td,
  body[data-theme="daylight"] .gc-market-table .Header td {
    padding-left: 6px;
    padding-right: 6px;
    font-size: 10px;
  }

  body[data-theme="nebula"] .gc-market-table--goods td:nth-child(1),
  body[data-theme="daylight"] .gc-market-table--goods td:nth-child(1) {
    width: 34%;
  }

  body[data-theme="nebula"] .gc-market-table--goods td:nth-child(2),
  body[data-theme="daylight"] .gc-market-table--goods td:nth-child(2) {
    width: 18%;
  }

  body[data-theme="nebula"] .gc-market-table--goods td:nth-child(3),
  body[data-theme="daylight"] .gc-market-table--goods td:nth-child(3) {
    width: 48%;
  }

  body[data-theme="nebula"] .gc-market-combined-wrap,
  body[data-theme="daylight"] .gc-market-combined-wrap {
    margin-top: 12px;
  }

  body[data-theme="nebula"] .gc-market-table--combined td:nth-child(1),
  body[data-theme="daylight"] .gc-market-table--combined td:nth-child(1) {
    width: 29%;
  }

  body[data-theme="nebula"] .gc-market-table--combined td:nth-child(2),
  body[data-theme="daylight"] .gc-market-table--combined td:nth-child(2) {
    width: 14%;
  }

  body[data-theme="nebula"] .gc-market-table--combined td:nth-child(3),
  body[data-theme="daylight"] .gc-market-table--combined td:nth-child(3) {
    width: 27%;
  }

  body[data-theme="nebula"] .gc-market-table--combined td:nth-child(4),
  body[data-theme="daylight"] .gc-market-table--combined td:nth-child(4) {
    width: 30%;
  }

  body[data-theme="nebula"] .gc-market-detail-page .gc-market-detail-table,
  body[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[data-theme="nebula"] .gc-market-detail-page .gc-market-detail-back,
  body[data-theme="daylight"] .gc-market-detail-page .gc-market-detail-back {
    margin-left: 0;
    margin-right: 0;
  }

  body[data-theme="nebula"] .gc-market-detail-page .gc-market-detail-table td,
  body[data-theme="daylight"] .gc-market-detail-page .gc-market-detail-table td {
    padding-left: 8px;
    padding-right: 8px;
    box-sizing: border-box;
  }

  body[data-theme="nebula"] .gc-market-detail-page input[type="text"],
  body[data-theme="daylight"] .gc-market-detail-page input[type="text"] {
    max-width: 100%;
    box-sizing: border-box;
  }

  body[data-theme="nebula"] .gc-market-combined-wrap,
  body[data-theme="daylight"] .gc-market-combined-wrap {
    padding-left: 8px;
    padding-right: 8px;
    box-sizing: border-box;
  }

  body[data-theme="nebula"] table.Default.gc-market-table--combined,
  body[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[data-theme="nebula"] table.Default.gc-market-table--combined td,
  body[data-theme="nebula"] table.Default.gc-market-table--combined th,
  body[data-theme="daylight"] table.Default.gc-market-table--combined td,
  body[data-theme="daylight"] table.Default.gc-market-table--combined th {
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  body[data-theme="nebula"] table.Default.gc-market-table--combined td:nth-child(1),
  body[data-theme="daylight"] table.Default.gc-market-table--combined td:nth-child(1) {
    width: 33%;
  }

  body[data-theme="nebula"] table.Default.gc-market-table--combined td:nth-child(2),
  body[data-theme="daylight"] table.Default.gc-market-table--combined td:nth-child(2) {
    width: 11%;
  }

  body[data-theme="nebula"] table.Default.gc-market-table--combined td:nth-child(3),
  body[data-theme="daylight"] table.Default.gc-market-table--combined td:nth-child(3) {
    width: 24%;
  }

  body[data-theme="nebula"] table.Default.gc-market-table--combined td:nth-child(4),
  body[data-theme="daylight"] table.Default.gc-market-table--combined td:nth-child(4) {
    width: 32%;
  }

  body[data-theme="nebula"] .gc-market-good-link,
  body[data-theme="daylight"] .gc-market-good-link {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
  }

  body[data-theme="nebula"] .gc-market-num-full,
  body[data-theme="daylight"] .gc-market-num-full,
  body[data-theme="nebula"] .gc-market-hdr-full,
  body[data-theme="daylight"] .gc-market-hdr-full {
    display: none;
  }

  body[data-theme="nebula"] .gc-market-num-abbrev,
  body[data-theme="daylight"] .gc-market-num-abbrev,
  body[data-theme="nebula"] .gc-market-hdr-mobile,
  body[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[data-theme="nebula"] a,
body[data-theme="daylight"] a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
body[data-theme="nebula"] a:visited,
body[data-theme="daylight"] a:visited {
  color: var(--link-visited);
}
body[data-theme="nebula"] a:hover,
body[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[data-theme="nebula"] input,
body[data-theme="nebula"] select,
body[data-theme="nebula"] textarea,
body[data-theme="daylight"] input,
body[data-theme="daylight"] select,
body[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[data-theme="nebula"] input:focus,
body[data-theme="nebula"] select:focus,
body[data-theme="nebula"] textarea:focus,
body[data-theme="daylight"] input:focus,
body[data-theme="daylight"] select:focus,
body[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[data-theme="nebula"] .col-lg-8.col-sm-12 .col-lg-8.col-sm-12,
body[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[data-theme="nebula"] .icon-bar2 a,
body[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[data-theme="nebula"] .icon-bar2 a,
  body[data-theme="daylight"] .icon-bar2 a {
    padding: 3px 8px;
  }
}
body[data-theme="nebula"] .icon-bar2 a:hover,
body[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[data-theme="nebula"] .icon-bar2 span[style*="b41837"],
body[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[data-theme="nebula"] .icon-bar2 span[style*="b41837"]:first-child,
body[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[data-theme="nebula"] .sidebar-item,
body[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[data-theme="nebula"] .sidebar-item h3,
body[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[data-theme="nebula"] .card,
body[data-theme="daylight"] .card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
body[data-theme="nebula"] .card-body,
body[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[data-theme="nebula"] .stats,
body[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[data-theme="nebula"] .buttonN.pill,
body[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[data-theme="nebula"] .buttonN-group,
body[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[data-theme="nebula"] .buttonN-group li,
body[data-theme="daylight"] .buttonN-group li {
  list-style: none;
}

/* Yellow announcement bar. Keep the yellow concept but detune. */
body[data-theme="nebula"] #topnavbar,
body[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[data-theme="nebula"] .yellowfont,
body[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[data-theme="nebula"] input[type=button],
body[data-theme="nebula"] input[type=submit],
body[data-theme="daylight"] input[type=button],
body[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[data-theme="nebula"] input[type=button]:hover,
body[data-theme="nebula"] input[type=submit]:hover,
body[data-theme="daylight"] input[type=button]:hover,
body[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[data-theme="nebula"] table,
body[data-theme="daylight"] table {
  color: var(--text-primary);
}
body[data-theme="nebula"] table th,
body[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[data-theme="nebula"] table td,
body[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[data-theme="nebula"] hr,
body[data-theme="daylight"] hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 12px 0;
}
body[data-theme="nebula"] .smallfont,
body[data-theme="daylight"] .smallfont {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Scrollbar styling on WebKit — subtle and thematic. */
body[data-theme="nebula"] ::-webkit-scrollbar,
body[data-theme="daylight"] ::-webkit-scrollbar { width: 10px; height: 10px; }
body[data-theme="nebula"] ::-webkit-scrollbar-thumb,
body[data-theme="daylight"] ::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 10px;
}
body[data-theme="nebula"] ::-webkit-scrollbar-track,
body[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; }
}


/* =========================================================
   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[data-theme="nebula"] table.Default,
body[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[data-theme="nebula"] table.Default th,
body[data-theme="nebula"] table.Default td,
body[data-theme="daylight"] table.Default th,
body[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[data-theme="nebula"] table.Default tr:last-child td,
body[data-theme="nebula"] table.Default tr:last-child th,
body[data-theme="daylight"] table.Default tr:last-child td,
body[data-theme="daylight"] table.Default tr:last-child th {
  border-bottom: 0;
}

body[data-theme="nebula"] table.Default thead td,
body[data-theme="nebula"] table.Default thead th,
body[data-theme="daylight"] table.Default thead td,
body[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[data-theme="nebula"] table.Default tr.Header td,
body[data-theme="nebula"] table.Default tr.Header th,
body[data-theme="daylight"] table.Default tr.Header td,
body[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[data-theme="nebula"] table.Default.gc-col-find-form,
body[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[data-theme="nebula"] table.Default.gc-col-find-form td,
body[data-theme="daylight"] table.Default.gc-col-find-form td {
  padding: 6px 10px;
}

body[data-theme="nebula"] .gc-col-find-form__batch,
body[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[data-theme="nebula"] .gc-col-find-form__batch .redFont,
body[data-theme="daylight"] .gc-col-find-form__batch .redFont {
  color: var(--accent-cool);
  font-weight: 600;
}

body[data-theme="nebula"] .gc-col-find-form tr:not(:first-child) td:first-child,
body[data-theme="daylight"] .gc-col-find-form tr:not(:first-child) td:first-child {
  width: 70%;
  text-align: right;
  color: var(--text-secondary);
}

body[data-theme="nebula"] .gc-col-find-form tr:not(:first-child) td:last-child,
body[data-theme="daylight"] .gc-col-find-form tr:not(:first-child) td:last-child {
  width: 30%;
}

body[data-theme="nebula"] .gc-col-find-form input[type="text"],
body[data-theme="daylight"] .gc-col-find-form input[type="text"] {
  width: 74px;
  max-width: 100%;
  text-align: center;
  font-family: var(--font-mono);
}

body[data-theme="nebula"] .gc-col-find-form__actions,
body[data-theme="daylight"] .gc-col-find-form__actions {
  width: auto !important;
  text-align: center !important;
  padding-top: 8px !important;
  padding-bottom: 10px !important;
}

body[data-theme="nebula"] .gc-col-find-form__actions input[type="button"],
body[data-theme="daylight"] .gc-col-find-form__actions input[type="button"] {
  min-width: 120px;
}

body[data-theme="nebula"] .gc-col-find-notes,
body[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[data-theme="nebula"] .gc-col-find-notes .yellowfont,
body[data-theme="daylight"] .gc-col-find-notes .yellowfont {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  text-align: center;
}

@media (max-width: 640px) {
  body[data-theme="nebula"] table.Default.gc-col-find-form,
  body[data-theme="daylight"] table.Default.gc-col-find-form,
  body[data-theme="nebula"] .gc-col-find-notes,
  body[data-theme="daylight"] .gc-col-find-notes {
    width: calc(100% - 12px) !important;
  }

  body[data-theme="nebula"] .gc-col-find-form tr:not(:first-child) td:first-child,
  body[data-theme="daylight"] .gc-col-find-form tr:not(:first-child) td:first-child {
    width: 64%;
    text-align: left;
  }

  body[data-theme="nebula"] .gc-col-find-form tr:not(:first-child) td:last-child,
  body[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[data-theme="nebula"] .gc-vacation-page,
body[data-theme="daylight"] .gc-vacation-page {
  padding-bottom: 1.25rem;
}

body[data-theme="nebula"] .gc-vacation-status,
body[data-theme="daylight"] .gc-vacation-status,
body[data-theme="nebula"] .gc-vacation-form,
body[data-theme="daylight"] .gc-vacation-form {
  width: min(100%, 36rem) !important;
  margin: 0.85rem auto 0 !important;
  box-shadow: var(--shadow-md);
}

body[data-theme="nebula"] .gc-vacation-status td,
body[data-theme="daylight"] .gc-vacation-status td,
body[data-theme="nebula"] .gc-vacation-form td,
body[data-theme="daylight"] .gc-vacation-form td {
  padding: 7px 10px;
}

body[data-theme="nebula"] .gc-vacation-status tr > td:first-child,
body[data-theme="daylight"] .gc-vacation-status tr > td:first-child {
  width: 42%;
  color: var(--text-secondary);
  text-align: right;
}

body[data-theme="nebula"] .gc-vacation-warning,
body[data-theme="daylight"] .gc-vacation-warning {
  color: var(--text-secondary);
}

body[data-theme="nebula"] .gc-vacation-warning font[color="yellow"],
body[data-theme="daylight"] .gc-vacation-warning font[color="yellow"] {
  color: var(--accent) !important;
  font-family: var(--font-display);
}

body[data-theme="nebula"] .gc-vacation-copy,
body[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[data-theme="nebula"] .gc-vacation-copy .yellowfont,
body[data-theme="daylight"] .gc-vacation-copy .yellowfont {
  display: block;
  margin: 0.35rem 0 0.2rem;
  color: var(--accent);
  text-align: center;
}

body[data-theme="nebula"] .gc-vacation-copy .yellowfont:first-child,
body[data-theme="daylight"] .gc-vacation-copy .yellowfont:first-child {
  margin-top: 0;
}

body[data-theme="nebula"] .gc-vacation-form td,
body[data-theme="daylight"] .gc-vacation-form td {
  text-align: center;
}

body[data-theme="nebula"] .gc-vacation-form select,
body[data-theme="daylight"] .gc-vacation-form select {
  min-width: 9rem;
  margin: 0 0.35rem;
}

body[data-theme="nebula"] .gc-vacation-form input[type="button"],
body[data-theme="daylight"] .gc-vacation-form input[type="button"] {
  min-width: 110px;
}

@media (max-width: 640px) {
  body[data-theme="nebula"] .gc-vacation-status,
  body[data-theme="daylight"] .gc-vacation-status,
  body[data-theme="nebula"] .gc-vacation-form,
  body[data-theme="daylight"] .gc-vacation-form,
  body[data-theme="nebula"] .gc-vacation-copy,
  body[data-theme="daylight"] .gc-vacation-copy {
    width: calc(100% - 12px) !important;
  }

  body[data-theme="nebula"] .gc-vacation-status tr > td:first-child,
  body[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[data-theme="nebula"] .gc-mission-page,
body[data-theme="daylight"] .gc-mission-page {
  padding-bottom: 1.25rem;
}

body[data-theme="nebula"] .gc-mission-page > p:first-child,
body[data-theme="daylight"] .gc-mission-page > p:first-child {
  margin-bottom: 0.85rem !important;
}

body[data-theme="nebula"] .gc-mission-reward-note,
body[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[data-theme="nebula"] .gc-mission-page table.Default2,
body[data-theme="daylight"] .gc-mission-page table.Default2,
body[data-theme="nebula"] .gc-mission-notice,
body[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[data-theme="nebula"] .gc-mission-page table.Default2 td,
body[data-theme="daylight"] .gc-mission-page table.Default2 td,
body[data-theme="nebula"] .gc-mission-notice td,
body[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[data-theme="nebula"] .gc-mission-page table.Default2 tr:last-child td,
body[data-theme="daylight"] .gc-mission-page table.Default2 tr:last-child td,
body[data-theme="nebula"] .gc-mission-notice tr:last-child td,
body[data-theme="daylight"] .gc-mission-notice tr:last-child td {
  border-bottom: 0;
}

body[data-theme="nebula"] .gc-mission-page table.Default2 tr.Header td,
body[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[data-theme="nebula"] .gc-mission-page table.Default2 > tbody > tr > td,
body[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[data-theme="nebula"] .gc-mission-page table.Default2 table[width="90%"],
body[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[data-theme="nebula"] .gc-mission-page table.Default2 table[width="90%"] > tbody > tr,
body[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[data-theme="nebula"] .gc-mission-page table.Default2 table[width="90%"] td,
body[data-theme="daylight"] .gc-mission-page table.Default2 table[width="90%"] td {
  display: block;
  padding: 0 !important;
  border: 0 !important;
  text-align: center;
}

body[data-theme="nebula"] .gc-mission-page table.Default2 table[width="90%"] td:last-child,
body[data-theme="daylight"] .gc-mission-page table.Default2 table[width="90%"] td:last-child {
  max-width: 30rem;
  margin: 0 auto;
}

body[data-theme="nebula"] .gc-mission-page table.Default2 table[width="90%"] td:has(> img[src*="sp_.gif"]),
body[data-theme="daylight"] .gc-mission-page table.Default2 table[width="90%"] td:has(> img[src*="sp_.gif"]) {
  display: none;
}

body[data-theme="nebula"] .gc-mission-page table.Default2 table[width="90%"] img:not([src*="sp_.gif"]),
body[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[data-theme="nebula"] .gc-mission-page table.Default2 form,
body[data-theme="daylight"] .gc-mission-page table.Default2 form {
  display: block;
  width: 100%;
  margin-top: 0.6rem;
  text-align: center;
}

body[data-theme="nebula"] .gc-mission-page table.Default2 form input[type="submit"],
body[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[data-theme="nebula"] .gc-mission-reward,
body[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[data-theme="nebula"] .gc-mission-page .gc-found-planet-title,
body[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[data-theme="nebula"] .gc-mission-page table.Default.gc-found-planet-table,
body[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[data-theme="nebula"] .gc-mission-page table.Default.gc-found-planet-table td,
body[data-theme="daylight"] .gc-mission-page table.Default.gc-found-planet-table td {
  padding: 5px 10px;
}

body[data-theme="nebula"] .gc-mission-notice,
body[data-theme="daylight"] .gc-mission-notice {
  width: min(100%, 26rem) !important;
}

body[data-theme="nebula"] .gc-mission-notice td,
body[data-theme="daylight"] .gc-mission-notice td {
  text-align: center;
}

@media (max-width: 640px) {
  body[data-theme="nebula"] .gc-mission-page table.Default2,
  body[data-theme="daylight"] .gc-mission-page table.Default2,
  body[data-theme="nebula"] .gc-mission-notice,
  body[data-theme="daylight"] .gc-mission-notice {
    width: calc(100% - 12px) !important;
  }

  body[data-theme="nebula"] .gc-mission-page table.Default2 td,
  body[data-theme="daylight"] .gc-mission-page table.Default2 td {
    padding: 7px 8px;
  }

  body[data-theme="nebula"] .gc-mission-page table.Default2 table[width="90%"] > tbody > tr,
  body[data-theme="daylight"] .gc-mission-page table.Default2 table[width="90%"] > tbody > tr {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  body[data-theme="nebula"] .gc-mission-page table.Default2 table[width="90%"] img:not([src*="sp_.gif"]),
  body[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[data-theme="nebula"] .gc-mission-page table.Default2,
  body[data-theme="daylight"] .gc-mission-page table.Default2 {
    width: 92% !important;
  }
}

/* f_rank2: PR Ratio — muted reference column (Classic-style), all breakpoints */
body[data-theme="nebula"] table.Default.rank-results-table tbody td.rank-table__pr-ratio,
body[data-theme="nebula"] table.Default.rank-results-table-mobile tbody td.rank-table__pr-ratio,
body[data-theme="daylight"] table.Default.rank-results-table tbody td.rank-table__pr-ratio,
body[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[data-theme="nebula"] table.Default.rank-results-table tbody td.rank-table__pr-ratio--vm,
body[data-theme="nebula"] table.Default.rank-results-table-mobile tbody td.rank-table__pr-ratio--vm,
body[data-theme="daylight"] table.Default.rank-results-table tbody td.rank-table__pr-ratio--vm,
body[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[data-theme="nebula"] table.Default.rank-s-table,
  body[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[data-theme="nebula"] table.Default.rank-s-table td,
  body[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[data-theme="nebula"] table.Default.rank-s-table tr.Header td,
  body[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[data-theme="nebula"] table.Default.rank-s-table tr > td:nth-child(1),
  body[data-theme="daylight"] table.Default.rank-s-table tr > td:nth-child(1) {
    width: 7%;
    text-align: right;
  }

  body[data-theme="nebula"] table.Default.rank-s-table tr > td:nth-child(2),
  body[data-theme="daylight"] table.Default.rank-s-table tr > td:nth-child(2) {
    width: 32%;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body[data-theme="nebula"] table.Default.rank-s-table tr > td:nth-child(3),
  body[data-theme="daylight"] table.Default.rank-s-table tr > td:nth-child(3) {
    width: 18%;
  }

  body[data-theme="nebula"] table.Default.rank-s-table tr > td:nth-child(4),
  body[data-theme="daylight"] table.Default.rank-s-table tr > td:nth-child(4) {
    width: 13%;
  }

  body[data-theme="nebula"] table.Default.rank-s-table tr > td:nth-child(5),
  body[data-theme="daylight"] table.Default.rank-s-table tr > td:nth-child(5) {
    width: 18%;
    white-space: nowrap;
  }

  body[data-theme="nebula"] table.Default.rank-s-table tr > td:nth-child(6),
  body[data-theme="daylight"] table.Default.rank-s-table tr > td:nth-child(6) {
    width: 12%;
    white-space: nowrap;
  }

  body[data-theme="nebula"] table.Default.rank-s-table--type8 tr > td:nth-child(2),
  body[data-theme="daylight"] table.Default.rank-s-table--type8 tr > td:nth-child(2) {
    width: 34%;
  }

  body[data-theme="nebula"] table.Default.rank-s-table--type8 tr > td:nth-child(3),
  body[data-theme="daylight"] table.Default.rank-s-table--type8 tr > td:nth-child(3) {
    width: 18%;
  }

  body[data-theme="nebula"] table.Default.rank-s-table--type8 tr > td:nth-child(4),
  body[data-theme="daylight"] table.Default.rank-s-table--type8 tr > td:nth-child(4) {
    width: 13%;
  }

  body[data-theme="nebula"] table.Default.rank-s-table--type8 tr > td:nth-child(5),
  body[data-theme="daylight"] table.Default.rank-s-table--type8 tr > td:nth-child(5) {
    width: 28%;
  }
}

/* Hover: elevated bg + gold left accent strip. */
body[data-theme="nebula"] table.Default tbody tr,
body[data-theme="daylight"] table.Default tbody tr {
  transition: background var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
body[data-theme="nebula"] table.Default tbody tr:hover td,
body[data-theme="daylight"] table.Default tbody tr:hover td {
  background: var(--bg-elevated);
}
body[data-theme="nebula"] table.Default tbody tr:hover td:first-child,
body[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[data-theme="nebula"] table.Default tbody tr td:first-child,
body[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[data-theme="nebula"] table.Default a,
body[data-theme="daylight"] table.Default a {
  color: var(--accent);
  text-decoration: none;
}
body[data-theme="nebula"] table.Default a:hover,
body[data-theme="daylight"] table.Default a:hover {
  text-decoration: underline;
}

/* Numeric cells — tabular figures for alignment. */
body[data-theme="nebula"] table.Default td[align="right"],
body[data-theme="nebula"] table.Default td.num,
body[data-theme="daylight"] table.Default td[align="right"],
body[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[data-theme="nebula"] table.Default .table_row1,
body[data-theme="daylight"] table.Default .table_row1 {
  background: var(--bg-surface) !important;
}
body[data-theme="nebula"] table.Default .table_row2,
body[data-theme="daylight"] table.Default .table_row2 {
  background: var(--bg-elevated) !important;
}
body[data-theme="nebula"] table.Default .tr1_header,
body[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[data-theme="nebula"] table.Default,
  body[data-theme="daylight"] table.Default {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 0;
    font-size: 12px;
  }
  body[data-theme="nebula"] table.Default th,
  body[data-theme="nebula"] table.Default td,
  body[data-theme="daylight"] table.Default th,
  body[data-theme="daylight"] table.Default td {
    padding: 2px 4px;
  }
  body[data-theme="nebula"] table.Default thead td,
  body[data-theme="nebula"] table.Default thead th,
  body[data-theme="daylight"] table.Default thead td,
  body[data-theme="daylight"] table.Default thead th,
  body[data-theme="nebula"] table.Default tr.Header td,
  body[data-theme="nebula"] table.Default tr.Header th,
  body[data-theme="daylight"] table.Default tr.Header td,
  body[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[data-theme="nebula"] table.Default.rank-page-table--your-rank,
  body[data-theme="nebula"] table.Default.rank-page-table--top50,
  body[data-theme="nebula"] table.Default.rank-results-table-mobile,
  body[data-theme="daylight"] table.Default.rank-page-table--your-rank,
  body[data-theme="daylight"] table.Default.rank-page-table--top50,
  body[data-theme="daylight"] table.Default.rank-results-table-mobile {
    table-layout: auto;
  }
  body[data-theme="nebula"] table.Default.rank-page-table--your-rank td.rank-table__rank-cell,
  body[data-theme="daylight"] table.Default.rank-page-table--your-rank td.rank-table__rank-cell {
    padding: 1px 0 !important;
    text-align: center;
  }
  body[data-theme="nebula"] table.Default.rank-page-table--top50 td.rank-table__rank-cell,
  body[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[data-theme="nebula"] table.Default.rank-page-table--your-rank td.rank-table__empire-cell,
  body[data-theme="daylight"] table.Default.rank-page-table--your-rank td.rank-table__empire-cell {
    padding: 1px 1px 1px 0 !important;
  }
  body[data-theme="nebula"] table.Default.rank-page-table--top50 td.rank-table__empire-cell,
  body[data-theme="daylight"] table.Default.rank-page-table--top50 td.rank-table__empire-cell {
    padding: 1px 1px 1px 0 !important;
  }
  body[data-theme="nebula"] table.Default.rank-page-table--your-rank td:last-child,
  body[data-theme="nebula"] table.Default.rank-page-table--top50 td:last-child,
  body[data-theme="daylight"] table.Default.rank-page-table--your-rank td:last-child,
  body[data-theme="daylight"] table.Default.rank-page-table--top50 td:last-child {
    padding-left: 1px !important;
    padding-right: 1px !important;
  }
  body[data-theme="nebula"] table.Default.rank-page-table--top50 tr.Header td.rank-table__rank-hdr,
  body[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[data-theme="nebula"] table.Default.rank-page-table--your-rank tr.Header td.rank-table__rank-hdr,
  body[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[data-theme="nebula"] table.Default.rank-results-table-mobile,
  body[data-theme="daylight"] table.Default.rank-results-table-mobile {
    font-size: 11px !important; /* ~10% over 10px */
  }

  body[data-theme="nebula"] table.Default.rank-results-table-mobile td,
  body[data-theme="nebula"] table.Default.rank-results-table-mobile th,
  body[data-theme="daylight"] table.Default.rank-results-table-mobile td,
  body[data-theme="daylight"] table.Default.rank-results-table-mobile th {
    padding: 1px 1px !important;
  }

  body[data-theme="nebula"] table.Default.rank-results-table-mobile tr.Header td,
  body[data-theme="nebula"] table.Default.rank-results-table-mobile tr.Header th,
  body[data-theme="daylight"] table.Default.rank-results-table-mobile tr.Header td,
  body[data-theme="daylight"] table.Default.rank-results-table-mobile tr.Header th {
    padding: 2px 1px !important;
    font-size: 10px !important;
  }

  body[data-theme="nebula"] table.Default.rank-results-table-mobile tr.Header td.rank-table__pr-ratio-hdr,
  body[data-theme="daylight"] table.Default.rank-results-table-mobile tr.Header td.rank-table__pr-ratio-hdr {
    padding: 2px 0 !important;
  }

  body[data-theme="nebula"] table.Default.rank-results-table-mobile td.rank-table__pr-ratio,
  body[data-theme="nebula"] table.Default.rank-results-table-mobile td.rank-table__pr-ratio--vm,
  body[data-theme="daylight"] table.Default.rank-results-table-mobile td.rank-table__pr-ratio,
  body[data-theme="daylight"] table.Default.rank-results-table-mobile td.rank-table__pr-ratio--vm {
    padding: 1px 0 !important;
    letter-spacing: 0 !important;
  }

  body[data-theme="nebula"] table.Default.rank-results-table-mobile td[align="right"],
  body[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[data-theme="nebula"] table.Default.kv thead td,
body[data-theme="nebula"] table.Default.kv thead th,
body[data-theme="nebula"] table.Default.kv tr.Header td,
body[data-theme="nebula"] table.Default.kv tr.Header th,
body[data-theme="daylight"] table.Default.kv thead td,
body[data-theme="daylight"] table.Default.kv thead th,
body[data-theme="daylight"] table.Default.kv tr.Header td,
body[data-theme="daylight"] table.Default.kv tr.Header th {
  text-align: center;
}

body[data-theme="nebula"] table.Default.kv tbody td,
body[data-theme="daylight"] table.Default.kv tbody td {
  padding: 2px 8px;
}

body[data-theme="nebula"] table.Default.kv tbody td:first-child,
body[data-theme="daylight"] table.Default.kv tbody td:first-child {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  width: 1%;
}

body[data-theme="nebula"] table.Default.kv tbody td:last-child,
body[data-theme="daylight"] table.Default.kv tbody td:last-child {
  color: var(--text-primary);
  font-size: 14px;
}

body[data-theme="nebula"] table.Default.kv.gc-pm-detail tbody td.gc-pm-detail__body,
body[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[data-theme="nebula"] table.Default.kv.gc-colupgrade-options tbody td,
body[data-theme="nebula"] table.Default.kv.gc-colupgrade-options td,
body[data-theme="daylight"] table.Default.kv.gc-colupgrade-options tbody td,
body[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;
}

body[data-theme="nebula"] .gc-project-detail-page__image-wrap,
body[data-theme="daylight"] .gc-project-detail-page__image-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}

body[data-theme="nebula"] .gc-project-detail-page__image,
body[data-theme="daylight"] .gc-project-detail-page__image {
  display: block;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

body[data-theme="nebula"] .gc-itech-reset-note,
body[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[data-theme="nebula"] .gc-project-detail-content,
  body[data-theme="daylight"] .gc-project-detail-content {
    display: block !important;
  }

  body[data-theme="nebula"] .gc-project-invest-spacer,
  body[data-theme="daylight"] .gc-project-invest-spacer {
    display: none !important;
  }

  body[data-theme="nebula"] .gc-project-invest-summary,
  body[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[data-theme="nebula"] .gc-project-action-panel,
  body[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[data-theme="nebula"] .gc-project-invest-summary__intro,
  body[data-theme="daylight"] .gc-project-invest-summary__intro {
    margin-top: 4px !important;
    margin-bottom: 6px !important;
  }

  body[data-theme="nebula"] .gc-project-invest-summary__table,
  body[data-theme="daylight"] .gc-project-invest-summary__table {
    margin-bottom: 0 !important;
  }

  body[data-theme="nebula"] .gc-project-invest-summary > form,
  body[data-theme="daylight"] .gc-project-invest-summary > form {
    margin: 0 !important;
  }

  body[data-theme="nebula"] .gc-project-invest-summary__table + br,
  body[data-theme="daylight"] .gc-project-invest-summary__table + br,
  body[data-theme="nebula"] .gc-project-invest-summary form:empty,
  body[data-theme="daylight"] .gc-project-invest-summary form:empty {
    display: none !important;
  }

  body[data-theme="nebula"] .gc-itech-reset-note,
  body[data-theme="daylight"] .gc-itech-reset-note {
    margin-top: 4px !important;
    margin-bottom: 6px !important;
    padding: 8px 10px;
  }

  body[data-theme="nebula"] .gc-itech-redistribution-form,
  body[data-theme="daylight"] .gc-itech-redistribution-form {
    margin: 0 !important;
  }

  body[data-theme="nebula"] .gc-itech-redistribution-table,
  body[data-theme="daylight"] .gc-itech-redistribution-table {
    margin-top: 0 !important;
  }
}

body[data-theme="nebula"] .gc-capsule-lab,
body[data-theme="daylight"] .gc-capsule-lab {
  width: 100%;
}

body[data-theme="nebula"] .gc-capsule-lab__title,
body[data-theme="daylight"] .gc-capsule-lab__title {
  margin: 0 0 12px;
}

body[data-theme="nebula"] .gc-capsule-lab__grid,
body[data-theme="daylight"] .gc-capsule-lab__grid {
  align-items: flex-start;
  margin-left: -8px;
  margin-right: -8px;
}

body[data-theme="nebula"] .gc-capsule-lab__left,
body[data-theme="nebula"] .gc-capsule-lab__right,
body[data-theme="daylight"] .gc-capsule-lab__left,
body[data-theme="daylight"] .gc-capsule-lab__right {
  padding-left: 8px;
  padding-right: 8px;
}

body[data-theme="nebula"] .gc-capsule-lab__form,
body[data-theme="nebula"] .gc-capsule-lab__stocks,
body[data-theme="nebula"] .gc-capsule-lab__recipes,
body[data-theme="daylight"] .gc-capsule-lab__form,
body[data-theme="daylight"] .gc-capsule-lab__stocks,
body[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[data-theme="nebula"] .gc-capsule-lab__form tr.Header td,
body[data-theme="nebula"] .gc-capsule-lab__stocks tr.Header td,
body[data-theme="nebula"] .gc-capsule-lab__recipes tr.Header td,
body[data-theme="daylight"] .gc-capsule-lab__form tr.Header td,
body[data-theme="daylight"] .gc-capsule-lab__stocks tr.Header td,
body[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[data-theme="nebula"] .gc-capsule-lab__form td,
body[data-theme="nebula"] .gc-capsule-lab__stocks td,
body[data-theme="nebula"] .gc-capsule-lab__recipes td,
body[data-theme="daylight"] .gc-capsule-lab__form td,
body[data-theme="daylight"] .gc-capsule-lab__stocks td,
body[data-theme="daylight"] .gc-capsule-lab__recipes td {
  padding: 6px 10px;
  color: var(--text-primary);
  vertical-align: middle;
}

body[data-theme="nebula"] .gc-capsule-lab__form select,
body[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[data-theme="nebula"] .gc-capsule-lab input[type="submit"],
body[data-theme="nebula"] .gc-capsule-lab input[type="button"].ArtifactFuser,
body[data-theme="daylight"] .gc-capsule-lab input[type="submit"],
body[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[data-theme="nebula"] .gc-capsule-lab input[type="button"].ArtifactFuser,
body[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[data-theme="nebula"] .gc-capsule-lab__stocks-wrap,
body[data-theme="daylight"] .gc-capsule-lab__stocks-wrap {
  margin-top: 14px;
}

body[data-theme="nebula"] .gc-capsule-lab__stocks td:nth-child(2),
body[data-theme="nebula"] .gc-capsule-lab__stocks td:nth-child(3),
body[data-theme="daylight"] .gc-capsule-lab__stocks td:nth-child(2),
body[data-theme="daylight"] .gc-capsule-lab__stocks td:nth-child(3) {
  text-align: center;
}

body[data-theme="nebula"] .gc-capsule-lab__recipes td,
body[data-theme="daylight"] .gc-capsule-lab__recipes td {
  vertical-align: top;
}

body[data-theme="nebula"] .gc-capsule-lab__help,
body[data-theme="daylight"] .gc-capsule-lab__help {
  margin: 14px 0 0;
}

body[data-theme="nebula"] .gc-capsule-lab__help a,
body[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[data-theme="nebula"] .gc-intel-page,
  body[data-theme="daylight"] .gc-intel-page,
  body[data-theme="nebula"] .gc-colony-page,
  body[data-theme="daylight"] .gc-colony-page,
  body[data-theme="nebula"] .gc-project-page,
  body[data-theme="daylight"] .gc-project-page,
  body[data-theme="nebula"] .gc-project-detail-page,
  body[data-theme="daylight"] .gc-project-detail-page {
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box;
  }

  body[data-theme="nebula"] .gc-intel-page .row,
  body[data-theme="daylight"] .gc-intel-page .row,
  body[data-theme="nebula"] .gc-project-detail-page .row,
  body[data-theme="daylight"] .gc-project-detail-page .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body[data-theme="nebula"] .gc-intel-page .mobileShow,
  body[data-theme="daylight"] .gc-intel-page .mobileShow,
  body[data-theme="nebula"] .gc-colony-page .mobileShow,
  body[data-theme="daylight"] .gc-colony-page .mobileShow,
  body[data-theme="nebula"] .gc-project-page .mobileShow,
  body[data-theme="daylight"] .gc-project-page .mobileShow {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
  }

  body[data-theme="nebula"] .gc-capsule-lab__grid,
  body[data-theme="daylight"] .gc-capsule-lab__grid {
    margin-left: 0;
    margin-right: 0;
  }

  body[data-theme="nebula"] .gc-capsule-lab__left,
  body[data-theme="nebula"] .gc-capsule-lab__right,
  body[data-theme="daylight"] .gc-capsule-lab__left,
  body[data-theme="daylight"] .gc-capsule-lab__right {
    padding-left: 0;
    padding-right: 0;
  }

  .gc-capsule-lab__stocks-wrap {
    display: none !important;
  }

  body[data-theme="nebula"] .gc-intel-page .gc-intel-page__content,
  body[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;
  }

  body[data-theme="nebula"] .gc-intel-page .gc-intel-page__content--mobile,
  body[data-theme="daylight"] .gc-intel-page .gc-intel-page__content--mobile,
  body[data-theme="nebula"] .gc-colony-page .gc-colony-page__mobile,
  body[data-theme="daylight"] .gc-colony-page .gc-colony-page__mobile,
  body[data-theme="nebula"] .gc-project-page .gc-project-page__mobile,
  body[data-theme="daylight"] .gc-project-page .gc-project-page__mobile,
  body[data-theme="nebula"] .gc-project-detail-page,
  body[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[data-theme="nebula"] .gc-intel-page .gc-intel-page__content--mobile table.Default,
  body[data-theme="daylight"] .gc-intel-page .gc-intel-page__content--mobile table.Default,
  body[data-theme="nebula"] .gc-colony-page .gc-colony-page__mobile table.Default,
  body[data-theme="daylight"] .gc-colony-page .gc-colony-page__mobile table.Default,
  body[data-theme="nebula"] .gc-project-page .gc-project-page__mobile table.Default,
  body[data-theme="daylight"] .gc-project-page .gc-project-page__mobile table.Default,
  body[data-theme="nebula"] .gc-project-detail-page table.Default,
  body[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[data-theme="nebula"] .gc-intel-page .gc-intel-page__content--mobile table.Default thead,
  body[data-theme="daylight"] .gc-intel-page .gc-intel-page__content--mobile table.Default thead,
  body[data-theme="nebula"] .gc-colony-page .gc-colony-page__mobile table.Default thead,
  body[data-theme="daylight"] .gc-colony-page .gc-colony-page__mobile table.Default thead,
  body[data-theme="nebula"] .gc-project-page .gc-project-page__mobile table.Default thead,
  body[data-theme="daylight"] .gc-project-page .gc-project-page__mobile table.Default thead,
  body[data-theme="nebula"] .gc-project-detail-page table.Default thead,
  body[data-theme="daylight"] .gc-project-detail-page table.Default thead {
    display: table-header-group !important;
    width: 100% !important;
  }

  body[data-theme="nebula"] .gc-intel-page .gc-intel-page__content--mobile table.Default tbody,
  body[data-theme="daylight"] .gc-intel-page .gc-intel-page__content--mobile table.Default tbody,
  body[data-theme="nebula"] .gc-colony-page .gc-colony-page__mobile table.Default tbody,
  body[data-theme="daylight"] .gc-colony-page .gc-colony-page__mobile table.Default tbody,
  body[data-theme="nebula"] .gc-project-page .gc-project-page__mobile table.Default tbody,
  body[data-theme="daylight"] .gc-project-page .gc-project-page__mobile table.Default tbody,
  body[data-theme="nebula"] .gc-project-detail-page table.Default tbody,
  body[data-theme="daylight"] .gc-project-detail-page table.Default tbody {
    display: table-row-group !important;
    width: 100% !important;
  }

  body[data-theme="nebula"] .gc-intel-page .gc-intel-page__content--mobile table.Default tr,
  body[data-theme="daylight"] .gc-intel-page .gc-intel-page__content--mobile table.Default tr,
  body[data-theme="nebula"] .gc-colony-page .gc-colony-page__mobile table.Default tr,
  body[data-theme="daylight"] .gc-colony-page .gc-colony-page__mobile table.Default tr,
  body[data-theme="nebula"] .gc-project-page .gc-project-page__mobile table.Default tr,
  body[data-theme="daylight"] .gc-project-page .gc-project-page__mobile table.Default tr,
  body[data-theme="nebula"] .gc-project-detail-page table.Default tr,
  body[data-theme="daylight"] .gc-project-detail-page table.Default tr {
    display: table-row !important;
  }

  body[data-theme="nebula"] .gc-intel-page .gc-intel-page__content--mobile table.Default th,
  body[data-theme="nebula"] .gc-intel-page .gc-intel-page__content--mobile table.Default td,
  body[data-theme="daylight"] .gc-intel-page .gc-intel-page__content--mobile table.Default th,
  body[data-theme="daylight"] .gc-intel-page .gc-intel-page__content--mobile table.Default td,
  body[data-theme="nebula"] .gc-colony-page .gc-colony-page__mobile table.Default th,
  body[data-theme="nebula"] .gc-colony-page .gc-colony-page__mobile table.Default td,
  body[data-theme="daylight"] .gc-colony-page .gc-colony-page__mobile table.Default th,
  body[data-theme="daylight"] .gc-colony-page .gc-colony-page__mobile table.Default td,
  body[data-theme="nebula"] .gc-project-page .gc-project-page__mobile table.Default th,
  body[data-theme="nebula"] .gc-project-page .gc-project-page__mobile table.Default td,
  body[data-theme="daylight"] .gc-project-page .gc-project-page__mobile table.Default th,
  body[data-theme="daylight"] .gc-project-page .gc-project-page__mobile table.Default td,
  body[data-theme="nebula"] .gc-project-detail-page table.Default th,
  body[data-theme="nebula"] .gc-project-detail-page table.Default td,
  body[data-theme="daylight"] .gc-project-detail-page table.Default th,
  body[data-theme="daylight"] .gc-project-detail-page table.Default td {
    display: table-cell !important;
    box-sizing: border-box;
    min-width: 0;
  }

  body[data-theme="nebula"] table.Default.kv.gc-intel-kv,
  body[data-theme="daylight"] table.Default.kv.gc-intel-kv {
    table-layout: fixed;
  }

  body[data-theme="nebula"] table.Default.kv tbody td,
  body[data-theme="daylight"] table.Default.kv tbody td {
    padding: 2px 4px;
  }
  body[data-theme="nebula"] table.Default.kv.gc-intel-kv tbody td:first-child,
  body[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[data-theme="nebula"] table.Default.kv.gc-intel-kv tbody td:last-child,
  body[data-theme="daylight"] table.Default.kv.gc-intel-kv tbody td:last-child {
    width: 62%;
    overflow-wrap: anywhere;
  }
  body[data-theme="nebula"] table.Default.kv tbody td:last-child,
  body[data-theme="daylight"] table.Default.kv tbody td:last-child {
    font-size: 13px;
  }
  body[data-theme="nebula"] table.Default.kv.gc-pm-detail tbody td.gc-pm-detail__body,
  body[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[data-theme="nebula"] table.Default.gc-fed-list,
body[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[data-theme="nebula"] table.Default.gc-fed-list tr.Header td,
body[data-theme="daylight"] table.Default.gc-fed-list tr.Header td {
  font-size: 10px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

body[data-theme="nebula"] table.Default.gc-fed-list tr:not(.Header) td,
body[data-theme="daylight"] table.Default.gc-fed-list tr:not(.Header) td {
  padding: 4px 6px;
  line-height: 1.15;
}

body[data-theme="nebula"] table.Default.gc-fed-list td:nth-child(1),
body[data-theme="daylight"] table.Default.gc-fed-list td:nth-child(1) {
  width: 28%;
}

body[data-theme="nebula"] table.Default.gc-fed-list td:nth-child(2),
body[data-theme="daylight"] table.Default.gc-fed-list td:nth-child(2) {
  width: 22%;
  font-variant-numeric: tabular-nums;
}

body[data-theme="nebula"] table.Default.gc-fed-list td:nth-child(3),
body[data-theme="daylight"] table.Default.gc-fed-list td:nth-child(3) {
  width: 10%;
  font-variant-numeric: tabular-nums;
}

body[data-theme="nebula"] table.Default.gc-fed-list td:nth-child(4),
body[data-theme="daylight"] table.Default.gc-fed-list td:nth-child(4) {
  width: 12%;
  font-variant-numeric: tabular-nums;
}

body[data-theme="nebula"] table.Default.gc-fed-list td:nth-child(5),
body[data-theme="daylight"] table.Default.gc-fed-list td:nth-child(5) {
  width: 28%;
}

body[data-theme="nebula"] .gc-fed-list__power-full,
body[data-theme="daylight"] .gc-fed-list__power-full {
  display: inline;
}

body[data-theme="nebula"] .gc-fed-list__power-abbrev,
body[data-theme="daylight"] .gc-fed-list__power-abbrev {
  display: none;
}

body[data-theme="nebula"] .gc-fed-list__hdr-full,
body[data-theme="daylight"] .gc-fed-list__hdr-full {
  display: inline;
}

body[data-theme="nebula"] .gc-fed-list__hdr-mobile,
body[data-theme="daylight"] .gc-fed-list__hdr-mobile {
  display: none;
}

body[data-theme="nebula"] table.Default.gc-fed-list td:nth-child(1),
body[data-theme="daylight"] table.Default.gc-fed-list td:nth-child(1),
body[data-theme="nebula"] table.Default.gc-fed-list td:nth-child(5),
body[data-theme="daylight"] table.Default.gc-fed-list td:nth-child(5) {
  overflow-wrap: anywhere;
}

body[data-theme="nebula"] table.Default.gc-fed-prev-table,
body[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[data-theme="nebula"] table.Default.gc-fed-member-table,
body[data-theme="daylight"] table.Default.gc-fed-member-table {
  margin-left: auto !important;
  margin-right: auto !important;
}

body[data-theme="nebula"] table.Default.gc-fed-member-table--mobile,
body[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: auto !important;
}

body[data-theme="nebula"] table.Default.gc-fed-member-table tr.gc-fed-member-table__empty td,
body[data-theme="daylight"] table.Default.gc-fed-member-table tr.gc-fed-member-table__empty td {
  width: 100% !important;
  text-align: center !important;
}

body[data-theme="nebula"] .gc-fed-member-empty,
body[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[data-theme="nebula"] .col-lg-8 .mobileHide:has(.gc-fed-member-empty),
  body[data-theme="daylight"] .col-lg-8 .mobileHide:has(.gc-fed-member-empty) {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box;
  }
}

body[data-theme="nebula"] .gc-fed-member-empty--desktop,
body[data-theme="daylight"] .gc-fed-member-empty--desktop {
  width: 100% !important;
  max-width: 100% !important;
}

body[data-theme="nebula"] .gc-fed-member-empty--mobile,
body[data-theme="daylight"] .gc-fed-member-empty--mobile {
  width: 100% !important;
  max-width: 100% !important;
}

/* =========================================================
   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[data-theme="nebula"] .gc-fed-war-grid table.Default.gc-fed-war-table,
body[data-theme="daylight"] .gc-fed-war-grid table.Default.gc-fed-war-table {
  width: 90%;
}

@media (max-width: 767.98px) {
  body[data-theme="nebula"] .col-lg-8 .mobileShow,
  body[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[data-theme="nebula"] .col-lg-8 .col-sm-12 > .mobileShow:has(.gc-fed-member-empty, .gc-fed-member-table--mobile),
  body[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[data-theme="nebula"] .col-lg-8 .col-sm-12 .col-sm-12 > .mobileShow:has(.gc-fed-member-empty, .gc-fed-member-table--mobile),
  body[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[data-theme="nebula"] .mobileShow > table.Default.gc-fed-member-table--mobile,
  body[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;
  }

  /* f=fed_member&apply=1 mobile: fixed columns + stacked actions so Approve/Reject
     share width and PR/Race get more room than a stretched last column. */
  body[data-theme="nebula"] table.Default.gc-fed-member-table--mobile.gc-fed-member-table--applicants,
  body[data-theme="daylight"] table.Default.gc-fed-member-table--mobile.gc-fed-member-table--applicants {
    table-layout: fixed !important;
  }
  body[data-theme="nebula"] table.Default.gc-fed-member-table--mobile.gc-fed-member-table--applicants td,
  body[data-theme="daylight"] table.Default.gc-fed-member-table--mobile.gc-fed-member-table--applicants td {
    padding: 3px 3px;
    vertical-align: middle;
  }
  /* Data rows only — header uses colspan; last row is totals. */
  body[data-theme="nebula"] table.Default.gc-fed-member-table--mobile.gc-fed-member-table--applicants tbody tr:not(.Header):not(:last-child) td:nth-child(1),
  body[data-theme="daylight"] table.Default.gc-fed-member-table--mobile.gc-fed-member-table--applicants tbody tr:not(.Header):not(:last-child) td:nth-child(1) {
    width: 1.85rem;
  }
  body[data-theme="nebula"] table.Default.gc-fed-member-table--mobile.gc-fed-member-table--applicants tbody tr:not(.Header):not(:last-child) td:nth-child(2),
  body[data-theme="daylight"] table.Default.gc-fed-member-table--mobile.gc-fed-member-table--applicants tbody tr:not(.Header):not(:last-child) td:nth-child(2) {
    width: 30%;
    min-width: 0;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body[data-theme="nebula"] table.Default.gc-fed-member-table--mobile.gc-fed-member-table--applicants tbody tr:not(.Header):not(:last-child) td:nth-child(3),
  body[data-theme="daylight"] table.Default.gc-fed-member-table--mobile.gc-fed-member-table--applicants tbody tr:not(.Header):not(:last-child) td:nth-child(3) {
    width: 17%;
    font-size: 11px;
  }
  body[data-theme="nebula"] table.Default.gc-fed-member-table--mobile.gc-fed-member-table--applicants tbody tr:not(.Header):not(:last-child) td:nth-child(4),
  body[data-theme="daylight"] table.Default.gc-fed-member-table--mobile.gc-fed-member-table--applicants tbody tr:not(.Header):not(:last-child) td:nth-child(4) {
    width: 12%;
  }
  body[data-theme="nebula"] table.Default.gc-fed-member-table--mobile.gc-fed-member-table--applicants tbody tr:not(.Header):not(:last-child) td:nth-child(5),
  body[data-theme="daylight"] table.Default.gc-fed-member-table--mobile.gc-fed-member-table--applicants tbody tr:not(.Header):not(:last-child) td:nth-child(5) {
    width: 18%;
    font-size: 11px;
  }
  body[data-theme="nebula"] table.Default.gc-fed-member-table--mobile.gc-fed-member-table--applicants tbody tr:not(.Header):not(:last-child) td:last-child,
  body[data-theme="daylight"] table.Default.gc-fed-member-table--mobile.gc-fed-member-table--applicants tbody tr:not(.Header):not(:last-child) td:last-child {
    width: 5.75rem;
    padding: 2px 4px;
  }
  body[data-theme="nebula"] .gc-fed-member-actions,
  body[data-theme="daylight"] .gc-fed-member-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: stretch;
    width: 100%;
    min-width: 0;
  }
  body[data-theme="nebula"] .gc-fed-member-actions__note,
  body[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[data-theme="nebula"] .gc-fed-member-actions input[type="button"],
  body[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[data-theme="nebula"] .gc-fed-war-grid table.Default.gc-fed-war-table,
  body[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[data-theme="nebula"] table.Default.gc-fed-prev-table tr > td:nth-child(1),
body[data-theme="daylight"] table.Default.gc-fed-prev-table tr > td:nth-child(1) {
  width: 30%;
}

body[data-theme="nebula"] table.Default.gc-fed-prev-table tr > td:nth-child(2),
body[data-theme="daylight"] table.Default.gc-fed-prev-table tr > td:nth-child(2) {
  width: 27%;
}

body[data-theme="nebula"] table.Default.gc-fed-prev-table tr > td:nth-child(3),
body[data-theme="daylight"] table.Default.gc-fed-prev-table tr > td:nth-child(3) {
  width: 27%;
}

body[data-theme="nebula"] table.Default.gc-fed-prev-table tr > td:nth-child(4),
body[data-theme="daylight"] table.Default.gc-fed-prev-table tr > td:nth-child(4) {
  width: 16%;
  white-space: nowrap;
}

body[data-theme="nebula"] .gc-fed-prev-pager,
body[data-theme="daylight"] .gc-fed-prev-pager {
  margin-right: 4px !important;
}

/* =========================================================
   COLONY LIST (f_com_col)
   ========================================================= */
@media (min-width: 768px) {
  body[data-theme="nebula"] table.Default.gc-colony-list-table tbody tr > td:nth-child(3),
  body[data-theme="nebula"] table.Default.gc-colony-list-table thead tr > td:nth-child(3),
  body[data-theme="nebula"] table.Default.gc-colony-list-table tbody tr > td:nth-child(4),
  body[data-theme="nebula"] table.Default.gc-colony-list-table thead tr > td:nth-child(4),
  body[data-theme="nebula"] table.Default.gc-colony-list-table tbody tr > td:last-child,
  body[data-theme="nebula"] table.Default.gc-colony-list-table thead tr > td:last-child,
  body[data-theme="daylight"] table.Default.gc-colony-list-table tbody tr > td:nth-child(3),
  body[data-theme="daylight"] table.Default.gc-colony-list-table thead tr > td:nth-child(3),
  body[data-theme="daylight"] table.Default.gc-colony-list-table tbody tr > td:nth-child(4),
  body[data-theme="daylight"] table.Default.gc-colony-list-table thead tr > td:nth-child(4),
  body[data-theme="daylight"] table.Default.gc-colony-list-table tbody tr > td:last-child,
  body[data-theme="daylight"] table.Default.gc-colony-list-table thead tr > td:last-child {
    white-space: nowrap;
  }
}

body[data-theme="nebula"] table.Default.gc-colony-detail-table tr.Header td,
body[data-theme="nebula"] table.Default.gc-colony-detail-table thead td,
body[data-theme="daylight"] table.Default.gc-colony-detail-table tr.Header td,
body[data-theme="daylight"] table.Default.gc-colony-detail-table thead td,
body[data-theme="nebula"] table.Default.gc-colony-mobile-table tr.Header td,
body[data-theme="nebula"] table.Default.gc-colony-mobile-table thead td,
body[data-theme="daylight"] table.Default.gc-colony-mobile-table tr.Header td,
body[data-theme="daylight"] table.Default.gc-colony-mobile-table thead td {
  text-align: center;
}

body[data-theme="nebula"] table.Default.gc-colony-detail-table tbody td,
body[data-theme="nebula"] table.Default.gc-colony-detail-table tbody td *,
body[data-theme="daylight"] table.Default.gc-colony-detail-table tbody td,
body[data-theme="daylight"] table.Default.gc-colony-detail-table tbody td * {
  letter-spacing: 0 !important;
  text-transform: none !important;
}

body[data-theme="nebula"] table.Default.gc-colony-detail-table .gc-colony-manage-title,
body[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[data-theme="nebula"] .gc-colony-build-form,
body[data-theme="daylight"] .gc-colony-build-form {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
}

body[data-theme="nebula"] .gc-colony-build-form > table.Default.gc-colony-detail-table,
body[data-theme="daylight"] .gc-colony-build-form > table.Default.gc-colony-detail-table,
body[data-theme="nebula"] .gc-colony-build-form > table.Default.gc-colony-mobile-table,
body[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[data-theme="nebula"] table.Default.kv.gc-colony-mobile-table,
  body[data-theme="daylight"] table.Default.kv.gc-colony-mobile-table {
    table-layout: fixed;
  }

  body[data-theme="nebula"] table.Default.kv.gc-colony-mobile-table tbody td:first-child,
  body[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[data-theme="nebula"] table.Default.gc-colony-mobile-table tbody td,
  body[data-theme="nebula"] table.Default.gc-colony-mobile-table tbody td *,
  body[data-theme="daylight"] table.Default.gc-colony-mobile-table tbody td,
  body[data-theme="daylight"] table.Default.gc-colony-mobile-table tbody td * {
    letter-spacing: 0 !important;
    text-transform: none !important;
  }

  body[data-theme="nebula"] table.Default.kv.gc-colony-mobile-table tbody td:last-child,
  body[data-theme="daylight"] table.Default.kv.gc-colony-mobile-table tbody td:last-child {
    width: 58%;
    overflow-wrap: anywhere;
    text-align: left;
  }

  body[data-theme="nebula"] table.Default.gc-colony-mobile-table--actions td,
  body[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[data-theme="nebula"] .gc-colony-page .gc-colony-page__mobile,
  body[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[data-theme="nebula"] table.Default.gc-intel-mobile-table,
  body[data-theme="daylight"] table.Default.gc-intel-mobile-table,
  body[data-theme="nebula"] table.Default.gc-colony-mobile-table,
  body[data-theme="daylight"] table.Default.gc-colony-mobile-table,
  body[data-theme="nebula"] table.Default.gc-colony-build-result-table,
  body[data-theme="daylight"] table.Default.gc-colony-build-result-table,
  body[data-theme="nebula"] table.Default.gc-disband-mobile-table,
  body[data-theme="daylight"] table.Default.gc-disband-mobile-table,
  body[data-theme="nebula"] table.Default.gc-project-mobile-table,
  body[data-theme="daylight"] table.Default.gc-project-mobile-table,
  body[data-theme="nebula"] table.Default.gc-project-detail-mobile-table,
  body[data-theme="daylight"] table.Default.gc-project-detail-mobile-table,
  body[data-theme="nebula"] table.Default.gc-colony-list-mobile-table,
  body[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[data-theme="nebula"] table.Default.gc-project-mobile-table,
  body[data-theme="daylight"] table.Default.gc-project-mobile-table,
  body[data-theme="nebula"] table.Default.gc-project-detail-mobile-table,
  body[data-theme="daylight"] table.Default.gc-project-detail-mobile-table,
  body[data-theme="nebula"] table.Default.gc-colony-list-mobile-table,
  body[data-theme="daylight"] table.Default.gc-colony-list-mobile-table,
  body[data-theme="nebula"] table.Default.gc-colony-build-result-table,
  body[data-theme="daylight"] table.Default.gc-colony-build-result-table,
  body[data-theme="nebula"] table.Default.gc-colony-mobile-table,
  body[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[data-theme="nebula"] table.Default.gc-disband-mobile-table,
  body[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[data-theme="nebula"] table.Default.gc-intel-mobile-table thead,
  body[data-theme="daylight"] table.Default.gc-intel-mobile-table thead,
  body[data-theme="nebula"] table.Default.gc-colony-mobile-table thead,
  body[data-theme="daylight"] table.Default.gc-colony-mobile-table thead,
  body[data-theme="nebula"] table.Default.gc-colony-build-result-table thead,
  body[data-theme="daylight"] table.Default.gc-colony-build-result-table thead,
  body[data-theme="nebula"] table.Default.gc-disband-mobile-table thead,
  body[data-theme="daylight"] table.Default.gc-disband-mobile-table thead,
  body[data-theme="nebula"] table.Default.gc-project-mobile-table thead,
  body[data-theme="daylight"] table.Default.gc-project-mobile-table thead,
  body[data-theme="nebula"] table.Default.gc-project-detail-mobile-table thead,
  body[data-theme="daylight"] table.Default.gc-project-detail-mobile-table thead,
  body[data-theme="nebula"] table.Default.gc-colony-list-mobile-table thead,
  body[data-theme="daylight"] table.Default.gc-colony-list-mobile-table thead {
    display: table-header-group !important;
  }

  body[data-theme="nebula"] table.Default.gc-intel-mobile-table tbody,
  body[data-theme="daylight"] table.Default.gc-intel-mobile-table tbody,
  body[data-theme="nebula"] table.Default.gc-colony-mobile-table tbody,
  body[data-theme="daylight"] table.Default.gc-colony-mobile-table tbody,
  body[data-theme="nebula"] table.Default.gc-colony-build-result-table tbody,
  body[data-theme="daylight"] table.Default.gc-colony-build-result-table tbody,
  body[data-theme="nebula"] table.Default.gc-disband-mobile-table tbody,
  body[data-theme="daylight"] table.Default.gc-disband-mobile-table tbody,
  body[data-theme="nebula"] table.Default.gc-project-mobile-table tbody,
  body[data-theme="daylight"] table.Default.gc-project-mobile-table tbody,
  body[data-theme="nebula"] table.Default.gc-project-detail-mobile-table tbody,
  body[data-theme="daylight"] table.Default.gc-project-detail-mobile-table tbody,
  body[data-theme="nebula"] table.Default.gc-colony-list-mobile-table tbody,
  body[data-theme="daylight"] table.Default.gc-colony-list-mobile-table tbody {
    display: table-row-group !important;
  }

  body[data-theme="nebula"] table.Default.gc-intel-mobile-table tr,
  body[data-theme="daylight"] table.Default.gc-intel-mobile-table tr,
  body[data-theme="nebula"] table.Default.gc-colony-mobile-table tr,
  body[data-theme="daylight"] table.Default.gc-colony-mobile-table tr,
  body[data-theme="nebula"] table.Default.gc-colony-build-result-table tr,
  body[data-theme="daylight"] table.Default.gc-colony-build-result-table tr,
  body[data-theme="nebula"] table.Default.gc-disband-mobile-table tr,
  body[data-theme="daylight"] table.Default.gc-disband-mobile-table tr,
  body[data-theme="nebula"] table.Default.gc-project-mobile-table tr,
  body[data-theme="daylight"] table.Default.gc-project-mobile-table tr,
  body[data-theme="nebula"] table.Default.gc-project-detail-mobile-table tr,
  body[data-theme="daylight"] table.Default.gc-project-detail-mobile-table tr,
  body[data-theme="nebula"] table.Default.gc-colony-list-mobile-table tr,
  body[data-theme="daylight"] table.Default.gc-colony-list-mobile-table tr {
    display: table-row !important;
  }

  body[data-theme="nebula"] table.Default.gc-intel-mobile-table th,
  body[data-theme="nebula"] table.Default.gc-intel-mobile-table td,
  body[data-theme="daylight"] table.Default.gc-intel-mobile-table th,
  body[data-theme="daylight"] table.Default.gc-intel-mobile-table td,
  body[data-theme="nebula"] table.Default.gc-colony-mobile-table th,
  body[data-theme="nebula"] table.Default.gc-colony-mobile-table td,
  body[data-theme="daylight"] table.Default.gc-colony-mobile-table th,
  body[data-theme="daylight"] table.Default.gc-colony-mobile-table td,
  body[data-theme="nebula"] table.Default.gc-colony-build-result-table th,
  body[data-theme="nebula"] table.Default.gc-colony-build-result-table td,
  body[data-theme="daylight"] table.Default.gc-colony-build-result-table th,
  body[data-theme="daylight"] table.Default.gc-colony-build-result-table td,
  body[data-theme="nebula"] table.Default.gc-disband-mobile-table th,
  body[data-theme="nebula"] table.Default.gc-disband-mobile-table td,
  body[data-theme="daylight"] table.Default.gc-disband-mobile-table th,
  body[data-theme="daylight"] table.Default.gc-disband-mobile-table td,
  body[data-theme="nebula"] table.Default.gc-project-mobile-table th,
  body[data-theme="nebula"] table.Default.gc-project-mobile-table td,
  body[data-theme="daylight"] table.Default.gc-project-mobile-table th,
  body[data-theme="daylight"] table.Default.gc-project-mobile-table td,
  body[data-theme="nebula"] table.Default.gc-project-detail-mobile-table th,
  body[data-theme="nebula"] table.Default.gc-project-detail-mobile-table td,
  body[data-theme="daylight"] table.Default.gc-project-detail-mobile-table th,
  body[data-theme="daylight"] table.Default.gc-project-detail-mobile-table td,
  body[data-theme="nebula"] table.Default.gc-colony-list-mobile-table th,
  body[data-theme="nebula"] table.Default.gc-colony-list-mobile-table td,
  body[data-theme="daylight"] table.Default.gc-colony-list-mobile-table th,
  body[data-theme="daylight"] table.Default.gc-colony-list-mobile-table td {
    display: table-cell !important;
    box-sizing: border-box;
    min-width: 0;
  }

  body[data-theme="nebula"] table.Default.gc-project-mobile-table--list,
  body[data-theme="daylight"] table.Default.gc-project-mobile-table--list,
  body[data-theme="nebula"] table.Default.gc-project-detail-mobile-table,
  body[data-theme="daylight"] table.Default.gc-project-detail-mobile-table,
  body[data-theme="nebula"] table.Default.gc-colony-mobile-table--form,
  body[data-theme="daylight"] table.Default.gc-colony-mobile-table--form {
    table-layout: fixed;
  }

  body[data-theme="nebula"] table.Default.gc-project-mobile-table--list tr > td:nth-child(1),
  body[data-theme="daylight"] table.Default.gc-project-mobile-table--list tr > td:nth-child(1) {
    width: 44%;
  }

  body[data-theme="nebula"] table.Default.gc-project-mobile-table--list tr > td:nth-child(2),
  body[data-theme="daylight"] table.Default.gc-project-mobile-table--list tr > td:nth-child(2) {
    width: 24%;
  }

  body[data-theme="nebula"] table.Default.gc-project-mobile-table--list tr > td:nth-child(3),
  body[data-theme="daylight"] table.Default.gc-project-mobile-table--list tr > td:nth-child(3) {
    width: 32%;
  }

  body[data-theme="nebula"] table.Default.gc-colony-mobile-table--form tr > td:nth-child(1),
  body[data-theme="daylight"] table.Default.gc-colony-mobile-table--form tr > td:nth-child(1) {
    width: 62%;
  }

  body[data-theme="nebula"] table.Default.gc-colony-mobile-table--form tr > td:nth-child(2),
  body[data-theme="daylight"] table.Default.gc-colony-mobile-table--form tr > td:nth-child(2) {
    width: 12%;
  }

  body[data-theme="nebula"] table.Default.gc-colony-mobile-table--form tr > td:nth-child(3),
  body[data-theme="daylight"] table.Default.gc-colony-mobile-table--form tr > td:nth-child(3) {
    width: 26%;
  }

  body[data-theme="nebula"] table.Default.gc-colony-mobile-table,
  body[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[data-theme="nebula"] .gc-colony-page .gc-colony-page__mobile > table.Default.gc-colony-mobile-table,
  body[data-theme="daylight"] .gc-colony-page .gc-colony-page__mobile > table.Default.gc-colony-mobile-table,
  body[data-theme="nebula"] .gc-colony-page .gc-colony-page__mobile > .gc-colony-build-form > table.Default.gc-colony-mobile-table,
  body[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[data-theme="nebula"] .gc-colony-page table.Default.gc-colony-build-result-table,
  body[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[data-theme="nebula"] table.Default.gc-colony-mobile-table .gc-colony-manage-title,
  body[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[data-theme="nebula"] table.Default.gc-project-detail-mobile-table tr > td:nth-child(1),
  body[data-theme="daylight"] table.Default.gc-project-detail-mobile-table tr > td:nth-child(1) {
    width: 20%;
  }

  body[data-theme="nebula"] table.Default.gc-project-detail-mobile-table tr > td:nth-child(2),
  body[data-theme="daylight"] table.Default.gc-project-detail-mobile-table tr > td:nth-child(2) {
    width: 40%;
  }

  body[data-theme="nebula"] table.Default.gc-project-detail-mobile-table tr > td:nth-child(3),
  body[data-theme="daylight"] table.Default.gc-project-detail-mobile-table tr > td:nth-child(3) {
    width: 40%;
  }

  body[data-theme="nebula"] table.Default.gc-colony-list-mobile-table,
  body[data-theme="daylight"] table.Default.gc-colony-list-mobile-table {
    table-layout: fixed;
  }

  body[data-theme="nebula"] table.Default.gc-colony-list-mobile-table td,
  body[data-theme="nebula"] table.Default.gc-colony-list-mobile-table th,
  body[data-theme="daylight"] table.Default.gc-colony-list-mobile-table td,
  body[data-theme="daylight"] table.Default.gc-colony-list-mobile-table th {
    padding-left: 3px !important;
    padding-right: 3px !important;
  }

  body[data-theme="nebula"] table.Default.gc-colony-list-mobile-table tbody tr > td:nth-child(1),
  body[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[data-theme="nebula"] table.Default.gc-colony-list-mobile-table tbody tr > td:nth-child(2),
  body[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[data-theme="nebula"] table.Default.gc-colony-list-mobile-table tbody tr > td:nth-child(3),
  body[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[data-theme="nebula"] table.Default.gc-colony-list-mobile-table tbody tr > td:nth-child(4),
  body[data-theme="daylight"] table.Default.gc-colony-list-mobile-table tbody tr > td:nth-child(4) {
    width: 14%;
    text-align: left;
  }

  body[data-theme="nebula"] table.Default.gc-colony-list-mobile-table tbody tr > td:nth-child(5),
  body[data-theme="daylight"] table.Default.gc-colony-list-mobile-table tbody tr > td:nth-child(5) {
    width: 16%;
  }

  body[data-theme="nebula"] table.Default.gc-colony-list-mobile-table tbody tr > td:nth-child(6),
  body[data-theme="daylight"] table.Default.gc-colony-list-mobile-table tbody tr > td:nth-child(6) {
    width: 25%;
  }

  body[data-theme="nebula"] table.Default.gc-colony-list-mobile-table tbody tr > td:nth-child(7),
  body[data-theme="daylight"] table.Default.gc-colony-list-mobile-table tbody tr > td:nth-child(7) {
    width: 16%;
  }

  body[data-theme="nebula"] table.Default.gc-colony-list-mobile-table thead tr > td:first-child,
  body[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[data-theme="nebula"] table.Default.gc-colony-list-mobile-table thead tr > td:nth-child(2),
  body[data-theme="daylight"] table.Default.gc-colony-list-mobile-table thead tr > td:nth-child(2) {
    width: 26%;
    text-align: left;
  }

  body[data-theme="nebula"] table.Default.gc-colony-list-mobile-table thead tr > td:nth-child(3),
  body[data-theme="daylight"] table.Default.gc-colony-list-mobile-table thead tr > td:nth-child(3) {
    width: 21%;
    text-align: left;
  }

  body[data-theme="nebula"] table.Default.gc-colony-list-mobile-table thead tr > td:nth-child(4),
  body[data-theme="daylight"] table.Default.gc-colony-list-mobile-table thead tr > td:nth-child(4) {
    width: 10%;
  }

  body[data-theme="nebula"] table.Default.gc-colony-list-mobile-table thead tr > td:nth-child(5),
  body[data-theme="daylight"] table.Default.gc-colony-list-mobile-table thead tr > td:nth-child(5) {
    width: 15%;
  }

  body[data-theme="nebula"] table.Default.gc-colony-list-mobile-table thead tr > td:nth-child(6),
  body[data-theme="daylight"] table.Default.gc-colony-list-mobile-table thead tr > td:nth-child(6) {
    width: 8%;
  }

  body[data-theme="nebula"] table.Default.gc-colony-list-mobile-table tbody tr > td:nth-child(6),
  body[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[data-theme="nebula"] .gc-plunder-page,
body[data-theme="daylight"] .gc-plunder-page {
  padding-bottom: 12px;
}

body[data-theme="nebula"] .gc-plunder-summary,
body[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[data-theme="nebula"] .gc-plunder-summary__card,
body[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[data-theme="nebula"] .gc-plunder-summary__card--credit,
body[data-theme="daylight"] .gc-plunder-summary__card--credit {
  border-color: color-mix(in srgb, var(--accent-good) 42%, var(--border));
}

body[data-theme="nebula"] .gc-plunder-summary__card--turns,
body[data-theme="daylight"] .gc-plunder-summary__card--turns {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--border));
}

body[data-theme="nebula"] .gc-plunder-summary__label,
body[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[data-theme="nebula"] .gc-plunder-summary__value,
body[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[data-theme="nebula"] .gc-plunder-summary__card--credit .gc-plunder-summary__value,
body[data-theme="daylight"] .gc-plunder-summary__card--credit .gc-plunder-summary__value {
  color: var(--accent-good);
}

body[data-theme="nebula"] .gc-plunder-summary__hint,
body[data-theme="daylight"] .gc-plunder-summary__hint {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-muted);
}

body[data-theme="nebula"] table.Default.gc-plunder-list-table,
body[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[data-theme="nebula"] table.Default.gc-plunder-list-table tr.Header td,
body[data-theme="daylight"] table.Default.gc-plunder-list-table tr.Header td,
body[data-theme="nebula"] table.Default.gc-plunder-list-mobile-table tr.Header td,
body[data-theme="daylight"] table.Default.gc-plunder-list-mobile-table tr.Header td {
  text-align: center;
}

body[data-theme="nebula"] .gc-plunder-note,
body[data-theme="daylight"] .gc-plunder-note {
  width: min(80%, 980px) !important;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

body[data-theme="nebula"] .gc-plunder-actions,
body[data-theme="daylight"] .gc-plunder-actions {
  margin-bottom: 0;
}

body[data-theme="nebula"] .gc-plunder-confirm-page,
body[data-theme="daylight"] .gc-plunder-confirm-page {
  padding-bottom: 12px;
}

@media (max-width: 767.98px) {
  body[data-theme="nebula"] .gc-plunder-summary,
  body[data-theme="daylight"] .gc-plunder-summary,
  body[data-theme="nebula"] .gc-plunder-note,
  body[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[data-theme="nebula"] .gc-plunder-summary,
  body[data-theme="daylight"] .gc-plunder-summary {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
    gap: 8px;
    margin-bottom: 10px;
  }

  body[data-theme="nebula"] .gc-plunder-summary__card,
  body[data-theme="daylight"] .gc-plunder-summary__card {
    min-width: 0;
    padding: 10px 12px;
  }

  body[data-theme="nebula"] .gc-plunder-summary__value,
  body[data-theme="daylight"] .gc-plunder-summary__value {
    font-size: clamp(18px, 6.4vw, 26px);
  }

  body[data-theme="nebula"] .gc-plunder-summary__hint,
  body[data-theme="daylight"] .gc-plunder-summary__hint {
    font-size: 10px;
    line-height: 1.2;
  }

  body[data-theme="nebula"] .gc-plunder-confirm-page table.Default.gc-plunder-confirm-table,
  body[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[data-theme="nebula"] .gc-plunder-confirm-page table.Default.gc-plunder-confirm-table tbody,
  body[data-theme="daylight"] .gc-plunder-confirm-page table.Default.gc-plunder-confirm-table tbody {
    display: table-row-group !important;
  }

  body[data-theme="nebula"] .gc-plunder-confirm-page table.Default.gc-plunder-confirm-table tr,
  body[data-theme="daylight"] .gc-plunder-confirm-page table.Default.gc-plunder-confirm-table tr {
    display: table-row !important;
  }

  body[data-theme="nebula"] .gc-plunder-confirm-page table.Default.gc-plunder-confirm-table td,
  body[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[data-theme="nebula"] table.Default.gc-plunder-list-mobile-table,
  body[data-theme="daylight"] table.Default.gc-plunder-list-mobile-table {
    table-layout: fixed;
  }

  body[data-theme="nebula"] table.Default.gc-plunder-list-mobile-table td,
  body[data-theme="nebula"] table.Default.gc-plunder-list-mobile-table th,
  body[data-theme="daylight"] table.Default.gc-plunder-list-mobile-table td,
  body[data-theme="daylight"] table.Default.gc-plunder-list-mobile-table th {
    padding-left: 3px !important;
    padding-right: 3px !important;
  }

  body[data-theme="nebula"] table.Default.gc-plunder-list-mobile-table tbody tr > td:nth-child(1),
  body[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[data-theme="nebula"] table.Default.gc-plunder-list-mobile-table tbody tr > td:nth-child(2),
  body[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[data-theme="nebula"] table.Default.gc-plunder-list-mobile-table tbody tr > td:nth-child(3),
  body[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[data-theme="nebula"] table.Default.gc-plunder-list-mobile-table tbody tr > td:nth-child(4),
  body[data-theme="daylight"] table.Default.gc-plunder-list-mobile-table tbody tr > td:nth-child(4),
  body[data-theme="nebula"] table.Default.gc-plunder-list-mobile-table tbody tr > td:nth-child(5),
  body[data-theme="daylight"] table.Default.gc-plunder-list-mobile-table tbody tr > td:nth-child(5),
  body[data-theme="nebula"] table.Default.gc-plunder-list-mobile-table tbody tr > td:nth-child(6),
  body[data-theme="daylight"] table.Default.gc-plunder-list-mobile-table tbody tr > td:nth-child(6) {
    width: 16%;
  }

  body[data-theme="nebula"] table.Default.gc-plunder-list-mobile-table thead tr > td:nth-child(1),
  body[data-theme="daylight"] table.Default.gc-plunder-list-mobile-table thead tr > td:nth-child(1) {
    width: 26px;
  }

  body[data-theme="nebula"] table.Default.gc-plunder-list-mobile-table thead tr > td:nth-child(2),
  body[data-theme="daylight"] table.Default.gc-plunder-list-mobile-table thead tr > td:nth-child(2) {
    width: 28%;
    text-align: left;
  }

  body[data-theme="nebula"] table.Default.gc-plunder-list-mobile-table thead tr > td:nth-child(3),
  body[data-theme="daylight"] table.Default.gc-plunder-list-mobile-table thead tr > td:nth-child(3) {
    width: 24%;
    text-align: left;
  }

  body[data-theme="nebula"] table.Default.gc-plunder-list-mobile-table thead tr > td:nth-child(4),
  body[data-theme="daylight"] table.Default.gc-plunder-list-mobile-table thead tr > td:nth-child(4),
  body[data-theme="nebula"] table.Default.gc-plunder-list-mobile-table thead tr > td:nth-child(5),
  body[data-theme="daylight"] table.Default.gc-plunder-list-mobile-table thead tr > td:nth-child(5),
  body[data-theme="nebula"] table.Default.gc-plunder-list-mobile-table thead tr > td:nth-child(6),
  body[data-theme="daylight"] table.Default.gc-plunder-list-mobile-table thead tr > td:nth-child(6) {
    width: 16%;
  }
}

@media (max-width: 640px) {
  body[data-theme="nebula"] table.Default.gc-fed-list tr.Header td,
  body[data-theme="daylight"] table.Default.gc-fed-list tr.Header td {
    font-size: 7px;
    letter-spacing: 0.06em;
  }

  body[data-theme="nebula"] table.Default.gc-fed-list tr:not(.Header) td,
  body[data-theme="daylight"] table.Default.gc-fed-list tr:not(.Header) td {
    padding: 3px 2px;
    font-size: 10px;
    line-height: 1.05;
  }

  body[data-theme="nebula"] table.Default.gc-fed-list td:nth-child(1),
  body[data-theme="daylight"] table.Default.gc-fed-list td:nth-child(1) {
    width: 30%;
  }

  body[data-theme="nebula"] table.Default.gc-fed-list td:nth-child(2),
  body[data-theme="daylight"] table.Default.gc-fed-list td:nth-child(2) {
    width: 18%;
  }

  body[data-theme="nebula"] table.Default.gc-fed-list td:nth-child(3),
  body[data-theme="daylight"] table.Default.gc-fed-list td:nth-child(3) {
    width: 11%;
  }

  body[data-theme="nebula"] table.Default.gc-fed-list td:nth-child(4),
  body[data-theme="daylight"] table.Default.gc-fed-list td:nth-child(4) {
    width: 13%;
  }

  body[data-theme="nebula"] table.Default.gc-fed-list td:nth-child(5),
  body[data-theme="daylight"] table.Default.gc-fed-list td:nth-child(5) {
    width: 28%;
  }

  body[data-theme="nebula"] .gc-fed-list__power-full,
  body[data-theme="daylight"] .gc-fed-list__power-full {
    display: none;
  }

  body[data-theme="nebula"] .gc-fed-list__power-abbrev,
  body[data-theme="daylight"] .gc-fed-list__power-abbrev {
    display: inline;
  }

  body[data-theme="nebula"] .gc-fed-list__hdr-full,
  body[data-theme="daylight"] .gc-fed-list__hdr-full {
    display: none;
  }

  body[data-theme="nebula"] .gc-fed-list__hdr-mobile,
  body[data-theme="daylight"] .gc-fed-list__hdr-mobile {
    display: inline;
    color: inherit;
    line-height: 1;
  }

  body[data-theme="nebula"] .gc-fed-list__hdr-mobile svg,
  body[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[data-theme="nebula"] table.Default[style*="border"],
body[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[data-theme="nebula"] .gc-income-page,
body[data-theme="daylight"] .gc-income-page {
  display: grid;
  gap: 10px;
  max-width: 900px;
  margin: 0 auto 8px;
}

/* -------- Hero P/L -------- */
body[data-theme="nebula"] .gc-income-hero,
body[data-theme="daylight"] .gc-income-hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 8px;
}
@media (max-width: 520px) {
  body[data-theme="nebula"] .gc-income-hero,
  body[data-theme="daylight"] .gc-income-hero {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

body[data-theme="nebula"] .gc-income-hero__card,
body[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[data-theme="nebula"] .gc-income-hero__card::before,
body[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[data-theme="nebula"] .gc-income-hero__label,
body[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[data-theme="nebula"] .gc-income-hero__value,
body[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[data-theme="nebula"] .gc-income-hero__card--primary .gc-income-hero__value,
body[data-theme="daylight"] .gc-income-hero__card--primary .gc-income-hero__value {
  font-size: clamp(26px, 5.2vw, 40px);
}
body[data-theme="nebula"] .gc-income-hero__card--positive .gc-income-hero__value,
body[data-theme="daylight"] .gc-income-hero__card--positive .gc-income-hero__value {
  color: var(--accent-good);
}
body[data-theme="nebula"] .gc-income-hero__card--negative .gc-income-hero__value,
body[data-theme="daylight"] .gc-income-hero__card--negative .gc-income-hero__value {
  color: var(--accent-hot);
}
body[data-theme="nebula"] .gc-income-hero__hint,
body[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[data-theme="nebula"] .gc-income-ledger,
body[data-theme="daylight"] .gc-income-ledger {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 640px) {
  body[data-theme="nebula"] .gc-income-ledger,
  body[data-theme="daylight"] .gc-income-ledger {
    grid-template-columns: 1fr;
  }
}

body[data-theme="nebula"] .gc-income-section,
body[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[data-theme="nebula"] .gc-income-section--credits,
body[data-theme="daylight"] .gc-income-section--credits {
  border-top: 1px solid var(--border);
}
body[data-theme="nebula"] .gc-income-section--debits,
body[data-theme="daylight"] .gc-income-section--debits {
  border-top: 1px solid var(--border);
}
body[data-theme="nebula"] .gc-income-section--resources,
body[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[data-theme="nebula"] .gc-income-section__title,
body[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[data-theme="nebula"] .gc-income-section__total,
body[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[data-theme="nebula"] .gc-income-section--credits .gc-income-section__total,
body[data-theme="daylight"] .gc-income-section--credits .gc-income-section__total {
  color: var(--accent-good);
}
body[data-theme="nebula"] .gc-income-section--debits .gc-income-section__total,
body[data-theme="daylight"] .gc-income-section--debits .gc-income-section__total {
  color: var(--accent-hot);
}
body[data-theme="nebula"] .gc-income-section--resources .gc-income-section__total,
body[data-theme="daylight"] .gc-income-section--resources .gc-income-section__total {
  color: var(--accent-good);
}

/* -------- Rows -------- */
body[data-theme="nebula"] .gc-ledger,
body[data-theme="daylight"] .gc-ledger {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
body[data-theme="nebula"] .gc-ledger__row,
body[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[data-theme="nebula"] .gc-ledger__row:last-child,
body[data-theme="daylight"] .gc-ledger__row:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}
body[data-theme="nebula"] .gc-ledger__label,
body[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[data-theme="nebula"] .gc-ledger__actual,
body[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[data-theme="nebula"] .gc-ledger__calc,
body[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[data-theme="nebula"] .gc-ledger__calc em,
body[data-theme="daylight"] .gc-ledger__calc em {
  font-style: normal;
  color: var(--text-secondary);
  margin: 0 3px;
  opacity: 0.8;
}
body[data-theme="nebula"] .gc-ledger__pct,
body[data-theme="daylight"] .gc-ledger__pct {
  margin-left: 1px;
  opacity: 0.65;
}
body[data-theme="nebula"] .gc-ledger__empty,
body[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[data-theme="nebula"] .gc-ledger__row--mineral-detail,
body[data-theme="daylight"] .gc-ledger__row--mineral-detail {
  border-bottom: 0;
  padding-top: 2px;
  padding-bottom: 2px;
}
body[data-theme="nebula"] .gc-ledger__row--mineral-detail .gc-ledger__label,
body[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[data-theme="nebula"] .gc-income-page + .smallfont,
body[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[data-theme="nebula"] .gc-income-hero__card,
  body[data-theme="daylight"] .gc-income-hero__card {
    padding: 8px 12px 9px;
  }
  body[data-theme="nebula"] .gc-income-section,
  body[data-theme="daylight"] .gc-income-section {
    padding: 8px 10px 9px;
  }
  body[data-theme="nebula"] .gc-ledger__row,
  body[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[data-theme="nebula"] .gc-attack-page table.Default tr.Header td,
body[data-theme="nebula"] .gc-attack-page table.Default tr.Header th,
body[data-theme="nebula"] .gc-attack-page table.Default thead td,
body[data-theme="nebula"] .gc-attack-page table.Default thead th,
body[data-theme="daylight"] .gc-attack-page table.Default tr.Header td,
body[data-theme="daylight"] .gc-attack-page table.Default tr.Header th,
body[data-theme="daylight"] .gc-attack-page table.Default thead td,
body[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[data-theme="nebula"] .gc-attack-page table.Default.kv tbody td:first-child,
body[data-theme="nebula"] .gc-attack-page table.Default.kv td:first-child,
body[data-theme="daylight"] .gc-attack-page table.Default.kv tbody td:first-child,
body[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[data-theme="nebula"] .col-lg-8.col-sm-12:has(.gc-attack-page),
  body[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[data-theme="nebula"] .gc-attack-page,
  body[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[data-theme="nebula"] .gc-attack-page .com-attack-title,
  body[data-theme="daylight"] .gc-attack-page .com-attack-title {
    margin-top: 2px !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    line-height: 1;
  }

  body[data-theme="nebula"] .gc-attack-page .com-attack-title .yellowfont,
  body[data-theme="daylight"] .gc-attack-page .com-attack-title .yellowfont {
    line-height: 1;
    display: inline-block;
  }

  body[data-theme="nebula"] .gc-attack-page .com-attack-controls-row,
  body[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[data-theme="nebula"] .gc-attack-page .com-attack-controls,
  body[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[data-theme="nebula"] .gc-attack-page .com-attack-fleet-wrap,
  body[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[data-theme="nebula"] .gc-attack-page .com-attack-fleet-note,
  body[data-theme="daylight"] .gc-attack-page .com-attack-fleet-note {
    order: 3;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  body[data-theme="nebula"] .gc-attack-page .com-attack-help,
  body[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[data-theme="nebula"] .gc-attack-page .com-attack-image,
  body[data-theme="daylight"] .gc-attack-page .com-attack-image,
  body[data-theme="nebula"] .gc-attack-page .com-attack-desktop-spacer,
  body[data-theme="daylight"] .gc-attack-page .com-attack-desktop-spacer {
    display: none;
  }

  body[data-theme="nebula"] .gc-attack-page .com-attack-controls table.Default,
  body[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[data-theme="nebula"] .gc-attack-page .com-attack-controls table.Default:first-of-type,
  body[data-theme="daylight"] .gc-attack-page .com-attack-controls table.Default:first-of-type {
    margin-top: 0 !important;
    margin-bottom: 4px !important;
  }

  body[data-theme="nebula"] .gc-attack-page .com-attack-controls table.Default:first-of-type td,
  body[data-theme="daylight"] .gc-attack-page .com-attack-controls table.Default:first-of-type td {
    padding-top: 4px;
    padding-bottom: 4px;
  }

  body[data-theme="nebula"] .gc-attack-page .com-attack-fleet-table,
  body[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[data-theme="nebula"] .gc-attack-page .com-attack-fleet-table td,
  body[data-theme="daylight"] .gc-attack-page .com-attack-fleet-table td {
    padding-left: 3px;
    padding-right: 3px;
    overflow-wrap: anywhere;
  }

  body[data-theme="nebula"] .gc-attack-page .com-attack-fleet-table td:nth-child(2),
  body[data-theme="daylight"] .gc-attack-page .com-attack-fleet-table td:nth-child(2) {
    width: 40%;
  }

  body[data-theme="nebula"] .gc-attack-page .com-attack-fleet-table td:nth-child(3),
  body[data-theme="daylight"] .gc-attack-page .com-attack-fleet-table td:nth-child(3) {
    width: 18%;
  }

  body[data-theme="nebula"] .gc-attack-page .com-attack-fleet-table td:nth-child(4),
  body[data-theme="daylight"] .gc-attack-page .com-attack-fleet-table td:nth-child(4) {
    width: 20%;
  }

  body[data-theme="nebula"] .gc-attack-page .com-attack-fleet-table td:nth-child(6),
  body[data-theme="daylight"] .gc-attack-page .com-attack-fleet-table td:nth-child(6) {
    width: 22%;
  }

  body[data-theme="nebula"] .gc-attack-page .com-attack-fleet__power-unit,
  body[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[data-theme="nebula"] .gc-attack-confirm-page table.Default tr.Header td,
body[data-theme="nebula"] .gc-attack-confirm-page table.Default tr.Header th,
body[data-theme="daylight"] .gc-attack-confirm-page table.Default tr.Header td,
body[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[data-theme="nebula"] .gc-attack-confirm-page table.Default.kv tbody td:first-child,
body[data-theme="nebula"] .gc-attack-confirm-page table.Default.kv td:first-child,
body[data-theme="daylight"] .gc-attack-confirm-page table.Default.kv tbody td:first-child,
body[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[data-theme="nebula"] .gc-attack-confirm-page .com-attack-confirm-table,
body[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[data-theme="nebula"] .gc-attack-confirm-page .com-attack-confirm-table td,
body[data-theme="daylight"] .gc-attack-confirm-page .com-attack-confirm-table td {
  padding-top: 4px;
  padding-bottom: 4px;
}

body[data-theme="nebula"] .gc-attack-confirm-page .com-attack-confirm-actions,
body[data-theme="daylight"] .gc-attack-confirm-page .com-attack-confirm-actions {
  margin-top: 2px !important;
}

@media (max-width: 767.98px) {
  body[data-theme="nebula"] .col-lg-8.col-sm-12:has(.gc-attack-confirm-page),
  body[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[data-theme="nebula"] .gc-attack-confirm-page,
  body[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[data-theme="nebula"] .gc-attack-confirm-page .com-attack-confirm-title,
  body[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[data-theme="nebula"] .gc-attack-confirm-page .com-attack-confirm-title .yellowfont,
  body[data-theme="daylight"] .gc-attack-confirm-page .com-attack-confirm-title .yellowfont {
    display: inline-block;
    line-height: 1;
  }

  body[data-theme="nebula"] .gc-attack-confirm-page .com-attack-confirm-row,
  body[data-theme="daylight"] .gc-attack-confirm-page .com-attack-confirm-row {
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body[data-theme="nebula"] .gc-attack-confirm-page .com-attack-confirm-main,
  body[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[data-theme="nebula"] .gc-attack-confirm-page .com-attack-confirm-table,
  body[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[data-theme="nebula"] .gc-attack-confirm-page .com-attack-confirm-table td,
  body[data-theme="daylight"] .gc-attack-confirm-page .com-attack-confirm-table td {
    padding: 2px 6px;
    line-height: 1.15;
  }

  body[data-theme="nebula"] .gc-attack-confirm-page .com-attack-confirm-table tr.Header td,
  body[data-theme="daylight"] .gc-attack-confirm-page .com-attack-confirm-table tr.Header td {
    padding-top: 3px;
    padding-bottom: 3px;
  }

  body[data-theme="nebula"] .gc-attack-confirm-page .com-attack-confirm-table td:first-child,
  body[data-theme="daylight"] .gc-attack-confirm-page .com-attack-confirm-table td:first-child {
    width: 42% !important;
    white-space: nowrap;
  }

  body[data-theme="nebula"] .gc-attack-confirm-page .com-attack-confirm-table td:last-child,
  body[data-theme="daylight"] .gc-attack-confirm-page .com-attack-confirm-table td:last-child {
    width: 58% !important;
    overflow-wrap: anywhere;
  }

  body[data-theme="nebula"] .gc-attack-confirm-page .com-attack-confirm-actions,
  body[data-theme="daylight"] .gc-attack-confirm-page .com-attack-confirm-actions {
    margin-top: 0 !important;
    margin-bottom: 4px !important;
  }

  body[data-theme="nebula"] .gc-attack-confirm-page .com-attack-confirm-actions input[type="button"],
  body[data-theme="nebula"] .gc-attack-confirm-page .com-attack-confirm-actions input[type="submit"],
  body[data-theme="daylight"] .gc-attack-confirm-page .com-attack-confirm-actions input[type="button"],
  body[data-theme="daylight"] .gc-attack-confirm-page .com-attack-confirm-actions input[type="submit"] {
    padding-top: 3px;
    padding-bottom: 3px;
  }

  body[data-theme="nebula"] .gc-attack-confirm-page .com-attack-confirm-side,
  body[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[data-theme="nebula"] .gc-attack-confirm-page .com-attack-confirm-side img.pic,
  body[data-theme="daylight"] .gc-attack-confirm-page .com-attack-confirm-side img.pic {
    display: none;
  }

  body[data-theme="nebula"] .gc-attack-confirm-page .com-attack-confirm-spacer,
  body[data-theme="daylight"] .gc-attack-confirm-page .com-attack-confirm-spacer {
    display: none;
  }

  body[data-theme="nebula"] .gc-attack-confirm-page .com-attack-confirm-notes,
  body[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[data-theme="nebula"] .gc-attack-confirm-page .com-attack-confirm-notes br,
  body[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[data-theme="nebula"] .gc-attack-result-page table.Default tr.Header td,
body[data-theme="nebula"] .gc-attack-result-page table.Default tr.Header th,
body[data-theme="daylight"] .gc-attack-result-page table.Default tr.Header td,
body[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[data-theme="nebula"] .gc-attack-result-page .com-attack-result-title,
body[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[data-theme="nebula"] .gc-attack-result-page .com-attack-result-title td,
body[data-theme="daylight"] .gc-attack-result-page .com-attack-result-title td {
  padding: 5px 12px;
  text-align: center;
}

body[data-theme="nebula"] .gc-attack-result-page .com-attack-result-fleets,
body[data-theme="daylight"] .gc-attack-result-page .com-attack-result-fleets {
  margin-left: 0;
  margin-right: 0;
}

body[data-theme="nebula"] .gc-attack-result-page .com-attack-result-fleet-table,
body[data-theme="daylight"] .gc-attack-result-page .com-attack-result-fleet-table,
body[data-theme="nebula"] .gc-attack-result-page .gc-battle-table,
body[data-theme="daylight"] .gc-attack-result-page .gc-battle-table,
body[data-theme="nebula"] .gc-attack-result-page .com-attack-result-log,
body[data-theme="daylight"] .gc-attack-result-page .com-attack-result-log {
  margin-left: auto !important;
  margin-right: auto !important;
}

body[data-theme="nebula"] .gc-attack-result-page .com-attack-result-fleet-table td,
body[data-theme="daylight"] .gc-attack-result-page .com-attack-result-fleet-table td,
body[data-theme="nebula"] .gc-attack-result-page .gc-battle-table td,
body[data-theme="daylight"] .gc-attack-result-page .gc-battle-table td {
  padding-top: 4px;
  padding-bottom: 4px;
}

body[data-theme="nebula"] .gc-attack-result-page .com-attack-result-log-row,
body[data-theme="daylight"] .gc-attack-result-page .com-attack-result-log-row {
  margin-left: 0;
  margin-right: 0;
}

body[data-theme="nebula"] .gc-attack-result-page .com-attack-result-log,
body[data-theme="daylight"] .gc-attack-result-page .com-attack-result-log {
  width: 82% !important;
  max-width: 820px;
  text-align: left !important;
}

body[data-theme="nebula"] .gc-attack-result-page .com-attack-result-log td,
body[data-theme="daylight"] .gc-attack-result-page .com-attack-result-log td {
  padding: 10px 12px;
  line-height: 1.35;
}

body[data-theme="nebula"] .gc-attack-result-page .com-attack-result-log b:first-child,
body[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[data-theme="nebula"] .gc-attack-result-page .com-attack-result-actions,
body[data-theme="daylight"] .gc-attack-result-page .com-attack-result-actions {
  margin-top: 8px !important;
}

@media (min-width: 768px) {
  body[data-theme="nebula"] .gc-attack-result-page .gc-battle-table,
  body[data-theme="daylight"] .gc-attack-result-page .gc-battle-table {
    width: min(88%, 700px) !important;
  }

  body[data-theme="nebula"] .gc-attack-result-page .com-attack-result-fleets,
  body[data-theme="daylight"] .gc-attack-result-page .com-attack-result-fleets {
    width: min(96%, 980px);
    margin-left: auto;
    margin-right: auto;
  }

  body[data-theme="nebula"] .gc-attack-result-page .com-attack-result-fleet-col,
  body[data-theme="daylight"] .gc-attack-result-page .com-attack-result-fleet-col {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  body[data-theme="nebula"] .gc-attack-result-page .com-attack-result-fleet-table,
  body[data-theme="daylight"] .gc-attack-result-page .com-attack-result-fleet-table {
    width: 100% !important;
  }

  body[data-theme="nebula"] .gc-attack-result-page .com-attack-result-log,
  body[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[data-theme="nebula"] .col-lg-8.col-sm-12:has(.gc-attack-result-page),
  body[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[data-theme="nebula"] .gc-attack-result-page,
  body[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[data-theme="nebula"] .gc-attack-result-page .com-attack-result-title,
  body[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[data-theme="nebula"] .gc-attack-result-page .com-attack-result-title td,
  body[data-theme="daylight"] .gc-attack-result-page .com-attack-result-title td {
    padding: 4px 6px;
    text-align: center !important;
    overflow-wrap: anywhere;
  }

  body[data-theme="nebula"] .gc-attack-result-page .com-attack-result-fleets,
  body[data-theme="daylight"] .gc-attack-result-page .com-attack-result-fleets {
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body[data-theme="nebula"] .gc-attack-result-page .com-attack-result-fleet-col,
  body[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[data-theme="nebula"] .gc-attack-result-page .com-attack-result-fleet-table,
  body[data-theme="daylight"] .gc-attack-result-page .com-attack-result-fleet-table,
  body[data-theme="nebula"] .gc-attack-result-page .gc-battle-table,
  body[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[data-theme="nebula"] .gc-attack-result-page .com-attack-result-fleet-table td,
  body[data-theme="daylight"] .gc-attack-result-page .com-attack-result-fleet-table td,
  body[data-theme="nebula"] .gc-attack-result-page .gc-battle-table td,
  body[data-theme="daylight"] .gc-attack-result-page .gc-battle-table td {
    padding: 2px 3px;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  body[data-theme="nebula"] .gc-attack-result-page .com-attack-result-fleet-table tr.Header td,
  body[data-theme="daylight"] .gc-attack-result-page .com-attack-result-fleet-table tr.Header td,
  body[data-theme="nebula"] .gc-attack-result-page .gc-battle-table tr.Header td,
  body[data-theme="daylight"] .gc-attack-result-page .gc-battle-table tr.Header td {
    padding-top: 3px;
    padding-bottom: 3px;
  }

  body[data-theme="nebula"] .gc-attack-result-page .com-attack-result-actions,
  body[data-theme="daylight"] .gc-attack-result-page .com-attack-result-actions {
    margin-top: 2px !important;
    margin-bottom: 4px !important;
  }

  body[data-theme="nebula"] .gc-attack-result-page .com-attack-result-actions input[type="button"],
  body[data-theme="daylight"] .gc-attack-result-page .com-attack-result-actions input[type="button"] {
    padding-top: 3px;
    padding-bottom: 3px;
  }

  body[data-theme="nebula"] .gc-attack-result-page .com-attack-result-log-row,
  body[data-theme="daylight"] .gc-attack-result-page .com-attack-result-log-row {
    margin: 6px 0 0 !important;
  }

  body[data-theme="nebula"] .gc-attack-result-page .com-attack-result-log,
  body[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[data-theme="nebula"] .gc-attack-result-page .com-attack-result-log td,
  body[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[data-theme="nebula"] table.Default.gc-attack-range-table,
  body[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[data-theme="nebula"] table.Default.gc-attack-range-table td,
  body[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[data-theme="nebula"] .gc-sidechat,
body[data-theme="daylight"] .gc-sidechat,
body[data-theme="classic"] .gc-sidechat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
}

body[data-theme="nebula"] .gc-sidechat__controls,
body[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[data-theme="nebula"] .gc-sidechat__controls a,
body[data-theme="daylight"] .gc-sidechat__controls a,
body[data-theme="classic"] .gc-sidechat__controls a {
  display: inline-block;
  padding: 2px 4px;
}

body[data-theme="nebula"] .gc-sidechat__controls span,
body[data-theme="daylight"] .gc-sidechat__controls span,
body[data-theme="classic"] .gc-sidechat__controls span {
  color: var(--text-muted);
}

body[data-theme="nebula"] .gc-sidechat__feed,
body[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[data-theme="nebula"] .gc-sidechat__feed::-webkit-scrollbar,
body[data-theme="daylight"] .gc-sidechat__feed::-webkit-scrollbar,
body[data-theme="classic"] .gc-sidechat__feed::-webkit-scrollbar {
  width: 8px;
}

body[data-theme="nebula"] .gc-sidechat__feed::-webkit-scrollbar-track,
body[data-theme="daylight"] .gc-sidechat__feed::-webkit-scrollbar-track,
body[data-theme="classic"] .gc-sidechat__feed::-webkit-scrollbar-track {
  background: transparent;
}

body[data-theme="nebula"] .gc-sidechat__feed::-webkit-scrollbar-thumb,
body[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[data-theme="nebula"] .gc-sidechat__feed::-webkit-scrollbar-thumb:hover,
body[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[data-theme="nebula"] .gc-sidechat__entry,
body[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[data-theme="nebula"] .gc-sidechat__name,
body[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[data-theme="nebula"] .gc-sidechat__text,
body[data-theme="daylight"] .gc-sidechat__text,
body[data-theme="classic"] .gc-sidechat__text {
  color: inherit;
}

body[data-theme="nebula"] .gc-pm,
body[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[data-theme="nebula"] .gc-pm__title,
body[data-theme="daylight"] .gc-pm__title,
body[data-theme="classic"] .gc-pm__title,
body[data-theme="nebula"] .gc-pm-compose-title,
body[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[data-theme="nebula"] .gc-pm-page-nav,
body[data-theme="daylight"] .gc-pm-page-nav,
body[data-theme="classic"] .gc-pm-page-nav {
  display: none;
}

body[data-theme="nebula"] .gc-pm-page-nav__btn,
body[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[data-theme="nebula"] .gc-pm-page-nav__btn:hover,
body[data-theme="daylight"] .gc-pm-page-nav__btn:hover,
body[data-theme="classic"] .gc-pm-page-nav__btn:hover,
body[data-theme="nebula"] .gc-pm-page-nav__btn--active,
body[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[data-theme="nebula"] .gc-pm-page-nav__btn i,
body[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[data-theme="nebula"] .gc-pm-shell,
body[data-theme="daylight"] .gc-pm-shell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

body[data-theme="nebula"] .gc-pm-bulk,
body[data-theme="daylight"] .gc-pm-bulk {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 2px 0 0;
}

body[data-theme="nebula"] .gc-pm-detail-card__eyebrow,
body[data-theme="daylight"] .gc-pm-detail-card__eyebrow,
body[data-theme="nebula"] .gc-pm-compose__eyebrow,
body[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[data-theme="nebula"] .gc-pm-bulk__actions,
body[data-theme="daylight"] .gc-pm-bulk__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

body[data-theme="nebula"] .gc-pm-bulk__note,
body[data-theme="daylight"] .gc-pm-bulk__note {
  color: var(--text-muted);
  font-size: 11px;
  text-align: left;
}

body[data-theme="nebula"] .gc-pm-toggle,
body[data-theme="daylight"] .gc-pm-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 11px;
}

body[data-theme="nebula"] .gc-pm-button,
body[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[data-theme="nebula"] .gc-pm-button--danger,
body[data-theme="daylight"] .gc-pm-button--danger {
  background: transparent;
  color: var(--accent-hot);
  border-color: rgba(236, 98, 98, 0.45);
}

body[data-theme="nebula"] .gc-pm-button--ghost,
body[data-theme="daylight"] .gc-pm-button--ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

body[data-theme="nebula"] .gc-pm-list,
body[data-theme="daylight"] .gc-pm-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

body[data-theme="nebula"] .gc-pm-card,
body[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[data-theme="nebula"] .gc-pm-card--new,
body[data-theme="daylight"] .gc-pm-card--new {
  border-color: rgba(125, 191, 242, 0.5);
}

body[data-theme="nebula"] .gc-pm-card--replied,
body[data-theme="daylight"] .gc-pm-card--replied {
  border-color: rgba(127, 197, 146, 0.45);
}

body[data-theme="nebula"] .gc-pm-card__select,
body[data-theme="daylight"] .gc-pm-card__select,
body[data-theme="nebula"] .gc-pm-card__status,
body[data-theme="daylight"] .gc-pm-card__status {
  padding-top: 2px;
}

body[data-theme="nebula"] .gc-pm-card__status img,
body[data-theme="daylight"] .gc-pm-card__status img {
  display: block;
  width: auto;
  max-height: 13px;
}

body[data-theme="nebula"] .gc-pm-card__status-dot,
body[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[data-theme="nebula"] .gc-pm-card__body,
body[data-theme="daylight"] .gc-pm-card__body {
  min-width: 0;
}

body[data-theme="nebula"] .gc-pm-card__row,
body[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[data-theme="nebula"] .gc-pm-card__meta,
body[data-theme="daylight"] .gc-pm-card__meta {
  display: block;
  min-width: 0;
}

body[data-theme="nebula"] .gc-pm-card__senderline,
body[data-theme="daylight"] .gc-pm-card__senderline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

body[data-theme="nebula"] .gc-pm-card__sender,
body[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[data-theme="nebula"] .gc-pm-card__sender img,
body[data-theme="daylight"] .gc-pm-card__sender img {
  width: auto;
  max-height: 14px;
}

body[data-theme="nebula"] .gc-pm-card__system,
body[data-theme="daylight"] .gc-pm-card__system {
  color: var(--accent);
}

body[data-theme="nebula"] .gc-pm-card__ghost,
body[data-theme="daylight"] .gc-pm-card__ghost {
  color: var(--text-muted);
}

body[data-theme="nebula"] .gc-pm-card__stamp,
body[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[data-theme="nebula"] .gc-pm-card__preview,
body[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[data-theme="nebula"] .gc-pm-card__preview:hover,
body[data-theme="daylight"] .gc-pm-card__preview:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

body[data-theme="nebula"] .gc-pm-empty,
body[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[data-theme="nebula"] .gc-pm-footer,
body[data-theme="daylight"] .gc-pm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0;
  flex-wrap: wrap;
}

body[data-theme="nebula"] .gc-pm__pager,
body[data-theme="daylight"] .gc-pm__pager {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text-muted);
  font-style: italic;
}

body[data-theme="nebula"] .gc-pm__pager a,
body[data-theme="daylight"] .gc-pm__pager a {
  text-decoration: none;
}

body[data-theme="nebula"] .gc-pm__pager-disabled,
body[data-theme="daylight"] .gc-pm__pager-disabled,
body[data-theme="nebula"] .gc-pm__pager-divider,
body[data-theme="daylight"] .gc-pm__pager-divider {
  color: var(--text-muted);
}

body[data-theme="nebula"] .gc-pm-legend,
body[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[data-theme="nebula"] .gc-pm-legend__title,
body[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[data-theme="nebula"] .gc-pm-legend__item,
body[data-theme="daylight"] .gc-pm-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body[data-theme="nebula"] .gc-pm-legend__item img,
body[data-theme="daylight"] .gc-pm-legend__item img {
  max-height: 14px;
}

body[data-theme="nebula"] .gc-pm-detail-card,
body[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[data-theme="nebula"] .gc-pm-detail-card,
body[data-theme="daylight"] .gc-pm-detail-card {
  background: var(--bg-surface);
}

body[data-theme="nebula"] .gc-pm-detail-card__actions,
body[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[data-theme="nebula"] .gc-pm-detail-card__actions a,
body[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[data-theme="nebula"] .gc-pm-detail-card__actions a:hover,
body[data-theme="daylight"] .gc-pm-detail-card__actions a:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

body[data-theme="nebula"] .gc-pm-detail-card__actions a.gc-pm-action--primary,
body[data-theme="daylight"] .gc-pm-detail-card__actions a.gc-pm-action--primary {
  color: var(--accent);
  border-color: var(--accent);
}

body[data-theme="nebula"] .gc-pm-actions-back,
body[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[data-theme="nebula"] .gc-pm-detail-card__meta,
body[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[data-theme="nebula"] .gc-pm-detail-card__meta-label,
body[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[data-theme="nebula"] .gc-pm-detail-card__meta-value,
body[data-theme="daylight"] .gc-pm-detail-card__meta-value {
  color: var(--text-primary);
  font-size: 12px;
}

body[data-theme="nebula"] .gc-pm-detail-card__status,
body[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[data-theme="nebula"] .gc-pm-detail-card__body,
body[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[data-theme="nebula"] .gc-pm-thread,
body[data-theme="daylight"] .gc-pm-thread {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

body[data-theme="nebula"] .gc-pm-thread__item,
body[data-theme="daylight"] .gc-pm-thread__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 82%;
}

body[data-theme="nebula"] .gc-pm-thread__item--self,
body[data-theme="daylight"] .gc-pm-thread__item--self {
  align-self: flex-end;
  text-align: right;
}

body[data-theme="nebula"] .gc-pm-thread__item--other,
body[data-theme="daylight"] .gc-pm-thread__item--other,
body[data-theme="nebula"] .gc-pm-thread__item--system,
body[data-theme="daylight"] .gc-pm-thread__item--system {
  align-self: flex-start;
  text-align: left;
}

body[data-theme="nebula"] .gc-pm-thread__hdr,
body[data-theme="daylight"] .gc-pm-thread__hdr {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

body[data-theme="nebula"] .gc-pm-thread__author,
body[data-theme="daylight"] .gc-pm-thread__author {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
}

body[data-theme="nebula"] .gc-pm-thread__bubble,
body[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[data-theme="nebula"] .gc-pm-thread__item--self .gc-pm-thread__author,
body[data-theme="daylight"] .gc-pm-thread__item--self .gc-pm-thread__author {
  color: var(--accent);
}

body[data-theme="nebula"] .gc-pm-thread__item--self .gc-pm-thread__bubble,
body[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[data-theme="nebula"] .gc-pm-thread__item--other .gc-pm-thread__author,
body[data-theme="daylight"] .gc-pm-thread__item--other .gc-pm-thread__author,
body[data-theme="nebula"] .gc-pm-thread__item--system .gc-pm-thread__author,
body[data-theme="daylight"] .gc-pm-thread__item--system .gc-pm-thread__author {
  color: var(--accent-cool);
}

body[data-theme="nebula"] .gc-pm-thread__item--other .gc-pm-thread__bubble,
body[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[data-theme="nebula"] .gc-pm-thread__item--system .gc-pm-thread__bubble,
body[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[data-theme="nebula"] .gc-pm-thread__stamp,
body[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[data-theme="nebula"] .gc-pm-quote-block,
body[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[data-theme="nebula"] .gc-pm-quote-gap,
body[data-theme="daylight"] .gc-pm-quote-gap {
  height: 6px;
}

body[data-theme="nebula"] .gc-pm-quote-block__hdr,
body[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[data-theme="nebula"] .gc-pm-quote-block__label,
body[data-theme="daylight"] .gc-pm-quote-block__label {
  color: var(--text-muted);
}

body[data-theme="nebula"] .gc-pm-quote-block__body,
body[data-theme="daylight"] .gc-pm-quote-block__body {
  line-height: 1.4;
}

body[data-theme="nebula"] .gc-pm-quote-block__author,
body[data-theme="daylight"] .gc-pm-quote-block__author {
  font-weight: 700;
  letter-spacing: 0.04em;
}

body[data-theme="nebula"] .gc-pm-quote-block--self,
body[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[data-theme="nebula"] .gc-pm-quote-block--self .gc-pm-quote-block__author,
body[data-theme="daylight"] .gc-pm-quote-block--self .gc-pm-quote-block__author {
  color: var(--accent);
}

body[data-theme="nebula"] .gc-pm-quote-block--other,
body[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[data-theme="nebula"] .gc-pm-quote-block--other .gc-pm-quote-block__author,
body[data-theme="daylight"] .gc-pm-quote-block--other .gc-pm-quote-block__author {
  color: var(--accent-cool);
}

body[data-theme="nebula"] .gc-pm-quote-block--depth-2,
body[data-theme="daylight"] .gc-pm-quote-block--depth-2 {
  filter: saturate(0.92);
}

body[data-theme="nebula"] .gc-pm-quote-block--depth-3,
body[data-theme="daylight"] .gc-pm-quote-block--depth-3,
body[data-theme="nebula"] .gc-pm-quote-block--depth-4,
body[data-theme="daylight"] .gc-pm-quote-block--depth-4,
body[data-theme="nebula"] .gc-pm-quote-block--depth-5,
body[data-theme="daylight"] .gc-pm-quote-block--depth-5 {
  filter: saturate(0.84) brightness(0.96);
}

body[data-theme="nebula"] .gc-pm-compose,
body[data-theme="daylight"] .gc-pm-compose {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(100%, 980px);
  margin: 0 auto;
}

body[data-theme="nebula"] .gc-pm-compose__panel,
body[data-theme="daylight"] .gc-pm-compose__panel,
body[data-theme="nebula"] .gc-pm-compose__quote,
body[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[data-theme="nebula"] .gc-pm-compose__panel,
body[data-theme="daylight"] .gc-pm-compose__panel {
  padding: 16px;
}

body[data-theme="nebula"] .gc-pm-compose__heading,
body[data-theme="daylight"] .gc-pm-compose__heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

body[data-theme="nebula"] .gc-pm-compose__title,
body[data-theme="daylight"] .gc-pm-compose__title {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.1;
}

body[data-theme="nebula"] .gc-pm-compose__grid,
body[data-theme="daylight"] .gc-pm-compose__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

body[data-theme="nebula"] .gc-pm-compose__field,
body[data-theme="daylight"] .gc-pm-compose__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body[data-theme="nebula"] .gc-pm-compose__field > span,
body[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[data-theme="nebula"] .gc-pm-compose__field input[type="text"],
body[data-theme="nebula"] .gc-pm-compose__field select,
body[data-theme="nebula"] .gc-pm-compose__textarea,
body[data-theme="daylight"] .gc-pm-compose__field input[type="text"],
body[data-theme="daylight"] .gc-pm-compose__field select,
body[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[data-theme="nebula"] .gc-pm-compose__textarea,
body[data-theme="daylight"] .gc-pm-compose__textarea {
  min-height: 220px;
  resize: vertical;
  line-height: 1.5;
}

body[data-theme="nebula"] .gc-pm-compose__footer,
body[data-theme="daylight"] .gc-pm-compose__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

body[data-theme="nebula"] .gc-pm-compose__counter,
body[data-theme="daylight"] .gc-pm-compose__counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

body[data-theme="nebula"] .gc-pm-compose__counter input,
body[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[data-theme="nebula"] .gc-pm-compose__actions,
body[data-theme="daylight"] .gc-pm-compose__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

body[data-theme="nebula"] .gc-pm-compose__quote,
body[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[data-theme="nebula"] .gc-pm-compose__quote-label,
body[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[data-theme="nebula"] .gc-pm-compose__quote-body,
body[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[data-theme="nebula"] .gc-pm-book,
body[data-theme="daylight"] .gc-pm-book {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body[data-theme="nebula"] .gc-pm-book__alert,
body[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[data-theme="nebula"] .gc-pm-book__panel,
body[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[data-theme="nebula"] .gc-pm-book__heading,
body[data-theme="daylight"] .gc-pm-book__heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

body[data-theme="nebula"] .gc-pm-book__title,
body[data-theme="daylight"] .gc-pm-book__title {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.1;
}

body[data-theme="nebula"] .gc-pm-book__grid,
body[data-theme="daylight"] .gc-pm-book__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body[data-theme="nebula"] .gc-pm-book__actions,
body[data-theme="daylight"] .gc-pm-book__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

body[data-theme="nebula"] .gc-pm-book__list,
body[data-theme="daylight"] .gc-pm-book__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body[data-theme="nebula"] .gc-pm-book__item,
body[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[data-theme="nebula"] .gc-pm-book__identity,
body[data-theme="daylight"] .gc-pm-book__identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

body[data-theme="nebula"] .gc-pm-book__intel,
body[data-theme="daylight"] .gc-pm-book__intel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  flex: 0 0 auto;
}

body[data-theme="nebula"] .gc-pm-book__name,
body[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[data-theme="nebula"] .gc-pm-book__name a,
body[data-theme="daylight"] .gc-pm-book__name a {
  color: var(--text-primary);
  text-decoration: none;
}

body[data-theme="nebula"] .gc-pm-book__name a:hover,
body[data-theme="daylight"] .gc-pm-book__name a:hover {
  color: var(--accent);
  text-decoration: none;
}

body[data-theme="nebula"] .gc-pm-book__item-actions,
body[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[data-theme="nebula"] .gc-pm,
  body[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[data-theme="nebula"] .gc-pm__title,
  body[data-theme="daylight"] .gc-pm__title,
  body[data-theme="classic"] .gc-pm__title,
  body[data-theme="nebula"] .gc-pm-compose-title,
  body[data-theme="daylight"] .gc-pm-compose-title {
    margin-bottom: 6px;
    font-size: 14px;
  }

  body[data-theme="nebula"] .gc-pm-page-nav,
  body[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[data-theme="nebula"] .gc-pm-page-nav__btn,
  body[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[data-theme="nebula"] .gc-pm-bulk,
  body[data-theme="daylight"] .gc-pm-bulk,
  body[data-theme="nebula"] .gc-pm-footer,
  body[data-theme="daylight"] .gc-pm-footer,
  body[data-theme="nebula"] .gc-pm-compose__footer,
  body[data-theme="daylight"] .gc-pm-compose__footer {
    flex-direction: column;
    align-items: stretch;
  }

  body[data-theme="nebula"] .gc-pm-bulk,
  body[data-theme="daylight"] .gc-pm-bulk {
    padding: 0;
  }

  body[data-theme="nebula"] .gc-pm-shell,
  body[data-theme="daylight"] .gc-pm-shell,
  body[data-theme="classic"] .gc-pm__tablewrap,
  body[data-theme="nebula"] .gc-pm-list,
  body[data-theme="daylight"] .gc-pm-list,
  body[data-theme="nebula"] .gc-pm-footer,
  body[data-theme="daylight"] .gc-pm-footer {
    width: 100%;
    box-sizing: border-box;
  }

  body[data-theme="nebula"] .gc-pm-bulk__note,
  body[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[data-theme="nebula"] .gc-pm-card,
  body[data-theme="daylight"] .gc-pm-card {
    grid-template-columns: 18px 18px minmax(0, 1fr);
    gap: 6px;
    padding: 4px 7px;
  }

  body[data-theme="nebula"] .gc-pm-list,
  body[data-theme="daylight"] .gc-pm-list {
    padding-inline: 2px;
  }

  body[data-theme="nebula"] .gc-pm-card__row,
  body[data-theme="daylight"] .gc-pm-card__row {
    display: block;
  }

  body[data-theme="nebula"] .gc-pm-card__meta,
  body[data-theme="daylight"] .gc-pm-card__meta {
    margin-bottom: 3px;
  }

  body[data-theme="nebula"] .gc-pm-card__senderline,
  body[data-theme="daylight"] .gc-pm-card__senderline {
    flex-wrap: wrap;
    gap: 3px 6px;
  }

  body[data-theme="nebula"] .gc-pm-card__stamp,
  body[data-theme="daylight"] .gc-pm-card__stamp {
    align-items: flex-start;
    gap: 6px;
  }

  body[data-theme="nebula"] .gc-pm-card__sender,
  body[data-theme="daylight"] .gc-pm-card__sender,
  body[data-theme="nebula"] .gc-pm-card__preview,
  body[data-theme="daylight"] .gc-pm-card__preview {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body[data-theme="nebula"] .gc-pm-detail-card,
  body[data-theme="daylight"] .gc-pm-detail-card {
    border-radius: var(--radius-md);
  }

  body[data-theme="nebula"] .gc-pm-detail-card,
  body[data-theme="daylight"] .gc-pm-detail-card {
    margin-top: 0;
  }

  body[data-theme="nebula"] .gc-pm-compose__panel,
  body[data-theme="daylight"] .gc-pm-compose__panel,
  body[data-theme="nebula"] .gc-pm-compose__quote,
  body[data-theme="daylight"] .gc-pm-compose__quote {
    padding: 12px;
  }

  body[data-theme="nebula"] .gc-pm-compose__title,
  body[data-theme="daylight"] .gc-pm-compose__title {
    font-size: 18px;
  }

  body[data-theme="nebula"] .gc-pm-detail-card__body,
  body[data-theme="daylight"] .gc-pm-detail-card__body {
    padding: 12px 10px;
    font-size: 13px;
  }

  body[data-theme="nebula"] .gc-pm-thread__item,
  body[data-theme="daylight"] .gc-pm-thread__item {
    max-width: 92%;
  }

  body[data-theme="nebula"] .gc-pm-thread__hdr,
  body[data-theme="daylight"] .gc-pm-thread__hdr {
    gap: 5px;
    flex-wrap: wrap;
  }

  body[data-theme="nebula"] .gc-pm-detail-card__meta,
  body[data-theme="daylight"] .gc-pm-detail-card__meta {
    gap: 4px 8px;
    padding: 8px 10px;
  }

  body[data-theme="nebula"] .gc-pm-detail-card__actions,
  body[data-theme="daylight"] .gc-pm-detail-card__actions {
    padding: 7px 10px;
    gap: 5px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body[data-theme="nebula"] .gc-pm-detail-card__actions a,
  body[data-theme="daylight"] .gc-pm-detail-card__actions a {
    flex-shrink: 0;
    font-size: 10px;
    padding: 3px 8px;
  }

  body[data-theme="nebula"] .gc-pm-quote-block__hdr,
  body[data-theme="daylight"] .gc-pm-quote-block__hdr {
    gap: 6px;
    flex-wrap: wrap;
  }

  body[data-theme="nebula"] .gc-pm-compose__grid,
  body[data-theme="daylight"] .gc-pm-compose__grid {
    grid-template-columns: 1fr;
  }

  body[data-theme="nebula"] .gc-pm-compose__textarea,
  body[data-theme="daylight"] .gc-pm-compose__textarea {
    min-height: 170px;
  }

  body[data-theme="nebula"] .gc-pm-compose__actions,
  body[data-theme="daylight"] .gc-pm-compose__actions {
    width: 100%;
    justify-content: stretch;
  }

  body[data-theme="nebula"] .gc-pm-compose__actions .gc-pm-button,
  body[data-theme="daylight"] .gc-pm-compose__actions .gc-pm-button {
    width: 100%;
  }

  body[data-theme="nebula"] .gc-pm-book__panel,
  body[data-theme="daylight"] .gc-pm-book__panel,
  body[data-theme="nebula"] .gc-pm-book__alert,
  body[data-theme="daylight"] .gc-pm-book__alert {
    padding: 12px;
  }

  body[data-theme="nebula"] .gc-pm-book__grid,
  body[data-theme="daylight"] .gc-pm-book__grid {
    grid-template-columns: 1fr;
  }

  body[data-theme="nebula"] .gc-pm-book__item,
  body[data-theme="daylight"] .gc-pm-book__item {
    flex-direction: column;
    align-items: stretch;
  }

  body[data-theme="nebula"] .gc-pm-book__item-actions,
  body[data-theme="daylight"] .gc-pm-book__item-actions {
    justify-content: stretch;
  }

  body[data-theme="nebula"] .gc-pm-book__item-actions .gc-pm-button,
  body[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[data-theme="nebula"] .gc-redeem-projects,
body[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[data-theme="nebula"] .gc-redeem-projects__header td,
body[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[data-theme="nebula"] .gc-redeem-projects__row td,
body[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[data-theme="nebula"] .gc-redeem-projects__row:nth-child(even) td,
body[data-theme="daylight"] .gc-redeem-projects__row:nth-child(even) td {
  background: rgba(125, 191, 242, 0.035);
}

body[data-theme="nebula"] .gc-redeem-projects__row:hover td,
body[data-theme="daylight"] .gc-redeem-projects__row:hover td {
  background: var(--bg-elevated);
}

body[data-theme="nebula"] .gc-redeem-projects__project a,
body[data-theme="daylight"] .gc-redeem-projects__project a {
  color: var(--accent);
  font-weight: 500;
}

body[data-theme="nebula"] .gc-redeem-projects__project a:hover,
body[data-theme="daylight"] .gc-redeem-projects__project a:hover,
body[data-theme="nebula"] .gc-redeem-projects__project a:focus,
body[data-theme="daylight"] .gc-redeem-projects__project a:focus {
  color: var(--accent-hover);
}

body[data-theme="nebula"] .gc-redeem-projects__cost,
body[data-theme="daylight"] .gc-redeem-projects__cost {
  color: var(--text-primary);
}

body[data-theme="nebula"] .gc-project-tooltip__float,
body[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[data-theme="nebula"] .gc-project-tooltip__float::before,
body[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[data-theme="nebula"] .gc-redeem-transfer,
body[data-theme="daylight"] .gc-redeem-transfer {
  width: min(100%, 32rem) !important;
  margin: 0 auto !important;
  box-shadow: var(--shadow-md);
}

body[data-theme="nebula"] .gc-redeem-transfer td,
body[data-theme="daylight"] .gc-redeem-transfer td {
  padding: 12px 14px;
}

body[data-theme="nebula"] .gc-redeem-transfer__form,
body[data-theme="daylight"] .gc-redeem-transfer__form {
  display: grid;
  grid-template-columns: 1fr 1.35fr auto;
  align-items: end;
  gap: 10px;
  margin: 0;
}

body[data-theme="nebula"] .gc-redeem-transfer__field,
body[data-theme="daylight"] .gc-redeem-transfer__field {
  display: grid;
  gap: 4px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
  text-align: left;
}

body[data-theme="nebula"] .gc-redeem-transfer__field span,
body[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[data-theme="nebula"] .gc-redeem-transfer__field input[type="text"],
body[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[data-theme="nebula"] .gc-redeem-transfer__submit,
body[data-theme="daylight"] .gc-redeem-transfer__submit {
  min-width: 96px;
}

@media (max-width: 640px) {
  body[data-theme="nebula"] .gc-redeem-transfer,
  body[data-theme="daylight"] .gc-redeem-transfer {
    width: calc(100% - 12px) !important;
  }

  body[data-theme="nebula"] .gc-redeem-transfer__form,
  body[data-theme="daylight"] .gc-redeem-transfer__form {
    grid-template-columns: 1fr;
  }

  body[data-theme="nebula"] .gc-redeem-transfer__submit,
  body[data-theme="daylight"] .gc-redeem-transfer__submit {
    justify-self: center;
  }
}

/* -------------------------------------------------------------------------
   Users online popup (`pop_useronline.cfm`) + sidebar subtitle (`i_f_800`)
-------------------------------------------------------------------------- */

body[data-theme="nebula"] .modern-public.is-popup .modern-content,
body[data-theme="daylight"] .modern-public.is-popup .modern-content {
  padding: 10px 12px 14px !important;
  max-width: 32rem;
  margin: 0 auto;
}

body[data-theme="nebula"] .gc-sidebar-online-sub,
body[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[data-theme="nebula"] .gc-useronline-popup,
body[data-theme="daylight"] .gc-useronline-popup {
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
}

body[data-theme="nebula"] .gc-useronline-popup__toolbar,
body[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[data-theme="nebula"] .gc-useronline-popup__title,
body[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[data-theme="nebula"] .gc-useronline-popup__close,
body[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[data-theme="nebula"] .gc-useronline-popup__close:hover,
body[data-theme="daylight"] .gc-useronline-popup__close:hover {
  border-color: var(--accent);
}

body[data-theme="nebula"] .gc-useronline-popup__stats,
body[data-theme="daylight"] .gc-useronline-popup__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

@media (max-width: 520px) {
  body[data-theme="nebula"] .gc-useronline-popup__stats,
  body[data-theme="daylight"] .gc-useronline-popup__stats {
    grid-template-columns: 1fr;
  }
}

body[data-theme="nebula"] .gc-useronline-popup__stat,
body[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[data-theme="nebula"] .gc-useronline-popup__stat--live,
body[data-theme="daylight"] .gc-useronline-popup__stat--live {
  border-top: 3px solid var(--accent-good);
}

body[data-theme="nebula"] .gc-useronline-popup__stat--day,
body[data-theme="daylight"] .gc-useronline-popup__stat--day {
  border-top: 3px solid var(--accent);
}

body[data-theme="nebula"] .gc-useronline-popup__stat-label,
body[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[data-theme="nebula"] .gc-useronline-popup__stat-value,
body[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[data-theme="nebula"] .gc-useronline-popup__stat-hint,
body[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[data-theme="nebula"] .gc-useronline-popup__list-head,
body[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[data-theme="nebula"] .gc-useronline-popup__grid,
body[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[data-theme="nebula"] .gc-useronline-popup__grid,
  body[data-theme="daylight"] .gc-useronline-popup__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

body[data-theme="nebula"] .gc-useronline-popup__cell,
body[data-theme="daylight"] .gc-useronline-popup__cell {
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}

body[data-theme="nebula"] .gc-useronline-popup__name,
body[data-theme="daylight"] .gc-useronline-popup__name {
  display: block;
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
}

body[data-theme="nebula"] .gc-useronline-popup__name:hover,
body[data-theme="daylight"] .gc-useronline-popup__name:hover {
  color: var(--link-hover);
}

body[data-theme="nebula"] .gc-useronline-popup__server,
body[data-theme="daylight"] .gc-useronline-popup__server {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

body[data-theme="nebula"] .gc-useronline-popup__trunc,
body[data-theme="daylight"] .gc-useronline-popup__trunc,
body[data-theme="nebula"] .gc-useronline-popup__empty,
body[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[data-theme="nebula"] .gc-rtreed-page,
body[data-theme="daylight"] .gc-rtreed-page {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 4px 0 16px;
}

body[data-theme="nebula"] .gc-rtreed-hero,
body[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[data-theme="nebula"] .gc-rtreed-hero__eyebrow,
body[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[data-theme="nebula"] .gc-rtreed-hero__title,
body[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[data-theme="nebula"] .gc-rtreed-hero__meta,
body[data-theme="daylight"] .gc-rtreed-hero__meta {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

body[data-theme="nebula"] table.Default.gc-rtreed-table,
body[data-theme="daylight"] table.Default.gc-rtreed-table {
  width: min(100%, 980px) !important;
  margin: 0 auto;
  table-layout: fixed;
}

body[data-theme="nebula"] table.Default.gc-rtreed-table tr.Header td,
body[data-theme="daylight"] table.Default.gc-rtreed-table tr.Header td {
  text-align: center;
}

body[data-theme="nebula"] table.Default.gc-rtreed-table tbody td,
body[data-theme="daylight"] table.Default.gc-rtreed-table tbody td {
  padding-top: 6px;
  padding-bottom: 6px;
}

body[data-theme="nebula"] table.Default.gc-rtreed-table tbody tr > td:nth-child(1),
body[data-theme="daylight"] table.Default.gc-rtreed-table tbody tr > td:nth-child(1) {
  width: 52%;
}

body[data-theme="nebula"] table.Default.gc-rtreed-table tbody tr > td:nth-child(2),
body[data-theme="daylight"] table.Default.gc-rtreed-table tbody tr > td:nth-child(2) {
  width: 28%;
}

body[data-theme="nebula"] table.Default.gc-rtreed-table tbody tr > td:nth-child(3),
body[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[data-theme="nebula"] .gc-rtreed-table__link,
body[data-theme="daylight"] .gc-rtreed-table__link {
  color: var(--link);
  font-weight: 700;
  text-decoration: none;
}

body[data-theme="nebula"] .gc-rtreed-table__link:hover,
body[data-theme="daylight"] .gc-rtreed-table__link:hover {
  color: var(--link-hover);
}

body[data-theme="nebula"] .gc-rtreed-empty,
body[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[data-theme="nebula"] .gc-rtreed-actions,
body[data-theme="daylight"] .gc-rtreed-actions {
  margin: 16px 0 0;
  text-align: center;
}

@media (max-width: 767.98px) {
  body[data-theme="nebula"] .gc-rtreed-page,
  body[data-theme="daylight"] .gc-rtreed-page {
    padding-bottom: 12px;
    overflow-x: hidden;
  }

  body[data-theme="nebula"] .gc-rtreed-hero,
  body[data-theme="daylight"] .gc-rtreed-hero,
  body[data-theme="nebula"] table.Default.gc-rtreed-table,
  body[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[data-theme="nebula"] .gc-rtreed-hero,
  body[data-theme="daylight"] .gc-rtreed-hero {
    padding: 14px 14px 15px;
    margin-bottom: 10px;
  }

  body[data-theme="nebula"] .gc-rtreed-hero__title,
  body[data-theme="daylight"] .gc-rtreed-hero__title {
    font-size: clamp(16px, 5.5vw, 20px);
  }

  body[data-theme="nebula"] table.Default.gc-rtreed-table,
  body[data-theme="daylight"] table.Default.gc-rtreed-table {
    display: table !important;
    overflow-x: visible;
    table-layout: fixed;
  }

  body[data-theme="nebula"] table.Default.gc-rtreed-table thead,
  body[data-theme="daylight"] table.Default.gc-rtreed-table thead {
    display: table-header-group !important;
  }

  body[data-theme="nebula"] table.Default.gc-rtreed-table tbody,
  body[data-theme="daylight"] table.Default.gc-rtreed-table tbody {
    display: table-row-group !important;
  }

  body[data-theme="nebula"] table.Default.gc-rtreed-table tr,
  body[data-theme="daylight"] table.Default.gc-rtreed-table tr {
    display: table-row !important;
  }

  body[data-theme="nebula"] table.Default.gc-rtreed-table td,
  body[data-theme="nebula"] table.Default.gc-rtreed-table th,
  body[data-theme="daylight"] table.Default.gc-rtreed-table td,
  body[data-theme="daylight"] table.Default.gc-rtreed-table th {
    display: table-cell !important;
    box-sizing: border-box;
    min-width: 0;
  }

  body[data-theme="nebula"] table.Default.gc-rtreed-table tr.Header td,
  body[data-theme="daylight"] table.Default.gc-rtreed-table tr.Header td {
    font-size: 10px;
  }

  body[data-theme="nebula"] table.Default.gc-rtreed-table tbody td,
  body[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[data-theme="nebula"] table.Default.gc-rtreed-table tbody tr > td:nth-child(1),
  body[data-theme="daylight"] table.Default.gc-rtreed-table tbody tr > td:nth-child(1) {
    width: 50%;
  }

  body[data-theme="nebula"] table.Default.gc-rtreed-table tbody tr > td:nth-child(2),
  body[data-theme="daylight"] table.Default.gc-rtreed-table tbody tr > td:nth-child(2) {
    width: 28%;
  }

  body[data-theme="nebula"] table.Default.gc-rtreed-table tbody tr > td:nth-child(3),
  body[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;
}
