/* =============================================================================
   macOS 27 — App-specific Liquid Glass styles
   ============================================================================= */

/* Finder icon grid (Tahoe-style) */
.finder-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 18px 12px;
  padding: 18px 16px 12px;
  overflow: auto;
  flex: 1;
}
.finder-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  text-align: center;
  color: rgba(0, 0, 0, 0.78);
  cursor: default;
}
.finder-icon-item:hover .finder-file-icon {
  filter: brightness(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}
.finder-file-icon {
  width: 64px;
  height: 52px;
  border-radius: 6px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.55), transparent 50%),
    linear-gradient(145deg, var(--c, #5ac8fa), color-mix(in srgb, var(--c, #5ac8fa) 60%, #000));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), inset 0 0.5px 0 rgba(255, 255, 255, 0.5);
  position: relative;
}
.finder-file-icon::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
}
.finder-pathbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  font-size: 11px;
  border-top: 0.5px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.4);
  color: rgba(0, 0, 0, 0.55);
}

/* Shared app layout */
.app-layout {
  display: flex;
  height: 100%;
  min-height: 0;
  background: rgba(246, 246, 248, 0.72);
  color: #1d1d1f;
  font-size: 13px;
}
.app-layout.col {
  flex-direction: column;
}
.app-sidebar {
  width: 180px;
  flex-shrink: 0;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.28);
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(24px) saturate(160%);
  overflow-y: auto;
}
.app-sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: default;
  color: #1d1d1f;
  margin-bottom: 1px;
}
.app-sidebar-item:hover {
  background: rgba(0, 0, 0, 0.05);
}
.app-sidebar-item.active,
.app-sidebar-item.selected {
  background: rgba(0, 122, 255, 0.85);
  color: #fff;
}
.app-sidebar-item.active .muted,
.app-sidebar-item.active .sb-icon {
  color: rgba(255, 255, 255, 0.9);
}
.sb-icon {
  width: 18px;
  text-align: center;
  opacity: 0.85;
  font-size: 12px;
}
.sb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a84ff, #64d2ff);
}
.app-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: 0;
}
.app-main.split {
  flex-direction: row;
}
.app-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}
.tb-nav {
  opacity: 0.55;
  letter-spacing: 4px;
  font-size: 12px;
}
.tb-path {
  flex: 1;
  font-size: 12px;
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-actions {
  opacity: 0.7;
  font-size: 12px;
}
.search-field {
  appearance: none;
  border: none;
  outline: none;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  padding: 5px 10px;
  font: inherit;
  min-width: 120px;
  color: inherit;
}
.search-field.grow,
.grow {
  flex: 1;
}
.search-field::placeholder {
  color: rgba(0, 0, 0, 0.35);
}
.muted {
  color: rgba(0, 0, 0, 0.45);
  font-size: 12px;
}
.app-list {
  flex: 1;
  overflow: auto;
}
.app-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  cursor: default;
}
.app-list-row:hover,
.app-list-row.selected {
  background: rgba(0, 122, 255, 0.08);
}
.row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.row-meta {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}
.app-empty {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px;
  opacity: 0.7;
}
.empty-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.08);
}
.pill.green {
  background: rgba(52, 199, 89, 0.18);
  color: #1a7f37;
}
.pill.red {
  background: rgba(255, 59, 48, 0.15);
  color: #c41e16;
}
.btn-primary {
  appearance: none;
  border: none;
  background: #0a84ff;
  color: #fff;
  border-radius: 8px;
  padding: 7px 14px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.btn-primary:hover {
  filter: brightness(1.05);
}
.btn-primary.wide,
.btn-glass.wide {
  width: 100%;
}
.btn-glass {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(16px);
  border-radius: 8px;
  padding: 7px 12px;
  font: inherit;
  cursor: pointer;
}
.btn-glass.active {
  background: rgba(10, 132, 255, 0.2);
  border-color: rgba(10, 132, 255, 0.35);
  color: #0a84ff;
}
.section-title {
  margin: 16px 16px 8px;
  font-size: 15px;
}

/* Safari */
.safari-start {
  padding: 28px;
  overflow: auto;
}
.favorites {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.fav-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.5);
  cursor: default;
}
.fav-letter {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  background: linear-gradient(145deg, #5ac8fa, #0a84ff);
}
.url-bar {
  flex: 1;
  text-align: center;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
  font-size: 13px;
  color: rgba(0, 0, 0, 0.55);
}
.privacy-report {
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

/* Mail */
.mail-list {
  width: 280px;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  overflow: auto;
  flex-shrink: 0;
}
.mail-read {
  flex: 1;
  padding: 20px 24px;
  overflow: auto;
}
.mail-body {
  margin-top: 16px;
  line-height: 1.55;
}

/* Messages */
.msg-sidebar .app-sidebar-item {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.messages-pane {
  background: rgba(255, 255, 255, 0.55);
}
.msg-header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  text-align: center;
}
.msg-thread {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
}
.bubble {
  max-width: 70%;
  padding: 8px 12px;
  border-radius: 18px;
  line-height: 1.35;
}
.bubble.them {
  align-self: flex-start;
  background: rgba(0, 0, 0, 0.07);
}
.bubble.me {
  align-self: flex-end;
  background: #0a84ff;
  color: #fff;
}
.msg-compose {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Maps */
.maps-app,
.map-canvas {
  position: relative;
  flex: 1;
  min-height: 0;
}
.map-canvas {
  background:
    radial-gradient(circle at 30% 40%, rgba(120, 200, 140, 0.35), transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(100, 160, 255, 0.3), transparent 45%),
    linear-gradient(160deg, #c8e6c9, #bbdefb 50%, #d7ccc8);
  overflow: hidden;
}
.map-roads {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 48%, rgba(255, 255, 255, 0.55) 49%, rgba(255, 255, 255, 0.55) 51%, transparent 52%),
    linear-gradient(0deg, transparent 48%, rgba(255, 255, 255, 0.4) 49%, rgba(255, 255, 255, 0.4) 51%, transparent 52%);
  background-size: 120px 120px;
  opacity: 0.5;
}
.map-pin {
  position: absolute;
  left: 52%;
  top: 42%;
  font-size: 32px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
  transform: translate(-50%, -100%);
}
.map-card {
  position: absolute;
  left: 20px;
  bottom: 20px;
  padding: 14px 16px;
  border-radius: 14px;
  min-width: 200px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(24px) saturate(160%);
}

/* Photos - Liquid Glass library */
.photos-app {
  background: rgba(248, 248, 250, 0.78);
}
.photos-sidebar {
  width: 200px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.22)),
    rgba(245, 245, 247, 0.55);
  border-right: 0.5px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
}
.sb-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: rgba(0, 0, 0, 0.4);
  padding: 12px 10px 4px;
  user-select: none;
}
.photos-main {
  background: rgba(255, 255, 255, 0.35);
}
.photos-main .app-toolbar {
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.07);
}
.photos-tb-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.photos-tb-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.photos-view {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  padding: 2px;
  border: 0.5px solid rgba(0, 0, 0, 0.06);
}
.photos-view .tb-seg {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  color: rgba(0, 0, 0, 0.65);
  cursor: default;
}
.photos-view .tb-seg.active {
  background: rgba(255, 255, 255, 0.9);
  color: #1d1d1f;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), inset 0 0.5px 0 rgba(255, 255, 255, 0.8);
}
.photos-search {
  width: 140px;
}
.photos-scroll {
  flex: 1;
  overflow: auto;
  min-height: 0;
}
.photos-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 16px 14px 8px;
}
.photos-section-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 3px;
  padding: 0 3px 16px;
}
.photo-grid-sm {
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}
.photo-tile {
  aspect-ratio: 1;
  border-radius: 3px;
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: default;
}
.photo-tile:hover {
  transform: scale(1.02);
  z-index: 1;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.18),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.35);
}

/* FaceTime */
.facetime-app {
  padding: 16px;
  gap: 12px;
}
.ft-hero {
  text-align: center;
  padding: 24px 12px 8px;
}
.ft-avatar {
  width: 88px;
  height: 88px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 42px;
  background: linear-gradient(145deg, #30d158, #64d2ff);
  box-shadow: 0 8px 24px rgba(48, 209, 88, 0.35);
}
.ft-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Calendar */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  padding: 8px 12px;
  flex: 1;
}
.cal-head {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.45);
  padding: 6px;
}
.cal-cell {
  min-height: 52px;
  padding: 6px;
  border-radius: 8px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.25);
}
.cal-cell.today {
  background: rgba(10, 132, 255, 0.15);
  color: #0a84ff;
  font-weight: 700;
}
.cal-cell.has-event::after {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #0a84ff;
  margin-top: 4px;
}
.cal-events {
  display: flex;
  gap: 8px;
  padding: 10px 14px 14px;
  flex-wrap: wrap;
}
.event-chip {
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 59, 48, 0.12);
  color: #c41e16;
  font-size: 12px;
  font-weight: 500;
}
.event-chip.blue {
  background: rgba(10, 132, 255, 0.12);
  color: #0a84ff;
}

