:root{
  --df-bg:       #dbd3be;   /* page background */
  --df-surface:     #225522;   /* card gradient start */
  --df-surface-alt:   #122c12;   /* card gradient end */
  --df-border-subtle: #31384b;   /* subtle border */
  --df-text-dark:      rgb(24, 24, 27);   /* primary text */
  --df-text-light:      #dbd3be;   /* primary text */
  --df-text-muted:    #6d6f80;   /* secondary text */
  --df-accent:   #225536;   /* azure */
  --df-accent-soft: #e2f1e7;   /* deep navy */
  --df-accent-contrast:     #0f2a1a;   /* lines/borders */
  --df-GoblinGold:     #cdec1e;   /* lines/borders */
  --df-GoblinGold--alt:     #839713;   /* lines/borders */

  --color-good: #39c46b;
  --color-bad: #e05252;
  --color-neutral-chip: #38405a;

  --df-radius: 16px;
  --df-shadow: 0 6px 20px rgba(0,0,0,.3);
  --df-col-w: clamp(260px, 85vw, 340px); /* per-round width on mobile */
  --df-gap: 16px;
  --app-shell-max-width: 1440px;
  --app-shell-gutter: clamp(14px, 2vw, 26px);
}


.tg-standalone {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Tool header: compact toolbar strip, not a card -- title + mode toggle
   grouped on one side, share action a quiet outline button on the other. */
.tg-standalone__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(34, 85, 34, 0.25);
}

.tg-standalone__header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.tg-standalone__title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 1.25rem;
}

.tg-mode-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tg-mode-toggle__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--df-text-dark);
  opacity: 0.7;
}

/* JS (applyModeToToggle) toggles Bootstrap's .text-cream/.text-light on these
   labels for active/inactive state; both assume a dark-green backdrop.
   Repoint them to read on the header's parchment background instead of
   editing the global utility classes. */
.tg-mode-toggle__label.text-cream {
  color: var(--df-accent-contrast) !important;
  opacity: 1;
}

.tg-mode-toggle__label.text-light {
  color: var(--df-text-dark) !important;
  opacity: 0.55;
}

.tg-share-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.tg-share-link__btn {
  background: transparent;
  color: var(--df-accent-contrast);
  border: 1px solid var(--df-accent);
  border-radius: 8px;
  padding: 0.45rem 0.9rem;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  min-height: 36px;
}

.tg-share-link__btn:hover,
.tg-share-link__btn:focus {
  background: var(--df-accent-contrast);
  color: var(--df-text-light);
  border-color: var(--df-accent-contrast);
}

.tg-share-link__status {
  min-height: 1.2em;
}

/* JS toggles .text-cream/.text-warning on this element for ok/error states;
   both assume a dark-green backdrop. Repoint them to read on the header's
   parchment background instead of editing the global utility classes. */
.tg-share-link__status.text-cream {
  color: var(--df-accent-contrast) !important;
}

.tg-share-link__status.text-warning {
  color: var(--color-bad) !important;
}

@media (max-width: 575.98px) {
  .tg-share-link {
    width: 100%;
    justify-content: space-between;
  }
}

/* standaloneTradeGrader.js's showHandoffNote() appends a plain
   `.text-cream small` <p> into the header for "loaded from another page"
   messaging; that class assumes a dark-green backdrop, so repoint it here
   instead of editing the JS. Full width so it wraps onto its own line. */
.tg-standalone__header [data-handoff-note] {
  width: 100%;
  margin: 0.25rem 0 0;
  color: var(--df-accent-contrast) !important;
}

/* Darker Fantasy Goblin green (matches alt_bg / the header) instead of the
   shared .trade-grader-filter-panel's lighter --df-surface. Page-scoped via
   the data attribute -- the shared component's rule in style.css is
   untouched, so Rankings/Trade Center/Trade Finder are unaffected. */
.trade-grader-filter-panel[data-standalone-pos-adj] {
  background: linear-gradient(180deg, var(--df-accent-contrast), var(--df-accent));
  color: var(--df-text-light);
}

