/* Fantapapi OS – phone shell */
:root {
  --page: #f1f4f5;
  --teal: #087e8b;
  --accent: #087e8b;
  --app-bg: #f6f8f9;
  --app-surface: #ffffff;
  --app-text: #0b2a2e;
  --app-muted: #4b6468;
  --app-line: #dbe4e6;
  --glass: rgba(24, 30, 32, .42);
  --glass-strong: rgba(24, 30, 32, .6);
  --bezel: #101416;
  --side-text: #0b2a2e;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --head: Unbounded, system-ui, sans-serif;
  --body: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #0c1618;
    --accent: #5fd2dd;
    --app-bg: #0f1517;
    --app-surface: #172225;
    --app-text: #eaf4f5;
    --app-muted: #9bb5b9;
    --app-line: rgba(255, 255, 255, .12);
    --bezel: #000;
    --side-text: #eaf4f5;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; background: var(--page); font-family: var(--body); }
body { overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #fff; outline-offset: 2px; border-radius: 10px; box-shadow: 0 0 0 6px rgba(8, 126, 139, .9); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Stage: phone fills the screen on mobile, framed on desktop */
#stage { height: 100%; height: 100dvh; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; justify-items: center; }
#stage > #phone { grid-column: 2; }
.side { display: none; grid-column: 1; grid-row: 1; justify-self: end; margin-right: 72px; color: var(--side-text); max-width: 320px; }
.side-k { margin: 0 0 12px; font: 700 13px var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--teal); }
.side-h { margin: 0 0 16px; font: 800 44px/1.08 var(--head); letter-spacing: -.02em; }
.side-p { margin: 0; font-size: 17px; line-height: 1.6; opacity: .75; }
@media (min-width: 1100px) and (min-height: 640px) { .side { display: block; } }

#phone { grid-row: 1; position: relative; overflow: hidden; isolation: isolate; width: 100%; height: 100%; background: #000; color: #fff; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
@media (max-width: 519px), (max-height: 599px) { #stage { display: block; } }
@media (min-width: 520px) and (min-height: 600px) {
  #phone { width: 430px; max-width: 430px; height: min(900px, calc(100dvh - 48px)); border-radius: 52px; box-shadow: 0 0 0 10px var(--bezel), 0 0 0 12px #2a3033, 0 40px 90px rgba(0, 0, 0, .35); --safe-t: 0px; --safe-b: 0px; }
  #phone::before { content: ""; position: absolute; z-index: 80; top: 11px; left: 50%; width: 112px; height: 32px; margin-left: -56px; border-radius: 20px; background: #000; pointer-events: none; }
}

/* Background video */
#bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
#dim { position: absolute; inset: 0; z-index: 1; background: linear-gradient(rgba(0, 0, 0, .45), rgba(0, 0, 0, .12) 40%, rgba(0, 0, 0, .55)); pointer-events: none; }

/* Status bar */
#status { position: absolute; z-index: 75; top: 0; left: 0; right: 0; padding: calc(16px + var(--safe-t)) 30px 0; display: flex; justify-content: space-between; align-items: center; font: 700 15px var(--body); pointer-events: none; transition: color .2s; }
#phone.in-app #status { color: var(--app-text); }
.sr { display: flex; gap: 6px; align-items: center; font-size: 12px; }
.bat { width: 24px; height: 12px; border-radius: 4px; border: 1.5px solid currentColor; display: inline-block; position: relative; }
.bat::after { content: ""; position: absolute; inset: 1.5px; right: 5px; border-radius: 2px; background: currentColor; }
.sig { width: 16px; height: 11px; display: inline-block; background: linear-gradient(90deg, currentColor 0 3px, transparent 3px 4.5px, currentColor 4.5px 7.5px, transparent 7.5px 9px, currentColor 9px 12px, transparent 12px 13.5px, currentColor 13.5px); -webkit-mask: linear-gradient(to top, #000 30%, transparent 30%) 0 0 / 3px 100% no-repeat, linear-gradient(to top, #000 55%, transparent 55%) 4.5px 0 / 3px 100% no-repeat, linear-gradient(to top, #000 80%, transparent 80%) 9px 0 / 3px 100% no-repeat, linear-gradient(#000, #000) 13.5px 0 / 3px 100% no-repeat; mask: linear-gradient(to top, #000 30%, transparent 30%) 0 0 / 3px 100% no-repeat, linear-gradient(to top, #000 55%, transparent 55%) 4.5px 0 / 3px 100% no-repeat, linear-gradient(to top, #000 80%, transparent 80%) 9px 0 / 3px 100% no-repeat, linear-gradient(#000, #000) 13.5px 0 / 3px 100% no-repeat; }

/* Home screen */
#home { position: absolute; inset: 0; z-index: 2; padding: calc(64px + var(--safe-t)) 20px calc(30px + var(--safe-b)); display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: none; }
#home::-webkit-scrollbar { display: none; }
.wid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 14px; margin-bottom: 24px; flex: none; }
.wid > button { height: clamp(124px, 18dvh, 156px); border-radius: 26px; overflow: hidden; position: relative; border: 0; padding: 0; text-align: left; background: var(--glass); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 6px 24px rgba(0, 0, 0, .25); transition: transform .15s; }
.wid > button:active { transform: scale(.96); }
.w1 img { width: 100%; height: 100%; object-fit: cover; }
.w1 span { position: absolute; left: 14px; bottom: 12px; font: 700 15px var(--head); text-shadow: 0 1px 8px #000; }
.w2 { padding: 16px !important; display: flex; flex-direction: column; gap: 4px; }
.w2 small { color: #7fe0ea; font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.w2 b { font: 700 15px/1.25 var(--head); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.w2 span { font-size: 13px; opacity: .85; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 6px; flex: none; }
.ic { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 44px; padding: 0; background: none; border: 0; color: #fff; text-decoration: none; font-size: 11.5px; font-weight: 600; line-height: 1.2; text-align: center; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.ic > span:last-child { max-width: 84px; }
.ic .t { width: 62px; height: 62px; border-radius: 16px; display: grid; place-items: center; box-shadow: 0 3px 12px rgba(0, 0, 0, .35); transition: transform .15s; overflow: hidden; flex: none; }
.ic:active .t { transform: scale(.88); }
.t svg { width: 36px; height: 36px; }
.t img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cal { background: #fff; color: #111; display: flex !important; flex-direction: column; justify-content: center; align-items: center; line-height: 1; }
.cal b { font-size: 10px; font-weight: 800; color: #e33; letter-spacing: .04em; }
.cal i { font-style: normal; font: 500 28px var(--head); margin-top: 2px; }
.dock { margin: 0; padding: 14px 12px 12px; border-radius: 32px; background: var(--glass); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); display: grid; grid-template-columns: repeat(4, 1fr); flex: none; position: relative; top: 0; }
.dock .ic > span:last-child { display: none; }
.tools { margin-top: auto; padding: 18px 4px 12px; display: flex; justify-content: flex-end; flex: none; }
#snd { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--glass-strong); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); display: grid; place-items: center; color: #fff; }
#snd svg { width: 22px; height: 22px; }
#snd .on { display: none; }
#snd[aria-pressed="true"] .on { display: inline; }
#snd[aria-pressed="true"] .off { display: none; }

/* In-app screens */
#app { position: absolute; inset: 0; z-index: 20; background: var(--app-bg); color: var(--app-text); display: flex; flex-direction: column; padding-top: calc(46px + var(--safe-t)); animation: zoom .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes zoom { from { transform: scale(.88); opacity: 0; border-radius: 40px; } }
.app-head { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--app-line); min-height: 56px; }
.app-head h2 { margin: 0; font: 700 16px var(--head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#back { min-height: 44px; min-width: 44px; padding: 0 10px; border: 0; background: none; color: var(--accent); font-weight: 700; font-size: 16px; display: inline-flex; align-items: center; gap: 4px; }
#back span { font-size: 28px; line-height: 1; margin-top: -3px; }
#aB { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 16px calc(44px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
#aB.flush { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.app-h { font: 700 13px var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 22px 0 10px; }
.app-h:first-child { margin-top: 4px; }
.app-p { color: var(--app-muted); font-size: 14px; margin: 0 0 12px; }

.go { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--teal); color: #fff; font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; }
.go.ghost { background: color-mix(in srgb, var(--app-text) 12%, transparent); color: var(--app-text); }
.go.danger { background: #c0392b; }

/* Calendar list */
.ev { display: grid; grid-template-columns: 56px 1fr; gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid var(--app-line); }
.ev .d { grid-row: span 2; text-align: center; font-size: 12px; font-weight: 700; color: #e33; text-transform: uppercase; background: var(--app-surface); border: 1px solid var(--app-line); border-radius: 14px; padding: 8px 0; align-self: start; }
.ev .d b { display: block; font: 600 22px var(--head); color: var(--app-text); }
.ev .info b { display: block; font-size: 15px; line-height: 1.3; }
.ev .info small { display: block; color: var(--app-muted); font-size: 13px; margin-top: 2px; }
.ev .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.empty-msg { padding: 20px; border: 1px dashed var(--accent); border-radius: 16px; color: var(--app-muted); }

/* Camera */
.cam { height: 100%; display: flex; flex-direction: column; gap: 14px; padding: 12px 12px calc(36px + var(--safe-b)); background: #000; color: #fff; }
.cam video { flex: 1; min-height: 0; width: 100%; object-fit: cover; border-radius: 22px; background: #111; }
.cam video.mirror { transform: scaleX(-1); }
.cam-msg { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 24px; border-radius: 22px; background: #151b1d; text-align: center; font-size: 15px; line-height: 1.5; }
.cam-msg b { font: 700 18px var(--head); }
.shut { display: flex; justify-content: space-around; align-items: center; min-height: 80px; }
#snap { width: 74px; height: 74px; border-radius: 50%; border: 5px solid #fff; background: rgba(255, 255, 255, .25); transition: transform .1s; }
#snap:active { transform: scale(.9); background: #fff; }
#snap:disabled { opacity: .35; }
.sm { width: 56px; height: 56px; border-radius: 50%; background: rgba(255, 255, 255, .14); border: 0; display: grid; place-items: center; overflow: hidden; padding: 0; color: #fff; }
.sm svg { width: 26px; height: 26px; }
.sm img { width: 100%; height: 100%; object-fit: cover; }
.flash { position: absolute; inset: 0; background: #fff; z-index: 30; animation: flash .35s forwards; pointer-events: none; }
@keyframes flash { to { opacity: 0; } }

/* Notes */
.note { width: 100%; height: 46dvh; min-height: 220px; border: 0; border-radius: 18px; background: #fff6c9; color: #222; padding: 18px; font: 500 17px/1.55 var(--body); resize: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.note:focus-visible { outline: 3px solid var(--teal); box-shadow: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* Photos */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: color-mix(in srgb, var(--app-text) 9%, transparent); margin-bottom: 8px; }
.tabs button { min-height: 44px; padding: 0 22px; border: 0; border-radius: 999px; background: none; color: var(--app-muted); font-weight: 700; font-size: 14px; }
.tabs button[aria-selected="true"] { background: var(--teal); color: #fff; }
.pg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; border-radius: 14px; overflow: hidden; }
.pg button { padding: 0; border: 0; background: var(--app-line); aspect-ratio: 1; min-height: 44px; display: block; }
.pg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame { margin-top: 22px; padding: 14px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 22px; background: color-mix(in srgb, var(--accent) 7%, transparent); }
.frame .app-h { margin-top: 0; }
.alb { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 0; border-bottom: 1px solid var(--app-line); color: var(--app-text); text-decoration: none; }
.alb div { flex: 1; min-width: 0; }
.alb small { display: block; color: var(--app-muted); }
.vid { margin-top: 14px; }
.vid video { width: 100%; max-height: 62dvh; border-radius: 16px; background: #000; display: block; }
.vid p { color: var(--app-muted); font-size: 13px; margin: 6px 0 0; }
#view { position: absolute; inset: 0; z-index: 72; background: rgba(0, 0, 0, .94); display: flex; flex-direction: column; align-items: center; gap: 14px; padding: calc(56px + var(--safe-t)) 10px calc(34px + var(--safe-b)); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
#view img, #view video { flex: 1; min-height: 0; max-width: 100%; object-fit: contain; }
.view-bar { display: flex; gap: 12px; }
#view .go.ghost { background: rgba(255, 255, 255, .16); color: #fff; }

/* Browser (Safari / Chrome) */
.url { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--app-bg); border-bottom: 1px solid var(--app-line); }
.url span { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--app-text) 8%, transparent); font-size: 14px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.url a { display: grid; place-items: center; width: 44px; height: 44px; color: var(--accent); border-radius: 12px; }
.url svg { width: 20px; height: 20px; }
.web { flex: 1; width: 100%; border: 0; background: #fff; display: block; }
.chrome { padding: 28px 18px; text-align: center; }
.chrome-logo { font: 800 30px var(--head); letter-spacing: -.02em; margin: 12px 0 22px; }
.chrome-logo span:nth-child(1) { color: #4285f4; } .chrome-logo span:nth-child(2) { color: #ea4335; } .chrome-logo span:nth-child(3) { color: #fbbc05; } .chrome-logo span:nth-child(4) { color: #34a853; }
.search { display: flex; gap: 8px; margin-bottom: 26px; }
.search input { flex: 1; min-width: 0; min-height: 48px; border-radius: 999px; border: 1px solid var(--app-line); background: var(--app-surface); padding: 0 18px; }
.search input:focus-visible { outline: 3px solid var(--teal); box-shadow: none; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 6px; }
.quick .ic { color: var(--app-text); text-shadow: none; }
.quick .t { width: 54px; height: 54px; border-radius: 50%; box-shadow: none; border: 1px solid var(--app-line); }
.quick .t svg { width: 28px; height: 28px; }

/* Toast */
#toast { position: absolute; z-index: 90; left: 50%; top: calc(58px + var(--safe-t)); transform: translate(-50%, -30px); max-width: 86%; background: #fff; color: #111; padding: 11px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; opacity: 0; transition: .3s; pointer-events: none; box-shadow: 0 8px 30px rgba(0, 0, 0, .3); text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Lock screen */
#lock { position: absolute; inset: 0; z-index: 60; touch-action: none; cursor: grab; transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .45s; background: #000; }
#lock.gone { transform: translateY(-105%); opacity: .6; }
#lock > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; pointer-events: none; }
#lock::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(rgba(0, 0, 0, .55), rgba(0, 0, 0, .1) 34%, rgba(0, 0, 0, .35) 60%, rgba(0, 0, 0, .8)); pointer-events: none; }
#lock > *:not(img) { position: relative; z-index: 2; }
.lock-top { text-align: center; padding-top: calc(74px + var(--safe-t)); text-shadow: 0 2px 18px rgba(0, 0, 0, .45); }
#ld { margin: 0; font-size: 19px; font-weight: 600; }
#lt { margin: 2px 0 0; font: 700 clamp(72px, 24vw, 98px)/1 var(--head); letter-spacing: -.04em; }
#ns { position: absolute !important; left: 12px; right: 12px; bottom: calc(108px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; }
.n { display: flex; gap: 12px; padding: 12px 14px; border-radius: 22px; background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4); animation: drop .55s cubic-bezier(.2, .9, .3, 1.2); box-shadow: 0 6px 22px rgba(0, 0, 0, .2); }
@keyframes drop { from { transform: translateY(-28px) scale(.95); opacity: 0; } }
.n .t { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; overflow: hidden; }
.n .t svg { width: 24px; height: 24px; }
.n .cal b { font-size: 7px; } .n .cal i { font-size: 17px; margin: 0; }
.n > div { min-width: 0; flex: 1; font-size: 14px; line-height: 1.3; }
.n b.h { display: flex; justify-content: space-between; gap: 8px; font-weight: 800; }
.n b.h em { font-weight: 500; font-style: normal; opacity: .7; font-size: 12px; flex: none; }
.n small { display: block; font-size: 12px; opacity: .75; font-weight: 700; }
.n p { margin: 2px 0 0; opacity: .92; }
#hint { position: absolute !important; bottom: calc(26px + var(--safe-b)); left: 50%; transform: translateX(-50%); min-height: 56px; min-width: 220px; padding: 6px 18px; background: none; border: 0; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 0; font-size: 16px; font-weight: 700; text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
#hint i { animation: bob 1.6s ease-in-out infinite; font-style: normal; font-size: 22px; line-height: 1; }
@keyframes bob { 50% { transform: translateY(-6px); } }

/* Home bar */
#bar { position: absolute; z-index: 85; left: 50%; bottom: calc(6px + var(--safe-b)); width: 150px; height: 44px; margin-left: -75px; padding: 0; border: 0; background: none; border-radius: 22px; }
#bar::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 6px; height: 5px; border-radius: 3px; background: #fff; opacity: .92; box-shadow: 0 0 6px rgba(0, 0, 0, .4); }
#phone.in-app #bar::after { background: var(--app-text); box-shadow: none; }
#phone.locked #bar { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
