/* The Log box of the Dashboard (logbox.js). Loaded after the kit and the light theme, so it needs no !important.
   Built from the kit's tokens (--uk-*); every rule that sets a side (start / end) uses the logical property, so the Persian (right-to-left) page mirrors itself. */
html body #page .lb { display: flex; flex-direction: column; gap: 10px; box-sizing: border-box; height: calc(100vh - 205px); min-height: 480px; margin: 0; padding: 14px 16px 12px; border-radius: 16px; border: 1px solid var(--uk-line); background: linear-gradient(180deg, #111a2e, #0e1626); box-shadow: none; overflow: hidden; }
html body #page .lb > * { flex: none; min-width: 0; }
html body #page .lb .sp { flex: 1; }
html body #page .lb-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
html body #page .lb-ttl h3 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: 0; text-transform: none; color: var(--uk-text); }
html body #page .lb-ttl small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--uk-mut); }
html body #page .lb-tabs { display: inline-flex; padding: 3px; border-radius: 999px; gap: 2px; } html body #page .lb-tabs button { height: 28px; padding: 0 14px; font-size: 12.5px; display: inline-flex; align-items: center; gap: 7px; }
html body #page .lb-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(61, 220, 151, .55); animation: lb-pulse 2s infinite; } html body #page .lb-pulse.off { background: var(--warn); animation: none; }
@keyframes lb-pulse { 70% { box-shadow: 0 0 0 7px rgba(61, 220, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); } }
html body #page .lb-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
html body #page .lb-search { position: relative; display: block; flex: 1 1 320px; max-width: 480px; margin: 0; }
html body #page .lb-search svg { position: absolute; inset-inline-start: 11px; top: 50%; width: 15px; height: 15px; margin-top: -7.5px; fill: none; stroke: var(--uk-mut); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
html body #page .lb-search input { width: 100%; height: 34px; box-sizing: border-box; padding-inline: 33px 32px; border-radius: 999px; font-size: 13px; }
html body #page .lb-x { position: absolute; inset-inline-end: 5px; top: 50%; width: 24px; height: 24px; margin-top: -12px; padding: 0; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .08); color: var(--uk-mut); font-size: 11px; line-height: 24px; } html body #page .lb-x[hidden] { display: none; }
html body #page .lb-kinds, html body #page .lb-cats, html body #page .lb-range { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; } html body #page .lb-range[hidden], html body #page #lb-live[hidden] { display: none; }
html body #page .lb button.lb-chip { height: 26px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--uk-line); background: transparent; box-shadow: none; color: var(--uk-mut); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; overflow: visible; backdrop-filter: none; flex: none; }
html body #page .lb button.lb-chip::after { display: none; }
html body #page .lb button.lb-chip:hover { color: var(--uk-text); border-color: var(--uk-line-2); background: rgba(255, 255, 255, .05); filter: none; box-shadow: none; }
html body #page .lb button.lb-chip.on { color: #fff; border-color: rgba(120, 170, 255, .45); background: #2a3a5e; box-shadow: inset 0 0 0 1px rgba(120, 170, 255, .2); }
html body #page .lb button.lb-chip small { font-size: 10.5px; font-weight: 600; opacity: .75; font-variant-numeric: tabular-nums; }
html body #page .lb-cats button.lb-chip { height: 24px; font-size: 11.5px; padding: 0 10px; }
html body #page .lb-dates { display: inline-flex; gap: 10px; align-items: center; margin-inline-start: 6px; font-size: 12px; color: var(--uk-mut); } html body #page .lb-dates label { display: inline-flex; align-items: center; gap: 6px; } html body #page .lb-dates input { height: 28px; border-radius: 9px; padding: 0 8px; font-size: 12px; color-scheme: dark; }
html body #page .lb button.sm { height: 28px; }

