/* Offload Connect: the look of Hedge Connect (dark, Inter, 10 px radius cards, blue pills), written from scratch. */
:root {
  --blue: #007aff;
  --success: #00c40a;
  --warning: #ffd60a;
  --danger: #ff453a;
  --n200: #98989d;
  --n400: #4f4f4f;
  --n500: #414141;
  --n600: #282828;
  --n700: #1d1d1d;
  --n800: #141414;
  --card: #181818;
  --radius: 10px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--n700); color: #fff; font-family: var(--font); font-size: 16px;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body { min-height: 100vh; min-height: 100dvh; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input { font: inherit; }
h1 { font-size: 18px; font-weight: 600; margin: 0; }
h2 { font-size: 14px; font-weight: 500; color: rgba(255,255,255,.8); margin: 0; }
p { margin: 0; }
.text { font-size: 14px; line-height: 20px; }
.small { font-size: 12px; line-height: 16px; }
.dark { color: rgba(255,255,255,.6); }
.hl { font-weight: 500; }
.warning-text { color: var(--warning); }
.danger-text { color: var(--danger); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.hbox { display: flex; flex-direction: row; min-width: 0; }
.vbox { display: flex; flex-direction: column; min-width: 0; }
.grow { flex: 1 1 auto; }
.center { align-items: center; }

/* header */
.topbar { position: sticky; top: 0; z-index: 20; height: calc(68px + var(--safe-top)); padding: var(--safe-top) 10px 0;
  display: flex; align-items: center; justify-content: space-between; background: var(--n700); border-bottom: 1px solid rgba(255,255,255,.05); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.topbar .actions { display: flex; gap: 6px; }

/* pill buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 500;
  color: #fff; background: var(--blue); flex: none; user-select: none; transition: outline .125s, background .125s, color .125s; outline: 0 solid #243c5a66; }
.btn:hover { outline-width: 3px; }
.btn.secondary { background: rgba(255,255,255,.1); color: rgba(255,255,255,.85); outline-color: #66666611; }
.btn.secondary:hover { color: #fff; }
.btn.round { width: 28px; padding: 0; justify-content: center; }
.btn svg { width: 14px; height: 14px; flex: none; }
.btn:disabled { opacity: .5; cursor: default; }

/* layout */
main { display: grid; grid-template-columns: 266px minmax(0, 1fr); gap: 16px; padding: 0 10px calc(24px + var(--safe-bottom)); max-width: 1400px; margin: 0 auto; }
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.section { display: flex; flex-direction: column; gap: 12px; }
.section + .section { margin-top: 18px; }
.sechead { position: sticky; top: calc(68px + var(--safe-top)); z-index: 5; background: var(--n700); height: 56px; display: flex; align-items: center;
  justify-content: space-between; gap: 20px; border-bottom: 1px solid rgba(255,255,255,.05); }
.sechead .tools { display: flex; gap: 8px; align-items: center; }
@media (max-width: 720px) {
  main { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .topbar .btn .label-long { display: none; }
}

/* connections */
.client { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--n600); border-radius: var(--radius); cursor: pointer;
  user-select: none; transition: opacity .15s, background .15s; -webkit-touch-callout: none; }
.client:hover { background: #2e2e2e; }
.client.deselected { opacity: .4; }
.client .icon { width: 32px; height: 32px; flex: none; }
.client .name { font-size: 14px; line-height: 18px; }
.client .sub { font-size: 12px; color: rgba(255,255,255,.6); display: flex; align-items: center; gap: 6px; }
.client .count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: rgba(255,255,255,.1); font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; color: rgba(255,255,255,.8); }
.client .count.zero { color: rgba(255,255,255,.4); }
.client .pin { width: 12px; height: 12px; color: rgba(255,255,255,.5); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--n200); flex: none; }
.dot.success { background: var(--success); } .dot.info { background: var(--blue); } .dot.warning { background: var(--warning); } .dot.danger { background: var(--danger); }

/* transfers */
.transfer { display: flex; align-items: center; gap: 20px; height: 84px; padding: 0 20px; border-radius: var(--radius); background: var(--card);
  overflow: hidden; user-select: none; }
.transfer.child { background: transparent; }
.transfer.child .icon { visibility: hidden; }
.transfer .icon { width: 42px; height: 42px; flex: none; }
.transfer .body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.transfer .names { display: flex; align-items: center; gap: 12px; min-width: 0; font-size: 14px; font-weight: 500; }
.transfer .names .to { display: flex; align-items: center; gap: 12px; min-width: 0; color: rgba(255,255,255,.5); }
.transfer .names svg { width: 12px; height: 12px; flex: none; fill: rgba(255,255,255,.5); }
.transfer .line { display: flex; align-items: center; gap: 12px; font-size: 12px; color: rgba(255,255,255,.6); min-width: 0; }
.transfer.stale .icon { opacity: .6; } .transfer.stale .body { opacity: .3; }
.transfer .remove { flex: none; }
.group { background: var(--card); border-radius: var(--radius); overflow: hidden; cursor: pointer; }
.group > .transfer { background: transparent; }
.group .chev { width: 16px; height: 16px; color: rgba(255,255,255,.6); transition: transform .2s, color .125s; flex: none; }
.group:hover .chev { color: #fff; }
.group.open .chev { transform: rotate(180deg); }
.group .children { display: none; border-top: 1px solid rgba(255,255,255,.05); }
.group.open .children { display: block; }
.bar { height: 8px; width: 100%; overflow: hidden; border-radius: 4px; background: var(--n800); padding: 2px; outline: 1px solid #ffffff06; }
.bar > div { height: 4px; border-radius: 2px; background: var(--blue); transition: width .5s ease-in-out; max-width: 100%; }
.bar.stale > div { background: var(--n200); }
.bar.paused > div { background: var(--n200); }
.empty { padding: 20px; border-radius: var(--radius); background: var(--card); text-align: center; font-size: 14px; color: rgba(255,255,255,.6); }

/* select + menus */
.select { display: inline-flex; align-items: center; gap: 6px; }
.select b { font-weight: 600; color: #fff; }
.select svg { width: 12px; height: 12px; }
.menu { position: fixed; z-index: 60; min-width: 150px; padding: 4px; background: rgba(65,65,65,.7); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.05); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.45); transform-origin: top; animation: pop .25s cubic-bezier(.34,1.56,.64,1); }
.menu button { display: flex; width: 100%; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 13px; text-align: left; }
.menu button:hover, .menu button:focus-visible { background: var(--blue); outline: none; }
.menu button .check { width: 12px; height: 12px; margin-left: auto; }
.menu hr { border: 0; border-top: 1px solid rgba(255,255,255,.08); margin: 4px 2px; }
.menu button.danger { color: #ff8a82; }
.menu button.danger:hover { color: #fff; background: var(--danger); }
@keyframes pop { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* dialogs and the settings sheet */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.dialog { position: fixed; z-index: 51; left: 50%; top: 22%; transform: translateX(-50%); width: min(420px, calc(100vw - 32px)); padding: 20px; background: var(--n600);
  border: 1px solid rgba(255,255,255,.05); border-radius: var(--radius); box-shadow: 0 20px 50px rgba(0,0,0,.5); display: flex; flex-direction: column; gap: 14px; animation: pop .3s cubic-bezier(.34,1.56,.64,1); }
.sheet { position: fixed; z-index: 51; top: 0; right: 0; bottom: 0; width: min(280px, 100vw); background: #222; border-left: 1px solid rgba(255,255,255,.06);
  border-radius: 14px 0 0 14px; display: flex; flex-direction: column; padding: calc(16px + var(--safe-top)) 24px calc(16px + var(--safe-bottom)); animation: slide .3s cubic-bezier(.2,.9,.3,1); }
@keyframes slide { from { transform: translateX(100%); } to { transform: translateX(0); } }
.sheet .head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 14px; font-weight: 600; }
.sheet .head button { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; color: rgba(255,255,255,.8); }
.sheet .row { display: flex; gap: 14px; align-items: flex-start; padding: 22px 0; }
.sheet .row .title { font-size: 14px; }
.sheet .row .desc { font-size: 13px; color: rgba(255,255,255,.6); margin-top: 2px; line-height: 18px; }
.sheet .foot { margin-top: auto; text-align: center; font-size: 11px; color: rgba(255,255,255,.3); }
.toggle { position: relative; width: 38px; height: 22px; flex: none; border-radius: 999px; background: rgba(255,255,255,.1); transition: background .2s; margin-top: 4px; }
.toggle .knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #3a3a3a; display: flex; align-items: center; justify-content: center;
  transition: transform .2s, background .2s; color: rgba(255,255,255,.7); }
.toggle .knob svg { width: 10px; height: 10px; }
.toggle.on { background: var(--blue); }
.toggle.on .knob { transform: translateX(16px); background: #fff; color: var(--blue); }
.toggle:disabled { opacity: .6; }

/* inputs, login */
.field { height: 44px; width: 100%; padding: 0 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,.04); background: var(--n600); color: #fff; font-size: 14px; outline: none; }
.field::placeholder { color: rgba(255,255,255,.4); }
.field:focus { border-color: rgba(0,122,255,.6); }
.error { color: var(--danger); font-size: 12px; min-height: 16px; }
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.login .topbar { justify-content: center; border-bottom: 0; }
.login .box { margin: auto; width: min(333px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 16px; padding-bottom: 12vh; }
.login .box .t { font-size: 14px; font-weight: 600; }
.login .box .d { font-size: 13px; color: rgba(255,255,255,.6); margin-top: 2px; line-height: 18px; }

/* banners and toasts */
.banner { position: sticky; top: calc(68px + var(--safe-top)); z-index: 15; margin: 8px 10px 0; padding: 10px 14px; border-radius: var(--radius); background: rgba(255,69,58,.15);
  color: #ffb3ad; font-size: 13px; text-align: center; }
.toasts { position: fixed; z-index: 70; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 999px; background: rgba(65,65,65,.9); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); font-size: 13px;
  border: 1px solid rgba(255,255,255,.06); animation: pop .3s cubic-bezier(.34,1.56,.64,1); white-space: nowrap; }
.hint { font-size: 12px; color: rgba(255,255,255,.5); line-height: 17px; }
.hidden { display: none !important; }
@media (hover: none) { .transfer .remove .label { display: none; } }
.line .nowrap, .line .dot { flex: none; }
@media (max-width: 480px) {
  .transfer { gap: 14px; padding: 0 14px; }
  .transfer .icon { width: 36px; height: 36px; }
  .group .chev { margin-left: -4px; }
}
/* Hedge shows Remove on hover where there is a pointer; always on touch screens */
@media (hover: hover) {
  .transfer .remove { max-width: 0; padding: 0; opacity: 0; overflow: hidden; transition: max-width .2s, opacity .2s, padding .2s; }
  .transfer:hover .remove, .group:hover > .transfer .remove { max-width: 95px; padding: 0 12px; opacity: 1; }
}
