@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --bg: #ffffff;
  --text: #202124;
  --muted: #70757a;
  --line: #e1e4e8;
  --surface: #f8f9fa;
  --card: #ffffff;
  --blue: #4285f4;
  --telegram: #229ed9;
  --focus: #8ab4f8;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body.dark {
  color-scheme: dark;
  --bg: #202124;
  --text: #e8eaed;
  --muted: #a0a4aa;
  --line: #4a4c50;
  --surface: #303134;
  --card: #202124;
  --blue: #8ab4f8;
  --focus: #8ab4f8;
}
button, input, a { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #4285f466; outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.topbar { height: 64px; padding: 0 28px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.profile-button {
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}
.profile-button:hover {
  background: var(--line);
  color: var(--blue);
}
.profile-button svg { width: 16px; height: 16px; stroke-width: 2.2; }
.fav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ea4335;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.add-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.add-button:hover {
  background: var(--line);
  color: var(--blue);
}
.add-button svg { width: 16px; height: 16px; stroke-width: 2.2; }

/* 9-Dots Apps Drawer */
.apps-drawer {
  position: fixed;
  top: 70px;
  right: 24px;
  width: min(360px, calc(100vw - 32px));
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
  z-index: 1000;
  padding: 18px;
  animation: drawerFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.drawer-title { font-size: 16px; font-weight: 600; }
.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.app-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 4px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.18s ease;
}
.app-tile:hover {
  background: var(--line);
  transform: translateY(-2px);
}
.app-tile-icon { font-size: 26px; margin-bottom: 6px; line-height: 1; }
.app-tile-name { font-size: 11px; font-weight: 500; text-align: center; line-height: 1.25; color: var(--text); }
.drawer-footer {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.drawer-add-action {
  width: 100%;
  padding: 10px;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--blue);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.drawer-add-action:hover { background: var(--line); }

.drawer-claim-action {
  width: 100%;
  padding: 10px;
  background: #fdf5e6;
  border: 1px solid #f9d8a0;
  border-radius: 14px;
  color: #b86200;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
body.dark .drawer-claim-action {
  background: #3b2f1e;
  border-color: #634b29;
  color: #ffd175;
}
.drawer-claim-action:hover { opacity: 0.9; }

/* Claim Modal Body */
.claim-body { display: flex; flex-direction: column; gap: 14px; }
.claim-intro { font-size: 13.5px; line-height: 1.45; color: var(--text); margin: 0; }
.claim-steps { display: flex; flex-direction: column; gap: 10px; margin: 4px 0; }
.claim-step { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--muted); }
.step-num { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 600; font-size: 12px; color: var(--blue); }
.claim-action-btn { display: inline-flex; align-items: center; justify-content: center; background: var(--blue); color: #fff; text-decoration: none; padding: 12px; border-radius: 14px; font-weight: 600; font-size: 14px; text-align: center; margin-top: 4px; transition: opacity 0.15s; }
.claim-action-btn:hover { opacity: 0.9; }

/* Submission Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  z-index: 999;
}
.submit-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  padding: 16px;
}
.modal-box {
  width: min(460px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-title { font-size: 18px; font-weight: 600; }
.modal-form { display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--muted); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--blue);
  outline: none;
}
.type-pills { display: flex; gap: 8px; }
.type-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.type-pill.active {
  background: #e8f0fe;
  border-color: var(--blue);
  color: #1967d2;
}
body.dark .type-pill.active {
  background: #2a3b5c;
  color: #8ab4f8;
}
.type-pill input { display: none; }
.submit-action-btn {
  background: var(--blue);
  color: #ffffff;
  border: 0;
  border-radius: 14px;
  padding: 12px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  margin-top: 6px;
  transition: opacity 0.15s;
}
.submit-action-btn:hover { opacity: 0.9; }
.form-status {
  padding: 10px;
  border-radius: 10px;
  font-size: 13px;
  text-align: center;
}
.form-status.success { background: #e6f4ea; color: #137333; }
.form-status.error { background: #fce8e6; color: #c5221f; }
body.dark .form-status.success { background: #1e3a29; color: #81c995; }
body.dark .form-status.error { background: #3d1c1c; color: #f28b82; }

@keyframes drawerFadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalScaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes drawerSlideInLeft { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Profile Drawer */
.profile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(440px, 100vw);
  background: var(--card);
  border-right: 1px solid var(--line);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.28);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  animation: drawerSlideInLeft 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.profile-drawer .drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.profile-tabs {
  display: flex;
  background: var(--surface);
  padding: 6px 8px;
  gap: 6px;
  border-bottom: 1px solid var(--line);
}
.profile-tab {
  flex: 1;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.profile-tab:hover {
  color: var(--text);
  background: var(--line);
}
.profile-tab.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  font-weight: 600;
}
.profile-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  -webkit-overflow-scrolling: touch;
}
.profile-tab-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.profile-tab-pane.hidden {
  display: none !important;
}
.history-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.history-subtitle, .recs-intro {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.clear-history-btn {
  background: transparent;
  border: 0;
  color: #ea4335;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.clear-history-btn:hover {
  background: rgba(234, 67, 53, 0.1);
}
.history-list, .history-chips, #history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.history-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}
.history-chip:hover {
  background: var(--line);
  border-color: var(--focus);
  color: var(--blue);
}
.favorites-list, .recommendations-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fav-card, .rec-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  transition: all 0.15s ease;
}
.fav-card:hover, .rec-card:hover {
  background: var(--card);
  border-color: var(--focus);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.fav-card-info, .rec-card-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.fav-card-title, .rec-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fav-card-meta, .rec-card-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fav-actions, .rec-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.fav-btn-sm, .rec-btn-sm {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}
.fav-btn-sm:hover, .rec-btn-sm:hover {
  background: var(--line);
  color: var(--text);
}
.fav-btn-sm.remove:hover {
  background: #fce8e6;
  color: #ea4335;
  border-color: #ea4335;
}
.empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--muted);
  font-size: 14px;
}
.empty-state-icon {
  font-size: 36px;
  margin-bottom: 8px;
  display: block;
}

