:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101619;
  color: #e8efed;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body, .gateway { width: 100%; height: 100%; min-height: 100%; margin: 0; }
body { overflow: hidden; }
[hidden] { display: none !important; }

.gateway { height: 100dvh; min-height: 100dvh; background: #101619; }
.workspace { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; }
.tabbar-shell {
  flex: 0 0 auto;
  padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  background: #111c20;
  color: #e8efed;
  border-bottom: 1px solid #304044;
  box-shadow: 0 2px 12px rgb(0 0 0 / 14%);
  z-index: 2;
}
.tablist { display: flex; gap: 6px; max-width: 1120px; margin: 0 auto; }
.tabbar-shell { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tablist { margin: 0; }
.dropi-controls { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.dropi-status { color: #b7c8c2; font-size: 13px; }
.dropi-status[data-error="true"] { color: #ffd0c9; }
.dropi-button { flex: 0 0 auto; min-height: 38px; padding: 8px 13px; border: 1px solid #39836d; border-radius: 8px; background: #193d34; color: #c8f4e1; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; touch-action: manipulation; }
.dropi-button:hover:not(:disabled) { background: #245446; }
.dropi-button:disabled { opacity: .55; cursor: wait; }
.tab {
  position: relative;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #a6b8b2;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  touch-action: manipulation;
}
.tab:hover { background: #223630; color: #e8efed; }
.tab[aria-selected="true"] { background: #193d34; border-color: #39836d; color: #b6f1d9; }
.tab:focus-visible, .retry-button:focus-visible, .dropi-button:focus-visible { outline: 3px solid #44aa8c; outline-offset: 2px; }
.frame-panel { position: relative; display: flex; flex: 1 1 auto; min-height: 0; }
.app-frame { display: block; flex: 1 1 auto; width: 100%; height: 100%; min-height: 0; border: 0; background: #101619; }
.login-view { width: 100%; height: 100%; min-height: 0; }
.frame-status {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: #101619;
  color: #d9e5e1;
  text-align: center;
}
.frame-status[role="alert"] { color: #ffe0dc; }
.frame-status p { margin: 0; }
.retry-button { padding: 9px 14px; border: 1px solid #58736a; border-radius: 8px; background: #1b2926; color: #f1f7f5; font: inherit; cursor: pointer; }

@media (max-width: 520px) {
  .tabbar-shell { align-items: stretch; flex-direction: column; gap: 8px; padding-bottom: 8px; }
  .tablist { gap: 4px; }
  .tab { flex: 1 1 50%; min-height: 44px; padding: 8px 9px; font-size: 13px; }
  .dropi-controls { justify-content: space-between; gap: 8px; }
  .dropi-status { font-size: 12px; }
  .dropi-button { min-height: 36px; padding: 7px 10px; font-size: 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  .tab { transition: background-color 120ms ease, color 120ms ease; }
}
