/* Shared by every look preview (chat/looks.py). Each look file colours and
   shapes these parts its own way; this file removes the Apple- and
   Meta-shaped parts and supplies Molo's own: icons drawn as masks (so a look
   picks the colour), the bubble tail, receipts as words, and the Molo mark on
   the keyboard and the lock screen. Loaded after the editor's own stylesheets.
   Nothing here changes a size that wrapping, scrolling or timing depends on. */
:root[data-look] {
  /* Signal bars and Wi-Fi in one strip */
  /* A plain battery: soft outline, three-quarters full */
  --look-ico-back: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 16' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2.5 2.5 8 8 13.5M3 8h16.5'/%3E%3C/svg%3E");
  /* A film camera with two reels */
  --look-ico-video: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 20' fill='none' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'%3E%3Ccircle cx='6.5' cy='5' r='3.6'/%3E%3Ccircle cx='14' cy='5' r='3.6'/%3E%3Crect x='2.5' y='9.5' width='15' height='8.5' rx='1.4'/%3E%3Cpath d='M17.5 12.2 23.5 9.6v8.2l-6-2.6z'/%3E%3C/svg%3E");
  /* A classic telephone handset, same stroke as the camera */
  --look-ico-call: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linejoin='round'%3E%3Cpath d='M5.2 3.2h3.1c.5 0 .9.3 1 .8l.8 3.4c.1.4 0 .9-.4 1.2L8 10.1c1.3 2.6 3.3 4.6 5.9 5.9l1.5-1.7c.3-.4.8-.5 1.2-.4l3.4.8c.5.1.8.5.8 1v3.1c0 1-.8 1.8-1.8 1.8C10.4 20.6 3.4 13.6 3.4 5c0-1 .8-1.8 1.8-1.8z'/%3E%3C/svg%3E");
  /* Molo's mark: their bubble (one line) behind mine (filled) */
  --look-ico-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 92'%3E%3Cpath d='M7.16 60C12.44 62.64 20.36 61.1 23.67 57.42A22 22 0 1 1 24.18 57.69' fill='none' stroke='%23000' stroke-width='9' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M72.98 76.67A27 27 0 1 1 80.07 72.06C79.58 75.86 84.6 78.62 91.51 78.37C85.23 81.39 77.07 80.88 72.98 76.67Z'/%3E%3C/svg%3E");
  /* The molo wordmark (chat/_wordmark.html) in one colour */
  --look-ico-wordmark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 196 76'%3E%3Cg fill='none' stroke='%23000' stroke-width='10' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 63V41a11.5 11.5 0 0 1 23 0v22M34 41a11.5 11.5 0 0 1 23 0v22'/%3E%3Cpath d='M71.87 62C75.83 63.98 81.77 62.83 84.25 60.07A16.5 16.5 0 1 1 84.64 60.27'/%3E%3Cpath d='M128 12v51'/%3E%3C/g%3E%3Cpath d='M171.74 65.14A21.5 21.5 0 1 1 177.39 61.48C177 64.5 181 66.7 186.5 66.5C181.5 68.9 175 68.5 171.74 65.14Z'/%3E%3C/svg%3E");
  --look-grain: url("/static/chat/looks/grain.f5e854bfa39e.png");
}

/* ── Parts that copy Apple: gone in every look ─────────────────────── */
:root[data-look] .dynamic-island,
:root[data-look] .ls-dynamic-island,
:root[data-look] .home-indicator,
:root[data-look] .ls-home-indicator,
:root[data-look] .ls-bottom,
:root[data-look] .ls-notif-app-badge,
:root[data-look] .ios-banner-icon svg,
:root[data-look] .ios-nav-back svg,
:root[data-look] .ios-nav-icons svg,
:root[data-look] .ios-key-pop svg,
:root[data-look] .mp-island { display: none !important; }
:root[data-look] #editorPage .iphone-frame::before,
:root[data-look] #editorPage .iphone-frame::after { display: none; }
/* iMessage's "thought bubble" circles under the typing dots */
:root[data-look] .ios-typing-bub::before { display: none !important; }

/* ── Molo icons, coloured by each look ─────────────────────────────── */
:root[data-look] .ios-status-right,
:root[data-look] .ls-status-icons { display: flex; align-items: center; gap: 6px; }
/* The top bar's signal and battery are drawn by 24-phone-top.js (they follow the story's settings) */
:root[data-look] .ios-nav-back::before {
  content: ""; width: 21px; height: 15px; background: var(--look-icon-c, currentColor);
  -webkit-mask: var(--look-ico-back) center / contain no-repeat; mask: var(--look-ico-back) center / contain no-repeat;
}
:root[data-look] .ios-nav-icons::before,
:root[data-look] .ios-nav-icons::after {
  content: ""; width: 24px; height: 19px; background: var(--look-icon-c, currentColor);
}
:root[data-look] .ios-nav-icons::before { -webkit-mask: var(--look-ico-video) center / contain no-repeat; mask: var(--look-ico-video) center / contain no-repeat; }
:root[data-look] .ios-nav-icons::after { width: 21px; height: 21px; -webkit-mask: var(--look-ico-call) center / contain no-repeat; mask: var(--look-ico-call) center / contain no-repeat; }