/* Notes */
.notes-list {
  width: 220px;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  overflow: auto;
  flex-shrink: 0;
}
.note-editor {
  flex: 1;
  padding: 20px 24px;
  overflow: auto;
  line-height: 1.5;
}
.note-editor h2,
.note-editor p,
.note-editor ul {
  outline: none;
}

/* Music / TV / albums - Liquid Glass */
.music-app {
  background: rgba(248, 248, 250, 0.78);
}
.music-sidebar {
  width: 200px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.22)),
    rgba(245, 245, 247, 0.55);
  border-right: 0.5px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
}
.music-main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: 0;
  background: rgba(255, 255, 255, 0.32);
}
.music-main .app-toolbar {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.07);
}
.music-main .app-toolbar .grow {
  flex: 1;
}
.music-scroll {
  flex: 1;
  overflow: auto;
  min-height: 0;
  /* Breathing room so last row titles aren't clipped at player edge */
  padding: 0 0 28px;
  scroll-padding-bottom: 12px;
}
.music-section:last-child {
  margin-bottom: 8px;
  padding-bottom: 8px;
}
.music-app .music-main {
  /* Ensure column flex so scroll region + player don't overlap */
  overflow: hidden;
}
.music-app .mini-player {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  margin-top: auto;
}
.music-section {
  margin-top: 4px;
}
.music-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 16px 4px;
}
.music-section-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.linkish {
  font-size: 12px;
  font-weight: 500;
  cursor: default;
}
.linkish:hover {
  color: var(--color-accent, #0a84ff);
}
.album-row {
  display: flex;
  gap: 14px;
  padding: 8px 16px 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.album-card {
  width: 140px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: default;
}
.album-card strong {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.album-card .muted {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.album-card.mix-card .album-art {
  border-radius: 12px;
}
.album-art {
  aspect-ratio: 1;
  border-radius: 10px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.35), transparent 45%),
    linear-gradient(145deg, hsl(var(--h, 210), 72%, 62%), hsl(calc(var(--h, 210) + 42), 75%, 42%));
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.16),
    inset 0 0.5px 0 rgba(255, 255, 255, 0.4);
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.album-art-sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.28) 0%, transparent 42%);
  pointer-events: none;
}
.album-card:hover .album-art {
  transform: scale(1.03);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.2),
    inset 0 0.5px 0 rgba(255, 255, 255, 0.5);
}
.album-art.tv {
  aspect-ratio: 16 / 10;
}
.album-art.book {
  aspect-ratio: 2 / 3;
  border-radius: 4px 8px 8px 4px;
}

/* Mini player bar (Music) */
.mini-player,
.now-playing {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin: 0;
  border-radius: 0;
  border: none;
  border-top: 0.5px solid rgba(255, 255, 255, 0.55);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.38)),
    rgba(250, 250, 252, 0.65);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.65),
    0 -4px 20px rgba(0, 0, 0, 0.06);
}
.now-playing {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.6);
}
.np-art {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  flex-shrink: 0;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.35), transparent 50%),
    linear-gradient(135deg, #ff375f, #bf5af2);
  box-shadow: 0 4px 12px rgba(191, 90, 242, 0.35);
}
.np-meta {
  min-width: 100px;
  max-width: 140px;
}
.np-meta strong {
  font-size: 12px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np-meta .muted {
  font-size: 11px;
}
.np-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 360px;
  margin: 0 auto;
}
.np-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: normal;
  opacity: 1;
  margin-left: 0;
}
.np-btn {
  border: none;
  background: transparent;
  font-size: 13px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 50%;
  color: rgba(0, 0, 0, 0.75);
  cursor: default;
}
.np-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}
.np-play {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.08);
  font-size: 11px;
}
.np-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.np-time {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: rgba(0, 0, 0, 0.45);
  min-width: 28px;
}
.np-bar,
.np-vol-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.1);
  overflow: hidden;
}
.np-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff375f, #bf5af2);
}
.np-volume {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100px;
  flex-shrink: 0;
}
.np-vol-bar {
  flex: 1;
}
.np-vol-bar .np-bar-fill {
  background: rgba(0, 0, 0, 0.35);
}

/* App Store */
.store-hero {
  margin: 16px;
  padding: 28px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(10, 132, 255, 0.35), rgba(191, 90, 242, 0.3)),
    rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
}
.store-hero .muted {
  color: rgba(255, 255, 255, 0.85);
}
.store-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0.9;
  margin-bottom: 8px;
}
.store-list {
  padding: 0 16px 16px;
}
.store-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.store-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(145deg, #5ac8fa, #0a84ff);
  flex-shrink: 0;
}
.btn-get {
  margin-left: auto;
  appearance: none;
  border: none;
  background: rgba(0, 122, 255, 0.12);
  color: #0a84ff;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
}

/* Settings */
.settings-sb {
  width: 210px;
}
.settings-main {
  padding: 20px 24px;
  gap: 12px;
}
.settings-card {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.55);
  overflow: hidden;
  margin-bottom: 12px;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.settings-row:last-child {
  border-bottom: none;
}
.toggle {
  width: 42px;
  height: 26px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.15);
  position: relative;
  display: inline-block;
}
.toggle span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}
.toggle.on {
  background: #34c759;
}
.toggle.on span {
  transform: translateX(16px);
}

/* Contacts */
.contact-card {
  align-items: center;
  padding: 32px;
  text-align: center;
}
.contact-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(145deg, #ff9f0a, #ff375f);
  margin-bottom: 12px;
}
.contact-card .settings-card {
  width: min(360px, 100%);
  text-align: left;
  margin-top: 16px;
}

/* Reminders */
.reminder-list {
  padding: 8px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.reminder-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  cursor: pointer;
}
.reminder-item .done {
  text-decoration: line-through;
  opacity: 0.45;
}

