:root {
  color-scheme: light;
  --ink: #191f28;
  --muted: #6b7684;
  --soft: #8b95a1;
  --line: #e5e8eb;
  --paper: #ffffff;
  --surface: #f2f4f6;
  --green: #3182f6;
  --blue: #3182f6;
  --yellow: #fff6d6;
  --rose: #ffe8e4;
  --shadow: 0 8px 24px rgba(25, 31, 40, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: #e9edf2;
  color: var(--ink);
  font-family: Pretendard, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  word-break: keep-all;
}

body::before,
body::after {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 100;
  width: max(0px, calc((100vw - 430px) / 2));
  pointer-events: none;
  background: #e9edf2;
}

body::before {
  left: 0;
}

body::after {
  right: 0;
}

.topbar,
main,
.toast {
  width: min(100%, 430px);
  margin-right: auto;
  margin-left: auto;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(229, 232, 235, 0.82);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: white;
}

nav {
  display: none;
  gap: 22px;
}

nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  min-height: auto;
  padding: 64px clamp(20px, 5vw, 72px) 42px;
  background: var(--paper);
}

.hero-copy {
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.08;
  font-weight: 800;
}

.hero-text {
  max-width: 650px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.search-box {
  max-width: 680px;
  margin-top: 34px;
}

.search-box label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 52px;
  gap: 8px;
}

input[type="search"] {
  min-height: 56px;
  width: 100%;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  outline: 0;
  box-shadow: none;
  font-size: 17px;
}

input[type="search"]:focus {
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.16);
}

.input-row button,
.quick-tags button,
.filter-list button,
.card-actions a,
.card-actions button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 700;
}

.input-row button {
  background: var(--blue);
  color: white;
  font-size: 24px;
}

.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}

.quick-tags button,
.filter-list button {
  padding: 0 13px;
  border-color: transparent;
  background: var(--surface);
  color: #4e5968;
}

.hero-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-panel div {
  padding: 16px;
  border-radius: 8px;
  background: white;
}

.hero-panel span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.hero-panel strong {
  display: block;
  font-size: 20px;
  line-height: 1.35;
}

.category-hub {
  padding: 22px 14px 8px;
  background: #f9fafb;
}

.section-title {
  padding: 0 8px 12px;
}

.section-title h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
}

.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.category-card {
  position: relative;
  display: grid;
  min-height: 142px;
  gap: 7px;
  align-content: start;
  padding: 18px 16px 16px;
  border: 0;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  text-align: left;
}

.category-card.active {
  box-shadow: inset 0 0 0 2px rgba(49, 130, 246, 0.42);
}

.category-dot {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.category-dot.blue {
  background: #e8f3ff;
}

.category-dot.red {
  background: #ffe8e4;
}

.category-dot.purple {
  background: #f0eaff;
}

.category-dot.green {
  background: #e7f8ee;
}

.category-dot.cyan {
  background: #e5f9ff;
}

.category-dot.gray {
  background: #f2f4f6;
}

.category-card strong {
  margin-top: 4px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
}

.category-card > span:not(.category-dot) {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.category-card em {
  position: absolute;
  right: 14px;
  bottom: 13px;
  color: var(--blue);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.nav-concepts {
  padding: 20px 14px 8px;
  background: #f9fafb;
}

.concept-stack {
  display: grid;
  gap: 10px;
}

.concept-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 8px;
  background: white;
}

.concept-card strong {
  font-size: 16px;
  font-weight: 800;
}

.concept-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.concept-preview {
  margin-top: 4px;
}

.concept-floating {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  background: #f2f4f6;
}

.concept-floating span {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #4e5968;
  font-size: 13px;
  font-weight: 700;
}

.concept-floating span.on {
  background: white;
  color: var(--blue);
  box-shadow: 0 4px 12px rgba(25, 31, 40, 0.08);
}

.concept-tabbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 8px;
  border-radius: 8px;
  background: #f7f8fa;
}

.concept-tabbar span {
  display: grid;
  gap: 2px;
  place-items: center;
  color: var(--soft);
  font-size: 18px;
}

.concept-tabbar b {
  font-size: 11px;
}

.concept-tabbar span.on {
  color: var(--blue);
}

.concept-sheet {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  background: #f2f4f6;
}

.concept-sheet span {
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
}

.concept-sheet div {
  display: flex;
  gap: 8px;
}

.concept-sheet b {
  padding: 8px 10px;
  border-radius: 8px;
  background: white;
  color: #4e5968;
  font-size: 12px;
}

.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) minmax(300px, 380px);
  gap: 18px;
  padding: 48px clamp(18px, 4vw, 56px);
  background: var(--surface);
}

.filters,
.results-panel,
.detail-panel {
  min-width: 0;
  border: 0;
  border-radius: 8px;
  background: white;
  box-shadow: none;
}

.filters,
.detail-panel {
  align-self: start;
  position: sticky;
  top: 84px;
  padding: 18px;
}

.filters h2,
.detail-panel h2,
.results-head h2,
.strategy h2 {
  margin: 0;
}

.filter-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.filter-group + .filter-group {
  margin-top: 22px;
}

.filter-group h3 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.filter-list button {
  display: flex;
  justify-content: space-between;
  width: 100%;
  background: #f7f8fa;
  color: #4e5968;
}

.filter-list button.active {
  border-color: transparent;
  background: #e8f3ff;
  color: var(--blue);
}

.source-note {
  margin-top: 20px;
  padding: 14px;
  border-radius: 8px;
  background: #f7f8fa;
}

.source-note p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

#resultMeta {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.result-grid {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.resource-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 0;
  border-radius: 8px;
  background: white;
}

.resource-card.selected {
  box-shadow: inset 0 0 0 1px rgba(49, 130, 246, 0.26);
}

.card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.resource-card h3 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.32;
}

.resource-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 9px;
  border-radius: 8px;
  background: #f2f4f6;
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
}

.badge.hot {
  background: #e8f3ff;
  color: var(--blue);
}

.score {
  min-width: 44px;
  text-align: right;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-actions a,
.card-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  text-decoration: none;
}

