/* Shared App Primitives */
.app-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.app-sidebar {
  width: 200px;
  flex-shrink: 0;
  background: var(--surface-sidebar);
  border-right: 1px solid var(--divider);
  padding: 10px 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 8px 10px 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sidebar-item {
  width: 100%;
  border: none;
  background: transparent;
  padding: 7px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  min-height: 34px;
}

.sidebar-item:hover {
  background: var(--glass-bg-subtle);
}

.sidebar-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.app-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-toolbar {
  padding: 8px 12px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.app-input {
  background: var(--surface-input);
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  outline: none;
}

.app-input:focus {
  border-color: var(--accent);
}

.app-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
}

@media (max-width: 640px) {
  .app-shell.responsive-collapse {
    flex-direction: column;
  }
  .app-shell.responsive-collapse .app-sidebar {
    width: 100%;
    max-height: 112px;
    border-right: none;
    border-bottom: 1px solid var(--divider);
    flex-direction: row;
    flex-wrap: wrap;
  }
  .app-shell.responsive-collapse .sidebar-section-label {
    display: none;
  }
  .app-shell.responsive-collapse .sidebar-item {
    width: auto;
    padding: 5px 10px;
  }
}

/* Finder */
.finder-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  flex: 1;
  min-width: 120px;
  overflow-x: auto;
}

.crumb-btn {
  border: none;
  background: transparent;
  padding: 3px 6px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}

.crumb-btn:hover {
  background: var(--glass-bg-subtle);
}

.finder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 12px;
}

.finder-item {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 12px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-align: center;
}

.finder-item:hover {
  background: var(--surface-card);
}

.finder-item.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.finder-item-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.finder-item-icon svg {
  width: 46px;
  height: 46px;
}

.finder-item-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
}

.finder-item-name {
  font-size: 12px;
  word-break: break-word;
  line-height: 1.25;
}

.finder-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.finder-list-row {
  display: grid;
  grid-template-columns: 28px 1fr 80px 90px;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
}

.finder-list-row:hover {
  background: var(--surface-card);
}

.finder-list-row.selected {
  background: var(--accent-soft);
}

.finder-statusbar {
  padding: 6px 14px;
  border-top: 1px solid var(--divider);
  background: var(--glass-bg-subtle);
  font-size: 11.5px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

/* Navigator Browser */
.browser-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px 0;
  background: var(--surface-sidebar);
  border-bottom: 1px solid var(--divider);
  overflow-x: auto;
}

.browser-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px 8px 0 0;
  font-size: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  max-width: 170px;
  white-space: nowrap;
}

.browser-tab.active {
  background: var(--surface-app);
  font-weight: 600;
}

.browser-tab-title {
  overflow: hidden;
  text-overflow: ellipsis;
}

.browser-tab-close {
  opacity: 0.6;
  font-size: 12px;
  padding: 0 2px;
}

.browser-bookmarks-bar {
  display: flex;
  gap: 6px;
  padding: 5px 12px;
  border-bottom: 1px solid var(--divider);
  overflow-x: auto;
  font-size: 12px;
}

.bookmark-pill {
  border: none;
  background: var(--surface-card);
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 11.5px;
}

.bookmark-pill:hover {
  background: var(--accent-soft);
}

.browser-viewport {
  flex: 1;
  min-height: 0;
  position: relative;
  background: var(--surface-app);
  overflow: hidden;
}

.browser-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

.browser-home {
  height: 100%;
  overflow-y: auto;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.browser-favorites-grid {
  width: min(560px, 100%);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
}

.browser-fav-card {
  background: var(--surface-card);
  border: 1px solid var(--divider);
  border-radius: 14px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
}

.browser-fav-card:hover {
  border-color: var(--accent);
}

/* Notes & TextEdit */
.notes-list-item {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notes-list-item:hover {
  background: var(--glass-bg-subtle);
}

.notes-list-item.active {
  background: var(--accent-soft);
}

.notes-editor-title {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 20px;
  font-weight: 700;
  outline: none;
  padding: 12px 16px 6px;
}

.notes-editor-body,
.textedit-textarea {
  flex: 1;
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  resize: none;
  padding: 8px 16px 16px;
  font-size: 14px;
  line-height: 1.6;
}

.textedit-textarea.mono {
  font-family: var(--font-mono);
  font-size: 13px;
}

/* Calendar */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 6px 0;
}

.cal-day {
  min-height: 54px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--surface-card);
  padding: 5px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  cursor: pointer;
  font-size: 12px;
}

.cal-day.other-month {
  opacity: 0.36;
}

.cal-day.today {
  border-color: var(--accent);
}

.cal-day.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.cal-dots {
  display: flex;
  gap: 3px;
}

.cal-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

