/* Physical enclosure and presentation. This is the only owner of device geometry. */
:root {
    --device-ratio: 1.43;
    --device-bezel: clamp(10px, 1.15vw, 18px);
    --device-radius: clamp(24px, 2.4vw, 38px);
    --device-rx: 0deg;
    --device-ry: 0deg;
    --light-x: 45%;
    --light-y: 0%;
}
html, body { width: 100%; height: 100%; margin: 0; padding: 0; }
body {
    background: #101113;
    color: #f5f5f7;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}
body::before {
    content: ''; position: fixed; inset: 0; pointer-events: none;
    background: radial-gradient(ellipse at 50% -15%, #55585d40, transparent 65%);
}
button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, a:focus-visible { outline: 2px solid #8bc1ff; outline-offset: 4px; }
[hidden] { display: none !important; }
.page { height: 100dvh; width: 100%; display: grid; grid-template-rows: 72px minmax(0, 1fr) 52px; padding: 0 36px; }
.studio-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; z-index: 2; }
.studio-brand { display: flex; align-items: center; gap: 21px; color: #dedfe3; text-decoration: none; font-size: 10px; font-weight: 600; letter-spacing: .18em; }
.studio-wordmark { position: relative; width: 114px; height: 17px; overflow: hidden; }
.studio-brand .studio-wordmark img { position: absolute; left: 50%; top: 50%; width: 172px; height: 97px; max-width: none; transform: translate(-50%, -50%); object-fit: contain; }
.studio-brand > span:not(.studio-wordmark) { padding-left: 20px; border-left: 1px solid #ffffff20; }
.studio-brand b { font-weight: 400; opacity: .5; margin-left: 4px; }
.presentation-switch { display: flex; padding: 4px; border: 1px solid #ffffff14; background: #ffffff05; border-radius: 30px; gap: 3px; }
.presentation-switch button { background: transparent; border: 0; border-radius: 25px; padding: 8px 18px; font-size: 12px; color: #93969f; cursor: pointer; transition: color .2s, background .2s; }
.presentation-switch button[aria-pressed='true'] { background: #303236; color: #f7f7f8; box-shadow: inset 0 1px #ffffff12, 0 1px 3px #0005; }
.studio-fullscreen { display: grid; place-items: center; width: 36px; height: 36px; padding: 8px; color: #b7b9c0; border: 1px solid #ffffff18; border-radius: 50%; background: transparent; cursor: pointer; }
.studio-fullscreen svg { width: 18px; height: 18px; }
.studio-fullscreen:hover { background: #ffffff0c; color: white; }
.device-stage { display: flex; justify-content: center; align-items: center; min-height: 0; perspective: 2000px; perspective-origin: 50% 45%; position: relative; }
.tablet {
    position: relative;
    flex: none;
    width: min(calc(100vw - 100px), calc((100dvh - 168px) * 1.43), 1780px);
    aspect-ratio: var(--device-ratio);
    height: auto;
    min-height: 0;
    padding: var(--device-bezel);
    border-radius: var(--device-radius);
    border: 1px solid #4c4e52;
    background: #050506;
    box-shadow: inset 0 0 0 1px #131416, inset 0 2px 2px #ffffff0b, 0 2px 0 1px #2e3033, 0 5px 0 1px #1a1b1e, 0 6px 0 1px #08090a, 0 32px 44px -16px #000a, 0 65px 110px -38px #000a;
    transform-style: preserve-3d;
    transform: rotateX(var(--device-rx)) rotateY(var(--device-ry));
    transition: transform 650ms cubic-bezier(.18, .9, .25, 1.06);
    overflow: visible;
    isolation: isolate;
}
.tablet-edge { position: absolute; z-index: -1; inset: 0; border-radius: inherit; background: transparent; border: 1px solid #ffffff12; transform: translateZ(-7px); pointer-events: none; }
.tablet-reflection { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 120; background: radial-gradient(ellipse at var(--light-x) var(--light-y), #ffffff05, transparent 65%); border: 1px solid #ffffff08; }
.tablet-camera { position: absolute; z-index: 130; width: 5px; height: 5px; border-radius: 50%; left: 50%; top: calc(var(--device-bezel) / 2 - 2px); transform: translateX(-50%); background: radial-gradient(circle at 35% 35%, #354157, #0d111b 35%, #010104 60%); box-shadow: 0 0 0 1px #13161c; pointer-events: none; }
.tablet-volume { position: absolute; left: 5%; top: -3px; width: 46px; height: 3px; background: #414246; border-radius: 3px 3px 0 0; box-shadow: 54px 0 #414246; }
.standby-hardware-button { position: absolute; top: 6%; right: -3px; width: 4px; height: 42px; padding: 0; border: 0; border-radius: 0 3px 3px 0; background: linear-gradient(90deg, #151618, #484a4d); cursor: pointer; z-index: 140; }
.standby-hardware-button::before { content: ''; position: absolute; inset: -5px -9px -5px -5px; }
.tablet-screen { position: relative; width: 100%; height: 100%; border-radius: calc(var(--device-radius) - var(--device-bezel)); overflow: hidden; background: #07090e; isolation: isolate; container-type: size; container-name: display; filter: brightness(var(--tk-screen-brightness, 1)); box-shadow: 0 0 0 1px #13151a, 0 0 6px 2px #000a; }
.tablet-screen::after { content: ''; position: absolute; inset: 0; background: #000; z-index: 300; pointer-events: none; opacity: 0; transition: opacity .25s; }
.tablet-screen.standby::after { opacity: 1; pointer-events: auto; }
.tablet-screen.standby > * { visibility: hidden; }
.studio-caption { display: flex; align-items: center; justify-content: center; color: #888b94; font-size: 11px; gap: 9px; z-index: 1; }
.studio-caption-dot { width: 4px; height: 4px; border-radius: 50%; background: #cf1534; }
.studio-caption-detail { margin-left: 20px; padding-left: 20px; border-left: 1px solid #ffffff16; color: #5e616a; font-size: 8px; letter-spacing: .16em; }
body[data-presentation='immersive'] .page { grid-template-rows: 48px minmax(0, 1fr) 12px; padding: 0 12px; }
body[data-presentation='immersive'] .tablet { width: min(calc(100vw - 38px), calc((100dvh - 82px) * 1.43)); }
body[data-presentation='immersive'] .studio-caption { display: none; }
body[data-presentation='immersive'] .studio-brand img { height: 24px; }
body[data-presentation='immersive'] .presentation-switch { padding: 2px; }
body[data-presentation='immersive'] .presentation-switch button { padding: 5px 15px; }
body[data-presentation='immersive'] .studio-fullscreen { width: 29px; height: 29px; }
@media (max-width: 900px) {
    .page { grid-template-rows: 58px minmax(0, 1fr) 38px; padding: 0 18px; }
    .tablet { width: min(calc(100vw - 44px), calc((100dvh - 122px) * 1.43)); }
    .studio-brand > span:not(.studio-wordmark) { display: none; }
    .studio-brand img { width: 88px; }
    .studio-caption-detail { display: none; }
}
@media (max-width: 600px) {
    .page { padding: 0 8px; }
    .tablet { width: min(calc(100vw - 22px), calc((100dvh - 112px) * 1.43)); }
    .presentation-switch button { padding: 6px 11px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { .tablet { transition: none; transform: none; } }
:root[data-tk-reduced-motion='true'] .tablet { transition: none; transform: none; }