.card-actions a {
  background: var(--blue);
  color: white;
}

.card-actions button {
  border-color: var(--line);
  background: #f2f4f6;
  color: #4e5968;
}

.inline-source {
  display: flex;
  gap: 6px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.5;
}

.inline-source strong {
  color: var(--ink);
}

.detail-body {
  display: grid;
  gap: 16px;
}

.detail-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 800;
}

.detail-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.detail-section {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.detail-section h3 {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 15px;
}

.detail-section ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  line-height: 1.55;
}

.related-list {
  display: grid;
  gap: 8px;
}

.related-card {
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
}

.related-card strong {
  color: var(--ink);
  font-size: 14px;
}

.related-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  font-weight: 700;
  text-decoration: none;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-actions button,
.detail-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
}

.detail-actions button {
  border: 1px solid var(--line);
  background: #f2f4f6;
  color: #4e5968;
}

.copy-fallback {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8df;
}

.copy-fallback p {
  margin: 0;
  color: #655315;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.5;
}

.copy-fallback textarea {
  width: 100%;
  min-height: 170px;
  resize: vertical;
  padding: 12px;
  border: 1px solid #ead99c;
  border-radius: 8px;
  color: var(--ink);
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.preview-modal[hidden] {
  display: none;
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 16, 0.42);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(780px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  overflow: auto;
  padding: 24px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 26px 90px rgba(12, 18, 16, 0.28);
}

.modal-close {
  position: sticky;
  top: 0;
  float: right;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.strategy {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
  padding: 50px clamp(18px, 4vw, 56px) 72px;
}

.strategy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.strategy article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.strategy span {
  color: var(--green);
  font-weight: 900;
}

.strategy h3 {
  margin: 14px 0 8px;
}

.strategy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-size: 14px;
  font-weight: 850;
  transition: opacity 180ms ease, transform 180ms ease;
}

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

body {
  background: #e9edf2;
}

main {
  background: #f9fafb;
}

.hero,
.app-shell,
.strategy {
  grid-template-columns: 1fr;
}

.hero {
  min-height: auto;
  padding: 30px 22px 18px;
  gap: 16px;
  background: var(--paper);
}

.hero-copy {
  max-width: none;
}

.hero .eyebrow {
  margin-bottom: 10px;
}

h1 {
  max-width: 330px;
  font-size: 32px;
  line-height: 1.16;
}

.hero-text {
  max-width: 300px;
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.55;
}

.search-box {
  position: sticky;
  top: 60px;
  z-index: 9;
  max-width: none;
  margin: 22px -22px 0;
  padding: 12px 22px;
  border-top: 1px solid rgba(229, 232, 235, 0.8);
  border-bottom: 1px solid rgba(229, 232, 235, 0.9);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
}

.search-box label {
  display: none;
}

.input-row {
  grid-template-columns: 1fr 48px;
  gap: 10px;
}

input[type="search"] {
  min-height: 50px;
  padding: 0 16px;
  box-shadow: none;
}

.quick-tags {
  flex-wrap: nowrap;
  margin: 12px -22px 0;
  padding: 0 22px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-tags::-webkit-scrollbar {
  display: none;
}

.quick-tags button {
  flex: 0 0 auto;
  min-height: 38px;
}

.hero-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.hero-panel div {
  padding: 14px;
  border: 0;
  background: white;
  box-shadow: 0 6px 18px rgba(25, 31, 40, 0.04);
}

.hero-panel span {
  margin-bottom: 7px;
  font-size: 12px;
}

.hero-panel strong {
  font-size: 16px;
  line-height: 1.3;
}

.app-shell {
  gap: 10px;
  padding: 6px 0 112px;
  background: #f9fafb;
}

.filters,
.results-panel,
.detail-panel {
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  box-shadow: none;
}

.filters {
  position: fixed;
  right: 0;
  bottom: 12px;
  left: 0;
  z-index: 30;
  width: min(calc(100% - 28px), 402px);
  margin: 0 auto;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 34px rgba(25, 31, 40, 0.16);
  backdrop-filter: blur(18px);
}

.filters > .eyebrow,
.filters > h2,
.source-note {
  display: none;
}

.filter-group {
  padding: 0;
}

.filter-group + .filter-group {
  display: none;
}

/* Final route-state overrides. Keep these last because earlier prototype blocks
   contain older mobile layouts. */
body:not(.search-mode) .category-hub,
body:not(.search-mode) .app-shell,
body:not(.search-mode) .strategy {
  display: none !important;
}

body.search-mode .home-feed {
  display: none !important;
}

body.search-mode .app-shell {
  display: grid !important;
  padding: 8px 0 108px !important;
  background: #f7f8fa;
}

body.search-mode .filters {
  position: static !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 1;
  width: auto !important;
  margin: 0 !important;
  padding: 10px 0 6px !important;
  border-radius: 0 !important;
  background: #f7f8fa !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

body.search-mode .category-hub,
body.search-mode .strategy {
  display: none !important;
}

body.modal-open .bottom-tabs {
  display: none !important;
}

.preview-modal {
  z-index: 90 !important;
}

.modal-card {
  padding-bottom: calc(22px + env(safe-area-inset-bottom)) !important;
}

.modal-card .detail-body {
  padding-bottom: 84px;
}

.modal-card .detail-actions {
  position: sticky;
  right: 0;
  bottom: calc(-22px - env(safe-area-inset-bottom));
  left: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 0.9fr 1fr;
  gap: 8px;
  margin: 4px -22px calc(-22px - env(safe-area-inset-bottom));
  padding: 12px 22px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid #edf0f3;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
}

.modal-card .detail-actions button,
.modal-card .detail-actions a {
  min-height: 48px;
  padding: 0 10px;
  font-size: 14px;
}

/* Final route-state overrides. Keep these last because earlier prototype blocks
   contain older mobile layouts. */
body:not(.search-mode) .category-hub,
body:not(.search-mode) .app-shell,
body:not(.search-mode) .strategy {
  display: none !important;
}

body.search-mode .home-feed {
  display: none !important;
}

body.search-mode .trend-screen,
body.trend-mode .hero,
body.trend-mode .home-feed,
body.trend-mode .category-hub,
body.trend-mode .app-shell,
body.trend-mode .strategy {
  display: none !important;
}

body.trend-mode .trend-screen {
  display: block !important;
}

body.search-mode .app-shell {
  display: grid !important;
}

body.search-mode .category-hub,
body.search-mode .strategy {
  display: none !important;
}

/* Final route-state overrides. Keep these at the end because earlier prototype
   blocks intentionally contain older mobile layouts. */
body:not(.search-mode) .category-hub,
body:not(.search-mode) .app-shell,
body:not(.search-mode) .strategy {
  display: none !important;
}

body.search-mode .home-feed {
  display: none !important;
}

body.search-mode .app-shell {
  display: grid !important;
}

body.search-mode .category-hub,
body.search-mode .strategy {
  display: none !important;
}

/* Home dashboard + focused search screen */
.home-feed {
  display: grid;
  gap: 18px;
  padding: 0 22px 110px;
  background: #f7f8fa;
}

.feed-section {
  padding-top: 2px;
}

.feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  margin-bottom: 6px;
}

.feed-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 850;
  line-height: 1.35;
}

.feed-head button {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6b7684;
  font-size: 13px;
  font-weight: 750;
}

.feed-list {
  display: grid;
  overflow: hidden;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(25, 31, 40, 0.04);
}

.feed-list button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  min-height: 62px;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid #f2f4f6;
  background: #ffffff;
  color: #191f28;
  text-align: left;
}