/* the rows */
html body #page .lb-list { flex: 1 1 auto; min-height: 120px; overflow-y: auto; overscroll-behavior: contain; margin-inline: -6px; padding-inline: 6px; scroll-behavior: auto; }
html body #page .lb-day { position: sticky; top: 0; z-index: 2; margin: 0; padding: 8px 4px 5px; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--uk-mut); background: linear-gradient(180deg, #0f1728 70%, rgba(15, 23, 40, 0)); }
html body #page .lb-row { margin: 0 0 2px; border-radius: 10px; border: 1px solid transparent; }
html body #page .lb-row:hover { background: rgba(255, 255, 255, .035); }
html body #page .lb-row.open { background: rgba(255, 255, 255, .045); border-color: var(--uk-line); }
html body #page .lb-r { display: grid; grid-template-columns: 62px 9px 118px minmax(0, 1fr) auto 12px; align-items: start; column-gap: 10px; min-height: 32px; padding: 7px 10px; cursor: pointer; font-size: 12.5px; line-height: 1.45; }
html body #page .lb-r time { padding-top: 1px; font-family: var(--mono); font-size: 11.5px; color: var(--uk-mut); direction: ltr; text-align: start; font-variant-numeric: tabular-nums; }
html body #page .lb-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--unk); }
html body #page .lb-row.ok .lb-dot { background: var(--ok); box-shadow: 0 0 7px rgba(61, 220, 151, .55); } html body #page .lb-row.info .lb-dot { background: var(--acc-2); }
html body #page .lb-row.warn .lb-dot { background: var(--warn); box-shadow: 0 0 7px rgba(255, 196, 77, .45); } html body #page .lb-row.bad .lb-dot { background: var(--bad); box-shadow: 0 0 7px rgba(255, 107, 139, .55); }
html body #page .lb-cat { padding-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--uk-mut); }
html body #page .lb-msg { min-width: 0; overflow-wrap: anywhere; unicode-bidi: plaintext; color: var(--uk-text); }
html body #page .lb-row:not(.open) .lb-t { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
html body #page .lb-row.bad .lb-t { color: #ff9db1; } html body #page .lb-row.warn .lb-t { color: #ffd98a; }
html body #page .lb-badge { display: inline-block; margin-inline-end: 7px; padding: 0 7px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; vertical-align: 1px; }
html body #page .lb-badge.failed { background: rgba(255, 107, 139, .16); color: #ff8aa2; border: 1px solid rgba(255, 107, 139, .4); } html body #page .lb-badge.incomplete { background: rgba(255, 196, 77, .14); color: #ffd075; border: 1px solid rgba(255, 196, 77, .4); }
html body #page .lb-n { margin-inline-start: 7px; padding: 0 7px; border-radius: 999px; font-style: normal; font-size: 11px; font-weight: 700; background: rgba(255, 255, 255, .09); color: var(--uk-mut); direction: ltr; unicode-bidi: isolate; }
html body #page .lb-who { padding-top: 1px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--uk-mut); }
html body #page .lb-chev { padding-top: 1px; font-size: 14px; line-height: 1; color: var(--uk-mut); transition: transform .15s; } html body #page .lb-row.open .lb-chev { transform: rotate(90deg); }
html[dir="rtl"] body #page .lb-chev { transform: scaleX(-1); } html[dir="rtl"] body #page .lb-row.open .lb-chev { transform: scaleX(-1) rotate(90deg); }
html body #page .lb-row.fresh { animation: lb-fresh 2.4s ease-out; }
@keyframes lb-fresh { 0% { background: rgba(124, 131, 255, .30); } 100% { background: transparent; } }
html body #page .lb-det { margin: 0 10px 10px; padding: 10px 12px 12px; border-radius: 10px; background: rgba(0, 0, 0, .22); border: 1px solid var(--uk-line); font-size: 12px; }
html body #page .lb-det dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; } html body #page .lb-det dt { color: var(--uk-mut); } html body #page .lb-det dd { margin: 0; overflow-wrap: anywhere; color: var(--uk-text); }
html body #page .lb-times { font-family: var(--mono); font-size: 11px; direction: ltr; unicode-bidi: isolate; }
html body #page .lb-tech h5 { margin: 12px 0 5px; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--uk-mut); }
html body #page .lb-tech pre { max-height: 240px; margin: 0; padding: 9px 11px; overflow: auto; border-radius: 8px; background: #0a101d; border: 1px solid var(--uk-line); color: #cfd6ee; font: 11.5px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; direction: ltr; text-align: start; unicode-bidi: plaintext; }
html body #page .lb-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
html body #page .lb-empty { display: grid; place-items: center; align-content: center; gap: 6px; min-height: 180px; text-align: center; color: var(--uk-mut); font-size: 12.5px; } html body #page .lb-empty b { font-size: 14px; color: var(--uk-text); } html body #page .lb-empty.bad b { color: var(--bad); } html body #page .lb-empty .spin { width: 20px; height: 20px; }

