/* Mobile / iPad: the Locket canvas fills the visual viewport, without a studio shell. */
.native-only { display: none; }
.friend-picker-sheet { position: absolute; inset: 0; z-index: 90; display: flex; flex-direction: column; padding: 8px 10px 14px; border-radius: 28px 28px 0 0; background: #242424; color: #f5f5f5; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(100%); transition: transform .25s ease, opacity .2s, visibility .2s; }
.friend-picker-sheet.open { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
.friend-picker-handle { display: grid; place-items: center; flex: 0 0 17px; width: 100%; border: 0; background: transparent; cursor: pointer; }
.friend-picker-handle span { width: 27px; height: 3px; border-radius: 5px; background: #626262; }
.friend-search { display: flex; align-items: center; flex: 0 0 44px; gap: 9px; margin: 5px 0 18px; padding: 0 15px; border-radius: 99px; background: #3b3b3b; color: #a2a2a2; }
.friend-search i { font-size: 20px; }
.friend-search input { width: 100%; min-width: 0; height: 44px; border: 0; outline: none; background: transparent; color: white; font-size: 16px; font-weight: 700; }
.friend-search input::placeholder { color: #a2a2a2; }
.friend-add-toggle { flex: 0 0 28px; width: 28px; height: 32px; border: 0; background: transparent; color: #aaa; cursor: pointer; }
.friend-add-form { flex-shrink: 0; padding: 4px 10px 14px; color: #bbb; font-size: 13px; }
.friend-add-form[hidden] { display: none; }
.friend-add-form > div { display: flex; gap: 8px; margin-top: 8px; }
.friend-add-form input { min-width: 0; width: 100%; padding: 9px 12px; border: 1px solid #505050; border-radius: 12px; background: #333; color: white; font-size: 16px; }
.friend-add-form button { padding: 8px 12px; border: 0; border-radius: 12px; background: #ffb800; color: #111; font-weight: 800; white-space: nowrap; cursor: pointer; }
.friend-add-form p { margin: 8px 0 0; }
.friend-picker-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-content: start; flex: 1; min-height: 0; gap: 20px 8px; overflow-y: auto; padding: 4px 4px 20px; overscroll-behavior: contain; }
.friend-picker-person { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; padding: 3px; border: 0; border-radius: 16px; background: transparent; color: #f4f4f4; cursor: pointer; }
.friend-picker-avatar { position: relative; display: grid; place-items: center; width: 64px; height: 64px; border: 3px solid transparent; border-radius: 50%; background: #393939; font-size: 24px; font-weight: 800; }
.friend-picker-avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.friend-picker-person[aria-pressed="true"] .friend-picker-avatar { border-color: #ffb800; }
.friend-picker-person[aria-pressed="true"] .friend-picker-avatar::after { content: '✓'; position: absolute; right: -3px; bottom: -3px; display: grid; place-items: center; width: 21px; height: 21px; border: 2px solid #242424; border-radius: 50%; background: #ffb800; color: black; font-size: 13px; }
.friend-picker-name { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 800; text-align: center; }
.friend-picker-empty { grid-column: 1 / -1; padding: 40px 16px; color: #999; font-size: 15px; text-align: center; }
.friend-picker-done { flex-shrink: 0; min-height: 42px; margin: 8px 8px 0; border: 0; border-radius: 99px; background: #ffb800; color: #111; font-weight: 800; cursor: pointer; }

@media (max-width: 1024px), (pointer: coarse) {
  :root[data-profile-theme] { --locket-gold: #ffb800; }
  html, body { width: 100%; height: 100%; min-height: 0; overflow: hidden; background: #000; color: #f5f5f5; overscroll-behavior: none; }
  body { position: fixed; inset: 0; }
  body, body * { font-family: var(--locket-font-family); }
  .app-shell, .layout-dashboard, .workspace, .workspace-grid, .preview-panel, .locket-stage { position: relative; display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; max-width: none; max-height: none; margin: 0; padding: 0; overflow: hidden; border: 0; border-radius: 0; background: #000; box-shadow: none; }
  .app-shell { height: var(--locket-viewport-height, 100dvh); }
  .menu-nav, .top-header, .workspace-heading, .studio-inspector, .preview-panel > .panel-heading, .preview-footer, .skip-link { display: none; }
  .locket-phone-card { display: block; flex: none; width: 100%; max-width: none; height: 100%; min-height: 0; max-height: none; margin: 0; overflow: clip; border: 0; border-radius: 0; background: #000; box-shadow: none; }
  .phone-screen { overflow: clip; background: var(--locket-ui-bg); transform: translate3d(0,0,0); transition: opacity .22s ease, visibility .22s; }
  .phone-screen.active { transform: translate3d(0,0,0); }
  .phone-screen, .history-view-layer { min-height: 0; }
  .native-only { display: block; }
  .locket-top-bar, .history-top-bar { position: absolute; top: env(safe-area-inset-top,0px); left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 10px 16px; background: linear-gradient(#000b,transparent); }
  .locket-avatar-btn, .locket-circle-icon { width: clamp(34px,7.7vw,52px); height: clamp(34px,7.7vw,52px); border: 0; background: #303030; box-shadow: none; }
  .locket-avatar-btn { border: 4px solid #252525; font-size: 15px; }
  .locket-friends-pill { position: absolute; left: 50%; transform: translateX(-50%); justify-content: center; gap: 7px; max-width: 68%; min-height: 38px; padding: 8px 15px; border: 0; border-radius: 99px; background: #333; color: #f7f7f7; box-shadow: none; font-size: clamp(15px,2.6vw,21px); font-weight: 800; white-space: nowrap; }
  .locket-friends-pill:hover, .locket-friends-pill:active { transform: translateX(-50%); background: #3a3a3a; }
  .locket-friends-pill > .camera-recipient-icon { display: none; }
  .locket-friends-pill > svg { width: 13px; height: 13px; }
  .locket-top-bar > .locket-circle-icon, .history-top-bar > .locket-circle-icon { margin-left: auto; }
  .locket-circle-icon > svg { width: 23px; height: 23px; }
  .unread-badge { border-color: #000; }

  /* Camera uses the same full screen square-media layout as the history feed. */
  .camera-screen-inner { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: calc(68px + env(safe-area-inset-top,0px)) 12px calc(164px + env(safe-area-inset-bottom,0px)); }
  .camera-screen-inner .locket-viewfinder { width: min(100%,calc(var(--locket-viewport-height,100dvh) - 272px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))); max-width: none; aspect-ratio: 1; border: 0; border-radius: clamp(28px,13vw,76px); background: #161616; box-shadow: none; }
  .camera-screen-inner .locket-bottom-bar { position: absolute; left: 0; right: 0; bottom: calc(76px + env(safe-area-inset-bottom,0px)); display: flex; justify-content: space-between; align-items: center; height: 68px; min-height: 0; margin: 0; padding: 0 clamp(28px,8vw,70px); }
  .locket-side-action { width: 44px; height: 44px; border: 0; background: transparent; color: #c9c9c9; border-radius: 50%; }
  .locket-shutter-ring, .locket-shutter-ring.send-mode { width: 64px; height: 64px; padding: 4px; border: 3px solid #ffb800; background: #000; box-shadow: none; }
  .locket-shutter-inner, .locket-shutter-ring.send-mode .locket-shutter-inner { background: #fff; color: #111; }
  .locket-shutter-ring.send-mode .locket-shutter-inner svg { color: #111; }
  .locket-history-trigger { position: absolute; bottom: calc(14px + env(safe-area-inset-bottom,0px)); left: 50%; transform: translateX(-50%); min-height: 40px; margin: 0; padding: 8px 15px; font-size: 14px; font-weight: 800; }
  .caption-pill-overlay { min-height: 32px; padding: 5px 14px; bottom: 14px; font-size: 16px; font-weight: 800; }
  .phone-toast { z-index: 95; bottom: calc(118px + env(safe-area-inset-bottom,0px)); font-size: 14px; }

  /* One snapped moment per screen, metadata below its square image. */
  .history-feed-scroll { height: 100%; overscroll-behavior: contain; }
  .moment-feed-slide { gap: 9px; justify-content: center; padding: calc(68px + env(safe-area-inset-top,0px)) 12px calc(132px + env(safe-area-inset-bottom,0px)); }
  .feed-media-card { width: min(100%,calc(var(--locket-viewport-height,100dvh) - 240px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))); max-width: none; margin: 0; border-radius: clamp(28px,13vw,76px); background: #181818; box-shadow: none; }
  .feed-sender-row { gap: 6px; flex-shrink: 0; padding: 0; }
  .feed-sender-avatar { width: 24px; height: 24px; }
  .feed-sender-name, .feed-sender-time { font-size: clamp(15px,2.5vw,21px); font-weight: 800; }
  .feed-sender-time { color: #777; font-weight: 800; }
  .feed-caption-pill { bottom: 14px; padding: 5px 14px; font-size: 16px; font-weight: 800; box-shadow: none; }
  .feed-bottom-chrome { bottom: 0; gap: 8px; padding: 8px 16px calc(10px + env(safe-area-inset-bottom,0px)); background: var(--locket-ui-bg); border-top: 1px solid var(--locket-ui-border); box-shadow: 0 -8px 22px color-mix(in srgb,var(--locket-ui-bg) 72%,transparent); }
  .feed-own-activity-pill { height: 36px; padding: 0 14px; background: var(--locket-ui-card); color: var(--locket-ui-muted); border: 1px solid var(--locket-ui-border); font-size: 14px; font-weight: 800; }
  .feed-bottom-nav { padding: 0 6px; }
  .feed-nav-icon-btn { width: 40px; height: 40px; font-size: 25px; color: #b7b7b7; }
  .feed-center-shutter, .history-bottom-shutter { width: 60px; height: 60px; padding: 3px; border: 3px solid #ffb800; background: #000; box-shadow: none; }
  .feed-center-shutter-inner, .history-bottom-shutter-inner { background: #fff; }
  .feed-reply-pill { height: 42px; padding: 0 7px 0 16px; border: 1px solid var(--locket-ui-border); background: var(--locket-ui-card); box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .feed-reply-input { font-size: 16px; font-weight: 800; }
  .feed-quick-emoji { padding: 4px; font-size: 23px; }
  .feed-more-emoji-btn { width: 34px; font-size: 24px; color: var(--locket-ui-muted); }
  .history-grid-scroll { padding: 0 2px calc(78px + env(safe-area-inset-bottom,0px)); overscroll-behavior: contain; }
  .history-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 3px; }
  .history-cell { border: 0; border-radius: clamp(16px,5vw,30px); background: #181818; animation: none; }
  .history-cell:hover, .history-cell:hover img { transform: none; box-shadow: none; }
  .history-bottom-shutter { bottom: calc(12px + env(safe-area-inset-bottom,0px)); }
  .friends-filter-dropdown { top: calc(66px + env(safe-area-inset-top,0px)); left: 50%; right: auto; width: min(360px,calc(100% - 60px)); max-height: min(430px,65%); border: 0; border-radius: 17px; background: #505050; box-shadow: 0 16px 40px #0004; transform: translate(-50%,-8px); backdrop-filter: none; }
  .friends-filter-dropdown.open { transform: translate(-50%,0); }
  .ff-item, .ff-item:hover, .ff-item.active { min-height: 47px; padding: 9px 12px; border-color: #303030; background: transparent; }
  .ff-item:hover { background: #5c5c5c; }
  .ff-item .friend-row-avatar { width: 28px; height: 28px; }
  .ff-item .friend-row-name { font-size: 16px; font-weight: 800; }
  .ff-chevron { color: #bcbcbc; font-size: 27px; }

  /* Inbox and shared moment replies. */
  .messages-header, .chat-thread-panel .messages-header { height: calc(58px + env(safe-area-inset-top,0px)); padding: calc(8px + env(safe-area-inset-top,0px)) 14px 8px; gap: 10px; background: #000; border: 0; backdrop-filter: none; }
  .msg-back-btn { width: 30px; height: 32px; background: transparent; border: 0; border-radius: 0; color: #f5f5f5; }
  .messages-title { font-size: 21px; font-weight: 800; color: #f5f5f5; }
  .conversations-scroll { min-height: 0; gap: 0; padding: 0 12px calc(82px + env(safe-area-inset-bottom,0px)); overscroll-behavior: contain; }
  .conv-row { min-height: 67px; gap: 10px; padding: 9px 0; border: 0; border-radius: 0; background: transparent; animation: none; }
  .conv-row:hover { background: #111; transform: none; }
  .conv-avatar { width: clamp(44px,9vw,64px); height: clamp(44px,9vw,64px); border: 3px solid #282828; background: #242424; font-size: 18px; }
  .conv-name { color: #e9e9e9; font-size: clamp(16px,2.6vw,21px); font-weight: 800; }
  .conv-time { font-size: clamp(12px,2.2vw,17px); color: #858585; font-weight: 800; }
  .conv-preview { font-size: clamp(15px,2.4vw,19px); font-weight: 800; color: #858585; }
  .conv-row.unread .conv-preview { color: #f0f0f0; }
  .msg-compose-fab { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom,0px)); width: 54px; height: 54px; color: #000; background: #ffb800; box-shadow: none; }
  .chat-thread-panel { background: #000; }
  #chatPeerAvatar { width: 32px; height: 32px; }
  #chatPeerName { font-size: 19px; }
  .chat-messages-box { min-height: 0; padding: 8px 8px 14px; gap: 6px; background: #000; overscroll-behavior: contain; }
  .chat-time-divider { margin: 20px 0 10px; color: #777; font-size: 12px; font-weight: 800; }
  .chat-moment-card { width: 100%; margin: 4px 0; border-radius: clamp(26px,6vw,44px); background: #181818; box-shadow: none; }
  .chat-moment-owner-pill { top: 14px; left: 14px; gap: 6px; padding: 5px 10px 5px 5px; background: #333c; }
  .chat-moment-owner-avatar { width: 22px; height: 22px; }
  .chat-moment-owner-name { font-size: 14px; font-weight: 800; }
  .chat-moment-caption-pill { bottom: 12px; padding: 4px 12px; font-size: 16px; font-weight: 800; }
  .chat-bubble { padding: 8px 14px; border-radius: 24px; font-size: 16px; line-height: 1.4; font-weight: 800; }
  .chat-bubble-row.me .chat-bubble { background: #e9e9e9; color: #111; font-weight: 800; }
  .chat-bubble-row.peer .chat-bubble { background: #333; color: #f5f5f5; font-weight: 800; }
  .chat-peer-mini-avatar { width: 25px; height: 25px; }
  .chat-input-bar { flex-shrink: 0; padding: 8px 14px calc(8px + env(safe-area-inset-bottom,0px)); background: #000; }
  .chat-input-pill-wrap { height: 47px; padding: 0 10px 0 16px; gap: 4px; background: #333; }
  .chat-text-input { font-size: 16px; font-weight: 800; }
  .chat-text-input::placeholder { color: #a6a6a6; font-weight: 800; }

  /* Searchable three-column friends sheet and nine-column emoji sheet. */
  .friend-picker-sheet { padding: calc(8px + env(safe-area-inset-top,0px)) 8px calc(10px + env(safe-area-inset-bottom,0px)); border-radius: 28px 28px 0 0; }
  .friend-search { margin: 6px 0 18px; min-height: 44px; }
  .friend-picker-grid { gap: 25px 8px; padding-top: 5px; }
  .friend-picker-avatar { width: clamp(60px,15vw,116px); height: clamp(60px,15vw,116px); }
  .friend-picker-name { font-size: clamp(15px,2.7vw,21px); font-weight: 800; }
  .emoji-picker-sheet { height: min(82%,760px); padding: 12px 8px calc(60px + env(safe-area-inset-bottom,0px)); border: 0; border-radius: 17px 17px 0 0; background: #242424; box-shadow: 0 -14px 40px #0003; }
  .emoji-picker-sheet .detail-locket-circle-icon { display: none; }
  .emoji-search-input { height: 40px; padding: 0 14px; border-radius: 99px; background: #3b3b3b; font-size: 16px; font-weight: 600; }
  .emoji-cat-title { margin: 11px 4px 12px; color: #aaa; font-size: 13px; }
  .emoji-grid-9 { grid-template-columns: repeat(9,minmax(0,1fr)); gap: 4px; }
  .emoji-cell-btn { padding: 0; font-family: 'Apple Color Emoji','Segoe UI Emoji',sans-serif; font-size: clamp(23px,5.7vw,44px); }
  .emoji-cat-dock { bottom: calc(10px + env(safe-area-inset-bottom,0px)); height: 31px; max-width: 94%; gap: 2px; padding: 0 5px; border: 0; border-radius: 8px; background: #3b3b3b; box-shadow: none; }
  .emoji-dock-btn { flex: 1 1 0; min-width: 0; width: clamp(22px,6vw,30px); height: 28px; font-size: 16px; }

  /* Account page uses clean padded cards & breathing room on left/right edges. */
  .locket-profile-scroll {
    gap: 12px;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 18px calc(56px + env(safe-area-inset-bottom, 0px));
    background: #000;
    overscroll-behavior: contain;
    box-sizing: border-box;
  }
  .lp-top-bar { height: 36px; padding: 0 2px; flex-shrink: 0; }
  .lp-close-arrow { font-size: 22px; color: #a1a1aa; }
  .lp-hero { gap: 5px; margin: -8px 0 4px; padding: 0 12px 4px; flex-shrink: 0; }
  .lp-hero .lp-avatar-ring { width: 88px; height: 88px; padding: 3px; border: 3px solid #ffb800; }
  .lp-user-name { margin-top: 4px; color: #f4f4f5; font-size: 21px; font-weight: 800; }
  .lp-edit-photo-btn { color: #ffb800; font-size: 13.5px; font-weight: 800; margin-top: 2px; }
  .lp-gold-banner {
    flex-shrink: 0;
    min-height: 62px;
    margin: 2px 0;
    padding: 14px 16px;
    gap: 14px;
    border: 1px solid rgba(255, 184, 0, 0.24);
    border-radius: 20px;
    background: linear-gradient(135deg, #332b19 0%, #241e12 100%);
  }
  .lp-gold-banner .lp-perk-icon { width: 36px; height: 36px; background: rgba(255, 184, 0, 0.16); color: #fbbf24; font-size: 20px; border-radius: 12px; }
  .lp-gold-banner .detail-div-4 { color: #fde68a; font-size: 15.5px; font-weight: 800; }
  .lp-gold-banner .detail-div-5 { color: #d6d3d1; font-size: 13px; font-weight: 600; margin-top: 2px; }
  .lp-gold-perks-grid { flex-shrink: 0; gap: 8px; }
  .lp-theme-grid { flex-shrink: 0; gap: 8px; }
  .lp-card-group {
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    background: #16171b;
  }
  .lp-card-row { min-height: 58px; padding: 13px 16px; border-color: rgba(255, 255, 255, 0.06); }
  .lp-card-row .detail-div-7 { font-size: 15px; font-weight: 800; }
  .lp-card-row .detail-div-8, .lp-card-row .detail-lp-invite-link-text { font-size: 13px; font-weight: 600; }
  .lp-dashed-gold-btn { width: 38px; height: 38px; padding: 0; border-radius: 12px; border: 1.5px solid rgba(255, 184, 0, 0.38); background: rgba(255, 184, 0, 0.10); color: #ffb800; }
  .lp-sec-heading { margin: 10px 4px 2px; color: #f4f4f5; font-size: 15.5px; font-weight: 800; flex-shrink: 0; }
  .profile-preferences, .profile-account-links {
    padding: 6px 14px;
    border-radius: 20px;
    background: #16171b;
    border: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
  }
  .lp-menu-item {
    min-height: 54px;
    padding: 10px 4px;
    border-radius: 12px;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  }
  .lp-menu-item:last-child { border-bottom: none; }
  .lp-menu-item:hover { padding-left: 6px; background: rgba(255, 255, 255, 0.04); }
  .lp-menu-left { gap: 12px; min-width: 0; flex: 1; }
  .lp-menu-left > div { min-width: 0; }
  .lp-menu-sub { overflow-wrap: anywhere; }
  .lp-menu-icon { color: #d4d4d8; font-size: 20px; width: 28px; }
  .lp-menu-title { color: #f4f4f5; font-size: 15px; font-weight: 700; }
  .lp-menu-sub { margin-top: 2px; color: #9ca3af; font-size: 12.5px; font-weight: 600; }
  .lp-toggle { width: 46px; height: 26px; background: #ffb800; flex-shrink: 0; margin-left: 6px; }
  .lp-toggle-knob { width: 20px; height: 20px; }
  .profile-overview {
    margin: 0;
    padding: 6px 14px;
    border-radius: 20px;
    background: #16171b;
    border: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
  }
  .profile-overview > .lp-sec-heading { margin: 6px 2px 4px; font-size: 14px; color: #a1a1aa; }
  .profile-overview .lp-menu-item { align-items: center; }
  .locket-side-drawer { bottom: 0; left: 0; right: 0; max-height: 86%; padding-bottom: calc(18px + env(safe-area-inset-bottom,0px)); border-radius: 25px 25px 0 0; background: #242424; }
  .moment-activity-sheet { max-height: 82%; border-radius: 26px 26px 0 0; background: #1c1d22; }
  .modal-card-9p { background: #242424; color: #f4f4f4; }
  .nx-input { font-size: 16px; }
}
