:root {
  --ink: #f8f7ff;
  --muted: rgba(248, 247, 255, 0.64);
  --line: rgba(0, 255, 255, 0.2);
  --panel: rgba(26, 26, 46, 0.78);
  --panel-solid: #1A1A2E;
  --accent: #00FFFF;
  --accent-ink: #07101f;
  --magenta: #FF00FF;
  --purple: #8A2BE2;
  --danger: #FF073A;
  --shade-opacity: 0.58;
  --radius: 26px;
  --font-ui: "Bahnschrift", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --font-display: "SF Pro Display", "Bahnschrift SemiCondensed", "Bahnschrift", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: #1A1A2E;
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wallpaper {
  position: fixed;
  z-index: -2;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 0, 255, 0.28), transparent 28%),
    radial-gradient(circle at 16% 22%, rgba(0, 255, 255, 0.25), transparent 34%),
    linear-gradient(145deg, #1A1A2E 0%, #17172c 45%, #0d0b1d 100%);
}

.wallpaper.is-neon {
  background:
    radial-gradient(circle at 14% 18%, rgba(0, 255, 255, 0.58), transparent 28%),
    radial-gradient(circle at 84% 14%, rgba(255, 0, 255, 0.54), transparent 30%),
    radial-gradient(circle at 76% 82%, rgba(255, 7, 58, 0.42), transparent 27%),
    radial-gradient(circle at 28% 78%, rgba(138, 43, 226, 0.58), transparent 32%),
    linear-gradient(145deg, #1A1A2E 0%, #121129 52%, #080716 100%);
}

.wallpaper::before {
  position: absolute;
  content: "";
  inset: -2%;
  opacity: 0;
  background-image: var(--wallpaper-image);
  background-position: center;
  background-size: cover;
  filter: saturate(0.9) contrast(1.04);
  transition: opacity 500ms ease;
}

.wallpaper.has-image::before {
  opacity: 1;
}

.wallpaper.is-neon::before {
  opacity: 0.72;
  background-image:
    linear-gradient(115deg, transparent 0 46%, rgba(255, 0, 255, 0.16) 47% 48%, transparent 49% 100%),
    repeating-linear-gradient(90deg, transparent 0 71px, rgba(0, 255, 255, 0.1) 72px 73px),
    repeating-linear-gradient(0deg, transparent 0 71px, rgba(138, 43, 226, 0.1) 72px 73px);
  background-position: center;
  background-size: auto;
  filter: none;
}

.wallpaper.is-neon .wallpaper__shade {
  background:
    linear-gradient(to bottom, rgba(26, 26, 46, 0.08), rgba(8, 7, 22, 0.54)),
    rgba(26, 26, 46, var(--shade-opacity));
}

.wallpaper.is-neon .wallpaper__aurora--one {
  background: linear-gradient(135deg, #00FFFF, #8A2BE2);
}

.wallpaper.is-neon .wallpaper__aurora--two {
  background: linear-gradient(135deg, #FF00FF, #FF073A);
}

.wallpaper.is-neon .wallpaper__grid {
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(0, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 0, 255, 0.16) 1px, transparent 1px);
}

.wallpaper__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(10, 8, 27, 0.08), rgba(10, 8, 27, 0.66)),
    rgba(10, 8, 27, var(--shade-opacity));
}

.wallpaper.is-loading::after {
  position: absolute;
  content: "";
  inset: 0;
  opacity: 0.7;
  background: repeating-linear-gradient(110deg, transparent 0 12px, rgba(0, 255, 255, 0.08) 13px 14px);
  animation: scanline 800ms linear infinite;
}

.wallpaper__aurora {
  position: absolute;
  width: 52vw;
  height: 52vw;
  border-radius: 48% 52% 45% 55%;
  opacity: 0.48;
  filter: blur(90px);
  animation: drift 18s ease-in-out infinite alternate;
}

