/* ==========================================================================
   macOS Web - app styles + sidebar-window chrome
   ========================================================================== */

/* toolbar windows (Preview, Calendar): title sits left of the toolbar controls */
.toolbar-window .win-titlebar { height: 52px; flex-basis: 52px; }
.toolbar-window .win-title {
  left: 86px; right: 400px; text-align: left; font-size: 14px; font-weight: 700;
}

/* ---------- full-height sidebar windows (Finder, Mail, Notes, Music, Settings) ---------- */
.sidebar-window { background: transparent; }
.sidebar-window .floating-lights {
  position: absolute; top: 0; left: 0; height: 52px; z-index: 60;
  display: flex; align-items: center;
}
.sidebar-window .win-body { flex: 1; }
.sidebar-window .app-sidebar { padding-top: 46px; }
.app-toolbar {
  height: 52px; flex: 0 0 52px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px;
  background: var(--titlebar-bg);
  border-bottom: 1px solid var(--hairline);
}
.mac-window:not(.active) .app-toolbar { background: var(--titlebar-bg-inactive); }
.plain-toolbar-pad { padding-left: 84px; } /* toolbar in non-sidebar window: clear traffic lights */
.app-toolbar .tb-title {
  font-size: 15px; font-weight: 700; color: var(--titlebar-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mac-window:not(.active) .app-toolbar .tb-title { color: var(--titlebar-text-inactive); }
.tb-spacer { flex: 1; }
.toolbar-window .win-titlebar { padding-right: 12px; }
.tb-btn {
  width: 30px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
}
.tb-btn svg { width: 17px; height: 17px; }
.tb-btn:hover { background: var(--control-bg); }
.tb-btn:active { background: var(--control-active); }
.tb-btn.disabled { opacity: 0.35; pointer-events: none; }
.tb-search {
  height: 26px; border-radius: 7px; border: none; outline: none;
  background: var(--control-bg); color: var(--text);
  font-size: 12.5px; padding: 0 10px; width: 150px;
}

/* ==========================================================================
   FINDER
   ========================================================================== */
.finder-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--win-bg); }
.finder-content { flex: 1; overflow-y: auto; padding: 12px; }
.finder-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 14px 6px; align-content: start;
}
.finder-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px; border-radius: 6px;
}
.finder-item svg { width: 52px; height: 52px; }
.finder-item .fi-name {
  font-size: 12px; text-align: center; line-height: 1.25; color: var(--text);
  max-width: 92px; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  padding: 1px 5px; border-radius: 4px;
}
.finder-item.selected { background: var(--control-bg); }
.finder-item.selected .fi-name { background: var(--accent); color: #fff; }
.finder-list { display: flex; flex-direction: column; font-size: 13px; }
.finder-list .fl-head {
  display: flex; padding: 4px 10px; color: var(--text-secondary);
  font-size: 11.5px; border-bottom: 1px solid var(--hairline);
  position: sticky; top: -12px; background: var(--win-bg); z-index: 2;
}
.finder-list .fl-row { display: flex; align-items: center; padding: 3px 10px; border-radius: 5px; }
.finder-list .fl-row:nth-child(odd) { background: var(--control-bg); }
:root[data-theme="dark"] .finder-list .fl-row:nth-child(odd) { background: rgba(255,255,255,0.04); }
.finder-list .fl-row.selected { background: var(--accent); color: #fff; }
.finder-list .fl-row.selected .fl-dim { color: rgba(255,255,255,0.75); }
.fl-name { flex: 1; display: flex; align-items: center; gap: 7px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fl-name svg { width: 17px; height: 17px; flex: 0 0 auto; }
.fl-kind { width: 110px; } .fl-size { width: 70px; text-align: right; }
.fl-dim { color: var(--text-secondary); font-size: 12.5px; }
.finder-pathbar {
  flex: 0 0 26px; display: flex; align-items: center; gap: 4px;
  border-top: 1px solid var(--hairline);
  padding: 0 12px; font-size: 12px; color: var(--text-secondary);
  overflow: hidden; white-space: nowrap;
}
.finder-pathbar .pb-seg { display: flex; align-items: center; gap: 4px; }
.finder-pathbar .pb-seg svg { width: 13px; height: 13px; }
.finder-pathbar .pb-sep { opacity: 0.5; }
.finder-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary); font-size: 17px; font-weight: 600; height: 100%;
}

/* ==========================================================================
   PREVIEW (PDF)
   ========================================================================== */
.preview-body { flex-direction: column; }
.preview-split { flex: 1; display: flex; overflow: hidden; }
.preview-thumbs {
  width: 150px; flex: 0 0 auto; overflow-y: auto;
  background: var(--sidebar-bg);
  backdrop-filter: blur(40px);
  border-right: 1px solid var(--hairline);
  padding: 12px 8px; display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.pv-thumb { border-radius: 3px; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,0.3); line-height: 0; }
.pv-thumb.current { outline: 3px solid var(--accent); }
.pv-thumb-num { font-size: 11px; color: var(--text-secondary); text-align: center; margin-top: -6px; }
.preview-canvas-wrap {
  flex: 1; overflow: auto; background: #838388;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: 24px;
}
:root[data-theme="dark"] .preview-canvas-wrap { background: #38383c; }
.preview-canvas-wrap canvas { box-shadow: 0 4px 24px rgba(0,0,0,0.4); background: #fff; flex: 0 0 auto; }
.preview-drop {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; color: var(--text-secondary);
}
.pv-page-label { font-size: 12.5px; color: var(--text-secondary); min-width: 84px; text-align: center; }

/* ==========================================================================
   CALCULATOR
   ========================================================================== */
.calc-body { flex-direction: column; background: rgba(41, 42, 47, 0.92); backdrop-filter: blur(30px); }
.calc-display {
  flex: 0 0 100px; display: flex; align-items: flex-end; justify-content: flex-end;
  padding: 10px 18px 6px; color: #fff;
  font-size: 52px; font-weight: 300; letter-spacing: 0;
  overflow: hidden; white-space: nowrap;
}
.calc-grid {
  flex: 1; display: grid;
  grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr;
  gap: 1px; padding: 1px;
}
.calc-btn {
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff; background: #656569;
  transition: filter 0.08s ease;
}
.calc-btn:active { filter: brightness(1.35); }
.calc-btn.fn { background: #47474b; font-size: 17px; }
.calc-btn.op { background: #ff9f0b; font-size: 24px; }
.calc-btn.op.active-op { background: #fff; color: #ff9f0b; }
.calc-btn.zero { grid-column: span 2; justify-content: flex-start; padding-left: 26px; }

/* ==========================================================================
   CALENDAR
   ========================================================================== */
.cal-main { flex: 1; display: flex; flex-direction: column; background: var(--win-bg); }
.cal-title {
  font-size: 21px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0; margin-right: 14px;
}
.cal-title .cal-year { font-weight: 300; color: var(--text-secondary); }
.cal-dow-row {
  display: grid; grid-template-columns: repeat(7, 1fr);
  padding: 4px 0 4px; border-bottom: 1px solid var(--hairline);
}
.cal-dow { text-align: right; padding-right: 10px; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.cal-grid { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 1fr; }
.cal-cell {
  border-right: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
  padding: 4px 6px; overflow: hidden; position: relative;
  display: flex; flex-direction: column; gap: 2px;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell .cc-num {
  align-self: flex-end; font-size: 13px; font-weight: 500;
  width: 22px; height: 22px; flex: 0 0 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.cal-cell.other-month .cc-num { color: var(--text-tertiary); }
.cal-cell.today .cc-num { background: #ec4d3c; color: #fff; font-weight: 700; }
.cal-cell:hover { background: var(--control-bg); }
.cal-event {
  font-size: 11px; padding: 1px 6px; border-radius: 4px;
  background: rgba(10, 130, 255, 0.16); color: var(--accent);
  border-left: 3px solid var(--accent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 500; flex: 0 0 auto;
}
:root[data-theme="dark"] .cal-event { background: rgba(10, 130, 255, 0.25); color: #7ab8ff; }
.cal-event-pop { width: 250px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.cal-event-pop .cep-title { font-size: 13px; font-weight: 700; }

/* ==========================================================================
   CLOCK
   ========================================================================== */
.clock-body { flex-direction: column; background: rgba(28, 28, 30, 0.94); color: #fff; }
.clock-tabs {
  flex: 0 0 auto; display: flex; justify-content: center; gap: 6px; padding: 10px 0 8px;
}
.clock-tab {
  padding: 4px 14px; border-radius: 7px; font-size: 13px; color: rgba(255,255,255,0.65);
}
.clock-tab.selected { background: rgba(255, 255, 255, 0.16); color: #fff; }
.clock-pane { flex: 1; overflow-y: auto; padding: 10px 26px 20px; }
.wc-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.wc-city { font-size: 17px; font-weight: 500; }
.wc-sub { font-size: 12px; color: rgba(255, 255, 255, 0.5); margin-top: 1px; }
.wc-time { font-size: 34px; font-weight: 250; font-variant-numeric: tabular-nums; letter-spacing: 0.5px; }
.wc-ampm { font-size: 15px; color: rgba(255,255,255,0.6); margin-left: 4px; }
.clock-big {
  display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%;
  gap: 22px;
}
.clock-digits { font-size: 76px; font-weight: 200; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.clock-digits .ms { font-size: 42px; color: rgba(255, 255, 255, 0.55); }
.clock-controls { display: flex; gap: 60px; }
.round-btn {
  width: 74px; height: 74px; border-radius: 50%;
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.round-btn::after { content: ""; position: absolute; inset: 2.5px; border-radius: 50%; border: 1.5px solid rgba(28,28,30,0.9); }
.round-btn.rb-green { background: rgba(48, 209, 88, 0.22); color: #30d158; }
.round-btn.rb-red { background: rgba(255, 69, 58, 0.22); color: #ff453a; }
.round-btn.rb-gray { background: rgba(255, 255, 255, 0.14); color: #fff; }
.round-btn:active { filter: brightness(1.4); }
.round-btn.disabled { opacity: 0.4; pointer-events: none; }
.laps { width: 100%; max-width: 380px; max-height: 130px; overflow-y: auto; font-variant-numeric: tabular-nums; }
.lap-row { display: flex; justify-content: space-between; padding: 7px 6px; border-bottom: 1px solid rgba(255,255,255,0.1); font-size: 14px; color: rgba(255,255,255,0.8); }
.timer-inputs { display: flex; align-items: baseline; gap: 6px; }
.timer-inputs input {
  width: 92px; background: rgba(255, 255, 255, 0.1); border: none; border-radius: 8px;
  color: #fff; font-size: 44px; font-weight: 200; text-align: center; outline: none;
  font-variant-numeric: tabular-nums;
}
.timer-inputs .colon { font-size: 40px; font-weight: 200; }
.alarm-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 4px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.alarm-time { font-size: 34px; font-weight: 250; font-variant-numeric: tabular-nums; }
.alarm-label { font-size: 12px; color: rgba(255,255,255,0.5); }
.clock-add-btn {
  position: absolute; top: 10px; right: 14px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,0.14); color: #fff; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}

/* ==========================================================================
   TEXTEDIT
   ========================================================================== */
.te-toolbar {
  flex: 0 0 38px; display: flex; align-items: center; gap: 5px;
  padding: 0 12px; border-bottom: 1px solid var(--hairline);
  background: var(--titlebar-bg);
}
.te-fmt-btn {
  min-width: 26px; height: 24px; border-radius: 5px; font-size: 13px;
  display: flex; align-items: center; justify-content: center; color: var(--text);
  padding: 0 6px;
}
.te-fmt-btn:hover { background: var(--control-bg); }
.te-fmt-btn.on { background: var(--control-active); }
.te-ruler {
  flex: 0 0 16px; border-bottom: 1px solid var(--hairline);
  background: repeating-linear-gradient(90deg, var(--hairline) 0 1px, transparent 1px 12px);
  background-position: 12px bottom; background-size: 100% 5px; background-repeat: repeat-x;
  opacity: 0.9;
}
.te-editor {
  flex: 1; overflow-y: auto; outline: none;
  padding: 22px 30px; font-size: 14px; line-height: 1.5;
  background: var(--win-bg); color: var(--text);
  font-family: "Helvetica Neue", var(--font);
}

/* ==========================================================================
   NOTES - one consistent spacing scheme:
   list gutter 8px / row inset 9x12 / editor gutter 28px
   ========================================================================== */
.notes-list {
  width: 240px; flex: 0 0 auto;
  border-right: 1px solid var(--hairline);
  overflow-y: auto; background: var(--win-bg);
  padding: 8px;
}
.note-row { padding: 9px 12px; border-radius: 8px; }
.note-row + .note-row { margin-top: 2px; }
.note-row .nr-title { font-size: 13px; font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-row .nr-sub { font-size: 12px; color: var(--text-secondary); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.note-row .nr-sub b { font-weight: 500; color: var(--text); margin-right: 6px; }
.note-row.selected { background: rgba(255, 214, 10, 0.28); }
:root[data-theme="dark"] .note-row.selected { background: rgba(255, 214, 10, 0.22); }
.notes-scroll {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 16px 28px 40px;
  background: var(--win-bg);
  cursor: text;
}
.note-date {
  flex: 0 0 auto;
  text-align: center; font-size: 11.5px; color: var(--text-tertiary);
  margin: 0 0 16px; user-select: none; cursor: default;
}
.notes-editor {
  flex: 1 0 auto;
  outline: none; padding: 0;
  font-size: 14px; line-height: 1.55; color: var(--text);
}
.notes-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); font-size: 16px; }

/* ==========================================================================
   PHOTOS
   ========================================================================== */
.photos-grid {
  flex: 1; overflow-y: auto; padding: 2px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px;
  align-content: start; background: var(--win-bg);
}
.photo-cell { aspect-ratio: 1; overflow: hidden; position: relative; }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter 0.15s ease; }
.photo-cell:hover img { filter: brightness(1.08); }
.photo-lightbox {
  position: absolute; inset: 0; z-index: 50;
  background: rgba(12, 12, 14, 0.96);
  display: flex; align-items: center; justify-content: center;
  animation: menuIn 0.18s ease;
}
.photo-lightbox img { max-width: calc(100% - 130px); max-height: calc(100% - 60px); object-fit: contain; border-radius: 3px; }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; backdrop-filter: blur(10px);
}
.lb-nav:hover { background: rgba(255, 255, 255, 0.22); }
.lb-prev { left: 14px; } .lb-next { right: 14px; }
.lb-topbar {
  position: absolute; top: 10px; right: 12px;
  display: flex; align-items: center; gap: 8px;
  z-index: 70; /* above the window's floating traffic lights */
}
.lb-close-btn {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(10px);
}
.lb-close-btn:hover { background: rgba(255, 255, 255, 0.26); }
.lb-title { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,0.8); font-size: 13px; pointer-events: none; }

/* ==========================================================================
   MAIL
   ========================================================================== */
.mail-list { width: 270px; flex: 0 0 auto; border-right: 1px solid var(--hairline); overflow-y: auto; background: var(--win-bg); }
.mail-row { padding: 9px 14px 9px 22px; border-bottom: 1px solid var(--hairline); position: relative; }
.mail-row .mr-top { display: flex; justify-content: space-between; align-items: baseline; }
.mail-row .mr-sender { font-size: 13px; font-weight: 700; }
.mail-row .mr-time { font-size: 11.5px; color: var(--text-secondary); }
.mail-row .mr-subject { font-size: 12.5px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-row .mr-preview { font-size: 12px; color: var(--text-secondary); margin-top: 1px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mail-row.unread::before {
  content: ""; position: absolute; left: 8px; top: 14px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.mail-row.selected { background: var(--accent); }
.mail-row.selected * { color: #fff !important; }
.mail-reading { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--win-bg); }
.mail-head { padding: 16px 22px 12px; border-bottom: 1px solid var(--hairline); }
.mail-head .mh-subject { font-size: 16px; font-weight: 700; }
.mail-head .mh-meta { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.mh-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; font-weight: 600;
}
.mh-from { font-size: 13px; font-weight: 600; }
.mh-to { font-size: 12px; color: var(--text-secondary); }
.mh-date { margin-left: auto; font-size: 12px; color: var(--text-secondary); }
.mail-content { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 13.5px; line-height: 1.6; user-select: text; }
.mail-content p { margin-bottom: 12px; }
.mail-placeholder { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); font-size: 15px; }

/* ==========================================================================
   MUSIC
   ========================================================================== */
.music-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--win-bg); }
.music-npbar {
  flex: 0 0 56px; display: flex; align-items: center; gap: 14px;
  padding: 0 16px; background: var(--titlebar-bg); border-bottom: 1px solid var(--hairline);
}
.mnp-controls { display: flex; align-items: center; gap: 14px; color: var(--text); }
.mnp-controls button { color: var(--text); display: flex; }
.mnp-controls button:hover { color: var(--accent); }
.mnp-controls svg { width: 18px; height: 18px; }
.mnp-controls .mnp-play svg { width: 24px; height: 24px; }
.mnp-lcd {
  flex: 1; height: 44px; border-radius: 8px;
  background: var(--control-bg);
  display: flex; align-items: center; gap: 10px;
  padding: 0 0 0 0; overflow: hidden; position: relative;
  box-shadow: inset 0 0 0 0.5px var(--hairline);
}
.mnp-art { width: 44px; height: 44px; flex: 0 0 auto; }
.mnp-art img { width: 100%; height: 100%; display: block; }
.mnp-info { flex: 1; text-align: center; overflow: hidden; padding-right: 44px; }
.mnp-title { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mnp-artist { font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; }
.mnp-progress { position: absolute; bottom: 0; left: 44px; right: 0; height: 3px; background: var(--hairline); }
.mnp-progress-fill { height: 100%; background: var(--text-secondary); width: 0%; }
.mnp-idle { font-size: 13px; color: var(--text-tertiary); display: flex; align-items: center; justify-content: center; width: 100%; }
.music-content { flex: 1; overflow-y: auto; padding: 18px 22px; }
.music-content h2 { font-size: 21px; font-weight: 700; margin-bottom: 2px; }
.music-content .mc-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; }
.song-row {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 10px; border-radius: 8px; font-size: 13px;
}
.song-row:hover { background: var(--control-bg); }
.song-row.playing { background: var(--control-bg); }
.song-row .sr-num { width: 20px; text-align: right; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.song-row .sr-art { width: 34px; height: 34px; border-radius: 4px; overflow: hidden; flex: 0 0 auto; }
.song-row .sr-art img { width: 100%; height: 100%; display: block; }
.song-row .sr-info { flex: 1; overflow: hidden; }
.song-row .sr-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-row .sr-title .eq { color: #fa2b4d; margin-right: 5px; }
.song-row .sr-artist { font-size: 12px; color: var(--text-secondary); }
.song-row .sr-dur { color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   SYSTEM SETTINGS
   ========================================================================== */
.st-sidebar-row svg { border-radius: 6px; padding: 2.5px; width: 21px !important; height: 21px !important; box-sizing: border-box; color: #fff !important; }
.st-main { flex: 1; overflow-y: auto; background: var(--win-bg); }
.st-header { padding: 16px 24px 6px; font-size: 19px; font-weight: 700; position: sticky; top: 0; background: var(--win-bg); z-index: 2; }
.st-section { padding: 10px 24px 24px; }
.st-card {
  background: var(--control-bg);
  border-radius: 10px;
  box-shadow: inset 0 0 0 0.5px var(--hairline);
}
.st-card + .st-card { margin-top: 14px; }
.st-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; font-size: 13px;
}
.st-row + .st-row { border-top: 1px solid var(--hairline); }
.st-row .str-label { font-weight: 500; }
.st-row .str-sub { font-size: 11.5px; color: var(--text-secondary); margin-top: 1px; }
.st-wall-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 14px; }
.st-wall {
  aspect-ratio: 16/10; border-radius: 8px; overflow: hidden;
  outline: 2px solid transparent; outline-offset: 2px;
  transition: outline-color 0.15s ease;
}
.st-wall.selected { outline-color: var(--accent); }
.st-wall-name { font-size: 11px; color: var(--text-secondary); text-align: center; margin-top: 4px; }
.st-appearance-grid { display: flex; gap: 14px; padding: 14px; }
.st-appearance-opt { text-align: center; }
.st-app-preview {
  width: 120px; height: 78px; border-radius: 8px; overflow: hidden;
  outline: 2px solid transparent; outline-offset: 2px; position: relative;
  transition: outline-color 0.15s ease;
}
.st-appearance-opt.selected .st-app-preview { outline-color: var(--accent); }
.st-appearance-opt .st-app-label { font-size: 12px; margin-top: 6px; }
.st-slider { -webkit-appearance: none; width: 180px; height: 4px; border-radius: 2px; background: var(--hairline-strong); outline: none; }
.st-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 0.5px 3px rgba(0,0,0,0.35);
}

/* ==========================================================================
   TERMINAL
   ========================================================================== */
.term-body {
  flex-direction: column;
  background: rgba(24, 24, 27, 0.88);
  backdrop-filter: blur(24px);
  color: #f2f2f2;
  font-family: var(--font-mono);
  font-size: 12.5px; line-height: 1.5;
  padding: 8px 10px;
  overflow-y: auto;
  cursor: text;
  user-select: text;
  display: block;
}
.term-line { white-space: pre-wrap; word-break: break-all; }
.term-prompt-user { color: #78d75e; }
.term-prompt-path { color: #6fb3ff; }
.term-input-row { display: flex; }
.term-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: inherit; font: inherit; padding: 0; caret-color: #f2f2f2;
}
.term-ascii { color: #78d75e; }
.term-dim { color: rgba(255,255,255,0.45); }

/* ==========================================================================
   SAFARI
   ========================================================================== */
.sf-address {
  flex: 0 1 560px; height: 30px;
  display: flex; align-items: center; gap: 6px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--control-bg);
  box-shadow: inset 0 0 0 0.5px var(--hairline);
  color: var(--text-secondary);
  min-width: 160px;
}
.sf-address.editing { box-shadow: inset 0 0 0 0.5px var(--hairline), 0 0 0 3px rgba(10, 130, 255, 0.35); background: var(--input-bg); }
.sf-lock svg { width: 12px; height: 12px; display: block; }
.sf-address-input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  color: var(--text); font-size: 12.5px; text-align: center;
  font-family: var(--font);
}
.sf-address.editing .sf-address-input { text-align: left; }
.sf-reload { width: 22px; height: 22px; border-radius: 5px; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); flex: 0 0 auto; }
.sf-reload svg { width: 13px; height: 13px; }
.sf-reload:hover { background: var(--control-bg-hover); }

.sf-tabbar {
  flex: 0 0 32px;
  display: flex; align-items: center; gap: 5px;
  padding: 0 10px 5px;
  background: var(--titlebar-bg);
  border-bottom: 1px solid var(--hairline);
}
.mac-window:not(.active) .sf-tabbar { background: var(--titlebar-bg-inactive); }
.sf-tab {
  flex: 1 1 0; min-width: 0; max-width: 240px; height: 26px;
  display: flex; align-items: center; gap: 5px;
  padding: 0 7px;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  position: relative;
}
.sf-tab:hover { background: var(--control-bg); }
.sf-tab.active { background: var(--control-active); color: var(--text); }
.sf-tab-title {
  flex: 1; text-align: center; font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding-right: 15px; /* balance the close button */
}
.sf-tab-close {
  width: 15px; height: 15px; border-radius: 4px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); opacity: 0;
}
.sf-tab:hover .sf-tab-close { opacity: 1; }
.sf-tab-close:hover { background: var(--control-bg-hover); }
.sf-tab-close svg { width: 8px; height: 8px; }

.sf-content { flex: 1; position: relative; background: var(--win-bg); overflow: hidden; }
.sf-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: none; background: #fff; }
.sf-start {
  position: absolute; inset: 0; overflow-y: auto;
  padding: 44px 56px;
  background: var(--win-bg-translucent);
  backdrop-filter: blur(50px) saturate(170%);
  -webkit-backdrop-filter: blur(50px) saturate(170%);
}
.sf-start-heading { font-size: 21px; font-weight: 700; margin-bottom: 18px; }
.sf-fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 22px 10px; max-width: 720px; }
.sf-fav { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sf-fav-icon {
  width: 60px; height: 60px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 600;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18), inset 0 0 0 0.5px rgba(0, 0, 0, 0.08);
  transition: transform 0.12s ease;
}
.sf-fav:hover .sf-fav-icon { transform: scale(1.05); }
.sf-fav:active .sf-fav-icon { transform: scale(0.96); filter: brightness(0.85); }
.sf-fav-name { font-size: 12px; color: var(--text); }
.sf-start-note {
  margin-top: 34px; max-width: 560px;
  font-size: 12px; line-height: 1.55; color: var(--text-secondary);
}

/* ---------- Safari in-browser search results ---------- */
.sf-search { position: absolute; inset: 0; overflow-y: auto; background: var(--win-bg); }
.sf-search-head {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 28px 14px;
  border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0; background: var(--win-bg); z-index: 2;
}
.sf-glogo { font-size: 24px; font-weight: 500; letter-spacing: -1px; user-select: none; }
.sf-glogo b { font-weight: 500; }
.sf-search-input {
  flex: 0 1 440px; height: 36px;
  border: 1px solid var(--hairline-strong); border-radius: 18px;
  outline: none; background: var(--win-bg); color: var(--text);
  padding: 0 18px; font-size: 14px; font-family: var(--font);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
}
.sf-search-input:focus { box-shadow: 0 1px 8px rgba(0, 0, 0, 0.16); }
.sf-google-out {
  margin-left: auto; padding: 6px 12px; border-radius: 8px;
  background: var(--control-bg); color: var(--accent); font-size: 12.5px;
  white-space: nowrap;
}
.sf-google-out:hover { background: var(--control-bg-hover); }
.sf-search-body { padding: 16px 28px 40px; max-width: 660px; }
.sf-search-loading { color: var(--text-secondary); font-size: 14px; padding: 22px 0; }
.sf-result-count { font-size: 12px; color: var(--text-tertiary); margin-bottom: 14px; }
.sf-featured {
  border: 1px solid var(--hairline); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 18px;
  background: var(--control-bg);
}
.sf-featured-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.sf-featured-text { font-size: 13.5px; line-height: 1.55; color: var(--text); margin-bottom: 8px; }
.sf-result { margin-bottom: 20px; }
.sfr-url { font-size: 12px; color: #1d7f37; display: block; margin-bottom: 1px; text-decoration: none; }
:root[data-theme="dark"] .sfr-url { color: #8fce9f; }
.sfr-title {
  font-size: 17px; color: #1a0dab; text-decoration: none; display: inline-block;
  line-height: 1.3; cursor: pointer;
}
.sfr-title:hover { text-decoration: underline; }
:root[data-theme="dark"] .sfr-title { color: #8ab4f8; }
.sfr-snippet { font-size: 13px; line-height: 1.5; color: var(--text-secondary); margin-top: 3px; }
.sf-search-note { margin-top: 26px; font-size: 11.5px; color: var(--text-tertiary); line-height: 1.5; }

/* ---------- Music search ---------- */
.music-search-wrap { padding: 4px 0 16px; }
.music-search-field {
  width: 100%; max-width: 480px; height: 34px;
  border: none; border-radius: 9px; outline: none;
  background: var(--control-bg);
  box-shadow: inset 0 0 0 0.5px var(--hairline);
  color: var(--text); font-size: 14px; padding: 0 14px;
  font-family: var(--font);
}
.music-search-field:focus { box-shadow: inset 0 0 0 0.5px var(--hairline), 0 0 0 3px rgba(10, 130, 255, 0.35); }
.music-msg { padding: 26px 4px; color: var(--text-secondary); font-size: 14px; line-height: 1.5; }
.mnp-vol { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.mnp-vol input {
  -webkit-appearance: none; width: 76px; height: 4px; border-radius: 2px;
  background: var(--hairline-strong); outline: none;
}
.mnp-vol input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: #fff; box-shadow: 0 0.5px 3px rgba(0, 0, 0, 0.4);
}

/* ---------- Photos lightbox actions ---------- */
.lb-actions { display: flex; gap: 8px; }
.lb-actions .mac-btn {
  background: rgba(255, 255, 255, 0.14); color: #fff;
  backdrop-filter: blur(10px); box-shadow: none;
  text-decoration: none; font-size: 12.5px;
}
.lb-actions .mac-btn:hover { background: rgba(255, 255, 255, 0.24); }
.lb-actions .mac-btn.primary { background: var(--accent); }

/* ---------- Photo Booth ---------- */
.pb-body { flex-direction: column; background: #2b2b2e; }
.pb-stage { flex: 1; position: relative; overflow: hidden; background: #131315; }
.pb-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transform: scaleX(-1);
}
.pb-flash {
  position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none;
  transition: opacity 0.38s ease-out;
}
.pb-flash.on { opacity: 1; transition: opacity 0.04s ease-in; }
.pb-count {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center;
  font-size: 120px; font-weight: 200; color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
.pb-state {
  position: absolute; inset: 0; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  color: rgba(255, 255, 255, 0.85); font-size: 13.5px;
  background: #1b1b1e;
}
.pb-bottom {
  flex: 0 0 74px;
  display: flex; align-items: center; gap: 14px;
  padding: 0 16px;
  background: linear-gradient(180deg, #3a3a3e, #232326);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.pb-strip { flex: 1; display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px; }
.pb-strip-empty { color: rgba(255, 255, 255, 0.35); font-size: 12px; align-self: center; }
.pb-thumb {
  width: 72px; height: 54px; flex: 0 0 auto;
  border-radius: 5px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.pb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pb-thumb:hover { outline: 2px solid var(--accent); }
.pb-shutter {
  width: 52px; height: 40px; border-radius: 9px; flex: 0 0 auto;
  background: linear-gradient(180deg, #f66, #d92c22);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  display: flex; align-items: center; justify-content: center;
}
.pb-shutter:active { filter: brightness(0.85); }
.pb-shutter.disabled { filter: grayscale(1) brightness(0.7); pointer-events: none; }
.pb-shutter-glyph svg { width: 22px; height: 22px; display: block; }
.pb-open-photos { flex: 0 0 auto; background: rgba(255, 255, 255, 0.12); color: #eee; box-shadow: none; }
.pb-open-photos:hover { background: rgba(255, 255, 255, 0.2); }

/* ==========================================================================
   MESSAGES (iMessage-style room-code chat)
   ========================================================================== */
.msg-start {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 30px; background: var(--win-bg); overflow-y: auto;
}
.msg-start-icon { width: 72px; height: 72px; }
.msg-start-icon img { width: 100%; height: 100%; }
.msg-start-title { font-size: 23px; font-weight: 700; }
.msg-start-col { display: flex; flex-direction: column; gap: 10px; width: 250px; margin-top: 6px; }
.msg-name-input { width: 100%; height: 32px; text-align: center; font-size: 13px; }
.msg-wide-btn { width: 100%; height: 34px; font-size: 13.5px; border-radius: 8px; }
.msg-or {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-tertiary); font-size: 11.5px; margin: 2px 0;
}
.msg-or::before, .msg-or::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.msg-code-input {
  width: 100%; height: 40px;
  border: none; outline: none; border-radius: 8px;
  background: var(--input-bg);
  box-shadow: inset 0 0 0 1px var(--hairline);
  color: var(--text);
  text-align: center; text-transform: uppercase;
  font-family: var(--font-mono); font-size: 20px; letter-spacing: 6px;
}
.msg-code-input::placeholder { font-family: var(--font); font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--text-tertiary); }
.msg-code-input:focus { box-shadow: inset 0 0 0 1px var(--hairline), 0 0 0 3px rgba(10, 130, 255, 0.35); }

.msg-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(140deg, #9aa2b1, #6b7280);
  color: #fff; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.msg-status { font-size: 11px; color: var(--text-secondary); display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; }
.msg-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }

.msg-scroll {
  flex: 1; overflow-y: auto; background: var(--win-bg);
  padding: 14px 16px 6px;
  display: flex; flex-direction: column; gap: 2px;
}
.msg-invite {
  align-self: center; text-align: center;
  background: var(--control-bg); border-radius: 12px;
  padding: 14px 20px; margin: 10px 0 16px;
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.5;
  max-width: 320px; display: flex; flex-direction: column; gap: 6px;
  box-shadow: inset 0 0 0 0.5px var(--hairline);
}
.msg-time { text-align: center; font-size: 10.5px; color: var(--text-tertiary); margin: 10px 0 4px; }
.msg-sender { font-size: 10.5px; color: var(--text-secondary); margin: 6px 0 1px 14px; }
.msg-row { display: flex; }
.msg-row.mine { justify-content: flex-end; }
.msg-row + .msg-row { margin-top: 2px; }
.msg-bubble {
  max-width: 68%; padding: 7px 12px;
  border-radius: 18px;
  font-size: 13px; line-height: 1.35;
  white-space: pre-wrap; word-break: break-word;
  user-select: text;
}
.msg-row.mine .msg-bubble { background: #0a84ff; color: #fff; border-bottom-right-radius: 5px; }
.msg-row.theirs .msg-bubble { background: #e9e9eb; color: #1c1c1e; border-bottom-left-radius: 5px; }
:root[data-theme="dark"] .msg-row.theirs .msg-bubble { background: #3a3a3c; color: #f2f2f7; }
.msg-delivered { text-align: right; font-size: 10.5px; color: var(--text-tertiary); margin: 2px 4px 0 0; }

.msg-input-bar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  padding: 8px 12px 10px; background: var(--win-bg);
}
.msg-input {
  flex: 1; height: 32px; border-radius: 16px;
  border: 1px solid var(--hairline-strong); outline: none;
  background: var(--input-bg); color: var(--text);
  font-size: 13px; padding: 0 14px; font-family: var(--font);
}
.msg-input:focus { border-color: rgba(10, 132, 255, 0.6); }
.msg-send {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto;
  background: #0a84ff;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.18s cubic-bezier(0.3, 1.3, 0.5, 1);
}
.msg-send.show { opacity: 1; transform: scale(1); }
.msg-send:active { filter: brightness(0.85); }

/* ==========================================================================
   FACETIME
   ========================================================================== */
.ft-body { flex-direction: column; background: #161618; color: #fff; }
.ft-start {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 30px;
}
.ft-start .msg-start-title { color: #fff; }
.ft-start .msg-name-input { background: rgba(255,255,255,0.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14); color: #fff; }
.ft-start .msg-code-input { background: rgba(255,255,255,0.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14); color: #fff; }
.ft-start .msg-code-input::placeholder { color: rgba(255,255,255,0.4); }
.ft-start .mac-btn { background: rgba(255,255,255,0.1); color: #fff; box-shadow: none; }
.ft-start .mac-btn.primary { background: var(--accent); }
.ft-new-btn {
  width: 100%; height: 36px; border-radius: 9px;
  background: #30d158; color: #fff;
  font-size: 13.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.ft-new-btn:active { filter: brightness(0.85); }

.ft-stage { flex: 1; position: relative; overflow: hidden; background: #161618; }
.ft-grid {
  position: absolute; inset: 10px 10px 86px;
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  align-items: stretch;
}
.ft-grid[data-count="1"] { grid-template-columns: 1fr; }
.ft-grid[data-count="2"] { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

.ft-tile {
  position: relative; overflow: hidden;
  background: #232326;
  border-radius: 14px;
  min-height: 120px;
  animation: ftTileIn 0.32s cubic-bezier(0.25, 1, 0.4, 1);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.08);
}
@keyframes ftTileIn { from { opacity: 0; transform: scale(0.92); } }
.ft-tile-out { opacity: 0; transform: scale(0.92); transition: opacity 0.24s ease, transform 0.24s ease; }
.ft-tile video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; background: #1a1a1c;
}
.ft-tile video.mirror { transform: scaleX(-1); }
.ft-tile.no-video video { visibility: hidden; }
.ft-avatar {
  position: absolute; inset: 0; margin: auto;
  width: 74px; height: 74px; border-radius: 50%;
  background: linear-gradient(140deg, #8e97a8, #5b6472);
  color: #fff; font-size: 32px; font-weight: 600;
  display: none; align-items: center; justify-content: center;
}
.ft-tile.no-video .ft-avatar { display: flex; }
.ft-name {
  position: absolute; left: 8px; bottom: 8px;
  display: flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 7px;
  background: rgba(20, 20, 22, 0.55);
  backdrop-filter: blur(12px);
  font-size: 11.5px; font-weight: 500; color: #fff;
  max-width: calc(100% - 16px); overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.ft-muted-badge { width: 12px; height: 12px; display: flex; color: #ff453a; flex: 0 0 auto; }
.ft-muted-badge svg { width: 100%; height: 100%; }
.ft-tile-status {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(22, 22, 24, 0.55);
  backdrop-filter: blur(6px);
  font-size: 13px; color: rgba(255, 255, 255, 0.85);
  z-index: 2;
}
.ft-degraded { outline: 1.5px solid rgba(255, 159, 10, 0.6); }
.ft-quality {
  position: absolute; top: 8px; left: 8px;
  padding: 2.5px 8px; border-radius: 6px;
  background: rgba(255, 159, 10, 0.85); color: #fff;
  font-size: 10.5px; font-weight: 600;
}

/* 1:1 layout - remote fills, self floats as PiP */
.ft-one-on-one .ft-grid { display: block; }
.ft-one-on-one .ft-tile:not(.ft-self) { position: absolute; inset: 0; }
.ft-one-on-one .ft-tile.ft-self {
  position: absolute; right: 12px; bottom: 12px; inset: auto 12px 12px auto;
  width: min(200px, 30%); aspect-ratio: 4 / 3; min-height: 0;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), inset 0 0 0 0.5px rgba(255, 255, 255, 0.14);
  z-index: 3;
}
.ft-one-on-one .ft-tile.ft-self .ft-avatar { width: 44px; height: 44px; font-size: 19px; }

.ft-topbar {
  position: absolute; top: 10px; right: 12px;
  display: flex; gap: 8px; z-index: 5;
}
.ft-chip {
  padding: 4px 11px; border-radius: 8px;
  background: rgba(28, 28, 30, 0.6); color: #fff;
  backdrop-filter: blur(16px);
  font-size: 12px; font-weight: 600; letter-spacing: 1.5px;
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.14);
}
.ft-chip:hover { background: rgba(50, 50, 54, 0.7); }
.ft-net { letter-spacing: 0; background: rgba(255, 69, 58, 0.35); }

.ft-controls {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  display: flex; gap: 14px; z-index: 5;
  padding: 10px 16px; border-radius: 30px;
  background: rgba(28, 28, 30, 0.55);
  backdrop-filter: blur(24px) saturate(160%);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.12), 0 8px 30px rgba(0, 0, 0, 0.4);
}
.ft-ctl {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.16); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, filter 0.1s ease;
}
.ft-ctl svg { width: 20px; height: 20px; }
.ft-ctl:hover { background: rgba(255, 255, 255, 0.26); }
.ft-ctl:active { filter: brightness(0.8); }
.ft-ctl.off { background: #fff; color: #1c1c1e; }
.ft-ctl.disabled { opacity: 0.4; pointer-events: none; }
.ft-end { background: #ff453a; }
.ft-end:hover { background: #ff5f55; }

.ft-wait {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(22, 22, 24, 0.72);
  backdrop-filter: blur(14px);
}
.ft-wait-code { font-size: 40px; font-weight: 700; letter-spacing: 10px; padding-left: 10px; }
.ft-wait-sub { font-size: 13px; color: rgba(255, 255, 255, 0.6); }
.ft-ring { display: flex; gap: 7px; margin-top: 14px; }
.ft-ring span {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  animation: ftRing 1.25s ease-in-out infinite;
}
.ft-ring span:nth-child(2) { animation-delay: 0.18s; }
.ft-ring span:nth-child(3) { animation-delay: 0.36s; }
@keyframes ftRing { 0%, 100% { opacity: 0.25; transform: scale(0.85); } 45% { opacity: 1; transform: scale(1.12); } }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .mb-battery-pct { display: none; }
  #launchpad-grid { grid-template-columns: repeat(auto-fill, 96px); gap: 24px 16px; }
  .lp-app .lp-icon { width: 62px; height: 62px; }
}
@media (max-width: 700px) {
  /* keep the dock to the essentials on phones - everything else stays
     reachable through Launchpad and Spotlight */
  .dock-item[data-app="mail"], .dock-item[data-app="photobooth"],
  .dock-item[data-app="notes"], .dock-item[data-app="calendar"],
  .dock-item[data-app="calculator"], .dock-item[data-app="clock"],
  .dock-item[data-app="textedit"], .dock-item[data-app="preview"],
  .dock-item[data-app="terminal"] { display: none; }
}
@media (max-width: 740px) {
  #menubar-left .mb-item:not(.mb-apple):not(.mb-appname) { display: none; }
  .mb-item { padding: 0 8px; }
  .mb-status { padding: 0 5px; }
  #mb-clock { padding: 0 6px; font-size: 12px; }
  .spotlight-panel { margin-top: 10vh; }
  #spotlight-input { font-size: 19px; }
  .app-sidebar { width: 150px !important; }
  .msg-start-cards { flex-direction: column; }
  .st-wall-grid { grid-template-columns: repeat(2, 1fr); }
  .cal-title { font-size: 17px; }
}
@media (max-width: 600px) {
  #desktop-icons { display: none; }
  .app-sidebar { display: none !important; }
  .sidebar-window .app-toolbar, .sidebar-window .music-npbar, .sidebar-window .clock-tabs { padding-left: 84px; }
  .sidebar-window .calc-display { padding-top: 34px; }
  .notes-list { width: 150px; }
  .mail-list { width: 170px; }
  .login-center { top: 52%; }
  .cc-grid { width: 262px; }
  .clock-digits { font-size: 54px; }
  .timer-inputs input { width: 70px; font-size: 34px; }
}

/* ==========================================================================
   NOTIFICATION BANNER
   ========================================================================== */
.os-banner {
  position: fixed; top: 34px; right: 12px; z-index: 8500;
  width: 320px;
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px;
  border-radius: 13px;
  background: var(--popover-bg);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow: var(--menu-shadow);
  color: var(--text);
  transform: translateX(360px);
  transition: transform 0.42s cubic-bezier(0.25, 1.1, 0.35, 1);
}
.os-banner.show { transform: translateX(0); }
.os-banner-icon { width: 34px; height: 34px; flex: 0 0 auto; }
.os-banner-icon svg { width: 100%; height: 100%; }
.os-banner-title { font-size: 13px; font-weight: 700; }
.os-banner-sub { font-size: 12.5px; color: var(--text-secondary); }

/* ==========================================================================
   DOCK AUTO-HIDE
   ========================================================================== */
#dock-container { transition: transform 0.32s cubic-bezier(0.3, 0.8, 0.3, 1), opacity 0.25s ease; }
#dock-container.autohide { transform: translateY(90px); opacity: 0; }
#dock-container.autohide:hover,
body.dock-peek #dock-container.autohide { transform: translateY(0); opacity: 1; }
