*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-primary);
  color: #f5f5f7;
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.4;
  user-select: none;
  -webkit-user-select: none;
}

/* Background Atmosphere */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 15%, rgba(10, 132, 255, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 80% 85%, rgba(191, 90, 242, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(48, 209, 88, 0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

/* Apple Floating Chrome Header */
.apple-header {
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(18, 21, 28, 0.75);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  position: relative;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #ffd60a, #ff9f0a);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 159, 10, 0.35);
  font-weight: 700;
  font-size: 17px;
  color: #000;
}

.brand-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #ffffff 0%, #a1a1a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Glass Segmented Control Dock */
.nav-dock {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.dock-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: #86868b;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.dock-btn:hover {
  color: #f5f5f7;
}

.dock-btn:active {
  transform: scale(0.96);
}

.dock-btn.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

.dock-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--apple-blue);
  color: #fff;
  font-weight: 600;
}

/* Header Utilities */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chip-counter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(255, 214, 10, 0.12);
  border: 1px solid rgba(255, 214, 10, 0.25);
  border-radius: var(--radius-pill);
  color: #ffd60a;
  font-weight: 600;
  font-size: 13px;
  font-family: var(--font-mono);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-subtle);
  color: #f5f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--glass-border-specular);
}

.icon-btn:active {
  transform: scale(0.92);
}

/* Main Viewport Container */
.main-stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
}

.screen-view {
  position: absolute;
  inset: 0;
  display: none;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 280ms ease, transform 280ms var(--spring-ease);
}

.screen-view.active {
  display: flex;
  opacity: 1;
  transform: scale(1);
}

/* Touch and interactive accessibility */
button, input, select {
  font-family: inherit;
}
