/*
 * Sign-in, Setup and Settings screens (FE-SETUP).
 * Rules are scoped under the view roots (.v-auth, .v-setup, .v-settings) or under the root class
 * of a sheet these views open (sheets live outside the view): .au-tip (install tip),
 * .su-sheet (Setup sheets: add a device, add receiver / TV, pairing, scanner, test result) and
 * .st-sheet (Settings sheets).
 * Everything builds on the tokens and shared components in app.css, so themes, accent colors
 * and large-button mode apply automatically.
 */

/* =================================================================== sign-in */
.v-auth {
  padding-top: 28px;
  padding-bottom: 28px;
}

.v-auth .au-wrap {
  width: 100%;
  max-width: 440px;
  margin: auto;
  padding: 12px 0;
}

.v-auth .au-wrap.au-setup {
  max-width: 980px;
}

.v-auth .au-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 22px;
  text-align: center;
}

.v-auth .au-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  box-shadow: 0 16px 40px -10px rgba(67, 56, 202, 0.55);
}

.v-auth .au-title {
  margin-top: 16px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.v-auth .au-lead {
  max-width: 520px;
  margin: 8px 0 0;
  color: var(--text-dim);
  font-size: 15.5px;
  line-height: 1.5;
}

.v-auth .au-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

@media (min-width: 860px) {
  .v-auth .au-columns {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: start;
    gap: 20px;
  }
}

.v-auth .au-card {
  padding: 22px 22px 20px;
}

.v-auth .au-seg {
  display: flex;
  width: 100%;
  margin-bottom: 20px;
}

.v-auth .au-card-title {
  font-size: 21px;
  font-weight: 750;
}

.v-auth .au-card-lead {
  margin: 6px 0 0;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.45;
}

.v-auth .au-form {
  margin-top: 18px;
}

.v-auth .au-pw {
  position: relative;
}

.v-auth .au-pw-input {
  padding-right: 52px;
}

.v-auth .au-eye {
  position: absolute;
  top: 50%;
  right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transform: translateY(-50%);
}

.v-auth .au-eye:active {
  background: var(--surface-2);
  color: var(--text);
}

.v-auth .au-remember {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: -2px 0 12px;
  cursor: pointer;
}

.v-auth .au-remember-text {
  font-size: 15px;
  font-weight: 550;
}

.v-auth .au-error {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 14px;
  padding: 11px 13px;
  border: 1px solid rgba(var(--danger-rgb), 0.32);
  border-radius: 12px;
  background: rgba(var(--danger-rgb), 0.11);
  color: var(--danger);
  font-size: 14.5px;
  font-weight: 550;
  line-height: 1.4;
}

.v-auth .au-error .icon {
  margin-top: 1px;
}

.v-auth .au-submit {
  margin-top: 4px;
}

.v-auth .au-btn-spin {
  width: 18px;
  height: 18px;
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
}

.v-auth .au-note {
  margin: 16px 0 0;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.v-auth .au-foot {
  margin: 20px 0 0;
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
}

.v-auth .au-checks .card-header h2 {
  font-size: 17px;
}

.v-auth .au-checks-body {
  padding: 14px 16px 16px;
}

.v-auth .au-checks-pad {
  margin: 0;
  padding: 6px 0;
}

.v-auth .au-checks-summary {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
}

.v-auth .au-checks-summary.ok {
  background: rgba(var(--success-rgb), 0.12);
}

.v-auth .au-checks-summary.ok .icon {
  color: var(--success);
}

.v-auth .au-checks-summary.bad {
  background: rgba(var(--danger-rgb), 0.11);
}

.v-auth .au-checks-summary.bad .icon {
  color: var(--danger);
}

.v-auth .au-checks-list {
  margin-top: 8px;
}

.v-auth .au-check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 10px 2px;
}

.v-auth .au-check + .au-check {
  border-top: 1px solid var(--border);
}

.v-auth .au-check-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.v-auth .au-check.ok .au-check-ic {
  background: rgba(var(--success-rgb), 0.15);
  color: var(--success);
}

.v-auth .au-check.opt .au-check-ic {
  background: rgba(var(--warning-rgb), 0.16);
  color: var(--warning);
}

.v-auth .au-check.bad .au-check-ic {
  background: rgba(var(--danger-rgb), 0.14);
  color: var(--danger);
}

.v-auth .au-check-text {
  flex: 1 1 auto;
  min-width: 0;
}

.v-auth .au-check-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
}