/* League Trade Center's Grader tab -- same treatment as the standalone panel
   above, scoped to its own data attribute so the shared .trade-grader-filter-panel
   rule in style.css stays untouched for every other user of that class. */
.trade-grader-filter-panel[data-league-grader-pos-adj] {
  background: linear-gradient(180deg, var(--df-accent-contrast), var(--df-accent));
  color: var(--df-text-light);
}

/* League Trade Center's Finder tab -- matches the Grader tab's positional-
   adjustment surface above (same disclosure structure, same background),
   scoped to its own data attribute so the Grader rule above and the shared
   .trade-grader-filter-panel rule in style.css both stay untouched. */
.trade-grader-filter-panel[data-league-finder-pos-adj] {
  background: linear-gradient(180deg, var(--df-accent-contrast), var(--df-accent));
  color: var(--df-text-light);
}

/* League Trade Center's History (list) tab -- same disclosure structure and
   background as the Grader/Finder rules above, scoped to its own data
   attribute so none of the other .trade-grader-filter-panel rules change. */
.trade-grader-filter-panel[data-league-history-pos-adj] {
  background: linear-gradient(180deg, var(--df-accent-contrast), var(--df-accent));
  color: var(--df-text-light);
}

/* Sides container is layout-only now -- Side A/Side B below are the primary
   dark-green surfaces, so this just provides the grid + gap between them. */
.tg-standalone__sides {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .tg-standalone__sides {
    grid-template-columns: 1fr 1fr;
  }
}

.tg-side {
  background: linear-gradient(180deg, var(--df-accent-contrast), var(--df-accent));
  color: var(--df-text-light);
  border-radius: 0.5rem;
  padding: 1rem;
}

/* League Trade Center's Grader tab -- Team A/Team B as their own primary
   dark-green surfaces (same gradient family as .tg-side above), scoped to
   [data-trade-picker] since that attribute is unique to the grader's two
   sides (Finder's asset picker uses data-offer-finder-picker instead, so
   this rule cannot leak into it). Existing .trade-asset-picker layout rules
   in style.css are untouched. */
[data-trade-picker] {
  background: linear-gradient(180deg, var(--df-accent-contrast), var(--df-accent));
  color: var(--df-text-light);
  border-radius: 0.5rem;
  padding: 1rem;
}

.tg-side__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.tg-side__head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.tg-side__rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tg-asset-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.9fr) auto;
  gap: 0.4rem;
  align-items: center;
}

.tg-settings {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0.5rem;
  padding: 1rem;
}

.tg-settings__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.tg-settings__row label {
  min-width: 9rem;
}

.tg-settings__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tg-settings__advanced {
  margin-top: 0.75rem;
}

.tg-result {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0.5rem;
  padding: 1rem;
}

.tg-result__totals {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.tg-result__verdict {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 0.75rem;
}

.tg-result__warning {
  margin-top: 0.5rem;
  color: #ffd47a;
}

.tg-result__section {
  margin-bottom: 1rem;
}

.tg-result__section h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: #c9c9c9;
}

.tg-result__section p {
  margin-bottom: 0.3rem;
}

.tg-package-pressure summary {
  cursor: pointer;
  list-style: none;
}

.tg-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #ffd47a;
  border: 1px solid rgba(255, 212, 122, 0.5);
  border-radius: 0.3rem;
  padding: 0.1rem 0.4rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.tg-side__add-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.tg-asset-search {
  position: relative;
  flex: 1;
  min-width: 0;
}

.tg-asset-search__results {
  position: absolute;
  top: calc(100% + 0.3rem);
  left: 0;
  right: 0;
  z-index: 5;
  max-height: 16rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: var(--df-surface-alt);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  padding: 0.4rem;
}

.tg-asset-search__result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.4rem;
  background: var(--df-text-light);
  color: var(--df-surface);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tg-asset-search__result:hover {
  border-color: var(--df-GoblinGold);
  background: var(--df-surface);
  color: var(--df-text-light);
} 


