:root {
  /* Deep teal-ink base — not the usual navy */
  --bg: #071310;
  --bg-deep: #040b09;

  /* Kingfisher palette: electric teal back + copper/amber breast */
  --teal: #1fd1a3;
  --teal-bright: #34f0be;
  --copper: #ff8a4c;
  --amber: #ffb35c;
  --gold: #ffd27a;

  /* Warm cream ink, sage muted */
  --text: #f4eee1;
  --muted: #9ba79a;
  --faint: #66756b;

  --glass: rgba(255, 250, 240, 0.05);
  --glass-strong: rgba(255, 250, 240, 0.08);
  --stroke: rgba(255, 250, 240, 0.1);
  --stroke-soft: rgba(255, 250, 240, 0.06);

  --grad: linear-gradient(118deg, var(--teal) 0%, var(--gold) 52%, var(--copper) 100%);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; }
::selection { background: rgba(31, 209, 163, 0.35); color: #fff; }

/* ---------------- Living background ---------------- */
#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.aurora {
  position: fixed;
  inset: -20% -10%;
  z-index: 0;
  filter: blur(88px);
  pointer-events: none;
  opacity: 0.9;
}
.blob {
  position: absolute;
  width: 46vw;
  height: 46vw;
  border-radius: 50%;
  mix-blend-mode: screen;
  will-change: transform;
}
.b1 {
  background: radial-gradient(circle at 30% 30%, rgba(31, 209, 163, 0.55), transparent 62%);
  top: -8%; left: -6%;
  animation: drift1 22s var(--ease) infinite alternate;
}
.b2 {
  background: radial-gradient(circle at 60% 40%, rgba(255, 138, 76, 0.42), transparent 62%);
  top: 8%; right: -12%;
  animation: drift2 28s var(--ease) infinite alternate;
}
.b3 {
  background: radial-gradient(circle at 50% 50%, rgba(255, 205, 110, 0.32), transparent 62%);
  bottom: -22%; left: 22%;
  animation: drift3 32s var(--ease) infinite alternate;
}
@keyframes drift1 { to { transform: translate(14vw, 10vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-12vw, 14vh) scale(1.1); } }
@keyframes drift3 { to { transform: translate(8vw, -12vh) scale(1.2); } }

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------- The signature orb ---------------- */
.orb {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--grad);
  position: relative;
  animation: orbGlow 5s ease-in-out infinite alternate;
}
.orb::after {
  content: "";
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0) 60%);
}
@keyframes orbGlow {
  from { box-shadow: 0 0 14px rgba(31, 209, 163, 0.4), 0 0 24px rgba(255, 138, 76, 0.18), inset 0 0 12px rgba(255, 255, 255, 0.3); }
  to   { box-shadow: 0 0 24px rgba(31, 209, 163, 0.68), 0 0 44px rgba(255, 138, 76, 0.4), inset 0 0 12px rgba(255, 255, 255, 0.4); }
}

/* ---------------- Layout ---------------- */
#app {
  position: relative;
  z-index: 2;
  display: flex;
  height: 100vh;
  padding: 16px;
  gap: 16px;
}

