/* Duo New Tab © 2026 DevRoshdi. All rights reserved. See LICENSE.txt. */
/*
 * Duo New Tab on the web: build.mjs adds this after the extension's own styles. It hides what only
 * the Chrome extension can do, and styles what only the website has (web/web.js); the extension's
 * files stay as they are.
 */

/* The page's main heading (build.mjs): read by screen readers and search engines, not shown. */
.web-h1 {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* Chrome's most visited sites: a website cannot read them (web.js answers the card "Not Now"). */
.welcome { display: none !important; }
.st-section:has(> .st-group > .st-row[data-key="Add Most Visited Sites…"]) { display: none; }

/* Chrome's favicon cache: only an extension can read it. */
.st-row[data-key="Site Favicons"],
.st-row[data-key="Use Site Favicons"] { display: none; }

/* Rating needs the extension installed; web.js puts "Get the Chrome Extension" in its place. */
.st-row[data-key="Rate Duo New Tab"] { display: none; }

/*
 * "Add to Chrome" (web.js): a glass pill in the top-left corner, as the alerts' glass, in the
 * Appearance's colours. It comes down into place with a little spring and goes back up; with reduced
 * motion it only fades. It sits under app windows, open folders, Spotlight, Control Center, Edit
 * Pages and the App Switcher (z-index 30 and up), which cover it as they cover the Home Screen.
 */
.web-chip {
  --chip-off: -12px;
  position: fixed; left: 16px; top: 16px; z-index: 29;
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); box-sizing: border-box;
  padding: 8px 8px 8px 10px; border-radius: 22px;
  background: rgba(var(--tone), 0.78); -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%);
  color: #fff; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
  font-size: 13px; line-height: 1.3;
  transition: opacity 0.3s ease, translate 0.45s cubic-bezier(0.34, 1.45, 0.64, 1), visibility 0s;
}
@starting-style { .web-chip { opacity: 0; translate: 0 var(--chip-off); } }
/*
 * Out of the way: closed (Add or ×); in edit mode, whose Edit and Add Widget buttons take the
 * top-left; while an app is full screen; while "Meet Clock" (js/clockintro.js) waits for an answer;
 * and while the Dynamic Island shows, in a window narrow enough for the two to meet (.near and
 * .near-cap, web.js): a message, or the Clock's island open, or its timer capsule.
 */