.v-auth .au-check-detail {
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

@media (max-width: 480px) {
  .v-auth .au-card {
    padding: 18px 16px 16px;
  }

  .v-auth .au-title {
    font-size: 25px;
  }
}

/* Install tip (sheet shown after sign-in on iPad / iPhone Safari). */
.au-tip {
  padding: 2px 2px 0;
  text-align: center;
}

.au-tip-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  margin: 4px auto 14px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.au-tip-lead {
  margin: 0 auto 6px;
  max-width: 400px;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.5;
}

.au-tip-steps {
  max-width: 400px;
  margin: 12px auto 0;
  padding-left: 22px;
  font-size: 15px;
  line-height: 1.55;
  text-align: left;
}

.au-tip-steps li + li {
  margin-top: 6px;
}

/* ===================================================================== setup */
.v-setup .su-header {
  margin-bottom: 18px;
}

.v-setup .su-titles {
  flex: 1 1 auto;
  min-width: 0;
}

.v-setup .su-loc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
}

.v-setup .su-loc-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v-setup .su-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.v-setup .su-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

@media (min-width: 1000px) {
  .v-setup .su-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    align-items: start;
    gap: 20px;
  }

  .v-setup .su-col {
    gap: 20px;
  }
}

.v-setup .su-card .card-header {
  gap: 12px;
}

.v-setup .su-card-ic,
.v-settings .st-card-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.v-setup .su-card-titles {
  flex: 1 1 auto;
  min-width: 0;
}

.v-setup .su-card-titles h2 {
  font-size: 17px;
  font-weight: 700;
}

.v-setup .su-card-sub {
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
  font-size: 13px;
}

.v-setup .su-card-sub:empty {
  display: none;
}

.v-setup .su-card-actions {
  display: flex;
  flex: none;
  gap: 8px;
}

.v-setup .su-card-actions:empty {
  display: none;
}

.v-setup .su-card-body {
  padding: 16px;
}

.v-setup .su-empty {
  margin: 0;
  padding: 4px 2px;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.5;
}

.v-setup .su-note {
  margin: 12px 2px 0;
}

.v-setup .su-intro p {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.5;
}

.v-setup .su-intro p:last-child {
  margin-bottom: 0;
}

/* Callouts (view and Setup sheets). */
.v-setup .su-notice,
.su-sheet .su-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 12px;
  padding: 11px 13px;
  border: 1px solid rgba(var(--accent-rgb), 0.26);
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.45;
}

.v-setup .su-notice > .icon,
.su-sheet .su-notice > .icon {
  margin-top: 1px;
  color: var(--accent-text);
}

.v-setup .su-notice.warn,
.su-sheet .su-notice.warn {
  border-color: rgba(var(--warning-rgb), 0.36);
  background: rgba(var(--warning-rgb), 0.12);
}

.v-setup .su-notice.warn > .icon,
.su-sheet .su-notice.warn > .icon {
  color: var(--warning);
}

.v-setup .su-notice-text,
.su-sheet .su-notice-text {
  flex: 1 1 auto;
  min-width: 0;
}

.v-setup .su-notice-act,
.su-sheet .su-notice-act {
  margin-top: 8px;
}

/* Progress panel (channel scan in the view, network scan in the sheet). */
.v-setup .su-progress,
.su-sheet .su-progress {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.v-setup .su-progress-top,
.su-sheet .su-progress-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
  font-size: 14.5px;
  font-weight: 600;
}

.v-setup .su-progress-text,
.su-sheet .su-progress-text {
  flex: 1 1 auto;
  min-width: 0;
}

.v-setup .su-progress-count,
.su-sheet .su-progress-count {
  flex: none;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}