/* ── Bubble tails: the iPhone-style curl the bubbles always had
      (--bub-tail, 03-thread.css). The typing bubble wears the same tail,
      pointing at whoever is typing, instead of two little circles. ───── */
:root[data-look] #editorPage .ios-typing-bub::after {
  content: ""; display: block; position: absolute; bottom: 0; left: -6px; width: 20px; height: 20px;
  background: inherit; border-radius: 0; pointer-events: none; transform: scaleX(-1);
  -webkit-mask: var(--bub-tail) no-repeat center / 100% 100%; mask: var(--bub-tail) no-repeat center / 100% 100%;
}

/* ── Receipts: a word under my message, never ticks ────────────────── */
:root[data-look] #editorPage .ios-tick svg,
:root[data-look] #editorPage .ios-tick-label { display: none !important; }
:root[data-look] #editorPage .ios-tick { padding-right: 4px; }
:root[data-look] #editorPage .ios-tick:has(> svg)::after {
  content: "Sent"; font-family: var(--look-receipt-font, inherit); font-size: var(--look-receipt-size, 11px);
  font-weight: var(--look-receipt-weight, 600); letter-spacing: var(--look-receipt-ls, 0.01em);
  text-transform: var(--look-receipt-case, none); line-height: 12px; color: var(--look-receipt-c, #6b6b70);
}
:root[data-look] #editorPage .ios-tick:has(> svg[width="18"])::after { content: "Delivered"; }
:root[data-look] #editorPage .ios-tick:has(> svg path[stroke="#34B7F1"])::after { content: "Read"; color: var(--look-live-c, var(--look-receipt-c, #6b6b70)); }
/* While a story plays, only my newest receipt shows (as on a real phone).
   In Edit every receipt shows: tapping one opens its menu. */
:root[data-look] #editorPage:not(.mode-edit) .ios-row:has(~ .ios-row .ios-tick > svg) .ios-tick::after { visibility: hidden; }

/* ── Reactions: the round badge, as before; the look picks its colours ─ */
:root[data-look] #editorPage .reaction-badge {
  background: var(--look-react-bg, rgba(255, 255, 255, 0.95)); border-color: var(--look-react-edge, #fff);
}
:root[data-look] #editorPage .reaction-badge span { color: var(--look-react-count, #555); }

/* ── Molo's mark: on the keyboard between emoji and the mic, and at the
      foot of the lock screen, like a maker's name on a handset ──────── */
:root[data-look] #editorPage .ios-kb-extra::after {
  content: ""; order: 1; width: 36px; height: 15px; background: var(--look-kbmark-c, currentColor);
  -webkit-mask: var(--look-ico-wordmark) center / contain no-repeat; mask: var(--look-ico-wordmark) center / contain no-repeat;
}
:root[data-look] #editorPage .ios-kb-extra > :last-child { order: 2; }
:root[data-look] #editorPage .ios-homescreen::after {
  content: ""; position: absolute; z-index: 3; left: 50%; bottom: 30px; width: 46px; height: 19px; margin-left: -23px;
  background: var(--look-lsmark-c, rgba(255, 255, 255, 0.75)); pointer-events: none;
  -webkit-mask: var(--look-ico-wordmark) center / contain no-repeat; mask: var(--look-ico-wordmark) center / contain no-repeat;
}

/* The in-chat banner: Molo's mark and name, never Apple's Messages app */
:root[data-look] .ios-banner-icon { position: relative; background: var(--look-mark-bg, #000); }
:root[data-look] .ios-banner-icon::after {
  content: ""; position: absolute; inset: 7px 6px; background: var(--look-mark-c, #fff);
  -webkit-mask: var(--look-ico-mark) center / contain no-repeat; mask: var(--look-ico-mark) center / contain no-repeat;
}
:root[data-look] .ios-banner-app { font-size: 0 !important; }
:root[data-look] .ios-banner-app::after { content: "Molo"; font-size: 11px; }


/* The key press: a cap without the iOS balloon's neck (the JS still places it) */
:root[data-look] .ios-key-pop { filter: none; }
:root[data-look] .ios-key-pop span { left: 8%; right: 8%; }

/* Film grain, for the looks that use it (--look-grain-o > 0): a still texture
   over the whole screen, lock screen included. Never blocks a tap. */
:root[data-look] #iosScreen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 900;
  background: var(--look-grain) 0 0 / 128px 128px repeat;
  opacity: var(--look-grain-o, 0); mix-blend-mode: overlay; border-radius: inherit;
}
