@import url("https://cdn.jsdelivr.net/npm/@fontsource/sora@5.0.8/400.css");
@import url("https://cdn.jsdelivr.net/npm/@fontsource/sora@5.0.8/600.css");
@import url("https://cdn.jsdelivr.net/npm/@fontsource/space-grotesk@5.0.8/500.css");
@import url("https://cdn.jsdelivr.net/npm/@fontsource/space-grotesk@5.0.8/700.css");

:root {
  --bg: #f7f3ed;
  --bg-2: #eef4f2;
  --panel: #ffffff;
  --panel-tint: #fbf9f5;
  --ink: #1f1c1a;
  --muted: #76706a;
  --accent: #2f7f74;
  --accent-2: #d7a577;
  --accent-3: #79b4a6;
  --stroke: rgba(31, 28, 26, 0.08);
  --shadow: 0 20px 45px rgba(28, 24, 20, 0.12);
  --shadow-soft: 0 12px 26px rgba(28, 24, 20, 0.08);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Sora", "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px circle at 12% 6%, rgba(47, 127, 116, 0.16), transparent 60%),
    radial-gradient(1100px circle at 92% 8%, rgba(215, 165, 119, 0.14), transparent 62%),
    linear-gradient(140deg, var(--bg) 0%, var(--bg-2) 55%, #fbfaf7 100%);
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::after {
  opacity: 0.18;
  background-image: linear-gradient(
    120deg,
    rgba(31, 28, 26, 0.1) 0%,
    rgba(31, 28, 26, 0.1) 1px,
    transparent 1px,
    transparent 24px
  );
  background-size: 24px 24px;
}

img,
svg {
  display: block;
}

button,
input {
  font: inherit;
}

::selection {
  background: rgba(47, 127, 116, 0.18);
  color: var(--ink);
}

.page {
  max-width: 1500px;
  margin: 0 auto;
  padding: 28px;
  padding-bottom: 145px;
}

.app {
  display: flex;
  min-height: calc(100vh - 170px);
  gap: 20px;
  align-items: stretch;
  animation: pageEnter 0.55s ease both;
}

.left-panel,
.right-panel {
  background:
    linear-gradient(180deg, rgba(47, 127, 116, 0.08), rgba(255, 255, 255, 0.98) 40%),
    var(--panel);
  border-radius: var(--radius-xl);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: flex 0.3s ease, max-width 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.left-panel::before,
.right-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(240px circle at 18% 18%, rgba(47, 127, 116, 0.12), transparent 70%),
    radial-gradient(260px circle at 90% 12%, rgba(215, 165, 119, 0.1), transparent 68%);
  opacity: 0.6;
}

.left-panel {
  flex: 2.1;
  padding: 26px;
  padding-top: 78px;
  align-self: flex-start;
}

.right-panel {
  flex: 1;
  padding: 20px;
}

body.focus-mode.focus-active .right-panel {
  flex: 0 0 0;
  max-width: 0;
  opacity: 0;
  transform: translateX(24px);
  pointer-events: none;
  padding: 0;
  border: none;
  box-shadow: none;
}

body.focus-mode.focus-active .left-panel {
  flex: 1;
}

.corner-icon {
  position: absolute;
  top: 20px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(47, 127, 116, 0.3), rgba(215, 165, 119, 0.25));
  border: 1px solid rgba(47, 127, 116, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  box-shadow: 0 12px 26px rgba(47, 127, 116, 0.2);
  animation: float 6s ease-in-out infinite;
}

.corner-icon img {
  width: 22px;
  height: 22px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.panel-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.2px;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.panel-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.panel-pill {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(47, 127, 116, 0.25);
  background: rgba(47, 127, 116, 0.12);
  color: var(--accent);
}

.panel-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.focus-toggle {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.95);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.focus-toggle:hover {
  transform: translateY(-1px);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

body.focus-mode .focus-toggle {
  background: linear-gradient(135deg, rgba(47, 127, 116, 0.18), rgba(121, 180, 166, 0.22));
  color: var(--accent);
  border-color: rgba(47, 127, 116, 0.35);
}

.search-pill {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  padding: 12px 16px;
  max-width: calc(100% - 70px);
  margin-top: 6px;
  margin-right: 62px;
  margin-left: auto;
  word-wrap: break-word;
  white-space: normal;
  text-align: left;
  border: 1px solid rgba(47, 127, 116, 0.2);
  box-shadow: var(--shadow-soft);
  animation: rise 0.4s ease both;
}

.search-pill strong {
  font-weight: 600;
  letter-spacing: 0.2px;
}

.search-pill p + p {
  margin-top: 8px;
}

.topic-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 6px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.topic-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.topic-bar input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: var(--ink);
}

.prompt-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 6px;
}

.prompt-chip {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.96);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.prompt-chip:hover {
  transform: translateY(-1px);
  color: var(--ink);
  border-color: rgba(47, 127, 116, 0.35);
  box-shadow: var(--shadow-soft);
}

.history-panel {
  margin: 14px 0 0;
  padding: 12px;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.95), rgba(247, 250, 249, 0.95));
  border: 1px dashed rgba(47, 127, 116, 0.25);
  border-radius: var(--radius-md);
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.history-topic {
  color: var(--ink);
  font-weight: 600;
  margin-left: 4px;
}

