/* Your Fidgets (/my-fidget/devices/) - device tabs, facts and actions on the
   left, the selected Fidget's device card on the right (phone: stacked).
   Tokens come from cf-kit.css. */

body.cf-fidgets-page { background: var(--cf-bg-deep); }
.cf-fidgets [hidden],
.cf-fidgets-modal[hidden] { display: none !important; }

.cf-fidgets {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  padding: 28px 0 96px; /* clears the fixed Feedback bubble on phones */
  color: var(--cf-ink);
  font-family: var(--cf-font-display);
}
.cf-fidgets-main { flex: 1; min-width: 0; }

.cf-fidgets-eyebrow,
.cf-fidgets-card-eyebrow,
.cf-fidgets-ready-title {
  margin: 0;
  font-family: var(--cf-font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--cf-cyan);
}

.cf-fidgets-title {
  margin: 8px 0 16px;
  font-family: var(--cf-font-display);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--cf-ink);
}

.cf-fidgets-status {
  margin: 0 0 14px;
  font-family: var(--cf-font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--cf-yellow);
}

.cf-fidgets-signin {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0 0 18px;
  padding: 12px 14px;
  background: var(--cf-bg-card);
  border: 1px solid rgba(104, 225, 253, .35);
}
.cf-fidgets-signin-body {
  flex: 1 1 260px;
  margin: 0;
  font-family: var(--cf-font-mono);
  font-size: 11px;
  line-height: 1.65;
  color: var(--cf-ink-dim);
}
.cf-fidgets-signin .cf-btn { align-self: center; }

/* device tabs: case-color dot, name, fingerprint, managed chip, waiting count */
.cf-fidgets-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--cf-bg-line);
  margin-bottom: 18px;
  /* More tabs than fit wrap onto another row: every name stays readable. */
  flex-wrap: wrap;
}
.cf-fidgets-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  white-space: nowrap;
}
.cf-fidgets-tab[aria-selected="true"] { border-bottom-color: var(--cf-cyan); }
.cf-fidgets-dot { background: var(--cf-anod-silver); }
.cf-fidgets-tab[data-kind="browser"] .cf-fidgets-dot {
  background: transparent;
  border: 1.5px dashed var(--cf-ink-mute);
  box-sizing: border-box;
}
.cf-fidgets-tab-name {
  font-family: var(--cf-font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--cf-ink-mute);
}
.cf-fidgets-tab[aria-selected="true"] .cf-fidgets-tab-name { color: var(--cf-ink); }
.cf-fidgets-fp {
  font-family: var(--cf-font-mono);
  font-size: 10px;
  color: var(--cf-ink-mute);
}
.cf-fidgets-browser-chip {
  color: var(--cf-ink-dim);
  border-style: dashed;
  border-color: var(--cf-ink-mute);
}
.cf-fidgets-count {
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--cf-yellow);
  color: #08050f;
  font-family: var(--cf-font-mono);
  font-size: 9.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* selected Fidget: facts + actions */
.cf-fidgets-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1px;
  margin: 0 0 18px;
  background: var(--cf-bg-line);
  border: 1px solid var(--cf-bg-line);
}
.cf-fidgets-fact {
  padding: 10px 14px;
  background: var(--cf-bg-card);
}
.cf-fidgets-fact dt {
  font-family: var(--cf-font-mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cf-ink-mute);
}
.cf-fidgets-fact dd {
  margin: 4px 0 0;
  font-family: var(--cf-font-mono);
  font-size: 12px;
  color: var(--cf-ink);
  overflow-wrap: anywhere;
}

.cf-fidgets-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}
.cf-fidgets-actions .cf-btn { align-self: auto; }
.cf-fidgets .cf-btn[disabled] { opacity: .55; cursor: default; }
/* outlined doors (the artboard's REMOVE language): .cf-btn has no border */
.cf-fidgets .cf-btn-outline,
.cf-fidgets .cf-btn-ghost {
  border: 1px solid rgba(255, 43, 184, .4);
  clip-path: none;
  box-shadow: none;
}
.cf-fidgets .cf-btn-ghost { border-color: rgba(104, 225, 253, .5); }

.cf-fidgets-rename {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 18px;
}
.cf-fidgets-rename input {
  flex: 1 1 200px;
  max-width: 320px;
  padding: 8px 10px;
  font-family: var(--cf-font-display);
  font-size: 14px;
  color: var(--cf-ink);
  background: #050308;
  border: 1px solid var(--cf-cyan);
}
.cf-fidgets-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.cf-fidgets-readback {
  margin: 0 0 18px;
  padding: 10px 12px;
  border: 1px solid rgba(104, 225, 253, .35);
  background: rgba(104, 225, 253, .05);
}
.cf-fidgets-readback p {
  margin: 0;
  font-family: var(--cf-font-mono);
  font-size: 11px;
  line-height: 1.65;
  color: var(--cf-ink-dim);
}
.cf-fidgets-readback p + p { margin-top: 6px; }
.cf-fidgets-readback .is-missing { color: var(--cf-yellow); }

