/* EldoDash — dark matte grays (Donut Demand style). Flat page panels; floating layers get a thin outline + soft shadow. */
:root {
  --bg: #141414;
  --panel: #1a1a1a;
  --card: #202020;
  --raised: #272727;
  --hover: #2c2c2c;
  --field: #232323;
  --line: #2a2a2a;
  --text: #f2f2f2;
  --muted: #8f8f8f;
  --faint: #5c5c5c;

  --blue: #2b7fff;
  --blue-hover: #1f6fe8;
  --yellow: #eab308;
  --green: #22c55e;
  --red: #ef4444;
  --gray-dot: #6b6b6b;
  /* Floating layers (slide-outs, popups, menu): thin outline + soft shadow so they lift off the page. */
  --pop-line: #333333;
  --pop-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 4px 14px rgba(0, 0, 0, .35);

  --r: 12px;
  --gap: 8px;
  --edge: 14px; /* space between the app and the window edges */
  --ease: cubic-bezier(.2, .8, .2, 1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
button, input, textarea { font: inherit; color: inherit; border: 0; outline: none; background: none; }
button { cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2 { margin: 0; }
[hidden] { display: none !important; }
::selection { background: var(--blue); color: #fff; }
* { scrollbar-width: thin; scrollbar-color: #333 var(--panel); }
.muted { color: var(--muted); }

.ic { width: 18px; height: 18px; flex: none; display: block; }
i[data-icon] { display: contents; }

.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; padding: var(--edge); gap: 10px; }

/* ---------- Top bar ---------- */
.topbar { display: flex; align-items: center; gap: 12px; padding: 8px 10px; background: var(--panel); border-radius: var(--r); flex: none; }
.logo { height: 26px; width: auto; color: var(--text); display: block; flex: none; }

.icon-btn { width: 36px; height: 36px; border-radius: 10px; background: var(--card); color: var(--text); display: grid; place-items: center; flex: none; }
.icon-btn:hover { background: var(--hover); }

.menu-wrap { position: relative; }
.menu { position: absolute; top: 44px; left: 0; z-index: 40; width: 230px; background: var(--raised); border-radius: var(--r); padding: 6px; display: grid; gap: 2px; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; color: var(--text); }
.menu-item:hover { background: var(--hover); }
.menu-item.active { background: var(--hover); color: var(--blue); }
.count { margin-left: auto; background: var(--blue); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; line-height: 18px; min-width: 18px; padding: 0 6px; text-align: center; }

.banner { background: #3a1a1a; color: #ffb3b3; padding: 8px 12px; font-size: 13px; border-radius: var(--r); flex: none; }

/* ---------- Pages ---------- */
.pages { flex: 1; min-height: 0; display: flex; }
.page { flex: 1; min-width: 0; overflow-y: auto; overflow-anchor: none; display: flex; flex-direction: column; gap: var(--gap); animation: fade .18s ease-out; }
@keyframes fade { from { transform: translateY(4px); } }
/* No side padding: search bars and buttons line up exactly with the boxes below; the title is inset to match their text. */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 14px 0 6px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.3px; padding-left: 6px; }
.card { background: var(--panel); border-radius: var(--r); padding: 18px; min-width: 0; }

.search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; background: var(--field); border-radius: 10px; color: var(--muted); min-width: 0; }
.search .ic { width: 16px; height: 16px; }
.search input { flex: 1; min-width: 0; height: 100%; color: var(--text); }
.search input::placeholder { color: var(--muted); }
.page-head .search { width: min(320px, 100%); background: var(--panel); }

/* segmented control */
.seg { display: inline-flex; background: var(--panel); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { height: 30px; padding: 0 14px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--raised); color: var(--text); }

/* ---------- Overview ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.tile { background: var(--panel); border-radius: var(--r); padding: 16px 18px; min-width: 0; display: grid; gap: 4px; }
.tile .k { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .v { font-size: 26px; font-weight: 800; letter-spacing: -.4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--gap); align-items: stretch; }
.chart-card { display: flex; flex-direction: column; gap: 12px; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.chart-head h2 { font-size: 15px; font-weight: 700; }
.chart-head .muted { font-size: 12px; }
.chart { position: relative; flex: 1; min-height: 280px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--blue); }
.chart .bar.dim { fill: #24467a; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .cross { stroke: var(--faint); stroke-width: 1; }
.tooltip { position: absolute; pointer-events: none; background: var(--raised); border-radius: 10px; padding: 8px 12px; font-size: 12px; white-space: nowrap; z-index: 5; display: grid; gap: 2px; }
.tooltip b { font-size: 14px; font-variant-numeric: tabular-nums; }

.hero-card { display: flex; flex-direction: column; padding: 24px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.hero-card h2 { font-size: 30px; font-weight: 800; letter-spacing: -.5px; margin: 14px 0 8px; }
.hero-card .lead { color: var(--muted); margin: 0 0 16px; }
.row-link { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 14px; width: 100%; padding: 15px 2px; color: #cfcfcf; text-align: left; }
.row-link + .row-link { border-top: 1px solid var(--line); }
.row-link:last-of-type { border-bottom: 1px solid var(--line); }
.row-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-link .ic:last-child { color: var(--muted); transition: transform .15s var(--ease); }
.row-link:hover { color: var(--text); }
.row-link:hover .ic:last-child { transform: translateX(3px); color: var(--text); }
.row-link .n { color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.hero-card .btn { margin-top: 22px; align-self: flex-start; width: auto; }

/* ---------- Orders page ---------- */
/* Lists scroll inside their rounded box, so the box keeps its curved corners and the page header stays put. */
#page-orders, #page-offers { overflow: hidden; }
/* Hug the content when the list is short; shrink to the screen and scroll inside when it's long. */
.table-card { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.olist { position: relative; flex: 0 1 auto; min-height: 0; overflow-y: auto; overflow-anchor: none; padding: 12px 10px 10px; }
.olist .group-head { padding: 10px 8px 8px; }
.olist .group + .group .group-head { padding-top: 16px; }
.orow { display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; align-items: center; gap: 12px; padding: 12px 10px; border-radius: 10px; cursor: pointer; }
.orow + .orow { margin-top: 2px; }
.orow:hover { background: var(--card); }
.orow.active { background: var(--raised); }
.ocell-main { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; min-width: 0; }
.otitle { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.osub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oprice { font-variant-numeric: tabular-nums; white-space: nowrap; }
.otime { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.orow .ic { color: var(--faint); }
.more { display: block; width: 100%; padding: 10px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.more:hover { background: var(--card); color: var(--text); }

/* ---------- Groups (chats + orders) ---------- */
.group-head { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 6px 6px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; }
.group-head .n { color: var(--faint); font-weight: 600; }
.group-head .ic { margin-left: auto; width: 14px; height: 14px; transition: transform .15s; }
.group.closed .group-head .ic { transform: rotate(-90deg); }
.group.closed .group-body { display: none; }
.group-body { display: grid; gap: 4px; }

/* dots: yellow = to deliver, blue = fulfilled, green = delivered, red = disputed; blue by a preview = new message */
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--gray-dot); display: inline-block; }
.dot.todo { background: var(--yellow); }
.dot.fulfilled { background: var(--blue); }
.dot.delivered { background: var(--green); }
.dot.disputed { background: var(--red); }
.dot.refunded, .dot.cancelled { background: var(--gray-dot); }
.dot.unread { background: var(--blue); }
.status-line { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; }

/* ---------- Chats page ---------- */
#page-chats { overflow: hidden; }
.chats-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: var(--gap); }
.col { min-height: 0; min-width: 0; display: flex; flex-direction: column; background: var(--panel); border-radius: var(--r); overflow: hidden; }
.side-head { padding: 8px; }
.list { overflow-y: auto; flex: 1; padding: 0 8px 8px; overflow-anchor: none; }
.item { position: relative; padding: 10px 12px; border-radius: 10px; background: var(--card); cursor: pointer; display: grid; gap: 3px; min-width: 0; }
.item:hover { background: var(--raised); }
.item.active { background: var(--hover); }
.item.active::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--blue); }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.right { display: flex; align-items: center; gap: 8px; }
.time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.preview { display: flex; align-items: center; gap: 7px; min-width: 0; }
.sub { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.item.unread .sub { color: var(--text); }

/* ---------- Workspace: chat + order details (Chats page and Orders drawer) ---------- */
.app > .workspace { display: none; } /* until mounted into a slot */
.ws-slot { min-width: 0; min-height: 0; height: 100%; container: ws / inline-size; }
.workspace { position: relative; height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); }
.ws-chat, .ws-details { min-height: 0; min-width: 0; display: flex; flex-direction: column; background: var(--panel); border-radius: var(--r); overflow: hidden; }
/* Order details: a popup under the receipt button, like the menu. */
.ws-details { display: none; }
.workspace.show-details .ws-details { display: flex; position: absolute; top: 60px; right: 10px; z-index: 20;
  width: min(360px, calc(100% - 20px)); max-height: calc(100% - 70px); background: var(--raised); animation: pop .16s var(--ease); }
.ws-details .col-head { background: none; height: 44px; padding: 0 14px; }
.ws-details .panel-body { padding: 0 8px 8px; }
.ws-details .dcard { background: var(--card); }
.ws-details .panel-body .btn.ghost { background: var(--card); }
.ws-details .panel-body .btn.ghost:hover { background: var(--hover); }
#receiptBtn.on { background: var(--hover); color: var(--blue); }
@keyframes pop { from { transform: translateY(-6px); } }
#wsClose, #wsBack { display: none; }
.workspace.in-drawer #wsClose { display: grid; }
.btn-deliver { height: 36px; padding: 0 14px; border-radius: 10px; background: var(--blue); color: #fff; font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; flex: none; }
.btn-deliver:hover { background: var(--blue-hover); }
.btn-deliver:disabled { background: var(--raised); color: var(--muted); cursor: default; }
.btn-deliver .ic { width: 16px; height: 16px; }


.col-head { display: flex; align-items: center; gap: 8px; padding: 0 10px 0 14px; height: 56px; flex: none; background: var(--card); }
.col-head .grow { flex: 1; min-width: 0; }
.col-head .title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-head .meta { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-head .icon-btn { background: var(--raised); }
.col-head .icon-btn:hover { background: var(--hover); }

.thread { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: min(72%, 560px); padding: 8px 12px; border-radius: 14px; background: #262626; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.them { align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.me { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.msg.me .at { color: #cfe0ff; }
.msg.system { align-self: center; background: none; color: var(--muted); font-size: 12px; max-width: 90%; text-align: center; padding: 4px 8px; }
.msg.system .at { display: none; }
.msg.sending { background: #23467f; }
.msg.failed { background: #5a1f1f; color: #ffd0d0; }
.msg .at { display: block; font-size: 10.5px; color: var(--muted); margin-top: 3px; text-align: right; }
.day { align-self: center; font-size: 11px; font-weight: 600; color: var(--muted); margin: 8px 0 4px; }
.atts { display: grid; gap: 6px; margin: 2px 0 4px; }
.att-img { display: block; max-width: 240px; max-height: 240px; width: 100%; object-fit: cover; border-radius: 10px; background: var(--raised); }
.att-file { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--raised); min-width: 0; color: var(--text); }
.msg.me .att-file { background: #1f66d6; color: #fff; }
.att-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.composer { position: relative; padding: 10px; display: grid; gap: 8px; background: var(--card); flex: none; }
.compose-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 6px; align-items: end; }
.compose-row .icon-btn { width: 40px; height: 40px; background: var(--raised); color: var(--muted); }
.compose-row .icon-btn:hover, .compose-row .icon-btn.on { color: var(--text); background: var(--hover); }
.compose-row .icon-btn.send { background: var(--blue); color: #fff; }
.compose-row .icon-btn.send:hover { background: var(--blue-hover); }
.compose-row textarea { width: 100%; resize: none; height: 40px; min-height: 40px; max-height: 160px; background: var(--field); border-radius: 10px; padding: 10px 12px; }
.compose-row textarea::placeholder { color: var(--muted); }
.composer.drag { background: var(--raised); }
.pending-files { display: flex; gap: 6px; overflow-x: auto; }
.pfile { flex: none; display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 10px; background: var(--raised); max-width: 230px; }
.pfile img, .pfile .ficon { width: 36px; height: 36px; border-radius: 7px; object-fit: cover; background: var(--hover); display: grid; place-items: center; flex: none; color: var(--muted); }
.pfile .pinfo { min-width: 0; display: grid; }
.pfile .pname { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfile .pstate { font-size: 11px; color: var(--muted); }
.pfile button { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); flex: none; }
.pfile button:hover { background: var(--hover); color: var(--text); }
.pfile .ic { width: 14px; height: 14px; }
.emoji-pop { position: absolute; left: 10px; bottom: calc(100% + 6px); width: min(336px, calc(100% - 20px)); background: var(--raised); border-radius: var(--r); padding: 8px; z-index: 30; }
.emoji-tabs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; margin-bottom: 6px; }
.emoji-tabs button { height: 32px; border-radius: 8px; font-size: 17px; }
.emoji-tabs button:hover, .emoji-tabs button.active { background: var(--hover); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; max-height: 216px; overflow-y: auto; }
.emoji-grid button { aspect-ratio: 1; border-radius: 8px; font-size: 21px; line-height: 1; display: grid; place-items: center; }
.emoji-grid button:hover { background: var(--hover); }

.empty { flex: 1; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 24px; }
.empty p { margin: 0 0 12px; }

/* order details */
.panel-body { overflow-y: auto; padding: 8px; display: grid; gap: var(--gap); align-content: start; flex: 1; }
.dcard { background: var(--card); border-radius: var(--r); padding: 14px; display: grid; gap: 9px; min-width: 0; }
.dcard h3 { margin: 0; font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); }
.offer-title { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: minmax(72px, max-content) minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 13px; min-height: 26px; }
.kv.nocopy { grid-template-columns: minmax(72px, max-content) minmax(0, 1fr); }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.copy { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--raised); color: var(--muted); }
.copy:hover { background: var(--hover); color: var(--text); }
.copy .ic { width: 14px; height: 14px; }
.deadline.late { color: var(--red); }
.btn { border-radius: 10px; height: 42px; padding: 0 18px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; width: 100%; }
.btn .ic { width: 16px; height: 16px; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-hover); }
.btn.primary:disabled { background: var(--raised); color: var(--muted); cursor: not-allowed; }
.btn.ghost { background: var(--raised); color: var(--text); }
.btn.ghost:hover { background: var(--hover); }
textarea.note { width: 100%; min-height: 84px; resize: vertical; background: var(--field); border-radius: 10px; padding: 10px; }
textarea.note::placeholder { color: var(--muted); }

/* ---------- Drawer (Orders page) ---------- */
/* Slide-outs float with their own rounded corners (no square backing). */
/* Starts below the top bar so the menu, notifications and sign out stay reachable. */
.drawer { position: fixed; top: calc(var(--edge) + 62px); right: var(--edge); bottom: var(--edge); width: min(720px, calc(100vw - 2 * var(--edge))); z-index: 30; border-radius: var(--r); box-shadow: var(--pop-shadow);
  transform: translateX(calc(100% + 16px)); visibility: hidden; transition: transform .32s var(--ease), visibility 0s linear .32s; }
.drawer.open { transform: none; visibility: visible; transition: transform .32s var(--ease), visibility 0s; }
@keyframes slidein { from { transform: translateX(24px); } }

/* ---------- Offers ---------- */
.head-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
.head-actions .search { width: 280px; background: var(--panel); }
.btn-new { height: 38px; padding: 0 14px; border-radius: 10px; background: var(--blue); color: #fff; font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; flex: none; }
.btn-new:hover { background: var(--blue-hover); }
.btn-new .ic { width: 16px; height: 16px; }
.notice { background: #3a2f12; color: #f3d98b; padding: 10px 14px; border-radius: var(--r); font-size: 13px; }
.dot.active { background: var(--green); }
.dot.paused { background: var(--yellow); }
.dot.closed, .dot.offline { background: var(--gray-dot); }
.ostock { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ostock.out { color: var(--red); }

.editor { height: 100%; display: flex; flex-direction: column; background: var(--panel); border-radius: var(--r); overflow: hidden; }
.editor .col-head { gap: 8px; }
.ed-body { flex: 1; overflow-y: auto; padding: 8px; display: grid; gap: var(--gap); align-content: start; }
.ed-foot { padding: 10px; background: var(--card); flex: none; }
.ed-card { background: var(--card); border-radius: var(--r); padding: 14px; display: grid; gap: 12px; min-width: 0; }
.ed-card h3 { margin: 0; font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); }
.ed-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.field input, .field textarea, .field select { width: 100%; background: var(--field); border: 0; outline: none; border-radius: 10px; padding: 0 12px; height: 40px; color: var(--text); font: inherit; }
.field textarea { height: auto; min-height: 110px; padding: 10px 12px; resize: vertical; }
.field select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f8f8f' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; }
.field input:focus, .field textarea:focus, .field select:focus { background-color: var(--hover); }
.field input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.field input[type=number]::-webkit-inner-spin-button, .field input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.field input:disabled, .field textarea:disabled, .field select:disabled { color: var(--muted); cursor: not-allowed; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.money-input { position: relative; }
.money-input::before { content: '$'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.money-input input { padding-left: 24px; }
.ed-note { font-size: 12px; color: var(--muted); margin: 0; }
.seg.full { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--field); }
.seg.full button:disabled { color: var(--faint); cursor: not-allowed; }
.btn-ghost-sm { height: 36px; padding: 0 12px; border-radius: 10px; background: var(--raised); color: var(--text); font-weight: 600; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex: none; }
.btn-ghost-sm:hover { background: var(--hover); }
.btn-ghost-sm .ic, .icon-btn.danger .ic { width: 16px; height: 16px; }
.icon-btn.danger:hover { background: #3a1a1a; color: #ff8a8a; }

/* ---------- Chat connection (Settings) ---------- */
.banner.warn { background: #3a2f12; color: #f3d98b; text-decoration: none; display: block; }
.banner.warn:hover { background: #45381a; }
.chat-login { display: grid; gap: 14px; }
.cl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cl-head h2 { font-size: 16px; font-weight: 700; }
.cl-state { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 99px; background: var(--card); }
.dot.connected { background: var(--green); }
.dot.starting { background: var(--yellow); }
.dot.login-expired, .dot.error { background: var(--red); }
.dot.disconnected, .dot.unavailable, .dot.idle { background: var(--gray-dot); }
.cl-meta { color: var(--muted); font-size: 13px; margin: 0; }
.cl-warn { background: #3a2f12; color: #f3d98b; padding: 10px 12px; border-radius: 10px; font-size: 13px; margin: 0; }
.cl-steps { background: var(--card); border-radius: 10px; padding: 12px 14px; font-size: 13px; color: #cfcfcf; }
.cl-steps summary { cursor: pointer; font-weight: 600; color: var(--text); }
.cl-steps ol { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.cl-steps code { background: var(--raised); padding: 1px 6px; border-radius: 5px; font-size: 12px; }
.chat-login textarea { width: 100%; min-height: 96px; resize: vertical; background: var(--field); border-radius: 10px; padding: 10px 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--text); }
.chat-login textarea::placeholder { color: var(--muted); font-family: inherit; }
.cl-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cl-actions .btn { width: auto; }
.cl-note { font-size: 12px; color: var(--muted); margin: 0; }

/* ---------- Auto delivery + connector ---------- */
.switch { width: 46px; height: 28px; border-radius: 99px; background: var(--raised); position: relative; flex: none; transition: background .2s; }
.switch span { position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: #bdbdbd; transition: transform .2s var(--ease), background .2s; }
.switch.on { background: var(--blue); }
.switch.on span { transform: translateX(18px); background: #fff; }
.switch:disabled { opacity: .6; cursor: default; }
.ad-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.ad-stats span { background: var(--card); border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--muted); }
.ad-stats b { color: var(--text); margin-right: 4px; }
.connector { display: grid; gap: 10px; }
.connector .btn .ic { width: 16px; height: 16px; }
.connector-steps { margin: 0; padding: 12px 14px 12px 32px; background: var(--card); border-radius: 10px; display: grid; gap: 8px; font-size: 13px; color: #cfcfcf; }
.connector-steps .btn { width: auto; height: 38px; }
.connector-steps code { background: var(--raised); padding: 1px 6px; border-radius: 5px; font-size: 12px; }
.link-btn { color: var(--blue); font-weight: 600; font-size: inherit; }
.link-btn:hover { text-decoration: underline; }
.bot-card .status-line { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.bot-card .cl-actions .btn { flex: 1 1 auto; height: 38px; }
.ws-details .panel-body .bot-card .btn.ghost { background: var(--raised); }
.ws-details .panel-body .bot-card .btn.ghost:hover { background: var(--hover); }
.shot-pick { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; background: var(--field); color: var(--muted); font-size: 13px; cursor: pointer; min-width: 0; }
.shot-pick:hover { background: var(--hover); color: var(--text); }
.shot-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fail-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.fail-row input { height: 38px; background: var(--field); border-radius: 10px; padding: 0 12px; min-width: 0; font-size: 13px; }
.fail-row input:focus { background: var(--hover); }
.fail-row .btn { width: auto; height: 38px; }
.dot.idle { background: var(--gray-dot); }

/* ---------- Minecraft bot: server chat console ---------- */
.console-card { display: flex; flex-direction: column; gap: 10px; margin-top: var(--gap); }
.console-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.console-head h2 { font-size: 16px; font-weight: 700; }
.console { height: 260px; overflow-y: auto; background: #151515; border-radius: 10px; padding: 10px 12px; font: 12.5px/1.55 ui-monospace, Menlo, Consolas, monospace; color: #d6d6d6; }
.console .empty { font-family: inherit; padding: 30px 0; }
.cline { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
.cline .ct { color: var(--faint); }
.cline .cx { white-space: pre-wrap; overflow-wrap: anywhere; }
.cline.note .cx { color: var(--muted); font-style: italic; }
.cline.cmd .cx { color: #8fb8ff; font-style: normal; }
.console-input { display: flex; align-items: center; gap: 8px; background: var(--field); border-radius: 10px; padding: 4px 4px 4px 12px; }
.console-input .slash { color: var(--muted); font: 600 14px ui-monospace, Menlo, Consolas, monospace; }
.console-input input { flex: 1; min-width: 0; height: 34px; font: 13px ui-monospace, Menlo, Consolas, monospace; }
.console-input .icon-btn { background: var(--blue); color: #fff; }
.console-input .icon-btn:hover { background: var(--blue-hover); }
#page-bot .console { height: 360px; }
.menu-item .mc-dot { margin-left: auto; width: 8px; height: 8px; }
.mc-code { background: var(--card); border-radius: 10px; padding: 12px 14px; display: grid; gap: 10px; }
.mc-code p { margin: 0; font-size: 13px; }
.mc-code-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mc-code-row code { font: 700 22px ui-monospace, Menlo, Consolas, monospace; letter-spacing: 2px; background: var(--raised); padding: 6px 12px; border-radius: 8px; }
.mc-code-row .btn { width: auto; height: 38px; }
.mc-rt { background: var(--card); border-radius: 10px; padding: 12px 14px; display: grid; gap: 10px; }
.mc-rt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.mc-rt-head .cl-note { margin: 2px 0 0; }
.danger-text { color: #ff8a8a !important; }
#page-bot .set-card code, #discordCard code { background: var(--raised); padding: 1px 6px; border-radius: 5px; font-size: 12px; }
#discordCard .ad-stats span { font-size: 12px; }

/* ---------- Delivery proof screenshot popup ---------- */
.proof-modal { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .55); display: grid; place-items: center; padding: var(--edge); }
.proof-box { width: min(900px, 100%); max-height: calc(100dvh - 2 * var(--edge)); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--pop-line); border-radius: var(--r); box-shadow: var(--pop-shadow); overflow: hidden; }
.proof-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 16px; }
.proof-head .grow { flex: 1; min-width: 0; }
.proof-head .title { font-weight: 700; }
.proof-head .meta { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proof-img { overflow: auto; padding: 0 12px 12px; }
.proof-img img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 8px; image-rendering: pixelated; }
.proof-img video { display: block; width: 100%; max-height: 60vh; border-radius: 8px; background: #111; }
.proof-img #downloadClip { margin: 8px 0 12px; }
.money-form { padding: 16px; margin-bottom: 12px; }
#sendMoneyResult:not(:empty) { margin: 0 0 12px; color: var(--text); }
#retrySendMoney { margin-bottom: 12px; }
.money-tax { display: inline-flex; align-items: center; gap: 8px; }
.money-form .money-tax input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- Settings forms ---------- */
.set-card { display: grid; gap: 14px; }
.listing-prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 12px 20px; margin: 12px 0; }
.listing-prices dt { color: var(--muted); font-size: 12px; }
.listing-prices dd { margin: 4px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.set-card input { width: 100%; height: 40px; background: var(--field); border-radius: 10px; padding: 0 12px; color: var(--text); }
.set-card input::placeholder { color: var(--muted); }
.set-card input:focus { background: var(--hover); }
#autosellForm { width: 100%; max-width: 760px; }
.autosell-fields { display: grid; gap: 18px; min-width: 0; margin: 0; padding: 0; border: 0; }
#autosellStatus:empty { display: none; }
.shop-card { width: 100%; max-width: 760px; margin-bottom: 14px; }
.shop-card .cl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.shop-card details { border-top: 1px solid var(--line, #343434); padding: 12px 0; overflow-wrap: anywhere; }
.shop-card summary { cursor: pointer; }
.shop-card .field { min-width: 0; }
.shop-card .cl-meta:empty { display: none; }
.shop-layout { width: min(100%, 980px); margin: 0 auto; padding-bottom: 24px; display: grid; gap: 12px; }
.shop-layout .page-head h1 { padding-left: 0; }
.shop-nav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.shop-nav a { padding: 10px 16px; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 650; }
.shop-nav a:hover, .shop-nav a[aria-current] { color: var(--text); }
.shop-nav a[aria-current] { border-bottom-color: var(--blue); }
.shop-layout :is(a, summary, button, input, select, textarea):focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.shop-overview { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; }
.shop-overview h2, .shop-card h2 { font-size: 18px; }
#shopState { display: flex; align-items: center; gap: 9px; }
#shopState::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--gray-dot); }
#shopState[data-open="true"]::before { background: var(--green); }
#shopConnections { margin-top: 4px; }
.shop-overview > p { flex-basis: 100%; }
.shop-layout p[role="status"]:empty, .shop-layout .cl-meta:empty { display: none; }
.shop-layout p[role="status"] { margin: 0; overflow-wrap: anywhere; }
.shop-overview .cl-actions, #shopActions, .shop-card-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.shop-card-head { justify-content: space-between; }
.shop-view { display: grid; gap: 8px; min-width: 0; }
.shop-layout .shop-card { max-width: none; margin: 0; }
.shop-layout .btn { width: auto; min-height: 38px; height: auto; padding: 8px 14px; white-space: normal; }
.shop-layout .btn:disabled { opacity: .5; cursor: default; }
.shop-view .shop-group { background: var(--panel); border: 0; border-radius: var(--r); padding: 0; min-width: 0; }
.shop-group > summary, #shopOrders > details > summary { display: flex; align-items: center; cursor: pointer; gap: 10px; list-style: none; }
.shop-group > summary { padding: 16px 18px; font-weight: 650; }
.shop-group > summary::-webkit-details-marker, #shopOrders > details > summary::-webkit-details-marker { display: none; }
.shop-group > summary::after, #shopOrders > details > summary::before { content: ''; width: 7px; height: 7px; flex: none; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); }
.shop-group > summary::after { margin-left: auto; }
.shop-group[open] > summary::after, #shopOrders > details[open] > summary::before { transform: rotate(45deg); }
.shop-group-body { display: grid; gap: 14px; padding: 2px 18px 18px; min-width: 0; }
.shop-group-body form, .shop-group-body fieldset { min-width: 0; }
.shop-group-body .set-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.shop-layout input[type="checkbox"] { width: 16px; height: 16px; vertical-align: middle; accent-color: var(--blue); }
.shop-layout #shopSearch { display: grid; align-items: end; grid-template-columns: 1fr 1fr 1.6fr auto; }
.shop-card .shop-group { background: var(--field); }
.shop-card .shop-group > summary { padding: 10px 14px; }
#shopOrders > details > summary { min-height: 28px; }
.shop-order-player { font-weight: 650; overflow-wrap: anywhere; }
.shop-order-trade { color: var(--muted); }
.shop-order-state { margin-left: auto; padding: 2px 8px; border-radius: 6px; background: var(--raised); font-size: 12px; text-transform: capitalize; }
.shop-order-state[data-state="completed"] { color: #80dba6; }
.shop-order-state[data-state="review"] { color: #edc577; }
@media (max-width: 650px) {
  .shop-layout #shopSearch { grid-template-columns: 1fr 1fr; }
  .shop-nav a { flex: 1; text-align: center; }
  #shopOrders > details > summary { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 2px 9px; }
  #shopOrders > details > summary::before { grid-area: 1/1/3/2; }
  .shop-order-trade { grid-area: 2/2; font-size: 12px; }
  .shop-order-state { grid-area: 1/3/3/4; }
}
.set-card .field span { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- Placeholders / settings ---------- */
.placeholder { display: grid; place-items: center; gap: 10px; padding: 56px 18px; color: var(--muted); text-align: center; }
.placeholder .ic { width: 28px; height: 28px; }
.placeholder p { margin: 0; }
.settings-basic { padding: 4px 18px; }
.settings-basic .row-link:last-of-type { border-bottom: 0; }

/* ---------- Toasts ---------- */
/* Pop-up notifications live in the bottom-left corner. */
.toast-wrap { position: fixed; left: calc(var(--edge) + 4px); bottom: calc(var(--edge) + 4px); display: grid; gap: 8px; z-index: 60; justify-items: start; }
.toast { display: flex; align-items: flex-start; gap: 10px; background: var(--raised); color: var(--text); padding: 10px 8px 10px 14px; border-radius: 10px; max-width: min(340px, calc(100vw - 32px)); overflow-wrap: anywhere; animation: fade .18s ease-out; }
.toast.err { background: #5a1f1f; color: #ffd0d0; }

/* ---------- Sign-in page ---------- */
.auth-body { background: var(--bg); background-image: radial-gradient(#1d1d1d 1px, var(--bg) 1px); background-size: 22px 22px; }
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--pop-line); border-radius: 18px; box-shadow: var(--pop-shadow);
  padding: 32px 28px 24px; display: grid; gap: 14px; text-align: center; animation: pop .25s var(--ease); }
.auth-mark { width: 64px; height: 64px; border-radius: 16px; background: var(--card); display: grid; place-items: center; justify-self: center; margin-bottom: 4px; }
.auth-mark svg { width: 36px; height: 36px; color: var(--text); }
.auth-card h1 { font-size: 26px; font-weight: 800; letter-spacing: -.4px; margin: 0; }
.auth-sub { margin: -8px 0 6px; color: var(--muted); font-size: 14px; }
.auth-error { background: #3a1a1a; color: #ffb3b3; border-radius: 10px; padding: 10px 12px; font-size: 13px; text-align: left; }
.discord-btn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 48px; border-radius: 12px; background: #5865f2; color: #fff;
  font-weight: 700; font-size: 15px; text-decoration: none; transition: background .15s, transform .15s var(--ease); }
.discord-btn:hover { background: #4752c4; }
.discord-btn:active { transform: translateY(1px); }
.discord-btn svg { width: 22px; height: 22px; }
.discord-btn.loading { pointer-events: none; background: #4752c4; }
.discord-btn.loading::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #c9ceff; border-top-color: #4752c4; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .8px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-pw { display: grid; gap: 8px; }
.auth-pw input { height: 44px; background: var(--field); border-radius: 10px; padding: 0 12px; color: var(--text); }
.auth-pw input:focus { background: var(--hover); }
.auth-pw .btn { height: 44px; }
.auth-foot { margin: 4px 0 0; color: var(--faint); font-size: 12px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 4px; border-radius: 10px; background: var(--card); font-size: 13px; font-weight: 600; max-width: 180px; }
.user-chip img, .user-chip .ava { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; flex: none; background: #5865f2; color: #fff; display: grid; place-items: center; font-size: 13px; }
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) { .user-chip span { display: none; } .user-chip { padding: 0 4px; } }

/* ---------- Login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login form { background: var(--panel); border-radius: 16px; padding: 28px; width: min(360px, 100%); display: grid; gap: 12px; }
.login .logo { height: 36px; justify-self: center; margin-bottom: 8px; }
.login input { height: 44px; background: var(--field); border-radius: 10px; padding: 0 12px; }
.login .err { color: var(--red); font-size: 13px; min-height: 18px; }
.setup-title { font-size: 20px; font-weight: 800; text-align: center; margin: 0; }
.setup-hint { color: var(--muted); font-size: 13px; text-align: center; margin: 0 0 4px; line-height: 1.5; }
.login .btn { height: 44px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chats-layout { grid-template-columns: 280px minmax(0, 1fr); }
}

/* Phone: one clean screen at a time. */
@media (max-width: 720px) {
  :root { --gap: 8px; }
  :root { --edge: 10px; }
  .app { padding: var(--edge); gap: 8px; }
  .topbar { padding: 8px 10px; }
  .menu { position: fixed; top: calc(var(--edge) + 58px); left: var(--edge); right: var(--edge); width: auto; }
  .page-head { padding: 8px 0 2px; }
  .page-head h1 { font-size: 22px; padding-left: 4px; }
  .page-head .search { width: 100%; }
  .tile { padding: 14px; }
  .tile .v { font-size: 21px; }
  .chart { min-height: 220px; }
  .hero-card { padding: 20px; }
  .hero-card h2 { font-size: 26px; }
  .olist { padding: 10px 6px 8px; }
  .orow { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 12px 8px; }
  .orow > .ic { display: none; }
  .otitle { white-space: normal; text-overflow: clip; line-height: 1.35; max-height: 2.7em; overflow: hidden; overflow-wrap: anywhere; }

  .chats-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .side-head { padding: 8px; }
  .list { padding: 0 8px 8px; }
  .item { padding: 12px 14px; }
  #chatsSlot { display: none; }
  #page-chats.show-chat .side-col { display: none; }
  #page-chats.show-chat #chatsSlot { display: block; }
  #page-chats #wsBack { display: grid; }
  .app.in-chat .topbar, .app.in-chat .banner { display: none; }
  .thread { padding: 12px; }
  .msg { max-width: 84%; }
  .composer { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
  .drawer { inset: var(--edge); width: auto; }
  .signout { padding: 0 12px; }
  .head-actions { width: 100%; }
  .head-actions .search { flex: 1; width: auto; }
  .btn-new { padding: 0 12px; }
  .toast-wrap { left: var(--edge); right: var(--edge); bottom: 72px; justify-items: start; }
  .toast { max-width: none; }
}

/* ---------- Custom dropdown ---------- */
.dd { position: relative; }
.dd-btn { width: 100%; height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px;
  background: var(--field); border-radius: 10px; color: var(--text); text-align: left; }
.dd-btn:hover, .dd.open .dd-btn { background: var(--hover); }
.dd-btn .ic { width: 14px; height: 14px; color: var(--muted); transition: transform .15s var(--ease); flex: none; }
.dd.open .dd-btn .ic { transform: rotate(180deg); }
.dd-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dd.disabled .dd-btn { color: var(--muted); cursor: not-allowed; }
.dd-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50; display: grid; gap: 2px; padding: 6px;
  max-height: 260px; overflow-y: auto; background: var(--raised); border: 1px solid var(--pop-line); border-radius: 12px;
  box-shadow: var(--pop-shadow); animation: pop .14s var(--ease); }
.dd.up .dd-menu { top: auto; bottom: calc(100% + 6px); }
.dd-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px;
  text-align: left; color: var(--text); }
.dd-opt:hover, .dd-opt:focus-visible { background: var(--hover); outline: none; }
.dd-opt .ic { width: 15px; height: 15px; color: var(--blue); flex: none; }
.dd-text { display: grid; gap: 1px; min-width: 0; }
.dd-text small { font-size: 11.5px; color: var(--muted); }
.dd-opt.sel .dd-text { font-weight: 600; }

/* ---------- Top-right: notifications + sign out ---------- */
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.notif-wrap { position: relative; }
.notif-wrap .icon-btn { position: relative; }
.notif-wrap .icon-btn.on { background: var(--hover); }
.notif-dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px var(--card); }
.signout { height: 36px; padding: 0 14px; border-radius: 10px; background: var(--card); color: var(--red); font-weight: 700; font-size: 13px; white-space: nowrap; }
.signout:hover { background: #3a1a1a; }
.notif-pop { position: absolute; top: 44px; right: 0; width: 360px; max-height: min(480px, 70vh); display: flex; flex-direction: column;
  background: var(--raised); border-radius: var(--r); z-index: 40; overflow: hidden; animation: pop .16s var(--ease); }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; font-weight: 700; }
.notif-head span { font-size: 12px; font-weight: 500; color: var(--muted); }
.notif-list { overflow-y: auto; padding: 0 6px 6px; display: grid; gap: 2px; align-content: start; }
.notif-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 8px; border-radius: 9px; text-align: left; width: 100%; color: var(--text); }
.notif-item:hover { background: var(--hover); }
.notif-item[disabled] { cursor: default; }
.notif-item[disabled]:hover { background: none; }
.notif-ic { width: 32px; height: 32px; border-radius: 8px; background: var(--card); display: grid; place-items: center; color: var(--muted); }
.notif-ic .ic { width: 16px; height: 16px; }
.notif-item.new .notif-ic { color: var(--blue); }
.notif-text { font-size: 13px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.notif-time { font-size: 11px; color: var(--muted); white-space: nowrap; align-self: start; padding-top: 2px; }
.notif-empty { padding: 28px 14px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- Floating layers: outline + shadow ---------- */
.drawer .ws-chat, .drawer .editor { border: 1px solid var(--pop-line); }
.workspace.show-details .ws-details, .menu, .emoji-pop, .notif-pop { border: 1px solid var(--pop-line); box-shadow: var(--pop-shadow); }
.toast { box-shadow: var(--pop-shadow); }

.toast-msg { flex: 1; min-width: 0; padding-top: 2px; }
.toast-x { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); flex: none; }
.toast-x:hover { background: var(--hover); color: var(--text); }
.toast-x .ic { width: 14px; height: 14px; }
.toast.err .toast-x { color: #ffd0d0; }
.toast.err .toast-x:hover { background: #6e2a2a; }

/* Phone overrides for floating layers (kept last so they win over the base rules above). */
@media (max-width: 720px) {
  .notif-pop { position: fixed; top: calc(var(--edge) + 58px); left: var(--edge); right: var(--edge); width: auto; }
}
#taxCard .seg { background: var(--card); }
.discord-access-list { list-style: none; padding: 0; margin: 12px 0; }
.discord-access-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; }
