/* S² beta disclaimer + feedback — floats above Flutter canvas */
#s2-beta-shell-root {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 2147483000;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  pointer-events: none;
}

#s2-beta-shell-root * {
  box-sizing: border-box;
}

.s2-beta-bar {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.2rem 0.45rem;
  padding: 0.28rem 0.5rem;
  background: rgba(15, 23, 42, 0.94);
  border-bottom: 1px solid rgba(255, 107, 53, 0.45);
  color: #e2e8f0;
  font-size: 0.72rem;
  line-height: 1.25;
  backdrop-filter: blur(8px);
}

.s2-beta-bar strong {
  color: #ff8c5a;
  font-weight: 700;
}

.s2-beta-maintenance {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fde68a;
  font-size: 0.78rem;
  line-height: 1.4;
}

.s2-beta-maintenance strong {
  color: #fbbf24;
}

.s2-beta-status--warn {
  color: #fbbf24;
}

.s2-beta-bar__text {
  flex: 1 1 12rem;
  min-width: 0;
  line-height: 1.25;
}

.s2-beta-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.s2-beta-bar button {
  font: inherit;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.12rem 0.35rem;
  background: rgba(255, 107, 53, 0.2);
  color: #fff;
  font-size: 0.68rem;
}

.s2-beta-bar button:hover {
  background: rgba(255, 107, 53, 0.35);
}

.s2-beta-bar button.s2-beta-bar__ghost {
  background: transparent;
}

.s2-beta-floating {
  pointer-events: auto;
  position: fixed;
  top: max(0.65rem, env(safe-area-inset-top, 0px));
  right: max(0.65rem, env(safe-area-inset-right, 0px));
  bottom: auto;
  left: auto;
  z-index: 2147483001;
  border: 1px solid rgba(255, 107, 53, 0.55);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  background: rgba(15, 23, 42, 0.96);
  color: #f8fafc;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
  max-width: min(9rem, calc(100vw - 1.3rem));
  white-space: nowrap;
}

/* Mobile: keep feedback top-right (not over body copy on the left) */
@media (max-width: 768px) {
  .s2-beta-floating {
    top: max(0.5rem, env(safe-area-inset-top, 0px));
    right: max(0.5rem, env(safe-area-inset-right, 0px));
    left: auto;
    bottom: auto;
    padding: 0.45rem 0.65rem;
    font-size: 0.72rem;
  }
}

.s2-beta-floating:hover {
  background: rgba(30, 41, 59, 0.98);
}

.s2-beta-floating[hidden] {
  display: none !important;
}

.s2-beta-dialog {
  pointer-events: auto;
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.55);
}

.s2-beta-dialog[hidden] {
  display: none;
}

.s2-beta-dialog__panel {
  width: min(28rem, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 12px 12px 0 0;
  border: 1px solid #334155;
  padding: 1rem 1rem 1.25rem;
}

.s2-beta-dialog__panel h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.s2-beta-dialog__panel label {
  display: block;
  margin: 0.65rem 0 0.25rem;
  font-size: 0.75rem;
  color: #cbd5e1;
}

.s2-beta-dialog__panel select,
.s2-beta-dialog__panel textarea {
  width: 100%;
  font: inherit;
  border-radius: 8px;
  border: 1px solid #475569;
  background: #1e293b;
  color: #f8fafc;
  padding: 0.45rem 0.55rem;
}

.s2-beta-dialog__panel textarea {
  min-height: 5rem;
  resize: vertical;
}

.s2-beta-dialog__foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.s2-beta-status {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  min-height: 1.2em;
}

.s2-beta-status--ok {
  color: #4ade80;
}

.s2-beta-status--err {
  color: #f87171;
}

.s2-beta-guidance {
  margin: 0.65rem 0 0;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.55);
  font-size: 0.78rem;
  line-height: 1.45;
  color: #cbd5e1;
}

.s2-beta-guidance p {
  margin: 0 0 0.35rem;
}

.s2-beta-guidance p:last-child {
  margin-bottom: 0;
}

.s2-beta-guidance em {
  font-style: normal;
  color: #f8fafc;
  font-weight: 600;
}

.s2-beta-chat__messages {
  min-height: 8rem;
  max-height: 14rem;
  overflow-y: auto;
  margin: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.s2-beta-chat__empty {
  margin: 0;
  font-size: 0.85rem;
  color: #94a3b8;
}

.s2-beta-chat__bubble {
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  line-height: 1.4;
}

.s2-beta-chat__bubble--user {
  margin-left: 1.5rem;
  background: rgba(255, 107, 53, 0.15);
}

.s2-beta-chat__bubble--assistant {
  margin-right: 1.5rem;
  background: #1e293b;
}

.s2-beta-chat__who {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  opacity: 0.82;
  margin-bottom: 0.15rem;
}

.s2-beta-groq-note {
  font-size: 0.72rem;
  color: #94a3b8;
}

.s2-beta-groq-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0.5rem;
  align-items: center;
}

.s2-beta-groq-input {
  flex: 1 1 10rem;
  min-width: 0;
  font: inherit;
  font-size: 0.78rem;
  border-radius: 8px;
  border: 1px solid #475569;
  background: #1e293b;
  color: #f8fafc;
  padding: 0.35rem 0.5rem;
}

.s2-beta-chat__input-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.s2-beta-chat__input {
  flex: 1;
  min-width: 0;
  font: inherit;
  border-radius: 8px;
  border: 1px solid #475569;
  background: #1e293b;
  color: #f8fafc;
  padding: 0.45rem 0.55rem;
}

.s2-beta-fix-btn {
  width: 100%;
  margin-top: 0.5rem;
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid #475569;
  padding: 0.45rem 0.55rem;
  background: transparent;
  color: #e2e8f0;
}

.s2-beta-fix-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.s2-beta-attach-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.s2-beta-attach-btn {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid #475569;
  padding: 0.35rem 0.55rem;
  background: transparent;
  color: #e2e8f0;
}

.s2-beta-attach-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.s2-beta-attach-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1 1 8rem;
}

.s2-beta-attach-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 8px;
  border: 1px solid #475569;
  background: #1e293b;
  padding: 0.2rem 0.35rem;
  max-width: 8rem;
}

.s2-beta-attach-thumb {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: cover;
  border-radius: 4px;
}

.s2-beta-attach-file {
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 5.5rem;
}

.s2-beta-attach-remove {
  font: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  color: #f87171;
  padding: 0 0.15rem;
  line-height: 1;
}

.s2-beta-chat__attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.s2-beta-chat__attachment-img {
  max-width: 100%;
  max-height: 6rem;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.35);
}