/* Freeform */
.freeform-canvas {
  flex: 1;
  position: relative;
  background:
    radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.08) 1px, transparent 0);
  background-size: 24px 24px;
  overflow: hidden;
}
.ff-sticky {
  position: absolute;
  width: 140px;
  min-height: 100px;
  padding: 12px;
  border-radius: 4px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  font-size: 13px;
  font-weight: 500;
}
.ff-sticky.y {
  background: #fff9c4;
  left: 12%;
  top: 18%;
  transform: rotate(-3deg);
}
.ff-sticky.p {
  background: #f8bbd0;
  left: 38%;
  top: 30%;
  transform: rotate(2deg);
}
.ff-sticky.b {
  background: #bbdefb;
  left: 58%;
  top: 16%;
  transform: rotate(-1deg);
}
.ff-shape {
  position: absolute;
  left: 28%;
  top: 55%;
  width: 120px;
  height: 80px;
  border-radius: 16px;
  border: 3px solid #0a84ff;
  background: rgba(10, 132, 255, 0.08);
}
.ff-note {
  position: absolute;
  right: 10%;
  bottom: 14%;
  padding: 12px 14px;
  border-radius: 12px;
  max-width: 200px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Pages / docs */
.doc-page {
  margin: 20px auto;
  width: min(640px, 92%);
  min-height: 720px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  border-radius: 2px;
  padding: 48px 56px;
  line-height: 1.55;
}
.doc-page h1,
.doc-page p {
  outline: none;
}

/* Numbers */
.sheet-wrap {
  overflow: auto;
  flex: 1;
  padding: 8px;
}
.sheet {
  border-collapse: collapse;
  min-width: 100%;
  font-size: 12px;
  background: #fff;
}
.sheet th,
.sheet td {
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 6px 10px;
  min-width: 80px;
}
.sheet th {
  background: rgba(0, 0, 0, 0.04);
  font-weight: 600;
}
.sheet td {
  outline: none;
}

/* Keynote */
.keynote-thumbs {
  width: 120px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}
.kn-thumb {
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  background: #1d1d1f;
  color: #fff;
  display: grid;
  place-items: center;
  border: 2px solid transparent;
  opacity: 0.7;
}
.kn-thumb.active {
  border-color: #0a84ff;
  opacity: 1;
}
.kn-stage {
  background: #111;
  display: grid;
  place-items: center;
  padding: 24px;
}
.kn-slide {
  width: min(720px, 92%);
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: linear-gradient(145deg, #0a84ff, #bf5af2);
  color: #fff;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}
.kn-slide h1 {
  font-size: 42px;
  margin: 0;
  font-weight: 700;
}

/* Preview / TextEdit legacy hooks kept for theme overrides */
.preview-view {
  flex: 1;
  background-size: cover;
  background-position: center;
  margin: 12px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.textedit-area {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  padding: 16px 18px;
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  background: #fff;
  color: #1d1d1f;
}

/* Calculator */
.calc {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #1c1c1e;
  color: #fff;
  padding: 12px;
  gap: 10px;
}
.calc-display {
  text-align: right;
  font-size: 48px;
  font-weight: 300;
  padding: 20px 8px 12px;
  letter-spacing: 1px;
  min-height: 80px;
  word-break: break-all;
}
.calc-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  flex: 1;
}
.calc-key {
  appearance: none;
  border: none;
  border-radius: 50%;
  background: #333336;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  aspect-ratio: 1;
}
.calc-key.op {
  background: #ff9f0a;
}
.calc-key.wide {
  grid-column: span 2;
  border-radius: 999px;
  aspect-ratio: auto;
}
.calc-key:active {
  filter: brightness(1.25);
}

/* Clock */
.clock-app {
  padding: 12px;
}
.clock-tabs {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 12px;
}
.clock-tabs span {
  flex: 1;
  text-align: center;
  padding: 6px;
  border-radius: 6px;
  font-size: 12px;
  cursor: default;
}
.clock-tabs span.active {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 600;
}
.world-clocks {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.wc-time {
  font-size: 28px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
}

/* Terminal */
.terminal {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #0d1117;
  color: #c9d1d9;
  font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  padding: 10px 12px;
}
.term-lines {
  flex: 1;
  overflow: auto;
  white-space: pre-wrap;
}
.term-hint {
  opacity: 0.4;
}
.term-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}
.term-prompt {
  color: #3fb950;
  white-space: nowrap;
}
#term-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #c9d1d9;
  font: inherit;
  caret-color: #58a6ff;
}

/* TV - Watch Now + shelves */
.tv-app {
  background: rgba(18, 18, 22, 0.92);
  color: #f5f5f7;
}
.tv-app .app-toolbar {
  background: rgba(28, 28, 32, 0.72);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(36px) saturate(160%);
  -webkit-backdrop-filter: blur(36px) saturate(160%);
}
.tv-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.tv-tab {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: default;
}
.tv-tab:hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.06);
}
.tv-tab.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.15);
}
.tv-scroll {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding-bottom: 20px;
}
.tv-hero {
  margin: 16px 16px 8px;
  padding: 40px 32px 36px;
  border-radius: 20px;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  background:
    linear-gradient(115deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.12) 55%, transparent 100%),
    linear-gradient(145deg, #5e5ce6 0%, #bf5af2 45%, #ff375f 100%);
  color: #fff;
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.35),
    inset 0 0.5px 0 rgba(255, 255, 255, 0.28);
  position: relative;
  overflow: hidden;
}
.tv-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.14) 0%, transparent 40%);
  pointer-events: none;
}
.tv-hero-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0.85;
  position: relative;
  z-index: 1;
}
.tv-hero h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1;
}
.tv-hero .muted {
  color: rgba(255, 255, 255, 0.82);
  max-width: 420px;
  position: relative;
  z-index: 1;
  margin: 0;
}
.tv-hero-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  position: relative;
  z-index: 1;
}
.tv-hero-actions .btn-primary {
  background: #fff;
  color: #1d1d1f;
  border: none;
  border-radius: 980px;
  padding: 7px 18px;
  font-weight: 600;
  font-size: 13px;
  cursor: default;
}
.tv-hero-actions .btn-glass {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 0.5px solid rgba(255, 255, 255, 0.28);
  border-radius: 980px;
  padding: 7px 16px;
  font-weight: 600;
  font-size: 13px;
  backdrop-filter: blur(12px);
  cursor: default;
}
.tv-shelf {
  margin-top: 8px;
}
.tv-shelf-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 16px 6px;
}
.tv-shelf-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f5f5f7;
}
.tv-shelf-head .linkish {
  color: rgba(255, 255, 255, 0.45);
}
.tv-shelf-head .linkish:hover {
  color: #0a84ff;
}
.tv-shelf-row {
  display: flex;
  gap: 12px;
  padding: 4px 16px 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.tv-card {
  width: 168px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: default;
}
.tv-card strong {
  font-size: 12px;
  font-weight: 600;
  color: #f5f5f7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-card .muted {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}
.tv-poster {
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.22), transparent 48%),
    linear-gradient(145deg, hsl(var(--h, 220), 65%, 48%), hsl(calc(var(--h, 220) + 50), 70%, 32%));
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.35),
    inset 0 0.5px 0 rgba(255, 255, 255, 0.25);
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.tv-poster-sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.2) 0%, transparent 40%);
  pointer-events: none;
}
.tv-poster-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  backdrop-filter: blur(8px);
}
.tv-card:hover .tv-poster {
  transform: scale(1.04);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.45),
    inset 0 0.5px 0 rgba(255, 255, 255, 0.35);
}

/* Dark TV chrome - beat theme.css !important surface tokens */
.tv-app.app-layout {
  background: rgba(18, 18, 22, 0.94) !important;
  color: #f5f5f7 !important;
}
.tv-app .app-toolbar {
  background: rgba(28, 28, 32, 0.78) !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
  color: #f5f5f7 !important;
}
.tv-app .muted {
  color: rgba(255, 255, 255, 0.5) !important;
}
.tv-app .tv-hero .muted {
  color: rgba(255, 255, 255, 0.85) !important;
}
.window[data-app='tv'] .window-titlebar {
  background: rgba(22, 22, 26, 0.88);
  color: #f5f5f7;
}
.window[data-app='tv'] .window-title {
  color: #f5f5f7;
}