/* ---------------- Dock ---------------- */
.dock {
  flex: 0 0 auto;
  /* Sit above .main so the nav tooltips, which overflow the dock to the right,
     render over the proxy iframe instead of being clipped behind it. */
  position: relative;
  z-index: 10;
  width: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--stroke);
  border-radius: 26px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.orb-mark {
  width: 38px; height: 38px;
  padding: 0;
  margin-bottom: 8px;
  transition: transform 0.3s var(--ease);
}
.orb-mark:hover { transform: scale(1.12) rotate(8deg); }
/* Dock brand mark is a rounded tile (matches the favicon); other orbs stay round */
.orb-mark .orb, .orb-mark .orb::after { border-radius: 11px; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav-spacer { flex: 1; }
.nav-btn {
  position: relative;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 15px;
  color: var(--muted);
  transition: color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.nav-btn svg { width: 21px; height: 21px; fill: currentColor; transition: transform 0.2s var(--ease); }
.nav-btn:hover { color: var(--text); background: var(--glass-strong); }
.nav-btn:hover svg { transform: scale(1.1); }
.nav-btn.active {
  color: #fff;
  background: linear-gradient(160deg, rgba(31, 209, 163, 0.26), rgba(255, 138, 76, 0.12));
  box-shadow: inset 0 0 0 1px rgba(52, 240, 190, 0.4), 0 6px 18px rgba(31, 209, 163, 0.22);
}
.nav-btn.active::before {
  content: "";
  position: absolute;
  left: -14px; top: 50%;
  width: 3px; height: 20px;
  border-radius: 3px;
  background: var(--grad);
  transform: translateY(-50%);
}
.nav-btn.danger:hover { color: #ff7a7a; background: rgba(255, 90, 90, 0.12); }
.tip {
  position: absolute;
  left: 58px;
  padding: 6px 11px;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  background: rgba(10, 20, 17, 0.94);
  border: 1px solid var(--stroke);
  border-radius: 9px;
  opacity: 0;
  transform: translateX(-6px);
  pointer-events: none;
  transition: opacity 0.16s, transform 0.16s var(--ease);
  z-index: 5;
}
.nav-btn:hover .tip { opacity: 1; transform: none; }

/* ---------------- Main / views ---------------- */
.main {
  position: relative;
  /* Own stacking context below the dock (z-index:10) so the proxy iframe and
     its descendants can't paint over the dock's hover tooltips. */
  z-index: 1;
  flex: 1;
  border-radius: 26px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* Positioning context for the (absolutely-stacked) views, below the tab bar. */
.viewport { position: relative; flex: 1; min-height: 0; }
.view {
  position: absolute;
  inset: 0;
  padding: 46px 5vw;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.99);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), visibility 0.4s;
}
.view.active { opacity: 1; visibility: visible; transform: none; }
.view.proxy { padding: 0; }
.view::-webkit-scrollbar { width: 10px; }
.view::-webkit-scrollbar-thumb { background: var(--stroke); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

/* ---------------- Home ---------------- */
.hero {
  max-width: 780px;
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.greeting {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.2px;
  color: var(--muted);
  margin: 0 0 20px;
  padding: 7px 16px;
  border: 1px solid var(--stroke-soft);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(10px);
}
.logo-line { display: flex; align-items: center; gap: 20px; }
.hero-orb { width: 54px; height: 54px; display: block; filter: drop-shadow(0 6px 22px rgba(31, 209, 163, 0.5)); }
.wordmark {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 92px;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
  margin: 0;
  /* Palindrome (ends match) + horizontal + scrolled exactly one tile = seamless */
  background: linear-gradient(90deg, #fff5e4, #ffe4b8, #d3fff0, #ffe4b8, #fff5e4);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 7s linear infinite;
}
@keyframes shimmer { from { background-position: 0 0; } to { background-position: 200% 0; } }
.tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  color: var(--muted);
  font-size: 20px;
  margin: 16px 0 42px;
}

.omni {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 22px;
  background: var(--glass-strong);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  position: relative;
  transition: transform 0.3s var(--ease);
}
.omni::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 999px;
  padding: 1px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none; /* let clicks reach the input + Go button underneath */
}
.omni:focus-within { transform: translateY(-2px); }
.omni:focus-within::before { opacity: 1; }
.omni-icon { width: 21px; height: 21px; fill: var(--muted); flex: 0 0 auto; }
.omni input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 17px;
  padding: 12px 0;
}
.omni input::placeholder { color: var(--faint); }
.omni-go {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--grad);
  color: #0a1a14;
  border-radius: 999px;
  padding: 13px 22px;
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.14s, filter 0.14s, box-shadow 0.14s;
  box-shadow: 0 8px 22px rgba(31, 209, 163, 0.3), 0 4px 14px rgba(255, 138, 76, 0.2);
}
.omni-go svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.omni-go:hover { filter: brightness(1.07); box-shadow: 0 10px 28px rgba(31, 209, 163, 0.45), 0 6px 18px rgba(255, 138, 76, 0.3); }
.omni-go:active { transform: scale(0.96); }

.ql-label {
  align-self: flex-start;
  margin: 42px 0 14px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--faint);
}
.quicklinks { display: flex; flex-wrap: wrap; gap: 12px; width: 100%; }
.ql {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 11px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--stroke-soft);
  border-radius: 14px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s;
}
.ql:hover {
  transform: translateY(-3px);
  background: var(--glass-strong);
  border-color: color-mix(in srgb, var(--glow, var(--teal)) 55%, transparent);
}
.ql .ico {
  width: 26px; height: 26px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--glow, #000) 45%, transparent);
}

