html, body { margin: 0; height: 100%; background: #1a2029; color: #e6ebf1; font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif; overflow: hidden }
/* window-controls-overlay: no Chrome title bar; a thin strip of our own (drag to move the window) holds the chip,
   beside Chrome's window buttons. Without the overlay (a browser tab), the strip has zero height. */
#bar { position: fixed; top: 0; left: 0; right: 0; height: env(titlebar-area-height, 0px); background: #1a2029; app-region: drag; -webkit-app-region: drag; z-index: 2 }
#body { position: fixed; left: 0; right: 0; bottom: 0; top: env(titlebar-area-height, 0px); width: 100vw; height: calc(100vh - env(titlebar-area-height, 0px)); border: 0; display: block }
#body[hidden] { display: none }
/* centre-top: right side holds harness controls (right-pane toggle) */
#chip { position: fixed; top: calc(env(titlebar-area-y, 10px) + (env(titlebar-area-height, 24px) - 24px) / 2); app-region: no-drag; -webkit-app-region: no-drag; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid #323d4b; background: rgba(35,43,54,.9); color: #c8d1dc; font: 12px/1.4 inherit; cursor: pointer; backdrop-filter: blur(6px) }
#chip:hover { color: #fff; border-color: #46566a }
#dot { width: 7px; height: 7px; border-radius: 50%; background: #6c7887 }
#chip.on #dot { background: #4ade80 } #chip.off #dot { background: #f59e0b } #chip.trip #dot { background: #ef4444 }
#controls { position: fixed; inset: 0; z-index: 4; display: grid; place-items: center; background: rgba(0,0,0,.55) }
#controls[hidden] { display: none }
#passkeys { display: block; width: 100%; height: 52px; border: 0; margin: 8px 0 }
#entry[hidden] { display: none }
details { margin-top: 10px } summary { cursor: pointer; color: #9aa7b6; font-size: 13px }
/* inside the passkey frame: its one button fills the frame */
#tap { width: 100%; height: 44px; font-size: 15px; font-weight: 600 }
html:has(#tap), body:has(#tap) { background: transparent; overflow: hidden; margin: 0; padding: 2px }
.card { width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; background: #232b36; border: 1px solid #323d4b; border-radius: 14px; padding: 18px 20px; box-shadow: 0 20px 60px rgba(0,0,0,.5) }
.head { display: flex; justify-content: space-between; align-items: center }
h2 { margin: 0; font-size: 16px; font-weight: 600 } h3 { margin: 16px 0 4px; font-size: 12px; font-weight: 600; color: #9aa7b6; text-transform: uppercase; letter-spacing: .04em }
p { margin: 6px 0 } .note { color: #9aa7b6; font-size: 12px }
.row { display: flex; gap: 8px; margin: 8px 0 }
input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 8px; border: 1px solid #3a4757; background: #141a22; color: #fff; font: inherit }
input:focus { outline: none; border-color: #3b7ddd }
button { padding: 7px 12px; border-radius: 8px; border: 1px solid #3a4757; background: #2b3542; color: #e6ebf1; font: inherit; cursor: pointer }
button:hover { background: #323d4b } button.primary { background: #3b7ddd; border-color: #3b7ddd; color: #fff } button.primary:hover { background: #4a8cf0 }
#close { border: 0; background: none; font-size: 20px; line-height: 1; padding: 2px 6px; color: #9aa7b6 }
#reports { white-space: pre-wrap; font: 11px/1.4 ui-monospace, monospace; color: #9aa7b6; margin: 4px 0 0 }

/* ---------- sign-in intro: the box as it opens with the app (Peter, 6 Dec: "our icon, Sign in, no DeepSeek") ---------- */
#controls { transition: opacity .45s ease }
#controls.out { opacity: 0; pointer-events: none }
#hello, .aura { display: none }
#controls.intro { background: radial-gradient(120% 90% at 50% 38%, #18202c 0%, #0d1118 62%, #080a0f 100%); overflow: hidden }
#controls.intro .aura { display: block; position: absolute; inset: 0; pointer-events: none; filter: blur(70px); opacity: .55 }
.aura i { position: absolute; width: 38vmin; height: 38vmin; border-radius: 50%; left: 50%; top: 36%; mix-blend-mode: screen; animation: drift 14s ease-in-out infinite alternate }
.aura i:nth-child(1) { background: #8b4fe0; transform: translate(-50%, -78%) }
.aura i:nth-child(2) { background: #10b981; transform: translate(-108%, -18%); animation-delay: -5s }
.aura i:nth-child(3) { background: #2f6fe6; transform: translate(8%, -18%); animation-delay: -9s }
@keyframes drift { to { margin-left: 3vmin; margin-top: -2vmin; opacity: .7 } }
#controls.intro .card { position: relative; background: transparent; border: 0; box-shadow: none; text-align: center; width: min(380px, calc(100vw - 40px)); padding: 0; overflow: visible; animation: rise .9s cubic-bezier(.2,.8,.2,1) both }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98) } }
#controls.intro #hello { display: block; margin-bottom: 26px }
#controls.intro .head, #controls.intro #spend { display: none }
.mark { width: 132px; height: 132px; margin: 0 auto 22px; position: relative; animation: breathe 5.5s ease-in-out infinite }
.mark::before { content: ''; position: absolute; inset: -18px; border-radius: 50%; background: radial-gradient(circle, rgba(120,140,255,.28), rgba(0,0,0,0) 68%) }
.mark img { position: relative; width: 100%; height: 100%; filter: drop-shadow(0 10px 28px rgba(60,90,220,.45)) }
@keyframes breathe { 50% { transform: translateY(-4px) scale(1.025) } }
#hello h1 { margin: 0; font-size: 34px; font-weight: 300; letter-spacing: .32em; text-indent: .32em; color: #f3f6fb }
#hello .sub { margin: 10px 0 0; color: #8d9aab; font-size: 14px; letter-spacing: .01em }
#controls.intro #state { color: #8d9aab; font-size: 12.5px; min-height: 1.4em; margin-top: 14px }
#controls.intro #passkeys { height: 56px; margin: 8px 0 0; border-radius: 999px; box-shadow: 0 10px 34px rgba(47,111,230,.32) }
#controls.intro #entry input { text-align: center; border-radius: 12px; background: rgba(20,26,34,.75); border-color: #2c3746; padding: 11px 14px }
#controls.intro details { text-align: left; margin-top: 26px; opacity: .8 }
#controls.intro summary { text-align: center; font-size: 12px; color: #6f7c8d; list-style: none }
#controls.intro summary::-webkit-details-marker { display: none }
#controls.intro details[open] { background: rgba(28,35,46,.92); border: 1px solid #2c3746; border-radius: 14px; padding: 12px 16px; opacity: 1 }
/* the one Touch ID button, inside its own passkey frame */
#tap.primary { height: 52px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); font-size: 15.5px; font-weight: 600; letter-spacing: .01em;
  background: linear-gradient(135deg, #6d4fe0 0%, #2f6fe6 55%, #12a57a 100%); color: #fff; box-shadow: 0 2px 6px rgba(47,111,230,.35), inset 0 1px 0 rgba(255,255,255,.18);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease }
#tap.primary:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 2px 8px rgba(47,111,230,.5), inset 0 1px 0 rgba(255,255,255,.22) }
#tap.primary:active:not(:disabled) { transform: scale(.985) }
#tap:disabled { height: 52px; border-radius: 999px; background: rgba(43,53,66,.6); color: #9aa7b6; border-color: #2c3746 }
@media (prefers-reduced-motion: reduce) { .aura i, .mark, #controls.intro .card { animation: none } }

/* ---------- Approve with Touch ID: Auma asked in her chat; the exact card, hashed here, one fingerprint ---------- */
#controls.approve .head, #controls.approve #entry, #controls.approve #spend, #controls.approve details { display: none }
#controls.approve .card { border-color: #3b4a7a; box-shadow: 0 24px 70px rgba(20,30,80,.6), 0 0 0 1px rgba(109,79,224,.25) }
#ask[hidden], #ask-row[hidden] { display: none }
.ask-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px } .ask-head h2 { font-size: 16px }
#ask dl { display: grid; grid-template-columns: 52px 1fr; gap: 4px 10px; margin: 8px 0; font-size: 13px }
#ask dt { color: #8d9aab } #ask dd { margin: 0; color: #e6ebf1; overflow-wrap: anywhere }
#ask-args { max-height: 180px; overflow: auto; background: #141a22; border: 1px solid #2c3746; border-radius: 8px; padding: 8px 10px; margin: 6px 0;
  font: 11.5px/1.45 ui-monospace, monospace; color: #c8d1dc; white-space: pre-wrap; overflow-wrap: anywhere }
#ask-args:empty { display: none }
#ask code { font: 11px ui-monospace, monospace; color: #9aa7b6 }
#ask-row { justify-content: center } #ask-deny { min-width: 120px }
#controls.approve #passkeys { height: 58px }

/* KEYMAKER: one row per connection */
#keymaker { width: 100%; border-collapse: collapse; margin: 4px 0 10px; font-size: 13px }
#keymaker td { padding: 5px 6px; border-bottom: 1px solid rgba(127, 127, 127, .18); vertical-align: middle }
#keymaker td:first-child { font-weight: 600 }
#keymaker .km-state { opacity: .75 }
#keymaker select { font: inherit; padding: 2px 4px }