/* Photos / Music glass sidebars over themed surfaces */
.photos-sidebar.app-sidebar,
.music-sidebar.app-sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.18)),
    var(--surface-sidebar, rgba(245, 245, 247, 0.55)) !important;
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
}
.photos-main.app-main,
.music-main.app-main {
  background: var(--surface-main, rgba(255, 255, 255, 0.32)) !important;
}
.mini-player.glass {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.38)),
    var(--surface-card, rgba(250, 250, 252, 0.65)) !important;
  border-color: var(--border-glass, rgba(255, 255, 255, 0.55)) !important;
  color: var(--color-text, #1d1d1f) !important;
}
html[data-theme='dark'] .mini-player,
html[data-theme='dark'] .mini-player.glass {
  background:
    linear-gradient(180deg, rgba(60, 60, 65, 0.92), rgba(40, 40, 44, 0.88)),
    rgba(30, 30, 32, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: rgba(255, 255, 255, 0.92) !important;
  border-top-color: rgba(255, 255, 255, 0.1) !important;
}
html[data-theme='dark'] .mini-player .np-btn {
  color: rgba(255, 255, 255, 0.85);
}
html[data-theme='dark'] .mini-player .np-play {
  background: rgba(255, 255, 255, 0.12);
}
html[data-theme='dark'] .mini-player .np-time {
  color: rgba(255, 255, 255, 0.45);
}
html[data-theme='dark'] .mini-player .np-bar,
html[data-theme='dark'] .mini-player .np-vol-bar {
  background: rgba(255, 255, 255, 0.15);
}
html[data-theme='dark'] .mini-player .np-vol-bar .np-bar-fill {
  background: rgba(255, 255, 255, 0.55);
}
html[data-theme='dark'] .music-app {
  background: rgba(28, 28, 30, 0.92);
}
html[data-theme='dark'] .music-sidebar {
  background: rgba(36, 36, 38, 0.85);
  border-right-color: rgba(255, 255, 255, 0.08);
}
html[data-theme='dark'] .music-main {
  background: rgba(22, 22, 24, 0.5);
}
.sb-section-label {
  color: var(--color-text-tertiary, rgba(0, 0, 0, 0.4)) !important;
}

/* News */
.news-hero {
  margin: 16px;
  padding: 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

/* Stocks */
.stocks-list {
  padding: 4px 0;
}
.stock-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.stock-chart {
  margin: 12px;
  height: 120px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.4);
  position: relative;
  overflow: hidden;
}
.chart-line {
  position: absolute;
  inset: 20% 10% 20% 10%;
  border-radius: 50%;
  border-top: 3px solid #30d158;
  border-right: 3px solid #30d158;
  border-bottom: 3px solid transparent;
  border-left: 3px solid transparent;
  transform: rotate(-20deg);
  opacity: 0.9;
}

/* Weather */
.weather-app {
  height: 100%;
  background: linear-gradient(180deg, #4facfe 0%, #00f2fe 45%, #89f7fe 100%);
  color: #fff;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wx-hero {
  text-align: center;
  padding: 12px 0 8px;
}
.wx-city {
  font-size: 20px;
  font-weight: 500;
}
.wx-temp {
  font-size: 72px;
  font-weight: 200;
  line-height: 1;
  margin: 4px 0;
}
.wx-cond,
.wx-hl {
  opacity: 0.9;
}
.wx-hourly,
.wx-days {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(20px);
  padding: 12px;
}
.wx-hourly {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}
.wx-h {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 48px;
  font-size: 12px;
}
.wx-d {
  display: flex;
  justify-content: space-between;
  padding: 6px 4px;
  font-size: 13px;
}

/* Chess */
.chess-app {
  align-items: center;
  background: #f5f5f7;
}
.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: min(420px, 90%);
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  margin: 16px auto 24px;
}
.chess-sq {
  display: grid;
  place-items: center;
  font-size: clamp(18px, 3.5vw, 28px);
  aspect-ratio: 1;
  user-select: none;
}
.chess-sq.light {
  background: #f0d9b5;
}
.chess-sq.dark {
  background: #b58863;
}

/* Stickies */
.stickies-board {
  height: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px;
  background: rgba(246, 246, 248, 0.6);
}
.sticky {
  width: 180px;
  min-height: 160px;
  padding: 14px;
  border-radius: 2px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  outline: none;
  font-size: 14px;
  line-height: 1.4;
}
.sticky.y {
  background: #fff59d;
}
.sticky.p {
  background: #f8bbd0;
}
.sticky.b {
  background: #90caf9;
}
.sticky.g {
  background: #a5d6a7;
}
.sticky.o {
  background: #ffcc80;
}
.sticky-toolbar {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 30;
  display: flex;
  gap: 8px;
}
.dict-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dict-chip {
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: rgba(10, 132, 255, 0.14);
  color: #0a84ff;
}
.dict-chip:hover {
  background: rgba(10, 132, 255, 0.24);
}

/* Photo Booth */
.photo-booth {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #111;
  color: #fff;
}
.pb-viewfinder {
  flex: 1;
  width: 100%;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 40%, #333, #111);
  display: grid;
  place-items: center;
}
.pb-face {
  font-size: 80px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}
.pb-effects {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.pb-fx {
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 12px;
  cursor: default;
}
.pb-fx.active {
  background: #0a84ff;
}
.pb-shutter {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 18px;
}

/* Image Playground */
.ip-create {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px;
}
.ip-preview {
  width: min(280px, 80%);
  aspect-ratio: 1;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 64px;
  background: linear-gradient(145deg, rgba(255, 55, 95, 0.2), rgba(10, 132, 255, 0.25));
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.ip-styles {
  display: flex;
  gap: 8px;
}

/* iPhone Mirroring */
.iphone-mirror {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(246, 246, 248, 0.8);
}
.iphone-frame {
  width: 220px;
  height: 440px;
  border-radius: 36px;
  background: #111;
  padding: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  position: relative;
}
.iphone-notch {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 22px;
  background: #000;
  border-radius: 12px;
  z-index: 2;
}
.iphone-screen {
  height: 100%;
  border-radius: 28px;
  background: linear-gradient(180deg, #1a1a2e, #16213e 50%, #0f3460);
  padding: 48px 14px 20px;
  color: #fff;
}
.iphone-time {
  text-align: center;
  font-size: 36px;
  font-weight: 200;
  margin-bottom: 24px;
}
.iphone-apps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.iphone-app {
  aspect-ratio: 1;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  font-size: 16px;
}
.center {
  text-align: center;
}

/* Window content fill */
.window-content {
  height: 100%;
  overflow: hidden;
}
.window-content > .app-layout,
.window-content > .calc,
.window-content > .terminal,
.window-content > .term27-app,
.window-content > .preview27-app,
.window-content > .te27-app,
.window-content > .am27-app,
.window-content > .du27-app,
.window-content > .notes27-app,
.window-content > .weather-app,
.window-content > .clock-app,
.window-content > .stocks-app,
.window-content > .reminders-app,
.window-content > .photo-booth,
.window-content > .stickies-board,
.window-content > .iphone-mirror {
  height: 100%;
}

/* Dark windows (terminal/calc already dark) */
.window[data-app='terminal'] .window-titlebar,
.window[data-app='calculator'] .window-titlebar {
  background: rgba(28, 28, 30, 0.85);
  color: #f5f5f7;
}
.window[data-app='terminal'] .window-title,
.window[data-app='calculator'] .window-title {
  color: #f5f5f7;
}

/* =============================================================================
   Desktop / in-app widgets (Liquid Glass companions)
   Core chrome lives in liquid-glass.css; app-specific tweaks here
   ============================================================================= */
.desktop-widgets .widget {
  color: rgba(0, 0, 0, 0.88);
}

.widget-clock .widget-time {
  font-family: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

.widget-weather .widget-location {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.widget-calendar .widget-cal-event time {
  font-variant-numeric: tabular-nums;
  opacity: 0.55;
  font-size: 11px;
  min-width: 40px;
}

/* Compact glass tiles used inside app surfaces */
.app-widget {
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.08),
    inset 0 0.5px 0 rgba(255, 255, 255, 0.45);
}

/* =============================================================================
   Functional runtime: Photos gallery, Safari browser, iPhone, Sidecar, sounds
   ============================================================================= */

.photo-grid-real {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 4px;
  padding: 0 12px 24px;
}
.photo-tile-img {
  position: relative;
  aspect-ratio: 1;
  border: none;
  padding: 0;
  border-radius: 4px;
  overflow: hidden;
  cursor: default;
  background: #222;
}
.photo-tile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}
.photo-tile-img.is-favorite {
  outline: 2px solid #ffd60a;
  outline-offset: 2px;
}
.photo-tile-img.is-favorite::after {
  content: '★';
  position: absolute;
  top: 6px;
  right: 6px;
  color: #ffd60a;
  font-size: 14px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.photo-tile-img {
  position: relative;
}
.photo-lb-fav {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #ffd60a;
  font-size: 18px;
  cursor: pointer;
  z-index: 2;
}
.photo-tile-img:hover img {
  transform: scale(1.04);
}
.photos-main {
  position: relative;
}
.photo-lightbox {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}
.photo-lightbox[hidden] {
  display: none !important;
}
.photo-lb-img {
  max-width: min(86%, 720px);
  max-height: 72%;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}
.photo-lb-title {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.photo-lb-close,
.photo-lb-prev,
.photo-lb-next {
  position: absolute;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  cursor: default;
}
.photo-lb-close { top: 16px; right: 16px; }
.photo-lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.photo-lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* Safari embedded browser */
.safari-browser-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 420px;
  background: #fff;
}
.safari-browser-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.04);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  font-size: 12px;
}
.safari-iframe {
  flex: 1;
  width: 100%;
  min-height: 380px;
  border: none;
  background: #fff;
}
.safari-browser-fallback {
  padding: 6px 12px 10px;
  font-size: 11px;
}

/* Device stage: iPhone + Sidecar */
.device-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px 16px 24px;
  height: 100%;
  box-sizing: border-box;
  overflow: auto;
  background: linear-gradient(160deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
.device-caption {
  text-align: center;
  color: rgba(255, 255, 255, 0.92);
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(100%, 760px);
}
.device-caption .muted { color: rgba(255, 255, 255, 0.55); }
.device-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 6px;
}

.iphone-bezel {
  width: 280px;
  height: 560px;
  border-radius: 40px;
  background: #111;
  padding: 12px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    inset 0 0 0 2px #333,
    inset 0 0 0 4px #1a1a1a;
  position: relative;
}
.iphone-dynamic-island {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 96px;
  height: 28px;
  background: #000;
  border-radius: 20px;
  z-index: 5;
}
.iphone-screen {
  width: 100%;
  height: 100%;
  border-radius: 30px;
  background: linear-gradient(165deg, #5b6cff 0%, #c44dff 45%, #ff6b9d 100%);
  overflow: hidden;
  position: relative;
  color: #fff;
  display: flex;
  flex-direction: column;
}
.iphone-status {
  display: flex;
  justify-content: space-between;
  padding: 14px 20px 4px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 22px;
}
.iphone-home {
  flex: 1;
  padding: 8px 14px 0;
  overflow: auto;
}
.iphone-page {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 8px;
}
.iphone-icon {
  border: none;
  background: transparent;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: default;
  padding: 0;
}
.iphone-icon-glyph {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.iphone-icon-label {
  font-size: 10px;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.iphone-dock-bar {
  margin: 8px 16px 6px;
  padding: 10px 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(20px);
  display: flex;
  justify-content: space-around;
  font-size: 22px;
}
.iphone-home-indicator {
  width: 120px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.85);
  margin: 6px auto 10px;
  cursor: default;
}
.iphone-app-view {
  flex: 1;
  background: #f2f2f7;
  color: #1d1d1f;
  overflow: auto;
  padding: 48px 14px 16px;
}
.iphone-lockscreen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: linear-gradient(160deg, #1a1a2e, #4a3f6b);
  color: #fff;
  margin: -48px -14px -16px;
  padding: 80px 16px;
}
.iapp-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}
.iapp-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 220px;
  margin: 0 auto;
}
.iapp-key {
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #e5e5ea;
  font-size: 18px;
  font-weight: 500;
}
.iapp-call {
  display: block;
  margin: 16px auto 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #34c759;
  color: #fff;
  font-weight: 600;
}
.iapp-thread {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 160px;
  margin-bottom: 10px;
}
.iapp-thread .bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 13px;
}
.iapp-thread .bubble.me {
  align-self: flex-end;
  background: #0a84ff;
  color: #fff;
}
.iapp-thread .bubble.them {
  align-self: flex-start;
  background: #e5e5ea;
  color: #1d1d1f;
}
.iapp-compose {
  display: flex;
  gap: 6px;
}
.iapp-compose input {
  flex: 1;
  border-radius: 16px;
  border: none;
  background: #e5e5ea;
  padding: 8px 12px;
}
.iapp-compose button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #0a84ff;
  color: #fff;
}
.iapp-viewfinder {
  height: 220px;
  border-radius: 12px;
  background: linear-gradient(135deg, #333, #111);
  margin-bottom: 16px;
}
.iapp-shutter {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid #1d1d1f;
  background: #fff;
  display: block;
  margin: 0 auto;
}
.iapp-shutter.flash {
  background: #0a84ff;
}
.iapp-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}
.iapp-photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.iapp-row {
  padding: 12px 14px;
  background: #fff;
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 14px;
}
.iapp-bigtime {
  font-size: 48px;
  font-weight: 200;
  letter-spacing: -0.03em;
  text-align: center;
}
.iapp-note {
  width: 100%;
  min-height: 160px;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font: inherit;
  resize: vertical;
}
.iapp-map-canvas {
  height: 200px;
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px) 0 0 / 24px 24px,
    #c8e6c9;
}
.iapp-now {
  font-size: 16px;
  margin: 12px 0;
  text-align: center;
}
.iapp-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -8px 0 12px;
}
.iapp-nav .iapp-title {
  margin: 0;
  flex: 1;
  font-size: 17px;
}
.iapp-back {
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: #0a84ff;
  cursor: pointer;
  padding: 0 4px 0 0;
}
.iapp-dial-disp {
  text-align: center;
  font-size: 28px;
  font-weight: 300;
  letter-spacing: 0.04em;
  min-height: 36px;
  margin-bottom: 12px;
}
.iapp-phone-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}
.iapp-call.is-on-call {
  background: #ff3b30;
}
.iapp-url-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.iapp-url {
  flex: 1;
  width: 100%;
  border-radius: 10px;
  border: none;
  background: #e5e5ea;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 8px;
  box-sizing: border-box;
}
.iapp-url-row .iapp-url {
  margin-bottom: 0;
}
.iapp-web-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.iapp-photo-lb {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  margin: -48px -14px -16px;
}
.iapp-photo-lb[hidden] {
  display: none;
}
.iapp-photo-lb img {
  max-width: 100%;
  max-height: 70%;
  object-fit: contain;
  border-radius: 8px;
}
.iapp-lb-close {
  margin-top: 12px;
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
}
.iapp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.iapp-row.is-on {
  background: #e8f1ff;
}
.iapp-row-val {
  color: #8e8e93;
  font-size: 13px;
}
.iapp-art {
  width: 120px;
  height: 120px;
  border-radius: 16px;
  margin: 12px auto;
  background: linear-gradient(145deg, #5b6cff, #c44dff);
  display: grid;
  place-items: center;
  font-size: 48px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.iapp-music-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.iapp-map-canvas {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.iapp-map-pin {
  font-size: 32px;
}
.iapp-mail-item {
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}
.iapp-mail-item.is-active {
  outline: 2px solid #0a84ff;
}
.iapp-wx-city {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
}
.icc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.icc-tile {
  border: none;
  border-radius: 16px;
  padding: 18px 12px;
  background: #e5e5ea;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  color: #1d1d1f;
}
.icc-tile.is-active {
  background: #0a84ff;
  color: #fff;
}
.iapp-ft-preview {
  height: 180px;
  border-radius: 16px;
  background: linear-gradient(160deg, #1a1a2e, #3d2a5c);
  margin: 12px 0;
}
.iapp-ft-status {
  text-align: center;
  margin-bottom: 12px;
}
.iphone-app-view {
  position: relative;
}
.iphone-icon,
.iphone-dock-icon {
  cursor: pointer;
}
.iapp-calc-disp {
  text-align: right;
  font-size: 36px;
  font-weight: 300;
  padding: 12px 8px;
  font-variant-numeric: tabular-nums;
}
.iapp-calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.iapp-calc-key {
  border: none;
  border-radius: 50%;
  aspect-ratio: 1;
  font-size: 18px;
  background: #e5e5ea;
  color: #1d1d1f;
  cursor: pointer;
}
.iapp-calc-key.op {
  background: #ff9f0a;
  color: #fff;
}
.iapp-calc-key.zero {
  grid-column: span 2;
  border-radius: 24px;
  aspect-ratio: auto;
  height: 48px;
}
.iapp-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.iapp-cal-day {
  border: none;
  background: transparent;
  border-radius: 50%;
  aspect-ratio: 1;
  font-size: 13px;
  cursor: pointer;
  color: #1d1d1f;
}
.iapp-cal-day.is-selected {
  background: #0a84ff;
  color: #fff;
}
.iapp-rem-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 4px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
  font-size: 15px;
}
.iapp-rem-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #0a84ff;
  flex-shrink: 0;
}
.iapp-rem-item.is-done {
  opacity: 0.45;
  text-decoration: line-through;
}
.iapp-rem-item.is-done .iapp-rem-check {
  background: #0a84ff;
}
.iapp-sound-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 6px;
  font-size: 14px;
  cursor: pointer;
  text-transform: capitalize;
}
.iapp-sound-btn.is-active {
  outline: 2px solid #0a84ff;
}
.iapp-card {
  margin: 8px 0;
  padding: 16px;
  border-radius: 14px;
  color: #fff;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.iapp-card-transit {
  background: linear-gradient(135deg, #0a84ff, #5e5ce6);
}
.iapp-card-pay {
  background: linear-gradient(135deg, #1d1d1f, #3a3a3c);
}
.iapp-card-pass {
  background: linear-gradient(135deg, #30d158, #0a84ff);
}
.iapp-card.is-selected {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.iapp-health-ring {
  text-align: center;
  padding: 16px 0;
}
.iapp-store-row,
.iapp-file-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
}
.iapp-file-row.is-selected {
  color: #0a84ff;
  font-weight: 600;
}
.iapp-get.is-installed {
  opacity: 0.85;
}
#iphone-pay {
  width: 100%;
  margin-top: 12px;
}

/* Calendar new event sheet + Messages compose sheet */
.cal-new-event,
.msg-new-sheet {
  position: absolute;
  left: 50%;
  top: 72px;
  transform: translateX(-50%);
  z-index: 20;
  width: min(320px, 90%);
  background: rgba(40, 40, 42, 0.96);
  color: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
html[data-theme='light'] .cal-new-event,
html[data-theme='light'] .msg-new-sheet {
  background: rgba(255, 255, 255, 0.98);
  color: #1d1d1f;
  border-color: rgba(0, 0, 0, 0.08);
}
.cal-new-input,
.msg-new-name {
  width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  border: 0.5px solid rgba(128, 128, 128, 0.35);
  padding: 10px 12px;
  font: inherit;
  background: rgba(128, 128, 128, 0.12);
  color: inherit;
}
.cal-new-actions,
.msg-new-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.cal27-app,
.msg27-app {
  position: relative;
}

/* Sidecar / iPad */
.ipad-bezel {
  width: min(100%, 760px);
  border-radius: 24px;
  background: #1c1c1e;
  padding: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.ipad-screen {
  background: #e8e8ed;
  border-radius: 12px;
  min-height: 280px;
  position: relative;
  overflow: hidden;
  color: #1d1d1f;
}
.ipad-menubar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.7);
}
.ipad-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8e8e93;
  flex-shrink: 0;
}
.ipad-status-dot.is-on {
  background: #30d158;
  box-shadow: 0 0 6px rgba(48, 209, 88, 0.7);
}
.ipad-main {
  display: flex;
  min-height: 260px;
}
.ipad-canvas {
  height: 80px;
  display: grid;
  place-items: center;
}
.ipad-sidebar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.55);
  border-right: 0.5px solid rgba(0, 0, 0, 0.08);
}
.ipad-sidebar button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}
.ipad-sidebar button.is-active {
  outline: 2px solid #0a84ff;
}
.ipad-swatches {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 0.5px solid rgba(0, 0, 0, 0.08);
}
.ipad-swatch {
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  margin: 0 auto;
  border: 1.5px solid rgba(255, 255, 255, 0.8) !important;
  padding: 0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}
