/* Kopierad från Kampanjmaskinens v2/assets/app.css.
   Verkstaden använder samma komponentklasser och samma interaktioner. */
.smartis-dock { position: fixed; left: 22px; bottom: 22px; z-index: 9000; display: flex; align-items: flex-end; gap: 12px; pointer-events: none; }
.smartis-dock > * { pointer-events: auto; }
.sd-avatar { position: relative; border: 0; background: transparent; padding: 0; cursor: pointer; flex: 0 0 auto; line-height: 0; }
.sd-bot { width: 104px; height: 104px; object-fit: contain; filter: drop-shadow(0 5px 9px rgba(20,20,20,.30)) drop-shadow(0 18px 32px rgba(20,20,20,.38)); transition: width .28s cubic-bezier(.34,1.2,.4,1), height .28s cubic-bezier(.34,1.2,.4,1); }
.sd-fable { aspect-ratio: 1152 / 1560; overflow: hidden;
  /* Vinröd natt sätter color-scheme: dark på sidan. Ärver iframen det medan dokumentet i den
     är ljust målar webbläsaren en ogenomskinlig vit ruta bakom Smartis — normal håller den genomskinlig. */
  color-scheme: normal; }
.smartis-dock.is-idle .sd-bot { width: 90px; height: 90px; }
.smartis-dock.is-idle:not(.is-bigwindow) .sd-avatar:hover .sd-bot { width: 120px; height: 120px; }
.smartis-dock.is-bigwindow .sd-bot { width: 167px; height: 167px; }
.smartis-dock.is-working .sd-bot { width: 149px; height: 149px; animation: sd-bob 1.7s ease-in-out infinite; }
.smartis-dock .sd-bot.is-fable-large { width: 149px !important; height: 149px !important; }
.smartis-dock .sd-bot.is-fable-celebrating { width: 127px !important; height: 127px !important; }
@keyframes sd-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.sd-bubble { display: none; max-width: min(340px, calc(100vw - 120px)); background: var(--soft); border: 1px solid var(--line);
  border-radius: 22px 22px 22px 0; padding: 13px 16px; box-shadow: 0 8px 26px rgba(20,20,20,.20);
  font-size: 13.5px; color: var(--ink); margin-bottom: 34px; }