.wallpaper__aurora--one {
  top: -28vw;
  left: -16vw;
  background: #00FFFF;
}

.wallpaper__aurora--two {
  right: -20vw;
  bottom: -30vw;
  background: #FF00FF;
  animation-delay: -7s;
}

.wallpaper__grid {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.11) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, transparent 10%, black 60%, transparent 100%);
}

@keyframes drift {
  to {
    transform: translate3d(8vw, 5vw, 0) rotate(14deg) scale(1.08);
  }
}

@keyframes scanline {
  to { transform: translateX(28px); }
}

.app-shell {
  width: min(100%, 1680px);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 70px);
}

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand__mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--accent-ink);
  border-radius: 50% 50% 50% 12%;
  background: linear-gradient(135deg, var(--accent), var(--magenta));
  box-shadow: 0 0 28px rgba(0, 255, 255, 0.32), 12px 10px 34px rgba(255, 0, 255, 0.2);
  font-size: 22px;
  font-weight: 900;
  transform: rotate(-8deg);
}

.brand__copy {
  display: grid;
  gap: 1px;
}

.brand__copy strong {
  font-size: 14px;
  letter-spacing: 0.18em;
}

.brand__copy small {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.topbar__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tool-button,
.round-button,
.overlay-close,
.modal__close {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(6, 16, 16, 0.34);
  cursor: pointer;
  backdrop-filter: blur(14px);
}

.tool-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  height: 42px;
  padding: 0 15px;
  border-radius: 999px;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.tool-button:hover,
.round-button:hover,
.modal__close:hover,
.overlay-close:hover {
  border-color: rgba(200, 255, 87, 0.6);
  background: rgba(0, 255, 255, 0.1);
  transform: translateY(-1px);
}

.settings-trigger {
  position: relative;
  min-width: 104px;
  justify-content: center;
}

.settings-trigger i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 12px var(--magenta);
}

.tool-button svg,
.round-button svg,
.overlay-close svg,
.modal__close svg,
.search-prompt svg,
.search-box svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-button--icon {
  width: 42px;
  padding: 0;
  justify-content: center;
}

.hero {
  display: flex;
  min-height: min(810px, calc(100vh - 88px));
  padding: clamp(76px, 11vh, 128px) 0 54px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero__eyebrow {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  margin-bottom: clamp(26px, 4vh, 46px);
  font-size: clamp(16px, 1.6vw, 24px);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.hero__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent);
}

.clock {
  display: flex;
  align-items: baseline;
  margin: 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(112px, 21vw, 300px);
  font-stretch: condensed;
  font-variation-settings: "wdth" 78, "wght" 720;
  font-weight: 760;
  letter-spacing: -0.075em;
  line-height: 0.78;
  text-shadow: 0 18px 54px rgba(0, 0, 0, 0.26);
}

.clock__colon {
  display: inline-block;
  margin: 0 0.04em;
  color: var(--accent);
  text-shadow: 0 0 24px rgba(0, 255, 255, 0.6), 0 0 54px rgba(255, 0, 255, 0.32);
  font-size: 0.72em;
  letter-spacing: 0;
  transform: translateY(-0.07em);
  animation: pulse-colon 2s ease-in-out infinite;
}

.clock__seconds {
  min-width: 2.1ch;
  margin-left: 0.55em;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.17em;
  font-variation-settings: "wdth" 90, "wght" 460;
  font-weight: 500;
  letter-spacing: 0.02em;
}

@keyframes pulse-colon {
  50% {
    opacity: 0.5;
  }
}

.search-launchers {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: clamp(36px, 7vh, 64px) 0 0;
  flex-wrap: wrap;
}

.search-prompt {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 8px 10px 8px 8px;
  color: var(--muted);
  border: 0;
  border-radius: 999px;
  background: rgba(2, 10, 10, 0.3);
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.06em;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
  backdrop-filter: blur(18px);
}