.v-setup .su-progress .progress,
.su-sheet .su-progress .progress {
  height: 6px;
}

.v-setup .su-progress-bottom,
.su-sheet .su-progress-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}

/* --- Connection */
.v-setup .su-opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.v-setup .su-opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.v-setup .su-opt.on {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.v-setup .su-opt:disabled {
  opacity: 0.5;
  cursor: default;
}

.v-setup .su-opt:not(:disabled):active {
  transform: scale(0.99);
}

.v-setup .su-radio {
  position: relative;
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  transition: border-color 0.15s;
}

.v-setup .su-opt.on .su-radio {
  border-color: var(--accent);
}

.v-setup .su-opt.on .su-radio::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}

.v-setup .su-opt-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.v-setup .su-opt-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 15.5px;
  font-weight: 650;
}

.v-setup .su-opt-sub {
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.4;
}

.v-setup .su-connection .su-notice {
  margin: 12px 0 0;
}

/* --- Devices (receivers and LG / Samsung TV sets) */
.v-setup .su-list + .su-actions,
.v-setup .su-intro + .su-actions {
  margin-top: 14px;
}

.v-setup .su-box {
  padding-right: 8px;
}

.v-setup .su-box-main {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  gap: 12px;
  min-width: 0;
  min-height: 44px;
}

.v-setup .su-box-end {
  gap: 4px;
}

.v-setup .su-box-ic.tvset,
.v-setup .su-tv-ic.tvset {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.v-setup .su-pair {
  flex: none;
}

.v-setup .su-pair-btn {
  flex: none;
}

.v-setup .su-pair-btn.warn {
  border-color: rgba(var(--warning-rgb), 0.45);
  color: var(--warning);
}

/* Phones: the Pair / Trust TV button already tells the state, so the name keeps the room. */
@media (max-width: 480px) {
  .v-setup .su-box.has-act .su-pair {
    display: none;
  }

  .v-setup .su-pair-btn {
    padding-left: 10px;
    padding-right: 10px;
  }
}

.v-setup .su-box-ic,
.v-setup .su-tv-ic,
.v-setup .su-room-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text-dim);
}

.v-setup .su-box-ic {
  width: 42px;
  height: 42px;
}