.ipad-swatch.is-active {
  outline: 2px solid #0a84ff;
  outline-offset: 2px;
}
.ipad-canvas-wrap {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.ipad-extended {
  background: linear-gradient(145deg, #5b6cff33, #c44dff22);
  border-radius: 10px;
  padding: 8px;
}
.ipad-win {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 8px 10px 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  font-size: 12px;
}
.ipad-win-tb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 4px;
}
.ipad-dots {
  width: 36px;
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    #ff5f57 0 8px,
    transparent 8px 12px,
    #febc2e 12px 20px,
    transparent 20px 24px,
    #28c840 24px 32px
  );
}
.ipad-hint {
  margin: 0;
  font-size: 11px;
  color: rgba(0, 0, 0, 0.45);
  text-align: center;
}
.sidecar-stage.is-mirror .ipad-extended {
  background: linear-gradient(145deg, #0a84ff33, #30d15822);
}
.sidecar-stage.is-extend .ipad-extended {
  background: linear-gradient(145deg, #bf5af233, #ff9f0a22);
}
#sidecar-draw {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  touch-action: none;
  cursor: crosshair;
  background: #f5f5f7;
  display: block;
}
/* Podcasts */
.podcasts-app .pod-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.pod-list {
  flex: 1;
  overflow: auto;
  padding: 8px 12px;
}
.pod-episode {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 4px;
}
.pod-episode.is-selected {
  background: rgba(10, 132, 255, 0.12);
}
.pod-art {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(145deg, hsl(var(--h, 220), 70%, 55%), hsl(calc(var(--h, 220) + 40), 70%, 45%));
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.pod-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pod-meta {
  font-size: 12px;
  white-space: nowrap;
}
.pod-transport {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  flex-wrap: wrap;
}
.pod-progress {
  flex: 1;
  min-width: 80px;
  height: 6px;
  border-radius: 3px;
  background: rgba(128, 128, 128, 0.28);
  cursor: pointer;
  overflow: hidden;
}
.pod-progress-fill {
  height: 100%;
  width: 0%;
  background: #bf5af2;
  border-radius: 3px;
  transition: width 0.15s linear;
}
.tv-progress {
  margin: 10px 16px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.tv-progress-fill {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #0a84ff;
  width: 0%;
}
.pw-row.is-selected {
  background: rgba(10, 132, 255, 0.16);
  border-radius: 10px;
}
.pod-now {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 0.5px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
  flex-wrap: wrap;
}
html[data-theme='dark'] .pod-now {
  background: rgba(0, 0, 0, 0.25);
  border-top-color: rgba(255, 255, 255, 0.08);
}
.pod-now-art {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(145deg, #5b6cff, #c44dff);
  display: grid;
  place-items: center;
  font-size: 22px;
}
.pod-now-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.album-card.is-playing {
  outline: 2px solid #0a84ff;
  outline-offset: 2px;
  border-radius: 12px;
}
.maps27-pin.is-bounce {
  animation: pinBounce 0.4s ease;
}
@keyframes pinBounce {
  0% { transform: translate(-50%, -100%) scale(1); }
  40% { transform: translate(-50%, -120%) scale(1.15); }
  100% { transform: translate(-50%, -100%) scale(1); }
}
}

.sound-demo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding: 12px;
}
.sound-demo-grid .btn-glass {
  text-transform: capitalize;
  font-size: 12px;
  padding: 6px 12px;
}

/* Mail compose modal */
.mail-compose-modal {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}
.mail-compose-sheet {
  width: min(520px, 92%);
  background: rgba(40, 40, 42, 0.96);
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
}
html[data-theme='light'] .mail-compose-sheet {
  background: rgba(250, 250, 252, 0.98);
  color: #1d1d1f;
}
.mail-compose-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
}
.mail-compose-close {
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  width: 28px;
  height: 28px;
  border-radius: 50%;
}
.mail-compose-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
}
.mail-compose-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  opacity: 0.85;
}
.mail-compose-fields input,
.mail-compose-fields textarea {
  border-radius: 8px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  padding: 8px 10px;
  font: inherit;
}
html[data-theme='light'] .mail-compose-fields input,
html[data-theme='light'] .mail-compose-fields textarea {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.1);
}
.mail-compose-fields textarea {
  min-height: 140px;
  resize: vertical;
}
.mail-compose-actions {
  display: flex;
  gap: 8px;
  padding: 0 14px 14px;
}