/* Channel Preview Modal */
.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1002;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  animation: modalFadeIn 0.2s ease;
}
.preview-modal-box {
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.32);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 601px) {
  .preview-modal {
    align-items: center;
    padding: 20px;
  }
  .preview-modal-box {
    border-radius: 24px;
    max-height: 88vh;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
    animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }
}
.preview-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 20px 12px;
  gap: 12px;
}
.preview-header-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}
.preview-avatar {
  width: 52px;
  height: 52px;
  font-size: 18px;
  flex-shrink: 0;
}
.preview-meta {
  min-width: 0;
  flex: 1;
}
.preview-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.preview-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.preview-username {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.preview-members {
  font-size: 12px;
  color: var(--telegram);
  font-weight: 500;
  margin-top: 2px;
}
.preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 20px 8px;
}
.preview-chip {
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.preview-description {
  margin: 0;
  padding: 0 20px 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  max-height: 80px;
  overflow-y: auto;
}
.preview-actions {
  display: flex;
  gap: 8px;
  padding: 0 20px 14px;
  border-bottom: 1px solid var(--line);
}
.preview-action-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  text-decoration: none;
}
.preview-action-btn.primary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}
.preview-action-btn.primary.active {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
}
body.dark .preview-action-btn.primary.active {
  background: #78350f;
  border-color: #d97706;
  color: #fef3c7;
}
.preview-action-btn.telegram {
  background: var(--telegram);
  color: #ffffff;
}
.preview-action-btn.telegram:hover {
  opacity: 0.92;
}
.preview-action-btn.outline {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
  flex: 0 0 auto;
}
.preview-action-btn:hover {
  filter: brightness(0.96);
}
.preview-feed-section {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.feed-title {
  padding: 10px 20px 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.preview-posts {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}
.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.post-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
}
.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}
.post-media-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--blue);
  font-weight: 500;
}
.preview-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  color: var(--muted);
  gap: 12px;
  font-size: 13px;
}
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@media (max-width: 360px) {
  .profile-tabs {
    flex-wrap: wrap;
  }
  .profile-tab {
    font-size: 11.5px;
    padding: 6px 3px;
  }
  .preview-actions {
    flex-direction: column;
  }
}

.icon-button { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: grid; place-items: center; }
.icon-button:hover { background: var(--surface); }