/* ---------------- View headers ---------------- */
.view-head { max-width: 1040px; margin: 6px auto 30px; }
.view-head h2 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 44px; font-weight: 600; letter-spacing: -0.5px; margin: 0 0 6px;
}
.view-head p { color: var(--muted); margin: 0; font-size: 15px; }

/* ---------------- Apps grid ---------------- */
.grid {
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 16px;
}
.card {
  position: relative;
  overflow: hidden;
  background: var(--glass);
  backdrop-filter: blur(14px);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius);
  padding: 26px 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  transition: transform 0.28s var(--ease), border-color 0.28s, box-shadow 0.28s;
}
.card::before {
  content: "";
  position: absolute;
  top: -40%; left: 50%;
  width: 120%; height: 80%;
  transform: translateX(-50%);
  background: radial-gradient(circle, color-mix(in srgb, var(--glow, var(--teal)) 42%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.32s;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--glow, var(--teal)) 55%, transparent);
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.5);
}
.card:hover::before { opacity: 0.55; }
.card .tile {
  width: 56px; height: 56px;
  border-radius: 17px;
  display: grid; place-items: center;
  font-size: 23px; font-weight: 800; color: #fff;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--glow, #000) 50%, transparent), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform 0.28s var(--ease);
  position: relative; z-index: 1;
}
.card:hover .tile { transform: scale(1.08) translateY(-2px); }
.card .card-name { font-size: 14px; font-weight: 600; position: relative; z-index: 1; }

