:root {
  --bg: #f5f5f7;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --line: rgba(15, 23, 42, 0.08);
  --line-soft: rgba(15, 23, 42, 0.06);
  --text: #111111;
  --muted: #6e6e73;
  --muted-soft: #8e8e93;
  --accent: #34c759;
  --accent-soft: rgba(52, 199, 89, 0.12);
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.06);
  --page: transparent;
  --radius-xl: 38px;
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  background: radial-gradient(circle at top center, rgba(222, 255, 231, 0.36) 0%, rgba(248, 248, 250, 0.98) 18%, rgba(242, 242, 245, 1) 48%, #f2f2f5 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
  padding: 0;
}

.shell {
  width: 100%;
  height: calc(100vh - 40px);
  min-height: calc(100vh - 40px);
  display: grid;
  grid-template-columns: 232px 1fr;
  grid-template-rows: 66px minmax(0, 1fr);
  background: var(--page);
  overflow: hidden;
}

.topbar {
  grid-column: 1 / -1;
  position: relative;
  display: grid;
  grid-template-columns: max-content 1fr max-content;
  align-items: center;
  gap: 16px;
  height: 66px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  background: rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(10px);
}

.brand-name {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: #17351f;
  white-space: nowrap;
}

.top-search {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(360px, 100%);
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.05);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  min-width: 0;
}

.top-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
  width: max-content;
  margin-left: auto;
}

.circle-btn,
.lang-btn,
.avatar {
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.05);
  background: rgba(255, 255, 255, 0.72);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
  line-height: 1;
  padding: 0;
}

.circle-btn {
  width: 34px;
  font-size: 14px;
  color: #4d4d52;
}

.lang-btn {
  min-width: 112px;
  padding: 0 14px;
  gap: 8px;
  font-size: 13px;
  color: #4d4d52;
}

.avatar {
  width: 44px;
  font-size: 13px;
  font-weight: 600;
  color: #1b5e2f;
  background: linear-gradient(180deg, rgba(52, 199, 89, 0.12), rgba(52, 199, 89, 0.06));
}

.sidebar {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  padding: 22px 12px 16px 12px;
  border-right: 1px solid rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.nav-section-title {
  font-size: 12px;
  color: var(--muted-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 8px 2px;
}

.nav-group {
  display: grid;
  gap: 12px;
  align-content: start;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 20px;
  color: #1d1d1f;
  transition: 160ms ease;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.48);
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(15, 23, 42, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(15, 23, 42, 0.04);
  background: rgba(255, 255, 255, 0.56);
  color: #3a3a3c;
  flex-shrink: 0;
  font-size: 14px;
}

.nav-item.active .nav-icon {
  background: rgba(52, 199, 89, 0.12);
  color: #1b5e2f;
}

.nav-label {
  font-size: 16px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-pill {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 42, 0.05);
  color: var(--muted);
  font-size: 11px;
  flex-shrink: 0;
}

.page {
  padding: 14px 0 24px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 90px);
  background: transparent;
}

.hero-wrap {
  width: min(980px, 100%);
  display: grid;
  justify-items: center;
  gap: 18px;
  padding-top: 0;
}

.search-stage {
  width: min(920px, 100%);
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.search-shell {
  position: relative;
  display: grid;
  grid-template-columns: 141px 1fr;
  align-items: center;
  min-height: 64px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.05);
  background: rgba(255, 255, 255, 0.92);
  overflow: visible;
  padding-right: 72px;
}

.engine-select {
  position: relative;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  border-right: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 17px;
  color: #1d1d1f;
  letter-spacing: -0.02em;
  cursor: pointer;
}

.engine-select-control {
  width: 100%;
  height: 100%;
  padding: 0 46px 0 28px;
  border: 0;
  outline: none;
  background: transparent;
  color: #1d1d1f;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
  display: block;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  text-align: left;
  text-align-last: left;
}

.engine-select::after {
  content: "▾";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-46%);
  color: #7d8794;
  font-size: 17px;
  line-height: 1;
  pointer-events: none;
}

.hero-input {
  width: 100%;
  height: 100%;
  padding: 0 20px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 17px;
  letter-spacing: -0.02em;
  min-width: 0;
}

.hero-search-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #41d86b, #29b44c);
  color: white;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(52, 199, 89, 0.22);
  z-index: 2;
}

.engine-tabs {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(5, 160px);
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.tab {
  min-height: 34px;
  width: 160px;
  min-width: 160px;
  max-width: 160px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.96);
}

.tab.active {
  background: rgba(255, 255, 255, 0.84);
  border-color: var(--line);
  color: #3a3a3c;
}

.tab.custom {
  position: relative;
  width: 160px;
  min-width: 160px;
  max-width: 160px;
  justify-content: space-between;
  padding-left: 12px;
  padding-right: 6px;
  gap: 8px;
  text-align: left;
  overflow: visible;
}

.tab-label {
  -webkit-user-select: none;
  user-select: none;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}