.feed-list button:last-child {
  border-bottom: 0;
}

.feed-list span {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.feed-list strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-list em {
  color: #8b95a1;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.feed-list i {
  color: #b0b8c1;
  font-size: 22px;
  font-style: normal;
  line-height: 1;
  text-align: right;
}

.question-section .feed-list strong {
  white-space: normal;
}

.category-hub,
.app-shell,
.strategy {
  display: none;
}

body.search-mode .home-feed {
  display: none;
}

body.search-mode .app-shell {
  display: grid;
}

body.search-mode .hero {
  padding-bottom: 10px;
}

body.search-mode .clinical-card,
body.search-mode .home-shortcuts,
body.search-mode .resource-pill {
  display: none;
}

body.search-mode .quick-tags {
  margin-bottom: 2px;
}

body.search-mode .filters {
  margin-top: 0;
}

body.search-mode .resource-card {
  gap: 9px;
  padding: 15px 16px 13px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(25, 31, 40, 0.035);
  cursor: pointer;
}

body.search-mode .resource-card h3 {
  font-size: 18px;
  line-height: 1.34;
}

body.search-mode .resource-card p {
  margin-top: 5px;
  font-size: 14px;
  line-height: 1.48;
  -webkit-line-clamp: 2;
}

body.search-mode .badge {
  min-height: 23px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 11px;
}

body.search-mode .score {
  display: none;
}

body.search-mode .inline-source {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  background: transparent;
  color: #8b95a1;
}

body.search-mode .inline-source span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.search-mode .inline-source a {
  flex: 0 0 auto;
  color: #3182f6;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

body.search-mode .card-actions {
  display: none;
}

body.search-mode .card-actions a,
body.search-mode .card-actions button {
  min-height: 38px;
  border-radius: 8px;
  font-size: 13px;
}

/* B concept: app-style bottom tab bar with category chips inside search results. */
main {
  padding-bottom: 92px;
}

.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 10px 0 108px;
  background: #f7f8fa;
}

.filters {
  position: static !important;
  top: auto !important;
  right: auto;
  bottom: auto;
  left: auto;
  z-index: 1;
  width: auto;
  margin: 0;
  padding: 12px 0 8px;
  border-radius: 0;
  background: #f7f8fa;
  box-shadow: none;
  backdrop-filter: none;
}

.filters > .eyebrow,
.filters > h2,
.source-note,
.filter-group h3,
.filter-group + .filter-group {
  display: none;
}

.filter-group {
  padding: 0;
}

.filters .filter-list {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0 18px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filters .filter-list::-webkit-scrollbar {
  display: none;
}

.filters .filter-list button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 38px;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #ffffff;
  color: #4e5968;
  box-shadow: 0 4px 12px rgba(25, 31, 40, 0.04);
  white-space: nowrap;
}

.filters .filter-list button.active {
  border-color: rgba(49, 130, 246, 0.18);
  background: #e8f3ff;
  color: #1b64da;
  box-shadow: none;
}

.filter-icon {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: #8b95a1;
}

.filter-icon.all {
  background: #3182f6;
}

.filter-icon.heart {
  background: #ff6b6b;
}

.filter-icon.brain {
  background: #8b5cf6;
}

.filter-icon.lab {
  background: #12b886;
}

.filter-icon.lung {
  background: #22b8cf;
}

.filter-icon.care {
  background: #adb5bd;
}

.filters .filter-list button span {
  font-size: 13px;
  font-weight: 800;
}

.filters .filter-list button em {
  color: inherit;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  opacity: 0.72;
}

.bottom-tabs {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(100%, 430px);
  min-height: 72px;
  margin: 0 auto;
  padding: 8px 12px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(229, 232, 235, 0.92);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -10px 28px rgba(25, 31, 40, 0.08);
  backdrop-filter: blur(18px);
}

.bottom-tab {
  display: grid;
  place-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 54px;
  padding: 4px 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6b7684;
  font-size: 11px;
  font-weight: 750;
}

.bottom-tab svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-tab.active {
  color: #3182f6;
}

.bottom-tab.active svg {
  fill: rgba(49, 130, 246, 0.12);
}

.bottom-tab:active {
  background: #f2f4f6;
}

.toast {
  bottom: 84px;
  z-index: 50;
}

/* Calm first screen inspired by the provided app mockup. */
.hero {
  display: block;
  padding: 26px 22px 18px;
  background: #ffffff;
}

.hero-copy {
  max-width: none;
}

.hero .eyebrow {
  margin: 18px 0 8px;
  color: #4e5968;
  font-size: 15px;
  font-weight: 750;
}

.hero h1 {
  max-width: 300px;
  font-size: 25px;
  line-height: 1.35;
  font-weight: 850;
}

.hero-text {
  max-width: 320px;
  margin-top: 10px;
  color: #6b7684;
  font-size: 14px;
  line-height: 1.55;
}

.search-box {
  position: static;
  z-index: auto;
  margin: 20px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

.input-row {
  grid-template-columns: 1fr 52px;
  gap: 0;
  overflow: hidden;
  border: 1px solid #e5e8eb;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(25, 31, 40, 0.04);
}

input[type="search"] {
  min-height: 52px;
  border-radius: 0;
  background: transparent;
  font-size: 14px;
}

.input-row button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: 0;
  font-size: 0;
}

.input-row button::before {
  content: "";
  width: 19px;
  height: 19px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.input-row button::after {
  content: "";
  width: 8px;
  height: 2px;
  margin-left: -4px;
  margin-top: 13px;
  border-radius: 99px;
  background: currentColor;
  transform: rotate(45deg);
}

.clinical-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 8px;
  min-height: 158px;
  margin-top: 22px;
  overflow: hidden;
  padding: 18px 12px 28px 18px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%);
  box-shadow: 0 10px 28px rgba(25, 31, 40, 0.07);
}