/* the foot: where you are in the log, and the promise that nothing is deleted */
html body #page .lb-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding-top: 9px; border-top: 1px solid var(--uk-line); font-size: 12px; color: var(--uk-mut); font-variant-numeric: tabular-nums; }
html body #page .lb-fl { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; } html body #page .lb-keep { font-size: 11.5px; }
html body #page .lb-pager { display: inline-flex; align-items: center; gap: 8px; } html body #page .lb-pager button.sm { width: 28px; padding: 0; font-size: 15px; line-height: 1; } html body #page .lb-pager input { width: 56px; height: 26px; padding: 0 6px; border-radius: 8px; text-align: center; font-size: 12px; }
html body #page .lb-foot select { height: 28px; padding: 0 8px; border-radius: 9px; font-size: 12px; }

/* the light theme */
html[data-mode="light"] body #page .lb { background: #fff; border-color: rgba(30, 50, 100, .14); }
html[data-mode="light"] body #page .lb-day { background: linear-gradient(180deg, #fff 70%, rgba(255, 255, 255, 0)); color: #4d5b7c; }
html[data-mode="light"] body #page .lb-row:hover { background: #f4f7fd; } html[data-mode="light"] body #page .lb-row.open { background: #f4f7fd; border-color: rgba(30, 50, 100, .14); }
html[data-mode="light"] body #page .lb button.lb-chip { color: #4d5b7c; } html[data-mode="light"] body #page .lb button.lb-chip:hover { color: #1b2540; background: #eef2fa; }
html[data-mode="light"] body #page .lb button.lb-chip.on { color: #1456c8; background: #e3edff; border-color: #9bbcf3; box-shadow: none; }
html[data-mode="light"] body #page .lb-row.bad .lb-t { color: #b4232f; } html[data-mode="light"] body #page .lb-row.warn .lb-t { color: #8a5a00; }
html[data-mode="light"] body #page .lb-badge.failed { color: #b4232f; background: #fdecee; border-color: rgba(200, 40, 60, .4); } html[data-mode="light"] body #page .lb-badge.incomplete { color: #8a5a00; background: #fff4dc; border-color: rgba(161, 92, 0, .4); }
html[data-mode="light"] body #page .lb-n { background: #e9eef9; color: #4d5b7c; } html[data-mode="light"] body #page .lb-x { background: #e9eef9; }
html[data-mode="light"] body #page .lb-det { background: #f7f9fe; } html[data-mode="light"] body #page .lb-tech pre { background: #fff; color: #1b2540; }
html[data-mode="light"] body #page .lb-dates input { color-scheme: light; }
html[data-mode="light"] body #page .lb-row.fresh { animation-name: lb-fresh-l; } @keyframes lb-fresh-l { 0% { background: #dfe8ff; } 100% { background: transparent; } }

