/* Core simulation styles: device, shell, header, tab bar, sheets, toast, keyboard. Owner: core.
 * Tokens come from /site/css/tokens.css. Feature teams style their own screens in their own CSS files. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.try {
  font-family: var(--font);
  background:
    radial-gradient(900px 600px at 12% 8%, rgba(78,205,196,.14), transparent 60%),
    radial-gradient(800px 600px at 92% 90%, rgba(212,107,168,.10), transparent 60%),
    radial-gradient(700px 500px at 85% 10%, rgba(123,104,200,.10), transparent 60%),
    #F3EFF9;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
button { font-family: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input, textarea { font-family: inherit; }
img { -webkit-user-drag: none; }

/* ---------- Page around the frame (try page only) ---------- */
.try-brand { position: fixed; top: 22px; left: 26px; display: flex; align-items: center; gap: 10px; font: 800 18px/1 var(--font); letter-spacing: -.27px; color: var(--ink); text-decoration: none; z-index: 2; }
.try-brand img { border-radius: 9px; }
.try-note { position: fixed; bottom: 18px; left: 0; right: 0; margin: 0; text-align: center; font: 500 12px/1 var(--font); letter-spacing: .3px; color: var(--text-muted); pointer-events: none; }
.try-noscript { text-align: center; padding: 40px; }
html:not([data-sim-mode="frame"]) .try-brand, html:not([data-sim-mode="frame"]) .try-note { display: none; }
@media (max-width: 1000px) { .try-brand { top: 16px; left: 16px; font-size: 15px; } .try-brand img { width: 26px; height: 26px; } .try-note { bottom: 14px; } }
html[data-sim-mode="embed"] body.try { background: transparent; }