/* Phone dialer */
.phone-dialer {
  max-width: 280px;
  margin: 24px auto;
  text-align: center;
}
.phone-display {
  font-size: 28px;
  font-weight: 300;
  letter-spacing: 0.04em;
  min-height: 40px;
  margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}
.phone-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.phone-key {
  height: 56px;
  border-radius: 50%;
  border: none;
  background: rgba(120, 120, 128, 0.2);
  font-size: 22px;
  font-weight: 400;
  color: inherit;
}
.phone-call {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto;
  display: grid;
  place-items: center;
}
.rem-add-row {
  padding: 12px 16px 20px;
}

/* Photo Booth */
.photo-booth {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  height: 100%;
  box-sizing: border-box;
  background: #1c1c1e;
  color: #fff;
}
.pb-viewfinder {
  position: relative;
  width: min(100%, 480px);
  aspect-ratio: 4/3;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.pb-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.pb-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 72px;
  background: linear-gradient(145deg, #333, #111);
}
.pb-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0.85;
}
.pb-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.pb-fx {
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 12px;
  cursor: default;
}
.pb-fx.active {
  background: #0a84ff;
}
.pb-shutter {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font-size: 22px;
}
.pb-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  max-width: 100%;
  min-height: 56px;
  padding: 4px;
}
.pb-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

/* FaceTime */
.facetime-app .ft-stage {
  position: relative;
  height: 280px;
  margin: 12px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(160deg, #1a1a2e, #3d2c8d);
}
.ft-remote {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  gap: 6px;
}
.ft-remote-avatar { font-size: 64px; }
.ft-remote-name { font-size: 20px; font-weight: 600; }
.ft-self {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 100px;
  height: 140px;
  border-radius: 12px;
  overflow: hidden;
  background: #222;
  border: 2px solid rgba(255,255,255,0.3);
}
.ft-self-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ft-self-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
}
.ft-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 12px;
}
.ft-ctrl {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(120,120,128,0.24);
  font-size: 18px;
  cursor: default;
}
.ft-ctrl.primary { background: #30d158; }
.ft-ctrl.danger { background: #ff453a; color: #fff; }
.ft-ctrl.is-active { outline: 2px solid #0a84ff; }
.ft-contact {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: inherit;
  cursor: default;
}

/* Preview draw */
.preview27-canvas { position: relative; }
.preview-draw-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  z-index: 2;
}
.preview-text-ann {
  position: absolute;
  top: 40%;
  left: 20%;
  padding: 4px 8px;
  background: rgba(255, 255, 0, 0.35);
  border: 1px dashed #c90;
  font-size: 14px;
  min-width: 80px;
  z-index: 3;
}
.preview27-page {
  transition: transform 0.15s ease;
}

/* Calculator history */
.calc-history {
  max-height: 72px;
  overflow: auto;
  padding: 4px 12px;
  font-size: 11px;
  opacity: 0.75;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.calc-hist-line {
  padding: 1px 0;
  cursor: pointer;
}
.calc-hist-line:hover {
  opacity: 1;
  color: #0a84ff;
}
.calc-hist-clear {
  display: block;
  width: 100%;
  margin-top: 4px;
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.6;
  font-size: 10px;
  cursor: pointer;
  text-align: right;
}

.ff27-canvas { position: relative; overflow: hidden; }
.ff27-ink { touch-action: none; }
.ff27-sticky { cursor: grab; user-select: none; }
.ff27-sticky:active { cursor: grabbing; }
.ff27-sticky p[contenteditable] { user-select: text; cursor: text; outline: none; }
.wx-d.is-selected {
  background: rgba(10, 132, 255, 0.15);
  border-radius: 8px;
}
.wx-city:hover { text-decoration: underline; }
.btn-get.is-installed {
  background: rgba(120, 120, 128, 0.2);
  min-width: 64px;
}
.am27-row.is-selected,
.am-row.is-selected,
tr.is-selected {
  background: rgba(10, 132, 255, 0.2);
}

.tv-card.is-selected .tv-poster {
  outline: 2px solid #0a84ff;
  outline-offset: 2px;
}
.tv-hero-actions .btn-glass.is-added {
  background: rgba(48, 209, 88, 0.25);
}
.app-list-row.is-selected {
  background: rgba(10, 132, 255, 0.18);
}
.chess-wrap {
  padding: 20px;
  text-align: center;
}
.chess-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 40px);
  grid-template-rows: repeat(8, 40px);
  width: 320px;
  margin: 12px auto;
  border: 2px solid rgba(0,0,0,0.2);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.chess-sq {
  border: none;
  font-size: 26px;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}
.chess-sq.light { background: #f0d9b5; }
.chess-sq.dark { background: #b58863; }
/* SVG pieces: solid cream vs near-black fills */
.chess-sq.piece-white,
.chess-sq.piece-black {
  position: relative;
  z-index: 0;
}
.chess-sq .chess-piece-svg {
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.35));
}
.chess-sq.piece-white .chess-piece-svg {
  fill: #fffaf2;
  stroke: #1a1410;
  stroke-width: 0.9;
  paint-order: stroke fill;
}
.chess-sq.piece-black .chess-piece-svg {
  fill: #14100c;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 0.4;
}
.chess-sq.is-selected {
  outline: 2px solid #0a84ff;
  outline-offset: -2px;
  z-index: 1;
  box-shadow: inset 0 0 0 3px rgba(10, 132, 255, 0.35);
}
.chess-sq.is-legal {
  position: relative;
  box-shadow: inset 0 0 0 100px rgba(10, 132, 255, 0.14);
}
.chess-sq.is-legal::after {
  content: '';
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: rgba(10, 132, 255, 0.45);
  position: absolute;
  pointer-events: none;
}
.chess-sq.is-legal.is-capture::after {
  width: auto;
  height: auto;
  inset: 4px;
  border-radius: 4px;
  background: transparent;
  border: 3px solid rgba(255, 59, 48, 0.55);
}
.chess-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 16px 20px;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}
.chess-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(420px, 100%);
  margin-bottom: 4px;
}
.chess-hint {
  margin: 4px 0 0;
  font-size: 12px;
}
.chess-app .chess-board {
  width: min(420px, 92%);
  max-width: 100%;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}