.web-chip.out,
body.editing .web-chip,
body[data-full-app] .web-chip,
body:has(> .ci) .web-chip,
body:has(#island.shown, .ck-island.on:not(.compact)) .web-chip.near,
body:has(.ck-island.on.compact) .web-chip.near-cap {
  opacity: 0; translate: 0 var(--chip-off); visibility: hidden; pointer-events: none;
  transition: opacity 0.25s ease, translate 0.3s ease-in, visibility 0s linear 0.3s;
}
@media (prefers-reduced-motion: reduce) { .web-chip { --chip-off: 0px; } }
body.mode-light .web-chip { background: rgba(250, 250, 252, 0.86); color: #000; }
.web-chip img { flex: none; border-radius: 22.5%; }
.web-chip-t { display: flex; flex-direction: column; min-width: 0; }
.web-chip-t > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.web-chip-t b { font-weight: 600; }
.web-chip-t span { opacity: 0.7; font-size: 12px; }
.web-chip-add { flex: none; padding: 7px 14px; border-radius: 16px; background: #0071e3; color: #fff; font-weight: 600; text-decoration: none; white-space: nowrap; }
.web-chip-add:hover { filter: brightness(1.08); text-decoration: none; }
.web-chip-x { flex: none; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: var(--fill); color: inherit; cursor: pointer; }
.web-chip-x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.web-chip a:focus-visible, .web-chip button:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
/* Narrow windows: "Add to Chrome" becomes "Add", then the line under the name goes. */
@media (max-width: 480px) { .web-chip-to { display: none; } }
@media (max-width: 380px) { .web-chip-t span { display: none; } }

/* The backup reminder's main button. */
.alert-actions button.web-tint { background: var(--tint); color: #fff; }

/* ---------- phones: "Made for Your Computer" (web.js), over the Home Screen ---------- */

.web-phone {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; outline: 0;
  background: rgba(10, 10, 20, 0.6); -webkit-backdrop-filter: blur(36px) saturate(170%); backdrop-filter: blur(36px) saturate(170%);
  color: #fff; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  transition: opacity 0.3s ease;
}
@starting-style { .web-phone[open] { opacity: 0; } }
.web-phone::backdrop { background: transparent; }
body.mode-light .web-phone { background: rgba(242, 242, 247, 0.72); color: #000; }

.wp-in {
  min-height: 100%; max-width: 440px; margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  display: flex; flex-direction: column; justify-content: center; gap: 18px; text-align: center;
}
.wp-head, .wp-get { display: flex; flex-direction: column; align-items: center; }
.wp-app { width: 56px; height: 56px; border-radius: 22.5%; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); }
.web-phone h2 { margin: 12px 0 6px; font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.wp-lead { margin: 0 0 16px; max-width: 34ch; font-size: 15.5px; line-height: 1.4; opacity: 0.78; }
.wp-shot { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4), 0 0 0 0.5px rgba(255, 255, 255, 0.25); }
.wp-shot.light, body.mode-light .wp-shot.dark { display: none; }
body.mode-light .wp-shot.light { display: block; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18), 0 0 0 0.5px rgba(0, 0, 0, 0.12); }

.web-phone h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.6; }
.wp-stores { display: grid; gap: 8px; width: 100%; }
.wp-store {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px 8px 14px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.12); color: inherit; text-align: left; text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.wp-store:active { transform: scale(0.98); background: rgba(255, 255, 255, 0.2); }
body.mode-light .wp-store { background: rgba(255, 255, 255, 0.85); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.wp-store-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wp-store-t b { font-size: 16px; font-weight: 600; }
.wp-store-t small { font-size: 12.5px; opacity: 0.65; }
.wp-store > .wp-ico { width: 18px; height: 18px; opacity: 0.45; }
.wp-dot { flex: none; width: 30px; height: 30px; border-radius: 50%; }
.wp-dot.chrome { background: radial-gradient(circle, #4285f4 0 28%, #fff 29% 40%, transparent 41%), conic-gradient(from -60deg, #ea4335 0 120deg, #34a853 0 240deg, #fbbc04 0); }
.wp-dot.edge { background: conic-gradient(from 200deg, #0c59a4 0 40%, #1b9de2 0 70%, #35c27a 0 90%, #0c59a4 0); }
.wp-dot.firefox { background: radial-gradient(circle at 60% 40%, #ffbd4f 0 22%, transparent 23%), conic-gradient(from 160deg, #ff3750 0 25%, #ff7139 0 55%, #ffbd4f 0 70%, #9059ff 0 100%); }
.wp-note { margin: 8px 0 14px; max-width: 36ch; font-size: 12.5px; line-height: 1.4; opacity: 0.6; }

.wp-ico { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wp-send, .wp-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px;
  color: inherit; text-decoration: none; font-weight: 600; cursor: pointer;
}
.wp-send { width: 100%; min-height: 52px; background: #0071e3; color: #fff; font-size: 17px; box-shadow: 0 8px 24px rgba(0, 113, 227, 0.35); }
.wp-send .wp-ico { width: 20px; height: 20px; }
.wp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-top: 8px; }
.wp-btn { min-height: 46px; padding: 8px 10px; background: rgba(255, 255, 255, 0.12); font-size: 15px; }
body.mode-light .wp-btn { background: rgba(0, 0, 0, 0.06); }
.wp-btn .wp-ico { width: 18px; height: 18px; flex: none; }
.wp-btn span { min-width: 0; overflow-wrap: anywhere; }
.wp-btn span.wp-url { -webkit-user-select: text; user-select: text; font-size: 12.5px; font-weight: 500; }
.wp-send:active, .wp-btn:active { transform: scale(0.97); }
.wp-anyway { margin-top: 8px; padding: 10px 16px; border: 0; background: none; color: inherit; font-size: 14px; opacity: 0.6; text-decoration: underline; text-underline-offset: 3px; }
.web-phone a:focus-visible, .web-phone button:focus-visible { outline: 2px solid #2997ff; outline-offset: 2px; }

/* A phone on its side: what it is on the left, where to get it on the right. */
@media (orientation: landscape) and (max-height: 520px) {
  .wp-in { max-width: 820px; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 28px; }
  .web-phone h2 { margin-top: 10px; font-size: 24px; }
  .wp-app { width: 48px; height: 48px; }
  .wp-lead { margin-bottom: 14px; }
}
