/* ws-term.css : styles of NDWS.term (terminal view, device information view, activity log view).
   Everything is prefixed ws-; colours come from the CSS variables of style.css so light and dark both work.
   The output container keeps the existing `.term` class (style.css: dark background, mono font, pre-wrap). */

/* ---------- terminal view ---------- */
.ws-term-view { display: flex; flex-direction: column; min-width: 0; }
.ws-term-view [hidden] { display: none !important; }
.ws-term-view > .term { flex: 0 0 auto; }
/* fill mode: the dock / floating window gives the view a definite height */
.ws-term-view.ws-fill { height: 100%; min-height: 0; }
.ws-term-view.ws-fill > .term { flex: 1 1 0; height: auto; min-height: 0; }
.ws-term-view .ws-prompt { flex: 0 1 auto; max-width: 70%; overflow-wrap: anywhere; }
/* soft-keyboard Tab button: only on coarse pointers (the view gets .ws-coarse from matchMedia); 32 px touch target, keeps the input focused */
.ws-term-view .ws-tabbtn { display: none; flex: 0 0 auto; align-items: center; justify-content: center; min-width: 44px; min-height: 32px; margin: 2px 0 2px 6px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 6px; background: rgba(255, 255, 255, .12); color: #fff; font: 600 12.5px var(--mono); cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.ws-term-view.ws-coarse .ws-tabbtn { display: inline-flex; }
.ws-term-view .ws-tabbtn:active { background: rgba(255, 255, 255, .28); }
.ws-term-view .ws-tabbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ws-term-view.ws-busy .ws-prompt { opacity: .6; }
.ws-term-view:focus-within > .term { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); }
.ws-term-ro { flex: 0 0 auto; background: #1a222c; color: var(--faint); font: 13px/1.45 var(--mono); padding: 6px 12px; border-top: 1px solid rgba(255, 255, 255, .06); }

/* ---------- device information view ---------- */
.ws-info-view { box-sizing: border-box; height: 100%; overflow: auto; padding: 12px 14px; background: var(--panel); color: var(--text); font-size: 13px; }
.ws-info-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.ws-info-title { font: 700 18px/1.2 var(--mono); overflow-wrap: anywhere; }
.ws-info-chip { border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 10px; font-size: 12px; color: var(--muted); background: var(--panel-2); }
.ws-info-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 0 0 14px; }
.ws-info-dl dt { color: var(--muted); }
.ws-info-dl dd { margin: 0; overflow-wrap: anywhere; }
.ws-info-dl .mono, .ws-info-tbl .mono { font-family: var(--mono); }
.ws-info-h { margin: 4px 0 8px; }
.ws-info-empty { color: var(--muted); padding: 8px 0; }
.ws-info-tblwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.ws-info-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ws-info-tbl th { text-align: left; font-weight: 600; color: var(--muted); background: var(--panel-2); padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ws-info-tbl td { padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ws-info-tbl tbody tr:last-child td { border-bottom: 0; }
.ws-st { white-space: nowrap; }
.ws-st .ws-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; background: var(--faint); }
.ws-st-up .ws-dot { background: var(--ok); }
.ws-st-down .ws-dot { background: var(--bad); }
.ws-st-admin .ws-dot { background: var(--faint); }
.ws-st-err .ws-dot { background: var(--warn); }
.ws-info-stp { margin-left: 8px; font-size: 11px; color: var(--warn); border: 1px solid currentColor; border-radius: 4px; padding: 0 5px; }
.ws-info-peer { min-height: 32px; min-width: 32px; padding: 0 6px; border: 0; background: transparent; color: var(--accent); font: 600 12.5px var(--mono); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.ws-info-peer:hover { color: var(--accent-2); }

/* ---------- activity log view ---------- */
.ws-log-view { box-sizing: border-box; display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--panel); color: var(--text); font-size: 13px; }
.ws-log-view [hidden] { display: none !important; }
.ws-log-bar { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.ws-log-filter { min-height: 32px; max-width: 100%; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel); color: var(--text); }
.ws-log-chk { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; user-select: none; }
.ws-log-btn { min-height: 32px; min-width: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel); color: var(--text); cursor: pointer; }
.ws-log-btn:hover { border-color: var(--accent); }
.ws-log-count { color: var(--muted); font-size: 12px; margin-left: auto; }
.ws-log-status { color: var(--ok); font-size: 12px; min-width: 1px; }
.ws-log-list { flex: 1 1 0; min-height: 0; overflow: auto; padding: 6px 10px; font: 12px/1.5 var(--mono); user-select: text; }
.ws-log-row { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.ws-log-row:last-child { border-bottom: 0; }
.ws-log-head { overflow-wrap: anywhere; }
.ws-log-time { color: var(--faint); margin-right: 8px; }
.ws-log-dev { color: var(--accent); margin-right: 8px; }
.ws-log-help .ws-log-cmd { color: var(--muted); }
.ws-log-err .ws-log-cmd { color: var(--bad); }
.ws-log-sys .ws-log-cmd { color: var(--warn); font-style: italic; }
.ws-log-out { margin: 3px 0 4px; padding: 4px 8px; max-height: 160px; overflow: auto; background: var(--panel-2); border-radius: 6px; color: var(--muted); font: inherit; white-space: pre-wrap; word-break: break-word; }
.ws-log-empty { padding: 24px 12px; text-align: center; color: var(--muted); }

.ws-log-btn:focus-visible, .ws-log-filter:focus-visible, .ws-log-chk input:focus-visible, .ws-info-peer:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
