:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17191f;
  --muted: #646b78;
  --line: #d9dde5;
  --google: #2d6cdf;
  --kagi: #d24b2a;
  --bing: #107c10;
  --duckduckgo: #de5833;
  --focus: #111827;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

.app {
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.topbar {
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(260px, auto) minmax(280px, 1fr) minmax(260px, auto);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 247, 249, 0.96);
  backdrop-filter: blur(10px);
}

.search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  min-width: 0;
}

.side-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.side-controls-right {
  justify-self: end;
}

.query {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
  outline: none;
}

.query:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1);
}

button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  min-width: 42px;
  padding: 0 14px;
  border: 1px solid var(--focus);
  border-radius: 8px;
  background: var(--focus);
  color: #ffffff;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.link-button {
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
}

.link-button:hover {
  border-color: var(--focus);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.pane {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  background: var(--panel);
}

.pane + .pane {
  border-left: 1px solid var(--line);
}

body[data-expanded-pane="left"] .layout,
body[data-expanded-pane="right"] .layout {
  grid-template-columns: minmax(0, 1fr);
}

body[data-expanded-pane="left"] .pane:nth-child(2),
body[data-expanded-pane="right"] .pane:nth-child(1) {
  display: none;
}

body[data-expanded-pane="right"] .pane:nth-child(2) {
  border-left: 0;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.dot.google {
  background: var(--google);
}

.dot.kagi {
  background: var(--kagi);
}

.dot.bing {
  background: var(--bing);
}

.dot.duckduckgo {
  background: var(--duckduckgo);
}

.engine-select {
  max-width: 180px;
  height: 42px;
  min-width: 0;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-weight: 750;
}

.engine-select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1);
  outline: none;
}

.frame-wrap {
  position: relative;
  min-height: 0;
  background: #eef1f6;
}

iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.empty strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 18px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .topbar,
  .search {
    grid-template-columns: 1fr;
  }

  .side-controls,
  .side-controls-right {
    justify-self: stretch;
  }

  .side-controls {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .pane + .pane {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .layout {
    overflow: auto;
  }
}
