:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #080e1b;
  color: #f1f6ff;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 280px;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 0, #14243e 0, #080e1b 65%);
}
.launcher { width: min(100% - 40px, 620px); margin: 0 auto; padding: 30px 0 24px; }
.welcome { text-align: center; }
.app-icon {
  display: block;
  width: 144px;
  height: 144px;
  object-fit: contain;
  border-radius: 22%;
  margin: 0 auto 18px;
  filter: drop-shadow(0 12px 30px #01071380);
}
.eyebrow { margin: 0 0 10px; color: #a7c5e4; font-size: 11px; font-weight: 650; letter-spacing: .17em; }
h1 { margin: 0; font-size: clamp(26px, 4vw, 34px); line-height: 1.15; letter-spacing: -.035em; font-weight: 650; }
.intro { margin: 12px 0 24px; color: #b5c3d9; font-size: 16px; line-height: 1.5; }
.launch-caption, .launcher-help-label, .back-to-launcher, .shortcut-setup-entry { display: none; }
.open-app {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-width: 230px;
  min-height: 54px;
  padding: 12px 24px;
  border: 1px solid #aee7ff;
  border-radius: 16px;
  background: #a6ddf5;
  color: #0a2234;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  box-shadow: 0 5px 22px #52b8df13;
}
.open-app:hover { background: #c7edff; }
.open-app:active { background: #91c8e5; }
.open-app:focus-visible, summary:focus-visible, .help-copy a:focus-visible, .back-to-launcher:focus-visible { outline: 3px solid #e9edff; outline-offset: 5px; }
.setup { margin-top: 30px; padding: 22px 26px; background: #111d30; border: 1px solid #2b3a51; border-radius: 20px; }
h2 { margin: 0 0 10px; font-size: 17px; letter-spacing: -.01em; font-weight: 650; }
.setup-intro { margin: 0 0 14px; color: #b6c8df; font-size: 14px; line-height: 1.5; }
.shortcut-path { list-style: none; padding: 0; margin: 0; display: flex; align-items: center; gap: 12px; }
.shortcut-path li { display: flex; align-items: center; gap: 10px; color: #d4e0ef; font-size: 14px; line-height: 1.5; }
.menu-symbol { flex: 0 0 30px; display: grid; place-items: center; width: 30px; height: 36px; border: 1px solid #607b94; border-radius: 9px; color: #d7f1ff; font-size: 24px; }
.path-arrow { color: #819db8; font-size: 19px; }
.shortcut-guide { margin-top: 14px; border-top: 1px solid #2b3a51; }
.shortcut-guide summary { width: fit-content; max-width: 100%; color: #c7e9fb; padding-inline: 4px; font-size: 14px; }
.guide-copy > p { margin: 4px 0 14px; color: #b6c8df; font-size: 14px; line-height: 1.6; }
.browser-guide { margin: 0; }
.browser-sketch { border: 1px solid #45576e; border-radius: 14px; overflow: hidden; background: #0b1321; }
.guide-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: #1c2839; border-bottom: 1px solid #384b62; }
.guide-address { min-width: 0; color: #afbed0; font-size: 13px; }
.guide-dots { position: relative; flex: 0 0 38px; height: 38px; display: grid; place-items: center; border: 2px solid #a6ddf5; border-radius: 10px; background: #233d50; color: #fff; font-size: 27px; }
.guide-number { flex: 0 0 22px; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #b6e4f8; color: #102335; font-size: 12px; font-weight: 750; }
.guide-dots .guide-number { position: absolute; right: 27px; top: -6px; }
.guide-dropdown { width: min(100% - 32px, 300px); margin: 0 16px 18px auto; padding: 12px; border: 1px solid #40546a; border-top: 0; border-radius: 0 0 12px 12px; background: #1a283b; }
.guide-menu-line { display: block; width: 44%; height: 5px; margin: 2px 10px 12px; border-radius: 3px; background: #405066; }
.guide-menu-line-short { width: 30%; margin-top: 12px; margin-bottom: 2px; }
.guide-choice { display: flex; align-items: center; gap: 9px; padding: 9px; border: 1px solid #91cde6; border-radius: 8px; background: #243f52; color: #e8f8ff; font-size: 13px; line-height: 1.5; }
.guide-confirm { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 16px 16px; padding: 14px; border: 1px solid #3a4e67; border-radius: 10px; background: #19263a; color: #dce9f8; font-size: 13px; line-height: 1.5; }
.guide-add { display: flex; align-items: center; flex-shrink: 0; gap: 8px; padding: 7px 12px 7px 8px; border: 1px solid #a6ddf5; border-radius: 8px; color: #e8f8ff; background: #243f52; font-weight: 650; }
figcaption { margin-top: 10px; color: #a2b1c8; font-size: 12px; line-height: 1.5; }
strong { color: #f1f6ff; font-weight: 600; }
.caption { margin: 16px 0 0; color: #a2b1c8; font-size: 12px; line-height: 1.5; }
.help { margin-top: 8px; color: #b6c8df; font-size: 14px; }
summary { min-height: 48px; padding: 14px 8px; cursor: pointer; border-radius: 8px; }
.help-copy { padding: 0 10px 8px; line-height: 1.65; }
.help-copy p { margin: 0 0 12px; }
footer { margin-top: 8px; text-align: center; color: #96a7c2; font-size: 12px; line-height: 1.5; }
@media (min-width: 700px) and (max-height: 700px) {
  .launcher { padding-top: 20px; }
  .app-icon { width: 102px; height: 102px; margin-bottom: 12px; }
  .intro { margin-bottom: 18px; }
  .setup { margin-top: 22px; padding-top: 18px; padding-bottom: 18px; }
}
@media (max-width: 420px) {
  .launcher { width: calc(100% - 32px); padding-top: 24px; }
  .app-icon { width: 112px; height: 112px; }
  .setup { padding: 20px 18px; }
  .open-app { width: 100%; min-width: 0; }
}
@media (max-width: 620px) {
  .shortcut-path { flex-direction: column; align-items: stretch; gap: 8px; }
  .path-arrow { display: grid; place-items: center; width: 30px; flex: 0 0 30px; transform: rotate(90deg); }
}
/* Library windows expose their actual display mode. Keep the existing URL,
   manifest identity and native link: older saved shortcuts continue to work.
   Unknown/ordinary browser modes retain the complete setup view. */
@media (display-mode: standalone), (display-mode: minimal-ui), (display-mode: window-controls-overlay) {
  .launcher { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-block: 48px; }
  .welcome { flex: 0 0 auto; }
  .app-icon { width: 152px; height: 152px; margin-bottom: 24px; }
  h1 { font-size: clamp(28px, 4vw, 38px); }
  .eyebrow, .intro, footer, .browser-help-label { display: none; }
  .open-app { margin-top: 30px; min-width: min(250px, 100%); min-height: 56px; }
  .launch-caption { display: block; margin: 18px 0 0; color: #a5b7d0; font-size: 14px; line-height: 1.6; }
  .setup { display: none; flex: 0 0 auto; scroll-margin-top: 20px; }
  .setup:target { display: block; }
  .setup:target ~ .help { display: none; }
  .help { align-self: center; width: min(100%, 480px); margin-top: 26px; }
  .help > summary { width: fit-content; max-width: 100%; margin-inline: auto; padding-inline: 12px; color: #b1c5dd; }
  .launcher-help-label { display: inline; }
  .help[open] { border: 1px solid #2b3a51; border-radius: 16px; background: #111d30; }
  .help-copy { padding: 4px 20px 16px; text-align: left; }
  .shortcut-setup-entry { display: block; }
  .help-copy a, .back-to-launcher { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding-inline: 4px; border-radius: 6px; color: #c7e9fb; text-decoration: underline; text-underline-offset: 4px; }
  .back-to-launcher { margin-top: 8px; }
}
@media (display-mode: standalone) and (max-height: 500px), (display-mode: minimal-ui) and (max-height: 500px), (display-mode: window-controls-overlay) and (max-height: 500px) {
  .launcher { padding-block: 20px; }
  .app-icon { width: 96px; height: 96px; margin-bottom: 16px; }
  .open-app { margin-top: 22px; }
  .help { margin-top: 14px; }
}
@media (forced-colors: active) {
  .open-app, .setup { border: 1px solid ButtonText; }
  .guide-number { border: 1px solid CanvasText; }
}