/* Calculator — macOS Sequoia Graphite Palette */
.calc-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 12px;
  gap: 10px;
  background: linear-gradient(180deg, rgba(28, 28, 30, 0.96), rgba(20, 20, 22, 0.98));
  color: #fff;
}

.calc-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.calc-toolbar .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.12);
}

#calc-history-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.calc-history-panel {
  background: rgba(44, 44, 46, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
}

.calc-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calc-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 108px;
  overflow-y: auto;
}

.calc-history-empty {
  font-size: 12px;
  color: #a1a1aa;
  padding: 6px 2px;
}

.calc-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  text-align: left;
}

.calc-history-item:hover {
  border-color: #ff9f0a;
}

.calc-history-expr {
  font-size: 11.5px;
  color: #a1a1aa;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calc-history-res {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.calc-display {
  background: transparent;
  border: none;
  border-radius: 14px;
  padding: 10px 10px 6px;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calc-expr {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.56);
  min-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calc-value {
  font-size: 38px;
  font-weight: 300;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calc-grid {
  flex: 1;
  display: grid;
  gap: 8px;
}

.calc-grid.standard {
  grid-template-columns: repeat(4, 1fr);
}

.calc-grid.scientific {
  grid-template-columns: repeat(5, 1fr);
}

.calc-key {
  border: none;
  border-radius: 999px;
  background: #333336;
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  min-height: 42px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.08s ease, filter 0.12s ease;
}

.calc-key:hover {
  filter: brightness(1.16);
}

.calc-key:active {
  transform: scale(0.94);
}

.calc-key.op {
  background: #ff9f0a;
  color: #fff;
  font-weight: 600;
}

.calc-key.fn {
  background: #a5a5a5;
  color: #111;
  font-size: 14px;
  font-weight: 600;
}

.calc-key.span-2 {
  grid-column: span 2;
  text-align: left;
  padding-left: 22px;
}

/* Photos & Preview */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.photo-tile {
  aspect-ratio: 4/3;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--surface-card);
  padding: 0;
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-tile:hover {
  border-color: var(--accent);
}

.photo-editor-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
  padding: 14px;
}

.photo-editor-stage canvas,
.photo-editor-stage img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  object-fit: contain;
}

/* Terminal */
.terminal-root {
  flex: 1;
  min-height: 0;
  background: rgba(11, 15, 23, 0.96);
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  cursor: text;
}

.term-line {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

.term-prompt-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.term-prompt-label {
  color: #38bdf8;
  font-weight: 700;
  white-space: nowrap;
}

.term-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-family: inherit;
  font-size: inherit;
}

/* Settings & Activity Monitor & App Store */
.settings-group {
  background: var(--surface-card);
  border: 1px solid var(--divider);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.swatch-row {
  display: flex;
  gap: 8px;
}

.accent-swatch {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
}

.accent-swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--accent);
}

.wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.wallpaper-card {
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--surface-card);
  padding: 0;
  text-align: left;
}

.wallpaper-card.active {
  border-color: var(--accent);
}

.wallpaper-card-preview {
  height: 74px;
  background-size: cover;
  background-position: center;
}

.wallpaper-card-name {
  padding: 6px 8px;
  font-size: 11.5px;
  font-weight: 600;
}

.monitor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.monitor-table th,
.monitor-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--divider);
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.store-card {
  background: var(--surface-card);
  border: 1px solid var(--divider);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.store-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.store-card-head svg {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.notes-editor-body[contenteditable]:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
}

.nav-spinner {
  display: inline-block;
  font-size: 11px;
  color: var(--accent);
  animation: navSpin 1s linear infinite;
}

@keyframes navSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  #mail-split,
  #ch-split {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr;
  }
  #finder-preview-pane {
    display: none !important;
  }
}

/* Zenith Explorer Multi-Tabs & Badges */
.finder-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px 0;
  background: var(--surface-sidebar);
  border-bottom: 1px solid var(--divider);
  overflow-x: auto;
}

.finder-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px 8px 0 0;
  border: none;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.finder-tab.active {
  background: var(--surface-app);
  font-weight: 600;
}

.finder-tag-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.finder-item.drag-over {
  outline: 2px dashed var(--accent);
  background: var(--accent-soft);
}

/* Zenith Browser Suggestions */
.browser-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--glass-bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  box-shadow: var(--shadow-panel);
  padding: 4px;
  max-height: 220px;
  overflow-y: auto;
}

.browser-suggestion-row {
  width: 100%;
  border: none;
  background: transparent;
  padding: 6px 10px;
  border-radius: 7px;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.browser-suggestion-row:hover {
  background: var(--accent);
  color: #fff;
}

/* Zenith Code Syntax Highlighter Widget */
.code-editor-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  background: #0d1320;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  overflow: hidden;
  position: relative;
}

.code-gutter {
  width: 46px;
  flex-shrink: 0;
  padding: 12px 6px;
  text-align: right;
  color: #64748b;
  background: #090e18;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  user-select: none;
  font-size: 12px;
}