/* ---------- Device ---------- */
.dv { position: fixed; inset: 0; display: grid; place-items: center; }
.dv-sizer { position: relative; }
.dv--frame .dv-sizer { width: calc(425px * var(--dv-scale, 1)); height: calc(884px * var(--dv-scale, 1)); }
.dv--embed .dv-sizer { width: calc(393px * var(--dv-scale, 1)); height: calc(852px * var(--dv-scale, 1)); }
.dv--frame .dv-body, .dv--embed .dv-body { position: absolute; left: 0; top: 0; transform: scale(var(--dv-scale, 1)); transform-origin: 0 0; }
.dv--frame .dv-body {
  width: 425px; height: 884px; padding: 16px; border-radius: 71px;
  background: #0E0E10;
  box-shadow:
    inset 0 0 0 2.5px #B9B6BE, inset 0 0 0 3.5px #6E6B73, inset 0 0 0 5px #1C1C1F,
    0 40px 80px -20px rgba(42,37,64,.35), 0 18px 36px -12px rgba(42,37,64,.22);
}
.dv-btn { position: absolute; width: 4px; border-radius: 2px; background: linear-gradient(90deg, #8D8A92, #C9C6CE 60%, #9A97A0); }
.dv-btn--action { left: -3px; top: 132px; height: 32px; }
.dv-btn--volup { left: -3px; top: 190px; height: 62px; }
.dv-btn--voldown { left: -3px; top: 266px; height: 62px; }
.dv-btn--power { right: -3px; top: 220px; height: 98px; }

.dv-screen {
  --safe-top: 59px;
  --safe-bottom: 34px;
  --tabbar-h: calc(78px + var(--safe-bottom)); /* 1 border + 8 + 42 + 4 + 17.16 label + 2 + 4 */
  position: relative; width: 393px; height: 852px; overflow: hidden; isolation: isolate;
  border-radius: 55px; background: var(--bg);
  font: 400 15px/1.43 var(--font); letter-spacing: .25px; color: var(--text-2);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.dv-screen input, .dv-screen textarea { user-select: text; -webkit-user-select: text; }
.dv--embed .dv-screen { border-radius: 0; }
.dv--bleed .dv-sizer, .dv--bleed .dv-body { width: 100%; height: 100%; }
.dv--bleed { display: block; bottom: auto; height: 100%; }
.dv--bleed .dv-screen {
  --safe-top: max(env(safe-area-inset-top), 8px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  width: 100%; height: 100%; border-radius: 0;
  touch-action: pan-x pan-y;
}
/* Phones: the website's slim bar above the app (hidden with the keyboard up and on the turn-upright card) */
.dv--sitebar .dv-body { display: flex; flex-direction: column; }
.dv--sitebar .dv-screen { flex: 1 1 auto; height: auto; min-height: 0; --safe-top: 8px; }
.dv-site {
  flex: none; box-sizing: border-box; height: calc(40px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) max(6px, env(safe-area-inset-right, 0px)) 0 max(6px, env(safe-area-inset-left, 0px));
  display: flex; align-items: center; justify-content: space-between;
  background: #F8F5FC; border-bottom: .5px solid #E8E4F0;
  font: 600 14px/1 var(--font); letter-spacing: .1px; color: #2A2540;
  -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none;
}
.dv-site-back {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px; min-width: 44px; padding: 0 10px;
  color: inherit; text-decoration: none; border-radius: 12px; -webkit-tap-highlight-color: transparent;
}
.dv-site-back:active { background: rgba(42,37,64,.06); }
.dv-site-back:focus-visible { outline: 2px solid var(--primary); outline-offset: -4px; }
.dv-site-back svg { flex: none; color: #6B6580; }
.dv-site-demo { margin-right: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(42,37,64,.05); font: 500 12px/1 var(--font); letter-spacing: .2px; color: #6B6580; white-space: nowrap; }
.dv--sitebar.dv--kb .dv-site { display: none; }
.dv--sitebar.dv--kb .dv-screen { --safe-top: max(env(safe-area-inset-top), 8px); }
/* Native keyboard up (phones): the root is pinned to the visible area above it (keyboard.js). */
.dv-screen.kb-native { --safe-bottom: 0px; }
.kb-native .tabbar { display: none; }
.kb-native .tab-area { bottom: 0; }
.kb-native .toast-wrap.is-above-tabs { bottom: 10px; }
.kb-native .sh-body .sh-primary { position: sticky; bottom: 0; box-shadow: 0 -10px 14px 4px var(--surface); }
.dv-app { position: absolute; inset: 0; }
/* A phone held sideways */
.dv-rotate { position: absolute; inset: 0; z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--bg); color: var(--secondary); padding: 24px; text-align: center; }
.dv-rotate-ic { animation: dv-rotate 2.4s var(--ease-in-out-cubic) infinite; transform-origin: 32px 30px; }
.dv-rotate-title { margin: 0; font: 800 20px/1.25 var(--font); letter-spacing: -.3px; color: var(--ink); }
@keyframes dv-rotate { 0%, 30% { transform: rotate(-90deg); } 60%, 100% { transform: rotate(0deg); } }
html[data-sim-mode="bleed"], html[data-sim-mode="bleed"] body { overscroll-behavior: none; background: var(--bg); }

.dv-status { position: absolute; top: 0; left: 0; right: 0; height: 54px; z-index: 1000; pointer-events: none; color: #000; font-family: var(--font-system); }
.bars-light .dv-status { color: #fff; }
.dv-status-time { position: absolute; left: 0; width: 133px; top: 16px; text-align: center; font-size: 17px; line-height: 20px; font-weight: 600; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.dv-status-icons { position: absolute; right: 0; width: 133px; top: 16px; height: 20px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.dv-status-icons svg { fill: currentColor; display: block; }
.dv-island { position: absolute; top: 11px; left: 50%; width: 126px; height: 37px; margin-left: -63px; border-radius: 19px; background: #000; z-index: 1001; pointer-events: none; }
.dv-home { position: absolute; bottom: 8px; left: 50%; width: 134px; height: 5px; margin-left: -67px; border-radius: 2.5px; background: #000; z-index: 1000; pointer-events: none; }
.bars-light .dv-home { background: #fff; }

/* ---------- App layers ---------- */
.app { position: absolute; inset: 0; }
.is-navigating .app { pointer-events: none; }
.home { position: absolute; inset: 0; z-index: 0; background: var(--bg); }
.home-tabs { position: absolute; inset: 0; }
.tab-area { position: absolute; left: 0; right: 0; top: 0; bottom: var(--tabbar-h); --safe-bottom: 0px; }
.tab-pane { position: absolute; inset: 0; }
.tab-pane.is-hidden { visibility: hidden; }
.scr { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; }
.scr--pushed { box-shadow: -4px 0 18px rgba(0,0,0,.07); touch-action: pan-y; }
.scr--clear { background: transparent; box-shadow: none; }
.scr > * { flex: 1 1 auto; min-height: 0; }
/* Standard screen column + scroller for teams */
.scr-col { display: flex; flex-direction: column; height: 100%; min-height: 0; position: relative; }
.sim-scroll { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.sim-scroll::-webkit-scrollbar { display: none; }
.dv-screen :focus { outline: none; }
.dv-screen :focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }

/* ---------- Tab-screen header ---------- */
.hh { flex: none; display: flex; align-items: center; min-height: 44px; padding: calc(var(--safe-top) + 4px) var(--gutter) 0; box-sizing: content-box; }
.hh-left, .hh-right { flex: none; display: flex; align-items: center; }
.hh-center { flex: 1 1 auto; min-width: 0; display: flex; justify-content: center; }
.hh-right { justify-content: flex-end; }
.hh--hangout .hh-left { width: 64px; }   /* avatar 44 + DateModeHeaderBalance 10 + gap 10 */
.hh--hangout .hh-right { width: 64px; }  /* heart switch 64 */
.hh--no-toggle .hh-left, .hh--no-toggle .hh-right { width: 54px; }
.hh-right > * { animation: hh-in 220ms var(--ease-out); }
@keyframes hh-in { from { opacity: 0; } to { opacity: 1; } }
.hh--title .hh-title { flex: 1; margin: 0 0 0 10px; font: 800 22px/1.25 var(--font); letter-spacing: -.33px; color: var(--ink); }

.avatar-btn { width: 44px; height: 44px; padding: 0; border: 0; background: none; display: grid; place-items: center; border-radius: 50%; flex: none; }
.avatar-ring { width: 38px; height: 38px; padding: 2px; border-radius: 50%; background: var(--grad-avatar-ring); box-shadow: var(--sh-avatar); }
.avatar-ring img { display: block; width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }

.city-pill {
  display: inline-flex; align-items: center; min-height: 36px; max-width: 100%;
  padding: 6px 8px 6px 10px; border-radius: var(--r-full);
  background: rgba(255,255,255,.78); border: 1px solid rgba(78,205,196,.45);
  box-shadow: 0 3px 8px rgba(0,0,0,.04);
  transition: background-color 220ms var(--ease-out), border-color 220ms var(--ease-out);
  position: relative;
}
.city-pill::after { content: ""; position: absolute; inset: -4px -2px; } /* 44 px tap target around the 36 px pill */
.city-pill-ic { flex: none; color: var(--city-ink); }
.city-pill-label { margin: 0 2px 0 6px; font: 700 14px/1.2 var(--font); letter-spacing: 0; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Create FAB ---------- */
.fab-create { width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--grad-create-fab); box-shadow: 0 5px 22px rgba(78,205,196,.40); transition: opacity 200ms var(--ease-out), transform 100ms ease-in-out; }
.fab-create.is-floating { position: absolute; right: 16px; bottom: 14px; z-index: 5; }
.fab-create:active { transform: scale(.98); }
.fab-create.is-hidden { opacity: 0; pointer-events: none; }

/* ---------- AppBar (pushed screens) ---------- */
.appbar { flex: none; position: relative; display: flex; align-items: center; height: calc(56px + var(--safe-top)); padding-top: var(--safe-top); background: var(--bg); }
.appbar.is-clear { background: transparent; }
.appbar-lead { flex: none; width: 56px; display: flex; justify-content: center; }
.appbar-lead:empty { width: 0; }
.appbar-title { flex: 1 1 auto; min-width: 0; padding: 0 16px; font: 600 20px/1.4 var(--font); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar.is-center .appbar-title { position: absolute; left: 72px; right: 72px; bottom: 0; height: 56px; line-height: 56px; padding: 0; text-align: center; }
.appbar-actions { flex: none; display: flex; align-items: center; padding-right: 4px; margin-left: auto; }
.icon-btn { width: 48px; height: 48px; padding: 0; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; color: var(--ink); }
.icon-btn:active { background: rgba(42,37,64,.06); }

/* ---------- Tab bar ---------- */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--tabbar-h); z-index: 20;
  display: flex; padding: 8px 0 calc(4px + var(--safe-bottom));
  background: #fff; border-top: 1px solid rgba(123,104,200,.12); box-shadow: var(--sh-tabbar);
}
.tab { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; padding: 0; border: 0; background: none; min-height: 44px; }
.tab-ic { position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; }
.tab-ic .ic-tab { display: block; width: 30px; height: 30px; }
.tab-ic.tab-g-hangout { background: linear-gradient(90deg, rgba(78,205,196,.25), rgba(69,183,170,.25)); }
.tab-ic.tab-g-activity { background: linear-gradient(90deg, rgba(78,205,196,.25), rgba(123,104,200,.25)); }
.tab-ic.tab-g-chats { background: linear-gradient(90deg, rgba(91,141,239,.25), rgba(123,104,200,.25)); }
.tab-label { margin: 4px 0 2px; font: 600 12px/17.16px var(--font); /* inherits bodyMedium height 1.43 */ letter-spacing: .1px; color: var(--tab-inactive); }
.tab.is-active .tab-label { font-weight: 700; }
.tab.is-active:nth-child(1) .tab-label { color: var(--tab-hangout-a); }
.tab.is-active:nth-child(2) .tab-label { color: var(--tab-activity-a); }
.tab.is-active:nth-child(3) .tab-label { color: var(--tab-chats-a); }
.tab-badge { position: absolute; top: -4px; right: -8px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; border: 1.5px solid #fff; font: 700 9px/15px var(--font); letter-spacing: 0; color: #fff; text-align: center; }
.tab-badge.tab-g-hangout { background: linear-gradient(90deg, #4ECDC4, #45B7AA); }
.tab-badge.tab-g-activity { background: linear-gradient(90deg, #4ECDC4, #7B68C8); }
.tab-badge.tab-g-chats { background: linear-gradient(90deg, #5B8DEF, #7B68C8); }
.tab-pulse { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 1px #fff; }
.tab-pulse::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--primary); opacity: 0; animation: tab-pulse 1400ms linear infinite; }
@keyframes tab-pulse { from { transform: scale(.43); opacity: .7; } to { transform: scale(1); opacity: 0; } }

/* ---------- Sheets ---------- */
.sh-host { position: absolute; inset: 0; z-index: 500; pointer-events: none; }
.sh-host.is-open { pointer-events: auto; }
.sh { position: absolute; inset: 0; }
.sh[inert] .sh-scrim { pointer-events: none; }
.sh-scrim { position: absolute; inset: 0; background: #000; opacity: 0; }
.sh-panel {
  position: absolute; left: 0; right: 0; bottom: var(--kb, 0px);
  max-height: calc(100% - var(--safe-top) - var(--kb, 0px));
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  touch-action: none;
}
.sh-panel--action { border-radius: var(--r-action-sheet) var(--r-action-sheet) 0 0; }
.sh-grab { flex: none; display: flex; justify-content: center; padding: 10px 0 10px; margin-bottom: -10px; cursor: grab; touch-action: none; position: relative; z-index: 1; }
.sh-grab span { width: 36px; height: 4px; border-radius: 2px; background: var(--border); }
.sh-panel--action .sh-grab span { width: 38px; }
.sh-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 12px 20px calc(16px + var(--safe-bottom)); scrollbar-width: none; }
.sh-panel--action .sh-body { padding: 10px 12px calc(8px + var(--safe-bottom)); }
.sh-bare { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.sh-tile { width: 60px; height: 60px; margin: 8px auto 14px; border-radius: 18px; display: grid; place-items: center; background: color-mix(in srgb, var(--tile) 12%, transparent); }
.sh-title { margin: 0 0 8px; text-align: center; font: 700 20px/1.3 var(--font); letter-spacing: 0; color: var(--ink); }
.sh-text { margin: 0 0 18px; text-align: center; font: 400 14.5px/1.45 var(--font); letter-spacing: 0; color: var(--text-2); }
.sh-primary { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; padding: 0 20px; border: 0; border-radius: var(--r-button); background: var(--primary-dark); color: #fff; font: 700 16px/1.2 var(--font); transition: transform 100ms ease-in-out; }
.sh-primary:active { transform: scale(.98); }
.sh-primary.is-destructive { background: var(--error); }
.sh-primary:disabled { background: rgba(59,175,168,.32); }
.sh-quiet { display: block; width: 100%; height: 46px; margin-top: 6px; border: 0; background: none; font: 600 15px/1 var(--font); color: var(--text-2); }
.nr { display: flex; flex-direction: column; padding-top: 4px; }
.nr-actions { margin-top: 10px; }

/* ---------- Toast (ink snackbar) ---------- */
.toast-wrap { position: absolute; left: 15px; right: 15px; bottom: calc(var(--safe-bottom) + 10px); z-index: 450; pointer-events: none; }
.toast-wrap.is-above-tabs { bottom: calc(var(--tabbar-h) + 10px); }
.toast { pointer-events: auto; padding: 14px 16px; border-radius: 16px; background: var(--ink); color: #fff; box-shadow: var(--sh-snackbar); }
.toast--card { padding: 16px 16px 14px; }
.toast-row { display: flex; align-items: center; gap: 12px; }
.toast-ic { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #4ECDC4, #7B68C8); }
.toast-text { flex: 1 1 auto; min-width: 0; }
.toast-msg { font: 500 15px/1.43 var(--font); letter-spacing: .25px; }
.toast--card .toast-msg { font-weight: 700; }
.toast-sub { margin-top: 2px; font: 400 13px/1.35 var(--font); color: rgba(255,255,255,.72); }
.toast-action { flex: none; min-width: 44px; min-height: 44px; margin: -12px -8px -12px 0; padding: 0 8px; border: 0; background: none; font: 600 14px/1 var(--font); color: var(--primary-light); }
.toast-x { flex: none; width: 44px; height: 44px; margin: -10px -12px -10px -6px; padding: 0; border: 0; background: none; display: grid; place-items: center; color: rgba(255,255,255,.7); }
.toast-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 44px; margin-top: 14px; border: 0; border-radius: var(--r-full); background: var(--primary); color: var(--ink); font: 600 15px/1 var(--font); }

/* ---------- Fake iOS keyboard (frame + embed only) ---------- */
.kb { position: absolute; left: 0; right: 0; bottom: 0; height: 291px; z-index: 600; padding: 8px 3px 0; background: #D1D3D9; font-family: var(--font-system); }
.kb-row { display: flex; gap: 6px; height: 42px; margin-bottom: 11px; }
.kb-row--inset { padding: 0 18px; }
.kb-key { flex: 1 1 0; min-width: 0; height: 42px; padding: 0; border: 0; border-radius: 5px; background: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.3); display: grid; place-items: center; font-size: 22.5px; font-weight: 400; color: #000; touch-action: manipulation; }
.kb-key:active { background: #E6E7EA; }
.kb-mod { flex: 0 0 42px; background: #ABB0BA; font-size: 16px; }
.kb-mod.is-on { background: #fff; }
.kb-row:nth-child(3) .kb-mod:first-child { margin-right: 8px; }
.kb-row:nth-child(3) .kb-mod:last-child { margin-left: 8px; }
.kb-wide { flex: 1.3 1 0; }
.kb-fn { flex: 0 0 92px; }
.kb-space { flex: 1 1 auto; font-size: 16px; }
.kb-strip { position: absolute; left: 0; right: 0; bottom: 0; height: 74px; padding: 14px 24px 0; display: flex; justify-content: space-between; align-items: flex-start; color: #50555C; }

/* ---------- Placeholders + core demo ---------- */
.ph { padding: 24px var(--gutter); }
.ph-card { padding: 32px 20px; border: 1.5px dashed var(--border); border-radius: 16px; background: rgba(255,255,255,.6); text-align: center; }
.ph-title { font: 800 20px/1.25 var(--font); letter-spacing: -.3px; color: var(--ink); }
.ph-note { margin-top: 6px; font: 400 13px/1.33 var(--font); letter-spacing: .4px; color: var(--text-muted); }
.demo { padding: 4px 16px 40px; }
.demo-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; margin-bottom: 8px; padding: 0 14px; border: 0; border-radius: 14px; background: #fff; color: var(--ink); font: 600 15px/1.2 var(--font); text-align: left; }
.demo-row span { flex: 1; }
.demo-row .ic { color: var(--primary-dark); }
.demo-field { display: block; margin-top: 16px; }
.demo-field input { display: block; width: 100%; height: 48px; margin-top: 6px; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; font: 400 16px/1.5 var(--font); color: var(--ink); }
.demo-area { display: block; width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); font: 400 16px/1.4 var(--font); color: var(--ink); resize: none; }
.demo-field input:focus { border: 1.5px solid var(--primary); outline: none; }

.ic { display: block; flex: none; }

@media (prefers-reduced-motion: reduce) {
  .tab-pulse::after { animation: none; opacity: 0; }
  .fab-create, .city-pill { transition: none; }
  .dv-rotate-ic { animation: none; }
  .hh-right > * { animation: none; }
}