.v-setup .su-box-ic.demo {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.v-setup .su-dot {
  display: inline-flex;
  align-items: center;
  flex: none;
}

.v-setup .su-box .li-end {
  color: var(--text-faint);
}

@media (max-width: 560px) {
  .v-setup .su-actions > .btn {
    flex: 1 1 auto;
  }
}

/* --- Buttons that look like plain text (tap a name to rename it) */
.v-setup .su-plain {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.v-setup .su-plain:active .li-title {
  color: var(--accent-text);
}

.v-setup .su-edit-ic {
  flex: none;
  color: var(--text-faint);
}

@media (hover: hover) and (pointer: fine) {
  .v-setup .su-plain:hover .su-edit-ic {
    color: var(--accent-text);
  }
}

.v-setup .su-danger {
  color: var(--danger);
}

/* --- TVs */
.v-setup .su-group-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 18px 4px 8px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.v-setup .su-group-title:first-child {
  margin-top: 0;
}

.v-setup .su-tv {
  flex-wrap: wrap;
  row-gap: 8px;
}

.v-setup .su-tv-ic,
.v-setup .su-room-ic {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.v-setup .su-tv .li-main {
  flex: 1 1 150px;
}

.v-setup .su-tv-ctl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 12px;
  margin-left: auto;
}

.v-setup .su-room,
.v-setup .su-link {
  width: 156px;
  height: 38px;
  min-height: 38px;
  padding-left: 12px;
  border-radius: 10px;
}

.v-setup .su-link {
  width: 184px;
}

.v-setup .su-link.on {
  border-color: rgba(var(--accent-rgb), 0.5);
}

.v-setup .su-switch-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.v-setup .su-move {
  display: flex;
  gap: 2px;
}

.v-setup .su-tv.is-hidden .su-tv-ic,
.v-setup .su-tv.is-hidden .li-main {
  opacity: 0.55;
}

.v-setup .su-tv.is-missing .su-tv-ic {
  background: rgba(var(--danger-rgb), 0.13);
  color: var(--danger);
}

.v-setup .su-remove {
  color: var(--danger);
}

@media (max-width: 600px) {
  .v-setup .su-tv-ctl {
    flex-basis: 100%;
    justify-content: flex-start;
    padding-left: 48px;
  }

  .v-setup .su-room,
  .v-setup .su-link {
    width: auto;
    flex: 1 1 130px;
    max-width: 220px;
  }
}

/* --- Rooms */
.v-setup .su-room-btns {
  gap: 0;
}

/* --- Channels */
.v-setup .su-chscan-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.v-setup .su-num-field {
  width: 86px;
  margin-bottom: 0;
}

.v-setup .su-num {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.v-setup .su-chscan-go {
  flex: 1 1 auto;
  max-width: 260px;
}

.v-setup .su-chscan .hint {
  margin: 10px 2px 0;
}

.v-setup .su-chscan .su-notice {
  margin: 12px 0 0;
}

.v-setup .su-chresult {
  padding: 14px;
  border: 1px solid rgba(var(--success-rgb), 0.32);
  border-radius: 14px;
  background: rgba(var(--success-rgb), 0.08);
}

.v-setup .su-chresult-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.v-setup .su-chresult-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--success);
  color: #ffffff;
}

.v-setup .su-chresult-text {
  min-width: 0;
  font-size: 15.5px;
}

.v-setup .su-chresult .hint {
  margin: 0 0 12px;
}

.v-setup .su-subhead {
  margin: 22px 2px 10px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.v-setup .su-chadd {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.v-setup .su-chadd .input {
  flex: 1 1 auto;
  min-width: 0;
}

.v-setup .su-search {
  position: relative;
  margin-bottom: 10px;
}

.v-setup .su-search > .icon {
  position: absolute;
  top: 50%;
  left: 13px;
  color: var(--text-faint);
  pointer-events: none;
  transform: translateY(-50%);
}

.v-setup .su-search .input {
  padding-left: 40px;
}

.v-setup .su-ch {
  gap: 10px;
  min-height: 56px;
  padding: 8px 8px 8px 12px;
}

.v-setup .su-ch-end {
  gap: 2px;
}

.v-setup .su-ch-end .switch {
  margin: 0 6px;
}

.v-setup .su-star {
  color: var(--text-faint);
}

.v-setup .su-star.on {
  color: var(--warning);
}

.v-setup .su-ch.is-hidden .ch-badge,
.v-setup .su-ch.is-hidden .li-main {
  opacity: 0.5;
}

.v-setup .su-more {
  margin-top: 10px;
}

@media (max-width: 400px) {
  .v-setup .su-ch-end .switch {
    margin: 0 2px;
  }

  .v-setup .su-chadd .btn > span {
    display: none;
  }
}

/* --- Help */
.v-setup .su-help-item {
  display: flex;
  gap: 14px;
}

.v-setup .su-help-item + .su-help-item {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.v-setup .su-help-num {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 750;
}

.v-setup .su-help-text {
  min-width: 0;
}

.v-setup .su-help-title {
  margin: 3px 0 4px;
  font-size: 15.5px;
  font-weight: 650;
}

.v-setup .su-help-text p {
  margin: 0 0 4px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
}

/* ================================================= Setup sheets (.su-sheet) */
.su-sheet .hint {
  margin: 0 0 12px;
}

.su-sheet .su-result {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 14.5px;
  line-height: 1.45;
}

.su-sheet .su-result.ok {
  border-color: rgba(var(--success-rgb), 0.35);
  background: rgba(var(--success-rgb), 0.1);
}

.su-sheet .su-result.ok > .icon {
  color: var(--success);
}

.su-sheet .su-result.bad {
  border-color: rgba(var(--danger-rgb), 0.32);
  background: rgba(var(--danger-rgb), 0.09);
}

.su-sheet .su-result.bad > .icon {
  color: var(--danger);
}

.su-sheet .su-result.busy {
  align-items: center;
  color: var(--text-dim);
}

.su-sheet .su-result-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.su-sheet .su-result-hint {
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 13.5px;
}

.su-sheet .su-row2 {
  display: flex;
  gap: 10px;
}

.su-sheet .su-grow {
  flex: 1 1 auto;
  min-width: 0;
}

.su-sheet .su-port {
  flex: 0 0 104px;
}

.su-sheet .su-result-act {
  margin-top: 8px;
}

/* --- "Add a device" chooser */
.su-typelist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.su-sheet .su-type {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 72px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}

.su-sheet .su-type:active {
  background: var(--surface-2);
  transform: scale(0.99);
}

@media (hover: hover) and (pointer: fine) {
  .su-sheet .su-type:hover {
    border-color: rgba(var(--accent-rgb), 0.45);
  }
}

.su-sheet .su-type-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.su-sheet .su-type.cable .su-type-ic {
  background: var(--surface-2);
  color: var(--text-dim);
}

.su-sheet .su-type-text {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 2px;
  min-width: 0;
}

.su-sheet .su-type-title {
  font-size: 16px;
  font-weight: 650;
}

.su-sheet .su-type-sub {
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.4;
}

.su-sheet .su-type-go {
  flex: none;
  color: var(--text-faint);
}

.su-cable .su-cable-tip {
  margin: 12px 2px 0;
}

/* --- "Trust TV" step (TVs with a secure connection, once per browser) */
.su-sheet .su-trust {
  margin-top: 4px;
  padding: 14px;
  border: 1px solid rgba(var(--warning-rgb), 0.38);
  border-radius: 14px;
  background: rgba(var(--warning-rgb), 0.1);
  font-size: 14.5px;
  line-height: 1.45;
}

.su-sheet .su-trust-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 15.5px;
}

.su-sheet .su-trust-head .icon {
  color: var(--warning);
}

.su-sheet .su-trust p {
  margin: 0 0 8px;
}

.su-sheet .su-trust .hint {
  margin: 0 0 12px;
}

.su-sheet .su-steps {
  margin: 0 0 8px;
  padding-left: 20px;
}

.su-sheet .su-steps li + li {
  margin-top: 4px;
}

.su-sheet .su-trust a.btn {
  text-decoration: none;
}

.su-pairsheet > .hint {
  margin: 0 2px 12px;
}

/* --- Network scanner */
.su-scan .su-scan-notes .su-result {
  margin: 0 0 14px;
}

.su-scan .su-types-block {
  margin-bottom: 14px;
}

.su-scan .su-types-block > .label {
  display: block;
  margin: 0 2px 8px;
}

.su-scan .su-typechks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.su-scan .su-typechk {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.su-scan .su-typechk input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}

.su-scan .su-typechk .icon {
  color: var(--text-dim);
}

.su-scan .su-typechk.off {
  opacity: 0.5;
  cursor: default;
}

.su-scan .su-types-note {
  margin: 8px 2px 0;
}

.su-scan .su-found-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text-dim);
}

.su-scan .su-found-ic.tvset {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.su-scan .su-found-head + .su-list + .su-note {
  margin: 10px 2px 0;
}

.sheet-actions .su-addbtn {
  min-width: 0;
  max-width: 100%;
}

.sheet-actions .su-addbtn .truncate {
  min-width: 0;
}

.su-scan .su-scan-notes .su-notice:last-child {
  margin-bottom: 16px;
}

.su-scan .su-chips {
  margin-bottom: 12px;
}

.su-scan .su-chips .label {
  display: block;
  margin: 0 2px 8px;
}

.su-scan .su-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.su-scan .su-net {
  height: 40px;
}

.su-scan .su-net:disabled {
  opacity: 0.5;
  cursor: default;
}

.su-scan .su-net-cidr {
  color: var(--text-faint);
  font-size: 12.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.su-scan .su-net.on .su-net-cidr {
  color: inherit;
  opacity: 0.75;
}

.su-scan .su-range-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  column-gap: 8px;
}

.su-scan .su-range-row .field {
  min-width: 0;
  margin-bottom: 10px;
}

.su-scan .su-dash {
  display: flex;
  align-items: center;
  height: var(--btn-h);
  margin-bottom: 10px;
  color: var(--text-faint);
  font-weight: 600;
}

.su-scan .su-ports {
  grid-column: 1 / -1;
  max-width: 180px;
}

@media (min-width: 560px) {
  .su-scan .su-range-row {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) 128px;
  }

  .su-scan .su-ports {
    grid-column: auto;
    max-width: none;
  }
}

.su-scan .su-ip {
  font-variant-numeric: tabular-nums;
}

.su-scan .su-range {
  margin: 0 2px 14px;
}

.su-scan .su-range.bad .su-range-text {
  color: var(--warning);
  font-weight: 600;
}

.su-scan .su-scan-status {
  margin-bottom: 12px;
}

.su-scan .su-scan-status:empty {
  display: none;
}

.su-scan .su-scan-status .su-notice {
  margin: 0 0 10px;
}

.su-scan .su-scan-done {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 14.5px;
  font-weight: 600;
}

.su-scan .su-scan-done.ok {
  background: rgba(var(--success-rgb), 0.12);
}

.su-scan .su-scan-done.ok .icon {
  color: var(--success);
}

.su-scan .su-found-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 2px 8px;
}