/* ---------------- Settings ---------------- */
.settings { max-width: 660px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.set-card {
  background: var(--glass);
  backdrop-filter: blur(14px);
  border: 1px solid var(--stroke-soft);
  border-radius: 16px;
  padding: 20px 22px;
}
.field { display: flex; flex-direction: column; gap: 9px; }
.field-label { font-size: 14.5px; font-weight: 600; }
.field-hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.field input[type="text"], .select-wrap select {
  width: 100%;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid var(--stroke);
  border-radius: 11px;
  padding: 13px 15px;
  color: var(--text);
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.field input[type="text"]:focus, .select-wrap select:focus {
  border-color: rgba(31, 209, 163, 0.7);
  box-shadow: 0 0 0 3px rgba(31, 209, 163, 0.16);
}
.select-wrap { position: relative; }
.select-wrap::after {
  content: "";
  position: absolute; right: 16px; top: 50%;
  width: 8px; height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.select-wrap select { appearance: none; -webkit-appearance: none; cursor: pointer; }

.wipe-btn {
  align-self: flex-start;
  margin-top: 4px;
  padding: 11px 20px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  color: #ff9a9a;
  background: rgba(255, 90, 90, 0.1);
  border: 1px solid rgba(255, 90, 90, 0.28);
  transition: background 0.16s, transform 0.12s;
}
.wipe-btn:hover { background: rgba(255, 90, 90, 0.18); }
.wipe-btn:active { transform: scale(0.97); }

.credits > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.credits > summary::-webkit-details-marker { display: none; }
.credits .credits-chevron {
  display: inline-block;
  color: var(--teal);
  transition: transform 0.2s var(--ease);
}
.credits[open] .credits-chevron { transform: rotate(90deg); }
.credit-list {
  margin: 14px 0 2px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.credit-list a { color: var(--teal); text-decoration: none; font-weight: 600; }
.credit-list a:hover { color: var(--teal-bright); text-decoration: underline; }

.toggle-field { flex-direction: row; align-items: center; justify-content: space-between; gap: 20px; cursor: pointer; }
.toggle-field > div { display: flex; flex-direction: column; gap: 5px; }
.switch { position: relative; flex: 0 0 auto; width: 50px; height: 28px; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch .track {
  position: absolute; inset: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  transition: background 0.24s;
}
.switch .track::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.26s var(--ease);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.switch input:checked + .track { background: var(--grad); }
.switch input:checked + .track::after { transform: translateX(22px); }
kbd {
  background: rgba(255, 255, 255, 0.1); border: 1px solid var(--stroke);
  border-radius: 6px; padding: 1px 7px; font-size: 11px; font-family: ui-monospace, monospace;
}

/* ---------------- Proxy view ---------------- */
.proxy { display: flex; flex-direction: column; background: rgba(7, 15, 12, 0.6); }
.topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--stroke-soft);
}
.tb-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: var(--muted);
  transition: all 0.16s;
}
.tb-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tb-btn:hover { background: var(--glass-strong); color: var(--text); }
.tb-omni {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  transition: border-color 0.18s;
}
.tb-omni:focus-within { border-color: rgba(31, 209, 163, 0.6); }
.tb-lock svg { width: 15px; height: 15px; fill: none; stroke: var(--teal); stroke-width: 2; }
.tb-omni input {
  flex: 1;
  background: transparent; border: none; outline: none;
  color: var(--text); font-size: 14px; padding: 11px 0;
}
.frame-wrap { flex: 1; position: relative; background: #fff; }
.frames { position: absolute; inset: 0; }
.frames .frame {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: none; background: #fff;
}

/* ---- Tab strip ---- */
.tabstrip {
  display: flex; align-items: flex-end; gap: 4px;
  padding: 8px 12px 0;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabstrip::-webkit-scrollbar { display: none; }
.tab {
  display: flex; align-items: center; gap: 8px;
  flex: 0 1 190px; min-width: 44px; max-width: 190px;
  padding: 9px 8px 9px 13px;
  border-radius: 12px 12px 0 0;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent; border-bottom: none;
  font-size: 13px; cursor: pointer;
  transition: background 0.16s, color 0.16s;
}
.tab:hover { background: var(--glass-strong); color: var(--text); }
.tab.active {
  background: rgba(7, 15, 12, 0.6);
  color: var(--text);
  border-color: var(--stroke-soft);
}
:root[data-theme="light"] .tab.active { background: rgba(243, 236, 221, 0.85); }
.tab .t-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab .t-close {
  flex: none; width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 6px; font-size: 15px; line-height: 1;
  color: var(--muted);
}
.tab .t-close:hover { background: var(--stroke); color: var(--text); }
.tab-new {
  flex: none; width: 34px; height: 34px; margin-bottom: 1px;
  display: grid; place-items: center;
  border-radius: 10px; font-size: 20px; line-height: 1;
  color: var(--muted);
}
.tab-new:hover { background: var(--glass-strong); color: var(--text); }

/* ---- Bookmark star + bookmark tiles ---- */
#tb-bookmark.active { color: var(--teal); }
#tb-bookmark.active svg { fill: var(--teal); stroke: var(--teal); }
.ql .bm-x {
  margin-left: 2px; width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 6px; font-size: 14px; line-height: 1;
  color: var(--faint); opacity: 0;
  transition: opacity 0.16s, background 0.16s, color 0.16s;
}
.ql:hover .bm-x { opacity: 1; }
.ql .bm-x:hover { background: var(--stroke); color: var(--text); }

/* ---- History view ---- */
.history-tools { max-width: 1040px; margin: 0 auto 18px; display: flex; }
.history-list { max-width: 1040px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.hist-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: 14px;
  background: var(--glass); border: 1px solid var(--stroke-soft);
  cursor: pointer; transition: background 0.16s, border-color 0.16s, transform 0.16s;
}
.hist-item:hover { background: var(--glass-strong); border-color: var(--stroke); transform: translateY(-1px); }
.hist-ico {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff;
}
.hist-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hist-title { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-url { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-time { flex: none; font-size: 12px; color: var(--faint); }
.hist-x {
  flex: none; width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 7px; font-size: 16px; color: var(--faint);
}
.hist-x:hover { background: var(--stroke); color: var(--text); }
.history-empty { max-width: 1040px; margin: 20px auto; color: var(--muted); }
.frame-loader {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: radial-gradient(circle at 50% 40%, #0a1712, var(--bg-deep));
  transition: opacity 0.4s;
}
.frame-loader.hidden { opacity: 0; pointer-events: none; }
.load-orb {
  width: 60px; height: 60px; display: block;
  animation: bob 2.4s var(--ease) infinite;
  filter: drop-shadow(0 10px 30px rgba(31, 209, 163, 0.55));
}
@keyframes bob { 50% { transform: translateY(-12px); } }
.load-text { color: var(--muted); font-family: var(--font-display); font-style: italic; font-size: 15px; margin: 0; }

/* ---------------- Responsive ---------------- */
@media (max-width: 680px) {
  #app { padding: 10px; gap: 10px; }
  .dock { width: 56px; border-radius: 20px; }
  .view { padding: 32px 22px; }
  .wordmark { font-size: 58px; letter-spacing: -1px; }
  .hero-orb { width: 40px; height: 40px; }
  .logo-line { gap: 14px; }
  .view-head h2 { font-size: 34px; }
  .omni-go span { display: none; }
  .omni-go { padding: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .blob, .orb, .wordmark, .load-orb { animation: none !important; }
}

/* ---------------- Theme toggle icon ---------------- */
#theme-btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#theme-btn .ic-moon { display: none; }
:root[data-theme="light"] #theme-btn .ic-sun { display: none; }
:root[data-theme="light"] #theme-btn .ic-moon { display: block; }

/* ================ LIGHT · "halcyon daytime" ================ */
:root[data-theme="light"] {
  --bg: #f3ecdd;
  --bg-deep: #ece3d1;

  /* Deepen the accents so they hold up on paper */
  --teal: #0f9b78;
  --teal-bright: #16c096;
  --copper: #dd5f28;
  --amber: #ec8f2c;
  --gold: #d9a441;

  --text: #1b2621;
  --muted: #5c6a5f;
  --faint: #93a08f;

  --glass: rgba(255, 255, 255, 0.52);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --stroke: rgba(28, 46, 36, 0.14);
  --stroke-soft: rgba(28, 46, 36, 0.08);
}

/* Sunlight-through-water aurora: multiply so the tints show on paper */
:root[data-theme="light"] .aurora { opacity: 0.55; filter: blur(96px); }
:root[data-theme="light"] .blob { mix-blend-mode: multiply; }
:root[data-theme="light"] .b1 {
  background: radial-gradient(circle at 30% 30%, rgba(16, 190, 150, 0.5), transparent 62%);
}
:root[data-theme="light"] .b2 {
  background: radial-gradient(circle at 60% 40%, rgba(240, 130, 60, 0.42), transparent 62%);
}
:root[data-theme="light"] .b3 {
  background: radial-gradient(circle at 50% 50%, rgba(230, 175, 70, 0.4), transparent 62%);
}
:root[data-theme="light"] #stars { opacity: 0; }
:root[data-theme="light"] .grain { opacity: 0.05; mix-blend-mode: multiply; }

/* Wordmark: ink gradient legible on cream */
:root[data-theme="light"] .wordmark {
  background: linear-gradient(90deg, #0e6b54, #14a07d, #cf8a2c, #14a07d, #0e6b54);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Soften the heavy dark shadows for daylight */
:root[data-theme="light"] .dock { box-shadow: 0 18px 44px rgba(45, 60, 50, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
:root[data-theme="light"] .omni { box-shadow: 0 20px 46px rgba(45, 60, 50, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
:root[data-theme="light"] .card:hover { box-shadow: 0 20px 40px rgba(45, 60, 50, 0.16); }
:root[data-theme="light"] .tip { background: rgba(255, 253, 248, 0.96); color: var(--text); }

/* Inset fields go light instead of black */
:root[data-theme="light"] .field input[type="text"],
:root[data-theme="light"] .select-wrap select,
:root[data-theme="light"] .tb-omni { background: rgba(255, 255, 255, 0.6); }
:root[data-theme="light"] .switch .track { background: rgba(28, 46, 36, 0.16); }
:root[data-theme="light"] .nav-btn.active { color: #123f31; }
:root[data-theme="light"] .omni-go { color: #0a1a14; }

/* Proxy chrome + loader for daylight */
:root[data-theme="light"] .proxy { background: rgba(243, 236, 221, 0.7); }
:root[data-theme="light"] .frame-loader {
  background: radial-gradient(circle at 50% 40%, #fbf6ec, var(--bg-deep));
}
:root[data-theme="light"] ::selection { background: rgba(15, 155, 120, 0.28); color: #06130f; }
