/* Copied from the design playground (branch claude/modest-shtern-f64ddd @ 887b161, assets/webui/css/components.css) for the release backend's portal and admin panel (D-144). Do not edit here: changes go to the design branch and are copied again. */
/* Components: every control is a standard one, finished to the craft bar. */

/* card: the one container; never nested */
.card { background: var(--raised-2); border: 1px solid var(--edge); border-radius: var(--r-card); box-shadow: var(--shadow-card); }
.card-head { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-5) 0; min-height: 52px; }
.card-head h2 { flex: 1; min-width: 0; }
.card-body { padding: var(--s-4) var(--s-5) var(--s-5); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); height: 34px; padding: 0 var(--s-4);
  border-radius: var(--r-control); font-size: var(--t-13); font-weight: 500; white-space: nowrap; user-select: none;
  background: var(--raised-3); border: 1px solid var(--edge-strong); color: var(--ink);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), opacity var(--t-fast); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--ink); color: var(--ink-inverse); border-color: transparent; font-weight: 600; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.danger { color: var(--bad); }
.btn.icon { width: 34px; padding: 0; }
.btn svg { width: 16px; height: 16px; }
.btn.armed { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.kbd { font-size: var(--t-11); font-weight: 500; color: var(--ink-3); border: 1px solid var(--edge-strong); border-radius: 5px; padding: 0 5px; line-height: 16px; }
.btn.primary .kbd { color: rgba(0, 0, 0, .55); border-color: rgba(0, 0, 0, .18); }

/* status pill with a dot that breathes only while the bot works */
.status { display: inline-flex; align-items: center; gap: var(--s-2); height: 28px; padding: 0 12px 0 10px; border-radius: var(--r-pill);
  background: var(--raised-3); border: 1px solid var(--edge); font-size: var(--t-13); font-weight: 500; }
.dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.dot.live::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: breathe 2.6s var(--ease) infinite; }
@keyframes breathe { 0% { transform: scale(1); opacity: .55; } 70%, 100% { transform: scale(2.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .dot.live::after { animation: none; opacity: 0; } }
.hidden-window .dot.live::after { animation-play-state: paused; }

/* change badge: +/- vs the previous period */
.change { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: var(--r-small); font-size: var(--t-12); font-weight: 600; white-space: nowrap; }
.change.up { color: var(--ok); background: var(--ok-soft); }
.change.down { color: var(--bad); background: var(--bad-soft); }
.change.none { color: var(--ink-3); background: rgba(255, 255, 255, .05); font-weight: 500; }
.change svg { width: 10px; height: 10px; }

/* segmented control: one thumb glides to the chosen segment */
.seg { position: relative; display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-control); background: var(--raised-1); border: 1px solid var(--edge); }
.seg-thumb { position: absolute; top: 3px; left: 0; height: calc(100% - 6px); border-radius: 6px; background: var(--raised-4);
  box-shadow: 0 1px 0 var(--edge-top) inset, 0 1px 3px rgba(0, 0, 0, .4); transition: transform var(--t-base) var(--ease), width var(--t-base) var(--ease); }
.seg button { position: relative; height: 26px; padding: 0 12px; border-radius: 6px; font-size: var(--t-12); font-weight: 500; color: var(--ink-3); transition: color var(--t-fast); }
.seg button:hover { color: var(--ink-2); }
.seg button[aria-pressed="true"] { color: var(--ink); }

/* switch */
.switch { position: relative; width: 34px; height: 20px; border-radius: 10px; background: var(--raised-4); border: 1px solid var(--edge-strong);
  transition: background var(--t-base) var(--ease), border-color var(--t-base) var(--ease); flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink-2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .5); transition: transform var(--t-base) var(--ease), background var(--t-base); }
.switch[aria-checked="true"] { background: var(--accent); border-color: transparent; }
.switch[aria-checked="true"]::after { transform: translateX(14px); background: #fff; }
.switch-row { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--t-13); color: var(--ink-2); cursor: pointer; }

/* menu (popover) */
.menu { position: absolute; z-index: 20; min-width: 220px; padding: 6px; border-radius: 12px; background: var(--raised-3); border: 1px solid var(--edge-strong);
  box-shadow: var(--shadow-float); transform-origin: top right; opacity: 0; transform: translateY(-4px) scale(.98); pointer-events: none;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.menu.open { opacity: 1; transform: none; pointer-events: auto; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border-radius: 7px; font-size: var(--t-13); color: var(--ink); text-align: left; }
.menu-item:hover { background: var(--raised-4); }
.menu-item .switch { margin-left: auto; transform: scale(.85); }

/* tag */
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: var(--r-small); font-size: var(--t-11); font-weight: 600;
  letter-spacing: .02em; color: var(--ink-2); background: rgba(255, 255, 255, .06); }