.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.topic-chip {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.topic-chip.active {
  color: var(--accent);
  border-color: rgba(47, 127, 116, 0.35);
  background: rgba(47, 127, 116, 0.12);
}

.topic-chip:hover {
  transform: translateY(-1px);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.history-clear {
  border: none;
  background: transparent;
  color: var(--accent-2);
  cursor: pointer;
  font-size: 12px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 130px;
  overflow-y: auto;
}

.history-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 6px 8px;
}

.history-list::-webkit-scrollbar {
  width: 6px;
}

.history-list::-webkit-scrollbar-thumb {
  background: rgba(31, 28, 26, 0.2);
  border-radius: 999px;
}

.history-item {
  text-align: left;
  background: #f7f4ed;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.history-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.favorites-panel {
  margin: 12px 0 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px dashed rgba(47, 127, 116, 0.25);
  border-radius: var(--radius-md);
}

.favorites-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.favorites-clear {
  border: none;
  background: transparent;
  color: var(--accent-2);
  cursor: pointer;
  font-size: 12px;
}

.favorites-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
}

.favorite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stroke);
  background: #f7f4ed;
  font-size: 12px;
}

.favorite-info {
  flex: 1;
  min-width: 0;
}

.favorite-title {
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.favorite-url {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.favorite-actions {
  display: flex;
  gap: 6px;
}

.favorite-btn {
  border: 1px solid var(--stroke);
  background: #ffffff;
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.favorite-btn:hover {
  transform: translateY(-1px);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}
.finished-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}

.status-icon {
  margin-right: 4px;
}

.cards-bar {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 10px 4px 14px;
  margin: 6px 0 14px;
  scroll-snap-type: x mandatory;
}

.cards-bar::-webkit-scrollbar {
  height: 8px;
}

.cards-bar::-webkit-scrollbar-thumb {
  background: rgba(31, 28, 26, 0.18);
  border-radius: 999px;
}

.result-card {
  flex: 0 0 240px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke);
  padding: 12px 14px;
  background: linear-gradient(160deg, #ffffff 0%, var(--panel-tint) 100%);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  scroll-snap-align: start;
  animation: rise 0.35s ease both;
}

.result-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.result-card:nth-child(1) {
  animation-delay: 0.03s;
}

.result-card:nth-child(2) {
  animation-delay: 0.06s;
}

.result-card:nth-child(3) {
  animation-delay: 0.09s;
}

.result-card:nth-child(4) {
  animation-delay: 0.12s;
}

.result-card:nth-child(5) {
  animation-delay: 0.15s;
}

.result-card-source {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 2px;
  word-break: break-all;
}

.source-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(47, 127, 116, 0.12);
  color: var(--accent);
  font-size: 10px;
  margin-top: 4px;
  border: 1px solid rgba(47, 127, 116, 0.2);
}

.result-card-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--ink);
}

.result-card-snippet {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

.chat-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.chat-scroll::-webkit-scrollbar {
  width: 8px;
}

.chat-scroll::-webkit-scrollbar-thumb {
  background: rgba(31, 28, 26, 0.18);
  border-radius: 999px;
}

.answer-block {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-soft);
  position: relative;
  animation: fadeUp 0.4s ease both;
}

.answer-block::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(47, 127, 116, 0.45), rgba(215, 165, 119, 0.35));
}

.answer-block p + p {
  margin-top: 8px;
}

.result-detail {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
  animation: fadeUp 0.35s ease both;
}

