/* Panikbarens stilar. Laddas i panikbarens shadow DOM, så att CSP kan ha style-src 'self' utan 'unsafe-inline'. */
:host { all: initial; }
* { box-sizing: border-box; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.bar { position: fixed; inset: 0 0 auto 0; height: 48px; z-index: 2147483000;
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  background: #120a05; color: #f6ede8; border-bottom: 2px solid #ff5f00;
  box-shadow: 0 2px 12px rgba(255, 95, 0, .25); }
.logo { font-weight: 900; letter-spacing: .08em; font-size: 18px; color: #fff; text-decoration: none; }
.logo span { color: #ff5f00; }
.spacer { flex: 1; }
button { font: inherit; font-size: 14px; color: inherit; background: #2a180c; border: 1px solid #4a2c18;
  border-radius: 999px; padding: 6px 12px; cursor: pointer; white-space: nowrap; max-width: 46vw;
  overflow: hidden; text-overflow: ellipsis; }
button:hover { border-color: #ff5f00; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2ecc40; margin-right: 6px; }
.panel { position: fixed; top: 54px; right: 12px; width: min(320px, calc(100vw - 24px)); max-height: 60vh;
  overflow: auto; z-index: 2147483001; background: #1b110a; color: #f6ede8; border: 1px solid #4a2c18;
  border-radius: 12px; padding: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.panel h3 { margin: 4px 8px 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: #ffa266; }
.panel ul { list-style: none; margin: 0; padding: 0; }
.panel li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 14px; }
.panel li:hover { background: #2a180c; }
.panel .who { flex: 1; min-width: 0; }
.panel .who small { display: block; color: #b8998a; font-size: 12px; }
.panel li button { padding: 4px 10px; font-size: 12px; background: #ff5f00; border-color: #ff5f00; color: #fff; }
.empty { padding: 8px; color: #b8998a; font-size: 14px; }
.toasts { position: fixed; right: 12px; bottom: 12px; z-index: 2147483002; display: flex; flex-direction: column;
  gap: 8px; width: min(340px, calc(100vw - 24px)); }
.toast { background: #1b110a; color: #f6ede8; border: 1px solid #ff5f00; border-radius: 12px; padding: 12px;
  font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.5); animation: in .2s ease-out; }
.toast .actions { display: flex; gap: 8px; margin-top: 8px; }
.toast .primary { background: #ff5f00; border-color: #ff5f00; color: #fff; }
@keyframes in { from { transform: translateY(10px); opacity: 0; } }

/* Ljudknapp, kugghjul och inställningspanelen */
button.icon { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; font-size: 16px; line-height: 1; }
.settings-wrap { position: fixed; inset: 0; z-index: 2147483003; background: rgba(10, 5, 2, .6);
  display: grid; place-items: start center; padding: 64px 12px 12px; overflow: auto; }
.settings-wrap[hidden] { display: none; }
.settings { width: min(420px, 100%); background: #1b110a; color: #f6ede8; border: 2px solid #ff5f00;
  border-radius: 14px; padding: 4px 16px 16px; box-shadow: 0 12px 40px rgba(0,0,0,.6); animation: in .15s ease-out; }
.settings header { display: flex; align-items: center; justify-content: space-between; }
.settings h2 { margin: 12px 0; font-size: 20px; letter-spacing: .04em; }
.settings h3 { margin: 16px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: #ffa266; }
.settings h4 { margin: 12px 0 6px; font-size: 14px; }
.settings section { border-top: 1px solid #3a2414; }
.settings .admin-link a { display: inline-block; margin: 0 0 4px; color: #ffa266; font-size: 14px; }
.settings p { margin: 6px 0; font-size: 14px; }
.settings .muted { color: #b8998a; }
.settings .small, .settings small { font-size: 12px; color: #b8998a; }
.settings .error { color: #ff8a65; min-height: 1em; }
.settings label { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 6px 0; cursor: pointer; }
.settings label.slider { justify-content: space-between; }
.settings input[type=range] { width: 55%; accent-color: #ff5f00; }
.settings input[type=checkbox] { width: 18px; height: 18px; accent-color: #ff5f00; margin: 0; }
.settings input:not([type]), .settings input[type=password], .settings input[type=email] { font: inherit; font-size: 15px; width: 100%; padding: 8px 10px;
  margin: 4px 0; color: #f6ede8; background: #120a05; border: 1px solid #4a2c18; border-radius: 8px; }
.settings input:focus-visible, .settings button:focus-visible { outline: 2px solid #ff5f00; outline-offset: 1px; }
.settings .row { display: flex; gap: 8px; align-items: center; }
.settings form button, .settings .account > button { margin-top: 6px; max-width: none; }
.settings button.primary { background: #ff5f00; border-color: #ff5f00; color: #fff; font-weight: 700; width: 100%; }
.settings button.small { padding: 3px 10px; font-size: 12px; }
.settings details { margin: 8px 0; font-size: 14px; }
.settings summary { cursor: pointer; color: #ffa266; padding: 4px 0; }
.settings .tabs { display: flex; gap: 6px; margin: 8px 0; }
.settings .tabs button { flex: 1; }
.settings .tabs button.active { border-color: #ff5f00; background: #3a1d08; }
.settings .keys { list-style: none; margin: 0; padding: 0; }
.settings .keys li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; }
.settings .logout { margin-top: 12px; }
@media (max-width: 480px) { .online { font-size: 0; padding: 6px 10px; } .online .count { font-size: 14px; } }
.settings .row input { flex: 1; min-width: 0; }
.settings .row button { flex: none; margin-top: 0; }

/* E-post med engångskod (emailCodeBox) */
.settings .email-box .em-send, .settings .email-box .em-verify { width: 100%; max-width: none; margin-top: 6px; }
.settings .email-box [name=code] { font-size: 22px; letter-spacing: 6px; text-align: center; }
.settings .em-links { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }
.settings .em-current b { overflow-wrap: anywhere; }
.settings .em-sec .em-remove { margin-top: 2px; }

/* Tyck till: typval, inringning och formulär */
.fb-wrap { position: fixed; inset: 0; z-index: 2147483003; background: rgba(10, 5, 2, .6);
  display: grid; place-items: start center; padding: 64px 12px 12px; overflow: auto; }
.fb-wrap[hidden], .fb-wrap [hidden] { display: none; }
.fb-wrap.marking { background: rgba(255, 95, 0, .06); padding: 0; overflow: hidden; box-shadow: inset 0 0 0 3px #ff5f00; }
.fb-dialog { width: min(420px, 100%); background: #1b110a; color: #f6ede8; border: 2px solid #ff5f00;
  border-radius: 14px; padding: 4px 16px 16px; box-shadow: 0 12px 40px rgba(0,0,0,.6); animation: in .15s ease-out; }
.fb-dialog header { display: flex; align-items: center; justify-content: space-between; }
.fb-dialog h2 { margin: 12px 0; font-size: 20px; letter-spacing: .02em; }
.fb-dialog p { margin: 6px 0; font-size: 14px; }
.fb-wrap .muted { color: #b8998a; }
.fb-wrap .small { font-size: 12px; }
.fb-wrap .error { color: #ff8a65; min-height: 1em; }
.kinds { display: grid; gap: 8px; margin-top: 10px; }
.kinds button { display: grid; gap: 2px; text-align: left; border-radius: 12px; padding: 12px 14px; max-width: none; white-space: normal; }
.kinds button b { font-size: 16px; }
.kinds button small { color: #b8998a; font-size: 13px; }
.kinds button:focus-visible, .fb-dialog button:focus-visible, .fb-hint button:focus-visible, .fb-dialog textarea:focus-visible {
  outline: 2px solid #ff5f00; outline-offset: 1px; }
.fb-mark { position: absolute; inset: 0; }
.fb-draw { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.fb-draw polyline { fill: rgba(255, 95, 0, .12); stroke: #ff5f00; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.fb-hint { position: absolute; top: 60px; left: 50%; transform: translateX(-50%); width: min(440px, calc(100% - 24px));
  background: #1b110a; color: #f6ede8; border: 2px solid #ff5f00; border-radius: 12px; padding: 10px 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.5); transition: opacity .15s; font-size: 14px; }
.fb-hint p { margin: 0 0 8px; }
.fb-hint.faded { opacity: .15; pointer-events: none; }
.fb-wrap .row { display: flex; gap: 8px; }
.fb-wrap .row.end { justify-content: flex-end; margin-top: 8px; }
.fb-dialog textarea { font: inherit; font-size: 15px; width: 100%; padding: 8px 10px; margin: 4px 0; resize: vertical;
  color: #f6ede8; background: #120a05; border: 1px solid #4a2c18; border-radius: 8px; }
.fb-dialog button.primary { background: #ff5f00; border-color: #ff5f00; color: #fff; font-weight: 700; }
.fb-wrap button.link { background: none; border: 0; padding: 0; color: #ffa266; text-decoration: underline; font-size: 14px; }
.fb-shot { margin: 4px 0; }
.fb-shot label { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 4px 0; cursor: pointer; }
.fb-shot input[type=checkbox] { width: 18px; height: 18px; accent-color: #ff5f00; margin: 0; }
.fb-shot-img { position: relative; border: 1px solid #4a2c18; border-radius: 8px; overflow: hidden; line-height: 0; }
.fb-shot-img img { width: 100%; height: auto; display: block; }
.fb-shot-img svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.fb-shot-img polyline { fill: rgba(255, 95, 0, .15); stroke: #ff5f00; stroke-width: 4; vector-effect: non-scaling-stroke;
  stroke-linejoin: round; stroke-linecap: round; }
.fb-shot:has(input:not(:checked)) .fb-shot-img { opacity: .3; }