/* account Fidget not seen for a long while, or moved to another account */
.cf-fidgets-notice {
  margin: 0 0 18px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 216, 74, .45);
  background: rgba(255, 216, 74, .05);
}
.cf-fidgets-notice-title {
  margin: 0;
  font-family: var(--cf-font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--cf-yellow);
}
.cf-fidgets-notice-body {
  margin: 6px 0 0;
  font-family: var(--cf-font-mono);
  font-size: 11px;
  line-height: 1.65;
  color: var(--cf-ink-dim);
}

/* browser-only Fidget: the "link it" nudge */
.cf-fidgets-nudge {
  margin: 0 0 18px;
  padding: 14px;
  border: 1px dashed rgba(255, 43, 184, .5);
  background: rgba(255, 43, 184, .04);
}
.cf-fidgets-nudge-title {
  margin: 0;
  font-family: var(--cf-font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--cf-ink);
}
.cf-fidgets-nudge-body {
  margin: 6px 0 12px;
  font-family: var(--cf-font-mono);
  font-size: 11px;
  line-height: 1.65;
  color: var(--cf-ink-dim);
}

.cf-fidgets-new { margin: 0; }
.cf-fidgets-note {
  font-family: var(--cf-font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--cf-ink-mute);
}

/* right-side device card (the rail shell) */
.cf-fidgets-card {
  position: sticky;
  top: 20px;
  width: 300px;
  flex: none;
  box-sizing: border-box;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--cf-bg-card);
  border: 1px solid var(--cf-bg-line);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
}
.cf-fidgets-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.cf-fidgets-status-dot.is-linked { background: var(--cf-yellow); box-shadow: 0 0 6px var(--cf-yellow); }
.cf-fidgets-status-dot.is-browser { background: var(--cf-ink-faint); }
.cf-fidgets-card-name {
  font-family: var(--cf-font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--cf-ink);
}
.cf-fidgets-card-sub {
  margin-top: 2px;
  font-family: var(--cf-font-mono);
  font-size: 10px;
  color: var(--cf-ink-dim);
}
.cf-fidgets-ready {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 216, 74, .4);
  background: rgba(255, 216, 74, .05);
}
.cf-fidgets-ready-title { color: var(--cf-yellow); }
.cf-fidgets-ready-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--cf-font-mono);
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--cf-ink-dim);
}
.cf-fidgets-ready-mark { color: var(--cf-green); }
.cf-fidgets-ready-mark.is-remove { color: var(--cf-magenta); }
.cf-fidgets-card-copy {
  margin: 0;
  font-family: var(--cf-font-mono);
  font-size: 11px;
  line-height: 1.65;
  color: var(--cf-ink-dim);
}

/* confirmations */
.cf-fidgets-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 5, 15, .78);
}
.cf-fidgets-modal-surface {
  width: 100%;
  max-width: 420px;
  box-sizing: border-box;
  padding: 20px;
  background: var(--cf-bg-elev);
  border: 1px solid var(--cf-magenta);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.cf-fidgets-modal-title {
  margin: 0;
  font-family: var(--cf-font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--cf-ink);
}
.cf-fidgets-modal-body p {
  margin: 10px 0 0;
  font-family: var(--cf-font-mono);
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--cf-ink-dim);
}
.cf-fidgets-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 880px) {
  /* bottom padding keeps the last control clear of the fixed Feedback button */
  .cf-fidgets { flex-direction: column; align-items: stretch; gap: 14px; padding: 12px 0 112px; }
  .cf-fidgets > *, .cf-fidgets-main > * { min-width: 0; max-width: 100%; }
  .cf-fidgets-detail { display: flex; flex-direction: column; gap: 14px; }
  .cf-fidgets-title { font-size: 28px; margin: 0; }
  .cf-fidgets-status, .cf-fidgets-signin, .cf-fidgets-facts,
  .cf-fidgets-actions, .cf-fidgets-rename, .cf-fidgets-readback, .cf-fidgets-nudge, .cf-fidgets-notice { margin-bottom: 0; }
  .cf-fidgets-card { position: static; width: 100%; order: -1; }
  .cf-fidgets-main { width: 100%; display: contents; }
  .cf-fidgets-eyebrow { order: -4; }
  .cf-fidgets-title { order: -3; }
  .cf-fidgets-status, .cf-fidgets-signin { order: -3; }
  .cf-fidgets-tabs { order: -2; margin-bottom: 0; }
  /* Phone: a long name wraps inside its tab rather than clipping. */
  .cf-fidgets-tab { padding: 10px 12px; flex: 0 1 auto; min-width: 0; white-space: normal; text-align: left; }
  .cf-fidgets-tab .cf-managed-chip { display: none; }
  .cf-fidgets-facts { grid-template-columns: 1fr 1fr; }
  .cf-fidgets-actions .cf-btn { flex: 1 1 auto; text-align: center; }
}