.result-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.result-detail-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-detail-close {
  border: none;
  background: transparent;
  color: var(--accent-2);
  font-size: 12px;
  cursor: pointer;
}

.result-detail-body {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 8px;
  white-space: pre-line;
}

.result-detail-link {
  display: inline-flex;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}

.result-detail-link:hover {
  text-decoration: underline;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(28, 29, 36, 0.7);
}

.results-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.results-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
  display: inline-block;
}

.mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.95);
  margin-bottom: 12px;
  box-shadow: var(--shadow-soft);
  animation: fadeUp 0.35s ease both;
}

.mode-label {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

.mode-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
}

.mode-btn {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.mode-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.mode-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.mode-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(47, 127, 116, 0.3);
}

.results-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.95);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.filter-chip.active {
  color: var(--accent);
  border-color: rgba(47, 127, 116, 0.35);
  background: rgba(47, 127, 116, 0.12);
}

.filter-chip:hover {
  transform: translateY(-1px);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.export-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.export-btn {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.95);
  color: var(--muted);
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 11px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.export-btn:hover {
  transform: translateY(-1px);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.export-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.results-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.results-list::-webkit-scrollbar {
  width: 8px;
}

.results-list::-webkit-scrollbar-thumb {
  background: rgba(31, 28, 26, 0.18);
  border-radius: 999px;
}

.results-list.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--stroke);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.85);
  text-align: center;
  color: var(--muted);
}

.empty-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 12px;
  line-height: 1.5;
}

.skeleton-card {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  padding: 12px;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  gap: 12px;
  align-items: center;
}

.skeleton-thumb {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(120deg, #f2f3f6, #e8eaee, #f2f3f6);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

.skeleton-lines {
  flex: 1;
}

.skeleton-line {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(120deg, #f2f3f6, #e8eaee, #f2f3f6);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  margin-bottom: 8px;
}

.skeleton-line.short {
  width: 55%;
}

.skeleton-line.tiny {
  width: 35%;
  margin-bottom: 0;
}

.image-card {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #ffffff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: rise 0.3s ease both;
  position: relative;
}

.image-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.image-card:nth-child(1) {
  animation-delay: 0.03s;
}

.image-card:nth-child(2) {
  animation-delay: 0.06s;
}

.image-card:nth-child(3) {
  animation-delay: 0.09s;
}

.image-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.image-fav {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.image-fav:hover {
  transform: translateY(-1px);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.image-fav.active {
  color: var(--accent);
  border-color: rgba(47, 127, 116, 0.35);
  background: rgba(47, 127, 116, 0.12);
}

.image-caption {
  padding: 8px 10px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.result-item {
  padding: 14px 14px 14px 18px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-soft);
  position: relative;
  animation: fadeUp 0.35s ease both;
}

.result-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(47, 127, 116, 0.35), rgba(215, 165, 119, 0.3));
}

.result-item:hover,
.result-item.active {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.result-item:nth-child(1) {
  animation-delay: 0.02s;
}

.result-item:nth-child(2) {
  animation-delay: 0.04s;
}

.result-item:nth-child(3) {
  animation-delay: 0.06s;
}

.result-item-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--ink);
}

.result-item-url {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
  word-break: break-all;
}

.result-item-snippet {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.result-action {
  border: 1px solid var(--stroke);
  background: #ffffff;
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.result-action:hover {
  transform: translateY(-1px);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.result-action.active {
  color: var(--accent);
  border-color: rgba(47, 127, 116, 0.35);
  background: rgba(47, 127, 116, 0.12);
}

.result-thumb {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.chat-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(246, 241, 234, 0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--stroke);
  display: flex;
  justify-content: center;
  padding: 12px 0;
  z-index: 50;
  box-shadow: 0 -12px 32px rgba(31, 28, 26, 0.12);
}

.chat-footer-inner {
  width: 100%;
  max-width: 1200px;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-bar {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  padding: 12px 14px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--stroke);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.input-bar:focus-within {
  border-color: rgba(47, 127, 116, 0.45);
  box-shadow: 0 0 0 3px rgba(47, 127, 116, 0.18), var(--shadow-soft);
  transform: translateY(-1px);
}

.input-bar input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 15px;
  color: var(--ink);
}

.send-btn {
  border: none;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 20px rgba(47, 127, 116, 0.3);
  position: relative;
  overflow: hidden;
}

.send-btn::after {
  content: "";
  position: absolute;
  top: -40%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  transform: translateX(-120%);
  transition: transform 0.45s ease;
}

.send-btn:hover::after {
  transform: translateX(220%);
}

.send-btn:hover {
  transform: translateY(-1px);
}

.send-btn:active {
  transform: translateY(1px);
}

.send-btn svg,
.clear-btn svg,
.icon-btn svg,
.icon-btn svg g,
.icon-btn svg path,
.clear-btn svg g,
.clear-btn svg path {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
  box-shadow: var(--shadow-soft);
}

.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.icon-btn.listening {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  border-color: transparent;
  animation: pulse 1.2s infinite;
}

.icon-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.clear-btn {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 13px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-soft);
}

.clear-btn:hover {
  border-color: rgba(47, 127, 116, 0.35);
  box-shadow: var(--shadow);
}

.clear-btn:active {
  transform: translateY(1px);
}

.attachment-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.attachment-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.attachment-remove {
  border: none;
  background: transparent;
  color: var(--accent-2);
  cursor: pointer;
  font-size: 12px;
}

.drop-zone {
  position: fixed;
  inset: 0;
  background: rgba(31, 28, 26, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 60;
}

.drop-zone.active {
  opacity: 1;
  pointer-events: all;
}

.drop-zone-card {
  background: rgba(255, 255, 255, 0.98);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  border: 1px dashed rgba(47, 127, 116, 0.35);
  box-shadow: var(--shadow);
  text-align: center;
  min-width: 220px;
}

.drop-zone-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}

.drop-zone-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 120px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--muted);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 70;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.favicon {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.ai-message {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 250, 0.98));
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 12px;
  font-size: 14px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-soft);
  animation: fadeUp 0.35s ease both;
  position: relative;
}

.ai-message.loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.loading-text {
  font-size: 12px;
  color: var(--muted);
}

.typing-dots {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  animation: dotBounce 1s infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

.ai-message::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(47, 127, 116, 0.45), rgba(215, 165, 119, 0.35));
}

