/* Link phone kit: the iOS app's Midnight theme rebuilt in HTML.
   Every value is taken from apps/link-ios (ReSono-Labs-Link, main @ f429512b, 2026-11-15)
   unless marked SYSTEM (iOS chrome the app does not draw) or FILM (presentation only).
   Units: 1 CSS px inside .dev = 1 iOS point. The phone is drawn at its on-screen size
   with CSS `zoom` (layout-level), never enlarged with a transform. */


:root {
  /* Palette.dark + ThemeSpec.midnight (LinkTheme.swift:23-38, 251-271) */
  --ink: #f3f1ff;
  --grey: rgba(243, 241, 255, .62);
  --meta: rgba(243, 241, 255, .55);
  --ink2: #d8d5ea;
  --mute: #aeaac6;
  --faint: #6f6b88;
  --line: rgba(255, 255, 255, .12);
  --brand: #aec4ff;
  --red: #ff3b5c;
  --pink: #ff3b7f;
  --ok: #1fae6a;
  --ok-text: #5fe3b2;
  --primary-fill: #f3f1ff;
  --primary-glyph: #16151c;
  --placeholder: rgba(235, 235, 245, .3);   /* SYSTEM: tertiaryLabel, dark */
  /* states/accents (base(), LinkTheme.swift:117-121) */
  --a-info: #2f7bff; --a-success: #34c38f; --a-warning: #ffd43b; --a-urgent: #f0445a; --a-calm: #9b8cff; --a-busy: #ffb020;
  /* kitGlass, dark (LinkTheme.swift:96) */
  --g-top: .10; --g-bottom: .04; --g-rim: .18; --g-highlight: .22; --g-material: .85; --g-floating: .08;
}

/* SwiftUI frames include padding: lay out like it */
.dev *, .dev *::before, .dev *::after, .kitfont, .kitfont * { box-sizing: border-box; }

