/* Shared with TornTraders (same file, same tokens) - styled after Torn's dark mode:
   gradient title bars, grey gradient buttons, dense Arial type, a left "Areas"
   sidebar and green money. RaffleHub-only rules are at the end. */
:root {
  --bg: #191919;
  --bg-2: #222;
  --box: #333;
  --box-2: #2e2e2e;
  --row-alt: #2a2a2a;
  --line: #444;
  --line-dark: #111;
  --text: #ddd;
  --text-hi: #fff;
  --muted: #999;
  --link: #74b3e8;
  --money: #9bc53d;
  --green: #85b200;
  --red: #ef5b4c;
  --yellow: #f0b90b;
  --blue: #5aa9e6;
  --star: #f5c518;
  --radius: 5px;
  /* One size system for every control and box edge. */
  --ctl-h: 30px;       /* inputs, selects, buttons */
  --ctl-h-sm: 24px;    /* small buttons inside tables and title bars */
  --pad-x: 12px;       /* horizontal inset of every box, title bar and table edge */
  --pad-y: 10px;
  --gap: 10px;
  --title-grad: linear-gradient(180deg, #555 0%, #333 100%);
  --btn-grad: linear-gradient(180deg, #6b6b6b 0%, #4a4a4a 50%, #353535 51%, #2b2b2b 100%);
  --btn-grad-hover: linear-gradient(180deg, #7b7b7b 0%, #5a5a5a 50%, #444 51%, #383838 100%);
  --green-grad: linear-gradient(180deg, #a8d14d 0%, #7fa82b 50%, #6a9220 51%, #557a14 100%);
  --red-grad: linear-gradient(180deg, #e86a5d 0%, #c9412f 50%, #b33424 51%, #92281b 100%);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 13px/1.45 Arial, "Helvetica Neue", Helvetica, sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; color: var(--text-hi); }
p { margin: 0 0 .7em; }
[hidden] { display: none !important; }
svg { width: 13px; height: 13px; flex: none; vertical-align: -2px; }
::selection { background: #557a14; color: #fff; }

.muted { color: var(--muted); }
.small { font-size: 11px; }
.money { color: var(--money); font-weight: bold; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.good, .ok { color: var(--green); }
.warn { color: var(--yellow); }
.danger, .bad { color: var(--red); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 10px; }
.grid { display: grid; gap: 10px; align-items: start; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* ---------------------------------------------------------------- header */
#progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--green); box-shadow: 0 0 8px var(--green); z-index: 50; opacity: 0; transition: width .35s ease, opacity .3s; }
#progress.on { opacity: 1; }
.tt-header { background: linear-gradient(180deg, #2c2c2c 0%, #111 100%); border-bottom: 1px solid #000; box-shadow: 0 1px 0 #333; position: sticky; top: 0; z-index: 20; }
.tt-header-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 14px; height: 50px; padding: 0 12px; }
.logo { display: flex; align-items: baseline; gap: 2px; font-family: "Arial Black", Arial, sans-serif; font-weight: 900; font-size: 22px; letter-spacing: 1px; text-shadow: 0 2px 3px #000; }
.logo:hover { text-decoration: none; }
.logo-a { color: #fff; }
.logo-b { color: var(--green); }
.header-tag { color: #888; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; border-left: 1px solid #444; padding-left: 12px; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.header-right .who { color: #bbb; }
.header-right .who b { color: #fff; }
.menu-btn { display: none; width: 34px; height: 30px; background: var(--btn-grad); border: 1px solid #000; border-radius: var(--radius); padding: 6px 7px; cursor: pointer; flex-direction: column; justify-content: space-between; }
.menu-btn span { display: block; height: 2px; background: #ddd; border-radius: 1px; }

/* ---------------------------------------------------------------- layout */
.tt-layout { max-width: 1280px; width: 100%; margin: 0 auto; display: flex; gap: 12px; padding: 12px; flex: 1; align-items: flex-start; }
.sidebar { width: 190px; flex: none; position: sticky; top: 62px; display: flex; flex-direction: column; gap: 10px; }
.content { flex: 1; min-width: 0; }
.content.loading { opacity: .55; transition: opacity .2s; pointer-events: none; }
.fade-in { animation: fadein .2s ease-out; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.footer { text-align: center; color: #777; font-size: 11px; padding: 14px 12px 22px; border-top: 1px solid #222; }
.backdrop { position: fixed; inset: 0; background: #000a; z-index: 25; }

/* ---------------------------------------------------------------- sidebar */
.sbox { background: var(--box-2); border-radius: var(--radius); box-shadow: 0 1px 3px #0008; overflow: hidden; }
.sbox-title { background: var(--title-grad); color: #fff; font-weight: bold; font-size: 12px; padding: 6px 10px; text-shadow: 0 0 2px #000; border-bottom: 1px solid #000; }
.info-row { display: flex; justify-content: space-between; gap: 6px; padding: 3px 10px; font-size: 12px; }
.info-row:first-of-type { padding-top: 7px; }
.info-row .k { color: var(--muted); }
.info-row .v { color: #fff; font-weight: bold; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-wrap { padding: 4px 10px 8px; }
.bar-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.bar { height: 7px; border-radius: 4px; background: #111; box-shadow: inset 0 1px 2px #000; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; transition: width .5s ease; }
.bar.green > i { background: linear-gradient(180deg, #a8d14d, #6a9220); }
.bar.red > i { background: linear-gradient(180deg, #f07a6e, #b33424); }
.bar.yellow > i { background: linear-gradient(180deg, #ffd24d, #c99400); }
.bar.blue > i { background: linear-gradient(180deg, #7cc0f5, #2f7fc0); }
.sbox .pad { padding: 8px 10px 10px; }
.areas a { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; color: #ddd; background: linear-gradient(180deg, #353535, #2c2c2c); border-top: 1px solid #3c3c3c; border-bottom: 1px solid #1c1c1c; font-size: 12px; }
.areas a:hover { background: #444; text-decoration: none; color: #fff; }
.areas a.active { background: linear-gradient(180deg, #4a4a4a, #3a3a3a); color: #fff; box-shadow: inset 3px 0 0 var(--green); }
.areas a svg { width: 16px; height: 16px; flex: none; color: #aaa; }
.areas a.active svg, .areas a:hover svg { color: var(--green); }
.areas .badge { margin-left: auto; }

/* ---------------------------------------------------------------- page title */
.page-head { display: flex; align-items: center; gap: var(--gap); flex-wrap: wrap; padding: 2px 0 var(--pad-y); border-bottom: 1px solid #000; box-shadow: 0 1px 0 #3a3a3a; }
.page-head h1 { font-size: 20px; font-weight: bold; text-shadow: 0 1px 2px #000; }
.page-head .sub { color: var(--muted); font-size: 12px; flex-basis: 100%; }

/* ---------------------------------------------------------------- boxes
   Every box edge is inset by --pad-x, so text in title bars, sub-bars,
   tables and box bodies all lines up vertically. */
.panel { background: var(--box); border-radius: var(--radius); box-shadow: 0 1px 3px #0008; padding: var(--pad-y) var(--pad-x); }
.panel.tight { padding: 0; overflow: hidden; }
.panel > h2:first-child, .panel-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 40px; padding: 5px var(--pad-x);
  background: var(--title-grad); color: #fff; font-size: 13px; font-weight: bold; text-shadow: 0 0 2px #000;
  border-bottom: 1px solid #000; border-radius: var(--radius) var(--radius) 0 0;
}
.panel > h2:first-child { margin: calc(-1 * var(--pad-y)) calc(-1 * var(--pad-x)) var(--pad-y); }
.panel-head h2, .panel-head h3 { font-size: 13px; }
.panel-head .muted, .panel-head .small { text-shadow: none; font-weight: normal; }
.subhead, .toolbar { background: #2a2a2a; border-bottom: 1px solid #1c1c1c; padding: 7px var(--pad-x); color: var(--muted); font-size: 12px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; color: var(--text); }
.toolbar .row { gap: 6px; }
.pad-box { padding: var(--pad-y) var(--pad-x); }

.stat { background: var(--box); border-radius: var(--radius); box-shadow: 0 1px 3px #0008; padding: 8px var(--pad-x); border-top: 2px solid #4a4a4a; }
.stat .k { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.stat .v { font-size: 17px; font-weight: bold; color: #fff; margin-top: 1px; font-variant-numeric: tabular-nums; }
.stat .v.money { color: var(--money); }
.stat .v.warn { color: var(--yellow); }
.stat .v.danger { color: var(--red); }
.stat .v .trust { font-size: 13px; }
.stat .hint { color: #888; font-size: 11px; }

/* Torn info-msg style banners */
.banner { display: flex; gap: var(--gap); align-items: flex-start; border-radius: var(--radius); padding: var(--pad-y) var(--pad-x); background: #2b2b2b; border: 1px solid #1a1a1a; border-left: 4px solid var(--blue); box-shadow: 0 1px 3px #0008; }
.banner::before { content: "i"; flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-weight: bold; font-size: 12px; color: #fff; background: var(--blue); font-family: Georgia, serif; }
.banner.danger { border-left-color: var(--red); } .banner.danger::before { content: "!"; background: var(--red); font-family: Arial; }
.banner.warn { border-left-color: var(--yellow); } .banner.warn::before { content: "!"; background: var(--yellow); color: #222; font-family: Arial; }
.banner.good { border-left-color: var(--green); } .banner.good::before { content: "✓"; background: var(--green); font-family: Arial; }
.banner > div { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------- controls
   All inputs, selects and buttons share one height, wherever they appear. */
input, select, textarea, button { font: inherit; color: inherit; }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=url], select, textarea {
  background: #111; border: 1px solid #555; border-radius: var(--radius); padding: 0 9px; min-width: 0; color: #eee; box-shadow: inset 0 1px 3px #000;
}
input[type=text], input[type=password], input[type=number], input[type=search], input[type=url], select { height: var(--ctl-h); }
textarea { width: 100%; min-height: 76px; resize: vertical; padding: 7px 9px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: inset 0 1px 3px #000, 0 0 0 2px #85b20033; }
label.field, div.field { display: grid; gap: 4px; }
label.field > span, div.field > span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
label.check { display: flex; gap: 8px; align-items: center; cursor: pointer; }
input[type=checkbox] { accent-color: var(--green); width: 15px; height: 15px; margin: 0; }

/* API key boxes: identical everywhere (login, trader setup, settings, TornExchange, admin). */
.key-field { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.key-input { width: 100%; max-width: 300px; flex: 1 1 220px; font-family: Consolas, "Courier New", monospace; letter-spacing: .06em; }
.key-count { font-size: 11px; color: var(--muted); min-width: 34px; font-variant-numeric: tabular-nums; }
.key-count.good { color: var(--green); }

/* Search / filter boxes: identical everywhere. */
.search-field { position: relative; display: flex; align-items: center; flex: 1 1 220px; min-width: 180px; max-width: 480px; }
.search-field svg { position: absolute; left: 9px; width: 14px; height: 14px; color: #777; pointer-events: none; }
.search-field input { width: 100%; padding-left: 29px; }
.pct-input { width: 64px; }
.price-input { width: 130px; text-align: right; font-variant-numeric: tabular-nums; }

.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--ctl-h); padding: 0 14px; border-radius: var(--radius);
  background: var(--btn-grad); border: 1px solid #111; color: #fff; font-weight: bold; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  text-shadow: 0 0 2px #000; cursor: pointer; white-space: nowrap; box-shadow: 0 1px 0 #ffffff14 inset, 0 1px 2px #000a; transition: filter .12s, transform .05s; }
.btn:hover { background: var(--btn-grad-hover); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--green-grad); border-color: #2f4a06; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { background: var(--red-grad); border-color: #4a120b; }
.btn.danger:hover { filter: brightness(1.1); }
.btn.small { height: var(--ctl-h-sm); padding: 0 9px; font-size: 10px; }
.btn:disabled { opacity: .5; cursor: default; filter: grayscale(.4); }
.btn.busy { color: transparent !important; text-shadow: none; }
.btn.busy::after { content: ""; position: absolute; width: 12px; height: 12px; border: 2px solid #fff8; border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { background: none; border: 0; color: #888; cursor: pointer; padding: 0 3px; vertical-align: middle; line-height: 1; }
.icon-btn:hover { color: var(--green); }
.icon-btn svg { width: 13px; height: 13px; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 7px 10px; }
th:first-child, td:first-child { padding-left: var(--pad-x); }
th:last-child, td:last-child { padding-right: var(--pad-x); }
th { background: linear-gradient(180deg, #464646, #383838); color: #ccc; font-weight: bold; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; text-align: left; border-bottom: 1px solid #000; white-space: nowrap; text-shadow: 0 0 2px #000; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: #fff; }
th.sorted::after { content: " ▾"; color: var(--green); }
td { border-bottom: 1px solid #262626; vertical-align: middle; }
tbody tr:nth-child(even) td { background: var(--row-alt); }
tbody tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #3d3d3d; }
tr.sub > td { background: #242424 !important; padding: 0 0 0 18px; box-shadow: inset 3px 0 0 var(--green); }
tr.sub table th { background: #2f2f2f; }
tr.hl td { background: #34401c !important; }
tr.risky td { opacity: .8; }
tr.group-row td { background: #262626 !important; border-top: 1px solid #000; border-bottom: 1px solid #000; padding-top: 5px; padding-bottom: 5px; color: #ddd; }
tr.group-row b { text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn + .btn { margin-left: 5px; }

.item { display: flex; align-items: center; gap: 9px; min-width: 170px; }
.item img { width: 38px; height: 19px; object-fit: contain; flex: none; filter: drop-shadow(0 1px 1px #000); }
.item .t { color: var(--muted); font-size: 11px; }

.stars { color: var(--star); letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: #555; }
.pill { display: inline-block; padding: 0 7px; border-radius: 3px; font-size: 11px; line-height: 18px; font-weight: bold; background: #444; color: #ccc; white-space: nowrap; text-transform: uppercase; letter-spacing: .02em; }
.pill.ok, .pill.good { background: #3b4d16; color: #c5e67a; }
.pill.warn { background: #4d3d0a; color: #ffd24d; }
.pill.danger { background: #4d1a14; color: #ff9a8f; }
.pill.info { background: #173550; color: #9fd0f7; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #555; color: #fff; font-size: 10px; font-weight: bold; text-align: center; line-height: 16px; }
.badge.red { background: var(--red); }
.badge.green { background: #6a9220; }
.badge.yellow { background: #c99400; color: #111; }

/* trust score chip */
.trust { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-weight: bold; font-size: 11px; }
.trust .sc { min-width: 26px; height: 18px; padding: 0 5px; border-radius: 3px; display: inline-grid; place-items: center; color: #fff; text-shadow: 0 0 2px #000; }
.trust.t-trusted .sc { background: linear-gradient(180deg, #8fbf2f, #557a14); }
.trust.t-reliable .sc { background: linear-gradient(180deg, #4ea0dc, #26628f); }
.trust.t-fair .sc { background: linear-gradient(180deg, #e0b030, #9c7400); }
.trust.t-risky .sc { background: linear-gradient(180deg, #e86a5d, #92281b); }
.trust.t-new .sc { background: #555; }
.trust .tl { color: var(--muted); font-weight: normal; }
.breakdown .bar-wrap { padding: 3px 0 6px; }

/* ---------------------------------------------------------------- tabs
   No margin here: spacing between page sections comes only from .stack. */
.tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 1px; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; height: var(--ctl-h); padding: 0 14px; border-radius: var(--radius); background: var(--btn-grad); border: 1px solid #111; color: #ccc; font-weight: bold; font-size: 11px; text-transform: uppercase; white-space: nowrap; text-shadow: 0 0 2px #000; }
.tabs a:hover { color: #fff; text-decoration: none; background: var(--btn-grad-hover); }
.tabs a.active { background: linear-gradient(180deg, #5a5a5a, #3d3d3d); color: #fff; box-shadow: inset 0 -2px 0 var(--green); }

/* ---------------------------------------------------------------- price-list sources & categories */
.source-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.source-card { display: flex; flex-direction: column; gap: 8px; padding: var(--pad-y) var(--pad-x); border-right: 1px solid #262626; }
.source-card:last-child { border-right: 0; }
.source-title { display: flex; align-items: baseline; gap: 8px; }
.source-actions { margin-top: auto; }   /* buttons line up across cards of different heights */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: var(--ctl-h-sm); padding: 0 10px; border-radius: 12px; background: #262626; border: 1px solid #444; cursor: pointer; font-size: 12px; user-select: none; }
.chip:hover { border-color: #666; }
.chip:has(input:checked) { background: #34401c; border-color: #6a9220; color: #fff; }
.chip .muted { font-size: 11px; }
details summary { cursor: pointer; color: var(--link); }
details[open] summary { margin-bottom: 8px; }

/* ---------------------------------------------------------------- misc */
.empty { padding: 26px 16px; text-align: center; color: var(--muted); }
.empty .btn { margin-top: var(--gap); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 5px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
pre.json { background: #111; border: 1px solid #000; border-radius: var(--radius); padding: var(--pad-y); overflow: auto; max-height: 320px; font-size: 11px; }
.tos td:first-child { color: var(--muted); width: 170px; font-weight: bold; }
.review { padding: var(--pad-y) var(--pad-x); border-bottom: 1px solid #262626; }
.review:last-child { border-bottom: 0; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; padding-left: 30px; position: relative; margin-bottom: 9px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 21px; height: 21px; border-radius: 50%; background: var(--green-grad); display: grid; place-items: center; font-size: 11px; font-weight: bold; color: #fff; text-shadow: 0 0 2px #000; }
.star-input button { background: none; border: 0; font-size: 22px; color: #555; cursor: pointer; padding: 0 2px; transition: transform .1s; }
.star-input button:hover { transform: scale(1.15); }
.star-input button.on { color: var(--star); }
.choice { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.choice .panel { display: flex; flex-direction: column; }
.choice .panel .steps { flex: 1; }
.kbd { display: inline-block; border: 1px solid #555; border-bottom-width: 2px; border-radius: 3px; padding: 0 4px; font-size: 10px; color: #aaa; }
.savebar { position: sticky; bottom: 10px; margin-top: var(--gap); display: flex; align-items: center; gap: var(--gap); background: #2b2b2b; border: 1px solid #000; border-left: 4px solid var(--yellow); border-radius: var(--radius); padding: 8px var(--pad-x); box-shadow: 0 6px 20px #000c; z-index: 5; animation: fadein .2s; }
.skeleton-page { height: 320px; background: linear-gradient(90deg, #2a2a2a 0%, #333 40%, #2a2a2a 80%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.nowrap { white-space: nowrap; }
.panel ul { margin: 0; padding-left: 18px; }
.panel ul li { margin-bottom: 4px; }
.grid.cols-4 { align-items: stretch; }
html { scrollbar-color: #555 #1e1e1e; }

/* ---------------------------------------------------------------- toasts & modal */
#toasts { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 40; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: var(--gap); align-items: flex-start; background: #2b2b2b; border: 1px solid #000; border-left: 4px solid var(--green); border-radius: var(--radius); padding: var(--pad-y) var(--pad-x); box-shadow: 0 8px 24px #000c; cursor: pointer; animation: toastin .22s ease-out; }
.toast.error { border-left-color: var(--red); }
.toast .ic { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-weight: bold; font-size: 11px; background: var(--green); color: #fff; }
.toast.error .ic { background: var(--red); }
.toast.out { opacity: 0; transform: translateX(20px); transition: all .2s; }
@keyframes toastin { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
#modal { position: fixed; inset: 0; background: #000b; display: grid; place-items: center; z-index: 45; padding: 16px; animation: fadein .15s; }
#modal .dialog { background: var(--box); border-radius: var(--radius); width: min(500px, 100%); box-shadow: 0 16px 50px #000; overflow: hidden; padding: 0 var(--pad-x) var(--pad-x); }
#modal .dialog > h2 { background: var(--title-grad); margin: 0 calc(-1 * var(--pad-x)) var(--pad-y); padding: 10px var(--pad-x); font-size: 13px; text-shadow: 0 0 2px #000; border-bottom: 1px solid #000; }
#modal .dialog .row { justify-content: flex-end; margin-top: var(--gap); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .menu-btn { display: flex; }
  .header-tag { display: none; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 250px; z-index: 30; background: var(--bg); padding: 10px; overflow-y: auto; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 4px 0 20px #000; }
  .sidebar.open { transform: none; }
  .tt-layout { padding: 8px; }
  .source-card { border-right: 0; border-bottom: 1px solid #262626; }
}
@media (max-width: 640px) {
  :root { --pad-x: 10px; }
  .hide-sm { display: none; }
  th, td { padding: 6px 7px; }
  .logo { font-size: 18px; }
  .header-right .who { display: none; }
  .search-field { max-width: none; }
}
.subhead.warn-note { color: #d9b44a; background: #2a2616; }
/* Banner colour lives in the left border and icon; text stays readable. */
.banner.good, .banner.warn, .banner.danger { color: var(--text); }
.choice .panel { gap: var(--gap); }
.choice .panel > h2:first-child { margin-bottom: 0; }
tr.closed td { opacity: .7; }
details.panel > summary { list-style: none; cursor: pointer; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary h2::before { content: "▸ "; color: var(--green); }
details.panel[open] > summary h2::before { content: "▾ "; }
details.panel:not([open]) > summary { border-bottom: 0; border-radius: var(--radius); }
details.panel[open] > summary { margin-bottom: 0; }
.panel.allow-overflow { overflow: visible; }
.search-wrap { position: relative; flex: 1 1 260px; max-width: 420px; }
.search-wrap .search-field { max-width: none; }
.search-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #2b2b2b; border: 1px solid #000; border-radius: var(--radius); box-shadow: 0 10px 28px #000c; z-index: 15; overflow: hidden; text-shadow: none; font-weight: normal; }
.search-results a { display: flex; justify-content: space-between; gap: 10px; padding: 8px var(--pad-x); color: var(--text); border-bottom: 1px solid #333; }
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover, .search-results a:focus { background: #3a3a3a; text-decoration: none; }
.update-body p:last-child, .update-body ul:last-child { margin-bottom: 0; }
.update-body ul { padding-left: 20px; margin: 0 0 .7em; }
.update-body li { margin-bottom: 4px; }

/* ================================================================ RaffleHub additions */
.raffle-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.raffle-card { display: flex; flex-direction: column; background: var(--box); border-radius: var(--radius); box-shadow: 0 1px 3px #0008; overflow: hidden; color: var(--text); }
.raffle-card:hover { text-decoration: none; box-shadow: 0 0 0 1px #6a9220, 0 4px 14px #000a; }
.raffle-card .panel-head { justify-content: space-between; flex-wrap: nowrap; }
.raffle-card .panel-head h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.raffle-card .body { padding: var(--pad-y) var(--pad-x); display: grid; gap: 8px; flex: 1; }
.raffle-card .foot { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 7px var(--pad-x); background: #2a2a2a; border-top: 1px solid #1c1c1c; font-size: 12px; }
.prize { display: flex; align-items: center; gap: 10px; min-height: 38px; }
.prize .cash-ic { width: 38px; height: 26px; border-radius: 4px; display: grid; place-items: center; background: linear-gradient(180deg, #3b4d16, #26330b); color: var(--money); font-weight: bold; font-size: 15px; border: 1px solid #111; flex: none; }
.prize .big { font-size: 16px; font-weight: bold; color: #fff; }
.prize .big.money { color: var(--money); }
.kvline { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.kvline .k { color: var(--muted); }
.code-chip { display: inline-flex; align-items: center; gap: 4px; font-family: Consolas, "Courier New", monospace; font-weight: bold; letter-spacing: .08em; background: #111; border: 1px solid #555; border-radius: 3px; padding: 0 6px; color: #fff; line-height: 20px; white-space: nowrap; }
.code-chip.big { font-size: 18px; line-height: 32px; padding: 0 12px; border-color: var(--green); box-shadow: 0 0 0 2px #85b20022; }
.enter-box { display: grid; gap: 10px; }
.enter-box .row { gap: 10px; }
.tickets-input { width: 90px; text-align: right; }
.hash { font-family: Consolas, "Courier New", monospace; font-size: 11px; word-break: break-all; color: #bbb; }
.verify-out li { margin-bottom: 4px; }
.winner-banner { display: flex; align-items: center; gap: 12px; padding: 12px var(--pad-x); background: linear-gradient(180deg, #34401c, #26300f); border: 1px solid #111; border-radius: var(--radius); box-shadow: 0 1px 3px #0008; color: #fff; }
.winner-banner svg { width: 28px; height: 28px; color: var(--star); }
.winner-banner .w { font-size: 16px; font-weight: bold; }
tr.me td { background: #2f3a1b !important; }
.radio-row { display: flex; gap: 6px; flex-wrap: wrap; }
.form-grid { display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: start; }
.form-grid .wide { grid-column: 1 / -1; }
.field .hint { color: #888; font-size: 11px; }
.field input, .field select { width: 100%; }
.preview { display: grid; gap: 4px; background: #2a2a2a; border: 1px solid #1c1c1c; border-radius: var(--radius); padding: var(--pad-y) var(--pad-x); }
.security-list { list-style: none; padding: 0 !important; margin: 0; }
.security-list li { display: flex; gap: 8px; align-items: flex-start; }
.security-list li::before { content: "✓"; color: var(--green); font-weight: bold; }
.linkish { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; font-size: 11px; }
.linkish:hover { text-decoration: underline; }
.mt { margin-top: 10px; }
.chip { white-space: nowrap; }
.radio-row .chip input { accent-color: var(--green); }
.search-wrap .search-results a { align-items: center; }
.search-results img { width: 30px; height: 16px; object-fit: contain; vertical-align: -3px; }
/* Item picker options are buttons (they pick, they don't navigate) - same as TornTraders. */
.search-results button { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px; padding: 8px var(--pad-x); color: var(--text); background: none; border: 0; border-bottom: 1px solid #333; font: inherit; text-align: left; cursor: pointer; }
.search-results button:last-child { border-bottom: 0; }
.search-results button:hover, .search-results button.active { background: #3a3a3a; }

/* ---------------------------------------------------------------- phones
   Controls grow to a comfortable tap size, and tables drop their least
   important columns instead of hiding everything behind a sideways scroll. */
.show-sm { display: none; }

@media (max-width: 640px) {
  :root { --ctl-h: 38px; --ctl-h-sm: 32px; }
  .show-sm { display: block; margin-top: 4px; }
  .btn { padding: 0 16px; }
  .btn.small { padding: 0 12px; }
  .areas a { height: 42px; font-size: 13px; }
  .icon-btn { padding: 6px; min-width: 34px; min-height: 34px; }
  .icon-btn svg { width: 16px; height: 16px; }
  .page-head h1 { font-size: 19px; }
  .tabs a { padding: 0 12px; }
  th, td { padding: 9px 8px; }
  td.actions .btn + .btn { margin-left: 4px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 6px; }
  .search-results button { padding: 11px var(--pad-x); }
  #toasts { bottom: 10px; left: 10px; right: 10px; max-width: none; }
  .winner-banner { flex-wrap: wrap; }
  .enter-box .steps li { padding-left: 28px; }
}
@media (pointer: coarse) {
  .btn, .chip, .tabs a { min-height: 34px; }
  .search-results a, .search-results button { min-height: 40px; }
  .icon-btn { min-width: 34px; min-height: 34px; }
  .star-input button { padding: 0 6px; }
}

/* ---------------------------------------------------------------- closed page */
.closed-page { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--gap); padding: 32px 0 40px; }
.closed-mark { width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, #3a3a3a, #222); border: 1px solid #000; box-shadow: 0 2px 8px #000a, inset 0 1px 0 #ffffff14; }
.closed-mark svg { width: 34px; height: 34px; color: var(--yellow); }
.closed-page h1 { font-size: clamp(30px, 8vw, 50px); letter-spacing: 1px; text-shadow: 0 2px 4px #000; }
.closed-lead { max-width: 640px; font-size: 15px; color: var(--text); margin: 0; }
.closed-card { max-width: 640px; width: 100%; text-align: left; }
.closed-foot { font-size: 11px; }
.closed-foot a { color: #777; }
.closed-foot a:hover { color: var(--link); }