main { width: min(760px, calc(100% - 40px)); margin: 0 auto; flex: 1; }
.search-section { padding-top: 105px; position: relative; z-index: 3; }
#intro { text-align: center; margin-bottom: 29px; }
.wordmark {
  display: inline-block;
  font-family: "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 58px;
  font-weight: 500;
  letter-spacing: -2.8px;
  line-height: 1.08;
  font-feature-settings: "kern" 1;
  background: linear-gradient(105deg, #4285f4 0 27%, #229ed9 42%, #20a889 60%, #34a853 75%, #f4b400 94%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
#intro p { color: var(--muted); font-size: 15px; margin: 12px 0 0; }

.search-box { position: relative; background: var(--card); border: 1px solid #dfe1e5; border-radius: 28px; box-shadow: 0 1px 6px #20212422; }
.search-box:focus-within { border-color: var(--focus); box-shadow: 0 1px 9px #20212433; }
.input-row { min-height: 56px; display: flex; align-items: center; gap: 8px; padding: 7px 13px 7px 18px; }
.search-icon { width: 21px; height: 21px; color: #9aa0a6; flex: 0 0 auto; }
input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; padding: 8px 3px; }
input::placeholder { color: #80868b; opacity: 1; }
input::-webkit-search-cancel-button { display: none; }
.tool-button { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: 50%; color: #5f6368; background: transparent; padding: 0; }
.tool-button:hover, .tool-button.listening { background: var(--surface); color: var(--blue); }
.tool-button svg { width: 21px; height: 21px; }
#clear { width: 30px; height: 30px; font-size: 25px; line-height: 1; color: #73787d; }

#dropdown { position: absolute; left: -1px; right: -1px; top: calc(100% - 1px); background: var(--card); border: 1px solid var(--focus); border-top: 0; border-radius: 0 0 22px 22px; box-shadow: 0 8px 16px #20212426; padding: 0 0 4px; }
.search-box.open { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.suggestion-heading { margin: 0 16px; padding: 11px 8px 6px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
ul { list-style: none; padding: 0; margin: 0; }
.suggestion { display: flex; align-items: center; gap: 14px; padding: 11px 23px; color: var(--text); font-size: 16px; cursor: pointer; }
.suggestion:hover, .suggestion.selected { background: var(--surface); }
.suggestion svg { width: 19px; height: 19px; color: #9aa0a6; flex: 0 0 auto; }
.suggestion-label { flex: 1; }
.suggestion strong { font-weight: 650; }
.suggestion .fill { color: #9aa0a6; font-size: 20px; }
.suggestion-footer { display: flex; gap: 16px; margin: 5px 24px 0; padding: 10px 0 7px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.home-actions { display: flex; justify-content: center; margin-top: 29px; }
.search-action { min-height: 40px; padding: 10px 18px; border: 1px solid transparent; border-radius: 4px; background: var(--surface); color: var(--text); font-size: 14px; box-shadow: 0 1px 1px #00000014; }
.search-action:hover { border-color: #dadce0; color: var(--blue); box-shadow: 0 1px 2px #0000001a; }
.notice { min-height: 22px; margin-top: 13px; color: var(--muted); font-size: 13px; text-align: center; }
.notice:not(.visible) { visibility: hidden; }

.catalog-section { margin: 58px 0 52px; }
body:not(.searching) .catalog-section { display: none; }
.catalog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.3px; }
.filters-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters { display: flex; gap: 3px; padding: 4px; border-radius: 12px; background: var(--surface); }
.filters button { padding: 6px 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; }
.filters button.active { background: var(--card); color: var(--text); box-shadow: 0 1px 4px #00000014; }
.sort-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); font-size: 13px; cursor: pointer; }
.sort-toggle:hover { color: var(--text); border-color: var(--focus); }
.sort-toggle svg { width: 14px; height: 14px; }
.lang-bar { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0 8px; scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; }
.lang-bar::-webkit-scrollbar { display: none; }
.lang-chip { flex: 0 0 auto; padding: 5px 11px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--muted); font-size: 12.5px; font-weight: 500; cursor: pointer; transition: all 0.15s ease; display: inline-flex; align-items: center; gap: 4px; }
.lang-chip:hover { border-color: var(--focus); color: var(--text); }
.lang-chip.active { background: #e8f0fe; color: #1967d2; border-color: var(--blue); }
body.dark .lang-chip.active { background: #2a3b5c; color: #8ab4f8; }
.category-bar { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0 10px; scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; }
.category-bar::-webkit-scrollbar { display: none; }
.cat-pill { flex: 0 0 auto; padding: 6px 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--muted); font-size: 13px; cursor: pointer; transition: all 0.15s ease; }
.cat-pill:hover { border-color: var(--focus); color: var(--text); }
.cat-pill.active { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 500; }
.offline-badge { display: inline-block; padding: 4px 10px; border-radius: 6px; background: #fff3cd; color: #856404; font-size: 12px; margin-top: 10px; font-weight: 500; }
body.dark .offline-badge { background: #423512; color: #ffe69c; }
.load-more-container { text-align: center; margin: 24px 0 16px; }
.load-more-btn { padding: 10px 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--blue); font-size: 14px; font-weight: 500; cursor: pointer; }
.load-more-btn:hover { background: var(--card); border-color: var(--focus); }
.empty-suggestions { margin: 16px 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.empty-chip { padding: 6px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--blue); font-size: 13px; cursor: pointer; }
.empty-chip:hover { background: var(--card); border-color: var(--focus); }
.results-info { margin: 13px 0 20px; color: var(--muted); font-size: 14px; }
.results { display: grid; grid-template-columns: 1fr; gap: 0; }
.result-card { display: flex; align-items: flex-start; gap: 14px; padding: 18px 4px; border-bottom: 1px solid var(--line); }
.result-card:hover { background: var(--surface); border-radius: 12px; }
.avatar { width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--avatar-bg); color: var(--avatar-color); font-size: 16px; font-weight: 650; }
.card-content { min-width: 0; flex: 1; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--blue); font-size: 19px; font-weight: 600; line-height: 1.35; }
.card-title svg { width: 15px; height: 15px; color: var(--muted); flex: 0 0 auto; }
.card-username { margin-top: 3px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.card-description { margin: 5px 0 8px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.card-tag { display: inline-flex; align-items: center; gap: 5px; color: var(--telegram); font-size: 12px; }
.card-tag svg { width: 13px; height: 13px; }
.correction { margin-top: 20px; color: var(--muted); font-size: 15px; }
.correction strong { color: var(--text); }
.correction button { padding: 0; border: 0; background: transparent; color: var(--blue); font-size: inherit; }
.empty { padding: 36px 0; text-align: center; }
.empty-icon { display: block; color: var(--muted); font-size: 50px; }
.empty p { color: var(--muted); font-size: 15px; }
.text-button { padding: 10px 16px; border: 0; border-radius: 10px; background: #e8f0fe; color: #1967d2; font-size: 14px; }

footer { width: min(760px, calc(100% - 40px)); display: flex; justify-content: space-between; gap: 14px; margin: 0 auto; padding: 18px 0 24px; color: var(--muted); font-size: 12px; }
.hidden { display: none !important; }
.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; }

body.searching .search-section { padding-top: 27px; }
body.searching #intro { display: none; }
body.searching .catalog-section { display: block; margin-top: 28px; }
body.searching .home-actions, body.searching .notice { display: none; }

@media (max-width: 600px) {
  .topbar { height: 56px; padding: 0 17px; }
  main { width: calc(100% - 32px); }
  .search-section { padding-top: 72px; }
  .wordmark { font-size: 42px; letter-spacing: -2.1px; }
  #intro { margin-bottom: 25px; }
  #intro p { font-size: 14px; }
  .search-box { border-radius: 25px; }
  .input-row { min-height: 54px; gap: 4px; padding-left: 15px; }
  .tool-button { width: 32px; height: 32px; }
  .input-row input { font-size: 16px; }
  .home-actions { margin-top: 24px; }
  .search-action { padding: 9px 15px; }
  .catalog-section { margin-top: 38px; }
  .catalog-head { gap: 9px; }
  h2 { font-size: 17px; }
  .filters button { padding: 6px 10px; font-size: 13px; }
  footer { width: calc(100% - 40px); flex-wrap: wrap; }
  body.searching .search-section { padding-top: 13px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
