/* PatchBay UI: dark, node-editor inspired theme. */ :root { color-scheme: dark; --bg: #1d1d1d; --surface-1: #1a1a19; --surface-2: #262626; --surface-3: #303030; --border: #3d3d3d; --text-primary: #ececec; --text-secondary: #c3c2b7; --text-muted: #8f8e88; --accent: #4a8fe0; --danger: #d03b3b; --good: #0ca30c; --series-1: #3987e5; /* in / TCP */ --series-2: #d95926; /* out / UDP */ --grid: #2f2f2d; --node-source: #2e7d4f; --node-csink: #2f5f9e; --node-psink: #a8452a; --node-split: #5a5a5a; --node-tsource: #1f7a7a; --node-tsink: #6a4a9e; --radius: 6px; --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; } * { box-sizing: border-box; } html, body { margin: 0; height: 100%; } body { background: var(--bg); color: var(--text-primary); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; } a { color: var(--accent); } code, .mono { font-family: var(--mono); font-size: 12.5px; } h1 { font-size: 22px; margin: 0 0 16px; } h2 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; } h3 { font-size: 14px; margin: 18px 0 8px; } .muted { color: var(--text-muted); } .small { font-size: 12.5px; } .right { text-align: right; } /* Top bar */ .topbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 8px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); } .brand { font-weight: 700; letter-spacing: .02em; } .topbar nav { display: flex; gap: 4px; } .topbar nav a { color: var(--text-secondary); text-decoration: none; padding: 6px 12px; border-radius: var(--radius); } .topbar nav a:hover { background: var(--surface-3); } .topbar nav a.active { background: var(--surface-3); color: var(--text-primary); } .tools { display: flex; align-items: center; gap: 8px; } .logout { margin-left: auto; display: flex; align-items: center; gap: 10px; } .who { color: var(--text-muted); } /* Controls */ .btn { font: inherit; color: var(--text-primary); background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 14px; cursor: pointer; } .btn:hover { background: #3a3a3a; } .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; } .btn.primary:hover { filter: brightness(1.1); } .btn.danger { color: #ff8a8a; } .btn.small { padding: 3px 10px; font-size: 12.5px; } .btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; } input, select, textarea { font: inherit; color: var(--text-primary); background: var(--surface-1); border: 1px solid var(--border); border-radius: 4px; padding: 6px 8px; width: 100%; } input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; } label { display: flex; flex-direction: column; gap: 4px; color: var(--text-secondary); font-size: 13px; } /* Layout */ .page { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; } .page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; } .page-head h1 { margin: 0; } .card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin: 16px 0; } .form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; align-items: end; margin-top: 12px; } .form-grid .wide { grid-column: 1 / -1; } .form-grid .actions { grid-column: 1 / -1; } .inline-form { display: flex; gap: 8px; align-items: center; flex: 1; flex-wrap: wrap; } .inline-form input { width: auto; flex: 1; min-width: 160px; } .user-row { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); } table.grid { width: 100%; border-collapse: collapse; } table.grid th, table.grid td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; } table.grid th { color: var(--text-muted); font-weight: 600; font-size: 12.5px; } table.grid .num { text-align: right; font-variant-numeric: tabular-nums; } td.key { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .table-wrap { max-height: 360px; overflow: auto; margin-top: 8px; } .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; } .dot.on { background: var(--good); } .dot.off { background: #666; } /* Flash messages */ .flashes { max-width: 1100px; margin: 12px auto 0; padding: 0 16px; } .flash { padding: 8px 12px; border-radius: var(--radius); margin: 6px 0; border: 1px solid var(--border); } .flash.ok { background: #1f3323; border-color: #2e5a36; } .flash.error { background: #3a1f1f; border-color: #6a2e2e; } /* Login */ body.auth main { display: flex; justify-content: center; padding-top: 12vh; } .auth-card { width: 340px; display: flex; flex-direction: column; gap: 12px; } .auth-card h1 { margin: 0; } input.code { font-family: var(--mono); font-size: 22px; letter-spacing: .3em; text-align: center; } /* Patch editor */ .editor-main { position: absolute; inset: 49px 0 0 0; } #editor { position: absolute; inset: 0; overflow: hidden; outline: none; cursor: default; background-color: var(--surface-1); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 24px 24px; } #editor.panning { cursor: grabbing; } #wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; } #wires path { fill: none; stroke-width: 2.5; pointer-events: stroke; cursor: pointer; } #wires path.hit { stroke: transparent; stroke-width: 14; } #wires path.tcp { stroke: var(--series-1); } #wires path.udp { stroke: var(--series-2); } #wires path.none { stroke: #9a9a9a; } #wires path.selected { stroke: #fff; stroke-width: 3.5; } #wires path.temp { stroke: #ddd; stroke-dasharray: 6 4; pointer-events: none; } #wires path.bad { stroke-dasharray: 4 4; } #wires .wire-del { pointer-events: all; cursor: pointer; } #wires .wire-del circle { fill: var(--surface-3); stroke: #fff; stroke-width: 1.5; } #wires .wire-del path { stroke: #fff; stroke-width: 2; pointer-events: none; } #wires .wire-del:hover circle { fill: var(--danger); } #canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; } .marquee { position: absolute; z-index: 5; pointer-events: none; border: 1px solid #f08a24; background: rgba(240, 138, 36, .15); border-radius: 2px; } .editor-hint { position: absolute; left: 12px; bottom: 10px; color: var(--text-muted); font-size: 12px; background: rgba(26, 26, 25, .85); padding: 4px 8px; border-radius: 4px; pointer-events: none; } .node { position: absolute; width: 220px; background: var(--surface-3); border: 1px solid #111; border-radius: 7px; box-shadow: 0 4px 14px rgba(0, 0, 0, .45); user-select: none; } .node.selected { outline: 2px solid #f0f0f0; } .node-head { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px 6px 0 0; font-weight: 600; font-size: 12.5px; cursor: grab; } .node.client_source .node-head { background: var(--node-source); } .node.client_sink .node-head { background: var(--node-csink); } .node.public_sink .node-head { background: var(--node-psink); } .node.splitter .node-head { background: var(--node-split); } .node.tunnel_source .node-head { background: var(--node-tsource); } .node.tunnel_sink .node-head { background: var(--node-tsink); } .iface-wrap { display: block; width: 100%; } .node-head .title { flex: 1; } .node-head .x { background: none; border: 0; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; opacity: .7; padding: 0 2px; } .node-head .x:hover { opacity: 1; } .node-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; } .node-body label { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; } .node-body label > span { flex: none; width: 54px; } .node-body input, .node-body select { padding: 3px 6px; font-size: 12.5px; } .node-body .origin { display: flex; flex-direction: column; gap: 4px; } .node-body label.check { justify-content: flex-start; cursor: pointer; } .node-body label.check > span { width: auto; } .node-body label.check input { width: auto; flex: none; margin: 0; accent-color: var(--accent); } .node-body label.check.disabled { opacity: 0.5; cursor: default; } .node-status { font-size: 11.5px; color: var(--text-muted); min-height: 16px; display: flex; gap: 6px; align-items: center; } .node-status.err { color: #ff8a8a; } .socket { position: absolute; top: 40px; width: 14px; height: 14px; border-radius: 50%; background: #c8c8c8; border: 2px solid #111; cursor: crosshair; } .socket.in { left: -8px; } .socket.out { right: -8px; } .socket:hover, .socket.target { background: #fff; transform: scale(1.25); } .dropdown { position: relative; } .dropdown .menu { display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 20; min-width: 190px; background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); } .dropdown.open .menu { display: block; } .dropdown .menu button { display: block; width: 100%; text-align: left; font: inherit; color: var(--text-primary); background: none; border: 0; padding: 6px 10px; border-radius: 4px; cursor: pointer; } .dropdown .menu button:hover, .dropdown .menu button:focus { background: var(--accent); outline: none; } .save-state { color: var(--text-muted); font-size: 12.5px; min-width: 120px; } .save-state.err { color: #ff8a8a; } /* Help */ .help-toc { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; } .help { line-height: 1.55; } .help p, .help ul, .help ol { margin: 0 0 10px; } .help p:last-child, .help ul:last-child, .help ol:last-child { margin-bottom: 0; } .help li + li { margin-top: 6px; } .help-table { border-collapse: collapse; width: 100%; margin-bottom: 10px; } .help-table td { padding: 7px 10px 7px 0; border-top: 1px solid var(--border); vertical-align: top; } .help-table td:first-child { white-space: nowrap; font-weight: 600; width: 1%; } .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 8px; } .swatch.client_source { background: var(--node-source); } .swatch.client_sink { background: var(--node-csink); } .swatch.public_sink { background: var(--node-psink); } .swatch.splitter { background: var(--node-split); } .swatch.tunnel_source { background: var(--node-tsource); } .swatch.tunnel_sink { background: var(--node-tsink); } @media (max-width: 640px) { .help-table td:first-child { white-space: normal; } } /* Stats */ .filter-row { display: flex; gap: 16px; align-items: end; flex-wrap: wrap; margin-bottom: 16px; } .filter-row label { min-width: 280px; flex: 1; } .segmented { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; } .segmented button { font: inherit; background: var(--surface-2); color: var(--text-secondary); border: 0; padding: 6px 12px; cursor: pointer; border-right: 1px solid var(--border); } .segmented button:last-child { border-right: 0; } .segmented button.selected { background: var(--surface-3); color: var(--text-primary); font-weight: 600; } .tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; } .tile { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; } .tile-value { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; } .tile-label { color: var(--text-muted); font-size: 12.5px; } .chart-card { background: var(--surface-1); } .chart-head { display: flex; justify-content: space-between; align-items: center; } .chart { position: relative; height: 240px; } .chart.loading { opacity: .5; } .chart svg { width: 100%; height: 100%; display: block; } .chart .axis text { fill: var(--text-muted); font-size: 11px; } .chart .gridline { stroke: var(--grid); stroke-width: 1; } .chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; } .chart .s1 { stroke: var(--series-1); } .chart .s2 { stroke: var(--series-2); } .chart .bar { fill: var(--series-1); } .chart .bar.hover { fill: #6da7ec; } .chart .crosshair { stroke: var(--text-muted); stroke-width: 1; } .chart .marker { stroke: var(--surface-1); stroke-width: 2; } .chart .marker.s1 { fill: var(--series-1); } .chart .marker.s2 { fill: var(--series-2); } .chart .endlabel { font-size: 11.5px; fill: var(--text-secondary); } .chart .empty { fill: var(--text-muted); font-size: 13px; } .legend { display: flex; gap: 14px; color: var(--text-secondary); font-size: 12.5px; } .legend .key { display: inline-flex; align-items: center; gap: 6px; } .swatch-line { width: 16px; height: 2px; display: inline-block; } .swatch-line.s1 { background: var(--series-1); } .swatch-line.s2 { background: var(--series-2); } .tooltip { position: fixed; z-index: 50; pointer-events: none; background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; font-size: 12.5px; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); } .tooltip .t-time { color: var(--text-muted); margin-bottom: 4px; } .tooltip .t-row { display: flex; align-items: center; gap: 8px; } .tooltip .t-row strong { font-variant-numeric: tabular-nums; } .tooltip .t-row .muted { margin-left: 2px; } @media (max-width: 640px) { .topbar { gap: 8px; } .logout .who { display: none; } .editor-main { inset: 96px 0 0 0; } }