/* Pick rows merged into the player search dropdown (standaloneTradeGrader.js's
   buildResultRow) -- a subtle left accent is enough to tell them apart from
   player rows without a second list/section. */
.tg-asset-search__result--pick {
  border-left: 2px solid var(--df-GoblinGold);
}

/* Known player, no value on either board — shown for context, not selectable. */
.tg-asset-search__result--unranked {
  cursor: default;
  opacity: 0.65;
}

.tg-asset-search__result--unranked:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: var(--df-surface-alt);
}

.tg-asset-search__empty {
  padding: 0.4rem 0.6rem;
  color: #c9c9c9;
}

.tg-side__chips {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.tg-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  padding: 0.5rem 0.7rem;
  background: var(--df-text-light);
  color: var(--df-surface);
}

.tg-chip__copy {
  min-width: 0;
}

.tg-chip__label {
  font-weight: 600;
}

.tg-chip__meta {
  font-size: 0.85rem;
  color: var(--df-text-dark);
}

.tg-chip__remove {
  flex-shrink: 0;
}

.tg-side__manual {
  margin-top: 0.5rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  padding-top: 0.5rem;
}

.tg-side__manual summary {
  cursor: pointer;
  color: #c9c9c9;
  font-size: 0.9rem;
}

/* Result section polish: asset breakdown rows for the Trade Summary / Base
   Comparison / Added Compensation panels. No status-badge coloring here --
   the Grader result is a neutral value comparison, not a graded outcome. */

.tg-asset-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.15rem 0;
}

.tg-asset-line__tag {
  font-size: 0.75rem;
  color: var(--df-text-muted);
  white-space: nowrap;
}

/* Trade Summary + target-range gauge: sits above the collapsible Detailed
   breakdown. Neutral value-comparison presentation -- no good/bad coloring. */
.tg-quick-summary {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.tg-quick-summary__title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--df-text-muted);
}

.tg-quick-summary__row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tg-quick-summary__label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--df-text-muted);
  min-width: 4.5rem;
}

.tg-gauge {
  margin-bottom: 1rem;
}

.tg-gauge__track {
  position: relative;
  height: 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  margin: 1.4rem 0 0.3rem;
}

/* Target band -- shows WHERE the target range sits on the fixed 0x-4x
   scale. Neutral parchment/gold tint (not green) so it reads as "this is
   the range being measured," not "this is the good zone." */
.tg-gauge__zone {
  position: absolute;
  top: 0;
  height: 100%;
  background: rgba(219, 211, 190, 0.22);
  border-radius: 999px;
}

.tg-gauge__mid {
  position: absolute;
  top: -0.15rem;
  width: 2px;
  height: calc(100% + 0.3rem);
  background: var(--df-GoblinGold);
  transform: translateX(-1px);
}

/* Single neutral marker style -- no per-zone color (previously
   light/in_range/centered/above_target/wrong_side each recolored this dot
   amber/green/gold/red, implying a pass/fail read on top of its position). */
.tg-gauge__marker {
  position: absolute;
  top: 50%;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  border: 2px solid var(--df-text-light);
  background: var(--color-neutral-chip);
  transform: translate(-50%, -50%);
}

.tg-gauge__marker-label {
  position: absolute;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--df-text-light);
}

.tg-gauge__ticks {
  position: relative;
  height: 1rem;
  font-size: 0.7rem;
  color: var(--df-text-muted);
}

.tg-gauge__tick {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
}

.tg-gauge__caption {
  margin-top: 0.3rem;
}

.tg-result__breakdown summary {
  font-weight: 600;
}

/* Logged-out rankings notice — quiet inline text under the header, only
   rendered by the EJS when currentUser is falsy. No card, no alt_bg. */
.tg-grader-notice {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--df-text-muted);
}

.tg-grader-notice__eyebrow {
  color: var(--df-accent-contrast);
  font-weight: 700;
}

.tg-grader-notice__link {
  color: var(--df-accent-contrast);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tg-grader-notice__link:hover,
.tg-grader-notice__link:focus {
  color: var(--df-GoblinGold--alt);
}