.clinical-card.notice-update {
  background: linear-gradient(135deg, #ffffff 0%, #edf8ff 100%);
}

.clinical-card.notice-recommend {
  background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%);
}

.clinical-card.notice-trend {
  background: linear-gradient(135deg, #ffffff 0%, #f6fbf4 100%);
}

.clinical-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.clinical-copy p {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  color: #191f28;
  font-size: 12px;
  font-weight: 850;
}

.clinical-copy p strong {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 0 6px;
  border-radius: 8px;
  background: #ff5c5c;
  color: #ffffff;
  font-size: 10px;
  font-weight: 850;
}

.clinical-card h2 {
  max-width: 210px;
  margin: 0;
  font-size: 16px;
  line-height: 1.42;
  font-weight: 850;
}

.notice-description {
  display: -webkit-box;
  max-width: 210px;
  margin-top: 7px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #6b7684;
  font-size: 12px;
  line-height: 1.45;
}

.clinical-card button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(49, 130, 246, 0.22);
  border-radius: 8px;
  background: #ffffff;
  color: #1b64da;
  font-size: 13px;
  font-weight: 850;
}

.notice-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
}

.notice-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: #6b7684;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.notice-actions a::after {
  content: "›";
  margin-left: 3px;
  color: #8b95a1;
}

.clinical-card img {
  position: absolute;
  right: -8px;
  bottom: -10px;
  width: 126px;
  height: 142px;
  object-fit: cover;
  object-position: 50% 18%;
  border-radius: 0;
  mix-blend-mode: normal;
}

.clinical-card.notice-update img,
.clinical-card.notice-trend img {
  right: 6px;
  bottom: 14px;
  width: 92px;
  height: 92px;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(25, 31, 40, 0.12);
}

.notice-dots {
  position: absolute;
  right: 18px;
  bottom: 14px;
  left: 18px;
  z-index: 2;
  display: flex;
  gap: 5px;
  align-items: center;
}

.notice-dots button {
  width: 6px;
  min-height: 6px;
  height: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #d1d6db;
}

.notice-dots button.active {
  width: 18px;
  background: #3182f6;
}

.quick-tags {
  flex-wrap: nowrap;
  gap: 8px;
  margin: 14px -22px 0;
  padding: 0 22px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-tags button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: #f2f4f6;
  color: #4e5968;
  font-size: 13px;
}

.home-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.home-shortcuts button {
  display: grid;
  min-width: 0;
  min-height: 82px;
  gap: 8px;
  place-items: center;
  padding: 11px 6px 10px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #ffffff;
  color: #191f28;
  box-shadow: 0 6px 18px rgba(25, 31, 40, 0.04);
}

.shortcut-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 850;
}

.shortcut-icon.exam {
  background: #f59f00;
}

.shortcut-icon.practice {
  background: #3182f6;
}

.shortcut-icon.guide {
  background: #4dabf7;
}

.shortcut-icon.sim {
  background: #4263eb;
}

.home-shortcuts strong {
  max-width: 62px;
  color: #333d4b;
  font-size: 11px;
  line-height: 1.28;
  text-align: center;
}

.resource-pill {
  margin: 13px 0 0;
  color: #8b95a1;
  font-size: 12px;
  font-weight: 750;
  text-align: right;
}

.resource-pill span {
  color: #3182f6;
}

.category-hub {
  padding-top: 18px;
}

.filter-group h3 {
  display: none;
}

