/* Cartões tally (soma) e lamp (lâmpada) dentro do balão do Pyro. Estilo escuro, estilo WhatsApp. */
.card-tally, .card-lamp {
  box-sizing: border-box; min-width: 0; max-width: 100%; width: 100%;
  margin-top: 6px; padding: 10px; border-radius: 10px;
  background: rgba(0, 0, 0, .18); color: #e9edef; font-size: .9rem; line-height: 1.35;
  overflow-wrap: anywhere;
}
.card-tally .card-title, .card-lamp .card-title { display: block; margin: 0 0 4px; color: #e9edef; font-size: .95rem; }
.card-tally .card-action, .card-lamp .card-action { min-height: 40px; }
.card-tally button:focus-visible, .card-lamp button:focus-visible, .card-lamp input:focus-visible {
  outline: 2px solid #00a884; outline-offset: 2px;
}
.card-tally [hidden], .card-lamp [hidden] { display: none !important; }

/* tally */
.tally-status { margin: 0 0 6px; color: #8696a0; font-size: .85rem; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tally-open { color: #00a884; }
.tally-cancelled { color: #8696a0; }
.tally-badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  border: 1px solid #00a884; color: #00a884; font-size: .75rem;
}
.tally-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.tally-table th, .tally-table td { padding: 4px 6px; border-bottom: 1px solid rgba(134, 150, 160, .18); text-align: left; vertical-align: top; }
.tally-table th { color: #8696a0; font-weight: 500; font-size: .8rem; }
.tally-table .tally-n { width: 3.2em; color: #8696a0; }
.tally-table .tally-value { text-align: right; }
.tally-table td.tally-value { color: #e9edef; }
.tally-row.tally-add td { color: #21c063; background: rgba(33, 192, 99, .10); }
.tally-row.tally-edit td { color: #ffb84d; background: rgba(255, 184, 77, .10); }
.tally-old { color: #8696a0; text-decoration: line-through; }
.tally-arrow { color: #8696a0; }
.tally-note { margin: 6px 0 0; color: #ffb84d; font-size: .85rem; }
.tally-more { margin-top: 6px; width: 100%; min-height: 44px; }
.tally-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(134, 150, 160, .3);
}
.tally-count { color: #8696a0; font-size: .85rem; }
.tally-total { display: inline-flex; align-items: baseline; gap: 6px; }
.tally-total-label { color: #8696a0; font-size: .75rem; letter-spacing: .04em; }
.tally-total-value { color: #00a884; font-size: 1.1rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tally-cancelled ~ .tally-foot .tally-total-value { color: #8696a0; text-decoration: line-through; }

/* lamp */
.card-lamp .card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.lamp-status { font-size: .8rem; color: #8696a0; }
.lamp-status.on { color: #21c063; }
.lamp-status.offline { color: #ff6b6b; }
.card-note { margin: 4px 0 0; color: #8696a0; }
.lamp-error { color: #ff6b6b; }
.lamp-controls { display: grid; gap: 10px; margin-top: 8px; }
.lamp-power {
  width: 100%; min-height: 48px; border: 0; border-radius: 10px; cursor: pointer;
  background: #2a3439; color: #e9edef; font-size: 1rem; font-weight: 600;
}
.lamp-power[aria-pressed="true"] { background: #00a884; color: #0b141a; }
.lamp-power:disabled, .lamp-swatch:disabled { opacity: .55; cursor: default; }
.lamp-label { color: #8696a0; font-size: .8rem; margin: 0; }
.lamp-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; }
.lamp-swatch {
  width: 100%; min-width: 44px; min-height: 44px; aspect-ratio: 1; border-radius: 50%; cursor: pointer;
  border: 2px solid rgba(233, 237, 239, .25); padding: 0;
}
.lamp-swatch[aria-pressed="true"] { border-color: #e9edef; box-shadow: 0 0 0 2px #0b141a inset; }
.lamp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-width: 0; }
.lamp-row > .lamp-label { flex: 0 0 auto; min-width: 5.5em; }
/* Colour wheel: hue around, saturation outwards, full value (brightness has its own slider). */
.lamp-wheel {
  position: relative; width: min(100%, 230px); aspect-ratio: 1; margin: 4px auto; border-radius: 50%;
  background: radial-gradient(circle closest-side, #fff, rgba(255, 255, 255, 0)),
              conic-gradient(#f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  box-shadow: 0 0 0 2px #0b141a, 0 0 0 3px #ffffff30; touch-action: none; cursor: crosshair; outline-offset: 6px;
}
.lamp-wheel-thumb {
  position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; pointer-events: none;
  border: 3px solid #fff; box-shadow: 0 0 0 1.5px #0b141a, 0 2px 8px #0009; background: #fff;
}
.lamp-wheel.is-disabled { opacity: .45; cursor: default; }
.lamp-wheel:focus-visible { outline: 2px solid #53bdeb; }
.lamp-xmas-note, .lamp-usage { display: block; margin-top: 6px; color: #8696a0; font-size: .75rem; }
.lamp-usage.is-warning { color: #ffb347; }
.lamp-row input[type="range"] { flex: 1 1 120px; min-width: 0; height: 44px; accent-color: #00a884; }
.lamp-level { min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; color: #e9edef; }

@media (prefers-reduced-motion: no-preference) {
  .lamp-swatch, .lamp-power { transition: transform .15s ease, box-shadow .15s ease; }
  .lamp-swatch:active, .lamp-power:active { transform: scale(.96); }
}