.code-stage {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.code-pre,
.code-textarea {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 12px 14px;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
  border: none;
  outline: none;
}

.code-pre {
  pointer-events: none;
  z-index: 1;
}

.code-textarea {
  background: transparent;
  color: transparent;
  caret-color: #38bdf8;
  resize: none;
  z-index: 2;
}

.code-textarea::selection {
  background: rgba(56, 189, 248, 0.28);
}

.tok-kw { color: #c084fc; font-weight: 600; }
.tok-str { color: #86efac; }
.tok-tag { color: #38bdf8; }
.tok-attr { color: #fbbf24; }
.tok-num { color: #fb7185; }
.tok-com { color: #64748b; font-style: italic; }
.tok-fn { color: #60a5fa; }

/* Zenith Sheets Grid */
.sheets-table {
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 100%;
}

.sheets-table th,
.sheets-table td {
  border: 1px solid var(--divider);
  padding: 0;
  min-width: 88px;
  height: 28px;
}

.sheets-table th {
  background: var(--surface-sidebar);
  font-weight: 700;
  text-align: center;
  padding: 4px 6px;
}

.sheets-cell {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  padding: 4px 6px;
  font-size: 12.5px;
  outline: none;
}

.sheets-cell:focus {
  background: var(--accent-soft);
}

/* Zenith Chess Board */
.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: min(360px, 100%);
  aspect-ratio: 1;
  border: 2px solid var(--divider);
  border-radius: 10px;
  overflow: hidden;
  user-select: none;
}

.chess-sq {
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(20px, 4vw, 30px);
  cursor: pointer;
  position: relative;
}

.chess-sq.light { background: #e2e8f0; color: #0f172a; }
.chess-sq.dark { background: #475569; color: #f8fafc; }
.chess-sq.selected { outline: 3px solid var(--accent); outline-offset: -3px; }
.chess-sq.legal::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(10, 132, 255, 0.72);
  position: absolute;
}

/* Music Studio Step Sequencer */
.seq-grid {
  display: grid;
  grid-template-columns: 92px repeat(16, minmax(22px, 1fr));
  gap: 4px;
  align-items: center;
}

.seq-step {
  height: 26px;
  border-radius: 5px;
  border: 1px solid var(--divider);
  background: var(--surface-card);
  cursor: pointer;
}

.seq-step.on {
  background: var(--accent);
  border-color: var(--accent);
}

.seq-step.playhead {
  outline: 2px solid var(--warning);
}

/* Sticky Notes */
.sticky-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.sticky-card {
  border-radius: 14px;
  padding: 10px;
  color: #111827;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 165px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.sticky-card textarea {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  color: #111827;
  font-size: 13px;
  line-height: 1.45;
}

/* Zenith Browser Search & Compatibility Views */
.browser-tab.drag-over {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.browser-progress-bar {
  height: 3px;
  width: 100%;
  background: transparent;
  overflow: hidden;
  flex-shrink: 0;
}

.browser-progress-bar.active {
  background: var(--accent-soft);
  position: relative;
}

.browser-progress-bar.active::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -35%;
  width: 35%;
  background: var(--accent);
  animation: zenithBrowserLoad 1.1s ease-in-out infinite;
}

@keyframes zenithBrowserLoad {
  0% { left: -35%; }
  100% { left: 100%; }
}

.browser-search-wrap {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.browser-result-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-card);
  border: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.browser-result-card:hover {
  border-color: var(--accent);
}

.browser-result-title {
  border: none;
  background: transparent;
  padding: 2px 0;
  margin: 0;
  text-align: left;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  touch-action: manipulation;
  min-height: 30px;
}

.browser-result-title:hover {
  text-decoration: underline;
}

.browser-result-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.browser-result-url {
  color: #30d158;
  word-break: break-all;
}

.browser-compat-card {
  max-width: 540px;
  margin: 36px auto;
  padding: 24px;
  border-radius: 16px;
  background: var(--surface-card);
  border: 1px solid var(--divider);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Compact Explorer & Browser Toolbars + Popovers + Miller Columns */
.finder-toolbar,
.browser-toolbar {
  padding: 6px 10px;
  min-height: 40px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  flex-shrink: 0;
  position: relative;
}

.finder-toolbar .btn,
.browser-toolbar .btn {
  min-height: 28px;
  padding: 3px 9px;
  font-size: 12px;
  flex-shrink: 0;
}

.finder-seg-toggle {
  display: inline-flex;
  background: var(--surface-input);
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}

.finder-seg-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.finder-seg-btn.active {
  background: var(--accent);
  color: #fff;
}

.finder-selection-strip {
  padding: 5px 10px;
  min-height: 32px;
  border-bottom: 1px solid var(--divider);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
  gap: 6px;
  font-size: 11.5px;
}

.finder-selection-strip .btn {
  min-height: 24px;
  padding: 2px 8px;
  font-size: 11px;
  flex-shrink: 0;
}

.toolbar-popover-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.toolbar-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 205px;
  max-height: 340px;
  overflow-y: auto;
  background: var(--glass-bg-elevated, var(--surface-app));
  backdrop-filter: blur(22px);
  border: 1px solid var(--divider);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  padding: 6px;
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toolbar-popover-item {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.toolbar-popover-item:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent);
}

.toolbar-popover-item:disabled {
  opacity: 0.45;
  cursor: default;
}

.toolbar-popover-sep {
  height: 1px;
  background: var(--divider);
  margin: 4px 2px;
}

.toolbar-popover-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 4px 8px 2px;
}

.finder-columns {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: stretch;
}

.finder-col-pane {
  width: 210px;
  min-width: 185px;
  flex-shrink: 0;
  border-right: 1px solid var(--divider);
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.finder-col-item {
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 7px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}

.finder-col-item:hover {
  background: var(--glass-bg-subtle);
}

.finder-col-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.finder-col-meta {
  min-width: 220px;
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.browser-compat-banner {
  padding: 3px 10px;
  min-height: 28px;
  font-size: 11.5px;
  background: var(--surface-sidebar);
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.browser-compat-banner .btn {
  min-height: 22px;
  padding: 2px 8px;
  font-size: 11px;
}

@media (max-width: 720px) {
  .finder-toolbar,
  .browser-toolbar {
    gap: 4px;
  }
  .finder-breadcrumbs {
    min-width: 100%;
    order: 5;
  }
}

/* Redesigned macOS-Inspired System Settings */
.macos-settings-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.macos-settings-sidebar {
  width: 242px;
  flex-shrink: 0;
  background: var(--surface-sidebar);
  border-right: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.macos-settings-search-wrap {
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.macos-settings-profile-mini {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 10px;
  background: var(--surface-card);
  border: 1px solid var(--divider);
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.macos-settings-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.macos-nav-group {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 8px 3px;
}

.macos-nav-item {
  width: 100%;
  border: none;
  background: transparent;
  padding: 6px 9px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  min-height: 32px;
}

.macos-nav-item:hover {
  background: var(--glass-bg-subtle);
}

.macos-nav-item.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.macos-nav-icon {
  width: 24px;
  height: 24px;
  border-radius: 6.5px;
  background: var(--glass-bg-subtle);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 1px 3px rgba(0, 0, 0, 0.18);
}

.macos-nav-icon svg {
  width: 14px;
  height: 14px;
}

.macos-nav-item.active .macos-nav-icon {
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.macos-settings-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.macos-settings-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-bg-subtle);
}

.macos-settings-back {
  display: none;
}

.macos-settings-search-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.macos-search-hit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--divider);
  background: var(--surface-card);
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.macos-search-hit:hover,
.macos-search-hit.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.setting-highlight-pulse {
  animation: settingPulse 1.6s ease;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

@keyframes settingPulse {
  0% { box-shadow: 0 0 0 6px var(--accent-soft); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

@media (max-width: 720px) {
  .macos-settings-shell.mobile-detail .macos-settings-sidebar {
    display: none;
  }
  .macos-settings-shell:not(.mobile-detail) .macos-settings-main {
    display: none;
  }
  .macos-settings-shell:not(.mobile-detail) .macos-settings-sidebar {
    width: 100%;
    border-right: none;
  }
  .macos-settings-back {
    display: inline-flex;
  }
}

/* Finder Unified Settings-Style Layout */
.finder-settings-header {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
}

.finder-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 180px;
}

.finder-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.finder-header-actions .btn {
  min-height: 28px;
  padding: 3px 10px;
  font-size: 12px;
}

.finder-drive-avatar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.macos-nav-item.drag-over {
  outline: 2px dashed var(--accent);
  background: var(--accent-soft);
}

.macos-nav-count {
  font-size: 10.5px;
  font-weight: 600;
  opacity: 0.7;
  flex-shrink: 0;
}

.finder-tabs-bar {
  background: var(--glass-bg-subtle);
  padding: 4px 10px;
  min-height: 34px;
}

.finder-body-split {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.finder-preview-pane {
  width: 268px;
  flex-shrink: 0;
  border-left: 1px solid var(--divider);
  background: var(--surface-sidebar);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.finder-inspector-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.finder-inspector-card {
  background: var(--surface-card);
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

@media (max-width: 720px) {
  .finder-body-split {
    flex-direction: column;
  }
  .finder-preview-pane {
    width: 100%;
    max-height: 210px;
    border-left: none;
    border-top: 1px solid var(--divider);
  }
  .finder-preview-pane.empty-hidden {
    display: none !important;
  }
}

/* Zenith Developer Studio */
.devstudio-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.devstudio-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.devstudio-tree {
  width: 210px;
  flex-shrink: 0;
  background: var(--surface-sidebar);
  border-right: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.devstudio-tree-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.devstudio-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px 0;
  background: var(--surface-sidebar);
  border-bottom: 1px solid var(--divider);
  overflow-x: auto;
}

.devstudio-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px 8px 0 0;
  border: 1px solid transparent;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.devstudio-tab.active {
  background: #0d1320;
  color: #f8fafc;
  border-color: var(--divider);
  border-bottom-color: transparent;
  font-weight: 600;
}

.devstudio-split {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.devstudio-preview {
  width: 42%;
  min-width: 220px;
  border-left: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  background: var(--surface-app);
}

.devstudio-findbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--divider);
  background: var(--surface-sidebar);
  flex-wrap: wrap;
}

.devstudio-diag-bar {
  padding: 5px 10px;
  border-top: 1px solid var(--divider);
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface-sidebar);
}

.devstudio-diag-bar.has-error {
  background: rgba(255, 69, 58, 0.14);
  color: #ff6961;
}

@media (max-width: 720px) {
  .devstudio-tree {
    display: none;
  }
  .devstudio-split {
    flex-direction: column;
  }
  .devstudio-preview {
    width: 100%;
    height: 45%;
    border-left: none;
    border-top: 1px solid var(--divider);
  }
}

/* Automation Studio Visual Blocks */
.wf-canvas {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wf-block {
  border: 1px solid var(--divider);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: var(--surface-card);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: grab;
  transition: transform 0.12s ease, border-color 0.14s ease, opacity 0.14s ease;
}

.wf-block.dragging {
  opacity: 0.48;
  transform: scale(0.98);
}

.wf-block.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.wf-cond-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* Quality Center Status Badges */
.qc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.qc-pass {
  background: rgba(48, 209, 88, 0.16);
  color: #30d158;
}

.qc-warn {
  background: rgba(255, 214, 10, 0.16);
  color: #ffd60a;
}

.qc-fail {
  background: rgba(255, 69, 58, 0.18);
  color: #ff6961;
}

/* Siri Gemini AI Assistant */
.siri-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--surface-app);
}

.siri-sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--surface-sidebar);
  border-right: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.siri-sidebar-top {
  padding: 10px;
  border-bottom: 1px solid var(--divider);
}

.siri-new-chat-btn {
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--divider);
  background: var(--surface-card);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.siri-new-chat-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.siri-thread-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.siri-thread-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.siri-thread-item:hover {
  background: var(--glass-bg-subtle);
}

.siri-thread-item.active {
  background: var(--accent-soft);
  border-color: rgba(99, 102, 241, 0.35);
}

.siri-thread-meta {
  min-width: 0;
  flex: 1;
}

.siri-thread-title {
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.siri-thread-sub {
  font-size: 10.5px;
  color: var(--text-secondary);
}

.siri-thread-del {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 6px;
}

.siri-thread-del:hover {
  color: #ff453a;
  background: rgba(255, 69, 58, 0.14);
}

.siri-thread-empty {
  padding: 14px 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.siri-sidebar-foot {
  padding: 10px;
  border-top: 1px solid var(--divider);
}

.siri-status-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--surface-card);
  border: 1px solid var(--divider);
}

.siri-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #ffd60a;
}

.siri-status-pill.ready .siri-status-dot {
  background: #30d158;
  box-shadow: 0 0 8px rgba(48, 209, 88, 0.6);
}

.siri-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.siri-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--divider);
  background: var(--glass-bg-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.siri-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.siri-brand-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
}

.siri-brand-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

.siri-model-select {
  background: var(--surface-input);
  color: var(--text-primary);
  border: 1px solid var(--divider);
  border-radius: 9px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
}

.siri-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.siri-icon-btn,
.siri-key-btn {
  border: 1px solid var(--divider);
  background: var(--surface-card);
  color: var(--text-primary);
  border-radius: 9px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.siri-icon-btn.active,
.siri-key-btn.highlight {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.siri-orb {
  border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, #67e8f9 0%, #818cf8 44%, #ec4899 82%, #312e81 100%);
  box-shadow: 0 0 18px rgba(103, 232, 249, 0.42), inset -4px -6px 12px rgba(15, 23, 42, 0.45);
  position: relative;
  flex-shrink: 0;
}

.siri-orb-mini {
  width: 28px;
  height: 28px;
}

.siri-orb-xs {
  width: 24px;
  height: 24px;
}

.siri-orb-hero {
  width: 76px;
  height: 76px;
  box-shadow: 0 0 36px rgba(129, 140, 248, 0.55), 0 0 60px rgba(236, 72, 153, 0.35);
  animation: siriOrbFloat 4.2s ease-in-out infinite;
}

.siri-orb.thinking {
  animation: siriOrbSpin 1.1s linear infinite;
}

@keyframes siriOrbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.04); }
}

@keyframes siriOrbSpin {
  0% { filter: hue-rotate(0deg) saturate(1.2); transform: scale(0.96); }
  50% { filter: hue-rotate(180deg) saturate(1.4); transform: scale(1.08); }
  100% { filter: hue-rotate(360deg) saturate(1.2); transform: scale(0.96); }
}

.siri-key-panel {
  padding: 10px 16px;
  background: var(--surface-sidebar);
  border-bottom: 1px solid var(--divider);
}

.siri-key-native-note {
  font-size: 12px;
  color: #30d158;
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(48, 209, 88, 0.12);
}

.siri-key-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 12.5px;
}

.siri-key-hint {
  font-size: 11px;
  color: var(--text-secondary);
}

.siri-key-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.siri-api-key-input {
  flex: 1;
  min-width: 210px;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid var(--divider);
  background: var(--surface-input);
  color: var(--text-primary);
  font-size: 12.5px;
  outline: none;
}

.siri-save-key-btn,
.siri-clear-key-btn {
  border-radius: 9px;
  border: 1px solid var(--divider);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.siri-save-key-btn {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.siri-clear-key-btn {
  background: transparent;
  color: #ff453a;
}

.siri-key-status {
  margin-top: 7px;
  font-size: 11.5px;
  padding: 5px 9px;
  border-radius: 8px;
}

.siri-key-status.ok {
  background: rgba(48, 209, 88, 0.14);
  color: #30d158;
}

.siri-key-status.err {
  background: rgba(255, 69, 58, 0.14);
  color: #ff6961;
}

.siri-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.siri-welcome {
  margin: auto;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 16px 0;
}

.siri-welcome h2 {
  margin: 6px 0 0;
  font-size: 20px;
  font-weight: 700;
}

.siri-welcome p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.siri-starter-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.siri-starter-card {
  border: 1px solid var(--divider);
  background: var(--surface-card);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 11px 13px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.siri-starter-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.siri-starter-title {
  font-size: 12.5px;
  font-weight: 700;
}

.siri-starter-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.siri-msg-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.siri-msg-row.user {
  justify-content: flex-end;
}

.siri-msg-user {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
  background: var(--accent);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.48;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
}

.siri-msg-attach {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.9;
  margin-bottom: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.18);
  display: inline-block;
}

.siri-msg-ai {
  flex: 1;
  min-width: 0;
  max-width: 86%;
  padding: 11px 14px;
  border-radius: 16px 16px 16px 4px;
  background: var(--surface-card);
  border: 1px solid var(--divider);
  font-size: 13.5px;
  line-height: 1.55;
  user-select: text;
}

.siri-msg-row.error .siri-msg-ai {
  border-color: rgba(255, 69, 58, 0.45);
  background: rgba(255, 69, 58, 0.1);
}

.siri-md-p {
  margin: 0 0 8px;
}

.siri-md-p:last-child {
  margin-bottom: 0;
}

.siri-md-h {
  margin: 8px 0 5px;
  font-size: 14px;
  font-weight: 700;
}

.siri-md-list {
  margin: 4px 0 8px 18px;
  padding: 0;
}

.siri-inline-code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-input);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.siri-code-block {
  margin: 8px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--divider);
  background: #0d1320;
  color: #e2e8f0;
}

.siri-code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: #94a3b8;
}

.siri-copy-code-btn {
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.siri-code-block pre {
  margin: 0;
  padding: 10px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.45;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.siri-msg-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--divider);
  font-size: 11px;
  color: var(--text-muted);
}

.siri-msg-tools {
  display: flex;
  gap: 6px;
}

.siri-msg-tool {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.siri-msg-tool:hover {
  background: var(--glass-bg-subtle);
  color: var(--text-primary);
}

.siri-thinking-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 12.5px;
}

.siri-waveform {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 16px;
}

.siri-waveform span {
  width: 3px;
  height: 6px;
  border-radius: 2px;
  background: linear-gradient(180deg, #67e8f9, #818cf8);
  animation: siriWave 0.9s ease-in-out infinite;
}

.siri-waveform span:nth-child(2) { animation-delay: 0.12s; }
.siri-waveform span:nth-child(3) { animation-delay: 0.24s; }
.siri-waveform span:nth-child(4) { animation-delay: 0.36s; }
.siri-waveform span:nth-child(5) { animation-delay: 0.48s; }

@keyframes siriWave {
  0%, 100% { height: 5px; opacity: 0.55; }
  50% { height: 15px; opacity: 1; }
}

.siri-composer-wrap {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--divider);
  background: var(--glass-bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.siri-attachment-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
}

.siri-attachment-chip button {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.siri-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 16px;
  border: 1px solid var(--divider);
  background: var(--surface-input);
}

.siri-tool-btn {
  border: none;
  background: transparent;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.siri-tool-btn.listening {
  background: rgba(255, 69, 58, 0.22);
}

.siri-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.45;
  resize: none;
  outline: none;
  padding: 6px 4px;
  max-height: 140px;
}

.siri-send-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.siri-send-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

@media (max-width: 700px) {
  .siri-shell {
    flex-direction: column;
  }
  .siri-sidebar {
    width: 100%;
    max-height: 136px;
    border-right: none;
    border-bottom: 1px solid var(--divider);
  }
}

/* WhatsApp App */
.wa-shell {
  display: grid;
  grid-template-columns: 290px 1fr;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--surface-app);
  color: var(--text-primary);
}

.wa-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #111b21;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .wa-sidebar {
  background: #ffffff;
  border-right-color: rgba(15, 23, 42, 0.1);
}

.wa-sidebar-header,
.wa-chat-header {
  min-height: 54px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #202c33;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

html[data-theme="light"] .wa-sidebar-header,
html[data-theme="light"] .wa-chat-header {
  background: #f0f2f5;
  border-bottom-color: rgba(15, 23, 42, 0.09);
}

.wa-brand-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.wa-user-avatar,
.wa-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 800;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.wa-self-handle {
  font-size: 11px;
  color: #8696a0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="light"] .wa-self-handle {
  color: #54656f;
}

.wa-status-pill {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(134, 150, 160, 0.2);
  color: #8696a0;
}

.wa-status-pill.online {
  background: rgba(0, 168, 132, 0.22);
  color: #25d366;
}

html[data-theme="light"] .wa-status-pill.online {
  background: rgba(0, 168, 132, 0.16);
  color: #008069;
}

.wa-icon-btn {
  border: none;
  background: transparent;
  color: inherit;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wa-icon-btn:hover {
  background: rgba(134, 150, 160, 0.18);
}

.wa-icon-btn.spinning {
  opacity: 0.5;
}

.wa-auth-card {
  margin: 8px 10px 0;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 168, 132, 0.12);
  border: 1px solid rgba(0, 168, 132, 0.3);
}

.wa-search-wrap {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

html[data-theme="light"] .wa-search-wrap {
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

.wa-search-input {
  width: 100%;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
}

.wa-filter-pills {
  display: flex;
  gap: 6px;
}

.wa-pill {
  border: none;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  color: #aebac1;
}

html[data-theme="light"] .wa-pill {
  background: #f0f2f5;
  color: #54656f;
}

.wa-pill.active {
  background: rgba(0, 168, 132, 0.22);
  color: #25d366;
}

html[data-theme="light"] .wa-pill.active {
  background: #d9fdd3;
  color: #008069;
}

.wa-chat-list {
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wa-chat-row {
  width: 100%;
  border: none;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}

.wa-chat-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

html[data-theme="light"] .wa-chat-row:hover {
  background: #f5f6f6;
}

.wa-chat-row.active {
  background: #2a3942;
}

html[data-theme="light"] .wa-chat-row.active {
  background: #f0f2f5;
}

.wa-chat-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wa-chat-top,
.wa-chat-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.wa-chat-name {
  font-size: 13.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wa-chat-time {
  font-size: 10.5px;
  color: #8696a0;
  flex-shrink: 0;
}

.wa-chat-time.unread {
  color: #25d366;
  font-weight: 700;
}

html[data-theme="light"] .wa-chat-time.unread {
  color: #008069;
}

.wa-chat-preview {
  font-size: 12px;
  color: #8696a0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="light"] .wa-chat-preview {
  color: #667781;
}

.wa-unread-pill {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: #25d366;
  color: #0b141a;
  font-size: 10.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wa-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background-color: #0b141a;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 22px 22px;
}

html[data-theme="light"] .wa-stage {
  background-color: #efeae2;
  background-image: radial-gradient(rgba(17, 27, 33, 0.06) 1px, transparent 1px);
}

.wa-error-strip {
  padding: 6px 12px;
  font-size: 11.5px;
  background: rgba(255, 69, 58, 0.16);
  color: #ff6961;
  border-bottom: 1px solid rgba(255, 69, 58, 0.3);
}

.wa-inchat-search {
  padding: 7px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--glass-bg-elevated);
  border-bottom: 1px solid var(--divider);
}

.wa-feed {
  flex: 1;
  min-height: 0;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wa-empty-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
}

.wa-empty-card {
  max-width: 360px;
  padding: 22px;
  border-radius: 16px;
  text-align: center;
  background: var(--glass-bg-elevated);
  border: 1px solid var(--glass-border);
}

.wa-date-row {
  display: flex;
  justify-content: center;
  margin: 8px 0 4px;
}

.wa-date-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 8px;
  background: #182229;
  color: #aebac1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

html[data-theme="light"] .wa-date-chip {
  background: #ffffff;
  color: #54656f;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

.wa-bubble-row {
  display: flex;
  width: 100%;
}

.wa-bubble-row.out {
  justify-content: flex-end;
}

.wa-bubble-row.in {
  justify-content: flex-start;
}

.wa-bubble {
  position: relative;
  max-width: min(74%, 540px);
  padding: 8px 11px 6px;
  border-radius: 11px;
  background: #202c33;
  color: #e9edef;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
  word-wrap: break-word;
}

.wa-bubble.in {
  border-top-left-radius: 2px;
}

.wa-bubble.out {
  background: #005c4b;
  color: #e9edef;
  border-top-right-radius: 2px;
}

html[data-theme="light"] .wa-bubble {
  background: #ffffff;
  color: #111b21;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .wa-bubble.out {
  background: #d9fdd3;
  color: #111b21;
}

.wa-bubble-quote {
  margin-bottom: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  border-left: 3px solid #25d366;
  background: rgba(0, 0, 0, 0.16);
  font-size: 11.5px;
}

html[data-theme="light"] .wa-bubble-quote {
  background: rgba(15, 23, 42, 0.06);
}

.wa-bubble-quote-author {
  font-weight: 700;
  color: #25d366;
}

html[data-theme="light"] .wa-bubble-quote-author {
  color: #008069;
}

.wa-bubble-quote-text {
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wa-bubble-media img {
  display: block;
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  margin-bottom: 6px;
}

.wa-bubble-file {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.16);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 5px;
}

html[data-theme="light"] .wa-bubble-file {
  background: rgba(15, 23, 42, 0.06);
}

.wa-bubble-text {
  font-size: 13.5px;
  line-height: 1.48;
  white-space: pre-wrap;
}

.wa-bubble-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  font-size: 10px;
  opacity: 0.72;
}

.wa-star-flag {
  color: #fbbf24;
  font-size: 11px;
}

.wa-tick {
  font-weight: 700;
  letter-spacing: -2px;
  margin-right: 2px;
}

.wa-tick.read {
  color: #53bdeb;
}

.wa-bubble-actions {
  display: none;
  position: absolute;
  top: -12px;
  right: 8px;
  background: var(--glass-bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 2px 5px;
  gap: 2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 4;
}

.wa-bubble:hover .wa-bubble-actions,
.wa-bubble:focus-within .wa-bubble-actions {
  display: inline-flex;
}

.wa-act-btn {
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 11.5px;
  padding: 2px 5px;
  border-radius: 999px;
}

.wa-act-btn:hover {
  background: var(--glass-bg-subtle);
}

.wa-reply-banner,
.wa-attach-banner {
  padding: 7px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #202c33;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .wa-reply-banner,
html[data-theme="light"] .wa-attach-banner {
  background: #f0f2f5;
  border-top-color: rgba(15, 23, 42, 0.08);
}

.wa-reply-quote-box {
  padding: 4px 8px;
  border-left: 3px solid #00a884;
  background: rgba(0, 0, 0, 0.14);
  border-radius: 6px;
}

html[data-theme="light"] .wa-reply-quote-box {
  background: #ffffff;
}

.wa-emoji-tray {
  padding: 8px 14px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  background: #202c33;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .wa-emoji-tray {
  background: #f0f2f5;
  border-top-color: rgba(15, 23, 42, 0.08);
}

.wa-emoji-pick {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 8px;
}

.wa-emoji-pick:hover {
  background: rgba(134, 150, 160, 0.2);
}

.wa-attach-menu {
  position: absolute;
  bottom: 58px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border-radius: 12px;
  background: var(--glass-bg-elevated);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-panel);
  z-index: 10;
}

.wa-attach-opt {
  border: none;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
}

.wa-attach-opt:hover {
  background: var(--glass-bg-subtle);
}

.wa-composer {
  padding: 8px 12px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #202c33;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

html[data-theme="light"] .wa-composer {
  background: #f0f2f5;
  border-top-color: rgba(15, 23, 42, 0.08);
}

.wa-input {
  flex: 1;
  min-height: 36px;
  max-height: 110px;
  border: none;
  border-radius: 18px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  resize: none;
  outline: none;
  background: #2a3942;
  color: #e9edef;
}

html[data-theme="light"] .wa-input {
  background: #ffffff;
  color: #111b21;
}

.wa-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #00a884;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wa-send-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.wa-back-btn {
  display: none;
}

@media (max-width: 660px) {
  .wa-shell {
    grid-template-columns: 1fr;
  }
  .wa-shell.wa-mobile-chat-open .wa-sidebar {
    display: none;
  }
  .wa-shell:not(.wa-mobile-chat-open) .wa-stage {
    display: none;
  }
  .wa-back-btn {
    display: inline-flex;
  }
  .wa-bubble {
    max-width: 86%;
  }
}