.su-scan .su-found {
  cursor: default;
}

.su-scan .su-found.clickable {
  cursor: pointer;
}

.su-scan .su-found.selected .check-circle {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.su-scan .su-found.added .check-circle {
  border-style: dashed;
  opacity: 0.4;
}

.su-scan .su-found-note {
  margin-top: 3px;
  color: var(--warning);
  font-size: 13px;
  line-height: 1.4;
}

.su-scan .su-none {
  padding: 14px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
}

.su-scan .su-none-title {
  margin-bottom: 6px;
  font-weight: 650;
}

.su-scan .su-tips {
  margin: 0;
  padding-left: 20px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
}

.su-scan .su-tips li + li {
  margin-top: 4px;
}

/* ================================================================== settings */
.v-settings .st-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.v-settings .st-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

@media (min-width: 1000px) {
  .v-settings .st-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 20px;
  }

  .v-settings .st-col {
    gap: 20px;
  }
}

.v-settings .st-card .card-header {
  gap: 12px;
}

.v-settings .st-body {
  padding: 4px 16px 16px;
}

.v-settings .st-row,
.st-sheet .st-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 14px 0;
}

.v-settings .st-row + .st-row,
.v-settings .st-me + .st-row {
  border-top: 1px solid var(--border);
}

.v-settings .st-row-text,
.st-sheet .st-row-text {
  flex: 1 1 220px;
  min-width: 0;
}