.search-prompt--dictionary .shift-key {
  color: #ff8cff;
  border-color: rgba(255, 0, 255, 0.42);
}

.search-prompt--translate .shift-key {
  color: #ff6a84;
  border-color: rgba(255, 7, 58, 0.5);
}

.search-prompt:hover {
  color: var(--ink);
  background: rgba(2, 10, 10, 0.54);
  transform: translateY(-2px);
}

.search-prompt svg {
  width: 15px;
}

.shift-key,
kbd {
  padding: 4px 7px;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom-color: rgba(255, 255, 255, 0.32);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font-family: var(--font-ui);
  font-size: 9px;
  line-height: 1;
}

.world-clocks {
  display: grid;
  width: min(100%, 1180px);
  margin-top: clamp(48px, 8vh, 78px);
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.world-clock {
  position: relative;
  display: grid;
  min-width: 0;
  padding: 20px clamp(10px, 2vw, 28px) 22px;
  gap: 8px;
  text-align: left;
}

.world-clock + .world-clock::before {
  position: absolute;
  content: "";
  top: 20%;
  bottom: 20%;
  left: 0;
  width: 1px;
  background: var(--line);
}

.world-clock__top {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
}

.world-clock__city {
  overflow: hidden;
  font-size: clamp(12px, 1vw, 15px);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-clock__offset {
  color: var(--accent);
  font-size: 10px;
}

.world-clock__time {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.3vw, 38px);
  font-variation-settings: "wdth" 88, "wght" 560;
  letter-spacing: -0.03em;
}

.world-clock__day {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.reveal {
  opacity: 0;
  animation: reveal-up 700ms cubic-bezier(0.2, 0.75, 0.25, 1) forwards;
}

.reveal--one { animation-delay: 80ms; }
.reveal--two { animation-delay: 170ms; }
.reveal--three { animation-delay: 300ms; }
.reveal--four { animation-delay: 390ms; }

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.shortcuts-section {
  margin: 18px 0 50px;
  padding: clamp(30px, 5vw, 64px);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: clamp(24px, 4vw, 42px);
  background:
    linear-gradient(145deg, rgba(74, 67, 116, 0.52), rgba(31, 29, 62, 0.34)),
    radial-gradient(circle at 90% 8%, rgba(0, 255, 255, 0.11), transparent 34%);
  box-shadow: 0 30px 90px rgba(5, 4, 18, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.13), inset 0 0 70px rgba(255, 0, 255, 0.035);
  backdrop-filter: blur(22px) saturate(1.35) brightness(1.13);
}

.section-heading {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 34px;
}

.section-kicker,
.modal__kicker,
.search-panel__kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.section-heading h2,
.modal h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 3vw, 48px);
  font-variation-settings: "wdth" 90, "wght" 620;
  letter-spacing: -0.035em;
}

.section-heading__right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.shortcut-add-button {
  white-space: nowrap;
}

.page-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
}

.page-tab {
  min-width: 34px;
  height: 34px;
  padding: 0 11px;
  color: var(--muted);
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  transition: color 180ms ease, background 180ms ease;
}

.page-tab:hover {
  color: var(--ink);
}

.page-tab.is-active {
  color: var(--accent-ink);
  background: var(--accent);
  font-weight: 800;
}

.round-button,
.modal__close,
.overlay-close {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border-radius: 50%;
}

.tiles {
  display: grid;
  grid-auto-flow: dense;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px;
}

