/* ==========================================================================
   misc.css – Režimy, hamburger pages (Hue Bridge, História, Logy, Účet, Pomoc),
   onboarding (/vitajte) and auth (login/register). Uses tokens from hue.css.
   ========================================================================== */

/* ---------- Shared ------------------------------------------------------- */
.mono, .tech-call, .call-path, .rule-line, .rule-name code, .diff, .own-sensor code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
}
.is-pending { opacity: .5; pointer-events: none; transition: opacity var(--dur); }
.is-leaving { opacity: 0 !important; transform: scale(.97); transition: opacity 240ms ease-out, transform 240ms ease-out; }
button.row-item.is-busy { pointer-events: none; }
.list-h > form + .row-item::before, .list-h > * + form > .row-item::before {
  content: ""; position: absolute; top: 0; left: 64px; right: 0; height: 1px; background: var(--line); pointer-events: none;
}

/* Soft brand glow behind guest / onboarding pages (Hue intro screen) */
body.glow-bg {
  background:
    radial-gradient(90% 55% at 50% -12%, rgba(238, 90, 155, .20), transparent 62%),
    radial-gradient(70% 45% at -5% 0%, rgba(255, 179, 71, .15), transparent 60%),
    radial-gradient(70% 45% at 105% 4%, rgba(108, 92, 231, .24), transparent 62%),
    var(--bg);
  background-repeat: no-repeat;
}