.filter-list {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-list::-webkit-scrollbar {
  display: none;
}

.filter-list button {
  flex: 0 0 auto;
  width: auto;
  min-height: 38px;
  gap: 8px;
  padding: 0 13px;
  border-radius: 8px;
  background: transparent;
  white-space: nowrap;
}

.filter-list button.active {
  background: #e8f3ff;
  box-shadow: none;
}

.results-panel {
  border: 0;
  background: transparent;
}

.results-head {
  padding: 18px 22px 12px;
  border: 0;
}

.results-head .eyebrow {
  display: none;
}

.results-head h2 {
  font-size: 22px;
  font-weight: 800;
}

.result-grid {
  gap: 12px;
  padding: 0 14px;
}

.resource-card {
  gap: 13px;
  padding: 20px;
  border-radius: 8px;
  box-shadow: none;
}

.resource-card h3 {
  font-size: 21px;
}

.resource-card p {
  display: -webkit-box;
  margin-top: 7px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.55;
}

.resource-card .badge-row {
  gap: 6px;
}

.inline-source {
  gap: 4px;
  padding: 10px;
  font-size: 12px;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.card-actions a,
.card-actions button {
  min-height: 46px;
  padding: 0 10px;
  font-size: 15px;
}

.detail-panel {
  display: none;
}

.strategy {
  padding: 30px 22px 42px;
}

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

.preview-modal {
  align-items: end;
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 0;
}

.modal-card {
  align-self: end;
  width: 100%;
  max-height: calc(100vh - 70px);
  padding: 22px;
  border-radius: 14px 14px 0 0;
}

.modal-close {
  top: 0;
  width: 42px;
  height: 42px;
}

.detail-title {
  font-size: 25px;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .detail-panel {
    position: static;
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  body {
    background: #f9fafb;
  }

  .hero,
  .app-shell,
  .strategy {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding: 30px 22px 18px;
    gap: 16px;
    background: var(--paper);
  }

  .hero-copy {
    max-width: none;
  }

  .hero .eyebrow {
    margin-bottom: 10px;
  }

  h1 {
    max-width: 330px;
    font-size: 32px;
    line-height: 1.16;
  }

  .hero-text {
    max-width: 300px;
    margin-top: 14px;
    font-size: 16px;
    line-height: 1.55;
  }

  .search-box {
    position: sticky;
    top: 64px;
    z-index: 9;
    max-width: none;
    margin: 22px -22px 0;
    padding: 12px 22px;
    border-top: 1px solid rgba(229, 232, 235, 0.8);
    border-bottom: 1px solid rgba(229, 232, 235, 0.9);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
  }

  .search-box label {
    display: none;
  }

  .input-row {
    grid-template-columns: 1fr 48px;
    gap: 10px;
  }

  input[type="search"] {
    min-height: 50px;
    padding: 0 16px;
    box-shadow: none;
  }

  .quick-tags {
    flex-wrap: nowrap;
    margin: 12px -22px 0;
    padding: 0 22px 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .quick-tags::-webkit-scrollbar {
    display: none;
  }

  .quick-tags button {
    flex: 0 0 auto;
    min-height: 38px;
  }

  .hero-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .hero-panel div {
    padding: 14px;
    border: 0;
    background: white;
    box-shadow: 0 6px 18px rgba(25, 31, 40, 0.04);
  }

  .hero-panel span {
    margin-bottom: 7px;
    font-size: 12px;
  }

  .hero-panel strong {
    font-size: 16px;
    line-height: 1.3;
  }

  .app-shell {
    gap: 10px;
    padding: 10px 0 38px;
    background: #f9fafb;
  }

  .filters {
    position: sticky;
    top: 148px;
    z-index: 8;
    padding: 12px 0 10px;
    border: 0;
    background: rgba(249, 250, 251, 0.96);
    backdrop-filter: blur(14px);
  }

  .filters > .eyebrow,
  .filters > h2,
  .source-note {
    display: none;
  }

  .filter-group {
    padding: 0 0 0 22px;
  }

  .filter-group + .filter-group {
    margin-top: 10px;
  }

  .filter-group h3 {
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--soft);
  }

  .filter-list {
    display: flex;
    gap: 8px;
    margin: 0;
    padding-right: 22px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .filter-list::-webkit-scrollbar {
    display: none;
  }

  .filter-list button {
    flex: 0 0 auto;
    width: auto;
    min-height: 34px;
    gap: 8px;
    padding: 0 13px;
    white-space: nowrap;
  }

  .results-panel {
    background: transparent;
    border: 0;
  }

  .results-head {
    padding: 18px 22px 12px;
    border: 0;
  }

  .results-head .eyebrow {
    display: none;
  }

  .results-head h2 {
    font-size: 22px;
    font-weight: 800;
  }

  .result-grid {
    gap: 12px;
    padding: 0 14px;
  }

  .resource-card {
    gap: 13px;
    padding: 20px;
    border-radius: 8px;
    box-shadow: none;
  }

  .resource-card h3 {
    font-size: 21px;
  }

  .resource-card p {
    display: -webkit-box;
    margin-top: 7px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.55;
  }

  .resource-card .badge-row {
    gap: 6px;
  }

  .inline-source {
    gap: 4px;
    padding: 10px;
    font-size: 12px;
  }

  .card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .card-actions a,
  .card-actions button {
    min-height: 46px;
    padding: 0 10px;
    font-size: 15px;
  }

  .detail-panel {
    display: none;
  }

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

  .strategy {
    padding: 30px 22px 42px;
  }

  .modal-card {
    align-self: end;
    width: 100%;
    max-height: calc(100vh - 70px);
    padding: 22px;
    border-radius: 14px 14px 0 0;
  }

  .preview-modal {
    align-items: end;
    padding: 0;
  }

  .modal-close {
    top: 0;
    width: 42px;
    height: 42px;
  }

  .detail-title {
    font-size: 25px;
  }
}

@media (max-width: 620px) {
  .topbar {
    min-height: 56px;
    padding: 0 16px;
  }

  nav {
    display: none;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .brand {
    font-size: 15px;
  }

  .search-box {
    top: 56px;
  }

  .filters {
    top: auto;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .hero-panel div:nth-child(1),
  .hero-panel div:nth-child(3) {
    display: none;
  }

  .results-head,
  .card-top {
    align-items: stretch;
    flex-direction: column;
  }

  .score {
    text-align: left;
  }
}

.app-shell {
  padding-bottom: 112px;
}

.filters {
  position: fixed;
  right: 0;
  bottom: 12px;
  left: 0;
  top: auto;
  z-index: 30;
  width: min(calc(100% - 28px), 402px);
  margin: 0 auto;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 34px rgba(25, 31, 40, 0.16);
  backdrop-filter: blur(18px);
}

.filter-group + .filter-group {
  display: none;
}

/* Final route-state overrides. Keep these last because earlier prototype blocks
   contain older mobile layouts. */
body:not(.search-mode) .category-hub,
body:not(.search-mode) .app-shell,
body:not(.search-mode) .strategy {
  display: none !important;
}

body.search-mode .home-feed {
  display: none !important;
}

body.search-mode .app-shell {
  display: grid !important;
}

body.search-mode .category-hub,
body.search-mode .strategy {
  display: none !important;
}

body.search-mode .save-button {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: #f2f4f6;
  color: #8b95a1;
  font-size: 19px;
  font-weight: 900;
}

body.search-mode .resource-card {
  grid-template-columns: 66px minmax(0, 1fr);
  align-items: start;
  column-gap: 12px;
}

body.search-mode .resource-card .resource-visual.thumb {
  grid-row: 1 / span 2;
}

body.search-mode .resource-card .card-top,
body.search-mode .resource-card .inline-source {
  grid-column: 2;
}

body.search-mode .card-top {
  flex-direction: row !important;
  align-items: flex-start !important;
}

body.search-mode .card-top > div {
  min-width: 0;
}

body.search-mode .save-button.saved {
  background: #e8f3ff;
  color: #3182f6;
}

body.search-mode .empty-card {
  cursor: default;
}

.modal-card .detail-actions {
  grid-template-columns: 1fr 1fr !important;
}

.modal-card .detail-actions .detail-link {
  grid-column: 1 / -1;
}

.resource-visual {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  isolation: isolate;
}

.resource-visual::before {
  content: "";
  position: absolute;
  inset: auto -18% -35% 18%;
  height: 72%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.44);
  transform: rotate(-12deg);
}

.resource-visual.has-image {
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(229, 232, 235, 0.8);
}

.resource-visual.has-image::before,
.resource-visual.has-image i {
  display: none;
}

.resource-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.resource-visual span {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: #191f28;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(25, 31, 40, 0.08);
}

.resource-visual i {
  position: absolute;
  right: 9px;
  bottom: 8px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
}

.resource-visual.thumb {
  width: 66px;
  height: 66px;
}

.resource-visual.visual-hero {
  height: 148px;
  margin-bottom: 2px;
}

.resource-visual.visual-hero span {
  min-width: 58px;
  height: 58px;
  font-size: 16px;
}

.resource-visual.visual-hero i {
  right: 20px;
  bottom: 18px;
  width: 34px;
  height: 34px;
}

.resource-visual.cardio {
  background: linear-gradient(135deg, #ffe8e4, #fff5f5);
}

.resource-visual.neuro {
  background: linear-gradient(135deg, #efe7ff, #f7f2ff);
}

.resource-visual.lab {
  background: linear-gradient(135deg, #e7f8ee, #f0fff7);
}

.resource-visual.resp {
  background: linear-gradient(135deg, #e5f9ff, #f2fcff);
}

.resource-visual.surgery,
.resource-visual.default {
  background: linear-gradient(135deg, #edf2ff, #f8f9fa);
}

.feed-caption {
  margin: -2px 0 10px;
  color: #8b95a1;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.question-list {
  display: grid;
  gap: 10px;
}

.question-card button {
  display: grid;
  width: 100%;
  gap: 8px;
  padding: 15px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #ffffff;
  color: #191f28;
  text-align: left;
  box-shadow: 0 6px 18px rgba(25, 31, 40, 0.04);
}

.question-kicker {
  color: #3182f6;
  font-size: 12px;
  font-weight: 850;
}

.question-card strong {
  font-size: 15px;
  font-weight: 850;
  line-height: 1.4;
}

.question-answer {
  color: #4e5968;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
}

.question-source {
  color: #8b95a1;
  font-size: 12px;
  font-weight: 800;
}

.question-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.question-tags em {
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #f2f4f6;
  color: #6b7684;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.trend-screen {
  display: none;
  min-height: calc(100vh - 72px);
  padding: 34px 22px 112px;
  background: #f7f8fa;
}

.trend-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.trend-top h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.28;
  font-weight: 850;
}

.trend-top p {
  margin: 8px 0 0;
  color: #6b7684;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.trend-top button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  color: #191f28;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 6px 18px rgba(25, 31, 40, 0.04);
}

.trend-feature > .eyebrow {
  margin-bottom: 14px;
  color: #191f28;
  font-size: 16px;
}

.trend-list {
  display: grid;
  gap: 14px;
}

.trend-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 20px 16px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(25, 31, 40, 0.045);
}

.trend-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  object-position: center;
  overflow: hidden;
  border-radius: 8px;
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px rgba(229, 232, 235, 0.82);
}

.trend-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6b7684;
  font-size: 12px;
  font-weight: 800;
}

.trend-card-meta em {
  font-style: normal;
}

.trend-card-meta strong {
  margin-left: auto;
  min-width: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e8f3ff;
  color: #3182f6;
  font-size: 13px;
  font-weight: 900;
}

.trend-card h2 {
  margin: 0;
  max-width: 300px;
  color: #191f28;
  font-size: 20px;
  line-height: 1.35;
  font-weight: 850;
}

.trend-card p {
  margin: 0;
  color: #4e5968;
  font-size: 13px;
  line-height: 1.55;
}

.content-stats {
  color: #8b95a1;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.trend-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.trend-tags span {
  min-height: 28px;
  padding: 6px 9px;
  border-radius: 8px;
  background: #f2f4f6;
  color: #4e5968;
  font-size: 12px;
  font-weight: 800;
}

.trend-card > button {
  justify-self: end;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(49, 130, 246, 0.3);
  border-radius: 8px;
  background: #ffffff;
  color: #1b64da;
  font-size: 13px;
  font-weight: 850;
}

.trend-detail,
.trend-comments {
  display: grid;
  gap: 18px;
  padding-bottom: 8px;
}

.trend-detail-top p {
  margin: 0 0 10px;
  color: #6b7684;
  font-size: 13px;
  font-weight: 800;
}

.trend-detail-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  margin-bottom: 16px;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px rgba(229, 232, 235, 0.82);
}

.trend-detail-top h2,
.trend-comments h2 {
  margin: 0;
  color: #191f28;
  font-size: 25px;
  line-height: 1.32;
  font-weight: 900;
}

.trend-summary-box {
  padding: 18px;
  border: 1px solid #d7e8ff;
  border-radius: 8px;
  background: #f1f7ff;
}

.trend-summary-box h3,
.trend-insight h3,
.trend-related h3 {
  margin: 0 0 9px;
  color: #191f28;
  font-size: 15px;
  font-weight: 900;
}

.trend-summary-box ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: #334155;
  font-size: 13px;
  line-height: 1.55;
}

.trend-insight {
  display: grid;
  gap: 4px;
}

.trend-insight p {
  margin: 0;
  color: #4e5968;
  font-size: 14px;
  line-height: 1.65;
}

.trend-related > div {
  display: grid;
  gap: 9px;
}

.trend-related-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}

.trend-related-card .resource-visual.thumb {
  width: 48px;
  height: 48px;
}

.trend-related-card span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.trend-related-card strong {
  overflow: hidden;
  color: #191f28;
  font-size: 14px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-related-card em {
  color: #6b7684;
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.trend-related-card i {
  color: #b0b8c1;
  font-size: 22px;
  font-style: normal;
}

.trend-detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  position: sticky;
  bottom: 0;
  padding-top: 8px;
  background: #ffffff;
}

.trend-detail-actions a,
.trend-detail-actions button {
  display: grid;
  min-height: 48px;
  place-items: center;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.trend-detail-actions a {
  border: 1px solid #3182f6;
  background: #ffffff;
  color: #1b64da;
}

.trend-detail-actions button {
  border: 0;
  background: #3182f6;
  color: #ffffff;
}

.khshim-notice {
  display: grid;
  gap: 18px;
  padding: 6px 0 0;
}

.khshim-notice h2 {
  margin: 0;
  color: #191f28;
  font-size: clamp(24px, 7vw, 32px);
  line-height: 1.18;
  letter-spacing: 0;
}

.khshim-lead {
  margin: 0;
  color: #4e5968;
  font-size: 15px;
  line-height: 1.65;
}

.khshim-device-list {
  display: grid;
  gap: 10px;
}

.khshim-device-list div {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 2px 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #f9fafb;
}

.khshim-device-list span {
  grid-row: span 2;
  display: grid;
  min-height: 46px;
  place-items: center;
  border-radius: 8px;
  background: #e8f3ff;
  color: #1b64da;
  font-size: 12px;
  font-weight: 900;
}

.khshim-device-list strong {
  color: #191f28;
  font-size: 15px;
}

.khshim-device-list p {
  margin: 0;
  color: #6b7684;
  font-size: 13px;
  line-height: 1.45;
}

.khshim-actions {
  display: grid;
  grid-template-columns: 0.85fr 1fr;
  gap: 10px;
  position: sticky;
  bottom: 0;
  margin: 2px -24px -24px;
  padding: 12px 24px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid #edf0f3;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
}

.khshim-actions a,
.khshim-actions button {
  display: grid;
  min-height: 50px;
  place-items: center;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.khshim-actions button {
  border: 0;
  background: #f2f4f6;
  color: #4e5968;
}

.khshim-actions a {
  background: #3182f6;
  color: #ffffff;
}

.comment-guide {
  padding: 14px;
  border-radius: 8px;
  background: #f1f7ff;
  color: #4e5968;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.comment-status {
  padding: 12px 14px;
  border-radius: 8px;
  background: #f7f8fa;
  color: #6b7684;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.comment-list {
  display: grid;
  gap: 14px;
}

.comment-card {
  display: grid;
  gap: 9px;
  padding-bottom: 14px;
  border-bottom: 1px solid #edf0f3;
}

.comment-card div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.comment-card strong {
  color: #191f28;
  font-size: 13px;
  font-weight: 850;
}

.comment-card span {
  color: #8b95a1;
  font-size: 12px;
  font-weight: 700;
}

.comment-card p {
  margin: 0;
  color: #333d4b;
  font-size: 14px;
  line-height: 1.65;
}

.comment-card button {
  justify-self: start;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: #f1f7ff;
  color: #1b64da;
  font-size: 12px;
  font-weight: 850;
}

.comment-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e5e8eb;
  border-radius: 8px;
}

.comment-input textarea {
  min-height: 50px;
  resize: none;
  border: 0;
  color: #191f28;
  font: inherit;
  outline: 0;
}

.comment-input button {
  align-self: end;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: #e8f3ff;
  color: #1b64da;
  font-size: 13px;
  font-weight: 850;
}

.search-screen-head {
  position: sticky;
  top: 0;
  z-index: 12;
  display: grid;
  gap: 10px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid rgba(229, 232, 235, 0.86);
  background: rgba(247, 248, 250, 0.96);
  backdrop-filter: blur(16px);
}

.search-nav-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
}

.search-back,
.filter-action,
.search-query-pill button {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4e5968;
  font-weight: 900;
}

.search-back,
.filter-action {
  width: 36px;
  height: 36px;
  font-size: 28px;
}

.filter-action {
  position: relative;
  font-size: 0;
}

.filter-action::before {
  content: "";
  width: 17px;
  height: 13px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.filter-action::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
}

.search-query-pill {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  min-height: 42px;
  overflow: hidden;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #edf0f3;
}

.search-query-pill input {
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: #191f28;
  font-size: 15px;
  font-weight: 700;
}

.search-query-pill input::-webkit-search-cancel-button,
.search-query-pill input::-webkit-search-decoration {
  display: none;
}

.search-query-pill button {
  width: 30px;
  height: 30px;
  color: #8b95a1;
  font-size: 17px;
}

.sort-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 4px;
  border: 1px solid #e5e8eb;
  border-radius: 8px;
  background: #f2f4f6;
}

.sort-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4e5968;
  font-size: 13px;
  font-weight: 850;
}

.sort-tabs button.active {
  background: #ffffff;
  color: #1b64da;
  box-shadow: 0 3px 10px rgba(25, 31, 40, 0.08);
}

body.search-mode .hero {
  display: none !important;
}

body.search-mode .topbar {
  display: none !important;
}

body.search-mode .app-shell {
  padding-top: 0 !important;
}

body.search-mode .results-head {
  padding-top: 16px !important;
}

body.admin-mode .topbar,
body.admin-mode main,
body.admin-mode .bottom-tabs {
  display: none !important;
}

.analytics-admin {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 16px 34px;
  background: #f7f8fa;
}

.analytics-admin[hidden] {
  display: none;
}

.admin-top {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 14px 0 12px;
  background: rgba(247, 248, 250, 0.96);
  backdrop-filter: blur(16px);
}

.admin-top button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  color: #4e5968;
  font-size: 28px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px #edf0f3;
}

.admin-top .eyebrow {
  margin-bottom: 2px;
}

.admin-top h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 14px;
}

