/* Watch Sim — simulator page chrome (everything outside the watch screen). */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0b0b0d; color: #f2f2f7; }
body {
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter Variable", Inter, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }

.sim {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: radial-gradient(90% 60% at 50% 45%, #1d1e24 0%, #0b0b0d 70%);
}
.sim-side { display: contents; }

/* header */
.sim-bar { order: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px 6px; }
.sim-brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.sim-brand > div { min-width: 0; }
.sim-brand b { display: block; font-size: 16px; letter-spacing: -.01em; }
.sim-brand small { display: block; font-size: 11.5px; color: #8e8e93; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-logo { width: 22px; height: 28px; border-radius: 8px; border: 2px solid #8e8e93; position: relative; flex: none; }
.sim-logo::after { content: ""; position: absolute; inset: 7px 5px; border-radius: 50%; background: #FF9F0A; }
.sim-notesbtn { flex: none; border: 0; border-radius: 999px; padding: 9px 14px; min-height: 40px; background: #0A84FF; color: #fff; font-weight: 600; font-size: 14px; }
.sim-notesbtn:active { filter: brightness(1.15); }

/* segmented controls */
.sim-controls { order: 1; padding: 2px 12px 4px; display: flex; flex-direction: column; gap: 7px; }
.sim-seg { display: flex; background: #1c1c1f; border-radius: 11px; padding: 3px; gap: 2px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.sim-seg button { flex: 1; border: 0; background: none; border-radius: 8px; min-height: 38px; padding: 0 6px; font-size: 14px; font-weight: 500; color: #c7c7cc; white-space: nowrap; }
.sim-seg button.on { background: #3a3a3f; color: #fff; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.sim-row2 { display: flex; gap: 7px; }
.sim-sizes { flex: 3; }
.sim-zooms { flex: 2; }

/* stage */
.sim-stage { order: 2; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 6px 0; overflow: hidden; }
.watch-scaler { position: relative; flex: none; }
.watch { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.watch.buzz { animation: sim-buzz .18s linear; }
.watch.buzz-long { animation: sim-buzz .18s linear 2; }
@keyframes sim-buzz { 0%,100% { translate: 0 0; } 25% { translate: -0.8px 0; } 75% { translate: 0.8px 0; } }

/* info block (screen ID + demo triggers) */
.sim-info { order: 3; padding: 4px 12px 10px; }
.sim-id { display: flex; align-items: center; gap: 8px; background: #1c1c1f; border-radius: 12px; padding: 6px 6px 6px 12px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.sim-idlabel { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #8e8e93; }
.sim-id b { font: 600 15px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: #FF9F0A; letter-spacing: .02em; }
.sim-title { flex: 1; min-width: 0; color: #d1d1d6; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-copy { border: 0; background: #3a3a3f; border-radius: 8px; min-height: 34px; padding: 0 12px; font-size: 13px; font-weight: 600; }
.sim-copy.ok { background: #30D158; color: #000; }
.sim-demos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.sim-demos:empty { display: none; }
.sim-demos button { border: 0; border-radius: 999px; min-height: 36px; padding: 0 13px; background: #26262b; color: #fff; font-size: 13px; font-weight: 500; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.sim-demos button::before { content: "▶ "; color: #FF9F0A; font-size: 10px; }
.sim-hint { margin: 7px 2px 0; font-size: 12px; color: #8e8e93; text-align: center; }

/* ---------- the watch ---------- */
.band { position: absolute; left: 50%; transform: translateX(-50%); border-radius: 18px; background: linear-gradient(90deg, #17181a, #2a2b2f 30%, #2a2b2f 70%, #17181a); }
.band-top { top: 0; -webkit-mask-image: linear-gradient(to top, #000 40%, transparent); mask-image: linear-gradient(to top, #000 40%, transparent); border-radius: 18px 18px 0 0; }
.band-bot { bottom: 0; -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent); mask-image: linear-gradient(to bottom, #000 40%, transparent); border-radius: 0 0 18px 18px; }
.watch[data-size="49"] .band { background: linear-gradient(90deg, #a5480f, #e8661a 30%, #e8661a 70%, #a5480f); }

.case {
  position: absolute;
  background: linear-gradient(150deg, #4a4b51 0%, #232428 35%, #17181b 60%, #3c3d42 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), inset 0 1.5px 2px rgba(255,255,255,.18), 0 18px 40px rgba(0,0,0,.65), 0 3px 8px rgba(0,0,0,.5);
}
.watch[data-size="49"] .case {
  background: linear-gradient(150deg, #e9e5dd 0%, #a9a49b 35%, #8c877f 60%, #d4cfc6 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35), inset 0 2px 3px rgba(255,255,255,.45), 0 18px 40px rgba(0,0,0,.65), 0 3px 8px rgba(0,0,0,.5);
}
.bezel { position: absolute; background: #050506; box-shadow: inset 0 0 0 1px rgba(255,255,255,.07), 0 0 0 0.6px rgba(0,0,0,.6); }
.watch[data-size="49"] .bezel { box-shadow: 0 0 0 2.5px #b7b2a9, 0 0 0 3.2px rgba(0,0,0,.25), inset 0 0 0 1px rgba(255,255,255,.06); }
.bezel .wk-host { position: absolute; overflow: hidden; isolation: isolate; }
.glass { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 10;
  background: linear-gradient(155deg, rgba(255,255,255,.07) 0%, rgba(255,255,255,0) 28%, rgba(255,255,255,0) 100%); }

.crown {
  position: absolute; border: 0; padding: 0;
  border-radius: 3px 5px 5px 3px;
  background-color: #2c2d31;
  background-image: repeating-linear-gradient(to bottom, rgba(255,255,255,.28) 0 1px, rgba(0,0,0,.35) 1px 2.2px);
  box-shadow: inset -1.5px 0 2px rgba(0,0,0,.5), inset 1px 0 1px rgba(255,255,255,.15), 1px 1px 2px rgba(0,0,0,.6);
  touch-action: none; cursor: ns-resize;
}
.crown::after { content: ""; position: absolute; right: -1px; top: 18%; bottom: 18%; width: 2px; border-radius: 1px; background: rgba(255,255,255,.12); }
.watch[data-size="49"] .crown { background-color: #9b968e; background-image: repeating-linear-gradient(to bottom, rgba(255,255,255,.55) 0 1px, rgba(0,0,0,.28) 1px 2.4px); }
.side-btn {
  position: absolute; border: 0; padding: 0; border-radius: 2px 4px 4px 2px;
  background: linear-gradient(90deg, #1d1e21, #3a3b40 60%, #26272a);
  box-shadow: 1px 1px 2px rgba(0,0,0,.6);
}
.watch[data-size="49"] .side-btn { background: linear-gradient(90deg, #8d887f, #d5d0c7 60%, #a39e95); }
.crown:active, .side-btn:active { filter: brightness(1.3); }
.action-btn { display: none; position: absolute; border-radius: 4px 2px 2px 4px; background: linear-gradient(90deg, #c94f0a, #ff7a1a 60%, #e5620f); box-shadow: -1px 1px 2px rgba(0,0,0,.5); }
.watch[data-size="49"] .action-btn { display: block; }
/* Ultra crown guard */
.watch[data-size="49"] .case::after { content: ""; position: absolute; right: -4px; top: var(--guard-top); height: var(--guard-h); width: 6px; border-radius: 0 6px 6px 0; background: linear-gradient(90deg, #9d988f, #d8d3ca); z-index: -1; }

/* ---------- notes dialog ---------- */
.sim-notes {
  width: min(560px, calc(100vw - 20px)); max-height: calc(100dvh - 30px);
  border: 0; border-radius: 18px; padding: 18px 18px 22px;
  background: #1c1c1f; color: #f2f2f7; box-shadow: 0 30px 80px rgba(0,0,0,.7), inset 0 0 0 1px rgba(255,255,255,.08);
}
.sim-notes::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.sim-notes h2 { margin: 0 40px 10px 0; font-size: 21px; }
.sim-notes h3 { margin: 18px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #8e8e93; }
.sim-notes-close { position: sticky; top: 0; float: right; margin: -6px -6px 0 0; z-index: 2; }
.sim-notes-close button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #3a3a3f; font-size: 17px; }
.sim-steps { margin: 0; padding-left: 22px; }
.sim-steps li { margin: 0 0 9px; }
.sim-quote { display: inline-block; margin-top: 4px; padding: 6px 10px; border-radius: 12px 12px 12px 4px; background: #2c2c30; color: #fff; }
.sim-notes code { font: 600 14px ui-monospace, "SF Mono", Menlo, monospace; color: #FF9F0A; }
.sim-list { margin: 0; padding-left: 18px; color: #d1d1d6; }
.sim-list li { margin-bottom: 5px; }
.sim-p { margin: 0; color: #d1d1d6; }
.sim-index h4 { margin: 12px 0 6px; font-size: 14px; }
.sim-index div { display: flex; flex-wrap: wrap; gap: 6px; }
.sim-index button { border: 0; border-radius: 10px; min-height: 36px; padding: 4px 10px; background: #2c2c30; font-size: 13px; text-align: left; }
.sim-index button b { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: #FF9F0A; margin-right: 5px; }

/* ---------- wide screens: controls in a left column ---------- */
@media (min-width: 900px) {
  .sim { flex-direction: row; height: 100vh; }
  .sim-side { display: flex; flex-direction: column; width: 360px; flex: none; padding: 14px 6px 14px 14px; gap: 6px; }
  .sim-bar { padding: 4px 4px 8px; }
  .sim-controls { padding: 0; gap: 8px; }
  .sim-info { padding: 6px 0 0; }
  .sim-hint { text-align: left; }
  .sim-stage { padding: 20px; }
}
@media (max-width: 370px) {
  .sim-seg button { font-size: 13px; padding: 0 3px; }
  .sim-brand small { display: none; }
}