.tab-edit {
  -webkit-user-select: none;
  user-select: none;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-right: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #41d86b, #29b44c);
  color: transparent;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(52, 199, 89, 0.16);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.tab-edit::before {
  content: "";
  width: 14px;
  height: 14px;
  display: block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='3.2'/><path d='M19.4 15a1 1 0 0 0 .2 1.1l.1.1a1.9 1.9 0 1 1-2.7 2.7l-.1-.1a1 1 0 0 0-1.1-.2 1 1 0 0 0-.6.9V20a2 2 0 1 1-4 0v-.2a1 1 0 0 0-.6-.9 1 1 0 0 0-1.1.2l-.1.1a1.9 1.9 0 1 1-2.7-2.7l.1-.1a1 1 0 0 0 .2-1.1 1 1 0 0 0-.9-.6H4a2 2 0 1 1 0-4h.2a1 1 0 0 0 .9-.6 1 1 0 0 0-.2-1.1l-.1-.1a1.9 1.9 0 1 1 2.7-2.7l.1.1a1 1 0 0 0 1.1.2 1 1 0 0 0 .6-.9V4a2 2 0 1 1 4 0v.2a1 1 0 0 0 .6.9 1 1 0 0 0 1.1-.2l.1-.1a1.9 1.9 0 1 1 2.7 2.7l-.1.1a1 1 0 0 0-.2 1.1 1 1 0 0 0 .9.6h.2a2 2 0 1 1 0 4H20a1 1 0 0 0-.6.6Z'/></svg>");
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .topbar {
    grid-template-columns: 1fr;
    height: auto;
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .top-search {
    position: static;
    left: auto;
    transform: none;
    justify-self: stretch;
  }

  .top-actions {
    justify-self: stretch;
  }

  .top-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 720px) {
  body {
    padding: 10px 12px;
  }

  .shell {
    min-height: calc(100vh - 20px);
  }

  .topbar {
    padding-left: 0;
    padding-right: 0;
  }

  .page {
    padding-left: 16px;
    padding-right: 0;
    padding-top: 16px;
  }

  .sidebar {
    padding-left: 0;
    padding-right: 0;
  }

  .search-shell {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 10px;
  }

  .engine-select {
    min-height: 52px;
    border-right: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  }

  .hero-input {
    min-height: 58px;
    font-size: 18px;
    padding: 0 12px;
  }

  .hero-search-btn {
    width: 100%;
    margin: 0;
    border-radius: 18px;
    position: static;
    transform: none;
  }

  .engine-tabs {
    grid-template-columns: 1fr;
  }
}
.custom-entry-panel {
  position: absolute;
  right: 0;
  z-index: 20;
  width: 340px;
}

.custom-entry-panel.panel-down {
  top: calc(100% + 14px);
  bottom: auto;
}

.custom-entry-panel.panel-up {
  bottom: calc(100% + 14px);
  top: auto;
}

.custom-entry-panel-inner {
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.10);
  padding: 16px;
}

.custom-entry-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 12px;
}

.custom-entry-field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.custom-entry-label {
  font-size: 12px;
  color: #6e6e73;
}

.custom-entry-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  padding: 0 14px;
  outline: none;
  background: rgba(255, 255, 255, 0.84);
  color: #1d1d1f;
  font-size: 14px;
  line-height: 1.4;
}

.custom-entry-input:focus {
  border-color: rgba(52, 199, 89, 0.28);
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.08);
}

.custom-entry-warning {
  font-size: 12px;
  line-height: 1.6;
  color: #7a7a80;
  background: rgba(15, 23, 42, 0.03);
  border-radius: 14px;
  padding: 10px 12px;
  margin-top: 4px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.custom-entry-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.custom-entry-save,
.custom-entry-cancel {
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  padding: 0 16px;
  font-size: 13px;
  cursor: pointer;
}

.custom-entry-save {
  background: linear-gradient(180deg, #41d86b, #29b44c);
  border: 0;
  color: #ffffff;
}

.custom-entry-cancel {
  background: rgba(255, 255, 255, 0.84);
  color: #4d4d52;
}




.tab-edit:hover {
  transform: translateY(-1px);
  box-shadow:
    0 10px 22px rgba(52, 199, 89, 0.28),
    0 0 0 4px rgba(52, 199, 89, 0.10);
  filter: brightness(1.04);
}

.tab-edit:active {
  transform: translateY(0);
  box-shadow:
    0 6px 14px rgba(52, 199, 89, 0.20),
    0 0 0 3px rgba(52, 199, 89, 0.08);
}


.nav-group:first-of-type {
  display: grid;
  gap: 12px;
  align-content: start;
  justify-content: stretch;
}




.nav-block {
  display: grid;
  gap: 6px;
}

.nav-submenu[hidden] {
  display: none;
}

.nav-submenu {
  display: grid;
  gap: 4px;
  padding-left: 46px;
}

.nav-block.is-open > .nav-item {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 22px;
}

.nav-submenu-item {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 16px;
  color: #4d4d52;
  font-size: 13px;
  line-height: 1.4;
  border: 0;
  background: transparent;
  text-align: left;
  appearance: none;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-submenu-item:hover {
  background: rgba(255, 255, 255, 0.7);
  color: #1d1d1f;
  transform: translateX(1px);
}

.content-skeleton {
  display: none;
}