.v-settings .st-row-title,
.st-sheet .st-row-title {
  font-size: 15.5px;
  font-weight: 600;
}

.v-settings .st-row-sub,
.st-sheet .st-row-sub {
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.4;
}

.v-settings .st-row-ctl,
.st-sheet .st-row-ctl {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  max-width: 100%;
}

.v-settings .st-select {
  width: auto;
  min-width: 210px;
}

@media (max-width: 600px) {
  .v-settings .st-row.st-stack {
    flex-direction: column;
    align-items: stretch;
  }

  .v-settings .st-stack .st-row-text {
    flex-basis: auto;
  }

  .v-settings .st-stack .st-row-ctl {
    width: 100%;
  }

  .v-settings .st-stack .seg {
    display: flex;
    width: 100%;
  }

  .v-settings .st-stack .st-select {
    width: 100%;
    min-width: 0;
  }
}

.v-settings .st-subhead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 2px 8px;
}

.v-settings .st-subhead-text {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.v-settings .st-btns {
  margin-top: 12px;
}

.v-settings .st-empty {
  margin: 12px 2px;
  color: var(--text-dim);
}

.v-settings .st-value {
  color: var(--text-dim);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.v-settings .st-danger-text {
  color: var(--danger);
}

/* --- Accent swatches */
.v-settings .st-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.v-settings .st-swatch {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--sw);
  color: #ffffff;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 6px 14px -6px var(--sw);
  transition: transform 0.15s var(--ease), box-shadow 0.15s;
}

.v-settings .st-swatch .icon {
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s, transform 0.15s var(--ease);
}

.v-settings .st-swatch.on {
  box-shadow: 0 0 0 3px var(--bg-elev), 0 0 0 5px var(--sw);
}

.v-settings .st-swatch.on .icon {
  opacity: 1;
  transform: none;
}

.v-settings .st-swatch:active {
  transform: scale(0.92);
}

/* --- Location */
.v-settings .st-loc {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 4px;
}

.v-settings .st-loc-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.v-settings .st-loc-text {
  flex: 1 1 auto;
  min-width: 0;
}

.v-settings .st-loc-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
  font-weight: 700;
}