.tag.ok { color: var(--ok); background: var(--ok-soft); } .tag.warn { color: var(--warn); background: var(--warn-soft); }
.tag.bad { color: var(--bad); background: var(--bad-soft); } .tag.accent { color: var(--accent-hover); background: var(--accent-soft); }

/* table (Binance structure: calm header, hairline rows, right-aligned numbers) */
.table { width: 100%; border-collapse: collapse; font-size: var(--t-13); }
.table th { text-align: left; font-size: var(--t-12); font-weight: 500; color: var(--ink-3); padding: 0 var(--s-3) var(--s-2); }
.table td { padding: 9px var(--s-3); border-top: 1px solid var(--edge); vertical-align: middle; }
.table tr:hover td { background: rgba(255, 255, 255, .02); }
.table .r { text-align: right; }
.table tr.fresh td { animation: fresh 1.2s var(--ease); }
@keyframes fresh { from { background: var(--accent-soft); } to { background: transparent; } }

/* empty state */
.empty { display: grid; place-items: center; gap: var(--s-2); padding: var(--s-8) var(--s-4); text-align: center; color: var(--ink-3); font-size: var(--t-13); }
.empty svg { width: 22px; height: 22px; color: var(--ink-3); }

/* an attack's stars: drawn, filled for earned, outlined for missed */
.stars { display: inline-flex; gap: 1px; color: var(--ink-3); }
.stars svg { width: 13px; height: 13px; }
.stars svg.on { color: var(--gold); fill: currentColor; }
.event { display: inline-flex; align-items: center; gap: var(--s-2); }

/* inputs and selects: sunken, hairline, accent focus */
.input, .select { height: 34px; padding: 0 var(--s-3); border-radius: var(--r-control); background: var(--raised-1); border: 1px solid var(--edge-strong);
  font-size: var(--t-13); color: var(--ink); transition: border-color var(--t-fast), background var(--t-fast); min-width: 0; }
.input:hover, .select:hover { border-color: rgba(255, 255, 255, .2); }
.input:focus, .select:focus { border-color: var(--accent); background: var(--raised-2); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--ink-3); }
.select { appearance: none; padding-right: 32px; 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='%237d818a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; }
.select option { background: var(--raised-3); color: var(--ink); }

/* a period stepper: < label > */
.stepper { display: inline-flex; align-items: center; gap: 2px; }
.stepper .label { min-width: 168px; text-align: center; font-size: var(--t-13); font-weight: 600; }
.stepper .btn.icon { width: 30px; height: 30px; }
.stepper .btn.icon svg { width: 14px; height: 14px; }

/* a strip of figures in one card, hairlines between (instead of a grid of same-size tiles) */
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.strip > div { padding: var(--s-4) var(--s-5); min-width: 0; }
.strip > div + div { border-left: 1px solid var(--edge); }
.strip .k { font-size: var(--t-12); color: var(--ink-3); font-weight: 500; }
.strip .v { font: 500 var(--t-24)/1.25 var(--font-display); letter-spacing: -.015em; margin: 4px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip .s { font-size: var(--t-12); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* key - value list */
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: 0; font-size: var(--t-13); margin: 0; }
.kv dt { color: var(--ink-2); padding: 7px 0; border-top: 1px solid var(--edge); }
.kv dd { margin: 0; padding: 7px 0; border-top: 1px solid var(--edge); text-align: right; font-weight: 500; }
.kv dt:first-of-type, .kv dd:first-of-type { border-top: 0; }

/* horizontal bars (stops by reason ...) */
.hbars { display: grid; gap: var(--s-2); }
.hbar { display: grid; grid-template-columns: 160px minmax(0, 1fr) 36px; align-items: center; gap: var(--s-3); font-size: var(--t-13); }
.hbar .track { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .05); overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 4px; background: var(--ink-3); transform-origin: left; animation: grow-x 520ms var(--ease); }
.hbar .fill.bad { background: var(--bad); } .hbar .fill.warn { background: var(--warn); } .hbar .fill.ok { background: var(--ok); }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* toast: one short note, bottom centre, gone after a few seconds */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 50; transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: 10px; background: var(--raised-4); border: 1px solid var(--edge-strong); box-shadow: var(--shadow-float);
  font-size: var(--t-13); transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
