/* Desk extras: address book, tunnels, recording and whiteboard.
   Colours come from the app tokens; inside the Desk dialog the --desk tokens
   keep it on the same paper as the rest of the panel. */

/* Address book on the Desk home screen. */
.dx-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  min-height: 172px;
  border-top: 1px solid var(--desk-line);
}
.dx-panel-head { display: flex; align-items: center; gap: 7px; }
.dx-panel-head strong { font-size: 12px; letter-spacing: .02em; }
.dx-panel-head .dx-spacer { flex: 1; }
.dx-tabs { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--desk-line); border-radius: 6px; }
.dx-tab {
  min-height: 22px; padding: 0 8px; font-size: 11px;
  color: var(--desk-muted); background: transparent; border: 0; border-radius: 4px;
}
.dx-tab.is-active { color: var(--desk-ink); background: color-mix(in srgb, var(--desk-accent) 14%, transparent); }
.dx-search { position: relative; }
.dx-search input { padding-left: 28px; }
.dx-search svg { position: absolute; left: 8px; top: 50%; width: 13px; height: 13px; transform: translateY(-50%); color: var(--desk-muted); pointer-events: none; }
.dx-list { display: flex; flex-direction: column; gap: 1px; max-height: 198px; overflow: auto; }
.dx-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 8px; padding: 5px 4px; border-radius: 5px;
}
.dx-row:hover { background: color-mix(in srgb, var(--desk-ink) 5%, transparent); }
.dx-main { display: flex; align-items: center; gap: 7px; min-width: 0; }
.dx-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--desk-muted); opacity: .45; }
.dx-dot.is-online { background: #2f9e63; opacity: 1; box-shadow: 0 0 0 2px color-mix(in srgb, #2f9e63 20%, transparent); }
.dx-names { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dx-alias { overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.dx-sub { overflow: hidden; font-size: 10.5px; color: var(--desk-muted); text-overflow: ellipsis; white-space: nowrap; }
.dx-tags { display: inline-flex; gap: 3px; margin-left: 2px; }
.dx-tag { padding: 0 5px; font-size: 9.5px; line-height: 15px; color: var(--desk-muted); border: 1px solid var(--desk-line); border-radius: 999px; }
.dx-actions { display: flex; align-items: center; gap: 3px; }
.dx-actions button { min-height: 24px; padding: 1px 8px; font-size: 11px; }
.orax-desk-dialog .dx-row .orax-desk-primary {
  color: var(--desk-accent); font-weight: 600;
  background: transparent; border-color: color-mix(in srgb, var(--desk-accent) 45%, var(--desk-line));
}
.orax-desk-dialog .dx-row .orax-desk-primary:hover { background: color-mix(in srgb, var(--desk-accent) 10%, transparent); }
.dx-empty { padding: 14px 4px; font-size: 12px; color: var(--desk-muted); text-align: center; }
.dx-note { font-size: 11px; color: var(--desk-muted); }
.dx-note.is-error { color: var(--danger); }
.dx-success { color: #2f9e63; }
.dx-form { display: grid; gap: 8px; }
.dx-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dx-field { display: grid; gap: 3px; }
.dx-field > span { font-size: 10.5px; color: var(--desk-muted); }
.dx-field input, .dx-field select { min-height: 28px; padding: 4px 8px; font-size: 12px; }
.dx-form-actions { display: flex; justify-content: flex-end; gap: 6px; }

/* Whiteboard over the remote screen. */
.dx-stage-wrap { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
.dx-stage-wrap > img { margin: 0; }
.dx-ink {
  position: absolute; inset: 0; width: 100%; height: 100%;
  touch-action: none; cursor: crosshair; z-index: 2;
}
.dx-ink[hidden] { display: none; }
.dx-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px; }
.dx-toolbar button { display: inline-flex; align-items: center; gap: 4px; min-height: 26px; padding: 2px 8px; font-size: 11px; }
.dx-toolbar button.is-active { color: var(--desk-ink); background: color-mix(in srgb, var(--desk-accent) 16%, transparent); border-color: var(--desk-accent); }
.dx-rec-dot { width: 7px; height: 7px; border-radius: 50%; background: #ff3b30; animation: dx-rec 1.4s ease-in-out infinite; }
@keyframes dx-rec { 50% { opacity: .25; } }
.dx-draw-options {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 4px; padding: 5px 0 0; font-size: 11px; color: var(--desk-muted);
}
.dx-swatch { width: 17px; height: 17px; min-height: 17px; padding: 0; border-radius: 50%; border: 1px solid var(--desk-line); }
.dx-swatch.is-active { box-shadow: 0 0 0 2px var(--desk-accent); }
.dx-sep { width: 1px; height: 17px; margin: 0 3px; background: var(--desk-line); }
.dx-muted { color: var(--desk-muted); }

/* Session tools modal. */
.dx-modal {
  width: min(520px, calc(100vw - 32px));
  padding: 0; color: var(--text); background: var(--bg-panel);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 20px 60px #0006;
}
.dx-modal::backdrop { background: color-mix(in srgb, var(--bg, #0A0A0A) 45%, transparent); }
.dx-modal-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.dx-modal-head strong { margin-right: auto; font-size: 13px; }
.dx-modal-body { display: grid; gap: 10px; padding: 13px 14px; }
.dx-modal-body label { display: grid; gap: 4px; font-size: 11.5px; color: var(--text-muted); }
.dx-modal-body input, .dx-modal-body select { min-height: 30px; padding: 4px 8px; color: var(--text); background: var(--bg-element); border: 1px solid var(--border); border-radius: 6px; }
.dx-modal .orax-desk-primary, .settings-page .orax-desk-primary {
  color: var(--btn-primary-fg, #18181B); background: var(--accent, #D4D4D7); border-color: transparent;
}
.dx-modal-actions { display: flex; justify-content: flex-end; gap: 6px; }
.dx-tunnel-list { display: flex; flex-direction: column; gap: 6px; padding: 0 14px; }
.dx-tunnel {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px;
  padding: 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-element);
}
.dx-tunnel b { font-size: 12px; }
.dx-tunnel small { display: block; color: var(--text-muted); font-size: 10.5px; }
.dx-tunnel-close { align-self: center; }
.dx-modal > .dx-note, .dx-modal > .dx-empty { margin: 0; padding: 0 14px 12px; }
.dx-counter { font-variant-numeric: tabular-nums; }

/* Settings > Desk. */
.dx-settings-list { display: flex; flex-direction: column; gap: 2px; }
.dx-settings-row { display: flex; align-items: center; gap: 8px; padding: 7px 2px; border-bottom: 1px solid var(--border-subtle); }
.dx-settings-row:last-child { border-bottom: 0; }
.dx-settings-row .dx-grow { flex: 1; min-width: 0; }
.dx-settings-row b { display: block; font-size: 12px; font-weight: 600; }
.dx-settings-row small { display: block; color: var(--text-muted); font-size: 11px; }
.dx-settings-row .btn { flex: 0 0 auto; }
.dx-folder { display: flex; gap: 6px; align-items: center; }
.dx-folder input { flex: 1; min-width: 0; }
.dx-recording { display: flex; gap: 8px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--border-subtle); }
.dx-recording:last-child { border-bottom: 0; }
.dx-recording .dx-grow { flex: 1; min-width: 0; }
.dx-recording b, .dx-recording small { display: block; }
.dx-recording small { margin-top: 2px; color: var(--text-muted); font-size: 11px; }
.dx-video { width: 100%; max-height: min(68vh, 520px); background: #000; border-radius: 8px; }
.dx-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 7px; font-size: 10.5px; font-weight: 600; letter-spacing: .04em;
  color: #fff; background: #c92a2a; border-radius: 999px;
}
.dx-badge.is-quiet { color: var(--text-muted); background: var(--bg-element); border: 1px solid var(--border); }
.dx-host-status { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dx-host-consent {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  width: 100%; padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--desk-accent) 55%, var(--desk-line));
  border-radius: 8px; background: color-mix(in srgb, var(--desk-accent) 8%, transparent);
}
.dx-host-consent > span { flex: 1; min-width: 180px; font-size: 12px; }
.dx-host-consent .dx-actions { flex: 0 0 auto; }
.settings-page .settings-help { margin: 2px 0 10px; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.settings-page .dx-note { color: var(--text-muted); font-size: 11.5px; }
.settings-page .dx-note.is-error { color: var(--danger, var(--error)); }
.orax-desk-stage:has(.dx-stage-wrap) { padding: 8px 0; }

@media (max-width: 540px) {
  .dx-grid2 { grid-template-columns: 1fr; }
}