.ai-message-question {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.ai-message-text {
  margin-bottom: 6px;
}

.ai-message-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.voice-btn,
.save-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.voice-btn:hover,
.save-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.voice-btn img,
.save-btn img {
  width: 18px;
  height: 18px;
}

.save-btn.saved {
  background: rgba(47, 127, 116, 0.12);
  box-shadow: 0 0 0 2px rgba(47, 127, 116, 0.35);
}

.save-btn.saved img {
  filter: hue-rotate(40deg) saturate(1.6);
}

.provider-error {
  margin-top: 10px;
  font-size: 12px;
  color: var(--accent-2);
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

@keyframes dotBounce {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 127, 116, 0.45);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(47, 127, 116, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(47, 127, 116, 0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@media (max-width: 1200px) {
  .page {
    padding: 22px;
    padding-bottom: 140px;
  }

  .app {
    gap: 16px;
  }
}

@media (max-width: 980px) {
  .app {
    flex-direction: column;
    min-height: calc(100vh - 190px);
  }

  .left-panel,
  .right-panel {
    height: auto;
    width: 100%;
    max-width: 100%;
  }

  .right-panel {
    order: 1;
  }

  .panel-pills {
    justify-content: flex-start;
  }

  .panel-actions {
    align-items: flex-start;
  }
}

@media (max-width: 680px) {
  .page {
    padding: 16px;
    padding-bottom: 150px;
  }

  .left-panel {
    padding: 18px;
    padding-top: 64px;
  }

  .right-panel {
    padding: 16px;
  }

  .corner-icon {
    top: 16px;
    right: 14px;
    width: 40px;
    height: 40px;
  }

  .search-pill {
    margin-right: 0;
    max-width: 100%;
  }

  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .panel-title {
    max-width: 100%;
    white-space: normal;
  }

  .panel-actions {
    align-items: flex-start;
  }

  .prompt-bar {
    margin-bottom: 10px;
  }

  .mode-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .mode-label {
    max-width: 100%;
  }

  .input-bar {
    gap: 6px;
    padding: 8px 10px;
  }

  .topic-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .input-bar input {
    font-size: 14px;
  }

  .icon-btn,
  .voice-btn,
  .save-btn {
    width: 30px;
    height: 30px;
  }

  .send-btn,
  .clear-btn {
    padding: 6px 10px;
  }

  .chat-footer {
    padding: 8px 0;
  }

  .toast {
    right: 16px;
    bottom: 150px;
  }
}

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