.admin-summary article,
.admin-card {
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(25, 31, 40, 0.04);
}

.admin-summary article {
  display: grid;
  gap: 5px;
  min-height: 86px;
  padding: 16px;
}

.admin-summary strong {
  color: #191f28;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.admin-summary span {
  color: #6b7684;
  font-size: 12px;
  font-weight: 800;
}

.admin-card {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 16px;
}

.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-card h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
}

.admin-card-head span,
.admin-empty,
.admin-note {
  color: #8b95a1;
  font-size: 12px;
  font-weight: 750;
}

.admin-rank-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-rank-list li,
.admin-event-list article {
  display: grid;
  align-items: center;
  min-height: 38px;
  border-radius: 8px;
  background: #f7f8fa;
}

.admin-rank-list li {
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 10px;
  padding: 9px 11px;
}

.admin-rank-list span {
  overflow: hidden;
  color: #333d4b;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-rank-list strong {
  display: grid;
  min-width: 28px;
  height: 26px;
  place-items: center;
  border-radius: 8px;
  background: #e8f3ff;
  color: #1b64da;
  font-size: 12px;
  font-weight: 900;
}

.admin-event-list {
  display: grid;
  gap: 8px;
}

.admin-event-list article {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr) auto;
  gap: 8px;
  padding: 9px 10px;
}