.chess-app .chess-sq {
  font-size: clamp(22px, 4.5vw, 36px);
  cursor: pointer;
  /* Prefer symbol fonts that render filled chess glyphs solidly */
  font-family: 'Segoe UI Symbol', 'Apple Symbols', 'Noto Sans Symbols 2', 'FreeSerif', 'DejaVu Sans', serif;
}
.num27-sheet td.active {
  outline: 2px solid #0a84ff;
  outline-offset: -2px;
}

.home-scenes {
  display: flex;
  gap: 8px;
  padding: 8px 16px 0;
}
.home-scene-chip {
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: rgba(120, 120, 128, 0.18);
  color: inherit;
}
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  padding: 16px;
}
.home-tile {
  border: none;
  border-radius: 14px;
  padding: 16px 12px;
  text-align: left;
  background: rgba(120, 120, 128, 0.16);
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.home-tile.is-on {
  background: rgba(10, 132, 255, 0.28);
}
.home-tile-icon { font-size: 22px; }
.shortcuts-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.shortcut-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(120, 120, 128, 0.12);
}
.se-code {
  flex: 1;
  margin: 0 12px;
  min-height: 220px;
  border-radius: 10px;
  border: 0.5px solid rgba(255,255,255,0.1);
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
  padding: 12px;
  resize: vertical;
}
.se-log {
  margin: 8px 12px 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0,0,0,0.25);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px;
  min-height: 48px;
}
.vm-list { flex: 1; padding: 12px 16px; overflow: auto; }
.vm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 10px;
  border-bottom: 0.5px solid rgba(128,128,128,0.2);
  border-radius: 8px;
  cursor: pointer;
}
.vm-row.is-selected {
  background: rgba(10, 132, 255, 0.12);
}
.vm-row.is-playing {
  outline: 1px solid #0a84ff;
}
.vm-record-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.vm-transcript {
  margin: 0 16px 8px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(120, 120, 128, 0.18);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  max-height: 72px;
  overflow: auto;
}
html[data-theme='light'] .vm-transcript {
  color: rgba(0, 0, 0, 0.72);
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.08);
}
#vm-record.is-recording {
  background: #ff3b30;
}
.ip-create {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  max-width: 480px;
  margin: 0 auto;
}
.ip-preview {
  height: 220px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 48px;
  overflow: hidden;
}

