/* The MacMoments window, rebuilt in HTML from the app's own screens (dark appearance).
   Everything inside .stage-inner is drawn at the window's natural size in points and scaled to fit. */

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ar, 1.6);
  contain: layout;
}
.stage-inner {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}
.stage-replay {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem 0.45rem 0.7rem;
  border: 0;
  border-radius: 999px;
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(14, 13, 18, 0.72);
  box-shadow: 0 0 0 1px var(--hair-hi) inset, 0 8px 30px -8px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
}
.stage-replay svg { width: 14px; height: 14px; fill: none; stroke: var(--amber); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stage.done .stage-replay { opacity: 1; transform: none; pointer-events: auto; }
.stage-replay:hover { box-shadow: 0 0 0 1px rgba(255, 200, 140, 0.6) inset, 0 0 26px -4px rgba(255, 170, 80, 0.55); }
.stage-replay:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

/* ---------- window ---------- */

.mm {
  --win: #1d1f22;
  --bar: #25272a;
  --canvas: #1c1c1c;
  --side: #28292c;
  --control: #303133;
  --label: rgba(255, 255, 255, 0.9);
  --label-2: rgba(235, 235, 245, 0.6);
  --label-3: rgba(235, 235, 245, 0.32);
  --sep: rgba(255, 255, 255, 0.06);
  --fill: rgba(255, 255, 255, 0.07);
  --accent: #3a7ff6;
  --accent-soft: #3d93ff;
  --green: #30d158;
  position: absolute;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.25;
  letter-spacing: -0.005em;
  text-align: left;
  color: var(--label);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  cursor: default;
}
.mm *, .mm *::before, .mm *::after { box-sizing: border-box; }
.mm-win {
  position: absolute;
  overflow: hidden;
  border-radius: 26px;
  background: var(--win);
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, 0.95), 0 0 90px -20px rgba(154, 123, 255, 0.35);
}
.mm-win::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 50;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.mm-i { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.mm-lights { display: flex; gap: 9px; }
.mm-lights i { width: 14px; height: 14px; border-radius: 50%; background: #ff5f57; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.3); }
.mm-lights i:nth-child(2) { background: #febc2e; }
.mm-lights i:nth-child(3) { background: #28c840; }

/* sidebar: a floating glass panel in its own 240 pt column */
.mm-side {
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 224px;
  padding: 44px 10px 0;
  border-radius: 20px;
  background: var(--side);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 10px 30px -10px rgba(0, 0, 0, 0.6);
}
.mm-side .mm-lights { position: absolute; left: 11px; top: 11px; }
.mm-side-toggle { position: absolute; right: 0; top: 0; }
.mm-sec { height: 19px; padding: 2px 4px 0; font-size: 11px; font-weight: 600; color: var(--label-3); }
.mm-row ~ .mm-sec { margin-top: 13px; }
.mm-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 32px;
  padding: 0 11px 0 9px;
  border-radius: 10px;
  color: var(--label);
}
.mm-row .mm-i { width: 19px; height: 19px; color: var(--accent-soft); }
.mm-row em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--label-3); font-variant-numeric: tabular-nums; }
.mm-row.sel { background: var(--accent); color: #fff; font-weight: 600; }
.mm-row.sel .mm-i, .mm-row.sel em { color: rgba(255, 255, 255, 0.9); }
.mm-row.sel.away { background: #3d3f40; }
.mm-row.sel.away .mm-i { color: var(--accent-soft); }
.mm-row.sel.away em { color: var(--label-3); }
.mm-proc { overflow: hidden; }
.mm-proc .mm-sec { margin-top: 13px; }
.mm-proc-bar { height: 6px; margin: 10px 4px 16px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.mm-proc-bar i { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--accent); transform-origin: 0 50%; }
.mm-proc-l { display: flex; align-items: center; gap: 6px; padding: 0 4px; font-size: 11px; color: var(--label-2); }
.mm-proc-l .mm-i { margin-left: auto; width: 14px; height: 14px; color: var(--label-3); }

/* main column */
.mm-main { position: absolute; top: 0; right: 0; bottom: 0; }
.mm-tb {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 52px;
  z-index: 4;
  background: var(--bar);
  border-bottom: 1px solid var(--sep);
}
.mm-tbl { position: absolute; inset: 0; display: flex; align-items: center; gap: 9px; padding: 0 8px; }
.mm-tb .mm-lights { margin: 0 8px 0 6px; }
.mm-title { margin-left: 4px; font-size: 15px; font-weight: 700; letter-spacing: -0.012em; color: #fff; white-space: nowrap; }
.mm-list-title { margin-left: 12px; }
.mm-titles { display: flex; flex-direction: column; justify-content: center; min-width: 0; margin-left: 4px; overflow: hidden; }
.mm-titles .mm-title { margin-left: 0; font-size: 13px; line-height: 1.2; }
.mm-titles small { font-size: 11px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-sp { flex: 1; }
.mm-gb {
  height: 36px;
  min-width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  color: var(--label);
  background: var(--control);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 2px 8px -2px rgba(0, 0, 0, 0.45);
  font-size: 13px;
  white-space: nowrap;
}
.mm-gb > span { display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-width: 36px; height: 36px; padding: 0 6px; border-radius: 18px; }
.mm-gb.mm-round, .mm-gb.mm-round > span { width: 36px; padding: 0; }
.mm-gb.on, .mm-gb > span.on { background: var(--accent); color: #fff; }
.mm-gb > span.dim { color: var(--label-3); }
.mm-gb .mm-caret { width: 9px; height: 9px; stroke-width: 2.4; color: var(--label-2); }

.mm-content { position: absolute; left: 0; right: 0; top: 52px; bottom: 0; overflow: hidden; }
.mm-status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 11px;
  color: var(--label-2);
  background: var(--bar);
  border-top: 1px solid var(--sep);
  font-variant-numeric: tabular-nums;
  z-index: 3;
}

/* moments grid */
.mm-sub { position: absolute; left: 16px; top: 8px; font-size: 11px; color: var(--label-2); }
.mm-card { position: absolute; left: 0; top: 0; padding-bottom: 8px; }
.mm-cover { position: relative; overflow: hidden; border-radius: 10px; background: #2b2b2f; }
.mm-cover img, .mm-tile img, .mm-pane img, .mm-thumb img, .mm-cell img { width: 100%; height: 100%; object-fit: cover; display: block; max-width: none; }
.mm-card h4 {
  margin: 4px 2px 4px;
  font-size: 13px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: -0.008em;
  color: #fff;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.mm-card h4 .mm-i { width: 13px; height: 13px; margin-right: 5px; vertical-align: -1px; color: var(--label-2); }
.mm-cap { margin: 0 2px; font-size: 10px; line-height: 13px; color: var(--label-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mm-card.sel .mm-cover { box-shadow: 0 0 0 3px var(--accent); }

/* a Moment's Photos and Picks tabs, over a hairline */
.mm-seg {
  position: absolute;
  left: 16px;
  top: 8px;
  display: inline-flex;
  height: 24px;
  padding: 0 2px;
  border-radius: 12px;
  background: #2a2b2e;
}
.mm-seg span { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; padding: 0 12px; border-radius: 12px; font-size: 13px; color: var(--label); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mm-seg b { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 12px; background: var(--accent); }
.mm-seg span.on { color: #fff; }
.mm-hair { position: absolute; left: 0; right: 0; top: 40px; height: 1px; background: var(--sep); }

/* photo tiles */
.mm-grid { position: absolute; left: 0; top: 0; right: 0; bottom: 0; }
.mm-tile {
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  background: #2b2b2f;
  transform-origin: 0 0;
  will-change: transform, opacity;
}
.mm-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 var(--ring, 0px) var(--ring-c, var(--accent));
}
.mm-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(120% 90% at 50% 50%, rgba(255, 190, 110, 0) 40%, rgba(255, 180, 90, 0.55));
  box-shadow: inset 0 0 0 2px rgba(255, 200, 130, 0.95);
}
.mm-altcap { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--label-2); white-space: nowrap; opacity: 0; }
.mm-altcap .mm-i { width: 13px; height: 13px; }

/* the Find Picks popover */
.mm-pop {
  position: absolute;
  width: 420px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(51, 50, 53, 0.97);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.2), 0 24px 60px -12px rgba(0, 0, 0, 0.8);
  transform-origin: 50% 0;
  z-index: 6;
  opacity: 0;
}
.mm-pop h5 { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: #fff; }
.mm-pop-row { display: flex; gap: 10px; font-size: 13px; color: var(--label); margin-bottom: 8px; }
.mm-pop-row b { font-weight: 400; font-variant-numeric: tabular-nums; }
.mm-slider { position: relative; height: 20px; }
.mm-slider-track { position: absolute; left: 0; right: 0; top: 7px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.14); display: flex; justify-content: space-between; align-items: center; padding: 0 9px; }
.mm-slider-track i { width: 2px; height: 2px; border-radius: 1px; background: rgba(255, 255, 255, 0.35); }
.mm-slider-fill { position: absolute; left: 0; top: 7px; height: 6px; border-radius: 3px; background: var(--accent); }
.mm-slider-knob { position: absolute; top: 1px; width: 20px; height: 18px; margin-left: -10px; border-radius: 9px; background: #f2f2f5; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5), inset 0 0 0 0.5px rgba(0, 0, 0, 0.2); }
.mm-pop-ends { display: flex; justify-content: space-between; font-size: 10px; color: var(--label-2); margin: 6px 0 10px; }
.mm-pop p { margin: 0 0 12px; font-size: 12px; line-height: 1.4; color: var(--label-2); min-height: 34px; }
.mm-btn { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 12px; border-radius: 12px; font-size: 13px; font-weight: 500; color: #fff; background: var(--accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2); white-space: nowrap; }
.mm-btn.plain { background: rgba(255, 255, 255, 0.16); color: var(--label); }
.mm-btn .mm-i { width: 15px; height: 15px; }

/* inspector: a column the height of the window, beside the grid */
.mm-insp {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 340px;
  border-left: 1px solid #2a2f36;
  background: #22262c;
  z-index: 2;
}
.mm-insp-prev { position: absolute; left: 16px; right: 16px; top: 52px; height: 405px; display: flex; align-items: center; }
.mm-insp-prev img { width: 100%; height: auto; max-height: 100%; object-fit: contain; border-radius: 4px; }
.mm-insp-body { position: absolute; left: 0; right: 0; top: 457px; padding: 10px 16px 0; border-top: 1px solid #2a2f36; }
.mm-insp h6 { margin: 18px 0 8px; font-size: 10px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--label-2); }
.mm-insp h6:first-child { margin-top: 6px; }
.mm-insp-name { font-size: 13px; font-weight: 600; color: #fff; }
.mm-comp { display: flex; align-items: center; gap: 10px; height: 20px; font-size: 12px; }
.mm-comp + .mm-comp { margin-top: 8px; }
.mm-gauge { position: relative; width: 90px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.mm-gauge i { position: absolute; inset: 0; border-radius: inherit; background: var(--accent); transform-origin: 0 50%; }
.mm-alts { display: flex; gap: 8px; }
.mm-thumb { position: relative; width: 84px; height: 62px; border-radius: 4px; overflow: hidden; background: #2b2b2f; }
.mm-alts small { font-size: 10px; color: var(--label-2); }
.mm-insp-act { position: absolute; left: 0; right: 0; bottom: 0; height: 58px; border-top: 1px solid #2a2f36; display: flex; align-items: center; justify-content: center; }
.mm-insp-act .mm-btn.plain { background: #3d4147; }

/* Compare */
.mm-canvas { position: absolute; inset: 0; background: var(--canvas); }
.mm-pane { position: absolute; overflow: hidden; background: #000; }
.mm-pane img { position: absolute; inset: 0; object-fit: contain; background: var(--canvas); }
.mm-pcap { position: absolute; display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--label); white-space: nowrap; }
.mm-pcap b { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.mm-pcap em { font-style: normal; }
.mm-pcap .mm-i { width: 13px; height: 13px; }
.mm-pcap.pick b { color: var(--green); }
.mm-pcap.alt b { color: var(--label-2); }
.mm-glass {
  position: absolute;
  display: flex;
  align-items: center;
  background: rgba(59, 59, 59, 0.92);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 30px -10px rgba(0, 0, 0, 0.7);
}
.mm-actions { height: 41px; padding: 0 8px 0 14px; gap: 10px; border-radius: 21px; transform-origin: 0 0; }
.mm-actions .mm-name { font-size: 13px; font-weight: 600; margin-right: 0; }
.mm-actions .mm-btn { height: 25px; }
.mm-actions .mm-btn.plain { background: #555; color: #fff; }
.mm-vsep { width: 1px; height: 22px; background: rgba(255, 255, 255, 0.14); }
.mm-strip { height: 126px; border-radius: 12px; }
.mm-cell { position: absolute; top: 12px; width: 126px; height: 101px; border-radius: 6px; }
.mm-cell .mm-ph { position: absolute; left: 4px; top: 4px; width: 118px; height: 74px; overflow: hidden; background: #2b2b2f; }
.mm-cell small { position: absolute; left: 0; right: 0; top: 81px; text-align: center; font-size: 10px; font-weight: 600; color: var(--label); }
.mm-cell .mm-dot { position: absolute; right: 9px; top: 9px; width: 16px; height: 16px; color: var(--green); opacity: 0; }
.mm-cell .mm-dot .mm-i { width: 16px; height: 16px; }
.mm-cell.shown { background: #3a4559; }
.mm-cell.pick { box-shadow: inset 0 0 0 1.5px var(--green); }
.mm-cell.pick .mm-dot { opacity: 1; }
.mm-cell.focus { box-shadow: inset 0 0 0 2.5px var(--accent); }

/* pointer */
.mm-cursor { position: absolute; left: 0; top: 0; width: 26px; height: 26px; margin: -3px 0 0 -7px; z-index: 40; pointer-events: none; opacity: 0; transform-origin: 7px 3px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); }
.mm-cursor svg { width: 100%; height: 100%; overflow: visible; }
.mm-press { position: absolute; left: 0; top: 0; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; z-index: 39; pointer-events: none; opacity: 0; box-shadow: 0 0 0 2px rgba(255, 210, 150, 0.9), 0 0 24px 4px rgba(255, 170, 80, 0.45); }

/* page annotations drawn over the stage, in the page's own voice */
.hud {
  position: absolute;
  z-index: 45;
  width: 268px;
  padding: 14px 16px 12px;
  border-radius: 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text);
  background: rgba(10, 10, 14, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 0 0 1px rgba(255, 190, 120, 0.28) inset, 0 20px 60px -16px rgba(0, 0, 0, 0.9), 0 0 50px -10px rgba(255, 150, 60, 0.35);
  opacity: 0;
}
.hud-h { display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 0.14em; font-size: 10px; color: var(--amber); margin-bottom: 10px; }
.hud-h::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px 2px rgba(255, 179, 92, 0.7); }
.hud-file { display: flex; justify-content: space-between; color: var(--text); margin-bottom: 10px; font-size: 12px; }
.hud-file span:last-child { color: var(--dim); }
.hud-row { display: grid; grid-template-columns: 92px 1fr 34px; align-items: center; gap: 8px; height: 20px; color: var(--muted); text-transform: uppercase; font-size: 10px; letter-spacing: 0.1em; }
.hud-row i { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden; position: relative; }
.hud-row i b { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, var(--violet), var(--amber)); transform-origin: 0 50%; }
.hud-row em { font-style: normal; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.hud-foot { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--hair); color: var(--dim); text-transform: uppercase; font-size: 10px; letter-spacing: 0.1em; }
.hud-foot b { color: var(--amber); font-weight: 500; }

.keycap {
  position: absolute;
  z-index: 45;
  min-width: 46px;
  height: 46px;
  padding: 0 12px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font: 500 18px/1 var(--mono);
  color: var(--text);
  background: linear-gradient(180deg, #2a2831, #17161c);
  box-shadow: 0 0 0 1px var(--hair-hi) inset, 0 4px 0 #050507, 0 0 30px -4px rgba(255, 179, 92, 0.5);
  opacity: 0;
}

.mm-layer { position: absolute; inset: 0; }
.hud-b { display: none; }
.hud-kv { display: flex; justify-content: space-between; align-items: center; height: 24px; color: var(--muted); text-transform: uppercase; font-size: 10px; letter-spacing: 0.1em; }
.hud-kv em { font-style: normal; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.hud-kv.hi { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--hair); color: var(--amber); }
.hud-kv.hi em { color: var(--amber); font-size: 16px; text-shadow: 0 0 14px rgba(255, 179, 92, 0.6); }