/* narrow screens: the line breaks into two, the box grows with its content */
@media (max-width: 760px) {
  html body #page .lb { height: auto; max-height: none; min-height: 0; padding: 12px; }
  html body #page .lb-list { max-height: 70vh; }
  html body #page .lb-search { flex-basis: 100%; max-width: none; }
  html body #page .lb-r { grid-template-columns: 56px 9px minmax(0, 1fr) 12px; row-gap: 2px; } html body #page .lb-cat { grid-column: 3; grid-row: 1; } html body #page .lb-msg { grid-column: 1 / -1; grid-row: 2; } html body #page .lb-who { display: none; }
  html body #page .lb-kinds, html body #page .lb-cats, html body #page .lb-range { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } html body #page .lb-kinds::-webkit-scrollbar, html body #page .lb-cats::-webkit-scrollbar, html body #page .lb-range::-webkit-scrollbar { display: none; }
}
:root[data-anim="off"] .lb-row.fresh, :root[data-anim="off"] .lb-pulse { animation: none; }

/* the Log and, beside it, the small card of the tunnels' connections (only: connected / unstable / disconnected, the broken ones first) */
html body #page .dash-row { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 14px; align-items: start; }
html body #page .tn-card { display: flex; flex-direction: column; gap: 10px; box-sizing: border-box; height: calc(100vh - 205px); min-height: 480px; padding: 14px 12px 8px 14px; border-radius: 16px; border: 1px solid var(--uk-line); background: linear-gradient(180deg, #111a2e, #0e1626); overflow: hidden; }
html body #page .tn-card > * { flex: none; min-width: 0; }
html body #page .tn-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-inline-end: 4px; }
html body #page .tn-t b { display: block; font-size: 16px; font-weight: 650; color: var(--uk-text); } html body #page .tn-t small { display: block; margin-top: 2px; font-size: 12px; color: var(--uk-mut); font-variant-numeric: tabular-nums; }
html body #page .tn-bar { display: flex; gap: 3px; height: 6px; margin-inline-end: 4px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, .06); }
html body #page .tn-bar u { display: block; height: 100%; text-decoration: none; min-width: 6px; } html body #page .tn-bar u.green { background: var(--ok); } html body #page .tn-bar u.yellow { background: var(--warn); } html body #page .tn-bar u.red { background: var(--bad); } html body #page .tn-bar u.grey { background: var(--unk); }
html body #page .tn-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-inline-end: 4px; scrollbar-width: thin; }
html body #page .tn-r { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; min-height: 34px; padding: 6px 8px; border-radius: 10px; cursor: pointer; font-size: 13px; }
html body #page .tn-r:hover { background: rgba(255, 255, 255, .05); }
html body #page .tn-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--uk-text); font-weight: 600; }
html body #page .tn-s { font-size: 11.5px; white-space: nowrap; color: var(--uk-mut); font-variant-numeric: tabular-nums; } html body #page .tn-s.green { color: var(--ok); } html body #page .tn-s.yellow { color: var(--warn); } html body #page .tn-s.red { color: var(--bad); }
html body #page .tn-none { padding: 24px 8px; text-align: center; color: var(--uk-mut); font-size: 12.5px; }
html[data-mode="light"] body #page .tn-card { background: #fff; border-color: rgba(30, 50, 100, .14); } html[data-mode="light"] body #page .tn-bar { background: #e9eef9; }
html[data-mode="light"] body #page .tn-r:hover { background: #f4f7fd; } html[data-mode="light"] body #page .tn-s.green { color: #0f7a4a; } html[data-mode="light"] body #page .tn-s.yellow { color: #8a5a00; } html[data-mode="light"] body #page .tn-s.red { color: #b4232f; }
@media (max-width: 980px) {
  html body #page .dash-row { grid-template-columns: minmax(0, 1fr); } html body #page .tn-card { order: -1; height: auto; min-height: 0; max-height: none; } html body #page .tn-list { max-height: 260px; }
}