.admin-event-list strong,
.admin-event-list span,
.admin-event-list time {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-event-list strong {
  color: #191f28;
  font-size: 12px;
  font-weight: 900;
}

.admin-event-list span,
.admin-event-list time {
  color: #6b7684;
  font-size: 11px;
  font-weight: 750;
}

.admin-resource-guide {
  display: grid;
  gap: 8px;
}

.admin-resource-guide article {
  display: grid;
  gap: 4px;
  padding: 11px;
  border-radius: 8px;
  background: #f7f8fa;
}

.admin-resource-guide strong {
  color: #191f28;
  font-size: 13px;
  font-weight: 900;
}

.admin-resource-guide span {
  color: #6b7684;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
  word-break: break-all;
}

.admin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 14px;
}

.admin-actions button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: #191f28;
  color: #ffffff;
  font-size: 13px;
  font-weight: 850;
}

.admin-actions button + button {
  background: #f2f4f6;
  color: #4e5968;
}

.admin-note {
  margin: 12px 2px 0;
  line-height: 1.5;
}

.supabase-form {
  display: grid;
  gap: 10px;
}

.supabase-form label {
  display: grid;
  gap: 6px;
}

.supabase-form label span {
  color: #6b7684;
  font-size: 12px;
  font-weight: 850;
}