/* ---------- Auth (login / register) -------------------------------------- */
.auth { width: 100%; }
.auth-head { text-align: center; margin-bottom: 28px; }
.auth-title { font-size: 28px; font-weight: 700; letter-spacing: -.01em; }
.auth-group {
  background: rgba(43, 45, 49, .88);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-radius: 16px; overflow: hidden; box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, var(--shadow-card);
}
.auth-field {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 56px; margin: 0; padding: 0 6px 0 16px; cursor: text;
  transition: background-color var(--dur);
}
.auth-field[hidden] { display: none; }
.auth-field + .auth-field::before { content: ""; position: absolute; top: 0; left: 50px; right: 0; height: 1px; background: var(--line); }
.auth-field > .ms { color: var(--label); font-size: 22px; transition: color var(--dur); }
.auth-field:focus-within { background: rgba(255, 255, 255, .035); }
.auth-field:focus-within > .ms { color: #fff; }
.auth-field.is-invalid > .ms { color: var(--danger-text); }
.auth-input {
  flex: 1; min-width: 0; height: 56px; padding: 0 10px 0 0; border: 0; outline: none;
  background: transparent; color: #fff; font: 400 16px/1.2 var(--font);
}
.auth-input::placeholder { color: var(--text-3); }
.auth-input:-webkit-autofill, .auth-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff; caret-color: #fff; box-shadow: 0 0 0 100px #2e3034 inset; transition: background-color 9999s;
}
.auth-eye {
  width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; padding: 0;
  display: grid; place-items: center; background: transparent; color: var(--label); cursor: pointer;
}
.auth-eye:hover { color: #fff; }
.auth-eye .ms { font-size: 20px; }
.auth-err { margin: 10px 6px 0; color: var(--danger-text); font-size: 14px; line-height: 1.35; }
.auth-submit { margin-top: 20px; }
.auth-foot { text-align: center; margin: 24px 0 0; color: var(--text-2); font-size: 15px; }
.auth-foot a { color: #fff; font-weight: 600; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }

/* ---------- Onboarding (/vitajte) ---------------------------------------- */
.ob { flex: 1; display: flex; flex-direction: column; width: 100%; }
.ob-dots { margin: 4px 0 8px; }
.ob-step { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px 0; }
.ob-step[hidden] { display: none; }
.ob-title { font-size: 26px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; outline: none; }
.ob-title-left { align-self: stretch; text-align: left; margin: 0 4px 16px; }
.ob-sub { color: var(--text-2); margin: 8px 0 0; font-size: 15px; }
.ob-sub[hidden] { display: none; }
.ob-actions { width: 100%; margin-top: 28px; display: flex; flex-direction: column; gap: 10px; }
.ob-actions[hidden] { display: none; }
.ob-actions form { margin: 0; }
.ob-foot { text-align: center; margin: 8px 0 0; }
.ob-foot .appbar-link { color: var(--text-2); font-size: 15px; font-weight: 500; }
.ob:has(#obTaken:not([hidden])) .ob-foot { display: none; }

/* step 1: logo with a slowly turning color orb */
.ob-hero { position: relative; width: 190px; height: 190px; display: grid; place-items: center; margin-bottom: 32px; }
.ob-orb {
  position: absolute; inset: 6px; border-radius: 50%;
  background: conic-gradient(from 200deg, #ffb347, #ee5a9b, #6c5ce7, #0a7aff, #30d158, #ffd60a, #ffb347);
  filter: blur(30px); opacity: .6; animation: ob-rotate 14s linear infinite;
}
.ob-logo { position: relative; width: 100px; height: 100px; border-radius: 28px; box-shadow: 0 18px 44px rgba(0, 0, 0, .45); }

/* step 2: bridge illustration + ring */
.ob-bridge { position: relative; width: 200px; height: 200px; margin-bottom: 30px; }
.ob-bridge[hidden] { display: none; }
.ob-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ob-ring circle { fill: none; stroke-width: 5; }
.ob-ring-track { stroke: rgba(255, 255, 255, .08); }
.ob-ring-fill { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .5s var(--ease), stroke .3s; }
.ob-bridge[data-state=auto] .ob-ring { animation: ob-ring-spin 1.2s linear infinite; }
.ob-bridge[data-state=auto] .ob-ring-fill { stroke-dasharray: 24 76; stroke-dashoffset: 0; }
.ob-bridge[data-state=ok] .ob-ring-fill { stroke: var(--success); stroke-dashoffset: 0; }
/* error / timeout: empty ring – no red round-cap dot at 12 o'clock, no half-drained countdown */
.ob-bridge[data-state=error] .ob-ring-fill, .ob-bridge[data-state=timeout] .ob-ring-fill { stroke: var(--danger); stroke-dashoffset: 100; stroke-opacity: 0; transition: none; }
.ob-device { position: absolute; inset: 36px; display: grid; place-items: center; }
.ob-device-body {
  width: 118px; height: 118px; border-radius: 32px; display: grid; place-items: center;
  background: linear-gradient(150deg, #fbfbfc 0%, #e4e6ea 55%, #c7cad1 100%);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .07), inset 0 2px 0 rgba(255, 255, 255, .9), 0 14px 30px rgba(0, 0, 0, .45);
}
.ob-device-btn {
  position: relative; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(150deg, #ffffff, #e6e8ec);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .18), inset 0 0 0 1px rgba(0, 0, 0, .06);
  transition: background .3s, box-shadow .3s;
}
.ob-device-pulse { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 3px var(--accent); opacity: 0; }
.ob-bridge[data-state=button] .ob-device-pulse { animation: ob-pulse 1.4s var(--ease) infinite; }
.ob-bridge[data-state=button] .ob-device-btn { box-shadow: 0 0 0 3px rgba(10, 122, 255, .9), 0 0 22px rgba(10, 122, 255, .55); }
.ob-device-check { font-size: 26px; color: #fff; opacity: 0; transform: scale(.4); transition: opacity .25s, transform .3s var(--ease); }
.ob-bridge[data-state=ok] .ob-device-btn { background: var(--success); box-shadow: 0 0 0 6px rgba(48, 209, 88, .22), 0 0 24px rgba(48, 209, 88, .5); }
.ob-bridge[data-state=ok] .ob-device-check { opacity: 1; transform: none; }
.ob-count {
  position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%);
  min-width: 44px; padding: 5px 12px; border-radius: var(--r-pill); background: var(--surface-2);
  font: 700 15px/1 var(--font); font-variant-numeric: tabular-nums; color: #fff; box-shadow: var(--shadow-card);
}
.ob-count:empty { display: none; }

.ob-error {
  width: 100%; padding: 28px 20px 20px; border-radius: 18px; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.ob-error[hidden] { display: none; }
.ob-error-ic {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--danger) 18%, var(--surface-2)); color: var(--danger-text);
}
.ob-error-ic .ms { font-size: 32px; }
.ob-error-title { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.3; }
.ob-error .ob-actions { margin-top: 6px; }

/* step 3: sync checklist */
.ob-check { list-style: none; margin: 0; padding: 0; width: 100%; background: var(--surface); border-radius: 18px; overflow: hidden; text-align: left; }
.ob-item { position: relative; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 16px 8px 12px; }
.ob-item + .ob-item::before { content: ""; position: absolute; top: 0; left: 60px; right: 0; height: 1px; background: var(--line); }
.ob-item-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--label); flex: none; transition: background-color .3s, color .3s; }
.ob-item-ic .ms { font-size: 20px; }
.ob-item-name { flex: 1; min-width: 0; font-size: 16px; font-weight: 500; }
.ob-item-val { font-size: 17px; font-weight: 700; opacity: 0; transform: translateY(4px); transition: opacity .3s, transform .3s var(--ease); }
.ob-item.is-done .ob-item-val, .ob-item.is-warn .ob-item-val { opacity: 1; transform: none; }
.ob-item-st { width: 24px; display: grid; place-items: center; flex: none; }
.ob-item-st .ms { font-size: 22px; color: var(--label); }
.ob-item.is-done .ob-item-ic { background: color-mix(in srgb, var(--accent) 24%, var(--surface-2)); color: #8cc1ff; }
.ob-item.is-done .ob-item-st .ms { color: var(--success); animation: hue-pop .32s var(--ease); }
.ob-item.is-warn .ob-item-st .ms { color: var(--warning); }

@keyframes ob-rotate { to { transform: rotate(360deg); } }
@keyframes ob-ring-spin { from { transform: rotate(-90deg); } to { transform: rotate(270deg); } }
@keyframes ob-pulse { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(2.1); } }

/* ---------- Režimy -------------------------------------------------------- */
.mode-list { display: flex; flex-direction: column; gap: var(--gap); }
@media (min-width: 600px) { .mode-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mode-card {
  --c: var(--accent);
  position: relative; display: flex; align-items: center; min-height: 76px;
  border-radius: var(--r-card); background: var(--surface); color: #fff; overflow: hidden;
  transition: background-color .25s ease-out, box-shadow .25s ease-out, opacity .25s, transform .15s var(--ease), color .25s;
}
.mode-card-main {
  flex: 1; min-width: 0; align-self: stretch; display: flex; align-items: center; gap: 14px;
  padding: 12px 6px 12px 16px; margin: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.mode-card-main:disabled { cursor: default; opacity: 1; }
.mode-card-main:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--r-card); }
.mode-card:has(.mode-card-main:active:not(:disabled)) { transform: scale(.985); }
.mode-card-dot {
  position: relative; width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
  transition: background-color .25s, box-shadow .25s;
}
.mode-card-dot .ms { font-size: 24px; color: var(--c); opacity: 0; transform: scale(.4); transition: opacity .2s, transform .25s var(--ease); font-variation-settings: 'FILL' 1, 'wght' 700, 'GRAD' 0, 'opsz' 24; }
.mode-card-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.mode-card-name { font-size: 17px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mode-card-sub { font-size: 13px; color: var(--text-2); }
.mode-card-sub:empty { display: none; }
.mode-card-more { margin-right: 12px; background: rgba(255, 255, 255, .07); color: #fff; }
.mode-card-more:hover { background: rgba(255, 255, 255, .14); }
.mode-card.is-active {
  background: linear-gradient(100deg, var(--c) 0%, var(--c) 7%, color-mix(in srgb, var(--c) 70%, #000) 100%);
  box-shadow: 0 8px 26px color-mix(in srgb, var(--c) 32%, transparent);
}
.mode-card.is-active .mode-card-dot { background: rgba(255, 255, 255, .95); box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.mode-card.is-active .mode-card-dot .ms { opacity: 1; transform: none; }
.mode-card.is-active .mode-card-sub { color: rgba(255, 255, 255, .85); font-weight: 600; }
.mode-card.is-active .mode-card-more { background: rgba(0, 0, 0, .18); }
.mode-card.is-active.is-light { color: var(--text-dark); }
.mode-card.is-active.is-light .mode-card-sub { color: rgba(0, 0, 0, .62); }
.mode-card.is-active.is-light .mode-card-dot { background: rgba(0, 0, 0, .74); }
.mode-card.is-active.is-light .mode-card-more { background: rgba(0, 0, 0, .1); color: var(--text-dark); }
.mode-card.is-busy .mode-card-dot { animation: hue-pulse 1s ease-in-out infinite; }
.mode-card.is-removing { opacity: .45; }
.mode-card.is-removing .mode-card-sub::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: currentColor; animation: hue-pulse 1s ease-in-out infinite; }
.mode-card.is-new { animation: mode-in 420ms var(--ease) both; }
@keyframes mode-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.mode-new {
  width: 100%; min-height: 68px; margin-top: var(--gap); padding: 12px 16px;
  display: flex; align-items: center; gap: 14px;
  border: 1.5px dashed rgba(255, 255, 255, .16); border-radius: var(--r-card);
  background: transparent; color: var(--text-2); font: 600 16px/1.2 var(--font); cursor: pointer;
  transition: background-color var(--dur), color var(--dur), border-color var(--dur);
}
.mode-new:hover { color: #fff; border-color: rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .02); }
.mode-new:active { transform: scale(.99); }
.mode-new[hidden] { display: none; }
.mode-new-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: #fff; flex: none; }

.modes-setup { display: flex; align-items: center; gap: 12px; margin-bottom: var(--gap); background: color-mix(in srgb, var(--warning) 11%, var(--surface)); }
.modes-setup-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--warning) 22%, var(--surface-2)); color: var(--warning); }
.modes-setup-text { flex: 1; min-width: 0; }
.modes-setup .card-h-title { font-size: 16px; }

/* Color swatches (mode sheets) */
.swatches { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.swatch {
  position: relative; width: 100%; aspect-ratio: 1; max-width: 48px; justify-self: center;
  padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--c); color: #fff; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
  transition: box-shadow .2s, transform .15s var(--ease);
}
.swatch::after { content: ""; position: absolute; inset: -4px; }
.swatch:active { transform: scale(.92); }
.swatch .ms { font-size: 20px; opacity: 0; transform: scale(.4); transition: opacity .15s, transform .2s var(--ease); font-variation-settings: 'FILL' 1, 'wght' 700, 'GRAD' 0, 'opsz' 20; }
.swatch.is-light { color: var(--text-dark); }
.swatch[aria-checked=true] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px #fff; }
.swatch[aria-checked=true] .ms { opacity: 1; transform: none; }

/* ---------- Hue Bridge ----------------------------------------------------- */
.bridge-hero { display: flex; align-items: center; gap: 16px; padding: 18px 16px; border-radius: var(--r-card); background: var(--surface); }
.bridge-art {
  position: relative; width: 64px; height: 64px; flex: none; border-radius: 18px; display: grid; place-items: center;
  background: linear-gradient(150deg, #fbfbfc 0%, #e4e6ea 55%, #c7cad1 100%);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .07), inset 0 1px 0 rgba(255, 255, 255, .9), 0 8px 18px rgba(0, 0, 0, .4);
}
.bridge-art-btn { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(150deg, #fff, #e3e5ea); box-shadow: 0 1px 2px rgba(0, 0, 0, .2), inset 0 0 0 1px rgba(0, 0, 0, .06); }
.bridge-hero.is-success .bridge-art-btn { box-shadow: 0 0 0 2px rgba(10, 122, 255, .85), 0 0 12px rgba(10, 122, 255, .55); }
.bridge-hero.is-danger .bridge-art-btn { box-shadow: 0 0 0 2px rgba(255, 69, 58, .85), 0 0 12px rgba(255, 69, 58, .45); }
.bridge-hero.is-warning .bridge-art-btn { box-shadow: 0 0 0 2px rgba(255, 179, 64, .85); }
.bridge-hero-text { flex: 1; min-width: 0; }
.bridge-name { font-size: 20px; font-weight: 700; letter-spacing: -.005em; line-height: 1.25; }
.bridge-state { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 15px; font-weight: 500; }
/* no bridge name yet (unpaired / not connected): the state is the headline – no repeated "Hue Bridge" */
.bridge-hero-text > .bridge-state:first-child { margin-top: 0; font-size: 17px; font-weight: 600; }
.bridge-sync { margin-top: 2px; }
.bridge-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: var(--gap); }
.bridge-count { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px 10px; border-radius: var(--r-tile); background: var(--surface); }
.bridge-count .ms { font-size: 20px; color: var(--label); margin-bottom: 2px; }
.bridge-count-n { font-size: 22px; font-weight: 700; line-height: 1.1; }
.bridge-count-l { font-size: 11px; font-weight: 500; color: var(--text-2); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bridge-cta { margin-top: 20px; }
.bridge-actions { margin-top: 24px; }
#bridgeSync.is-busy .row-title { color: var(--text-2); }

/* ---------- História zmien ------------------------------------------------ */
.hist .section-label:first-child { margin-top: 4px; }
.hist-ic { transition: background-color .3s, color .3s; }
.hist-row.is-applied .hist-ic { color: var(--success); background: color-mix(in srgb, var(--success) 14%, var(--surface-2)); }
.hist-row.is-failed .hist-ic { color: var(--danger-text); background: color-mix(in srgb, var(--danger) 16%, var(--surface-2)); }
.hist-row.is-queued .hist-ic, .hist-row.is-running .hist-ic { color: #6aaeff; background: color-mix(in srgb, var(--accent) 18%, var(--surface-2)); }
.hist-row.is-failed .row-sub { color: var(--danger-text); }
.hist-time { font-size: 13px; color: var(--text-2); }

.plan-head {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; text-align: center;
  margin-top: 8px; padding: 24px 18px 22px; border-radius: var(--r-card); background: var(--surface);
}
.plan-head-ic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--label); }
.plan-head-ic .ms { font-size: 36px; font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 40; }
.plan-head.is-applied .plan-head-ic { color: var(--success); background: color-mix(in srgb, var(--success) 15%, var(--surface-2)); }
.plan-head.is-failed .plan-head-ic { color: var(--danger-text); background: color-mix(in srgb, var(--danger) 16%, var(--surface-2)); }
.plan-head.is-queued .plan-head-ic, .plan-head.is-running .plan-head-ic { color: #6aaeff; background: color-mix(in srgb, var(--accent) 18%, var(--surface-2)); }
.plan-head-title { margin-top: 14px; font-size: 21px; font-weight: 700; letter-spacing: -.005em; line-height: 1.25; overflow-wrap: anywhere; }
.plan-head-sub { margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; color: var(--text-2); font-size: 14px; }
.plan-head.is-applied .plan-head-state { color: var(--success); font-weight: 600; }
.plan-head.is-failed .plan-head-state { color: var(--danger-text); font-weight: 600; }
.plan-head-err { margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--danger) 12%, var(--surface-2)); color: #ffd0cc; font-size: 15px; line-height: 1.35; }
.plan-retry { margin-top: 16px; }
.plan-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.plan-bar > i { display: block; height: 100%; background: var(--accent); transform: scaleX(var(--p, 0)); transform-origin: left; transition: transform .3s ease-out; }
.plan-bar.is-indeterminate > i { width: 38%; transform: none; animation: hue-indeterminate 1.15s ease-in-out infinite; }
.plan-none { text-align: center; margin: 18px 0 0; }

.plan-steps { list-style: none; margin: 0; padding: 0; }
.plan-step { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px 13px 14px; font-size: 15px; line-height: 1.35; }
.plan-step + .plan-step::before { content: ""; position: absolute; top: 0; left: 48px; right: 0; height: 1px; background: var(--line); }
.plan-step-ic { flex: none; width: 22px; display: grid; place-items: center; margin-top: -1px; }
.plan-step-ic .ms { font-size: 22px; color: var(--label); }
.plan-step.is-ok .plan-step-ic .ms { color: var(--success); }
.plan-step.is-failed .plan-step-ic .ms { color: var(--danger-text); }
.plan-step.is-running .plan-step-ic .ms { color: #6aaeff; }
.plan-step.is-skipped, .plan-step.is-waiting { color: var(--text-2); }
.plan-step.is-failed .plan-step-label { color: var(--danger-text); }
.plan-step-label { min-width: 0; overflow-wrap: anywhere; }

/* Technical details (History detail) */
.tech { margin-top: 24px; border-radius: var(--r-card); background: var(--surface); overflow: hidden; }
.tech > summary {
  list-style: none; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 14px;
  color: var(--text-2); font-weight: 600; cursor: pointer; -webkit-user-select: none; user-select: none;
}
.tech > summary::-webkit-details-marker { display: none; }
.tech > summary:hover { color: #fff; }
.tech > summary .ms { font-size: 20px; }
.tech-chev { margin-left: auto; transition: transform var(--dur); }
.tech[open] .tech-chev { transform: rotate(180deg); }
.tech-body { padding: 0 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.tech-op { padding: 10px; border-radius: 10px; background: rgba(0, 0, 0, .22); }
.tech-op-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tech-kind { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); }
.tech-kind.is-create { background: rgba(48, 209, 88, .16); color: #6fe08e; }
.tech-kind.is-update { background: rgba(255, 179, 64, .16); color: #ffc46b; }
.tech-kind.is-delete { background: rgba(255, 69, 58, .16); color: #ff8a82; }
.tech-call { font-size: 12px; color: #dfe1e6; word-break: break-all; }
.tech-label { margin-top: 6px; font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.tech-err { margin-top: 6px; font-size: 12.5px; color: var(--danger-text); overflow-wrap: anywhere; }
.tech-ok { margin-top: 6px; font-size: 12px; color: var(--success); }
.tech-meta { font-size: 11.5px; color: var(--text-3); padding: 2px 4px 0; }
.diff {
  margin: 8px 0 0; padding: 8px 0; max-height: 360px; overflow: auto; border-radius: 8px;
  background: rgba(0, 0, 0, .3); color: #aeb1ba; font-size: 11.5px; line-height: 1.5; white-space: pre;
}
.diff > span { display: block; padding: 0 10px; min-width: max-content; }
.diff .add { background: rgba(48, 209, 88, .12); color: #7ee29a; }
.diff .del { background: rgba(255, 69, 58, .12); color: #ff8a82; }

/* ---------- Logy ---------------------------------------------------------- */
.logs-tabs { margin: 0 0 16px; }
.quota { padding: 14px 16px 16px; border-radius: var(--r-card); background: var(--surface); }
.quota-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.quota-row-sub { margin-top: 14px; }
.quota-label { font-size: 14px; color: var(--text-2); }
.quota-val { font-size: 14px; color: var(--text-2); white-space: nowrap; }
.quota-val b { color: #fff; font-size: 17px; font-weight: 700; }
.quota-bar { height: 6px; margin-top: 8px; border-radius: 3px; background: var(--track); overflow: hidden; }
.quota-bar > i { display: block; height: 100%; width: max(4px, calc(var(--p, 0) * 100%)); border-radius: 3px; background: var(--success); }
.quota-bar.is-high > i { background: var(--warning); }
.quota-bar.is-critical > i, .quota-bar.is-over > i, .quota-bar.is-blocked > i { background: var(--danger); }

.call { position: relative; display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 14px 10px 12px; }
.call + .call::before { content: ""; position: absolute; top: 0; left: 12px; right: 0; height: 1px; background: var(--line); }
.call-m { padding: 4px 0; border-radius: 6px; text-align: center; font: 700 10.5px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; background: var(--surface-2); color: var(--text-2); }
.call-m.m-get { background: rgba(10, 122, 255, .16); color: #7bb5ff; }
.call-m.m-put { background: rgba(255, 179, 64, .16); color: #ffc46b; }
.call-m.m-post { background: rgba(48, 209, 88, .16); color: #6fe08e; }
.call-m.m-delete { background: rgba(255, 69, 58, .16); color: #ff8a82; }
.call-main { min-width: 0; }
.call-path { display: block; font-size: 12px; line-height: 1.4; color: #e3e5ea; word-break: break-all; }
.call-err { display: block; margin-top: 3px; font-size: 12px; color: var(--danger-text); overflow-wrap: anywhere; }
.call-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; font-size: 12px; color: var(--text-2); }
.call-st { font-weight: 700; color: var(--success); }
.call.is-err .call-st { color: var(--danger-text); }
.call-t { margin-left: auto; color: var(--text-3); }
.snap .row-title { font-size: 15px; }
.snap-meta { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.call-try { color: var(--warning); font-weight: 600; }

.rule { position: relative; padding: 8px 12px 8px 14px; transition: opacity var(--dur); }
.rule + .rule::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: var(--line); }
.rule-top { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.rule-toggle { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 4px 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.rule-name { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rule-name code { font-size: 13px; color: #fff; }
.rule-id { font-size: 12px; font-weight: 400; color: var(--text-3); }
.rule-desc { font-size: 13px; color: var(--text-2); line-height: 1.3; }
.rule.is-off .rule-name code, .rule.is-off .rule-desc { color: var(--text-3); }
.rule-more { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 4px 0 8px; }
.rule-more[hidden] { display: none; }
.rule-line { display: block; padding: 5px 8px; border-radius: 6px; background: rgba(0, 0, 0, .25); color: #c9ccd3; font-size: 11.5px; line-height: 1.4; word-break: break-all; }
.rule-line.is-action { color: #ffd08a; }
.rule-meta { margin: 4px 0 6px; font-size: 12px; color: var(--text-2); }
.rule-more .btn-h { align-self: flex-start; }
.own-sensor code { font-size: 13px; color: #fff; }

/* ---------- Účet ---------------------------------------------------------- */
.acct-head { display: flex; align-items: center; gap: 14px; margin: 0 4px 16px; }
.acct-avatar { width: 56px; height: 56px; font-size: 24px; }
.acct-who { flex: 1; min-width: 0; }
.acct-name { font-size: 20px; font-weight: 700; line-height: 1.25; }
.acct-mail { color: var(--text-2); font-size: 14px; }
.acct-card .form-control[readonly] { color: var(--text-2); background-color: rgba(0, 0, 0, .2); cursor: default; }
.acct-save { margin-top: 16px; }
.acct-actions { margin-top: 28px; }
.pw-wrap { position: relative; }
.pw-wrap .form-control { padding-right: 50px; }
.pw-wrap .auth-eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }
[data-confirm-field][hidden] { display: none; }

/* ---------- Pomoc --------------------------------------------------------- */
.faq-item { position: relative; }
.faq-item + .faq-item::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; height: 1px; background: var(--line); }
.faq-item > summary {
  list-style: none; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px 10px 12px; cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary:active { background: var(--surface-2); }
.faq-item[open] > summary .row-ic { background: color-mix(in srgb, var(--accent) 22%, var(--surface-2)); color: #8cc1ff; }
.faq-q { flex: 1; min-width: 0; font-size: 16px; font-weight: 500; line-height: 1.3; }
.faq-chev { color: var(--label); transition: transform var(--dur); }
.faq-item[open] .faq-chev { transform: rotate(180deg); }
.faq-a { margin: -4px 0 0; padding: 0 18px 16px 64px; color: var(--text-2); font-size: 15px; line-height: 1.5; }
.help-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }

@media (prefers-reduced-motion: reduce) {
  .ob-orb, .ob-bridge[data-state=auto] .ob-ring, .ob-device-pulse { animation: none !important; }
}

/* Účet: disabled „Zmeniť heslo“ looks like the disabled profile „Uložiť“ (x-savebar) in the card above */
.acct-card .btn-h.primary:disabled { opacity: 1; background: var(--surface-2); color: var(--text-3); }

/* Logy › API volania: posledné povely Asistenta (§13.1, rozbaľovacie) */
.as-usage { margin-top: 18px; }
.as-usage > summary { display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; }
.as-usage > summary::-webkit-details-marker { display: none; }
.as-usage > summary .ms { font-size: 20px; margin-left: -4px; transition: transform var(--dur) var(--ease); }
.as-usage[open] > summary .ms { transform: rotate(90deg); }
.as-usage .call-m { font-size: 9.5px; }
.quota-note { margin-top: 6px; font-size: 12px; color: var(--text-3); }
.quota-note .t-danger { color: var(--danger-text); }