/* FILM: stage behind the phone */
.stage { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 45%, #10131a 0%, #07080b 60%, #040405 100%); overflow: hidden; }
.hold { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }

/* ---------- device (FILM: iPhone 17 Pro class, 402 x 874 pt screen) ---------- */
.dev { position: relative; width: 416px; height: 888px; flex: none; zoom: var(--z, 1); font-family: LinkUI, sans-serif; color: var(--ink);
  -webkit-font-smoothing: antialiased; text-rendering: geometricPrecision; font-feature-settings: "cv05", "cv08"; }
.dev .body { position: absolute; inset: 0; border-radius: 62px; background: #050506;
  box-shadow: 0 0 0 1px #3b3e45, 0 0 0 2.2px #15161a, 0 0 0 3px #6b6f78, 0 40px 90px rgba(0, 0, 0, .55), 0 12px 30px rgba(0, 0, 0, .4); }
.dev .scr { position: absolute; left: 7px; top: 7px; width: 402px; height: 874px; border-radius: 55px; overflow: hidden; isolation: isolate; background: #08111d; }
.dev .scr > * { position: absolute; }
.ghost { position: relative; width: 416px; height: 888px; flex: none; zoom: var(--z, 1); font-family: LinkUI, sans-serif; color: var(--ink);
  -webkit-font-smoothing: antialiased; pointer-events: none; }
.ghost .lay { position: absolute; left: 7px; top: 7px; width: 402px; height: 874px; }

/* ---------- Midnight field (FoldedLightField.swift): artwork scaledToFill at +96 pt, blur 20, black 16% ---------- */
.fld { inset: -48px; background: center / cover no-repeat; filter: blur(var(--fld-blur, 20px)); }
.fld-dim { inset: 0; background: rgba(0, 0, 0, .16); }
/* SimpleWorkspaceField, midnight (SimpleCardWorkspace.swift:226-236) */
/* radii are 0.72 x and 0.58 x the field's own height (874 full screen; the unfolding plane is area + 300 = 968) */
.wsf { position: absolute; inset: 0; --fh: 874px; background:
  radial-gradient(circle at 100% 0, rgba(21, 59, 99, .8) 0, transparent calc(var(--fh) * .72)),
  radial-gradient(circle at 0 100%, rgba(18, 52, 85, .65) 0, transparent calc(var(--fh) * .58)), #030f1e; }

/* ---------- status bar (SYSTEM) ---------- */
.sb { left: 0; top: 0; width: 402px; height: 62px; z-index: 60; color: #fff; pointer-events: none; }
.sb .t { position: absolute; left: 0; width: 128px; top: 21px; text-align: center; font-size: 17px; font-weight: 600; letter-spacing: -.3px; line-height: 22px; }
.sb .isl { position: absolute; left: 138px; top: 11px; width: 126px; height: 37px; border-radius: 19px; background: #000; }
.sb .ic { position: absolute; right: 34px; top: 26px; display: flex; gap: 6px; align-items: center; height: 13px; }
.sb .ic svg { display: block; height: 12.5px; width: auto; fill: #fff; }

/* ---------- glass recipes ---------- */
/* ThemeGlassFill, live material (LinkTheme.swift ~440-475): material @ .85, white wash top-left .10 -> bottom-right .04,
   1 pt rim white(.38 -> .09), inner 1 pt top highlight white .22 fading by 18% */
.glass { position: absolute; isolation: isolate; }
.glass::before { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  -webkit-backdrop-filter: blur(var(--mat-blur, 22px)) saturate(1.05); backdrop-filter: blur(var(--mat-blur, 22px)) saturate(1.05);
  background: linear-gradient(135deg, rgba(255, 255, 255, var(--g-top)), rgba(255, 255, 255, var(--g-bottom))), rgba(120, 128, 145, .10); }
.glass::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  padding: 1px; background: linear-gradient(135deg, rgba(255, 255, 255, .38), rgba(255, 255, 255, .09));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.hl { position: absolute; inset: 1px; border-radius: inherit; pointer-events: none; padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, var(--g-highlight)) 0, rgba(255, 255, 255, 0) 18%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
/* FieldGlass (pre-blurred field: sigma 16, saturation 1.35, black 12%) on the theme field */
.fglass::before { -webkit-backdrop-filter: blur(16px) saturate(1.35); backdrop-filter: blur(16px) saturate(1.35);
  background: linear-gradient(135deg, rgba(255, 255, 255, var(--g-top)), rgba(255, 255, 255, var(--g-bottom))), rgba(0, 0, 0, .12); }
/* TintedGlass shadow: FlatShadow black .45, radius 18 (blur 0.6r sigma), y 8 */
.tshadow { box-shadow: 0 8px 22px rgba(0, 0, 0, .45); }
/* ThemeGroupBackground: ThemeRowFill (field glass @ .85 + white .07), 1 pt edge white .14, shadow .5 x .45, r14, y6 */
.group { position: absolute; border-radius: 22px; isolation: isolate; box-shadow: 0 6px 17px rgba(0, 0, 0, .23); }
.group::before { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  -webkit-backdrop-filter: blur(16px) saturate(1.35); backdrop-filter: blur(16px) saturate(1.35);
  background: linear-gradient(rgba(255, 255, 255, .07), rgba(255, 255, 255, .07)), rgba(0, 0, 0, .10); }
.group::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }

/* ---------- SF Symbols (drawn by kit.js into <i data-sf>) ---------- */
i[data-sf] { display: inline-block; font-style: normal; line-height: 0; }
i[data-sf] svg { width: 100%; height: 100%; display: block; overflow: visible; }

/* ---------- Ask header (ConversationSurface.swift:405-475): 44 tall, padding h10, under the 62 pt safe area ---------- */
.hdr { left: 10px; top: 62px; width: 382px; height: 44px; z-index: 30; }
.hdr .nm { position: absolute; left: 8px; top: 0; height: 44px; max-width: 140px; display: flex; align-items: center;
  font-size: 15px; font-weight: 500; letter-spacing: -.2px; color: rgba(243, 241, 255, .9); white-space: nowrap; }
.hdr .stk { position: absolute; left: 169px; top: 0; width: 44px; height: 44px; }
.hdr .el { position: absolute; right: 0; top: 0; width: 44px; height: 44px; opacity: .6; color: var(--grey); display: flex; align-items: center; justify-content: center; }
.hdr .el i { width: 16px; height: 4px; }
/* SimpleStackSymbol: three 26x18 planes, radius 4, rotated 42 deg about X, offset -3/0/+3, accent .10 fill, ink .55 0.65 pt stroke */
.stk .pl { position: absolute; left: 9px; top: 13px; width: 26px; height: 18px; border-radius: 4px; background: rgba(174, 196, 255, .10);
  box-shadow: inset 0 0 0 .65px rgba(243, 241, 255, .55); transform: perspective(52px) rotateX(42deg); }

/* ---------- greeting (HomeGreeting.swift): Snell Roundhand 34, padding top16 bottom12 h6, inside padding h16 ---------- */
.greet { left: 22px; width: 358px; top: 106px; height: 672px; display: flex; align-items: center; z-index: 5; }
.greet .tx { font-family: LinkScript, cursive; font-size: var(--greet-size, 34px); line-height: 1.2; color: var(--ink); white-space: nowrap; padding-top: 16px; padding-bottom: 12px; }
.greet .tx span { opacity: 0; }

/* ---------- quiet composer (ChatComposer.swift:300-440): padding h12 top6 bottom10, row spacing 8 ---------- */
.cmp { left: 12px; top: 784px; width: 378px; height: 46px; z-index: 30; }
.cmp .plus { position: absolute; left: 0; top: 2px; width: 44px; height: 44px; color: var(--grey); display: flex; align-items: center; justify-content: center; }
.cmp .plus i { width: 14px; height: 14px; }
.cmp .fld2 { position: absolute; left: 52px; right: 0; top: 0; height: 46px; }
.cmp .ph { position: absolute; left: 16px; top: 0; height: 46px; display: flex; align-items: center; font-size: 15px; letter-spacing: -.2px; color: var(--placeholder); white-space: nowrap; }
.cmp .typed { position: absolute; left: 16px; top: 0; height: 46px; display: flex; align-items: center; font-size: 15px; letter-spacing: -.2px; color: var(--ink); white-space: nowrap; }
.cmp .mic { position: absolute; right: 6px; top: -4px; width: 44px; height: 44px; color: var(--grey); display: flex; align-items: center; justify-content: center; }
.cmp .mic i { width: 10px; height: 15px; }
/* PrimaryCircle send: 34 pt, primaryFill, 16 pt bold arrow.up */
.cmp .send { position: absolute; right: 11px; top: 1px; width: 34px; height: 34px; border-radius: 50%; background: var(--primary-fill); color: var(--primary-glyph);
  display: flex; align-items: center; justify-content: center; opacity: 0; }
.cmp .send i { width: 14px; height: 15px; }

/* ---------- workspace + cards (CardWorkspaceView.swift, CardTileView.swift, main) ----------
   Simple Mode: ScrollView padding 16 in the area between the header (y 106) and the composer (y 774).
   Root VStack spacing 10; header row = first heading (title2 semibold, tracking -0.3) + refresh 44x32;
   CardFlowLayout spacing 12, two 179 pt columns; each row as tall as its tallest card. */
.wsp { position: absolute; left: 16px; top: 122px; width: 370px; }
.wsp .wh { display: flex; align-items: center; justify-content: space-between; }
.wsp .wh b { font-weight: 600; font-size: 22px; letter-spacing: -.56px; line-height: 1.19; padding: 6px 4px 0; }
.wsp .wh .rf { width: 44px; height: 32px; color: var(--grey); display: flex; align-items: center; justify-content: center; }
.wsp .wh .rf i { width: 14px; height: 15px; }
.wsp .deck { display: grid; grid-template-columns: 179px 179px; gap: 12px; margin-top: 10px; align-items: stretch; }
/* a section heading (only when the section has several cards): subheadline semibold, tracking -0.1, ink .8, padding h4 top6 */
.wsp .whs { grid-column: span 2; font-size: 15px; font-weight: 600; letter-spacing: -.33px; line-height: 1.19; color: rgba(243, 241, 255, .8); padding: 6px 4px 0; }
/* tile: padding 12, minHeight 132 (rows 2), radius 24, TintedGlass (field glass + wash + rim + highlight + FlatShadow) */
.tile { position: relative; border-radius: 24px; padding: 12px; min-height: 132px; }
.tile.wide { grid-column: span 2; }
.tile .in { position: relative; z-index: 2; }
.tile .top { display: flex; gap: 8px; align-items: flex-start; }
.tile .tt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
/* title: headline semibold, tracking -0.2 (+ SF 17 pt -0.43), lineLimit 2 */
.tile h5 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.63px; line-height: 1.19;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* subtitle: subheadline, LinkTheme.grey, lineLimit 2 */
.tile .sub { font-size: 15px; letter-spacing: -.23px; line-height: 1.19; color: var(--grey);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .bdg { flex: none; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.tile .bdg i { width: 11px; height: 11px; }
.tile .bd { margin-top: 8px; }
/* ListBody: VStack spacing 6; dot 7 + subheadline, spacing 9, lineLimit 1 */
.tile .list { display: flex; flex-direction: column; gap: 6px; }
.tile .list div { display: flex; align-items: center; gap: 9px; font-size: 15px; line-height: 1.19; letter-spacing: -.23px; color: var(--grey); white-space: nowrap; min-width: 0; }
.tile .list div > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tile .list u { flex: none; width: 7px; height: 7px; border-radius: 50%; }
/* MetricBody: HStack(bottom, spacing 12): [meta subheadline, number 36 regular, delta body] + AreaChart 48 */
.tile .metric { display: flex; align-items: flex-end; gap: 12px; }
.tile .metric .mcol { display: flex; flex-direction: column; gap: 4px; flex: none; }
.tile .metric .mlab { font-size: 15px; letter-spacing: -.23px; line-height: 1.19; color: var(--grey); }
.tile .metric .mv { font-size: 36px; line-height: 1.19; font-weight: 400; letter-spacing: .1px; }
.tile .metric .mdel { font-size: 17px; letter-spacing: -.43px; line-height: 1.19; color: var(--grey); }
.tile .metric .area { flex: 1; height: 48px; display: block; overflow: visible; }

/* ---------- system pull-down menu (SYSTEM, iOS 26) ---------- */
.menu { position: absolute; z-index: 70; border-radius: 34px; padding: 10px 0; isolation: isolate; transform-origin: 100% 0;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .38), 0 2px 8px rgba(0, 0, 0, .18); }
.menu::before { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  -webkit-backdrop-filter: blur(30px) saturate(1.15) brightness(1.1); backdrop-filter: blur(30px) saturate(1.15) brightness(1.1);
  background: linear-gradient(160deg, rgba(140, 152, 175, .30), rgba(105, 115, 138, .22)), rgba(16, 18, 26, .62); }   /* owner, 2026-11-18: darker base, less see-through */
.menu::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; padding: 1px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .30), rgba(255, 255, 255, .06) 45%, rgba(255, 255, 255, .14));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.menu .it { position: relative; display: flex; align-items: center; min-height: 42px; padding: 0 22px 0 0; font-size: 17px; letter-spacing: -.43px; color: var(--ink); }
.menu .it .ck { width: 36px; padding-left: 10px; flex: none; display: flex; justify-content: center; }
.menu .it .ck i { width: 14px; height: 13px; }
.menu .it .ic { width: 28px; height: 28px; flex: none; margin-right: 10px; display: flex; align-items: center; justify-content: center; color: var(--brand); }
.menu .it .ic i { width: 19px; height: 19px; }
.menu .it .lb { display: flex; flex-direction: column; padding: 8px 0; line-height: 21px; }
.menu .it .lb small { font-size: 13px; line-height: 17px; letter-spacing: -.08px; color: rgba(235, 235, 245, .6); }
.menu .it.red { color: #ff453a; }
.menu .it.red .ic { color: #ff453a; }
.menu .sep { height: 1px; margin: 10px 24px 10px 24px; background: rgba(255, 255, 255, .12); }

/* ---------- orbs (Assets.xcassets/Orb*.imageset): image URLs live in index.html so they resolve from the project root ---------- */
.orb { border-radius: 50%; background: center / cover no-repeat; flex: none; }

/* ---------- Agents screen (AgentsScreen.swift, AgentsUI.swift): margin 14, gap 10 ---------- */
.net { left: 14px; top: 62px; width: 374px; z-index: 10; display: flex; flex-direction: column; gap: 10px; }
.net .top { display: flex; gap: 8px; align-items: center; height: 44px; margin-top: 8px; }
.net .top .sp { flex: 1; }
.cbtn { position: relative; width: 44px; height: 44px; flex: none; }
.cbtn .c { position: absolute; left: 3px; top: 3px; width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--ink); }
.cbtn .c i { width: 17px; height: 17px; position: relative; z-index: 2; }
.net h1 { margin: 0; padding: 2px 6px 0; font-size: 34px; font-weight: 400; letter-spacing: -.6px; line-height: 41px; }
.srch { position: relative; height: 38px; border-radius: 12px; display: flex; align-items: center; gap: 6px; padding: 0 10px; }
.srch i { width: 17px; height: 17px; color: var(--mute); position: relative; z-index: 2; }
.srch span { position: relative; z-index: 2; font-size: 16px; letter-spacing: -.3px; color: var(--placeholder); }
.sec { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 0; min-height: 38px; }
.sec b { font-size: 12px; font-weight: 600; letter-spacing: .9px; color: var(--mute); }
.sec a { font-size: 13px; font-weight: 600; letter-spacing: -.08px; color: var(--brand); }
.ngrp { position: relative; }
.nrow { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px; min-height: 62px; z-index: 2; }
.nrow + .nrow::before { content: ""; position: absolute; left: 64px; right: 0; top: 0; height: 1px; background: var(--line); }
.nrow .orb { width: 40px; height: 40px; }
.nrow .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0; }
.nrow .tx b { font-size: 17px; font-weight: 500; letter-spacing: -.43px; line-height: 22px; }
.nrow .tx span { display: flex; align-items: center; gap: 4px; font-size: 13px; letter-spacing: -.08px; color: var(--mute); line-height: 18px; }
.pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.pill.ok { color: var(--ok-text); background: rgba(31, 174, 106, .16); }
.chev { width: 8px; height: 13px; color: var(--faint); flex: none; }

/* ---------- tab bar (LinkBottomBar.swift): height 64, glass radius 34, padding h22, bottom 4 ---------- */
.tabs { left: 22px; top: 772px; width: 358px; height: 64px; border-radius: 34px; z-index: 40; display: flex; padding: 0 6px; }
.tabs .tb { position: relative; z-index: 2; flex: 1; display: flex; align-items: center; justify-content: center; }
.tabs .tb div { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 16px; border-radius: 22px; color: var(--ink2); }
.tabs .tb.on div { color: var(--brand); background: rgba(174, 196, 255, .1); }
.tabs .tb i { width: 24px; height: 20px; }
.tabs .tb small { font-size: 10.5px; font-weight: 600; letter-spacing: .05px; }

/* ---------- FILM: touch indicator ---------- */
.touch { position: absolute; z-index: 90; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .42) 0, rgba(255, 255, 255, .22) 55%, rgba(255, 255, 255, 0) 72%); opacity: 0; pointer-events: none; }

.kitfont { font-family: LinkUI, sans-serif; }