.v-settings .st-loc-sub {
  color: var(--text-dim);
  font-size: 13.5px;
}

.v-settings .st-env-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-dim);
}

.v-settings .st-env.selected .st-env-ic {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.v-settings .st-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.v-settings .st-avatar.big {
  width: 54px;
  height: 54px;
  font-size: 22px;
}

.v-settings .st-quiet {
  min-height: 48px;
}

.v-settings .st-share {
  margin-top: 12px;
}

.v-settings .st-share-row {
  display: flex;
  gap: 10px;
  margin-bottom: 6px;
}

.v-settings .st-share-row .input {
  flex: 1 1 auto;
  min-width: 0;
}

.v-settings .st-danger-zone {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(var(--danger-rgb), 0.3);
  border-radius: 14px;
  background: rgba(var(--danger-rgb), 0.06);
}

/* --- Account */
.v-settings .st-me {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0 14px;
}

.v-settings .st-me-text {
  min-width: 0;
}

.v-settings .st-me-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
  font-weight: 700;
}

.v-settings .st-me-sub {
  color: var(--text-dim);
  font-size: 14px;
}

/* --- Admin */
.v-settings .st-user .li-end {
  color: var(--text-faint);
}

.v-settings .st-inline-error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(var(--danger-rgb), 0.08);
  font-size: 14px;
}

.v-settings .st-check {
  align-items: flex-start;
  min-height: 0;
  padding: 11px 14px;
}

.v-settings .st-check-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border-radius: 50%;
}

.v-settings .st-check.ok .st-check-ic {
  background: rgba(var(--success-rgb), 0.15);
  color: var(--success);
}

.v-settings .st-check.opt .st-check-ic {
  background: rgba(var(--warning-rgb), 0.16);
  color: var(--warning);
}

.v-settings .st-check.bad .st-check-ic {
  background: rgba(var(--danger-rgb), 0.14);
  color: var(--danger);
}

.v-settings .st-check-detail {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.v-settings .st-facts {
  margin: 10px 2px 0;
  overflow-wrap: anywhere;
}

/* --- About */
.v-settings .st-install {
  padding: 2px 0 4px;
}

.v-settings .st-ok-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(var(--success-rgb), 0.12);
  font-size: 14.5px;
  font-weight: 600;
}

.v-settings .st-ok-note .icon {
  color: var(--success);
}

.v-settings .st-steps {
  margin: 0 0 10px;
  padding-left: 22px;
  font-size: 14.5px;
  line-height: 1.55;
}

.v-settings .st-steps li + li {
  margin-top: 4px;
}

/* ============================================= Settings sheets (.st-sheet) */
.st-sheet .st-lead {
  margin: 0 0 12px;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.5;
}

.st-sheet .st-code {
  min-height: 180px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre;
  overflow: auto;
}

.st-sheet .st-import-row {
  position: relative;
  margin: 10px 0 14px;
}

.st-sheet .st-file {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.st-sheet .st-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(var(--danger-rgb), 0.3);
  border-radius: 12px;
  background: rgba(var(--danger-rgb), 0.11);
  color: var(--danger);
  font-size: 14.5px;
  line-height: 1.4;
}

.st-sheet .st-error .icon {
  margin-top: 1px;
}

.st-sheet .st-row {
  padding: 4px 0 12px;
}