.supabase-form input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: #f2f4f6;
  color: #191f28;
  outline: 0;
  font-size: 13px;
  font-weight: 750;
}

.supabase-form input:focus {
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.16);
}

.supabase-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.supabase-actions button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: #3182f6;
  color: #ffffff;
  font-size: 13px;
  font-weight: 850;
}

.supabase-actions button + button {
  background: #e8f3ff;
  color: #1b64da;
}

/* Admin operating dashboard */
.admin-hero {
  display: grid;
  gap: 7px;
  margin: 8px 0 14px;
  padding: 18px 16px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(25, 31, 40, 0.04);
}

.admin-hero h2 {
  margin: 0;
  color: #191f28;
  font-size: 23px;
  line-height: 1.25;
  font-weight: 900;
}

.admin-hero p:last-child {
  margin: 0;
  color: #6b7684;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.5;
}

.admin-toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.admin-period-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid #e5e8eb;
  border-radius: 8px;
  background: #f2f4f6;
}

.admin-period-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4e5968;
  font-size: 13px;
  font-weight: 850;
}

.admin-period-tabs button.active {
  background: #ffffff;
  color: #1b64da;
  box-shadow: 0 3px 10px rgba(25, 31, 40, 0.08);
}

.admin-toolbar input {
  min-height: 44px;
  width: 100%;
  padding: 0 14px;
  border: 1px solid #e5e8eb;
  border-radius: 8px;
  background: #ffffff;
  color: #191f28;
  font-size: 14px;
  font-weight: 750;
  outline: 0;
}

.admin-status {
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: #e8f3ff;
  color: #1b64da;
  font-size: 13px;
  font-weight: 800;
}

.admin-status.error {
  background: #fff0ee;
  color: #e03131;
}

.dashboard-kpis {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-card-head button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #d7e8ff;
  border-radius: 8px;
  background: #ffffff;
  color: #1b64da;
  font-size: 12px;
  font-weight: 850;
}

.admin-insights,
.gap-list {
  display: grid;
  gap: 8px;
}

.admin-insights article,
.gap-list article {
  padding: 12px;
  border-radius: 8px;
  background: #f7f8fa;
  color: #333d4b;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.gap-list article {
  display: grid;
  gap: 5px;
  background: #fff7ed;
}

.gap-list strong {
  color: #191f28;
  font-size: 14px;
  font-weight: 900;
}

.gap-list span {
  color: #7c5d35;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.admin-bar-chart {
  display: grid;
  gap: 9px;
}

.bar-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
}

.bar-row span {
  overflow: hidden;
  color: #4e5968;
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-row div {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #f2f4f6;
}

.bar-row i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #3182f6;
}

.bar-row strong {
  color: #191f28;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.admin-line-chart {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: #f7f8fa;
}

.admin-line-chart svg {
  width: 100%;
  height: 96px;
}

.admin-line-chart div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-line-chart span,
.admin-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 8px;
  background: #f2f4f6;
  color: #6b7684;
  font-size: 11px;
  font-weight: 850;
}

.admin-badge.danger {
  background: #fff0ee;
  color: #e03131;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #edf0f3;
  border-radius: 8px;
}

.admin-table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  background: #ffffff;
}

.admin-table th,
.admin-table td {
  padding: 10px 9px;
  border-bottom: 1px solid #edf0f3;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
}

.admin-table th {
  color: #8b95a1;
  font-weight: 900;
}

.admin-table td {
  color: #333d4b;
  font-weight: 750;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}
