/**
 * renderer/IoT/tigertouch/tigertouch.css
 *
 * Tiger Touch header glyph, side card extras (LAN mode, access code) and the
 * screenshot preview. The card chrome is the TigerScale's (.scale-card*,
 * .scale-chip*) and the printer rows are the TigerSpool's (.tsp-*), so the
 * three devices read as one family. Only what differs is here.
 *
 * Colours per screen: green active · blue standby (screen off) · red offline.
 */
.ttc-health { cursor: pointer; }
.ttc-glyphs { display: inline-flex; align-items: center; gap: 2px; }
.ttc-glyph  { position: relative; display: inline-flex; align-items: center; }
.ttc-icon {
  display: inline-block;
  height: 34px; margin: 5px 0;               /* 34 px of ink in the 44 px row, like its neighbours */
  aspect-ratio: 1774 / 1648;                  /* viewBox 0 0 1774 1648: the screen in 3/4 view */
  background-color: var(--neutral);
  -webkit-mask-image: url('../../../assets/svg/icons/icon_tigertouch_3d.svg');
  -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center;
  transition: background-color .3s, filter .3s;
}
.ttc-glyph.ttc-active .ttc-icon  { background-color: var(--success); filter: drop-shadow(0 0 5px var(--success)); }
.ttc-glyph.ttc-standby .ttc-icon { background-color: var(--info);    filter: drop-shadow(0 0 5px var(--info)); }
.ttc-glyph.ttc-offline .ttc-icon { background-color: var(--danger); }
.ttc-glyph.ttc-none .ttc-icon    { opacity: .38; }

/* ── Side card ── */
.ttc-panel #tigertouchPanelBody { padding: 14px 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.detail-panel.ttc-panel { width: 400px; }
.scale-card-photo.ttc-card-photo { width: 84px; height: 84px; object-fit: contain; padding: 4px; }

.ttc-lan {
  border-top: 1px solid var(--border); margin-top: 2px; padding-top: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.ttc-lan-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ttc-lan-off {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted);
}
.ttc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface-2, var(--surface));
  color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: background-color .15s, border-color .15s, opacity .15s;
}
.ttc-btn:hover:not(:disabled) { border-color: var(--primary); }
.ttc-btn:disabled { opacity: .45; cursor: default; }
.ttc-btn--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.ttc-btn--primary:hover:not(:disabled) { filter: brightness(1.08); }
.ttc-btn--ok { border-color: var(--success) !important; }
.ttc-btn .icon { background-color: currentColor; }

.ttc-demo { font-style: italic; }

/* ── Screenshot preview ── */
.ttc-shot-card { width: min(860px, 92vw); }
.ttc-shot-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.ttc-shot-frame {
  aspect-ratio: 800 / 480; width: 100%; max-height: 62vh;   /* a portrait screen (Tiger Spool) must fit too */
  border-radius: 10px; overflow: hidden; background: #000;
  display: flex; align-items: center; justify-content: center;
}
.ttc-shot-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ttc-shot-frame--err {
  flex-direction: column; gap: 10px; background: var(--surface-2, rgba(127,127,127,.1));
  color: var(--muted); font-size: 13px; text-align: center; padding: 20px;
}
.ttc-shot-frame--err .icon { background-color: var(--danger); }
.ttc-shot-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.ttc-spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.2); border-top-color: #fff;
  animation: ttc-spin .8s linear infinite;
}
@keyframes ttc-spin { to { transform: rotate(360deg); } }

/* ── Live view: the screen's frames, clickable ── */
.ttc-live-frame { position: relative; cursor: pointer; touch-action: none; user-select: none; }
.ttc-live-frame canvas { width: 100%; height: 100%; display: block; transition: opacity .2s; }
.ttc-live-frame canvas[hidden] { display: none; }
.ttc-live-frame.is-stale canvas { opacity: .35; }
.ttc-live-frame.is-touched { box-shadow: inset 0 0 0 2px var(--primary); }
.ttc-live-frame .ttc-spinner, .ttc-live-msg { position: absolute; }
.ttc-live-msg {
  left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 80%;
  padding: 10px 14px; border-radius: 10px; background: rgba(0,0,0,.7);
  color: #fff; font-size: 13px; text-align: center;
}
.ttc-live-msg[hidden], .ttc-live-frame .ttc-spinner[hidden] { display: none; }
.ttc-live-hint { margin-right: auto; align-self: center; font-size: 12px; color: var(--muted); }

