/* Shared with main navigator — CSS variables & chrome */
*, *::before, *::after { box-sizing: border-box; }

:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --sidebar-bg: #ffffff;
  --card-bg: #ffffff;
  --header-bg: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #5a6272;
  --text-muted: #9aa0ad;
  --accent: #ff6b35;
  --accent-light: #fff1ec;
  --border: #e8eaed;
  --border-hover: #c8cdd5;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1014;
  --sidebar-bg: #16161d;
  --card-bg: #1c1c26;
  --header-bg: #16161d;
  --text-primary: #e8e8ed;
  --text-secondary: #b4b8c4;
  --text-muted: #7e8496;
  --accent: #ff8a5c;
  --accent-light: rgba(255, 138, 92, 0.16);
  --border: #2a2b36;
  --border-hover: #3e4050;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 8px 28px rgba(0, 0, 0, 0.5);
}

.ai-says {
  margin-bottom: 28px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: nowrap;
}
.ai-says-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}
.ai-says-tabs {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  margin-inline-start: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.ai-says-tabs::-webkit-scrollbar {
  height: 4px;
}
.ai-says-tabs::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.ai-says-tab {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  flex-shrink: 0;
}
.ai-says-tab:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  text-decoration: none;
}
.ai-says-tab::after {
  content: " ↗";
  font-size: 11px;
  opacity: 0.75;
}

.ai-says-article h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 18px 0 10px;
}
.ai-says-article h3:first-child { margin-top: 0; }
.ai-says-lead { margin-bottom: 12px; }
.ai-says-article p { margin: 0 0 10px; }
.ai-says-list {
  margin: 0 0 14px;
  padding-left: 1.25rem;
}
.ai-says-list li { margin-bottom: 12px; }
.ai-says-list li::marker { color: var(--accent); font-weight: 600; }
.ai-says-bullets {
  margin: 0 0 12px;
  padding-left: 1.2rem;
}
.ai-says-bullets li { margin-bottom: 6px; }
.ai-says-tool-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.ai-says-tool-link:hover { text-decoration: underline; }
.ai-says-loading,
.ai-says-error {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
}

/* View page */
.ai-says-view-page {
  font-family: "Noto Sans SC", "Noto Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  margin: 0;
  padding-top: 56px;
}
.ai-says-view-page.rtl { direction: rtl; }

.ai-says-view-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px 0 12px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.ai-says-view-top .header-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}
.ai-says-view-top .header-filters select {
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  max-width: 200px;
}
.ai-says-view-top .header-filters select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.12);
}
.ai-says-view-top .theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  font-family: inherit;
}
.ai-says-view-top .theme-toggle:hover {
  border-color: var(--accent);
}
.ai-says-view-top .theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ai-says-back {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.ai-says-back:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.ai-says-view-title {
  flex: 1;
  min-width: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-says-view-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 18px 48px;
}
.ai-says-view-body {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 900px) {
  .ai-says {
    flex-wrap: wrap;
    padding: 14px 16px;
  }
  .ai-says-tabs {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
    overflow-x: visible;
  }
}

@media (max-width: 640px) {
  .ai-says-view-top { padding: 0 10px 0 8px; gap: 8px; }
  .ai-says-view-top .header-filters select { max-width: 120px; font-size: 12px; }
  .ai-says-view-title { font-size: 14px; }
}