.tile {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 128px;
  padding: 16px;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  overflow: hidden;
  background: var(--tile-color, #177d74);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transform: translateZ(0);
  transition: transform 190ms ease, border-color 190ms ease, filter 190ms ease;
  isolation: isolate;
}

.tile::before {
  position: absolute;
  z-index: -1;
  content: "";
  inset: 0;
  opacity: 0.9;
  background:
    radial-gradient(circle at 90% 0%, rgba(0, 255, 255, 0.2), transparent 42%),
    linear-gradient(to bottom, rgba(9, 7, 27, 0.08), rgba(9, 7, 27, 0.58));
}

.tile::after {
  position: absolute;
  z-index: -1;
  content: "";
  right: -26px;
  bottom: -32px;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 50%;
}

.tile:hover {
  z-index: 2;
  border-color: var(--accent);
  box-shadow: 0 0 26px rgba(0, 255, 255, 0.16), 0 16px 36px rgba(10, 7, 28, 0.34);
  filter: brightness(1.07);
  transform: translateY(-5px) scale(1.015);
}

.tile.is-dragging {
  opacity: 0.48;
  transform: scale(0.96);
}

.tile.is-drag-target {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tile--wide {
  grid-column: span 2;
}

.tile__main {
  display: flex;
  min-width: 0;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
}

.tile__icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 13px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.tile__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile__copy {
  min-width: 0;
  width: 100%;
}

.tile__name {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile__host {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile__edit {
  position: absolute;
  z-index: 3;
  top: 9px;
  right: 9px;
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  color: white;
  border: 0;
  border-radius: 50%;
  opacity: 0;
  background: rgba(0, 0, 0, 0.32);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  transition: opacity 180ms ease, background 180ms ease;
}

.tile:hover .tile__edit,
.tile:focus-within .tile__edit {
  opacity: 1;
}

.tile__edit:hover {
  background: rgba(0, 0, 0, 0.58);
}

.empty-state {
  display: grid;
  min-height: 230px;
  padding: 30px;
  place-items: center;
  grid-column: 1 / -1;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  text-align: center;
}

.empty-state button {
  margin-top: 14px;
}

.drag-hint {
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.38);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-align: center;
}

.footer {
  display: flex;
  justify-content: space-between;
  padding: 12px 0 34px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.search-overlay {
  --search-accent: #00FFFF;
  position: fixed;
  z-index: 100;
  display: grid;
  inset: 0;
  padding: clamp(18px, 5vw, 72px);
  place-items: center;
  visibility: hidden;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--search-accent) 11%, transparent), transparent 42%),
    rgba(2, 8, 8, 0.8);
  backdrop-filter: blur(28px) saturate(0.8);
  transition: visibility 0s linear 260ms, opacity 260ms ease;
}

.search-overlay[data-mode="dictionary"] {
  --search-accent: #FF00FF;
}

.search-overlay[data-mode="translate"] {
  --search-accent: #FF073A;
}

.search-overlay.is-open {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.overlay-close {
  position: absolute;
  top: clamp(20px, 4vw, 48px);
  right: clamp(20px, 4vw, 48px);
}

.search-panel {
  width: min(1060px, 100%);
  transform: translateY(20px) scale(0.985);
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.search-overlay.is-open .search-panel {
  transform: translateY(0) scale(1);
}

.search-panel__kicker {
  margin-bottom: 20px;
  color: var(--search-accent);
  text-align: center;
}

.search-box {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 17px 20px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 22px;
  background: rgba(247, 249, 244, 0.96);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.26);
}

.search-box svg {
  width: 28px;
  color: #17302d;
  flex: 0 0 auto;
}

.search-box input {
  min-width: 0;
  width: 100%;
  color: #10201f;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 38px);
  font-variation-settings: "wdth" 92, "wght" 470;
}

.search-box input::placeholder {
  color: rgba(16, 32, 31, 0.42);
}

.search-box kbd {
  color: rgba(16, 32, 31, 0.56);
  border-color: rgba(16, 32, 31, 0.16);
  background: rgba(16, 32, 31, 0.06);
}

.engine-grid {
  display: grid;
  max-height: min(52vh, 480px);
  margin-top: 18px;
  padding: 4px;
  overflow: auto;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  scrollbar-width: thin;
}

.engine-choice {
  display: flex;
  min-width: 0;
  min-height: 104px;
  padding: 15px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.engine-choice:hover,
.engine-choice.is-selected {
  border-color: var(--search-accent);
  background: color-mix(in srgb, var(--search-accent) 13%, transparent);
  transform: translateY(-2px);
}

.engine-choice--all,
.engine-choice--all:hover,
.engine-choice--all.is-selected {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  border-color: color-mix(in srgb, var(--search-accent) 78%, #fff 22%);
  background-image:
    linear-gradient(180deg, rgba(10, 5, 13, 0.08), rgba(10, 5, 13, 0.9)),
    url("assets/i-want-them-all.png");
  background-position: center 28%;
  background-size: cover;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--search-accent) 28%, transparent);
}

.engine-choice--all > * {
  position: relative;
  z-index: 1;
}

.engine-choice--all .engine-choice__badge {
  width: auto;
  min-width: 34px;
  padding: 0 7px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(8, 5, 10, 0.64);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.engine-choice--all .engine-choice__name {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 8px #000;
}

.engine-choice__meta {
  max-width: 100%;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.7);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-panel__notice {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding: 10px 13px;
  color: rgba(255, 255, 255, 0.78);
  border: 1px solid color-mix(in srgb, var(--search-accent) 42%, transparent);
  border-left: 4px solid var(--search-accent);
  border-radius: 11px;
  background: color-mix(in srgb, var(--search-accent) 9%, rgba(8, 7, 18, 0.76));
  font-size: 10px;
  line-height: 1.45;
}

.search-panel__notice[hidden] {
  display: none;
}

.search-panel__notice strong {
  color: var(--search-accent);
  flex: 0 0 auto;
  letter-spacing: 0.08em;
}

.engine-choice__badge,
.engine-manager__badge {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--accent-ink);
  border-radius: 10px;
  background: var(--search-accent, var(--accent));
  font-weight: 900;
}

.engine-choice__name {
  max-width: 100%;
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-panel__footer {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-top: 18px;
  color: var(--muted);
  font-size: 10px;
}

.search-panel__footer kbd {
  display: inline-block;
  margin-right: 2px;
}

.search-panel__footer button {
  margin-left: auto;
  padding: 0;
  color: var(--search-accent);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}

.modal {
  width: min(560px, calc(100% - 28px));
  max-height: min(820px, calc(100vh - 32px));
  padding: 0;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 26px;
  overflow: auto;
  background: rgba(13, 27, 26, 0.96);
  box-shadow: 0 36px 120px rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(30px);
}

.modal::backdrop {
  background: rgba(1, 7, 7, 0.76);
  backdrop-filter: blur(14px);
}

.modal > form {
  padding: clamp(24px, 4vw, 38px);
}

.modal--wide {
  width: min(920px, calc(100% - 28px));
}

.modal--settings {
  width: min(1080px, calc(100% - 28px));
  min-height: min(720px, calc(100vh - 32px));
  background:
    linear-gradient(135deg, rgba(255, 0, 255, 0.06), transparent 26%),
    rgba(18, 16, 39, 0.97);
}

.modal--settings > form {
  display: flex;
  min-height: min(718px, calc(100vh - 34px));
  flex-direction: column;
}

.settings-layout {
  display: grid;
  min-height: 470px;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 28px;
  flex: 1;
}

.settings-nav {
  display: flex;
  gap: 8px;
  flex-direction: column;
}

.settings-nav__item {
  position: relative;
  display: grid;
  min-height: 88px;
  padding: 14px 16px 14px 48px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
  cursor: pointer;
  gap: 2px;
  text-align: left;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.settings-nav__item > span {
  position: absolute;
  top: 17px;
  left: 15px;
  color: rgba(0, 255, 255, 0.52);
  font-size: 9px;
  font-weight: 800;
}

.settings-nav__item strong {
  color: inherit;
  font-size: 14px;
}

.settings-nav__item small {
  color: rgba(248, 247, 255, 0.38);
  font-size: 9px;
  letter-spacing: 0.05em;
}

.settings-nav__item:hover {
  color: var(--ink);
  transform: translateX(3px);
}

.settings-nav__item.is-active {
  color: var(--ink);
  border-color: rgba(0, 255, 255, 0.38);
  background: linear-gradient(120deg, rgba(0, 255, 255, 0.12), rgba(255, 0, 255, 0.07));
  box-shadow: inset 3px 0 0 var(--accent), 0 0 24px rgba(0, 255, 255, 0.06);
}

.settings-content {
  min-width: 0;
}

.settings-panel {
  animation: settings-panel-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.settings-panel[hidden] {
  display: none;
}

@keyframes settings-panel-in {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

.settings-panel__heading {
  margin-bottom: 24px;
}

.settings-panel__heading p {
  margin: 0 0 8px;
  color: var(--magenta);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.settings-panel__heading h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(25px, 3vw, 38px);
  font-variation-settings: "wdth" 90, "wght" 620;
  letter-spacing: -0.03em;
}

.settings-panel__heading > span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.settings-panel__heading code {
  color: var(--accent);
}

.data-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.data-action {
  position: relative;
  display: grid;
  min-height: 176px;
  padding: 22px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  gap: 5px;
  align-content: end;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.data-action::after {
  position: absolute;
  content: "";
  top: -70px;
  right: -50px;
  width: 160px;
  height: 160px;
  border: 1px solid rgba(255, 0, 255, 0.18);
  border-radius: 50%;
}

.data-action:hover {
  border-color: var(--accent);
  background: rgba(0, 255, 255, 0.07);
  transform: translateY(-3px);
}

.data-action svg {
  position: absolute;
  top: 22px;
  left: 22px;
  width: 32px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.data-action strong {
  font-size: 15px;
}

.data-action span {
  color: var(--muted);
  font-size: 10px;
}

.settings-danger-zone {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  padding: 15px 17px;
  border: 1px solid rgba(255, 7, 58, 0.24);
  border-radius: 14px;
  background: rgba(255, 7, 58, 0.045);
}

.settings-danger-zone div {
  display: grid;
  gap: 3px;
  flex: 1;
}

.settings-danger-zone strong {
  font-size: 11px;
}

.settings-danger-zone span {
  color: var(--muted);
  font-size: 9px;
}

.wallpaper-sources {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.wallpaper-source {
  display: grid;
  min-width: 0;
  min-height: 82px;
  padding: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  align-content: space-between;
  text-align: left;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.wallpaper-source strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallpaper-source span {
  color: rgba(0, 255, 255, 0.54);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.wallpaper-source:hover,
.wallpaper-source.is-selected {
  color: var(--ink);
  border-color: var(--magenta);
  background: linear-gradient(145deg, rgba(255, 0, 255, 0.12), rgba(138, 43, 226, 0.08));
  transform: translateY(-2px);
}

.wallpaper-source.is-selected {
  box-shadow: inset 0 -3px 0 var(--magenta), 0 0 22px rgba(255, 0, 255, 0.08);
}

.wallpaper-actions {
  display: flex;
  gap: 9px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.button--magenta {
  color: white;
  background: var(--magenta);
}

.api-credit {
  margin: 18px 0 0;
  color: rgba(248, 247, 255, 0.32);
  font-size: 8px;
  letter-spacing: 0.16em;
}

.api-credit a {
  color: var(--accent);
  text-decoration: none;
}

.settings-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.settings-footer > span:first-child {
  color: rgba(248, 247, 255, 0.34);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.modal__header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}

.modal__header h2 {
  font-size: clamp(28px, 3vw, 42px);
}

.modal__close {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}

.modal__description {
  margin: -8px 0 24px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.modal__description code {
  color: var(--accent);
}

.field {
  display: grid;
  margin-top: 18px;
  gap: 8px;
}

.field > span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 600;
}

.field > span small {
  color: rgba(255, 255, 255, 0.38);
  font-weight: 400;
}

.field input[type="text"],
.field input[type="url"] {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: rgba(255, 255, 255, 0.06);
  transition: border-color 180ms ease, background 180ms ease;
}

.field input[type="text"]:focus,
.field input[type="url"]:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.09);
}

.field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.field output {
  float: right;
  color: var(--accent);
}

.color-row {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.size-row {
  display: flex;
  gap: 8px;
}

.size-choice {
  min-width: 86px;
  height: 38px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.size-choice.is-selected {
  color: var(--accent-ink);
  border-color: var(--accent);
  background: var(--accent);
  font-weight: 800;
}

.color-swatch {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--swatch);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.color-swatch.is-selected {
  border-color: white;
  box-shadow: 0 0 0 3px rgba(200, 255, 87, 0.38);
}

.modal__actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 30px;
}

.modal__spacer {
  flex: 1;
}

.button {
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: filter 180ms ease, transform 180ms ease, background 180ms ease;
}

.button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.button--primary {
  color: var(--accent-ink);
  background: var(--accent);
}

.button--ghost {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.05);
}

.button--danger {
  color: #250301;
  background: var(--danger);
}

.button--danger-soft {
  color: #ffaaa5;
  border-color: rgba(255, 109, 100, 0.28);
  background: rgba(255, 109, 100, 0.08);
}

.engine-manager {
  display: grid;
  max-height: 360px;
  overflow: auto;
  border-top: 1px solid var(--line);
}

.engine-group-tabs {
  display: grid;
  margin: 18px 0 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.15);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.engine-group-tabs button {
  display: flex;
  min-height: 48px;
  padding: 8px 10px;
  color: var(--muted);
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.engine-group-tabs button small {
  margin-top: 3px;
  color: rgba(248, 247, 255, 0.38);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.engine-group-tabs button:hover,
.engine-group-tabs button.is-active {
  color: var(--ink);
  background: linear-gradient(120deg, rgba(0, 255, 255, 0.14), rgba(255, 0, 255, 0.1));
}

.engine-manager__item {
  display: grid;
  padding: 12px 0;
  grid-template-columns: 40px minmax(100px, 0.65fr) minmax(180px, 1.6fr) 34px;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.engine-manager__badge {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.engine-manager__name,
.engine-manager__url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.engine-manager__name {
  font-size: 12px;
  font-weight: 700;
}

.engine-manager__url {
  color: var(--muted);
  font-size: 10px;
}

.engine-manager__delete {
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--muted);
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.engine-manager__delete:hover {
  color: var(--danger);
  background: rgba(255, 109, 100, 0.1);
}

.engine-add-row {
  display: grid;
  margin-top: 20px;
  grid-template-columns: minmax(120px, 0.65fr) minmax(240px, 1.6fr) auto;
  gap: 12px;
  align-items: end;
}

.engine-add-row .field {
  margin: 0;
}

.engine-add-row .button {
  height: 48px;
}

.toast {
  position: fixed;
  z-index: 200;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100% - 48px));
  padding: 13px 17px;
  color: var(--accent-ink);
  border-radius: 12px;
  visibility: hidden;
  opacity: 0;
  background: var(--accent);
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.34);
  font-size: 12px;
  font-weight: 700;
  transform: translateY(12px);
  transition: visibility 0s linear 220ms, opacity 220ms ease, transform 220ms ease;
}

.toast.is-visible {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0s;
}

.toast.is-error {
  color: white;
  background: #b02e29;
}

@media (max-width: 1200px) {
  .tiles {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .world-clocks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .world-clock:nth-child(4)::before {
    display: none;
  }

  .world-clock:nth-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 900px) {
  .tool-button span {
    display: none;
  }

  .tool-button {
    width: 42px;
    padding: 0;
    justify-content: center;
  }

  .tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .engine-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .engine-add-row {
    grid-template-columns: 1fr;
  }

  .settings-layout {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 18px;
  }

  .settings-nav__item {
    padding-left: 42px;
  }

  .wallpaper-sources {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 0 14px;
  }

  .topbar {
    min-height: 72px;
  }

  .brand__copy {
    display: none;
  }

  .topbar__actions {
    gap: 5px;
  }

  .tool-button {
    width: 38px;
    height: 38px;
  }

  .hero {
    min-height: calc(100vh - 72px);
    padding: 72px 0 36px;
  }

  .hero__eyebrow {
    gap: 9px;
    font-size: 14px;
  }

  .clock {
    font-size: clamp(80px, 27vw, 148px);
  }

  .clock__seconds {
    display: none;
  }

  .search-launchers {
    margin-top: 42px;
  }

  .world-clocks {
    margin-top: 50px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .world-clock {
    padding: 15px 12px;
  }

  .world-clock:nth-child(3)::before,
  .world-clock:nth-child(5)::before {
    display: none;
  }

  .world-clock:nth-child(4)::before {
    display: block;
  }

  .world-clock:nth-child(-n + 4) {
    border-bottom: 1px solid var(--line);
  }

  .shortcuts-section {
    margin-top: 10px;
    padding: 24px 14px;
    border-radius: 24px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading__right {
    width: 100%;
  }

  .page-tabs {
    min-width: 0;
    overflow-x: auto;
    flex: 1;
  }

  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .tile {
    min-height: 120px;
  }

  .tile__edit {
    opacity: 0.75;
  }

  .search-overlay {
    padding: 74px 14px 18px;
    align-items: start;
  }

  .search-box {
    gap: 10px;
    padding: 13px 15px;
    border-radius: 16px;
  }

  .search-box input {
    font-size: 20px;
  }

  .search-box kbd {
    display: none;
  }

  .engine-grid {
    max-height: 58vh;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .engine-choice {
    min-height: 90px;
  }

  .search-panel__notice {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-panel__footer span {
    display: none;
  }

  .search-panel__footer button {
    margin-left: auto;
  }

  .engine-manager__item {
    grid-template-columns: 34px minmax(80px, 1fr) 30px;
  }

  .engine-manager__url {
    display: none;
  }

  .footer {
    gap: 10px;
    flex-direction: column;
  }

  .modal--settings > form {
    min-height: calc(100vh - 34px);
    padding: 22px 16px;
  }

  .modal--settings .modal__header {
    margin-bottom: 18px;
  }

  .settings-layout {
    display: flex;
    min-height: 0;
    gap: 18px;
    flex-direction: column;
  }

  .settings-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .settings-nav__item {
    min-height: 60px;
    padding: 10px 8px;
    text-align: center;
  }

  .settings-nav__item > span,
  .settings-nav__item small {
    display: none;
  }

  .settings-nav__item:hover {
    transform: translateY(-2px);
  }

  .settings-nav__item.is-active {
    box-shadow: inset 0 -3px 0 var(--accent), 0 0 24px rgba(0, 255, 255, 0.06);
  }

  .settings-panel__heading {
    margin-bottom: 18px;
  }

  .data-actions {
    grid-template-columns: 1fr;
  }

  .data-action {
    min-height: 112px;
  }

  .wallpaper-sources {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wallpaper-source {
    min-height: 65px;
  }

  .wallpaper-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-footer > span:first-child {
    display: none;
  }

  .settings-footer {
    position: sticky;
    z-index: 5;
    bottom: 0;
    padding: 14px 0 10px;
    background: linear-gradient(to bottom, rgba(18, 16, 39, 0), rgba(18, 16, 39, 1) 28%);
  }

  .settings-danger-zone {
    align-items: flex-start;
  }

  .settings-trigger {
    min-width: 38px;
  }

  .settings-trigger i {
    position: absolute;
    top: 5px;
    right: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