/* QuickTime */
.qt-stage { padding: 12px 16px 16px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.qt-screen {
  flex: 1; min-height: 240px; background: #000; border-radius: 10px; position: relative;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.qt-placeholder { text-align: center; color: #fff; }
.qt-big-play {
  width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,0.2);
  display: grid; place-items: center; font-size: 24px; margin: 0 auto 8px; cursor: default;
}
.qt-progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,0.2);
}
.qt-progress-fill { height: 100%; width: 0; background: #0a84ff; }
.qt-controls { display: flex; align-items: center; gap: 10px; justify-content: center; }

/* News */
.news-body { display: flex; flex: 1; min-height: 0; }
.news-list-pane {
  width: 320px; border-right: 0.5px solid rgba(255,255,255,0.08); overflow: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.news-item {
  text-align: left; border: none; background: rgba(120,120,128,0.1); color: inherit;
  border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 4px; cursor: default;
}
.news-item.is-active { outline: 2px solid #0a84ff; }
.news-reader { flex: 1; overflow: auto; padding: 24px 28px; }
.news-reader h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: -0.02em; }

/* Books */
.books-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 14px; padding: 16px;
}
.book-cover {
  aspect-ratio: 2/3; border: none; border-radius: 6px; color: #fff; font-weight: 700; font-size: 12px;
  background: linear-gradient(145deg, hsl(var(--h,200),60%,45%), hsl(var(--h,200),70%,28%));
  box-shadow: 0 8px 20px rgba(0,0,0,0.25); padding: 12px; cursor: default;
}
.book-reader { display: flex; flex-direction: column; height: 100%; }
.book-reader[hidden] { display: none !important; }
.book-reader-bar {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 14px;
  border-bottom: 0.5px solid rgba(255,255,255,0.08);
}
.book-pages { flex: 1; display: flex; align-items: center; gap: 8px; padding: 16px; }
.book-page-card {
  flex: 1; max-width: 520px; margin: 0 auto; min-height: 360px; background: #faf8f5; color: #1d1d1f;
  border-radius: 4px; padding: 28px 32px; box-shadow: 0 12px 40px rgba(0,0,0,0.2); line-height: 1.55;
}
.book-nav {
  width: 36px; height: 36px; border-radius: 50%; border: none; background: rgba(120,120,128,0.2); color: inherit;
}
.book-drop { font-size: 20px; font-weight: 700; margin-top: 0; }

/* Find My */
.fm-body { display: flex; flex: 1; min-height: 0; }
.fm-map {
  flex: 1; position: relative; background:
    linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px) 0 0 / 28px 28px,
    #c5e0b4;
  min-height: 360px;
}
.fm-pin {
  position: absolute; width: 36px; height: 36px; border-radius: 50%; border: none;
  background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.25); font-size: 16px; cursor: default;
  display: grid; place-items: center; transform: translate(-50%, -50%);
}
.fm-pin.is-selected { outline: 3px solid #0a84ff; }
.fm-list {
  width: 240px; border-left: 0.5px solid rgba(255,255,255,0.08); padding: 10px; display: flex; flex-direction: column; gap: 6px;
}
.fm-row {
  text-align: left; border: none; background: transparent; color: inherit; padding: 10px; border-radius: 10px;
  display: flex; flex-direction: column; gap: 2px; cursor: default;
}
.fm-row.is-selected { background: rgba(10,132,255,0.2); }
.fm-actions { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.fm-tabs { display: flex; gap: 4px; }
.fm-tab {
  border: none; background: transparent; color: inherit; padding: 4px 10px; border-radius: 999px; font-size: 12px;
}
.fm-tab.active { background: rgba(255,255,255,0.12); }

/* Time Machine */
.tm-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 20px;
  background: radial-gradient(ellipse at center, #1a2744 0%, #0a0e18 70%); color: #fff; }
.tm-stack { position: relative; width: 280px; height: 180px; }
.tm-window {
  position: absolute; inset: 0; border-radius: 10px; background: rgba(40,40,50,0.9);
  border: 0.5px solid rgba(255,255,255,0.15); transform: translateY(calc(var(--i) * -14px)) scale(calc(1 - var(--i) * 0.05));
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.tm-win-bar { height: 22px; background: rgba(255,255,255,0.08); border-radius: 10px 10px 0 0; }
.tm-win-body { padding: 24px; text-align: center; font-size: 13px; }
.tm-timeline { display: flex; align-items: center; gap: 12px; }

/* Passwords */
.pw-list { padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.pw-row {
  display: flex; justify-content: space-between; align-items: center; padding: 12px 14px;
  border-radius: 10px; background: rgba(120,120,128,0.12);
}
.pw-actions { display: flex; align-items: center; gap: 10px; }

/* Console */
.console-log {
  flex: 1; overflow: auto; padding: 10px 14px; font-family: ui-monospace, Menlo, monospace; font-size: 11px;
  background: #0d0d0f; color: #c8c8c8;
}
.console-log .c-time { color: #6e6e73; margin-right: 8px; }
.console-log .c-src { color: #64d2ff; margin-right: 8px; }

/* Magnifier */
.mag-view {
  flex: 1; margin: 12px; border-radius: 12px; overflow: hidden; background: #111;
  display: grid; place-items: center;
}
.mag-content {
  font-size: 72px; font-weight: 700; color: #fff; transition: transform 0.1s ease, filter 0.1s ease;
}
.mag-controls {
  display: flex; flex-wrap: wrap; gap: 12px; padding: 12px 16px 16px; align-items: center; justify-content: center;
  font-size: 12px;
}
.mag-controls label { display: flex; align-items: center; gap: 6px; }

/* GarageBand */
.gb-tracks { flex: 1; overflow: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.gb-track { display: flex; gap: 8px; align-items: center; }
.gb-track.is-muted { opacity: 0.4; }
.gb-track-head { width: 120px; display: flex; align-items: center; gap: 4px; font-size: 12px; }
.gb-mute, .gb-solo {
  width: 22px; height: 22px; border-radius: 4px; border: none; font-size: 10px; font-weight: 700;
  background: rgba(120,120,128,0.25); color: inherit;
}
.gb-mute.is-on { background: #ff9f0a; color: #000; }
.gb-solo.is-on { background: #ffd60a; color: #000; }
.gb-lane {
  flex: 1; height: 40px; border-radius: 6px; background: rgba(0,0,0,0.25); position: relative; overflow: hidden;
}
.gb-region {
  position: absolute; top: 6px; bottom: 6px; border-radius: 4px;
  background: linear-gradient(90deg, #bf5af2, #5e5ce6);
}
.gb-keys { display: flex; padding: 10px; gap: 4px; justify-content: center; border-top: 0.5px solid rgba(255,255,255,0.08); }
.gb-key {
  width: 40px; height: 100px; border-radius: 0 0 6px 6px; border: 1px solid rgba(0,0,0,0.15);
  background: #f5f5f7; color: #1d1d1f; font-weight: 600;
}
.gb-key.is-down { background: #0a84ff; color: #fff; }

/* iMovie */
.im-preview {
  height: 200px; margin: 10px 14px 0; border-radius: 10px; background: #111; overflow: hidden;
  display: grid; place-items: center;
}
.im-frame {
  width: 100%; height: 100%; display: grid; place-items: center; color: #fff; background-position: center;
}
.im-library {
  display: flex; gap: 8px; padding: 10px 14px; overflow-x: auto;
}
.im-clip {
  border: none; background: transparent; color: inherit; width: 100px; cursor: default; padding: 0;
}
.im-clip img { width: 100px; height: 60px; object-fit: cover; border-radius: 6px; display: block; }
.im-clip span { font-size: 11px; }
.im-timeline {
  height: 72px; margin: 0 14px 14px; border-radius: 8px; background: rgba(0,0,0,0.3);
  position: relative; overflow: hidden;
}
.im-playhead {
  position: absolute; top: 0; bottom: 0; width: 2px; background: #ff453a; left: 0; z-index: 2;
}
.im-tl-track { display: flex; height: 100%; align-items: center; gap: 4px; padding: 8px; }
.im-tl-clip {
  height: 48px; min-width: 80px; border-radius: 4px; background-size: cover; background-position: center;
  color: #fff; font-size: 10px; display: flex; align-items: flex-end; padding: 4px;
  text-shadow: 0 1px 2px #000; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
}

/* Font Book */
.fb-preview {
  margin: 20px; padding: 24px; min-height: 180px; border-radius: 12px;
  background: rgba(255,255,255,0.06); font-size: 28px; line-height: 1.35; outline: none;
}
.fb-sizes { display: flex; gap: 8px; padding: 0 20px 20px; flex-wrap: wrap; }
.fb-font { width: 100%; text-align: left; border: none; background: transparent; color: inherit; padding: 10px 12px; border-radius: 8px; cursor: default; }
.fb-font.active { background: rgba(10,132,255,0.25); }

/* Journal */
.journal-body { display: flex; flex: 1; min-height: 0; }
.journal-list {
  width: 220px; border-right: 0.5px solid rgba(255,255,255,0.08); overflow: auto; padding: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.journal-item {
  text-align: left; border: none; background: transparent; color: inherit; padding: 10px; border-radius: 10px;
  display: flex; flex-direction: column; gap: 2px; cursor: default;
}
.journal-item.is-active { background: rgba(10,132,255,0.22); }
.journal-editor { flex: 1; display: flex; flex-direction: column; padding: 16px; gap: 10px; }
.journal-title {
  border: none; background: transparent; color: inherit; font-size: 22px; font-weight: 700; outline: none;
}
.journal-text {
  flex: 1; border: none; background: transparent; color: inherit; font: inherit; line-height: 1.5; resize: none; outline: none;
}

/* Games */
.games-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; padding: 16px;
}
.game-card {
  border: none; border-radius: 14px; padding: 0 0 12px; background: rgba(120,120,128,0.12);
  color: inherit; text-align: left; cursor: default; overflow: hidden;
}
.game-art {
  height: 100px; background: linear-gradient(135deg, hsl(var(--h,200),70%,50%), hsl(var(--h,200),60%,30%));
  margin-bottom: 8px;
}
.game-card strong, .game-card .muted, .game-play { padding: 0 10px; display: block; }
.game-play { margin-top: 8px; text-align: center; }

/* System Information / Print Center */
.si-rows { padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.si-nav { width: 100%; text-align: left; border: none; background: transparent; color: inherit; padding: 10px 12px; border-radius: 8px; cursor: default; }
.si-nav.active { background: rgba(10,132,255,0.25); }
.pc-list { display: flex; gap: 8px; padding: 12px; }
.pc-printer {
  flex: 1; text-align: left; border: none; background: rgba(120,120,128,0.12); color: inherit;
  padding: 12px; border-radius: 12px; display: flex; flex-direction: column; gap: 4px; cursor: default;
}
.pc-printer.is-selected { outline: 2px solid #0a84ff; }
.pc-jobs { flex: 1; padding: 0 12px; }
.pc-job {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  background: rgba(120,120,128,0.12); margin-bottom: 6px;
}
.pc-job strong { flex: 1; }

.app-list-row.simple-row, .simple-row {
  width: 100%; text-align: left; border: none; background: transparent; color: inherit;
  display: flex; justify-content: space-between; align-items: center; padding: 10px 14px;
  border-radius: 8px; cursor: default;
}
.simple-row.is-selected, .app-list-row.is-selected { background: rgba(10,132,255,0.2); }
.simple-list { padding: 8px 12px; max-height: 40vh; overflow: auto; }

.ic-body { display: flex; flex: 1; min-height: 0; }
.ic-devices { width: 160px; border-right: 0.5px solid rgba(255,255,255,0.08); padding: 8px; }
.ic-dev {
  width: 100%; text-align: left; border: none; background: transparent; color: inherit;
  padding: 10px; border-radius: 8px; margin-bottom: 4px; cursor: default;
}
.ic-dev.is-selected { background: rgba(10,132,255,0.25); }
.ic-grid {
  flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px; padding: 12px; overflow: auto;
}
.ic-thumb {
  border: 2px solid transparent; border-radius: 8px; padding: 0; overflow: hidden; background: #111; cursor: default;
}
.ic-thumb.is-selected { border-color: #0a84ff; }
.ic-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }

.am-workflow { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.am-step {
  padding: 12px 14px; border-radius: 10px; background: rgba(120,120,128,0.15); font-size: 13px;
}
.am-log { padding: 10px 16px 16px; font-size: 12px; }
.am-action { width: 100%; text-align: left; border: none; background: transparent; color: inherit; padding: 10px 12px; border-radius: 8px; cursor: default; }
.am-action.active { background: rgba(10,132,255,0.25); }

.kc-list, .ams-list, .cs-list { padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; }
.kc-row, .ams-row, .cs-row {
  text-align: left; border: none; background: transparent; color: inherit; padding: 10px 12px;
  border-radius: 10px; display: flex; flex-direction: column; gap: 2px; cursor: default;
}
.kc-row.is-selected, .ams-row.is-selected, .cs-row.is-selected { background: rgba(10,132,255,0.22); }

.dvd-screen {
  flex: 1; margin: 12px; border-radius: 12px; background: #000; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; color: #fff;
}
.dvd-disc { font-size: 72px; }
@keyframes dvd-spin { to { transform: rotate(360deg); } }
.dvd-controls { display: flex; gap: 10px; justify-content: center; padding: 0 12px 16px; }

.mig-opt {
  display: block; margin: 8px 20px; padding: 12px 14px; border-radius: 10px;
  background: rgba(120,120,128,0.12); cursor: default;
}
.mig-opt.is-selected { outline: 2px solid #0a84ff; }
.vo-toggle { font-size: 12px; display: flex; align-items: center; gap: 6px; }

.iphone-dock-icon {
  border: none;
  background: transparent;
  font-size: 22px;
  padding: 4px;
  cursor: default;
  line-height: 1;
  border-radius: 10px;
}
.iphone-dock-icon:active {
  transform: scale(0.92);
  background: rgba(255,255,255,0.15);
}

/* Phone app */
.phone-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #1c1c1e;
  color: #fff;
}
.phone-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 12px;
  border-bottom: 0.5px solid rgba(255,255,255,0.1);
}
.phone-tab {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.phone-tab.active {
  background: rgba(255,255,255,0.12);
}
.phone-pane {
  flex: 1;
  overflow: auto;
  padding: 12px;
}
.phone-display {
  text-align: center;
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 0.04em;
  min-height: 48px;
  margin: 12px 0 20px;
}
.phone-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 260px;
  margin: 0 auto;
}
.phone-key {
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #3a3a3c;
  color: #fff;
  font-size: 22px;
  font-weight: 400;
  cursor: pointer;
}
.phone-key:active { background: #48484a; }
.phone-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}
.phone-call {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: #30d158;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.phone-call.is-on-call { background: #ff3b30; }
.phone-del {
  min-width: 48px;
}
.phone-recent {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 6px;
  background: rgba(255,255,255,0.06);
  cursor: pointer;
}
.phone-recent:hover { background: rgba(255,255,255,0.1); }
.phone-status { margin-top: 16px; }

/* Games mini session */
.game-play-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}
.game-play-panel {
  width: min(320px, 90%);
  padding: 20px;
  border-radius: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(40,40,42,0.95);
  color: #fff;
}
.game-play-panel h2 { margin: 0; font-size: 18px; }
.game-score { font-size: 20px; }
.game-card.is-selected {
  outline: 2px solid #0a84ff;
  outline-offset: 2px;
}
.games-app, .games-grid { position: relative; }
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  padding: 16px;
}
.game-card {
  border: none;
  border-radius: 14px;
  padding: 12px;
  text-align: left;
  background: rgba(120,120,128,0.16);
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.game-art {
  height: 90px;
  border-radius: 10px;
  background: linear-gradient(145deg, hsl(var(--h, 200), 70%, 55%), hsl(calc(var(--h, 200) + 40), 70%, 40%));
}