.smartis-dock.is-working .sd-bubble, .smartis-dock.is-done .sd-bubble, .smartis-dock.is-error .sd-bubble { display: block; animation: sd-pop .22s ease; }
@keyframes sd-pop { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
.sd-kicker { display: block; color: var(--rosa); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.sd-line { display: block; line-height: 1.45; white-space: nowrap; }
.sd-msg { white-space: normal; }
.sd-dots { display: none; gap: 2px; margin-left: 3px; vertical-align: baseline; white-space: nowrap; }
.smartis-dock.is-working .sd-dots { display: inline-flex; }
.sd-dots span { width: 3px; height: 3px; border-radius: 50%; background: currentColor; display: inline-block; opacity: .3; animation: sd-dot 1.3s infinite ease-in-out; }
.sd-dots span:nth-child(2) { animation-delay: .2s; }
.sd-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes sd-dot { 0%,70%,100% { opacity: .3; } 35% { opacity: 1; } }
.smartis-dock.is-error .sd-bubble { border-color: var(--rosa); color: var(--rosa); }
.sd-bubble-cost { display: grid; grid-template-columns: 26px 1fr; gap: 9px; align-items: center; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.sd-bubble-cost[hidden] { display: none; }
.sd-coin { width: 26px; height: 26px; object-fit: contain; flex: 0 0 auto; }
.sd-bubble-cost-label { display: block; font-size: 11px; color: var(--muted); }
.sd-bubble-cost-val { display: block; font-size: 14px; font-weight: 600; }
.sd-pop { animation: sd-pop-val .5s cubic-bezier(.2, 1.5, .4, 1); transform-origin: left center; }
@keyframes sd-pop-val { 0% { transform: scale(1); } 35% { transform: scale(1.18); color: var(--rosa); } 100% { transform: scale(1); } }

.sd-panel { position: absolute; left: 0; bottom: calc(100% + 12px); width: min(400px, calc(100vw - 44px)); height: min(78vh, 600px); overflow: hidden;
  background: var(--bg); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 18px 50px rgba(20, 20, 20, .18); padding: 0; display: flex; flex-direction: column; }
.sd-panel[hidden] { display: none; }
.sd-panel-top { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 12px 12px 9px; background: var(--bg); }
.sd-top-actions { display: flex; gap: 6px; flex: 0 0 auto; margin-left: auto; }
.sd-panel-close { border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 17px; line-height: 1; color: var(--muted); width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.sd-panel-close:hover { border-color: var(--rosa); color: var(--rosa); }
.sd-panel-help { border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 13px; font-weight: 700; line-height: 1; color: var(--muted); width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.sd-panel-help:hover { border-color: var(--rosa); color: var(--rosa); }
.sd-viewhost { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.sd-viewhost > * { flex: 1 1 auto; min-height: 0; }

.sd-alert-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--rosa); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--card); }
.sd-tab-count { margin-left: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--rosa); color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.sd-tab.is-on .sd-tab-count { background: #fff; color: var(--rosa); }
.sd-alert-badge[hidden], .sd-tab-count[hidden] { display: none !important; }
.sd-alerts-tab { padding: 14px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.sd-alert-ack { margin-left: auto; border: 1px solid var(--line); border-radius: 999px; background: var(--card); width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); font-size: 13px; flex: 0 0 auto; }
.sd-alert-ack:hover:not(:disabled) { border-color: var(--turkos); color: var(--turkos); }
.sd-alert.is-acked { opacity: .55; }
.sd-alert.is-acked .sd-alert-ack { color: var(--turkos); cursor: default; }
.sd-alert { border: 1px solid var(--line); border-radius: 12px; background: var(--soft); padding: 8px 11px; }
.sd-alert-title { font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.sd-alert.is-high .sd-alert-title .ti { color: var(--rosa); }
.sd-alert-rescue { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.4; }

.sd-tabs { display: flex; gap: 6px; flex: 1 1 auto; }
.sd-tab { border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font: inherit; font-size: 12px; font-weight: 600; padding: 6px 15px; cursor: pointer; }
.sd-tab:hover { border-color: var(--rosa); color: var(--rosa); }
.sd-tab.is-on { background: var(--rosa); border-color: var(--rosa); color: #fff; }
.sd-tab.is-on:hover { color: #fff; }
.sc-view { display: flex; flex-direction: column; min-height: 0; gap: 0; padding: 0; }
.sc-list { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; padding: 16px 14px 8px; scroll-behavior: smooth; }
.sc-row { display: flex; gap: 8px; align-items: flex-end; max-width: 90%; }
.sc-row-user { justify-content: flex-end; align-self: flex-end; }
.sc-avatar { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%; background: var(--card); border: 1px solid var(--line); padding: 3px; object-fit: contain; }
.sc-bubble { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 13.5px; line-height: 1.5; }
.sc-bubble-user { background: var(--rosa); color: #fff; border-radius: 16px 16px 0 16px; }
.sc-bubble-smartis { background: var(--card); border: 1px solid var(--line); color: var(--ink); border-radius: 16px 16px 16px 0; }
.sc-thinking { display: flex; align-items: flex-end; gap: 7px; color: var(--muted); }
.sc-dots { display: inline-flex; gap: 3px; margin-bottom: 3px; }
.sc-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--rosa); opacity: .35; animation: sc-blink 1.2s infinite; }
.sc-dots i:nth-child(2) { animation-delay: .2s; }
.sc-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes sc-blink { 0%, 70%, 100% { opacity: .25; } 35% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sc-dots i { animation: none; opacity: .5; } }
.sc-md p { margin: 0 0 6px; }
.sc-md p:last-child { margin-bottom: 0; }
.sc-md ul { margin: 0 0 6px; padding-left: 18px; }
.sc-md-h { font-weight: 700; margin: 4px 0; }
.sc-citations { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.sc-citation { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--soft2); border: 1px solid var(--line); font: inherit; font-size: 10.5px; font-weight: 600; color: var(--dark); cursor: pointer; text-decoration: none; }
.sc-citation:hover { border-color: var(--rosa); color: var(--rosa); background: var(--card); }
.sc-quick { display: flex; flex-wrap: wrap; gap: 7px; padding: 4px 14px 8px; flex: 0 0 auto; }
.sc-quick[hidden] { display: none; }
.sc-quick-btn { border: 1.5px solid var(--rosa); border-radius: 999px; background: var(--card); color: var(--ink); font: inherit; font-size: 12px; font-weight: 500; padding: 6px 13px; cursor: pointer; transition: background .12s, color .12s; }
.sc-quick-btn:hover { background: var(--rosa); color: #fff; }
.sc-feedback { display: flex; gap: 4px; margin-top: 8px; }
.sc-vote { border: 1px solid var(--line); border-radius: 999px; background: var(--card); width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); font-size: 13px; }
.sc-vote.is-on { border-color: var(--turkos); color: var(--turkos); }
.sc-cost { font-size: 11.5px; color: var(--muted); padding: 6px 15px 0; flex: 0 0 auto; background: var(--soft2); }
.sc-inputrow { display: flex; gap: 9px; align-items: flex-end; flex: 0 0 auto; padding: 11px 14px 8px; background: var(--soft2); }
.sc-input { flex: 1; border: 2px solid transparent; border-radius: 999px; background: var(--card); color: var(--ink); padding: 10px 16px; font: inherit; font-size: 13.5px; resize: none; min-height: 42px; height: 42px; max-height: 120px; }
.sc-input:focus { outline: none; border-color: var(--rosa); }
.sc-send { border: 0; border-radius: 50%; background: var(--rosa); color: #fff; width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 16px; flex: 0 0 auto; }
.sc-send:hover { background: var(--geni); }
.sc-send:disabled { opacity: .5; cursor: default; }
.sc-tools { display: flex; justify-content: flex-end; flex: 0 0 auto; padding: 0 14px 11px; background: var(--soft2); }
.sc-clear { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 999px; }
.sc-clear:hover { color: var(--ink); }
.sd-history-view { padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.sd-wallet { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); }
.sd-wallet-label { display: block; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.sd-wallet-value { display: block; margin-top: 1px; font-family: var(--heading); font-size: 20px; font-weight: 700; }
.sd-history { display: grid; gap: 8px; }
.sd-history-empty { margin: 0; color: var(--muted); font-size: 13px; padding: 4px 2px; }
.sd-history-item { display: grid; gap: 3px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.sd-history-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sd-history-task { font-size: 13px; font-weight: 600; }
.sd-history-cost { font-size: 12px; color: var(--muted); white-space: nowrap; flex: 0 0 auto; }

@media (max-width: 560px) {
  .smartis-dock { left: 10px; bottom: 10px; }
  .sd-panel { width: calc(100vw - 20px); height: min(78vh, 600px); }
}
